Skip to content

Commit

Permalink
Merge pull request #21 from sebastiaanbrand/interface-to-mtbdd
Browse files Browse the repository at this point in the history
Merge interface-to-mtbdd into master while this branch is already merged with renamed master files
  • Loading branch information
MarinusVanDijk authored Jul 20, 2024
2 parents 4395bc2 + bcfc7fc commit 0f10a80
Show file tree
Hide file tree
Showing 30 changed files with 2,500 additions and 2,105 deletions.
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ add_example(test_algs test_algs.c)
target_sources(test_algs PRIVATE ${ALGORITHM_EXAMPLES})

add_executable(circuit_equivalence circuit_equivalence.c)
target_link_libraries(circuit_equivalence qsylvan qsylvan_qasm_parser)
target_link_libraries(circuit_equivalence qsylvan qsylvan_qasm_parser_qmdd)
36 changes: 32 additions & 4 deletions qasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,42 @@

# allow the parser to be included in other places as a library
# (without compiling eval_expr.cpp again)
add_library(qsylvan_qasm_parser)
target_sources(qsylvan_qasm_parser

#add_library(qsylvan_qasm_parser)
#target_sources(qsylvan_qasm_parser
# PRIVATE
# simple_parser.cpp
# parse_math/eval_expr.cpp
# PUBLIC
# simple_parser.h)
#
#add_executable(sim_qasm sim_qasm.c)
#target_link_libraries(sim_qasm qsylvan qsylvan_qasm_parser)


# QASM simulator with qmddd

add_library(qsylvan_qasm_parser_qmdd)
target_sources(qsylvan_qasm_parser_qmdd
PRIVATE
simple_parser.cpp
parse_math/eval_expr.cpp
PUBLIC
simple_parser.h)

add_executable(sim_qasm sim_qasm.c)
target_link_libraries(sim_qasm qsylvan qsylvan_qasm_parser)
add_executable(run_qasm_on_qmdd run_qasm_on_qmdd.c)
target_link_libraries(run_qasm_on_qmdd qsylvan qsylvan_qasm_parser_qmdd)


# QASM simulator with mtbdd

add_library(qsylvan_qasm_parser_mtbdd)
target_sources(qsylvan_qasm_parser_mtbdd
PRIVATE
simple_parser.cpp
parse_math/eval_expr.cpp
PUBLIC
simple_parser.h)

add_executable(run_qasm_on_mtbdd run_qasm_on_mtbdd.c)
target_link_libraries(run_qasm_on_mtbdd qsylvan qsylvan_qasm_parser_mtbdd)
2 changes: 1 addition & 1 deletion qasm/QASM_to_circuit.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ BDDVAR partition(BDDVAR* qubits, int low, int high);
* PARAMETERS:
* - qubits: the circuit in which to store the barrier column
* - low: the first index of the array
* - high: the last index of the array
* - high: the last index of the array
*/
void sort(BDDVAR* qubits, int low, int high);

Expand Down
36 changes: 18 additions & 18 deletions qasm/circuits/qft_n4.qasm
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// quantum Fourier transform
OPENQASM 2.0;
include "qelib1.inc";
qreg q[4];
creg c[4];
x q[0];
x q[2];
barrier q;
h q[0];
cu1(pi/2) q[1],q[0];
h q[1];
cu1(pi/4) q[2],q[0];
cu1(pi/2) q[2],q[1];
h q[2];
cu1(pi/8) q[3],q[0];
cu1(pi/4) q[3],q[1];
cu1(pi/2) q[3],q[2];
h q[3];
// quantum Fourier transform
OPENQASM 2.0;
include "qelib1.inc";
qreg q[4];
creg c[4];
x q[0];
x q[2];
barrier q;
h q[0];
cu1(pi/2) q[1],q[0];
h q[1];
cu1(pi/4) q[2],q[0];
cu1(pi/2) q[2],q[1];
h q[2];
cu1(pi/8) q[3],q[0];
cu1(pi/4) q[3],q[1];
cu1(pi/2) q[3],q[2];
h q[3];
196 changes: 98 additions & 98 deletions qasm/circuits/vqe_n4.qasm
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
OPENQASM 2.0;
include "qelib1.inc";
qreg q[4];
creg meas[4];
sx q[0];
rz(5.0300511584448) q[0];
sx q[0];
rz(3*pi) q[0];
rz(2.61519568487349) q[0];
sx q[1];
rz(5.36606826220224) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.667082990176662) q[1];
cx q[0],q[1];
sx q[0];
rz(4.09739784898316) q[0];
sx q[0];
rz(3*pi) q[0];
rz(1.92219255913748) q[0];
sx q[2];
rz(3.20626074964735) q[2];
sx q[2];
rz(3*pi) q[2];
rz(0.571219981217032) q[2];
cx q[1],q[2];
sx q[1];
rz(4.79016360412963) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.438232887845333) q[1];
cx q[0],q[1];
sx q[0];
rz(4.57437876552885) q[0];
sx q[0];
rz(3*pi) q[0];
rz(1.86112525741656) q[0];
sx q[3];
rz(6.18865431978628) q[3];
sx q[3];
rz(3*pi) q[3];
rz(0.576182260790784) q[3];
cx q[2],q[3];
sx q[2];
rz(4.49858795091057) q[2];
sx q[2];
rz(3*pi) q[2];
rz(0.917799481623813) q[2];
cx q[1],q[2];
sx q[1];
rz(5.60829568567739) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.145928275357359) q[1];
cx q[0],q[1];
sx q[0];
rz(3.34595826021666) q[0];
sx q[0];
rz(3*pi) q[0];
rz(0.956972379417358) q[0];
sx q[3];
rz(4.05651598094723) q[3];
sx q[3];
rz(3*pi) q[3];
rz(1.15095967544708) q[3];
cx q[2],q[3];
sx q[2];
rz(3.76888634073298) q[2];
sx q[2];
rz(3*pi) q[2];
rz(1.90865844345986) q[2];
cx q[1],q[2];
sx q[1];
rz(6.12260448652247) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.30684599582304) q[1];
sx q[3];
rz(4.75710778753287) q[3];
sx q[3];
rz(3*pi) q[3];
rz(0.535717334235832) q[3];
cx q[2],q[3];
sx q[2];
rz(6.17521515476781) q[2];
sx q[2];
rz(3*pi) q[2];
rz(2.1495814494341) q[2];
sx q[3];
rz(5.68124782361394) q[3];
sx q[3];
rz(3*pi) q[3];
rz(1.38277984079156) q[3];
barrier q[0],q[1],q[2],q[3];
measure q[0] -> meas[0];
measure q[1] -> meas[1];
measure q[2] -> meas[2];
measure q[3] -> meas[3];
OPENQASM 2.0;
include "qelib1.inc";
qreg q[4];
creg meas[4];
sx q[0];
rz(5.0300511584448) q[0];
sx q[0];
rz(3*pi) q[0];
rz(2.61519568487349) q[0];
sx q[1];
rz(5.36606826220224) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.667082990176662) q[1];
cx q[0],q[1];
sx q[0];
rz(4.09739784898316) q[0];
sx q[0];
rz(3*pi) q[0];
rz(1.92219255913748) q[0];
sx q[2];
rz(3.20626074964735) q[2];
sx q[2];
rz(3*pi) q[2];
rz(0.571219981217032) q[2];
cx q[1],q[2];
sx q[1];
rz(4.79016360412963) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.438232887845333) q[1];
cx q[0],q[1];
sx q[0];
rz(4.57437876552885) q[0];
sx q[0];
rz(3*pi) q[0];
rz(1.86112525741656) q[0];
sx q[3];
rz(6.18865431978628) q[3];
sx q[3];
rz(3*pi) q[3];
rz(0.576182260790784) q[3];
cx q[2],q[3];
sx q[2];
rz(4.49858795091057) q[2];
sx q[2];
rz(3*pi) q[2];
rz(0.917799481623813) q[2];
cx q[1],q[2];
sx q[1];
rz(5.60829568567739) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.145928275357359) q[1];
cx q[0],q[1];
sx q[0];
rz(3.34595826021666) q[0];
sx q[0];
rz(3*pi) q[0];
rz(0.956972379417358) q[0];
sx q[3];
rz(4.05651598094723) q[3];
sx q[3];
rz(3*pi) q[3];
rz(1.15095967544708) q[3];
cx q[2],q[3];
sx q[2];
rz(3.76888634073298) q[2];
sx q[2];
rz(3*pi) q[2];
rz(1.90865844345986) q[2];
cx q[1],q[2];
sx q[1];
rz(6.12260448652247) q[1];
sx q[1];
rz(3*pi) q[1];
rz(0.30684599582304) q[1];
sx q[3];
rz(4.75710778753287) q[3];
sx q[3];
rz(3*pi) q[3];
rz(0.535717334235832) q[3];
cx q[2],q[3];
sx q[2];
rz(6.17521515476781) q[2];
sx q[2];
rz(3*pi) q[2];
rz(2.1495814494341) q[2];
sx q[3];
rz(5.68124782361394) q[3];
sx q[3];
rz(3*pi) q[3];
rz(1.38277984079156) q[3];
barrier q[0],q[1],q[2],q[3];
measure q[0] -> meas[0];
measure q[1] -> meas[1];
measure q[2] -> meas[2];
measure q[3] -> meas[3];
Loading

0 comments on commit 0f10a80

Please sign in to comment.