QCirS is a quantum circuit simulator.
To build QCirS, followings are required:
- C++ compiler with C++14 capabilities
- g++ 6.4 is recomended.
- Boost C++ Libraries version 1.66 or greater
- to construct parser using boost::spirit::qi
- CMake 2.8 or greater
$ git clone https://github.com/sndtkrh/qcirs.git
$ cd qcirs
$ mkdir build
$ cd ./build
$ cmake ..
$ make && make install
To use quantum circuit library, you include qc/qcore.hpp
in your .cpp
files.
For example, see example/dj.cpp
.
To compile this file, execute following commands:
$ cd ./example
$ g++ -std=c++14 dj.cpp -lqc -odj
This command generate executable file dj
, and you can run it by:
$ ./dj
and you will get the result:
Result of applying D-J algorithm to a constant function:
The probability of results of measurement is [ 1 0 0 0 ].
(-0.707107,0)
(0,0)
(0,0)
(0,0)
(0.707107,0)
(0,0)
(0,0)
(0,0)
This function is constant.
Result of applying D-J algorithm to a balanced function:
The probability of results of measurement is [ 0 0 1 0 ].
(0,0)
(0,0)
(-0.707107,0)
(0,0)
(0,0)
(0,0)
(0.707107,0)
(0,0)
This function is balanced.