├── olsq ├── display.py ├── olsq_cirq │ ├── output.py │ ├── __init__.py │ └── input.py ├── olsq_qiskit │ ├── input.py │ ├── output.py │ └── __init__.py ├── __init__.py ├── devices │ ├── default_ourense.json │ ├── default_1a.json │ ├── default_grid2by3.json │ ├── default_2b.json │ ├── default_2a.json │ ├── default_1b.json │ ├── default_grid2by4.json │ ├── default_sycamore23.json │ ├── default_3b.json │ ├── default_3a.json │ ├── default_tokyo.json │ ├── default_aspen4.json │ └── default_ibmqx2.json └── benchmarks │ ├── toffoli.qasm │ ├── or.qasm │ ├── 4mod5-v1_22.qasm │ ├── adder.qasm │ ├── qaoa5.qasm │ ├── mod5mils_65.qasm │ ├── queko_05_0.qasm │ ├── tof_4.qasm │ ├── 4gt13_92.qasm │ ├── barenco_tof_4.qasm │ ├── tof_5.qasm │ ├── queko_10_3.qasm │ ├── mod_mult_55.qasm │ ├── vbe_adder_3.qasm │ ├── barenco_tof_5.qasm │ └── queko_15_1.qasm ├── iccad20 ├── result │ ├── olsq │ │ ├── queko_05_0_aspen-4 │ │ │ ├── 16QBT_05CYC_TFL_0_wille │ │ │ ├── 16QBT_05CYC_TFL_0_aspen4_olsq_swap.txt │ │ │ ├── 16QBT_05CYC_TFL_0_aspen4_olsq_depth.txt │ │ │ ├── 16QBT_05CYC_TFL_0_aspen4_olsq_fidelity.txt │ │ │ ├── 16QBT_05CYC_TFL_0_aspen4_olsq_depth.qasm │ │ │ ├── 16QBT_05CYC_TFL_0_aspen4_olsq_fidelity.qasm │ │ │ └── 16QBT_05CYC_TFL_0_aspen4_olsq_swap.qasm │ │ ├── queko_10_3_aspen-4 │ │ │ ├── 16QBT_10CYC_TFL_3_wille │ │ │ ├── 16QBT_10CYC_TFL_3_aspen4_olsq_depth.txt │ │ │ ├── 16QBT_10CYC_TFL_3_aspen4_olsq_swap.txt │ │ │ └── 16QBT_10CYC_TFL_3_aspen4_olsq_fidelity.txt │ │ ├── queko_15_1_aspen-4 │ │ │ ├── 16QBT_15CYC_TFL_1_wille │ │ │ ├── 16QBT_15CYC_TFL_1_aspen4_olsq_depth.txt │ │ │ ├── 16QBT_15CYC_TFL_1_aspen4_olsq_swap.txt │ │ │ └── 16QBT_15CYC_TFL_1_aspen4_olsq_fidelity.txt │ │ ├── qaoa5_ibmqx2 │ │ │ ├── qaoa_ibmqx2_olsq_depth.txt │ │ │ ├── qaoa_ibmqx2_olsq_swap.txt │ │ │ ├── qaoa_ibmqx2_olsq_fidelity.txt │ │ │ ├── qaoa_ibmqx2_wille.qasm │ │ │ ├── qaoa_ibmqx2_olsq_fidelity.qasm │ │ │ ├── qaoa_ibmqx2_olsq_swap.qasm │ │ │ └── qaoa_ibmqx2_olsq_depth.qasm │ │ ├── 4gt_13_92_ibmqx2 │ │ │ ├── 4gt13_92_ibmqx2_olsq_depth.txt │ │ │ ├── 4gt13_92_ibmqx2_olsq_fidelity.txt │ │ │ ├── 4gt13_92_ibmqx2_olsq_swap.txt │ │ │ ├── 4gt13_92_ibmqx2_wille.qasm │ │ │ ├── 4gt13_92_ibmqx2_olsq_swap.qasm │ │ │ └── 4gt13_92_ibmqx2_olsq_fidelity.qasm │ │ ├── or_ibmqx2 │ │ │ ├── or_ibmqx2_olsq_depth.txt │ │ │ ├── or_ibmqx2_olsq_fidelity.txt │ │ │ ├── or_ibmqx2_olsq_swap.txt │ │ │ ├── or_ibmqx2_wille.qasm │ │ │ ├── or_ibmqx2_olsq_depth.qasm │ │ │ ├── or_ibmqx2_olsq_swap.qasm │ │ │ └── or_ibmqx2_olsq_fidelity.qasm │ │ ├── adder_ibmqx2 │ │ │ ├── adder_ibmqx2_olsq_depth.txt │ │ │ ├── adder_ibmqx2_olsq_swap.txt │ │ │ ├── adder_ibmqx2_olsq_fidelity.txt │ │ │ ├── adder_ibmqx2_olsq_depth.qasm │ │ │ ├── adder_ibmqx2_olsq_fidelity.qasm │ │ │ ├── adder_ibmqx2_olsq_swap.qasm │ │ │ └── adder_ibmqx2_wille.qasm │ │ ├── 4mod5-v1_22_ibmqx2 │ │ │ ├── 4mod5-v1_22_ibmqx2_olsq_depth.txt │ │ │ ├── 4mod5-v1_22_ibmqx2_olsq_swap.txt │ │ │ ├── 4mod5-v1_22_ibmqx2_olsq_fidelity.txt │ │ │ ├── 4mod5-v1_22_ibmqx2_wille.qasm │ │ │ ├── 4mod5-v1_22_ibmqx2_olsq_swap.qasm │ │ │ ├── 4mod5-v1_22_ibmqx2_olsq_fidelity.qasm │ │ │ └── 4mod5-v1_22_ibmqx2_olsq_depth.qasm │ │ ├── adder_grid2by3 │ │ │ ├── adder_grid2by3_olsq_depth.txt │ │ │ ├── adder_grid2by3_olsq_swap.txt │ │ │ ├── adder_grid2by3_olsq_fidelity.txt │ │ │ ├── adder_grid2by3_olsq_fidelity.qasm │ │ │ ├── adder_grid2by3_olsq_depth.qasm │ │ │ └── adder_grid2by3_olsq_swap.qasm │ │ ├── adder_grid2by4 │ │ │ ├── adder_grid2by4_olsq_depth.txt │ │ │ ├── adder_grid2by4_olsq_swap.txt │ │ │ ├── adder_grid2by4_olsq_fidelity.txt │ │ │ ├── adder_grid2by4_olsq_fidelity.qasm │ │ │ ├── adder_grid2by4_olsq_depth.qasm │ │ │ └── adder_grid2by4_olsq_swap.qasm │ │ ├── mod5mils_65_ibmqx2 │ │ │ ├── mod5mils_65_ibmqx2_olsq_depth.txt │ │ │ ├── mod5mils_65_ibmqx2_olsq_swap.txt │ │ │ ├── mod5mils_65_ibmqx2_olsq_fidelity.txt │ │ │ ├── mod5mils_65_ibmqx2_wille.qasm │ │ │ ├── mod5mils_65_ibmqx2_olsq_fidelity.qasm │ │ │ ├── mod5mils_65_ibmqx2_olsq_swap.qasm │ │ │ └── mod5mils_65_ibmqx2_olsq_depth.qasm │ │ ├── 4mod5-v1_22_grid2by3 │ │ │ ├── 4mod5-v1_22_grid2by3_olsq_depth.txt │ │ │ ├── 4mod5-v1_22_grid2by3_olsq_fidelity.txt │ │ │ ├── 4mod5-v1_22_grid2by3_olsq_swap.txt │ │ │ ├── 4mod5-v1_22_grid2by3_olsq_fidelity.qasm │ │ │ ├── 4mod5-v1_22_grid2by3_olsq_swap.qasm │ │ │ ├── 4mod5-v1_22_grid2by3_olsq_depth.qasm │ │ │ └── 4mod5-v1_22_grid2by3_wille.qasm │ │ └── 4mod5-v1_22_grid2by4 │ │ │ ├── 4mod5-v1_22_grid2by4_olsq_depth.txt │ │ │ ├── 4mod5-v1_22_grid2by4_olsq_fidelity.txt │ │ │ ├── 4mod5-v1_22_grid2by4_olsq_swap.txt │ │ │ ├── 4mod5-v1_22_grid2by4_olsq_fidelity.qasm │ │ │ ├── 4mod5-v1_22_grid2by4_olsq_swap.qasm │ │ │ ├── 4mod5-v1_22_grid2by4_wille.qasm │ │ │ └── 4mod5-v1_22_grid2by4_olsq_depth.qasm │ ├── qaoa-olsq │ │ ├── data.xlsx │ │ └── output.py │ └── tb-olsq │ │ ├── queko_05_0_aspen-4 │ │ ├── 16QBT_05CYC_TFL_0_aspen4_tket.txt │ │ ├── 16QBT_05CYC_TFL_0_aspen4_tbolsq_swap.txt │ │ ├── 16QBT_05CYC_TFL_0_aspen4_tbolsq_fidelity.txt │ │ ├── 16QBT_05CYC_TFL_0.in │ │ ├── 16QBT_05CYC_TFL_0_aspen4_tbolsq_fidelity.qasm │ │ ├── 16QBT_05CYC_TFL_0_triq_fidelity.qasm │ │ └── 16QBT_05CYC_TFL_0_aspen4_tbolsq_swap.qasm │ │ ├── queko_10_3_aspen-4 │ │ ├── 16QBT_10CYC_TFL_3_aspen4_tket.txt │ │ ├── 16QBT_10CYC_TFL_3_aspen4_tbolsq_swap.txt │ │ ├── 16QBT_10CYC_TFL_3_aspen4_tbolsq_fidelity.txt │ │ └── 16QBT_10CYC_TFL_3.in │ │ ├── queko_15_1_aspen-4 │ │ ├── 16QBT_15CYC_TFL_1_aspen4_tket.txt │ │ ├── 16QBT_15CYC_TFL_1_aspen4_tbolsq_swap.txt │ │ └── 16QBT_15CYC_TFL_1_aspen4_tbolsq_fidelity.txt │ │ ├── 4gt_13_92_ibmqx2 │ │ ├── 4gt13_92_ibmqx2_tket.txt │ │ ├── 4gt13_92_ibmqx2_tbolsq_fidelity.txt │ │ ├── 4gt13_92_ibmqx2_tbolsq_swap.txt │ │ ├── 4gt13_92.in │ │ ├── 4gt13_92_ibmqx2_tbolsq_swap.qasm │ │ └── 4gt13_92_ibmqx2_tbolsq_fidelity.qasm │ │ ├── qaoa5_ibmqx2 │ │ ├── qaoa_ibmqx2_tket.txt │ │ ├── qaoa_ibmqx2_tbolsq_swap.txt │ │ ├── qaoa_ibmqx2_tbolsq_fidelity.txt │ │ ├── qaoa.in │ │ ├── qaoa_ibmqx2_tbolsq_fidelity.qasm │ │ ├── qaoa_ibmqx2_tbolsq_swap.qasm │ │ ├── qaoa_ibmqx2_tket.qasm │ │ └── qaoa_ibmqx2_triq_fidelity.qasm │ │ ├── qaoa5_melbourne │ │ ├── qaoa_ibmq14_tket.txt │ │ ├── qaoa_ibmq14_tbolsq_swap.txt │ │ ├── qaoa_ibmq14_tbolsq_fidelity.txt │ │ ├── qaoa.in │ │ ├── qaoa_ibmq14_tbolsq_fidelity.qasm │ │ ├── qaoa_ibmq14_tbolsq_swap.qasm │ │ ├── qaoa_ibmq14_tket.qasm │ │ └── qaoa_ibmq14_triq_fidelity.qasm │ │ ├── 4gt_13_92_melbourne │ │ ├── 4gt13_92_ibmq14_tket.txt │ │ ├── 4gt13_92_ibmq14_tbolsq_swap.txt │ │ ├── 4gt13_92_ibmq14_tbolsq_fidelity.txt │ │ └── 4gt13_92.in │ │ ├── or_ibmqx2 │ │ ├── or_ibmqx2_tket.txt │ │ ├── or_ibmqx2_tbolsq_fidelity.txt │ │ ├── or_ibmqx2_tbolsq_swap.txt │ │ ├── or.in │ │ ├── or_ibmqx2_triq_fidelity.qasm │ │ ├── or_ibmqx2_tbolsq_swap.qasm │ │ ├── or_ibmqx2_tbolsq_fidelity.qasm │ │ └── or_ibmqx2_tket.qasm │ │ ├── tof_4_melbourne │ │ ├── tof_4_after_heavy_ibmq14_tket.txt │ │ ├── tof_4_after_heavy_ibmq14_tbolsq_fidelity.txt │ │ ├── tof_4_after_heavy_ibmq14_tbolsq_swap.txt │ │ ├── tof_4_after_heavy_ibmq14_triq.in │ │ ├── tof_4_after_heavy_ibmq14_tbolsq_fidelity.qasm │ │ └── tof_4_after_heavy_ibmq14_tbolsq_swap.qasm │ │ ├── tof_5_melbourne │ │ ├── tof_5_after_heavy_ibmq14_tket.txt │ │ ├── tof_5_after_heavy_ibmq14_tbolsq_fidelity.txt │ │ ├── tof_5_after_heavy_ibmq14_tbolsq_swap.txt │ │ ├── tof_5_after_heavy_ibmq14_triq.in │ │ ├── tof_5_after_heavy_ibmq14_tbolsq_fidelity.qasm │ │ └── tof_5_after_heavy_ibmq14_tbolsq_swap.qasm │ │ ├── or_melbourne │ │ ├── or_ibmq14_tket.txt │ │ ├── or_ibmq14_tbolsq_fidelity.txt │ │ ├── or_ibmq14_tbolsq_swap.txt │ │ ├── or.in │ │ ├── or_ibmq14_tbolsq_swap.qasm │ │ ├── or_ibmq14_tbolsq_fidelity.qasm │ │ ├── or_ibmq14_tket.qasm │ │ └── or_ibmq14_triq_fidelity.qasm │ │ ├── adder_ibmqx2 │ │ ├── adder_ibmqx2_tket.txt │ │ ├── adder_ibmqx2_tbolsq_swap.txt │ │ ├── adder_ibmqx2_tbolsq_fidelity.txt │ │ ├── adder.in │ │ ├── adder_ibmqx2_tbolsq_swap.qasm │ │ ├── adder_ibmqx2_tbolsq_fidelity.qasm │ │ ├── adder_ibmqx2_tket.qasm │ │ └── adder_ibmqx2_triq_fidelity.qasm │ │ ├── adder_melbourne │ │ ├── adder_ibmq14_tket.txt │ │ ├── adder_ibmq14_tbolsq_swap.txt │ │ ├── adder_ibmq14_tbolsq_fidelity.txt │ │ ├── adder.in │ │ ├── adder_ibmq14_triq.in │ │ ├── adder_ibmq14_tbolsq_fidelity.qasm │ │ ├── adder_ibmq14_tbolsq_swap.qasm │ │ ├── adder_ibmq14_triq_fidelity.qasm │ │ └── adder_ibmq14_tket.qasm │ │ ├── 4mod5-v1_22_ibmqx2 │ │ ├── 4mod5-v1_22_ibmqx2_tket.txt │ │ ├── 4mod5-v1_22_ibmqx2_tbolsq_swap.txt │ │ ├── 4mod5-v1_22_ibmqx2_tbolsq_fidelity.txt │ │ ├── 4mod5-v1_22.in │ │ ├── 4mod5-v1_22_ibmqx2_tbolsq_swap.qasm │ │ ├── 4mod5-v1_22_ibmqx2_tbolsq_fidelity.qasm │ │ ├── 4mod5-v1_22_ibmqx2_tket.qasm │ │ └── 4mod5-v1_22_ibmqx2_triq_fidelity.qasm │ │ ├── 4mod5-v1_22_melbourne │ │ ├── 4mod5-v1_22_ibmq14_tket.txt │ │ ├── 4mod5-v1_22_ibmq14_tbolsq_swap.txt │ │ ├── 4mod5-v1_22_ibmq14_tbolsq_fidelity.txt │ │ ├── 4mod5-v1_22.in │ │ ├── 4mod5-v1_22_ibmq14_tbolsq_fidelity.qasm │ │ ├── 4mod5-v1_22_ibmq14_tbolsq_swap.qasm │ │ └── 4mod5-v1_22_ibmq14_tket.qasm │ │ ├── mod5mils_65_ibmqx2 │ │ ├── mod5mils_65_ibmqx2_tket.txt │ │ ├── mod5mils_65_ibmqx2_tbolsq_swap.txt │ │ ├── mod5mils_65_ibmqx2_tbolsq_fidelity.txt │ │ ├── mod5mils_65.in │ │ ├── mod5mils_65_ibmqx2_tbolsq_swap.qasm │ │ ├── mod5mils_65_ibmqx2_tbolsq_fidelity.qasm │ │ └── mod5mils_65_ibmqx2_tket.qasm │ │ ├── mod5mils_65_melbourne │ │ ├── mod5mils_65_ibmq14_tket.txt │ │ ├── mod5mils_65_ibmq14_tbolsq_swap.txt │ │ ├── mod5mils_65_ibmq14_tbolsq_fidelity.txt │ │ ├── mod5mils_65.in │ │ ├── mod5mils_65_ibmq14_tbolsq_swap.qasm │ │ ├── mod5mils_65_ibmq14_tbolsq_fidelity.qasm │ │ └── mod5mils_65_ibmq14_tket.qasm │ │ ├── rc_adder_6_melbourne │ │ ├── rc_adder_6_after_heavy_ibmq14_tket.txt │ │ ├── rc_adder_6_after_heavy_ibmq14_tbolsq_swap.txt │ │ └── rc_adder_6_after_heavy_ibmq14_tbolsq_fidelity.txt │ │ ├── barenco_tof_4_melbourne │ │ ├── barenco_tof_4_after_heavy_ibmq14_tket.txt │ │ ├── barenco_tof_4_after_heavy_ibmq14_tbolsq_swap.txt │ │ ├── barenco_tof_4_after_heavy_ibmq14_tbolsq_fidelity.txt │ │ ├── barenco_tof_4_after_heavy_ibmq14_triq.in │ │ └── barenco_tof_4_after_heavy_ibmq14_tbolsq_swap.qasm │ │ ├── barenco_tof_5_melbourne │ │ ├── barenco_tof_5_after_heavy_ibmq14_tket.txt │ │ ├── barenco_tof_5_after_heavy_ibmq14_tbolsq_swap.txt │ │ └── barenco_tof_5_after_heavy_ibmq14_tbolsq_fidelity.txt │ │ ├── mod_mult_55_melbourne │ │ ├── mod_mult_55_after_heavy_ibmq14_tket.txt │ │ ├── mod_mult_55_after_heavy_ibmq14_tbolsq_swap.txt │ │ └── mod_mult_55_after_heavy_ibmq14_tbolsq_fidelity.txt │ │ └── vbe_adder_3_melbourne │ │ ├── vbe_adder_3_after_heavy_ibmq14_tket.txt │ │ ├── vbe_adder_3_after_heavy_ibmq14_tbolsq_swap.txt │ │ └── vbe_adder_3_after_heavy_ibmq14_tbolsq_fidelity.txt ├── script │ ├── tb-olsq │ │ ├── runtket.sh │ │ ├── runtbolsq.sh │ │ ├── runtriq.sh │ │ └── tket_test.py │ ├── info.py │ └── qaoa-olsq │ │ └── qaoa_exp.py └── benchmark │ ├── or.qasm │ ├── adder.qasm │ ├── 4mod5-v1_22.qasm │ ├── qaoa5.qasm │ ├── mod5mils_65.qasm │ ├── 16QBT_05CYC_TFL_0.qasm │ ├── tof_4_after_heavy.qasm │ ├── 4gt13_92.qasm │ ├── barenco_tof_4_after_heavy.qasm │ ├── 16QBT_10CYC_TFL_3.qasm │ ├── tof_5_after_heavy.qasm │ ├── mod_mult_55_after_heavy.qasm │ ├── vbe_adder_3_after_heavy.qasm │ ├── barenco_tof_5_after_heavy.qasm │ └── 16QBT_15CYC_TFL_1.qasm ├── dac22 ├── adder.png ├── bowtie.png └── heavyhex.png ├── .gitignore ├── setup.py ├── test_olsq.py ├── LICENSE └── test_olsq_qiskit.py /olsq/display.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /olsq/olsq_cirq/output.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /olsq/olsq_qiskit/input.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /olsq/olsq_qiskit/output.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_wille: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3_wille: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_15_1_aspen-4/16QBT_15CYC_TFL_1_wille: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /olsq/olsq_cirq/__init__.py: -------------------------------------------------------------------------------- 1 | from olsq.olsq_cirq.solve import OLSQ_cirq 2 | -------------------------------------------------------------------------------- /dac22/adder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qu-tan-um/OLSQ/HEAD/dac22/adder.png -------------------------------------------------------------------------------- /dac22/bowtie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qu-tan-um/OLSQ/HEAD/dac22/bowtie.png -------------------------------------------------------------------------------- /olsq/__init__.py: -------------------------------------------------------------------------------- 1 | from olsq.solve import OLSQ 2 | from olsq.device import qcdevice -------------------------------------------------------------------------------- /olsq/olsq_qiskit/__init__.py: -------------------------------------------------------------------------------- 1 | from olsq.olsq_qiskit.solve import OLSQ_qiskit 2 | -------------------------------------------------------------------------------- /dac22/heavyhex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qu-tan-um/OLSQ/HEAD/dac22/heavyhex.png -------------------------------------------------------------------------------- /iccad20/result/qaoa-olsq/data.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qu-tan-um/OLSQ/HEAD/iccad20/result/qaoa-olsq/data.xlsx -------------------------------------------------------------------------------- /iccad20/script/tb-olsq/runtket.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for bench in benchmark/paper5/* 4 | do 5 | python "tket_test.py" "$bench" "ibmqx2" & 6 | done 7 | -------------------------------------------------------------------------------- /olsq/devices/default_ourense.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ourense", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 5, 5 | "list_qubit_edge": [[0, 1], [1, 2], [1, 3], [3, 4]] 6 | } 7 | -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 5 3 | x 22 4 | cx 15 5 | after: 6 | depth 6 7 | u3 22 8 | measure 16 9 | cx 15 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 5 3 | x 22 4 | cx 15 5 | after: 6 | depth 10 7 | u3 22 8 | cx 18 9 | measure 16 10 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 5 3 | x 22 4 | cx 15 5 | after: 6 | depth 6 7 | u3 22 8 | measure 16 9 | cx 15 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 5 3 | x 22 4 | cx 15 5 | after: 6 | depth 6 7 | u3 22 8 | measure 16 9 | cx 15 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3_aspen4_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 10 3 | x 44 4 | cx 29 5 | after: 6 | depth 11 7 | u3 44 8 | cx 29 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3_aspen4_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 10 3 | x 44 4 | cx 29 5 | after: 6 | depth 11 7 | u3 44 8 | cx 29 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_15_1_aspen-4/16QBT_15CYC_TFL_1_aspen4_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 15 3 | x 65 4 | cx 44 5 | after: 6 | depth 15 7 | u3 63 8 | cx 44 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_15_1_aspen-4/16QBT_15CYC_TFL_1_aspen4_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 15 3 | x 65 4 | cx 44 5 | after: 6 | depth 16 7 | u3 65 8 | cx 44 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 5 3 | x 22 4 | cx 15 5 | after: 6 | depth 6 7 | u3 22 8 | measure 16 9 | cx 15 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3_aspen4_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 10 3 | x 44 4 | cx 29 5 | after: 6 | depth 45 7 | cx 74 8 | u3 44 9 | measure 16 10 | additional cx 45 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_15_1_aspen-4/16QBT_15CYC_TFL_1_aspen4_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 15 3 | x 65 4 | cx 44 5 | after: 6 | depth 58 7 | cx 158 8 | u3 65 9 | measure 16 10 | additional cx 114 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3_aspen4_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 10 3 | x 44 4 | cx 29 5 | after: 6 | depth 11 7 | u3 44 8 | cx 29 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_15_1_aspen-4/16QBT_15CYC_TFL_1_aspen4_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 15 3 | x 65 4 | cx 44 5 | after: 6 | depth 14 7 | u3 57 8 | cx 39 9 | measure 16 10 | additional cx -5 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 5 3 | x 22 4 | cx 15 5 | after: 6 | depth 6 7 | u3 22 8 | measure 16 9 | cx 15 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3_aspen4_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 10 3 | x 44 4 | cx 29 5 | after: 6 | depth 11 7 | u3 44 8 | cx 29 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_15_1_aspen-4/16QBT_15CYC_TFL_1_aspen4_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 15 3 | x 65 4 | cx 44 5 | after: 6 | depth 16 7 | u3 65 8 | cx 44 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info 2 | *.pyc 3 | .vscode 4 | /.idea 5 | dist/ 6 | build/ 7 | /.DS_Store 8 | /try.py 9 | __pycache__ 10 | .pytest_cache 11 | /docs/build 12 | /docs/source/_static 13 | /docs/source/_templates -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3_aspen4_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 10 3 | x 44 4 | cx 29 5 | after: 6 | depth 11 7 | u3 44 8 | cx 29 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_15_1_aspen-4/16QBT_15CYC_TFL_1_aspen4_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 15 3 | x 65 4 | cx 44 5 | after: 6 | depth 16 7 | u3 65 8 | cx 44 9 | measure 16 10 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/qaoa5_ibmqx2/qaoa_ibmqx2_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 11 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/olsq/qaoa5_ibmqx2/qaoa_ibmqx2_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 8 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 64 9 | cx 51 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 21 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa_ibmqx2_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 17 9 | cx 11 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 8 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 39 9 | cx 42 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 12 -------------------------------------------------------------------------------- /iccad20/result/olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 39 9 | cx 30 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 39 9 | cx 30 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/qaoa5_ibmqx2/qaoa_ibmqx2_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 8 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_melbourne/4gt13_92_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 84 9 | cx 72 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 42 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa_ibmqx2_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 8 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 8 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 39 9 | cx 30 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 39 9 | cx 30 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_melbourne/4gt13_92_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 68 9 | cx 60 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 30 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or_ibmqx2_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 9 11 | u1 8 12 | cx 6 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa_ibmqx2_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 8 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 14 3 | cx 8 4 | h 5 5 | rx 5 6 | rz 4 7 | after: 8 | depth 15 9 | cx 8 10 | u2 5 11 | r 5 12 | measure 5 13 | u1 4 14 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_4_melbourne/tof_4_after_heavy_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 46 3 | cx 22 4 | t 12 5 | tdg 11 6 | h 10 7 | after: 8 | depth 53 9 | cx 25 10 | u1 23 11 | u2 10 12 | measure 7 13 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_5_melbourne/tof_5_after_heavy_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 61 3 | cx 30 4 | t 16 5 | tdg 15 6 | h 14 7 | after: 8 | depth 68 9 | cx 51 10 | u1 31 11 | u2 14 12 | measure 9 13 | additional cx 21 -------------------------------------------------------------------------------- /iccad20/result/olsq/or_ibmqx2/or_ibmqx2_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 9 11 | u1 8 12 | cx 6 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/or_ibmqx2/or_ibmqx2_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 9 11 | u1 8 12 | cx 6 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/or_ibmqx2/or_ibmqx2_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 9 11 | u1 8 12 | cx 6 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_melbourne/4gt13_92_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 38 3 | cx 30 4 | t 16 5 | tdg 12 6 | h 8 7 | after: 8 | depth 72 9 | cx 66 10 | u1 28 11 | u2 8 12 | measure 5 13 | additional cx 36 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 18 11 | cx 12 12 | u1 8 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_ibmqx2/adder_ibmqx2_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 16 11 | cx 13 12 | u1 9 13 | measure 4 14 | u2 2 15 | u3 2 16 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_ibmqx2/adder_ibmqx2_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 16 11 | cx 13 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder_ibmqx2_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 27 11 | cx 22 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 12 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 14 11 | cx 13 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or_ibmqx2_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 9 11 | u1 8 12 | cx 6 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or_ibmqx2_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 9 11 | u1 8 12 | cx 6 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_4_melbourne/tof_4_after_heavy_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 46 3 | cx 22 4 | t 12 5 | tdg 11 6 | h 10 7 | after: 8 | depth 47 9 | cx 25 10 | u1 23 11 | u2 10 12 | measure 7 13 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_4_melbourne/tof_4_after_heavy_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 46 3 | cx 22 4 | t 12 5 | tdg 11 6 | h 10 7 | after: 8 | depth 47 9 | cx 25 10 | u1 23 11 | u2 10 12 | measure 7 13 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_5_melbourne/tof_5_after_heavy_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 61 3 | cx 30 4 | t 16 5 | tdg 15 6 | h 14 7 | after: 8 | depth 62 9 | cx 33 10 | u1 31 11 | u2 14 12 | measure 9 13 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_5_melbourne/tof_5_after_heavy_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 61 3 | cx 30 4 | t 16 5 | tdg 15 6 | h 14 7 | after: 8 | depth 62 9 | cx 33 10 | u1 31 11 | u2 14 12 | measure 9 13 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 16 10 | cx 17 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 16 10 | cx 14 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by3/adder_grid2by3_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by3/adder_grid2by3_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by4/adder_grid2by4_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by4/adder_grid2by4_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u2 2 15 | u3 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_ibmqx2/adder_ibmqx2_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 16 11 | cx 13 12 | u1 9 13 | measure 4 14 | u2 2 15 | u3 2 16 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 25 10 | cx 28 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 12 -------------------------------------------------------------------------------- /iccad20/result/olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 28 10 | cx 22 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 29 10 | cx 23 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 12 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_melbourne/4mod5-v1_22_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 24 10 | cx 20 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 9 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder_ibmqx2_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 16 11 | cx 13 12 | u1 9 13 | measure 4 14 | u2 2 15 | u3 2 16 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 34 10 | cx 28 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 12 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_melbourne/mod5mils_65_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 45 10 | cx 34 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 18 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 17 11 | cx 12 12 | u1 8 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 8 3 | cx 6 4 | tdg 4 5 | t 3 6 | h 2 7 | x 1 8 | sdg 1 9 | after: 10 | depth 16 11 | cx 12 12 | u1 8 13 | measure 3 14 | u2 2 15 | u3 1 16 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/rc_adder_6_melbourne/rc_adder_6_after_heavy_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 83 3 | cx 71 4 | t 24 5 | tdg 23 6 | h 22 7 | after: 8 | depth 186 9 | cx 245 10 | u1 47 11 | u2 22 12 | measure 14 13 | additional cx 174 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by3/4mod5-v1_22_grid2by3_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 21 10 | cx 23 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 12 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by3/4mod5-v1_22_grid2by3_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 22 10 | cx 20 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 9 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by3/4mod5-v1_22_grid2by3_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 21 10 | cx 20 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 9 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by4/4mod5-v1_22_grid2by4_olsq_depth.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 21 10 | cx 26 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 15 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by4/4mod5-v1_22_grid2by4_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 24 10 | cx 20 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 9 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by4/4mod5-v1_22_grid2by4_olsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 22 10 | cx 20 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 9 -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 16 10 | cx 14 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by3/adder_grid2by3_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by4/adder_grid2by4_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u2 2 15 | u3 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_olsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 28 10 | cx 22 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 16 10 | cx 14 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_melbourne/4mod5-v1_22_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 16 10 | cx 20 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 9 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder_ibmqx2_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 16 11 | cx 13 12 | u1 9 13 | measure 4 14 | u2 2 15 | u3 2 16 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u3 2 15 | u2 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_4_melbourne/barenco_tof_4_after_heavy_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 68 3 | cx 34 4 | t 14 5 | tdg 14 6 | h 10 7 | after: 8 | depth 91 9 | cx 61 10 | u1 28 11 | u2 10 12 | measure 7 13 | additional cx 27 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_5_melbourne/barenco_tof_5_after_heavy_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 95 3 | cx 50 4 | t 20 5 | tdg 20 6 | h 14 7 | after: 8 | depth 146 9 | cx 101 10 | u1 40 11 | u2 14 12 | measure 9 13 | additional cx 51 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 29 10 | cx 22 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/rc_adder_6_melbourne/rc_adder_6_after_heavy_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 83 3 | cx 71 4 | t 24 5 | tdg 23 6 | h 22 7 | after: 8 | depth 80 9 | cx 98 10 | u1 47 11 | u2 22 12 | measure 14 13 | additional cx 27 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 16 10 | cx 14 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 3 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_melbourne/4mod5-v1_22_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 12 3 | cx 11 4 | t 4 5 | tdg 3 6 | h 2 7 | x 1 8 | after: 9 | depth 25 10 | cx 20 11 | u1 7 12 | measure 5 13 | u2 2 14 | u3 1 15 | additional cx 9 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 11 3 | cx 10 4 | t 4 5 | tdg 4 6 | x 2 7 | h 2 8 | s 1 9 | after: 10 | depth 12 11 | cx 10 12 | u1 9 13 | measure 4 14 | u2 2 15 | u3 2 16 | additional cx 0 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_4_melbourne/barenco_tof_4_after_heavy_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 68 3 | cx 34 4 | t 14 5 | tdg 14 6 | h 10 7 | after: 8 | depth 75 9 | cx 49 10 | u1 28 11 | u2 10 12 | measure 7 13 | additional cx 15 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_5_melbourne/barenco_tof_5_after_heavy_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 95 3 | cx 50 4 | t 20 5 | tdg 20 6 | h 14 7 | after: 8 | depth 81 9 | cx 68 10 | u1 40 11 | u2 14 12 | measure 9 13 | additional cx 18 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 27 10 | cx 22 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 6 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_melbourne/mod5mils_65_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 34 10 | cx 34 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 18 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod_mult_55_melbourne/mod_mult_55_after_heavy_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 47 3 | cx 40 4 | t 18 5 | tdg 17 6 | h 14 7 | sdg 2 8 | after: 9 | depth 78 10 | cx 76 11 | u1 37 12 | u2 14 13 | measure 9 14 | additional cx 36 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/rc_adder_6_melbourne/rc_adder_6_after_heavy_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 83 3 | cx 71 4 | t 24 5 | tdg 23 6 | h 22 7 | after: 8 | depth 85 9 | cx 98 10 | u1 47 11 | u2 22 12 | measure 14 13 | additional cx 27 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_4_melbourne/barenco_tof_4_after_heavy_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 68 3 | cx 34 4 | t 14 5 | tdg 14 6 | h 10 7 | after: 8 | depth 78 9 | cx 58 10 | u1 28 11 | u2 10 12 | measure 7 13 | additional cx 24 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_5_melbourne/barenco_tof_5_after_heavy_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 95 3 | cx 50 4 | t 20 5 | tdg 20 6 | h 14 7 | after: 8 | depth 93 9 | cx 89 10 | u1 40 11 | u2 14 12 | measure 9 13 | additional cx 39 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_melbourne/mod5mils_65_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 21 3 | cx 16 4 | t 8 5 | tdg 6 6 | h 4 7 | x 1 8 | after: 9 | depth 43 10 | cx 34 11 | u1 14 12 | measure 5 13 | u2 4 14 | u3 1 15 | additional cx 18 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod_mult_55_melbourne/mod_mult_55_after_heavy_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 47 3 | cx 40 4 | t 18 5 | tdg 17 6 | h 14 7 | sdg 2 8 | after: 9 | depth 71 10 | cx 64 11 | u1 37 12 | u2 14 13 | measure 9 14 | additional cx 24 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod_mult_55_melbourne/mod_mult_55_after_heavy_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 47 3 | cx 40 4 | t 18 5 | tdg 17 6 | h 14 7 | sdg 2 8 | after: 9 | depth 68 10 | cx 64 11 | u1 37 12 | u2 14 13 | measure 9 14 | additional cx 24 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/vbe_adder_3_melbourne/vbe_adder_3_after_heavy_ibmq14_tket.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 58 3 | cx 50 4 | tdg 12 5 | t 12 6 | h 10 7 | s 3 8 | sdg 2 9 | after: 10 | depth 96 11 | cx 98 12 | u1 29 13 | u2 10 14 | measure 10 15 | additional cx 48 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/vbe_adder_3_melbourne/vbe_adder_3_after_heavy_ibmq14_tbolsq_swap.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 58 3 | cx 50 4 | tdg 12 5 | t 12 6 | h 10 7 | s 3 8 | sdg 2 9 | after: 10 | depth 59 11 | cx 74 12 | u1 29 13 | u2 10 14 | measure 10 15 | additional cx 24 -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/vbe_adder_3_melbourne/vbe_adder_3_after_heavy_ibmq14_tbolsq_fidelity.txt: -------------------------------------------------------------------------------- 1 | before: 2 | depth 58 3 | cx 50 4 | tdg 12 5 | t 12 6 | h 10 7 | s 3 8 | sdg 2 9 | after: 10 | depth 61 11 | cx 77 12 | u1 29 13 | u2 10 14 | measure 10 15 | additional cx 27 -------------------------------------------------------------------------------- /iccad20/script/tb-olsq/runtbolsq.sh: -------------------------------------------------------------------------------- 1 | for bench in benchmark/paper5/* 2 | do 3 | s=${bench##*/} 4 | s=${s%.*} 5 | python -u "newsmt.py" "$bench" "ibmqx2" "swap" | tee "result/paper/${s}_ibmqx2_tbelsq_swap" & 6 | python -u "newsmt.py" "$bench" "ibmqx2" "fidelity" | tee "result/paper/${s}_ibmqx2_tbelsq_fidelity" & 7 | done 8 | -------------------------------------------------------------------------------- /olsq/benchmarks/toffoli.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[3]; 5 | h q[2]; 6 | cx q[1], q[2]; 7 | tdg q[2]; 8 | cx q[0], q[2]; 9 | t q[2]; 10 | cx q[1], q[2]; 11 | tdg q[2]; 12 | cx q[0], q[2]; 13 | t q[1]; 14 | t q[2]; 15 | cx q[0], q[1]; 16 | h q[2]; 17 | t q[0]; 18 | tdg q[1]; 19 | cx q[0], q[1]; 20 | -------------------------------------------------------------------------------- /iccad20/benchmark/or.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[3]; 4 | x q[0]; 5 | tdg q[1]; 6 | h q[2]; 7 | cx q[2], q[1]; 8 | tdg q[0]; 9 | t q[1]; 10 | tdg q[2]; 11 | cx q[0], q[1]; 12 | sdg q[2]; 13 | cx q[2], q[0]; 14 | t q[1]; 15 | t q[0]; 16 | cx q[2], q[1]; 17 | tdg q[1]; 18 | cx q[2], q[0]; 19 | cx q[0], q[1]; 20 | h q[2]; 21 | -------------------------------------------------------------------------------- /olsq/benchmarks/or.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[3]; 4 | x q[0]; 5 | tdg q[1]; 6 | h q[2]; 7 | cx q[2], q[1]; 8 | tdg q[0]; 9 | t q[1]; 10 | tdg q[2]; 11 | cx q[0], q[1]; 12 | sdg q[2]; 13 | cx q[2], q[0]; 14 | t q[1]; 15 | t q[0]; 16 | cx q[2], q[1]; 17 | tdg q[1]; 18 | cx q[2], q[0]; 19 | cx q[0], q[1]; 20 | h q[2]; 21 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or.in: -------------------------------------------------------------------------------- 1 | 3 17 2 | 0 X 1 0 0 3 | 1 T 1 1 0 4 | 2 H 1 2 0 5 | 3 CNOT 2 2 1 2 2 1 6 | 4 T 1 0 1 0 7 | 5 T 1 1 1 3 8 | 6 T 1 2 1 3 9 | 7 CNOT 2 0 1 2 4 5 10 | 8 S 1 2 1 6 11 | 9 CNOT 2 2 0 2 8 7 12 | 10 T 1 1 1 7 13 | 11 T 1 0 1 9 14 | 12 CNOT 2 2 1 2 9 10 15 | 13 T 1 1 1 12 16 | 14 CNOT 2 2 0 2 12 11 17 | 15 CNOT 2 0 1 2 14 13 18 | 16 H 1 2 1 14 19 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or.in: -------------------------------------------------------------------------------- 1 | 3 17 2 | 0 X 1 0 0 3 | 1 T 1 1 0 4 | 2 H 1 2 0 5 | 3 CNOT 2 2 1 2 2 1 6 | 4 T 1 0 1 0 7 | 5 T 1 1 1 3 8 | 6 T 1 2 1 3 9 | 7 CNOT 2 0 1 2 4 5 10 | 8 S 1 2 1 6 11 | 9 CNOT 2 2 0 2 8 7 12 | 10 T 1 1 1 7 13 | 11 T 1 0 1 9 14 | 12 CNOT 2 2 1 2 9 10 15 | 13 T 1 1 1 12 16 | 14 CNOT 2 2 0 2 12 11 17 | 15 CNOT 2 0 1 2 14 13 18 | 16 H 1 2 1 14 19 | -------------------------------------------------------------------------------- /olsq/devices/default_1a.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "1a", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 16, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], 6 | [0, 8], [1, 9], [2, 10], [3, 11], [4, 12], [5, 13], [6, 14], [7, 15], 7 | [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15]] 8 | } -------------------------------------------------------------------------------- /iccad20/script/tb-olsq/runtriq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # for bench in benchmark/paper/* 4 | # do 5 | # s=${bench##*/} 6 | # echo "$s" 7 | # s=${s%.*} 8 | # echo "$s" 9 | # python "../TriQ/ir2dag.py" "$bench" "result/paper/${s}_ibmq14_triq.in" & 10 | # done 11 | 12 | for infile in ../ExQuS/result/paper/*.in 13 | do 14 | ./triq "$infile" "${infile%.*}_ibmq14_triq_fidelity.qasm" | tee "${infile%.*}_ibmq14_triq_fidelity" & 15 | done 16 | -------------------------------------------------------------------------------- /olsq/devices/default_grid2by3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grid2by3", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 6, 5 | "list_qubit_edge": [[0, 1], [1, 2], [0, 3], [1, 4], [2, 5], [3, 4], [4, 5]], 6 | "list_fidelity_measure": [0.928, 0.928, 0.928, 0.928, 0.928, 0.928], 7 | "list_fidelity_single":[0.999, 0.999, 0.999, 0.999, 0.999, 0.999], 8 | "list_fidelity_two": [0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955] 9 | } 10 | -------------------------------------------------------------------------------- /iccad20/benchmark/adder.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[4]; 4 | x q[0]; 5 | x q[1]; 6 | h q[3]; 7 | cx q[2], q[3]; 8 | t q[0]; 9 | t q[1]; 10 | t q[2]; 11 | tdg q[3]; 12 | cx q[0], q[1]; 13 | cx q[2], q[3]; 14 | cx q[3], q[0]; 15 | cx q[1], q[2]; 16 | cx q[0], q[1]; 17 | cx q[2], q[3]; 18 | tdg q[0]; 19 | tdg q[1]; 20 | tdg q[2]; 21 | t q[3]; 22 | cx q[0], q[1]; 23 | cx q[2], q[3]; 24 | s q[3]; 25 | cx q[3], q[0]; 26 | h q[3]; 27 | -------------------------------------------------------------------------------- /olsq/benchmarks/4mod5-v1_22.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | x q[4]; 6 | cx q[0], q[2]; 7 | cx q[1], q[3]; 8 | h q[4]; 9 | t q[2]; 10 | t q[3]; 11 | t q[4]; 12 | cx q[3], q[2]; 13 | cx q[4], q[3]; 14 | cx q[2], q[4]; 15 | tdg q[3]; 16 | cx q[2], q[3]; 17 | tdg q[2]; 18 | tdg q[3]; 19 | t q[4]; 20 | cx q[4], q[3]; 21 | cx q[2], q[4]; 22 | cx q[3], q[2]; 23 | h q[4]; 24 | cx q[2], q[3]; 25 | cx q[3], q[4]; 26 | -------------------------------------------------------------------------------- /olsq/benchmarks/adder.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[4]; 4 | x q[0]; 5 | x q[1]; 6 | h q[3]; 7 | cx q[2], q[3]; 8 | t q[0]; 9 | t q[1]; 10 | t q[2]; 11 | tdg q[3]; 12 | cx q[0], q[1]; 13 | cx q[2], q[3]; 14 | cx q[3], q[0]; 15 | cx q[1], q[2]; 16 | cx q[0], q[1]; 17 | cx q[2], q[3]; 18 | tdg q[0]; 19 | tdg q[1]; 20 | tdg q[2]; 21 | t q[3]; 22 | cx q[0], q[1]; 23 | cx q[2], q[3]; 24 | s q[3]; 25 | cx q[3], q[0]; 26 | h q[3]; 27 | -------------------------------------------------------------------------------- /iccad20/benchmark/4mod5-v1_22.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | x q[4]; 6 | cx q[0], q[2]; 7 | cx q[1], q[3]; 8 | h q[4]; 9 | t q[2]; 10 | t q[3]; 11 | t q[4]; 12 | cx q[3], q[2]; 13 | cx q[4], q[3]; 14 | cx q[2], q[4]; 15 | tdg q[3]; 16 | cx q[2], q[3]; 17 | tdg q[2]; 18 | tdg q[3]; 19 | t q[4]; 20 | cx q[4], q[3]; 21 | cx q[2], q[4]; 22 | cx q[3], q[2]; 23 | h q[4]; 24 | cx q[2], q[3]; 25 | cx q[3], q[4]; 26 | -------------------------------------------------------------------------------- /olsq/devices/default_2b.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "2b", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 16, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], 6 | [0, 8], [1, 9], [2, 10], [3, 11], [4, 12], [5, 13], [6, 14], [7, 15], 7 | [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], 8 | [1, 8], [1, 10], [3, 10], [3, 12], [5, 12], [5, 14], [7, 14]] 9 | } -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa.in: -------------------------------------------------------------------------------- 1 | 5 22 2 | 0 H 1 0 0 3 | 1 H 1 1 0 4 | 2 H 1 2 0 5 | 3 H 1 3 0 6 | 4 H 1 4 0 7 | 5 CNOT 2 0 1 2 0 1 8 | 6 Y 1 1 1 5 9 | 7 CNOT 2 0 1 2 5 6 10 | 8 CNOT 2 1 2 2 7 2 11 | 9 Y 1 2 1 8 12 | 10 CNOT 2 1 2 2 8 9 13 | 11 CNOT 2 2 3 2 10 3 14 | 12 Y 1 3 1 11 15 | 13 CNOT 2 2 3 2 11 12 16 | 14 CNOT 2 3 4 2 13 4 17 | 15 Y 1 4 1 14 18 | 16 CNOT 2 3 4 2 14 15 19 | 17 X 1 0 1 7 20 | 18 X 1 1 1 10 21 | 19 X 1 2 1 13 22 | 20 X 1 3 1 16 23 | 21 X 1 4 1 16 24 | -------------------------------------------------------------------------------- /olsq/devices/default_2a.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "2a", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 16, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], 6 | [0, 8], [1, 9], [2, 10], [3, 11], [4, 12], [5, 13], [6, 14], [7, 15], 7 | [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15], 8 | [0, 9], [1, 8], [2, 11], [3, 10], [4, 13], [5, 12], [6, 15], [7, 14]] 9 | } -------------------------------------------------------------------------------- /iccad20/result/olsq/or_ibmqx2/or_ibmqx2_wille.qasm: -------------------------------------------------------------------------------- 1 | // 0->2, 1->4, 2->3 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[5]; 5 | creg c[3]; 6 | x q[2]; 7 | tdg q[4]; 8 | h q[3]; 9 | cx q[3], q[4]; 10 | tdg q[2]; 11 | t q[4]; 12 | tdg q[3]; 13 | cx q[2], q[4]; 14 | sdg q[3]; 15 | cx q[3], q[2]; 16 | t q[4]; 17 | t q[2]; 18 | cx q[3], q[4]; 19 | tdg q[4]; 20 | cx q[3], q[2]; 21 | cx q[2], q[4]; 22 | h q[3]; 23 | measure q[2]->c[0]; 24 | measure q[4]->c[1]; 25 | measure q[3]->c[2]; 26 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa.in: -------------------------------------------------------------------------------- 1 | 5 22 2 | 0 H 1 0 0 3 | 1 H 1 1 0 4 | 2 H 1 2 0 5 | 3 H 1 3 0 6 | 4 H 1 4 0 7 | 5 CNOT 2 0 1 2 0 1 8 | 6 Y 1 1 1 5 9 | 7 CNOT 2 0 1 2 5 6 10 | 8 CNOT 2 1 2 2 7 2 11 | 9 Y 1 2 1 8 12 | 10 CNOT 2 1 2 2 8 9 13 | 11 CNOT 2 2 3 2 10 3 14 | 12 Y 1 3 1 11 15 | 13 CNOT 2 2 3 2 11 12 16 | 14 CNOT 2 3 4 2 13 4 17 | 15 Y 1 4 1 14 18 | 16 CNOT 2 3 4 2 14 15 19 | 17 X 1 0 1 7 20 | 18 X 1 1 1 10 21 | 19 X 1 2 1 13 22 | 20 X 1 3 1 16 23 | 21 X 1 4 1 16 24 | -------------------------------------------------------------------------------- /iccad20/benchmark/qaoa5.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | 5 | h q[0]; 6 | h q[1]; 7 | h q[2]; 8 | h q[3]; 9 | h q[4]; 10 | cx q[0], q[1]; 11 | rz(1.571) q[1]; 12 | cx q[0], q[1]; 13 | cx q[1], q[2]; 14 | rz(1.571) q[2]; 15 | cx q[1], q[2]; 16 | cx q[2], q[3]; 17 | rz(1.571) q[3]; 18 | cx q[2], q[3]; 19 | cx q[3], q[4]; 20 | rz(1.571) q[4]; 21 | cx q[3], q[4]; 22 | rx(2.356) q[0]; 23 | rx(2.356) q[1]; 24 | rx(2.356) q[2]; 25 | rx(2.356) q[3]; 26 | rx(2.356) q[4]; 27 | -------------------------------------------------------------------------------- /olsq/benchmarks/qaoa5.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | 5 | h q[0]; 6 | h q[1]; 7 | h q[2]; 8 | h q[3]; 9 | h q[4]; 10 | cx q[0], q[1]; 11 | rz(1.571) q[1]; 12 | cx q[0], q[1]; 13 | cx q[1], q[2]; 14 | rz(1.571) q[2]; 15 | cx q[1], q[2]; 16 | cx q[2], q[3]; 17 | rz(1.571) q[3]; 18 | cx q[2], q[3]; 19 | cx q[3], q[4]; 20 | rz(1.571) q[4]; 21 | cx q[3], q[4]; 22 | rx(2.356) q[0]; 23 | rx(2.356) q[1]; 24 | rx(2.356) q[2]; 25 | rx(2.356) q[3]; 26 | rx(2.356) q[4]; 27 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22.in: -------------------------------------------------------------------------------- 1 | 5 21 2 | 0 X 1 4 0 3 | 1 CNOT 2 0 2 0 4 | 2 CNOT 2 1 3 0 5 | 3 H 1 4 1 0 6 | 4 T 1 2 1 1 7 | 5 T 1 3 1 2 8 | 6 T 1 4 1 3 9 | 7 CNOT 2 3 2 2 5 4 10 | 8 CNOT 2 4 3 2 6 7 11 | 9 CNOT 2 2 4 2 7 8 12 | 10 T 1 3 1 8 13 | 11 CNOT 2 2 3 2 9 10 14 | 12 T 1 2 1 11 15 | 13 T 1 3 1 11 16 | 14 T 1 4 1 9 17 | 15 CNOT 2 4 3 2 14 13 18 | 16 CNOT 2 2 4 2 12 15 19 | 17 CNOT 2 3 2 2 15 16 20 | 18 H 1 4 1 16 21 | 19 CNOT 2 2 3 2 17 17 22 | 20 CNOT 2 3 4 2 19 18 23 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_melbourne/4mod5-v1_22.in: -------------------------------------------------------------------------------- 1 | 5 21 2 | 0 X 1 4 0 3 | 1 CNOT 2 0 2 0 4 | 2 CNOT 2 1 3 0 5 | 3 H 1 4 1 0 6 | 4 T 1 2 1 1 7 | 5 T 1 3 1 2 8 | 6 T 1 4 1 3 9 | 7 CNOT 2 3 2 2 5 4 10 | 8 CNOT 2 4 3 2 6 7 11 | 9 CNOT 2 2 4 2 7 8 12 | 10 T 1 3 1 8 13 | 11 CNOT 2 2 3 2 9 10 14 | 12 T 1 2 1 11 15 | 13 T 1 3 1 11 16 | 14 T 1 4 1 9 17 | 15 CNOT 2 4 3 2 14 13 18 | 16 CNOT 2 2 4 2 12 15 19 | 17 CNOT 2 3 2 2 15 16 20 | 18 H 1 4 1 16 21 | 19 CNOT 2 2 3 2 17 17 22 | 20 CNOT 2 3 4 2 19 18 23 | -------------------------------------------------------------------------------- /olsq/devices/default_1b.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "1b", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 16, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], 6 | [0, 4], [1, 5], [2, 6], [3, 7], 7 | [4, 5], [5, 6], [6, 7], 8 | [4, 8], [5, 9], [6, 10], [7, 11], 9 | [8, 9], [9, 10], [10, 11], 10 | [8, 12], [9, 13], [10, 14], [11, 15], 11 | [12, 13], [13, 14], [14, 15]] 12 | } -------------------------------------------------------------------------------- /olsq/devices/default_grid2by4.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grid2by4", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 8, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], [0, 4], [1, 5], [2, 6], [3, 7], [4, 5], [5, 6], [6, 7]], 6 | "list_fidelity_measure": [0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928], 7 | "list_fidelity_single": [0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999], 8 | "list_fidelity_two": [0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955] 9 | } 10 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder.in: -------------------------------------------------------------------------------- 1 | 4 23 2 | 0 X 1 0 0 3 | 1 X 1 1 0 4 | 2 H 1 3 0 5 | 3 CNOT 2 2 3 1 2 6 | 4 T 1 0 1 0 7 | 5 T 1 1 1 1 8 | 6 T 1 2 1 3 9 | 7 T 1 3 1 3 10 | 8 CNOT 2 0 1 2 4 5 11 | 9 CNOT 2 2 3 2 6 7 12 | 10 CNOT 2 3 0 2 9 8 13 | 11 CNOT 2 1 2 2 8 9 14 | 12 CNOT 2 0 1 2 10 11 15 | 13 CNOT 2 2 3 2 11 10 16 | 14 T 1 0 1 12 17 | 15 T 1 1 1 12 18 | 16 T 1 2 1 13 19 | 17 T 1 3 1 13 20 | 18 CNOT 2 0 1 2 14 15 21 | 19 CNOT 2 2 3 2 16 17 22 | 20 S 1 3 1 19 23 | 21 CNOT 2 3 0 2 20 18 24 | 22 H 1 3 1 21 25 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder.in: -------------------------------------------------------------------------------- 1 | 4 23 2 | 0 X 1 0 0 3 | 1 X 1 1 0 4 | 2 H 1 3 0 5 | 3 CNOT 2 2 3 1 2 6 | 4 T 1 0 1 0 7 | 5 T 1 1 1 1 8 | 6 T 1 2 1 3 9 | 7 T 1 3 1 3 10 | 8 CNOT 2 0 1 2 4 5 11 | 9 CNOT 2 2 3 2 6 7 12 | 10 CNOT 2 3 0 2 9 8 13 | 11 CNOT 2 1 2 2 8 9 14 | 12 CNOT 2 0 1 2 10 11 15 | 13 CNOT 2 2 3 2 11 10 16 | 14 T 1 0 1 12 17 | 15 T 1 1 1 12 18 | 16 T 1 2 1 13 19 | 17 T 1 3 1 13 20 | 18 CNOT 2 0 1 2 14 15 21 | 19 CNOT 2 2 3 2 16 17 22 | 20 S 1 3 1 19 23 | 21 CNOT 2 3 0 2 20 18 24 | 22 H 1 3 1 21 25 | -------------------------------------------------------------------------------- /iccad20/result/olsq/or_ibmqx2/or_ibmqx2_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[3]; 5 | u1(-pi/4) q[0]; 6 | u3(pi,0,pi) q[1]; 7 | u1(-pi/4) q[1]; 8 | u2(0,pi) q[2]; 9 | cx q[2],q[0]; 10 | u1(pi/4) q[0]; 11 | cx q[1],q[0]; 12 | u1(pi/4) q[0]; 13 | u1(-pi/4) q[2]; 14 | u1(-pi/2) q[2]; 15 | cx q[2],q[1]; 16 | u1(pi/4) q[1]; 17 | cx q[2],q[0]; 18 | u1(-pi/4) q[0]; 19 | cx q[2],q[1]; 20 | cx q[1],q[0]; 21 | u2(0,pi) q[2]; 22 | measure q[1] -> c[0]; 23 | measure q[0] -> c[1]; 24 | measure q[2] -> c[2]; 25 | -------------------------------------------------------------------------------- /iccad20/result/olsq/or_ibmqx2/or_ibmqx2_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[3]; 5 | u2(0,pi) q[2]; 6 | u3(pi,0,pi) q[3]; 7 | u1(-pi/4) q[3]; 8 | u1(-pi/4) q[4]; 9 | cx q[2],q[4]; 10 | u1(-pi/4) q[2]; 11 | u1(-pi/2) q[2]; 12 | u1(pi/4) q[4]; 13 | cx q[3],q[4]; 14 | cx q[2],q[3]; 15 | u1(pi/4) q[3]; 16 | u1(pi/4) q[4]; 17 | cx q[2],q[4]; 18 | cx q[2],q[3]; 19 | u2(0,pi) q[2]; 20 | u1(-pi/4) q[4]; 21 | cx q[3],q[4]; 22 | measure q[3] -> c[0]; 23 | measure q[4] -> c[1]; 24 | measure q[2] -> c[2]; 25 | -------------------------------------------------------------------------------- /iccad20/result/olsq/or_ibmqx2/or_ibmqx2_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[3]; 5 | u1(-pi/4) q[0]; 6 | u2(0,pi) q[1]; 7 | cx q[1],q[0]; 8 | u1(pi/4) q[0]; 9 | u1(-pi/4) q[1]; 10 | u1(-pi/2) q[1]; 11 | u3(pi,0,pi) q[2]; 12 | u1(-pi/4) q[2]; 13 | cx q[2],q[0]; 14 | u1(pi/4) q[0]; 15 | cx q[1],q[2]; 16 | cx q[1],q[0]; 17 | u1(-pi/4) q[0]; 18 | u1(pi/4) q[2]; 19 | cx q[1],q[2]; 20 | u2(0,pi) q[1]; 21 | cx q[2],q[0]; 22 | measure q[2] -> c[0]; 23 | measure q[0] -> c[1]; 24 | measure q[1] -> c[2]; 25 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_triq.in: -------------------------------------------------------------------------------- 1 | 4 23 2 | 0 X 1 0 0 3 | 1 X 1 1 0 4 | 2 H 1 3 0 5 | 3 CNOT 2 2 3 1 2 6 | 4 T 1 0 1 0 7 | 5 T 1 1 1 1 8 | 6 T 1 2 1 3 9 | 7 T 1 3 1 3 10 | 8 CNOT 2 0 1 2 4 5 11 | 9 CNOT 2 2 3 2 6 7 12 | 10 CNOT 2 3 0 2 9 8 13 | 11 CNOT 2 1 2 2 8 9 14 | 12 CNOT 2 0 1 2 10 11 15 | 13 CNOT 2 2 3 2 11 10 16 | 14 T 1 0 1 12 17 | 15 T 1 1 1 12 18 | 16 T 1 2 1 13 19 | 17 T 1 3 1 13 20 | 18 CNOT 2 0 1 2 14 15 21 | 19 CNOT 2 2 3 2 16 17 22 | 20 S 1 3 1 19 23 | 21 CNOT 2 3 0 2 20 18 24 | 22 H 1 3 1 21 25 | -------------------------------------------------------------------------------- /iccad20/result/olsq/qaoa5_ibmqx2/qaoa_ibmqx2_wille.qasm: -------------------------------------------------------------------------------- 1 | // 0->0, 1->1, 2->2, 3->3, 4->4 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[5]; 5 | creg c[5]; 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[3]; 10 | h q[4]; 11 | cx q[0], q[1]; 12 | rz(1.571) q[1]; 13 | cx q[0], q[1]; 14 | cx q[1], q[2]; 15 | rz(1.571) q[2]; 16 | cx q[1], q[2]; 17 | cx q[2], q[3]; 18 | rz(1.571) q[3]; 19 | cx q[2], q[3]; 20 | cx q[3], q[4]; 21 | rz(1.571) q[4]; 22 | cx q[3], q[4]; 23 | rx(2.356) q[0]; 24 | rx(2.356) q[1]; 25 | rx(2.356) q[2]; 26 | rx(2.356) q[3]; 27 | rx(2.356) q[4]; 28 | measure q->c; 29 | -------------------------------------------------------------------------------- /olsq/devices/default_sycamore23.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sycamore23", 3 | "swap_duration": 1, 4 | "count_physical_qubit": 23, 5 | "list_qubit_edge": [[0, 2], [1, 2], [2, 3], [1, 5], [2, 6], [3, 7], 6 | [4, 5], [5, 6], [6, 7], [7, 8], 7 | [4, 10], [5, 11], [6, 12], [7, 13], 8 | [9, 10], [10, 11], [11, 12], [12, 13], 9 | [9, 15], [10, 16], [11, 17], [12, 18], 10 | [14, 15], [15, 16], [16, 17], [17, 18], 11 | [15, 19], [16, 20], [17, 21], [19, 20], [20, 21], [20, 22]] 12 | } 13 | -------------------------------------------------------------------------------- /iccad20/benchmark/mod5mils_65.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | cx q[1], q[3]; 6 | x q[3]; 7 | h q[4]; 8 | t q[3]; 9 | t q[0]; 10 | t q[4]; 11 | cx q[0], q[3]; 12 | cx q[4], q[0]; 13 | cx q[3], q[4]; 14 | tdg q[0]; 15 | cx q[3], q[0]; 16 | tdg q[3]; 17 | tdg q[0]; 18 | t q[4]; 19 | cx q[4], q[0]; 20 | cx q[3], q[4]; 21 | cx q[0], q[3]; 22 | h q[4]; 23 | h q[4]; 24 | t q[3]; 25 | t q[2]; 26 | t q[4]; 27 | cx q[2], q[3]; 28 | cx q[4], q[2]; 29 | cx q[3], q[4]; 30 | tdg q[2]; 31 | cx q[3], q[2]; 32 | tdg q[3]; 33 | tdg q[2]; 34 | t q[4]; 35 | cx q[4], q[2]; 36 | cx q[3], q[4]; 37 | cx q[2], q[3]; 38 | h q[4]; 39 | cx q[3], q[4]; 40 | -------------------------------------------------------------------------------- /olsq/benchmarks/mod5mils_65.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | cx q[1], q[3]; 6 | x q[3]; 7 | h q[4]; 8 | t q[3]; 9 | t q[0]; 10 | t q[4]; 11 | cx q[0], q[3]; 12 | cx q[4], q[0]; 13 | cx q[3], q[4]; 14 | tdg q[0]; 15 | cx q[3], q[0]; 16 | tdg q[3]; 17 | tdg q[0]; 18 | t q[4]; 19 | cx q[4], q[0]; 20 | cx q[3], q[4]; 21 | cx q[0], q[3]; 22 | h q[4]; 23 | h q[4]; 24 | t q[3]; 25 | t q[2]; 26 | t q[4]; 27 | cx q[2], q[3]; 28 | cx q[4], q[2]; 29 | cx q[3], q[4]; 30 | tdg q[2]; 31 | cx q[3], q[2]; 32 | tdg q[3]; 33 | tdg q[2]; 34 | t q[4]; 35 | cx q[4], q[2]; 36 | cx q[3], q[4]; 37 | cx q[2], q[3]; 38 | h q[4]; 39 | cx q[3], q[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or_ibmqx2_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u3(3.14159265358979,0.785398163397448,3.14159265358979) q[1]; 6 | u2(0,3.14159265358979) q[2]; 7 | u1(0.785398163397448) q[0]; 8 | cx q[2],q[0]; 9 | u1(0.785398163397448) q[2]; 10 | u1(0.785398163397448) q[0]; 11 | cx q[1],q[0]; 12 | u1(1.5707963267949) q[2]; 13 | u1(0.785398163397448) q[0]; 14 | cx q[2],q[1]; 15 | u1(0.785398163397448) q[1]; 16 | cx q[2],q[0]; 17 | u1(0.785398163397448) q[0]; 18 | cx q[2],q[1]; 19 | cx q[1],q[0]; 20 | u2(0,3.14159265358979) q[2]; 21 | measure q[1] -> c[0]; 22 | measure q[2] -> c[2]; 23 | measure q[0] -> c[1]; 24 | -------------------------------------------------------------------------------- /olsq/benchmarks/queko_05_0.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | x q[2]; 5 | x q[11]; 6 | x q[1]; 7 | x q[13]; 8 | x q[0]; 9 | x q[14]; 10 | x q[6]; 11 | cx q[3], q[9]; 12 | cx q[8], q[12]; 13 | x q[2]; 14 | x q[9]; 15 | x q[7]; 16 | x q[3]; 17 | x q[4]; 18 | x q[1]; 19 | x q[15]; 20 | cx q[10], q[11]; 21 | cx q[8], q[12]; 22 | cx q[14], q[6]; 23 | x q[1]; 24 | x q[12]; 25 | cx q[8], q[2]; 26 | cx q[3], q[9]; 27 | cx q[5], q[4]; 28 | cx q[6], q[0]; 29 | cx q[14], q[10]; 30 | x q[10]; 31 | cx q[8], q[12]; 32 | cx q[14], q[6]; 33 | cx q[1], q[4]; 34 | x q[15]; 35 | x q[1]; 36 | x q[6]; 37 | x q[9]; 38 | x q[0]; 39 | cx q[8], q[12]; 40 | cx q[14], q[10]; 41 | -------------------------------------------------------------------------------- /olsq/devices/default_3b.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "3b", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 16, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], 6 | [0, 4], [1, 5], [2, 6], [3, 7], 7 | [4, 5], [5, 6], [6, 7], 8 | [4, 8], [5, 9], [6, 10], [7, 11], 9 | [8, 9], [9, 10], [10, 11], 10 | [8, 12], [9, 13], [10, 14], [11, 15], 11 | [12, 13], [13, 14], [14, 15], 12 | [0, 5], [2, 5], [2, 7], 13 | [4, 9], [6, 9], [6, 11], 14 | [8, 13], [10, 13], [10, 15]] 15 | } -------------------------------------------------------------------------------- /iccad20/benchmark/16QBT_05CYC_TFL_0.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | x q[2]; 5 | x q[11]; 6 | x q[1]; 7 | x q[13]; 8 | x q[0]; 9 | x q[14]; 10 | x q[6]; 11 | cx q[3], q[9]; 12 | cx q[8], q[12]; 13 | x q[2]; 14 | x q[9]; 15 | x q[7]; 16 | x q[3]; 17 | x q[4]; 18 | x q[1]; 19 | x q[15]; 20 | cx q[10], q[11]; 21 | cx q[8], q[12]; 22 | cx q[14], q[6]; 23 | x q[1]; 24 | x q[12]; 25 | cx q[8], q[2]; 26 | cx q[3], q[9]; 27 | cx q[5], q[4]; 28 | cx q[6], q[0]; 29 | cx q[14], q[10]; 30 | x q[10]; 31 | cx q[8], q[12]; 32 | cx q[14], q[6]; 33 | cx q[1], q[4]; 34 | x q[15]; 35 | x q[1]; 36 | x q[6]; 37 | x q[9]; 38 | x q[0]; 39 | cx q[8], q[12]; 40 | cx q[14], q[10]; 41 | -------------------------------------------------------------------------------- /olsq/devices/default_3a.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "3a", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 16, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], 6 | [0, 4], [1, 5], [2, 6], [3, 7], 7 | [4, 5], [5, 6], [6, 7], 8 | [4, 8], [5, 9], [6, 10], [7, 11], 9 | [8, 9], [9, 10], [10, 11], 10 | [8, 12], [9, 13], [10, 14], [11, 15], 11 | [12, 13], [13, 14], [14, 15], 12 | [0, 5], [1, 4], [2, 7], [3, 6], 13 | [5, 10], [6, 9], 14 | [8, 13], [9, 12], [10, 15], [11, 14]] 15 | } -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by3/adder_grid2by3_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[6]; 4 | creg c[4]; 5 | u3(pi,0,pi) q[1]; 6 | u1(pi/4) q[1]; 7 | u3(pi,0,pi) q[2]; 8 | u1(pi/4) q[2]; 9 | cx q[1],q[2]; 10 | u2(0,pi) q[4]; 11 | cx q[5],q[4]; 12 | u1(-pi/4) q[4]; 13 | u1(pi/4) q[5]; 14 | cx q[5],q[4]; 15 | cx q[2],q[5]; 16 | cx q[4],q[1]; 17 | cx q[1],q[2]; 18 | u1(-pi/4) q[1]; 19 | u1(-pi/4) q[2]; 20 | cx q[1],q[2]; 21 | cx q[5],q[4]; 22 | u1(pi/4) q[4]; 23 | u1(-pi/4) q[5]; 24 | cx q[5],q[4]; 25 | u1(pi/2) q[4]; 26 | cx q[4],q[1]; 27 | u2(0,pi) q[4]; 28 | measure q[1] -> c[0]; 29 | measure q[2] -> c[1]; 30 | measure q[5] -> c[2]; 31 | measure q[4] -> c[3]; 32 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by4/adder_grid2by4_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[8]; 4 | creg c[4]; 5 | u2(0,pi) q[0]; 6 | cx q[1],q[0]; 7 | u1(-pi/4) q[0]; 8 | u1(pi/4) q[1]; 9 | cx q[1],q[0]; 10 | u3(pi,0,pi) q[4]; 11 | u1(pi/4) q[4]; 12 | u3(pi,0,pi) q[5]; 13 | u1(pi/4) q[5]; 14 | cx q[4],q[5]; 15 | cx q[0],q[4]; 16 | cx q[5],q[1]; 17 | cx q[1],q[0]; 18 | u1(pi/4) q[0]; 19 | u1(-pi/4) q[1]; 20 | cx q[1],q[0]; 21 | u1(pi/2) q[0]; 22 | cx q[4],q[5]; 23 | u1(-pi/4) q[4]; 24 | u1(-pi/4) q[5]; 25 | cx q[4],q[5]; 26 | cx q[0],q[4]; 27 | u2(0,pi) q[0]; 28 | measure q[4] -> c[0]; 29 | measure q[5] -> c[1]; 30 | measure q[1] -> c[2]; 31 | measure q[0] -> c[3]; 32 | -------------------------------------------------------------------------------- /olsq/devices/default_tokyo.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tokyo", 3 | "swap_duration" : 3, 4 | "count_physical_qubit": 20, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], [3, 4], 6 | [0, 5], [1, 6], [1, 7], [2, 6], [2, 7], [3, 8], [3, 9], [4, 8], [4, 9], 7 | [5, 6], [6, 7], [7, 8], [8, 9], 8 | [5, 10], [5, 11], [6, 10], [6, 11], [7, 12], [7, 13], [8, 12], [8, 13], [9, 14], 9 | [10, 11], [11, 12], [12, 13], [13, 14], 10 | [10, 15], [11, 16], [11, 17], [12, 16], [12, 17], [13, 18], [13, 19], [14, 18], [14, 19], 11 | [15, 16], [16, 17], [17, 18], [18, 19]] 12 | } -------------------------------------------------------------------------------- /iccad20/result/olsq/qaoa5_ibmqx2/qaoa_ibmqx2_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,pi) q[0]; 6 | u2(0,pi) q[1]; 7 | u2(0,pi) q[2]; 8 | u2(0,pi) q[3]; 9 | u2(0,pi) q[4]; 10 | cx q[3],q[4]; 11 | u1(1.571) q[4]; 12 | cx q[3],q[4]; 13 | u2(2.356,0) q[3]; 14 | cx q[4],q[2]; 15 | u1(1.571) q[2]; 16 | cx q[4],q[2]; 17 | cx q[2],q[0]; 18 | u1(1.571) q[0]; 19 | cx q[2],q[0]; 20 | cx q[0],q[1]; 21 | u1(1.571) q[1]; 22 | cx q[0],q[1]; 23 | u2(2.356,0) q[0]; 24 | u2(2.356,0) q[1]; 25 | u2(2.356,0) q[2]; 26 | u2(2.356,0) q[4]; 27 | measure q[3] -> c[0]; 28 | measure q[4] -> c[1]; 29 | measure q[2] -> c[2]; 30 | measure q[0] -> c[3]; 31 | measure q[1] -> c[4]; 32 | -------------------------------------------------------------------------------- /iccad20/result/olsq/qaoa5_ibmqx2/qaoa_ibmqx2_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,pi) q[0]; 6 | u2(0,pi) q[1]; 7 | u2(0,pi) q[2]; 8 | u2(0,pi) q[3]; 9 | u2(0,pi) q[4]; 10 | cx q[4],q[3]; 11 | u1(1.571) q[3]; 12 | cx q[4],q[3]; 13 | cx q[3],q[2]; 14 | u1(1.571) q[2]; 15 | cx q[3],q[2]; 16 | cx q[2],q[1]; 17 | u1(1.571) q[1]; 18 | cx q[2],q[1]; 19 | cx q[1],q[0]; 20 | u1(1.571) q[0]; 21 | cx q[1],q[0]; 22 | u2(2.356,0) q[0]; 23 | u2(2.356,0) q[1]; 24 | u2(2.356,0) q[2]; 25 | u2(2.356,0) q[3]; 26 | u2(2.356,0) q[4]; 27 | measure q[4] -> c[0]; 28 | measure q[3] -> c[1]; 29 | measure q[2] -> c[2]; 30 | measure q[1] -> c[3]; 31 | measure q[0] -> c[4]; 32 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or_ibmqx2_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[3]; 5 | u2(0,3.141592653589793) q[0]; 6 | u1(-0.7853981633974483) q[1]; 7 | cx q[0],q[1]; 8 | u1(-0.7853981633974483) q[0]; 9 | u1(-1.5707963267948966) q[0]; 10 | u1(0.7853981633974483) q[1]; 11 | u3(3.141592653589793,0,3.141592653589793) q[2]; 12 | u1(-0.7853981633974483) q[2]; 13 | cx q[2],q[1]; 14 | cx q[0],q[2]; 15 | u1(0.7853981633974483) q[1]; 16 | cx q[0],q[1]; 17 | u1(-0.7853981633974483) q[1]; 18 | u1(0.7853981633974483) q[2]; 19 | cx q[0],q[2]; 20 | u2(0,3.141592653589793) q[0]; 21 | cx q[2],q[1]; 22 | measure q[2] -> c[0]; 23 | measure q[1] -> c[1]; 24 | measure q[0] -> c[2]; 25 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or_ibmqx2_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[3]; 5 | u1(-0.7853981633974483) q[0]; 6 | u3(3.141592653589793,0,3.141592653589793) q[1]; 7 | u1(-0.7853981633974483) q[1]; 8 | u2(0,3.141592653589793) q[2]; 9 | cx q[2],q[0]; 10 | u1(0.7853981633974483) q[0]; 11 | cx q[1],q[0]; 12 | u1(0.7853981633974483) q[0]; 13 | u1(-0.7853981633974483) q[2]; 14 | u1(-1.5707963267948966) q[2]; 15 | cx q[2],q[1]; 16 | u1(0.7853981633974483) q[1]; 17 | cx q[2],q[0]; 18 | u1(-0.7853981633974483) q[0]; 19 | cx q[2],q[1]; 20 | cx q[1],q[0]; 21 | u2(0,3.141592653589793) q[2]; 22 | measure q[1] -> c[0]; 23 | measure q[0] -> c[1]; 24 | measure q[2] -> c[2]; 25 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_ibmqx2/adder_ibmqx2_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[4]; 5 | u2(0,pi) q[1]; 6 | cx q[0],q[1]; 7 | u1(pi/4) q[0]; 8 | u1(-pi/4) q[1]; 9 | cx q[0],q[1]; 10 | u3(pi,0,pi) q[2]; 11 | u1(pi/4) q[2]; 12 | u3(pi,0,pi) q[3]; 13 | u1(pi/4) q[3]; 14 | cx q[3],q[2]; 15 | cx q[2],q[0]; 16 | cx q[2],q[3]; 17 | cx q[3],q[2]; 18 | cx q[2],q[3]; 19 | cx q[1],q[2]; 20 | cx q[0],q[1]; 21 | u1(-pi/4) q[0]; 22 | u1(pi/4) q[1]; 23 | cx q[0],q[1]; 24 | u1(pi/2) q[1]; 25 | cx q[2],q[3]; 26 | u1(-pi/4) q[2]; 27 | u1(-pi/4) q[3]; 28 | cx q[2],q[3]; 29 | cx q[1],q[2]; 30 | u2(0,pi) q[1]; 31 | measure q[2] -> c[0]; 32 | measure q[3] -> c[1]; 33 | measure q[0] -> c[2]; 34 | measure q[1] -> c[3]; 35 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_ibmqx2/adder_ibmqx2_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[4]; 5 | u2(0,pi) q[1]; 6 | cx q[2],q[1]; 7 | u1(-pi/4) q[1]; 8 | u1(pi/4) q[2]; 9 | cx q[2],q[1]; 10 | u3(pi,0,pi) q[3]; 11 | u1(pi/4) q[3]; 12 | u3(pi,0,pi) q[4]; 13 | u1(pi/4) q[4]; 14 | cx q[4],q[3]; 15 | cx q[3],q[2]; 16 | cx q[1],q[2]; 17 | cx q[2],q[1]; 18 | cx q[1],q[2]; 19 | cx q[2],q[4]; 20 | cx q[1],q[2]; 21 | u1(-pi/4) q[1]; 22 | u1(pi/4) q[2]; 23 | cx q[1],q[2]; 24 | u1(pi/2) q[2]; 25 | cx q[4],q[3]; 26 | u1(-pi/4) q[3]; 27 | u1(-pi/4) q[4]; 28 | cx q[4],q[3]; 29 | cx q[2],q[4]; 30 | u2(0,pi) q[2]; 31 | measure q[4] -> c[0]; 32 | measure q[3] -> c[1]; 33 | measure q[1] -> c[2]; 34 | measure q[2] -> c[3]; 35 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_ibmqx2/adder_ibmqx2_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[4]; 5 | u3(pi,0,pi) q[0]; 6 | u1(pi/4) q[0]; 7 | u3(pi,0,pi) q[2]; 8 | u1(pi/4) q[2]; 9 | cx q[0],q[2]; 10 | u2(0,pi) q[4]; 11 | cx q[3],q[4]; 12 | u1(pi/4) q[3]; 13 | u1(-pi/4) q[4]; 14 | cx q[3],q[4]; 15 | cx q[2],q[3]; 16 | cx q[0],q[2]; 17 | cx q[2],q[0]; 18 | cx q[0],q[2]; 19 | cx q[4],q[2]; 20 | cx q[2],q[0]; 21 | u1(-pi/4) q[0]; 22 | u1(-pi/4) q[2]; 23 | cx q[2],q[0]; 24 | cx q[3],q[4]; 25 | u1(-pi/4) q[3]; 26 | u1(pi/4) q[4]; 27 | cx q[3],q[4]; 28 | u1(pi/2) q[4]; 29 | cx q[4],q[2]; 30 | u2(0,pi) q[4]; 31 | measure q[2] -> c[0]; 32 | measure q[0] -> c[1]; 33 | measure q[3] -> c[2]; 34 | measure q[4] -> c[3]; 35 | -------------------------------------------------------------------------------- /iccad20/result/olsq/qaoa5_ibmqx2/qaoa_ibmqx2_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,pi) q[0]; 6 | u2(0,pi) q[1]; 7 | u2(0,pi) q[2]; 8 | u2(0,pi) q[3]; 9 | u2(0,pi) q[4]; 10 | cx q[4],q[3]; 11 | u1(1.571) q[3]; 12 | cx q[4],q[3]; 13 | cx q[3],q[2]; 14 | u1(1.571) q[2]; 15 | cx q[3],q[2]; 16 | cx q[2],q[0]; 17 | u1(1.571) q[0]; 18 | cx q[2],q[0]; 19 | cx q[0],q[1]; 20 | u1(1.571) q[1]; 21 | cx q[0],q[1]; 22 | u2(2.356,0) q[0]; 23 | u2(2.356,0) q[1]; 24 | u2(2.356,0) q[3]; 25 | u2(2.356,0) q[4]; 26 | cx q[2],q[4]; 27 | cx q[4],q[2]; 28 | cx q[2],q[4]; 29 | u2(2.356,0) q[4]; 30 | measure q[2] -> c[0]; 31 | measure q[3] -> c[1]; 32 | measure q[4] -> c[2]; 33 | measure q[0] -> c[3]; 34 | measure q[1] -> c[4]; 35 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_ibmqx2/or_ibmqx2_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[3]; 4 | creg c[3]; 5 | u1(-0.7853981633974483) node[0]; 6 | u3(3.141592653589793,0,3.141592653589793) node[1]; 7 | u1(-0.7853981633974483) node[1]; 8 | u2(0,3.141592653589793) node[2]; 9 | cx node[2],node[0]; 10 | u1(0.7853981633974483) node[0]; 11 | cx node[1],node[0]; 12 | u1(0.7853981633974483) node[0]; 13 | u1(-0.7853981633974483) node[2]; 14 | u1(-1.5707963267948966) node[2]; 15 | cx node[2],node[1]; 16 | u1(0.7853981633974483) node[1]; 17 | cx node[2],node[0]; 18 | u1(-0.7853981633974483) node[0]; 19 | cx node[2],node[1]; 20 | cx node[1],node[0]; 21 | u2(0,3.141592653589793) node[2]; 22 | measure node[1] -> c[0]; 23 | measure node[0] -> c[1]; 24 | measure node[2] -> c[2]; 25 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa_ibmqx2_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) q[0]; 6 | u2(0,3.141592653589793) q[1]; 7 | u2(0,3.141592653589793) q[2]; 8 | u2(0,3.141592653589793) q[3]; 9 | u2(0,3.141592653589793) q[4]; 10 | cx q[3],q[4]; 11 | u1(1.571) q[4]; 12 | cx q[3],q[4]; 13 | u2(2.356,0) q[3]; 14 | cx q[4],q[2]; 15 | u1(1.571) q[2]; 16 | cx q[4],q[2]; 17 | cx q[2],q[0]; 18 | u1(1.571) q[0]; 19 | cx q[2],q[0]; 20 | cx q[0],q[1]; 21 | u1(1.571) q[1]; 22 | cx q[0],q[1]; 23 | u2(2.356,0) q[0]; 24 | u2(2.356,0) q[1]; 25 | u2(2.356,0) q[2]; 26 | u2(2.356,0) q[4]; 27 | measure q[3] -> c[0]; 28 | measure q[4] -> c[1]; 29 | measure q[2] -> c[2]; 30 | measure q[0] -> c[3]; 31 | measure q[1] -> c[4]; 32 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa_ibmqx2_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) q[0]; 6 | u2(0,3.141592653589793) q[1]; 7 | u2(0,3.141592653589793) q[2]; 8 | u2(0,3.141592653589793) q[3]; 9 | u2(0,3.141592653589793) q[4]; 10 | cx q[3],q[4]; 11 | u1(1.571) q[4]; 12 | cx q[3],q[4]; 13 | u2(2.356,0) q[3]; 14 | cx q[4],q[2]; 15 | u1(1.571) q[2]; 16 | cx q[4],q[2]; 17 | cx q[2],q[1]; 18 | u1(1.571) q[1]; 19 | cx q[2],q[1]; 20 | cx q[1],q[0]; 21 | u1(1.571) q[0]; 22 | cx q[1],q[0]; 23 | u2(2.356,0) q[0]; 24 | u2(2.356,0) q[1]; 25 | u2(2.356,0) q[2]; 26 | u2(2.356,0) q[4]; 27 | measure q[3] -> c[0]; 28 | measure q[4] -> c[1]; 29 | measure q[2] -> c[2]; 30 | measure q[1] -> c[3]; 31 | measure q[0] -> c[4]; 32 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_wille.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | // 0->2, 1->0, 2->3, 3->1, 4->4 6 | x q[4]; 7 | cx q[2], q[3]; 8 | cx q[0], q[1]; 9 | cx q[1], q[2]; // swap 1 2 10 | cx q[2], q[1]; // swap 1 2 11 | cx q[1], q[2]; // swap 1 2 12 | 13 | // 0->1, 1->0, 2->3, 3->2, 4->4 14 | h q[4]; 15 | t q[3]; 16 | t q[2]; 17 | t q[4]; 18 | cx q[2], q[3]; 19 | cx q[4], q[2]; 20 | cx q[3], q[4]; 21 | tdg q[2]; 22 | cx q[3], q[2]; 23 | tdg q[3]; 24 | tdg q[2]; 25 | t q[4]; 26 | cx q[4], q[2]; 27 | cx q[3], q[4]; 28 | cx q[2], q[3]; 29 | h q[4]; 30 | cx q[3], q[2]; 31 | cx q[2], q[4]; 32 | 33 | measure q[1]->c[0]; 34 | measure q[0]->c[1]; 35 | measure q[3]->c[2]; 36 | measure q[2]->c[3]; 37 | measure q[4]->c[4]; 38 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa_ibmq14_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) q[4]; 6 | u2(0,3.141592653589793) q[5]; 7 | u2(0,3.141592653589793) q[6]; 8 | u2(0,3.141592653589793) q[8]; 9 | u2(0,3.141592653589793) q[9]; 10 | cx q[9],q[8]; 11 | u1(1.571) q[8]; 12 | cx q[9],q[8]; 13 | cx q[8],q[6]; 14 | u1(1.571) q[6]; 15 | cx q[8],q[6]; 16 | cx q[6],q[5]; 17 | u1(1.571) q[5]; 18 | cx q[6],q[5]; 19 | cx q[5],q[4]; 20 | u1(1.571) q[4]; 21 | cx q[5],q[4]; 22 | u2(2.356,0) q[4]; 23 | u2(2.356,0) q[5]; 24 | u2(2.356,0) q[6]; 25 | u2(2.356,0) q[8]; 26 | u2(2.356,0) q[9]; 27 | measure q[9] -> c[0]; 28 | measure q[8] -> c[1]; 29 | measure q[6] -> c[2]; 30 | measure q[5] -> c[3]; 31 | measure q[4] -> c[4]; 32 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) q[1]; 6 | u2(0,3.141592653589793) q[2]; 7 | u2(0,3.141592653589793) q[3]; 8 | u2(0,3.141592653589793) q[4]; 9 | cx q[4],q[3]; 10 | u1(1.571) q[3]; 11 | cx q[4],q[3]; 12 | cx q[3],q[2]; 13 | u1(1.571) q[2]; 14 | cx q[3],q[2]; 15 | cx q[2],q[1]; 16 | u1(1.571) q[1]; 17 | cx q[2],q[1]; 18 | u2(2.356,0) q[2]; 19 | u2(2.356,0) q[3]; 20 | u2(2.356,0) q[4]; 21 | u2(0,3.141592653589793) q[13]; 22 | cx q[1],q[13]; 23 | u1(1.571) q[13]; 24 | cx q[1],q[13]; 25 | u2(2.356,0) q[1]; 26 | u2(2.356,0) q[13]; 27 | measure q[4] -> c[0]; 28 | measure q[3] -> c[1]; 29 | measure q[2] -> c[2]; 30 | measure q[1] -> c[3]; 31 | measure q[13] -> c[4]; 32 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_ibmqx2/mod5mils_65.in: -------------------------------------------------------------------------------- 1 | 5 35 2 | 0 CNOT 2 1 3 0 3 | 1 X 1 3 1 0 4 | 2 H 1 4 0 5 | 3 T 1 3 1 1 6 | 4 T 1 0 0 7 | 5 T 1 4 1 2 8 | 6 CNOT 2 0 3 2 4 3 9 | 7 CNOT 2 4 0 2 5 6 10 | 8 CNOT 2 3 4 2 6 7 11 | 9 T 1 0 1 7 12 | 10 CNOT 2 3 0 2 8 9 13 | 11 T 1 3 1 10 14 | 12 T 1 0 1 10 15 | 13 T 1 4 1 8 16 | 14 CNOT 2 4 0 2 13 12 17 | 15 CNOT 2 3 4 2 11 14 18 | 16 CNOT 2 0 3 2 14 15 19 | 17 H 1 4 1 15 20 | 18 H 1 4 1 17 21 | 19 T 1 3 1 16 22 | 20 T 1 2 0 23 | 21 T 1 4 1 18 24 | 22 CNOT 2 2 3 2 20 19 25 | 23 CNOT 2 4 2 2 21 22 26 | 24 CNOT 2 3 4 2 22 23 27 | 25 T 1 2 1 23 28 | 26 CNOT 2 3 2 2 24 25 29 | 27 T 1 3 1 26 30 | 28 T 1 2 1 26 31 | 29 T 1 4 1 24 32 | 30 CNOT 2 4 2 2 29 28 33 | 31 CNOT 2 3 4 2 27 30 34 | 32 CNOT 2 2 3 2 30 31 35 | 33 H 1 4 1 31 36 | 34 CNOT 2 3 4 2 32 33 37 | -------------------------------------------------------------------------------- /olsq/devices/default_aspen4.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aspen4", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 16, 5 | "list_qubit_edge": [[0, 1], [1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], 6 | [0, 8], [3, 11], [4, 12], [7, 15], 7 | [8, 9], [9, 10], [10, 11], [11, 12], [12, 13], [13, 14], [14, 15]], 8 | "list_fidelity_measure": [0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928, 0.928], 9 | "list_fidelity_single": [0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999], 10 | "list_fidelity_two": [0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955, 0.955] 11 | } 12 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_melbourne/mod5mils_65.in: -------------------------------------------------------------------------------- 1 | 5 35 2 | 0 CNOT 2 1 3 0 3 | 1 X 1 3 1 0 4 | 2 H 1 4 0 5 | 3 T 1 3 1 1 6 | 4 T 1 0 0 7 | 5 T 1 4 1 2 8 | 6 CNOT 2 0 3 2 4 3 9 | 7 CNOT 2 4 0 2 5 6 10 | 8 CNOT 2 3 4 2 6 7 11 | 9 T 1 0 1 7 12 | 10 CNOT 2 3 0 2 8 9 13 | 11 T 1 3 1 10 14 | 12 T 1 0 1 10 15 | 13 T 1 4 1 8 16 | 14 CNOT 2 4 0 2 13 12 17 | 15 CNOT 2 3 4 2 11 14 18 | 16 CNOT 2 0 3 2 14 15 19 | 17 H 1 4 1 15 20 | 18 H 1 4 1 17 21 | 19 T 1 3 1 16 22 | 20 T 1 2 0 23 | 21 T 1 4 1 18 24 | 22 CNOT 2 2 3 2 20 19 25 | 23 CNOT 2 4 2 2 21 22 26 | 24 CNOT 2 3 4 2 22 23 27 | 25 T 1 2 1 23 28 | 26 CNOT 2 3 2 2 24 25 29 | 27 T 1 3 1 26 30 | 28 T 1 2 1 26 31 | 29 T 1 4 1 24 32 | 30 CNOT 2 4 2 2 29 28 33 | 31 CNOT 2 3 4 2 27 30 34 | 32 CNOT 2 2 3 2 30 31 35 | 33 H 1 4 1 31 36 | 34 CNOT 2 3 4 2 32 33 37 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[3]; 5 | u1(-0.7853981633974483) q[8]; 6 | cx q[6],q[8]; 7 | cx q[5],q[6]; 8 | cx q[6],q[5]; 9 | cx q[5],q[6]; 10 | u1(0.7853981633974483) q[8]; 11 | u2(0,3.141592653589793) q[9]; 12 | cx q[9],q[5]; 13 | u1(0.7853981633974483) q[5]; 14 | cx q[9],q[8]; 15 | cx q[9],q[5]; 16 | u3(3.141592653589793,0,3.141592653589793) q[5]; 17 | u1(-0.7853981633974483) q[5]; 18 | cx q[9],q[8]; 19 | cx q[8],q[9]; 20 | cx q[9],q[8]; 21 | u2(0,3.141592653589793) q[8]; 22 | u1(-0.7853981633974483) q[9]; 23 | cx q[8],q[9]; 24 | u1(-0.7853981633974483) q[8]; 25 | u1(-1.5707963267948966) q[8]; 26 | u1(0.7853981633974483) q[9]; 27 | cx q[5],q[9]; 28 | measure q[5] -> c[0]; 29 | measure q[8] -> c[1]; 30 | measure q[9] -> c[2]; 31 | -------------------------------------------------------------------------------- /olsq/devices/default_ibmqx2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ibmqx2", 3 | "swap_duration": 3, 4 | "count_physical_qubit": 5, 5 | "list_qubit_edge": [[0, 1], [0, 2], [1, 2], [2, 3], [2, 4], [3, 4]], 6 | "list_fidelity_two": [0.971324125855421, 7 | 0.9728188875810317, 8 | 0.9632801476247475, 9 | 0.9347599759334276, 10 | 0.9356666889085882, 11 | 0.9502316716169495], 12 | "list_fidelity_measure": [0.846, 0.937, 0.962, 0.97, 0.926], 13 | "list_fidelity_single": [0.9992273692706546, 14 | 0.9988839145121239, 15 | 0.9989697818583652, 16 | 0.9984545411897114, 17 | 0.9987121725030761] 18 | } -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0.in: -------------------------------------------------------------------------------- 1 | 16 37 2 | 0 X 1 2 0 3 | 1 X 1 11 0 4 | 2 X 1 1 0 5 | 3 X 1 13 0 6 | 4 X 1 0 0 7 | 5 X 1 14 0 8 | 6 X 1 6 0 9 | 7 CNOT 2 3 9 0 10 | 8 CNOT 2 8 12 0 11 | 9 X 1 2 1 0 12 | 10 X 1 9 1 7 13 | 11 X 1 7 0 14 | 12 X 1 3 1 7 15 | 13 X 1 4 0 16 | 14 X 1 1 1 2 17 | 15 X 1 15 0 18 | 16 CNOT 2 10 11 1 1 19 | 17 CNOT 2 8 12 2 8 8 20 | 18 CNOT 2 14 6 2 5 6 21 | 19 X 1 1 1 14 22 | 20 X 1 12 1 17 23 | 21 CNOT 2 8 2 2 17 9 24 | 22 CNOT 2 3 9 2 12 10 25 | 23 CNOT 2 5 4 1 13 26 | 24 CNOT 2 6 0 2 18 4 27 | 25 CNOT 2 14 10 2 18 16 28 | 26 X 1 10 1 25 29 | 27 CNOT 2 8 12 2 21 20 30 | 28 CNOT 2 14 6 2 25 24 31 | 29 CNOT 2 1 4 2 19 23 32 | 30 X 1 15 1 15 33 | 31 X 1 1 1 29 34 | 32 X 1 6 1 28 35 | 33 X 1 9 1 22 36 | 34 X 1 0 1 24 37 | 35 CNOT 2 8 12 2 27 27 38 | 36 CNOT 2 14 10 2 28 26 39 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or_ibmq14_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[3]; 5 | cx q[3],q[11]; 6 | u2(0,3.141592653589793) q[3]; 7 | u1(-0.7853981633974483) q[12]; 8 | cx q[11],q[12]; 9 | cx q[11],q[3]; 10 | cx q[3],q[11]; 11 | cx q[11],q[3]; 12 | u1(-0.7853981633974483) q[11]; 13 | u1(-1.5707963267948966) q[11]; 14 | cx q[11],q[3]; 15 | cx q[11],q[12]; 16 | u2(0,3.141592653589793) q[11]; 17 | u1(-0.7853981633974483) q[12]; 18 | cx q[11],q[12]; 19 | u1(0.7853981633974483) q[12]; 20 | u1(0.7853981633974483) q[3]; 21 | cx q[2],q[3]; 22 | cx q[3],q[2]; 23 | cx q[2],q[3]; 24 | u3(3.141592653589793,0,3.141592653589793) q[2]; 25 | u1(-0.7853981633974483) q[2]; 26 | cx q[2],q[12]; 27 | u1(0.7853981633974483) q[12]; 28 | measure q[3] -> c[0]; 29 | measure q[12] -> c[1]; 30 | measure q[11] -> c[2]; 31 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by3/4mod5-v1_22_grid2by3_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[6]; 4 | creg c[5]; 5 | u3(pi,0,pi) q[3]; 6 | u2(0,pi) q[3]; 7 | u1(pi/4) q[3]; 8 | cx q[1],q[4]; 9 | u1(pi/4) q[4]; 10 | cx q[2],q[5]; 11 | u1(pi/4) q[5]; 12 | cx q[4],q[5]; 13 | cx q[3],q[4]; 14 | u1(-pi/4) q[4]; 15 | cx q[4],q[5]; 16 | cx q[5],q[4]; 17 | cx q[4],q[5]; 18 | cx q[4],q[3]; 19 | u1(pi/4) q[3]; 20 | cx q[4],q[5]; 21 | cx q[3],q[4]; 22 | cx q[4],q[3]; 23 | cx q[3],q[4]; 24 | u1(-pi/4) q[3]; 25 | u1(-pi/4) q[5]; 26 | cx q[4],q[5]; 27 | cx q[3],q[4]; 28 | cx q[4],q[5]; 29 | cx q[5],q[4]; 30 | cx q[4],q[5]; 31 | cx q[4],q[3]; 32 | cx q[3],q[4]; 33 | u2(0,pi) q[5]; 34 | cx q[4],q[5]; 35 | measure q[2] -> c[0]; 36 | measure q[1] -> c[1]; 37 | measure q[3] -> c[2]; 38 | measure q[4] -> c[3]; 39 | measure q[5] -> c[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by4/4mod5-v1_22_grid2by4_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[8]; 4 | creg c[5]; 5 | cx q[1],q[5]; 6 | u1(pi/4) q[5]; 7 | cx q[2],q[6]; 8 | u1(pi/4) q[6]; 9 | cx q[6],q[5]; 10 | u3(pi,0,pi) q[7]; 11 | u2(0,pi) q[7]; 12 | u1(pi/4) q[7]; 13 | cx q[7],q[6]; 14 | u1(-pi/4) q[6]; 15 | cx q[5],q[6]; 16 | cx q[6],q[5]; 17 | cx q[5],q[6]; 18 | cx q[6],q[7]; 19 | cx q[6],q[5]; 20 | u1(-pi/4) q[5]; 21 | u1(-pi/4) q[6]; 22 | u1(pi/4) q[7]; 23 | cx q[6],q[7]; 24 | cx q[7],q[6]; 25 | cx q[6],q[7]; 26 | cx q[6],q[5]; 27 | cx q[7],q[6]; 28 | u2(0,pi) q[6]; 29 | cx q[5],q[6]; 30 | cx q[6],q[5]; 31 | cx q[5],q[6]; 32 | cx q[6],q[7]; 33 | cx q[7],q[6]; 34 | cx q[6],q[5]; 35 | measure q[1] -> c[0]; 36 | measure q[2] -> c[1]; 37 | measure q[7] -> c[2]; 38 | measure q[6] -> c[3]; 39 | measure q[5] -> c[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_ibmqx2/adder_ibmqx2_wille.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[4]; 5 | // 0->2, 1->1, 2->3, 3->4 6 | x q[2]; 7 | x q[1]; 8 | h q[3]; 9 | cx q[3], q[4]; 10 | t q[2]; 11 | t q[1]; 12 | t q[3]; 13 | tdg q[4]; 14 | cx q[2], q[1]; 15 | cx q[3], q[4]; 16 | 17 | cx q[2], q[3]; //swap 2 3 18 | cx q[3], q[2]; //swap 2 3 19 | cx q[2], q[3]; //swap 2 3 20 | // 0->3, 1->1, 2->2, 3->4 21 | cx q[4], q[3]; 22 | cx q[1], q[2]; 23 | 24 | cx q[2], q[3]; //swap 2 3 25 | cx q[3], q[2]; //swap 2 3 26 | cx q[2], q[3]; //swap 2 3 27 | // 0->2, 1->1, 2->3, 3->4 28 | cx q[2], q[1]; 29 | cx q[3], q[4]; 30 | tdg q[2]; 31 | tdg q[1]; 32 | tdg q[3]; 33 | t q[4]; 34 | cx q[2], q[1]; 35 | cx q[3], q[4]; 36 | s q[4]; 37 | cx q[4], q[2]; 38 | h q[4]; 39 | measure q[2]->c[0]; 40 | measure q[1]->c[1]; 41 | measure q[3]->c[2]; 42 | measure q[4]->c[3]; 43 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u3(3.141592653589793,0,3.141592653589793) q[1]; 6 | u2(0,3.141592653589793) q[1]; 7 | u1(0.7853981633974483) q[1]; 8 | cx q[2],q[0]; 9 | u1(0.7853981633974483) q[0]; 10 | cx q[3],q[4]; 11 | cx q[2],q[4]; 12 | cx q[4],q[2]; 13 | cx q[2],q[4]; 14 | u1(0.7853981633974483) q[2]; 15 | cx q[0],q[2]; 16 | cx q[1],q[0]; 17 | u1(-0.7853981633974483) q[0]; 18 | cx q[2],q[1]; 19 | u1(0.7853981633974483) q[1]; 20 | cx q[2],q[0]; 21 | u1(-0.7853981633974483) q[0]; 22 | cx q[1],q[0]; 23 | u1(-0.7853981633974483) q[2]; 24 | cx q[2],q[1]; 25 | cx q[0],q[2]; 26 | u2(0,3.141592653589793) q[1]; 27 | cx q[2],q[0]; 28 | cx q[0],q[1]; 29 | measure q[3] -> c[0]; 30 | measure q[4] -> c[1]; 31 | measure q[2] -> c[2]; 32 | measure q[0] -> c[3]; 33 | measure q[1] -> c[4]; 34 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u3(3.141592653589793,0,3.141592653589793) q[1]; 6 | u2(0,3.141592653589793) q[1]; 7 | u1(0.7853981633974483) q[1]; 8 | cx q[2],q[0]; 9 | u1(0.7853981633974483) q[0]; 10 | cx q[3],q[4]; 11 | cx q[2],q[4]; 12 | cx q[4],q[2]; 13 | cx q[2],q[4]; 14 | u1(0.7853981633974483) q[2]; 15 | cx q[0],q[2]; 16 | cx q[1],q[0]; 17 | u1(-0.7853981633974483) q[0]; 18 | cx q[2],q[1]; 19 | u1(0.7853981633974483) q[1]; 20 | cx q[2],q[0]; 21 | u1(-0.7853981633974483) q[0]; 22 | cx q[1],q[0]; 23 | u1(-0.7853981633974483) q[2]; 24 | cx q[2],q[1]; 25 | cx q[0],q[2]; 26 | u2(0,3.141592653589793) q[1]; 27 | cx q[2],q[0]; 28 | cx q[0],q[1]; 29 | measure q[3] -> c[0]; 30 | measure q[4] -> c[1]; 31 | measure q[2] -> c[2]; 32 | measure q[0] -> c[3]; 33 | measure q[1] -> c[4]; 34 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[0]; 6 | u3(3.141592653589793,0,3.141592653589793) q[1]; 7 | u2(0,3.141592653589793) q[1]; 8 | u1(0.7853981633974483) q[1]; 9 | cx q[4],q[2]; 10 | u1(0.7853981633974483) q[2]; 11 | cx q[0],q[2]; 12 | cx q[1],q[0]; 13 | u1(-0.7853981633974483) q[0]; 14 | cx q[2],q[1]; 15 | u1(0.7853981633974483) q[1]; 16 | cx q[2],q[0]; 17 | u1(-0.7853981633974483) q[0]; 18 | cx q[1],q[0]; 19 | u1(-0.7853981633974483) q[2]; 20 | cx q[2],q[1]; 21 | cx q[0],q[2]; 22 | u2(0,3.141592653589793) q[1]; 23 | cx q[2],q[0]; 24 | cx q[0],q[1]; 25 | cx q[2],q[3]; 26 | cx q[3],q[2]; 27 | cx q[2],q[3]; 28 | cx q[2],q[0]; 29 | measure q[4] -> c[0]; 30 | measure q[3] -> c[1]; 31 | measure q[2] -> c[2]; 32 | measure q[0] -> c[3]; 33 | measure q[1] -> c[4]; 34 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by3/adder_grid2by3_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[6]; 4 | creg c[4]; 5 | u3(3.141592653589793,0,3.141592653589793) q[2]; 6 | u1(0.7853981633974483) q[2]; 7 | u2(0,3.141592653589793) q[4]; 8 | cx q[1],q[4]; 9 | u1(0.7853981633974483) q[1]; 10 | u1(-0.7853981633974483) q[4]; 11 | cx q[1],q[4]; 12 | u3(3.141592653589793,0,3.141592653589793) q[5]; 13 | u1(0.7853981633974483) q[5]; 14 | cx q[5],q[2]; 15 | cx q[2],q[1]; 16 | cx q[4],q[5]; 17 | cx q[1],q[4]; 18 | u1(-0.7853981633974483) q[1]; 19 | u1(0.7853981633974483) q[4]; 20 | cx q[1],q[4]; 21 | u1(1.5707963267948966) q[4]; 22 | cx q[5],q[2]; 23 | u1(-0.7853981633974483) q[2]; 24 | u1(-0.7853981633974483) q[5]; 25 | cx q[5],q[2]; 26 | cx q[4],q[5]; 27 | u2(0,3.141592653589793) q[4]; 28 | measure q[5] -> c[0]; 29 | measure q[2] -> c[1]; 30 | measure q[1] -> c[2]; 31 | measure q[4] -> c[3]; 32 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by3/adder_grid2by3_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[6]; 4 | creg c[4]; 5 | u3(3.141592653589793,0,3.141592653589793) q[0]; 6 | u1(0.7853981633974483) q[0]; 7 | u3(3.141592653589793,0,3.141592653589793) q[1]; 8 | u1(0.7853981633974483) q[1]; 9 | cx q[0],q[1]; 10 | u2(0,3.141592653589793) q[3]; 11 | cx q[4],q[3]; 12 | u1(-0.7853981633974483) q[3]; 13 | u1(0.7853981633974483) q[4]; 14 | cx q[4],q[3]; 15 | cx q[1],q[4]; 16 | cx q[3],q[0]; 17 | cx q[0],q[1]; 18 | u1(-0.7853981633974483) q[0]; 19 | u1(-0.7853981633974483) q[1]; 20 | cx q[0],q[1]; 21 | cx q[4],q[3]; 22 | u1(0.7853981633974483) q[3]; 23 | u1(-0.7853981633974483) q[4]; 24 | cx q[4],q[3]; 25 | u1(1.5707963267948966) q[3]; 26 | cx q[3],q[0]; 27 | u2(0,3.141592653589793) q[3]; 28 | measure q[0] -> c[0]; 29 | measure q[1] -> c[1]; 30 | measure q[4] -> c[2]; 31 | measure q[3] -> c[3]; 32 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by4/adder_grid2by4_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[8]; 4 | creg c[4]; 5 | u3(3.141592653589793,0,3.141592653589793) q[0]; 6 | u1(0.7853981633974483) q[0]; 7 | u2(0,3.141592653589793) q[1]; 8 | u3(3.141592653589793,0,3.141592653589793) q[4]; 9 | u1(0.7853981633974483) q[4]; 10 | cx q[0],q[4]; 11 | cx q[5],q[1]; 12 | u1(-0.7853981633974483) q[1]; 13 | u1(0.7853981633974483) q[5]; 14 | cx q[5],q[1]; 15 | cx q[1],q[0]; 16 | cx q[4],q[5]; 17 | cx q[0],q[4]; 18 | u1(-0.7853981633974483) q[0]; 19 | u1(-0.7853981633974483) q[4]; 20 | cx q[0],q[4]; 21 | cx q[5],q[1]; 22 | u1(0.7853981633974483) q[1]; 23 | u1(-0.7853981633974483) q[5]; 24 | cx q[5],q[1]; 25 | u1(1.5707963267948966) q[1]; 26 | cx q[1],q[0]; 27 | u2(0,3.141592653589793) q[1]; 28 | measure q[0] -> c[0]; 29 | measure q[4] -> c[1]; 30 | measure q[5] -> c[2]; 31 | measure q[1] -> c[3]; 32 | -------------------------------------------------------------------------------- /iccad20/result/olsq/adder_grid2by4/adder_grid2by4_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[8]; 4 | creg c[4]; 5 | u2(0,3.141592653589793) q[1]; 6 | u3(3.141592653589793,0,3.141592653589793) q[2]; 7 | u1(0.7853981633974483) q[2]; 8 | cx q[5],q[1]; 9 | u1(-0.7853981633974483) q[1]; 10 | u1(0.7853981633974483) q[5]; 11 | cx q[5],q[1]; 12 | u3(3.141592653589793,0,3.141592653589793) q[6]; 13 | u1(0.7853981633974483) q[6]; 14 | cx q[2],q[6]; 15 | cx q[1],q[2]; 16 | cx q[6],q[5]; 17 | cx q[2],q[6]; 18 | u1(-0.7853981633974483) q[2]; 19 | cx q[5],q[1]; 20 | u1(0.7853981633974483) q[1]; 21 | u1(-0.7853981633974483) q[5]; 22 | cx q[5],q[1]; 23 | u1(1.5707963267948966) q[1]; 24 | u1(-0.7853981633974483) q[6]; 25 | cx q[2],q[6]; 26 | cx q[1],q[2]; 27 | u2(0,3.141592653589793) q[1]; 28 | measure q[2] -> c[0]; 29 | measure q[6] -> c[1]; 30 | measure q[5] -> c[2]; 31 | measure q[1] -> c[3]; 32 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[0]; 6 | cx q[0],q[2]; 7 | cx q[1],q[0]; 8 | u1(-0.7853981633974483) q[0]; 9 | cx q[2],q[1]; 10 | u1(0.7853981633974483) q[1]; 11 | cx q[2],q[0]; 12 | u1(-0.7853981633974483) q[0]; 13 | cx q[1],q[0]; 14 | u1(-0.7853981633974483) q[2]; 15 | cx q[2],q[1]; 16 | cx q[0],q[2]; 17 | u2(0,3.141592653589793) q[1]; 18 | cx q[2],q[0]; 19 | cx q[0],q[1]; 20 | u3(3.141592653589793,0,3.141592653589793) q[1]; 21 | u2(0,3.141592653589793) q[1]; 22 | u1(0.7853981633974483) q[1]; 23 | cx q[2],q[4]; 24 | cx q[4],q[2]; 25 | cx q[2],q[4]; 26 | cx q[2],q[0]; 27 | cx q[3],q[4]; 28 | u1(0.7853981633974483) q[4]; 29 | measure q[3] -> c[0]; 30 | measure q[4] -> c[1]; 31 | measure q[2] -> c[2]; 32 | measure q[0] -> c[3]; 33 | measure q[1] -> c[4]; 34 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[4]; 5 | u2(0,3.141592653589793) q[3]; 6 | cx q[2],q[3]; 7 | u1(0.7853981633974483) q[2]; 8 | u1(-0.7853981633974483) q[3]; 9 | cx q[2],q[3]; 10 | u3(3.141592653589793,0,3.141592653589793) q[11]; 11 | u1(0.7853981633974483) q[11]; 12 | u3(3.141592653589793,0,3.141592653589793) q[12]; 13 | u1(0.7853981633974483) q[12]; 14 | cx q[11],q[12]; 15 | cx q[12],q[2]; 16 | cx q[3],q[11]; 17 | cx q[11],q[12]; 18 | u1(-0.7853981633974483) q[11]; 19 | u1(-0.7853981633974483) q[12]; 20 | cx q[11],q[12]; 21 | cx q[2],q[3]; 22 | u1(-0.7853981633974483) q[2]; 23 | u1(0.7853981633974483) q[3]; 24 | cx q[2],q[3]; 25 | u1(1.5707963267948966) q[3]; 26 | cx q[3],q[11]; 27 | u2(0,3.141592653589793) q[3]; 28 | measure q[11] -> c[0]; 29 | measure q[12] -> c[1]; 30 | measure q[2] -> c[2]; 31 | measure q[3] -> c[3]; 32 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[4]; 5 | u3(3.141592653589793,0,3.141592653589793) q[2]; 6 | u1(0.7853981633974483) q[2]; 7 | u3(3.141592653589793,0,3.141592653589793) q[3]; 8 | u1(0.7853981633974483) q[3]; 9 | cx q[3],q[2]; 10 | u2(0,3.141592653589793) q[11]; 11 | cx q[12],q[11]; 12 | u1(-0.7853981633974483) q[11]; 13 | u1(0.7853981633974483) q[12]; 14 | cx q[12],q[11]; 15 | cx q[11],q[3]; 16 | cx q[2],q[12]; 17 | cx q[12],q[11]; 18 | u1(0.7853981633974483) q[11]; 19 | u1(-0.7853981633974483) q[12]; 20 | cx q[12],q[11]; 21 | u1(1.5707963267948966) q[11]; 22 | cx q[3],q[2]; 23 | u1(-0.7853981633974483) q[2]; 24 | u1(-0.7853981633974483) q[3]; 25 | cx q[3],q[2]; 26 | cx q[11],q[3]; 27 | u2(0,3.141592653589793) q[11]; 28 | measure q[3] -> c[0]; 29 | measure q[2] -> c[1]; 30 | measure q[12] -> c[2]; 31 | measure q[11] -> c[3]; 32 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or_ibmq14_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[6]; 4 | creg c[3]; 5 | u3(3.141592653589793,0,3.141592653589793) node[3]; 6 | u1(-0.7853981633974483) node[3]; 7 | u1(-0.7853981633974483) node[4]; 8 | u2(0,3.141592653589793) node[5]; 9 | cx node[5],node[4]; 10 | u1(0.7853981633974483) node[4]; 11 | cx node[3],node[4]; 12 | u1(0.7853981633974483) node[4]; 13 | u1(-0.7853981633974483) node[5]; 14 | u1(-1.5707963267948966) node[5]; 15 | cx node[5],node[4]; 16 | cx node[4],node[5]; 17 | cx node[5],node[4]; 18 | cx node[4],node[3]; 19 | u1(0.7853981633974483) node[3]; 20 | cx node[4],node[5]; 21 | cx node[4],node[3]; 22 | u2(0,3.141592653589793) node[4]; 23 | u1(-0.7853981633974483) node[5]; 24 | measure node[4] -> c[2]; 25 | cx node[5],node[4]; 26 | cx node[4],node[5]; 27 | cx node[5],node[4]; 28 | cx node[3],node[4]; 29 | measure node[3] -> c[0]; 30 | measure node[4] -> c[1]; 31 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa_ibmq14_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[13]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) node[2]; 6 | u2(0,3.141592653589793) node[3]; 7 | u2(0,3.141592653589793) node[4]; 8 | u2(0,3.141592653589793) node[5]; 9 | cx node[5],node[4]; 10 | u1(1.5710000000000002) node[4]; 11 | cx node[5],node[4]; 12 | cx node[4],node[3]; 13 | u1(1.5710000000000002) node[3]; 14 | cx node[4],node[3]; 15 | cx node[3],node[2]; 16 | u1(1.5710000000000002) node[2]; 17 | cx node[3],node[2]; 18 | u2(2.356,0) node[3]; 19 | u2(2.356,0) node[4]; 20 | u2(2.356,0) node[5]; 21 | u2(0,3.141592653589793) node[12]; 22 | cx node[2],node[12]; 23 | u1(1.5710000000000002) node[12]; 24 | cx node[2],node[12]; 25 | u2(2.356,0) node[12]; 26 | u2(2.356,0) node[2]; 27 | measure node[5] -> c[0]; 28 | measure node[4] -> c[1]; 29 | measure node[3] -> c[2]; 30 | measure node[2] -> c[3]; 31 | measure node[12] -> c[4]; 32 | -------------------------------------------------------------------------------- /olsq/benchmarks/tof_4.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[7]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[1],q[4]; 9 | tdg q[4]; 10 | cx q[0],q[4]; 11 | t q[4]; 12 | cx q[1],q[4]; 13 | tdg q[4]; 14 | cx q[0],q[4]; 15 | t q[4]; 16 | h q[4]; 17 | cx q[4],q[5]; 18 | tdg q[5]; 19 | cx q[2],q[5]; 20 | t q[5]; 21 | cx q[4],q[5]; 22 | tdg q[5]; 23 | cx q[2],q[5]; 24 | t q[5]; 25 | h q[5]; 26 | cx q[5],q[6]; 27 | tdg q[6]; 28 | cx q[3],q[6]; 29 | t q[6]; 30 | cx q[5],q[6]; 31 | tdg q[6]; 32 | cx q[3],q[6]; 33 | cx q[3],q[5]; 34 | t q[6]; 35 | tdg q[5]; 36 | h q[6]; 37 | cx q[3],q[5]; 38 | t q[3]; 39 | t q[5]; 40 | h q[5]; 41 | cx q[4],q[5]; 42 | t q[5]; 43 | cx q[2],q[5]; 44 | tdg q[5]; 45 | cx q[4],q[5]; 46 | h q[4]; 47 | t q[5]; 48 | cx q[1],q[4]; 49 | cx q[2],q[5]; 50 | t q[4]; 51 | tdg q[5]; 52 | cx q[0],q[4]; 53 | h q[5]; 54 | tdg q[4]; 55 | cx q[1],q[4]; 56 | t q[4]; 57 | cx q[0],q[4]; 58 | tdg q[4]; 59 | h q[4]; 60 | -------------------------------------------------------------------------------- /iccad20/benchmark/tof_4_after_heavy.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[7]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[1],q[4]; 9 | tdg q[4]; 10 | cx q[0],q[4]; 11 | t q[4]; 12 | cx q[1],q[4]; 13 | tdg q[4]; 14 | cx q[0],q[4]; 15 | t q[4]; 16 | h q[4]; 17 | cx q[4],q[5]; 18 | tdg q[5]; 19 | cx q[2],q[5]; 20 | t q[5]; 21 | cx q[4],q[5]; 22 | tdg q[5]; 23 | cx q[2],q[5]; 24 | t q[5]; 25 | h q[5]; 26 | cx q[5],q[6]; 27 | tdg q[6]; 28 | cx q[3],q[6]; 29 | t q[6]; 30 | cx q[5],q[6]; 31 | tdg q[6]; 32 | cx q[3],q[6]; 33 | cx q[3],q[5]; 34 | t q[6]; 35 | tdg q[5]; 36 | h q[6]; 37 | cx q[3],q[5]; 38 | t q[3]; 39 | t q[5]; 40 | h q[5]; 41 | cx q[4],q[5]; 42 | t q[5]; 43 | cx q[2],q[5]; 44 | tdg q[5]; 45 | cx q[4],q[5]; 46 | h q[4]; 47 | t q[5]; 48 | cx q[1],q[4]; 49 | cx q[2],q[5]; 50 | t q[4]; 51 | tdg q[5]; 52 | cx q[0],q[4]; 53 | h q[5]; 54 | tdg q[4]; 55 | cx q[1],q[4]; 56 | t q[4]; 57 | cx q[0],q[4]; 58 | tdg q[4]; 59 | h q[4]; 60 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u3(3.141592653589793,0,3.141592653589793) q[1]; 6 | u2(0,3.141592653589793) q[1]; 7 | cx q[2],q[0]; 8 | u1(0.7853981633974483) q[0]; 9 | cx q[0],q[1]; 10 | cx q[1],q[0]; 11 | cx q[0],q[1]; 12 | u1(0.7853981633974483) q[0]; 13 | cx q[3],q[4]; 14 | u1(0.7853981633974483) q[4]; 15 | cx q[2],q[4]; 16 | cx q[4],q[2]; 17 | cx q[2],q[4]; 18 | cx q[2],q[1]; 19 | cx q[0],q[2]; 20 | cx q[1],q[0]; 21 | u1(0.7853981633974483) q[0]; 22 | u1(-0.7853981633974483) q[2]; 23 | cx q[1],q[2]; 24 | u1(-0.7853981633974483) q[1]; 25 | u1(-0.7853981633974483) q[2]; 26 | cx q[0],q[2]; 27 | cx q[1],q[0]; 28 | u2(0,3.141592653589793) q[0]; 29 | cx q[2],q[1]; 30 | cx q[1],q[2]; 31 | cx q[2],q[0]; 32 | measure q[4] -> c[0]; 33 | measure q[3] -> c[1]; 34 | measure q[1] -> c[2]; 35 | measure q[2] -> c[3]; 36 | measure q[0] -> c[4]; 37 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder_ibmqx2_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[4]; 5 | cx q[2],q[3]; 6 | cx q[1],q[2]; 7 | u1(-0.7853981633974483) q[1]; 8 | u1(0.7853981633974483) q[2]; 9 | cx q[1],q[2]; 10 | u1(1.5707963267948966) q[2]; 11 | cx q[3],q[4]; 12 | u1(-0.7853981633974483) q[3]; 13 | u1(-0.7853981633974483) q[4]; 14 | cx q[3],q[4]; 15 | cx q[2],q[3]; 16 | u2(0,3.141592653589793) q[2]; 17 | cx q[1],q[2]; 18 | cx q[2],q[1]; 19 | cx q[1],q[2]; 20 | u2(0,3.141592653589793) q[1]; 21 | cx q[2],q[1]; 22 | u1(-0.7853981633974483) q[1]; 23 | u1(0.7853981633974483) q[2]; 24 | cx q[2],q[1]; 25 | u3(3.141592653589793,0,3.141592653589793) q[3]; 26 | u1(0.7853981633974483) q[3]; 27 | u3(3.141592653589793,0,3.141592653589793) q[4]; 28 | u1(0.7853981633974483) q[4]; 29 | cx q[3],q[4]; 30 | cx q[4],q[2]; 31 | measure q[3] -> c[0]; 32 | measure q[4] -> c[1]; 33 | measure q[1] -> c[2]; 34 | measure q[2] -> c[3]; 35 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder_ibmqx2_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[4]; 5 | cx q[2],q[4]; 6 | cx q[1],q[2]; 7 | u1(-0.7853981633974483) q[1]; 8 | u1(0.7853981633974483) q[2]; 9 | cx q[1],q[2]; 10 | u1(1.5707963267948966) q[2]; 11 | cx q[4],q[3]; 12 | u1(-0.7853981633974483) q[3]; 13 | u1(-0.7853981633974483) q[4]; 14 | cx q[4],q[3]; 15 | cx q[2],q[4]; 16 | u2(0,3.141592653589793) q[2]; 17 | cx q[1],q[2]; 18 | cx q[2],q[1]; 19 | cx q[1],q[2]; 20 | u2(0,3.141592653589793) q[1]; 21 | cx q[2],q[1]; 22 | u1(-0.7853981633974483) q[1]; 23 | u1(0.7853981633974483) q[2]; 24 | cx q[2],q[1]; 25 | u3(3.141592653589793,0,3.141592653589793) q[3]; 26 | u1(0.7853981633974483) q[3]; 27 | u3(3.141592653589793,0,3.141592653589793) q[4]; 28 | u1(0.7853981633974483) q[4]; 29 | cx q[4],q[3]; 30 | cx q[3],q[2]; 31 | measure q[4] -> c[0]; 32 | measure q[3] -> c[1]; 33 | measure q[1] -> c[2]; 34 | measure q[2] -> c[3]; 35 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa_ibmqx2_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[5]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) node[0]; 6 | u2(0,3.141592653589793) node[1]; 7 | u2(0,3.141592653589793) node[2]; 8 | cx node[2],node[0]; 9 | u1(1.5710000000000002) node[0]; 10 | cx node[2],node[0]; 11 | cx node[0],node[1]; 12 | u1(1.5710000000000002) node[1]; 13 | cx node[0],node[1]; 14 | u2(2.356,0) node[0]; 15 | u2(2.356,0) node[2]; 16 | u2(0,3.141592653589793) node[3]; 17 | u2(0,3.141592653589793) node[4]; 18 | measure node[2] -> c[0]; 19 | cx node[2],node[3]; 20 | cx node[3],node[2]; 21 | cx node[2],node[3]; 22 | cx node[1],node[2]; 23 | u1(1.5710000000000002) node[2]; 24 | cx node[1],node[2]; 25 | u2(2.356,0) node[1]; 26 | cx node[2],node[4]; 27 | u1(1.5710000000000002) node[4]; 28 | cx node[2],node[4]; 29 | u2(2.356,0) node[2]; 30 | u2(2.356,0) node[4]; 31 | measure node[0] -> c[1]; 32 | measure node[1] -> c[2]; 33 | measure node[2] -> c[3]; 34 | measure node[4] -> c[4]; 35 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by3/4mod5-v1_22_grid2by3_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[6]; 4 | creg c[5]; 5 | u3(3.141592653589793,0,3.141592653589793) q[0]; 6 | u2(0,3.141592653589793) q[0]; 7 | u1(0.7853981633974483) q[0]; 8 | cx q[4],q[1]; 9 | u1(0.7853981633974483) q[1]; 10 | cx q[5],q[2]; 11 | u1(0.7853981633974483) q[2]; 12 | cx q[1],q[2]; 13 | cx q[0],q[1]; 14 | cx q[1],q[2]; 15 | cx q[2],q[1]; 16 | cx q[1],q[2]; 17 | cx q[1],q[0]; 18 | u1(0.7853981633974483) q[0]; 19 | u1(-0.7853981633974483) q[2]; 20 | cx q[1],q[2]; 21 | cx q[0],q[1]; 22 | cx q[1],q[0]; 23 | cx q[0],q[1]; 24 | u1(-0.7853981633974483) q[0]; 25 | u1(-0.7853981633974483) q[2]; 26 | cx q[1],q[2]; 27 | cx q[0],q[1]; 28 | cx q[1],q[2]; 29 | cx q[2],q[1]; 30 | cx q[1],q[2]; 31 | cx q[1],q[0]; 32 | cx q[0],q[1]; 33 | u2(0,3.141592653589793) q[2]; 34 | cx q[1],q[2]; 35 | measure q[5] -> c[0]; 36 | measure q[4] -> c[1]; 37 | measure q[0] -> c[2]; 38 | measure q[1] -> c[3]; 39 | measure q[2] -> c[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by4/4mod5-v1_22_grid2by4_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[8]; 4 | creg c[5]; 5 | u3(3.141592653589793,0,3.141592653589793) q[1]; 6 | u2(0,3.141592653589793) q[1]; 7 | u1(0.7853981633974483) q[1]; 8 | cx q[6],q[2]; 9 | u1(0.7853981633974483) q[2]; 10 | cx q[7],q[3]; 11 | u1(0.7853981633974483) q[3]; 12 | cx q[2],q[3]; 13 | cx q[1],q[2]; 14 | u1(-0.7853981633974483) q[2]; 15 | cx q[2],q[3]; 16 | cx q[3],q[2]; 17 | cx q[2],q[3]; 18 | cx q[2],q[1]; 19 | u1(0.7853981633974483) q[1]; 20 | cx q[2],q[3]; 21 | cx q[1],q[2]; 22 | cx q[2],q[1]; 23 | cx q[1],q[2]; 24 | u1(-0.7853981633974483) q[1]; 25 | u1(-0.7853981633974483) q[3]; 26 | cx q[2],q[3]; 27 | cx q[1],q[2]; 28 | cx q[2],q[3]; 29 | cx q[3],q[2]; 30 | cx q[2],q[3]; 31 | cx q[2],q[1]; 32 | cx q[1],q[2]; 33 | u2(0,3.141592653589793) q[3]; 34 | cx q[2],q[3]; 35 | measure q[7] -> c[0]; 36 | measure q[6] -> c[1]; 37 | measure q[1] -> c[2]; 38 | measure q[2] -> c[3]; 39 | measure q[3] -> c[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_ibmqx2/qaoa_ibmqx2_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,3.14159265358979) q[4]; 6 | u2(0,3.14159265358979) q[3]; 7 | u2(0,3.14159265358979) q[1]; 8 | u2(0,3.14159265358979) q[2]; 9 | u2(0,3.14159265358979) q[0]; 10 | cx q[3],q[4]; 11 | u1(1.5707963267949) q[4]; 12 | cx q[3],q[4]; 13 | cx q[4],q[2]; 14 | u3(3.14159265358979,0,3.14159265358979) q[3]; 15 | u1(1.5707963267949) q[2]; 16 | cx q[4],q[2]; 17 | cx q[2],q[0]; 18 | u3(3.14159265358979,0,3.14159265358979) q[4]; 19 | u1(1.5707963267949) q[0]; 20 | cx q[2],q[0]; 21 | u2(0,3.14159265358979) q[1]; 22 | u2(0,3.14159265358979) q[0]; 23 | cx q[1],q[0]; 24 | u1(1.5707963267949) q[1]; 25 | u3(3.14159265358979,0,3.14159265358979) q[2]; 26 | cx q[1],q[0]; 27 | u2(1.22464679914735e-16,6.28318530717959) q[1]; 28 | u2(1.22464679914735e-16,6.28318530717959) q[0]; 29 | measure q[3] -> c[0]; 30 | measure q[2] -> c[2]; 31 | measure q[4] -> c[1]; 32 | measure q[0] -> c[3]; 33 | measure q[1] -> c[4]; 34 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_melbourne/4mod5-v1_22_ibmq14_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[5]; 5 | cx q[3],q[11]; 6 | cx q[11],q[3]; 7 | cx q[3],q[2]; 8 | cx q[2],q[3]; 9 | cx q[3],q[2]; 10 | cx q[2],q[3]; 11 | u1(-0.7853981633974483) q[2]; 12 | u1(0.7853981633974483) q[3]; 13 | cx q[3],q[2]; 14 | cx q[11],q[3]; 15 | u2(0,3.141592653589793) q[3]; 16 | cx q[11],q[3]; 17 | cx q[3],q[11]; 18 | cx q[11],q[3]; 19 | cx q[3],q[11]; 20 | u3(3.141592653589793,0,3.141592653589793) q[11]; 21 | u2(0,3.141592653589793) q[11]; 22 | u1(0.7853981633974483) q[11]; 23 | cx q[3],q[2]; 24 | u1(-0.7853981633974483) q[3]; 25 | cx q[2],q[3]; 26 | cx q[3],q[2]; 27 | cx q[2],q[3]; 28 | cx q[1],q[2]; 29 | u1(0.7853981633974483) q[2]; 30 | cx q[4],q[3]; 31 | u1(0.7853981633974483) q[3]; 32 | cx q[3],q[2]; 33 | cx q[11],q[3]; 34 | u1(-0.7853981633974483) q[3]; 35 | measure q[1] -> c[0]; 36 | measure q[4] -> c[1]; 37 | measure q[3] -> c[2]; 38 | measure q[2] -> c[3]; 39 | measure q[11] -> c[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_melbourne/4mod5-v1_22_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) q[3]; 6 | cx q[11],q[12]; 7 | cx q[12],q[11]; 8 | cx q[11],q[3]; 9 | u1(-0.7853981633974483) q[11]; 10 | cx q[12],q[2]; 11 | cx q[2],q[12]; 12 | cx q[12],q[2]; 13 | u1(-0.7853981633974483) q[2]; 14 | u1(0.7853981633974483) q[3]; 15 | cx q[3],q[11]; 16 | cx q[11],q[12]; 17 | cx q[12],q[11]; 18 | cx q[11],q[12]; 19 | u1(-0.7853981633974483) q[12]; 20 | cx q[2],q[3]; 21 | cx q[2],q[3]; 22 | cx q[11],q[3]; 23 | cx q[2],q[12]; 24 | cx q[3],q[11]; 25 | cx q[11],q[3]; 26 | u3(3.141592653589793,0,3.141592653589793) q[11]; 27 | u2(0,3.141592653589793) q[11]; 28 | u1(0.7853981633974483) q[11]; 29 | cx q[3],q[2]; 30 | u1(0.7853981633974483) q[2]; 31 | cx q[13],q[12]; 32 | u1(0.7853981633974483) q[12]; 33 | cx q[12],q[2]; 34 | cx q[11],q[12]; 35 | measure q[11] -> c[0]; 36 | measure q[13] -> c[1]; 37 | measure q[2] -> c[2]; 38 | measure q[12] -> c[3]; 39 | measure q[3] -> c[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[14]; 5 | u3(3.14159265358979,0.785398163397448,3.14159265358979) q[11]; 6 | u3(3.14159265358979,0.785398163397448,3.14159265358979) q[12]; 7 | u2(0,3.14159265358979) q[3]; 8 | cx q[2],q[3]; 9 | cx q[11],q[12]; 10 | u1(0.785398163397448) q[2]; 11 | u1(0.785398163397448) q[3]; 12 | cx q[2],q[3]; 13 | u2(0,3.14159265358979) q[11]; 14 | u2(0,3.14159265358979) q[3]; 15 | cx q[11],q[3]; 16 | u2(0,3.14159265358979) q[11]; 17 | u2(0,3.14159265358979) q[3]; 18 | cx q[12],q[2]; 19 | cx q[11],q[12]; 20 | cx q[2],q[3]; 21 | u1(0.785398163397448) q[11]; 22 | u1(0.785398163397448) q[12]; 23 | u1(0.785398163397448) q[2]; 24 | u1(0.785398163397448) q[3]; 25 | cx q[11],q[12]; 26 | cx q[2],q[3]; 27 | u2(0,3.14159265358979) q[11]; 28 | u2(0,4.71238898038469) q[3]; 29 | cx q[11],q[3]; 30 | u2(0,3.14159265358979) q[11]; 31 | measure q[11] -> c[0]; 32 | measure q[2] -> c[2]; 33 | measure q[12] -> c[1]; 34 | measure q[3] -> c[3]; 35 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by3/4mod5-v1_22_grid2by3_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[6]; 4 | creg c[5]; 5 | u3(3.141592653589793,0,3.141592653589793) q[1]; 6 | u2(0,3.141592653589793) q[1]; 7 | u1(0.7853981633974483) q[1]; 8 | cx q[0],q[3]; 9 | u1(0.7853981633974483) q[3]; 10 | cx q[5],q[4]; 11 | u1(0.7853981633974483) q[4]; 12 | cx q[4],q[3]; 13 | cx q[1],q[4]; 14 | cx q[3],q[4]; 15 | cx q[4],q[3]; 16 | cx q[3],q[4]; 17 | u1(-0.7853981633974483) q[3]; 18 | cx q[4],q[1]; 19 | u1(0.7853981633974483) q[1]; 20 | cx q[4],q[3]; 21 | cx q[1],q[4]; 22 | u1(-0.7853981633974483) q[3]; 23 | cx q[4],q[1]; 24 | cx q[1],q[4]; 25 | u1(-0.7853981633974483) q[1]; 26 | cx q[4],q[3]; 27 | cx q[0],q[3]; 28 | cx q[1],q[4]; 29 | cx q[3],q[0]; 30 | cx q[0],q[3]; 31 | cx q[0],q[1]; 32 | cx q[1],q[0]; 33 | u2(0,3.141592653589793) q[4]; 34 | cx q[3],q[4]; 35 | cx q[4],q[3]; 36 | cx q[3],q[4]; 37 | cx q[0],q[3]; 38 | measure q[4] -> c[0]; 39 | measure q[5] -> c[1]; 40 | measure q[1] -> c[2]; 41 | measure q[0] -> c[3]; 42 | measure q[3] -> c[4]; 43 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(pi/4) q[0]; 6 | u1(pi/4) q[1]; 7 | cx q[1],q[0]; 8 | u2(0,pi) q[2]; 9 | u2(0,pi) q[2]; 10 | u1(pi/4) q[2]; 11 | cx q[2],q[1]; 12 | cx q[0],q[2]; 13 | u1(-pi/4) q[1]; 14 | cx q[0],q[1]; 15 | u1(-pi/4) q[0]; 16 | u1(-pi/4) q[1]; 17 | u1(pi/4) q[2]; 18 | cx q[2],q[1]; 19 | cx q[0],q[2]; 20 | cx q[1],q[0]; 21 | u2(0,pi) q[2]; 22 | cx q[0],q[2]; 23 | u1(pi/4) q[3]; 24 | cx q[2],q[4]; 25 | cx q[4],q[2]; 26 | cx q[2],q[4]; 27 | cx q[0],q[2]; 28 | cx q[2],q[0]; 29 | cx q[0],q[2]; 30 | cx q[0],q[2]; 31 | u3(pi,0,pi) q[2]; 32 | u1(pi/4) q[2]; 33 | cx q[3],q[2]; 34 | u2(0,pi) q[4]; 35 | u1(pi/4) q[4]; 36 | cx q[4],q[3]; 37 | cx q[2],q[4]; 38 | u1(-pi/4) q[3]; 39 | cx q[2],q[3]; 40 | u1(-pi/4) q[2]; 41 | u1(-pi/4) q[3]; 42 | u1(pi/4) q[4]; 43 | cx q[4],q[3]; 44 | cx q[2],q[4]; 45 | cx q[3],q[2]; 46 | measure q[3] -> c[0]; 47 | measure q[2] -> c[1]; 48 | measure q[1] -> c[2]; 49 | measure q[0] -> c[3]; 50 | measure q[4] -> c[4]; 51 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by3/4mod5-v1_22_grid2by3_wille.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[6]; 4 | creg c[5]; 5 | 6 | // 0->3, 1->4, 2->0, 3->1, 4->2 7 | x q[2]; 8 | cx q[3], q[0]; 9 | cx q[4], q[1]; 10 | h q[2]; 11 | t q[0]; 12 | t q[1]; 13 | t q[2]; 14 | cx q[1], q[0]; 15 | cx q[2], q[1]; 16 | cx q[0], q[1]; // swap 0 1 17 | cx q[1], q[0]; // swap 0 1 18 | cx q[0], q[1]; // swap 0 1 19 | 20 | // 0->3, 1->4, 2->1, 3->0, 4->2 21 | cx q[1], q[2]; 22 | tdg q[0]; 23 | cx q[1], q[0]; 24 | cx q[1], q[2]; // swap 1 2 25 | cx q[2], q[1]; // swap 1 2 26 | cx q[1], q[2]; // swap 1 2 27 | 28 | 29 | // 0->3, 1->4, 2->2, 3->0, 4->1 30 | tdg q[2]; 31 | tdg q[0]; 32 | t q[1]; 33 | cx q[1], q[0]; 34 | cx q[2], q[1]; 35 | cx q[1], q[0]; // swap 0 1 36 | cx q[0], q[1]; // swap 0 1 37 | cx q[1], q[0]; // swap 0 1 38 | 39 | // 0->3, 1->4, 2->2, 3->1, 4->0 40 | cx q[1], q[2]; 41 | h q[0]; 42 | cx q[2], q[1]; 43 | cx q[1], q[0]; 44 | 45 | measure q[3]->c[0]; 46 | measure q[4]->c[1]; 47 | measure q[2]->c[2]; 48 | measure q[1]->c[3]; 49 | measure q[0]->c[4]; 50 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by4/4mod5-v1_22_grid2by4_wille.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[8]; 4 | creg c[5]; 5 | 6 | // 0->0, 1->3, 2->1, 3->2, 4->6 7 | x q[4]; 8 | cx q[0], q[2]; 9 | cx q[1], q[3]; 10 | h q[4]; 11 | t q[2]; 12 | t q[3]; 13 | t q[4]; 14 | cx q[3], q[2]; 15 | cx q[4], q[3]; 16 | cx q[1], q[2]; // swap 1 2 17 | cx q[2], q[1]; // swap 1 2 18 | cx q[1], q[2]; // swap 1 2 19 | 20 | // 0->0, 1->3, 2->2, 3->1, 4->6 21 | cx q[2], q[4]; 22 | tdg q[3]; 23 | cx q[2], q[3]; 24 | cx q[1], q[5]; // swap 1 5 25 | cx q[5], q[1]; // swap 1 5 26 | cx q[1], q[5]; // swap 1 5 27 | 28 | 29 | // 0->0, 1->3, 2->2, 3->5, 4->6 30 | tdg q[2]; 31 | tdg q[3]; 32 | t q[4]; 33 | cx q[4], q[3]; 34 | cx q[2], q[4]; 35 | cx q[1], q[2]; // swap 1 2 36 | cx q[2], q[1]; // swap 1 2 37 | cx q[1], q[2]; // swap 1 2 38 | 39 | 40 | // 0->0, 1->3, 2->1, 3->5, 4->6 41 | cx q[3], q[2]; 42 | h q[4]; 43 | cx q[2], q[3]; 44 | cx q[3], q[4]; 45 | 46 | measure q[0]->c[0]; 47 | measure q[3]->c[1]; 48 | measure q[1]->c[2]; 49 | measure q[5]->c[3]; 50 | measure q[6]->c[4]; 51 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_melbourne/adder_ibmq14_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[11]; 4 | creg c[4]; 5 | u3(3.141592653589793,0,3.141592653589793) node[4]; 6 | u1(0.7853981633974483) node[4]; 7 | u3(3.141592653589793,0,3.141592653589793) node[5]; 8 | u1(0.7853981633974483) node[5]; 9 | cx node[5],node[4]; 10 | cx node[5],node[4]; 11 | cx node[4],node[5]; 12 | cx node[5],node[4]; 13 | u2(0,3.141592653589793) node[10]; 14 | cx node[9],node[10]; 15 | u1(-0.7853981633974483) node[10]; 16 | u1(0.7853981633974483) node[9]; 17 | cx node[9],node[10]; 18 | cx node[10],node[4]; 19 | cx node[5],node[9]; 20 | cx node[4],node[5]; 21 | u1(-0.7853981633974483) node[4]; 22 | u1(-0.7853981633974483) node[5]; 23 | cx node[4],node[5]; 24 | cx node[9],node[10]; 25 | u1(0.7853981633974483) node[10]; 26 | u1(-0.7853981633974483) node[9]; 27 | cx node[9],node[10]; 28 | u1(1.5707963267948966) node[10]; 29 | cx node[10],node[4]; 30 | u2(0,3.141592653589793) node[10]; 31 | measure node[4] -> c[0]; 32 | measure node[5] -> c[1]; 33 | measure node[9] -> c[2]; 34 | measure node[10] -> c[3]; 35 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | with open("README.md", "r", encoding="utf-8") as fh: 4 | long_description = fh.read() 5 | 6 | setuptools.setup( 7 | name="olsq", 8 | version="0.0.4.1", 9 | license = "BSD", 10 | author="Daniel Bochen Tan", 11 | author_email="bctan@cs.ucla.edu", 12 | description="Optimal Layout Synthesis for Quantum Computing (OLSQ) for mapping and scheduling quantum circuits", 13 | long_description=long_description, 14 | long_description_content_type="text/markdown", 15 | url="https://github.com/tbcdebug/OLSQ", 16 | project_urls={ 17 | "Bug Tracker": "https://github.com/tbcdebug/OLSQ/issues", 18 | }, 19 | install_requires=[ 20 | "networkx>=2.5", 21 | "z3-solver>=4.8.9.0", 22 | ], 23 | packages=setuptools.find_packages(), 24 | package_data={ "olsq": ["devices/*", "benchmarks/*"]}, 25 | classifiers=[ 26 | "Programming Language :: Python :: 3", 27 | "License :: OSI Approved :: BSD License", 28 | "Operating System :: OS Independent", 29 | ], 30 | python_requires=">=3.6", 31 | ) 32 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4mod5-v1_22_grid2by4/4mod5-v1_22_grid2by4_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[8]; 4 | creg c[5]; 5 | cx q[0],q[1]; 6 | cx q[1],q[0]; 7 | cx q[0],q[1]; 8 | cx q[4],q[5]; 9 | cx q[0],q[4]; 10 | cx q[4],q[0]; 11 | cx q[0],q[4]; 12 | u1(0.7853981633974483) q[5]; 13 | cx q[2],q[6]; 14 | u1(0.7853981633974483) q[6]; 15 | cx q[6],q[5]; 16 | u3(3.141592653589793,0,3.141592653589793) q[7]; 17 | u2(0,3.141592653589793) q[7]; 18 | u1(0.7853981633974483) q[7]; 19 | cx q[7],q[6]; 20 | cx q[5],q[6]; 21 | cx q[6],q[5]; 22 | cx q[5],q[6]; 23 | u1(-0.7853981633974483) q[5]; 24 | cx q[6],q[7]; 25 | cx q[6],q[5]; 26 | u1(-0.7853981633974483) q[5]; 27 | u1(0.7853981633974483) q[7]; 28 | cx q[6],q[7]; 29 | cx q[7],q[6]; 30 | cx q[6],q[7]; 31 | cx q[6],q[5]; 32 | u1(-0.7853981633974483) q[7]; 33 | cx q[7],q[6]; 34 | cx q[5],q[6]; 35 | cx q[6],q[5]; 36 | cx q[5],q[6]; 37 | u2(0,3.141592653589793) q[5]; 38 | cx q[6],q[7]; 39 | cx q[7],q[6]; 40 | cx q[6],q[5]; 41 | measure q[0] -> c[0]; 42 | measure q[2] -> c[1]; 43 | measure q[7] -> c[2]; 44 | measure q[6] -> c[3]; 45 | measure q[5] -> c[4]; 46 | -------------------------------------------------------------------------------- /iccad20/result/olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_wille.qasm: -------------------------------------------------------------------------------- 1 | 2 | // 0->1, 1->4, 2->3, 3->2, 4->0 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | qreg q[5]; 6 | creg c[5]; 7 | cx q[4], q[2]; 8 | x q[2]; 9 | h q[0]; 10 | t q[2]; 11 | t q[1]; 12 | t q[0]; 13 | cx q[1], q[2]; 14 | cx q[0], q[1]; 15 | cx q[2], q[0]; 16 | tdg q[1]; 17 | cx q[2], q[1]; 18 | tdg q[2]; 19 | tdg q[1]; 20 | t q[0]; 21 | cx q[0], q[1]; 22 | cx q[2], q[1]; // swap 1 2 23 | cx q[1], q[2]; // swap 1 2 24 | cx q[2], q[1]; // swap 1 2 25 | 26 | // 0->2, 1->4, 2->3, 3->1, 4->0 27 | cx q[1], q[0]; 28 | cx q[2], q[1]; 29 | cx q[2], q[3]; // swap 2 3 30 | cx q[3], q[2]; // swap 2 3 31 | cx q[2], q[3]; // swap 2 3 32 | 33 | // 0->3, 1->4, 2->2, 3->1, 4->0 34 | h q[0]; 35 | h q[0]; 36 | t q[1]; 37 | t q[2]; 38 | t q[0]; 39 | cx q[2], q[1]; 40 | cx q[0], q[2]; 41 | cx q[1], q[0]; 42 | tdg q[2]; 43 | cx q[1], q[2]; 44 | tdg q[1]; 45 | tdg q[2]; 46 | t q[0]; 47 | cx q[0], q[2]; 48 | cx q[1], q[0]; 49 | cx q[2], q[1]; 50 | h q[0]; 51 | cx q[1], q[0]; 52 | 53 | measure q[3]->c[0]; 54 | measure q[4]->c[1]; 55 | measure q[3]->c[2]; 56 | measure q[1]->c[3]; 57 | measure q[0]->c[4]; 58 | -------------------------------------------------------------------------------- /iccad20/benchmark/4gt13_92.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | cx q[4], q[0]; 6 | h q[0]; 7 | t q[1]; 8 | t q[4]; 9 | t q[0]; 10 | cx q[4], q[1]; 11 | cx q[0], q[4]; 12 | cx q[1], q[0]; 13 | tdg q[4]; 14 | cx q[1], q[4]; 15 | tdg q[1]; 16 | tdg q[4]; 17 | t q[0]; 18 | cx q[0], q[4]; 19 | cx q[1], q[0]; 20 | cx q[4], q[1]; 21 | h q[0]; 22 | h q[4]; 23 | t q[3]; 24 | t q[2]; 25 | t q[4]; 26 | cx q[2], q[3]; 27 | cx q[4], q[2]; 28 | cx q[3], q[4]; 29 | tdg q[2]; 30 | cx q[3], q[2]; 31 | tdg q[3]; 32 | tdg q[2]; 33 | t q[4]; 34 | cx q[4], q[2]; 35 | cx q[3], q[4]; 36 | cx q[2], q[3]; 37 | h q[4]; 38 | h q[0]; 39 | t q[1]; 40 | t q[4]; 41 | t q[0]; 42 | cx q[4], q[1]; 43 | cx q[0], q[4]; 44 | cx q[1], q[0]; 45 | tdg q[4]; 46 | cx q[1], q[4]; 47 | tdg q[1]; 48 | tdg q[4]; 49 | t q[0]; 50 | cx q[0], q[4]; 51 | cx q[1], q[0]; 52 | cx q[4], q[1]; 53 | h q[0]; 54 | h q[4]; 55 | t q[3]; 56 | t q[2]; 57 | t q[4]; 58 | cx q[2], q[3]; 59 | cx q[4], q[2]; 60 | cx q[3], q[4]; 61 | tdg q[2]; 62 | cx q[3], q[2]; 63 | tdg q[3]; 64 | tdg q[2]; 65 | t q[4]; 66 | cx q[4], q[2]; 67 | cx q[3], q[4]; 68 | cx q[2], q[3]; 69 | h q[4]; 70 | cx q[0], q[4]; 71 | -------------------------------------------------------------------------------- /olsq/benchmarks/4gt13_92.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | cx q[4], q[0]; 6 | h q[0]; 7 | t q[1]; 8 | t q[4]; 9 | t q[0]; 10 | cx q[4], q[1]; 11 | cx q[0], q[4]; 12 | cx q[1], q[0]; 13 | tdg q[4]; 14 | cx q[1], q[4]; 15 | tdg q[1]; 16 | tdg q[4]; 17 | t q[0]; 18 | cx q[0], q[4]; 19 | cx q[1], q[0]; 20 | cx q[4], q[1]; 21 | h q[0]; 22 | h q[4]; 23 | t q[3]; 24 | t q[2]; 25 | t q[4]; 26 | cx q[2], q[3]; 27 | cx q[4], q[2]; 28 | cx q[3], q[4]; 29 | tdg q[2]; 30 | cx q[3], q[2]; 31 | tdg q[3]; 32 | tdg q[2]; 33 | t q[4]; 34 | cx q[4], q[2]; 35 | cx q[3], q[4]; 36 | cx q[2], q[3]; 37 | h q[4]; 38 | h q[0]; 39 | t q[1]; 40 | t q[4]; 41 | t q[0]; 42 | cx q[4], q[1]; 43 | cx q[0], q[4]; 44 | cx q[1], q[0]; 45 | tdg q[4]; 46 | cx q[1], q[4]; 47 | tdg q[1]; 48 | tdg q[4]; 49 | t q[0]; 50 | cx q[0], q[4]; 51 | cx q[1], q[0]; 52 | cx q[4], q[1]; 53 | h q[0]; 54 | h q[4]; 55 | t q[3]; 56 | t q[2]; 57 | t q[4]; 58 | cx q[2], q[3]; 59 | cx q[4], q[2]; 60 | cx q[3], q[4]; 61 | tdg q[2]; 62 | cx q[3], q[2]; 63 | tdg q[3]; 64 | tdg q[2]; 65 | t q[4]; 66 | cx q[4], q[2]; 67 | cx q[3], q[4]; 68 | cx q[2], q[3]; 69 | h q[4]; 70 | cx q[0], q[4]; 71 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_melbourne/4mod5-v1_22_ibmq14_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[12]; 4 | creg c[5]; 5 | cx node[5],node[4]; 6 | u1(0.7853981633974483) node[4]; 7 | cx node[9],node[10]; 8 | u1(0.7853981633974483) node[10]; 9 | cx node[10],node[4]; 10 | u3(3.141592653589793,0,3.141592653589793) node[11]; 11 | u2(0,3.141592653589793) node[11]; 12 | u1(0.7853981633974483) node[11]; 13 | cx node[11],node[10]; 14 | u1(-0.7853981633974483) node[10]; 15 | cx node[4],node[10]; 16 | cx node[10],node[4]; 17 | cx node[4],node[10]; 18 | cx node[10],node[11]; 19 | cx node[10],node[4]; 20 | u1(-0.7853981633974483) node[10]; 21 | u1(0.7853981633974483) node[11]; 22 | cx node[11],node[10]; 23 | cx node[10],node[11]; 24 | cx node[11],node[10]; 25 | u1(-0.7853981633974483) node[4]; 26 | cx node[10],node[4]; 27 | cx node[11],node[10]; 28 | u2(0,3.141592653589793) node[10]; 29 | cx node[4],node[10]; 30 | cx node[10],node[4]; 31 | cx node[4],node[10]; 32 | cx node[10],node[11]; 33 | cx node[11],node[10]; 34 | cx node[10],node[4]; 35 | measure node[5] -> c[0]; 36 | measure node[9] -> c[1]; 37 | measure node[11] -> c[2]; 38 | measure node[10] -> c[3]; 39 | measure node[4] -> c[4]; 40 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[5]; 4 | creg c[5]; 5 | cx node[2],node[0]; 6 | u1(0.7853981633974483) node[0]; 7 | u3(3.141592653589793,0,3.141592653589793) node[4]; 8 | u2(0,3.141592653589793) node[4]; 9 | u1(0.7853981633974483) node[4]; 10 | measure node[2] -> c[0]; 11 | cx node[2],node[3]; 12 | cx node[3],node[2]; 13 | cx node[2],node[3]; 14 | cx node[1],node[2]; 15 | u1(0.7853981633974483) node[2]; 16 | cx node[2],node[0]; 17 | cx node[4],node[2]; 18 | u1(-0.7853981633974483) node[2]; 19 | cx node[0],node[2]; 20 | cx node[2],node[0]; 21 | cx node[0],node[2]; 22 | cx node[2],node[4]; 23 | cx node[2],node[0]; 24 | u1(-0.7853981633974483) node[0]; 25 | u1(-0.7853981633974483) node[2]; 26 | cx node[0],node[2]; 27 | u1(0.7853981633974483) node[4]; 28 | cx node[2],node[4]; 29 | cx node[0],node[2]; 30 | cx node[2],node[4]; 31 | cx node[2],node[4]; 32 | cx node[0],node[2]; 33 | cx node[2],node[0]; 34 | u2(0,3.141592653589793) node[4]; 35 | measure node[1] -> c[1]; 36 | measure node[2] -> c[2]; 37 | cx node[0],node[2]; 38 | cx node[2],node[0]; 39 | cx node[0],node[2]; 40 | cx node[2],node[4]; 41 | measure node[2] -> c[3]; 42 | measure node[4] -> c[4]; 43 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/qaoa5_melbourne/qaoa_ibmq14_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[14]; 5 | u2(0,3.14159265358979) q[11]; 6 | u2(0,3.14159265358979) q[12]; 7 | u2(0,3.14159265358979) q[3]; 8 | u2(0,3.14159265358979) q[4]; 9 | u2(0,3.14159265358979) q[5]; 10 | cx q[5],q[4]; 11 | u3(3.14159265358979,1.5707963267949,1.5707963267949) q[4]; 12 | cx q[5],q[4]; 13 | cx q[4],q[3]; 14 | u3(3.14159265358979,1.5707963267949,1.5707963267949) q[3]; 15 | u3(3.14159265358979,0,3.14159265358979) q[5]; 16 | cx q[4],q[3]; 17 | u2(0,3.14159265358979) q[11]; 18 | u2(0,3.14159265358979) q[3]; 19 | cx q[11],q[3]; 20 | u3(3.14159265358979,-1.5707963267949,4.71238898038469) q[11]; 21 | u3(3.14159265358979,0,3.14159265358979) q[4]; 22 | cx q[11],q[3]; 23 | u2(0,3.14159265358979) q[11]; 24 | u2(0,3.14159265358979) q[3]; 25 | cx q[11],q[12]; 26 | u3(3.14159265358979,1.5707963267949,1.5707963267949) q[12]; 27 | u3(3.14159265358979,0,3.14159265358979) q[3]; 28 | cx q[11],q[12]; 29 | u3(3.14159265358979,0,3.14159265358979) q[11]; 30 | u3(3.14159265358979,0,3.14159265358979) q[12]; 31 | measure q[5] -> c[0]; 32 | measure q[3] -> c[2]; 33 | measure q[4] -> c[1]; 34 | measure q[11] -> c[3]; 35 | measure q[12] -> c[4]; 36 | -------------------------------------------------------------------------------- /olsq/benchmarks/barenco_tof_4.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[7]; 5 | t q[4]; 6 | t q[5]; 7 | h q[6]; 8 | cx q[5],q[6]; 9 | tdg q[6]; 10 | cx q[3],q[6]; 11 | t q[6]; 12 | cx q[5],q[6]; 13 | cx q[3],q[5]; 14 | tdg q[5]; 15 | cx q[3],q[5]; 16 | h q[5]; 17 | cx q[4],q[5]; 18 | tdg q[5]; 19 | cx q[2],q[5]; 20 | t q[5]; 21 | cx q[4],q[5]; 22 | cx q[2],q[4]; 23 | tdg q[4]; 24 | cx q[2],q[4]; 25 | h q[4]; 26 | cx q[1],q[4]; 27 | tdg q[4]; 28 | cx q[0],q[4]; 29 | t q[4]; 30 | cx q[1],q[4]; 31 | tdg q[4]; 32 | cx q[0],q[4]; 33 | t q[4]; 34 | h q[4]; 35 | cx q[4],q[5]; 36 | tdg q[5]; 37 | cx q[2],q[5]; 38 | t q[5]; 39 | cx q[4],q[5]; 40 | h q[5]; 41 | cx q[5],q[6]; 42 | tdg q[6]; 43 | cx q[3],q[6]; 44 | t q[6]; 45 | cx q[5],q[6]; 46 | cx q[3],q[5]; 47 | h q[6]; 48 | t q[5]; 49 | cx q[3],q[5]; 50 | tdg q[5]; 51 | h q[5]; 52 | cx q[4],q[5]; 53 | tdg q[5]; 54 | cx q[2],q[5]; 55 | t q[5]; 56 | cx q[4],q[5]; 57 | h q[4]; 58 | cx q[1],q[4]; 59 | t q[4]; 60 | cx q[0],q[4]; 61 | tdg q[4]; 62 | cx q[1],q[4]; 63 | t q[4]; 64 | cx q[0],q[4]; 65 | tdg q[4]; 66 | h q[4]; 67 | cx q[4],q[5]; 68 | tdg q[5]; 69 | cx q[2],q[5]; 70 | t q[5]; 71 | cx q[4],q[5]; 72 | cx q[2],q[4]; 73 | h q[5]; 74 | t q[4]; 75 | cx q[2],q[4]; 76 | tdg q[4]; 77 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_4_melbourne/tof_4_after_heavy_ibmq14_triq.in: -------------------------------------------------------------------------------- 1 | 7 55 2 | 0 H 1 4 0 3 | 1 H 1 5 0 4 | 2 H 1 6 0 5 | 3 CNOT 2 1 4 1 0 6 | 4 T 1 4 1 3 7 | 5 CNOT 2 0 4 1 4 8 | 6 T 1 4 1 5 9 | 7 CNOT 2 1 4 2 3 6 10 | 8 T 1 4 1 7 11 | 9 CNOT 2 0 4 2 5 8 12 | 10 T 1 4 1 9 13 | 11 H 1 4 1 10 14 | 12 CNOT 2 4 5 2 11 1 15 | 13 T 1 5 1 12 16 | 14 CNOT 2 2 5 1 13 17 | 15 T 1 5 1 14 18 | 16 CNOT 2 4 5 2 12 15 19 | 17 T 1 5 1 16 20 | 18 CNOT 2 2 5 2 14 17 21 | 19 T 1 5 1 18 22 | 20 H 1 5 1 19 23 | 21 CNOT 2 5 6 2 20 2 24 | 22 T 1 6 1 21 25 | 23 CNOT 2 3 6 1 22 26 | 24 T 1 6 1 23 27 | 25 CNOT 2 5 6 2 21 24 28 | 26 T 1 6 1 25 29 | 27 CNOT 2 3 6 2 23 26 30 | 28 CNOT 2 3 5 2 27 25 31 | 29 T 1 6 1 27 32 | 30 T 1 5 1 28 33 | 31 H 1 6 1 29 34 | 32 CNOT 2 3 5 2 28 30 35 | 33 T 1 3 1 32 36 | 34 T 1 5 1 32 37 | 35 H 1 5 1 34 38 | 36 CNOT 2 4 5 2 16 35 39 | 37 T 1 5 1 36 40 | 38 CNOT 2 2 5 2 18 37 41 | 39 T 1 5 1 38 42 | 40 CNOT 2 4 5 2 36 39 43 | 41 H 1 4 1 40 44 | 42 T 1 5 1 40 45 | 43 CNOT 2 1 4 2 7 41 46 | 44 CNOT 2 2 5 2 38 42 47 | 45 T 1 4 1 43 48 | 46 T 1 5 1 44 49 | 47 CNOT 2 0 4 2 9 45 50 | 48 H 1 5 1 46 51 | 49 T 1 4 1 47 52 | 50 CNOT 2 1 4 2 43 49 53 | 51 T 1 4 1 50 54 | 52 CNOT 2 0 4 2 47 51 55 | 53 T 1 4 1 52 56 | 54 H 1 4 1 53 57 | -------------------------------------------------------------------------------- /olsq/benchmarks/tof_5.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[9]; 5 | h q[5]; 6 | h q[6]; 7 | h q[7]; 8 | h q[8]; 9 | cx q[1],q[5]; 10 | tdg q[5]; 11 | cx q[0],q[5]; 12 | t q[5]; 13 | cx q[1],q[5]; 14 | tdg q[5]; 15 | cx q[0],q[5]; 16 | t q[5]; 17 | h q[5]; 18 | cx q[5],q[6]; 19 | tdg q[6]; 20 | cx q[2],q[6]; 21 | t q[6]; 22 | cx q[5],q[6]; 23 | tdg q[6]; 24 | cx q[2],q[6]; 25 | t q[6]; 26 | h q[6]; 27 | cx q[6],q[7]; 28 | tdg q[7]; 29 | cx q[3],q[7]; 30 | t q[7]; 31 | cx q[6],q[7]; 32 | tdg q[7]; 33 | cx q[3],q[7]; 34 | t q[7]; 35 | h q[7]; 36 | cx q[7],q[8]; 37 | tdg q[8]; 38 | cx q[4],q[8]; 39 | t q[8]; 40 | cx q[7],q[8]; 41 | tdg q[8]; 42 | cx q[4],q[8]; 43 | cx q[4],q[7]; 44 | t q[8]; 45 | tdg q[7]; 46 | h q[8]; 47 | cx q[4],q[7]; 48 | t q[4]; 49 | t q[7]; 50 | h q[7]; 51 | cx q[6],q[7]; 52 | t q[7]; 53 | cx q[3],q[7]; 54 | tdg q[7]; 55 | cx q[6],q[7]; 56 | h q[6]; 57 | t q[7]; 58 | cx q[3],q[7]; 59 | cx q[5],q[6]; 60 | t q[6]; 61 | tdg q[7]; 62 | cx q[2],q[6]; 63 | h q[7]; 64 | tdg q[6]; 65 | cx q[5],q[6]; 66 | h q[5]; 67 | t q[6]; 68 | cx q[1],q[5]; 69 | cx q[2],q[6]; 70 | t q[5]; 71 | tdg q[6]; 72 | cx q[0],q[5]; 73 | h q[6]; 74 | tdg q[5]; 75 | cx q[1],q[5]; 76 | t q[5]; 77 | cx q[0],q[5]; 78 | tdg q[5]; 79 | h q[5]; 80 | -------------------------------------------------------------------------------- /iccad20/benchmark/barenco_tof_4_after_heavy.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[7]; 5 | t q[4]; 6 | t q[5]; 7 | h q[6]; 8 | cx q[5],q[6]; 9 | tdg q[6]; 10 | cx q[3],q[6]; 11 | t q[6]; 12 | cx q[5],q[6]; 13 | cx q[3],q[5]; 14 | tdg q[5]; 15 | cx q[3],q[5]; 16 | h q[5]; 17 | cx q[4],q[5]; 18 | tdg q[5]; 19 | cx q[2],q[5]; 20 | t q[5]; 21 | cx q[4],q[5]; 22 | cx q[2],q[4]; 23 | tdg q[4]; 24 | cx q[2],q[4]; 25 | h q[4]; 26 | cx q[1],q[4]; 27 | tdg q[4]; 28 | cx q[0],q[4]; 29 | t q[4]; 30 | cx q[1],q[4]; 31 | tdg q[4]; 32 | cx q[0],q[4]; 33 | t q[4]; 34 | h q[4]; 35 | cx q[4],q[5]; 36 | tdg q[5]; 37 | cx q[2],q[5]; 38 | t q[5]; 39 | cx q[4],q[5]; 40 | h q[5]; 41 | cx q[5],q[6]; 42 | tdg q[6]; 43 | cx q[3],q[6]; 44 | t q[6]; 45 | cx q[5],q[6]; 46 | cx q[3],q[5]; 47 | h q[6]; 48 | t q[5]; 49 | cx q[3],q[5]; 50 | tdg q[5]; 51 | h q[5]; 52 | cx q[4],q[5]; 53 | tdg q[5]; 54 | cx q[2],q[5]; 55 | t q[5]; 56 | cx q[4],q[5]; 57 | h q[4]; 58 | cx q[1],q[4]; 59 | t q[4]; 60 | cx q[0],q[4]; 61 | tdg q[4]; 62 | cx q[1],q[4]; 63 | t q[4]; 64 | cx q[0],q[4]; 65 | tdg q[4]; 66 | h q[4]; 67 | cx q[4],q[5]; 68 | tdg q[5]; 69 | cx q[2],q[5]; 70 | t q[5]; 71 | cx q[4],q[5]; 72 | cx q[2],q[4]; 73 | h q[5]; 74 | t q[4]; 75 | cx q[2],q[4]; 76 | tdg q[4]; 77 | -------------------------------------------------------------------------------- /olsq/benchmarks/queko_10_3.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | x q[0]; 5 | x q[2]; 6 | x q[10]; 7 | x q[9]; 8 | x q[7]; 9 | cx q[14], q[12]; 10 | cx q[13], q[6]; 11 | x q[0]; 12 | x q[7]; 13 | x q[11]; 14 | x q[4]; 15 | x q[5]; 16 | cx q[12], q[1]; 17 | cx q[6], q[10]; 18 | x q[7]; 19 | cx q[0], q[11]; 20 | cx q[12], q[1]; 21 | cx q[9], q[5]; 22 | cx q[2], q[8]; 23 | x q[10]; 24 | x q[9]; 25 | x q[4]; 26 | x q[8]; 27 | x q[3]; 28 | cx q[11], q[14]; 29 | cx q[15], q[2]; 30 | cx q[12], q[7]; 31 | cx q[13], q[0]; 32 | x q[11]; 33 | x q[7]; 34 | x q[3]; 35 | x q[12]; 36 | x q[14]; 37 | x q[8]; 38 | cx q[6], q[10]; 39 | cx q[13], q[0]; 40 | x q[11]; 41 | x q[8]; 42 | x q[1]; 43 | x q[14]; 44 | x q[13]; 45 | cx q[12], q[7]; 46 | cx q[3], q[5]; 47 | x q[9]; 48 | x q[10]; 49 | cx q[11], q[14]; 50 | cx q[12], q[1]; 51 | cx q[2], q[8]; 52 | x q[11]; 53 | x q[2]; 54 | x q[4]; 55 | x q[15]; 56 | x q[8]; 57 | x q[14]; 58 | cx q[13], q[6]; 59 | cx q[7], q[9]; 60 | cx q[12], q[1]; 61 | x q[11]; 62 | x q[7]; 63 | x q[9]; 64 | x q[1]; 65 | cx q[14], q[12]; 66 | cx q[13], q[6]; 67 | cx q[3], q[5]; 68 | cx q[8], q[4]; 69 | x q[11]; 70 | x q[12]; 71 | x q[0]; 72 | x q[10]; 73 | x q[14]; 74 | cx q[7], q[9]; 75 | cx q[3], q[5]; 76 | cx q[8], q[4]; 77 | -------------------------------------------------------------------------------- /iccad20/benchmark/16QBT_10CYC_TFL_3.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | x q[0]; 5 | x q[2]; 6 | x q[10]; 7 | x q[9]; 8 | x q[7]; 9 | cx q[14], q[12]; 10 | cx q[13], q[6]; 11 | x q[0]; 12 | x q[7]; 13 | x q[11]; 14 | x q[4]; 15 | x q[5]; 16 | cx q[12], q[1]; 17 | cx q[6], q[10]; 18 | x q[7]; 19 | cx q[0], q[11]; 20 | cx q[12], q[1]; 21 | cx q[9], q[5]; 22 | cx q[2], q[8]; 23 | x q[10]; 24 | x q[9]; 25 | x q[4]; 26 | x q[8]; 27 | x q[3]; 28 | cx q[11], q[14]; 29 | cx q[15], q[2]; 30 | cx q[12], q[7]; 31 | cx q[13], q[0]; 32 | x q[11]; 33 | x q[7]; 34 | x q[3]; 35 | x q[12]; 36 | x q[14]; 37 | x q[8]; 38 | cx q[6], q[10]; 39 | cx q[13], q[0]; 40 | x q[11]; 41 | x q[8]; 42 | x q[1]; 43 | x q[14]; 44 | x q[13]; 45 | cx q[12], q[7]; 46 | cx q[3], q[5]; 47 | x q[9]; 48 | x q[10]; 49 | cx q[11], q[14]; 50 | cx q[12], q[1]; 51 | cx q[2], q[8]; 52 | x q[11]; 53 | x q[2]; 54 | x q[4]; 55 | x q[15]; 56 | x q[8]; 57 | x q[14]; 58 | cx q[13], q[6]; 59 | cx q[7], q[9]; 60 | cx q[12], q[1]; 61 | x q[11]; 62 | x q[7]; 63 | x q[9]; 64 | x q[1]; 65 | cx q[14], q[12]; 66 | cx q[13], q[6]; 67 | cx q[3], q[5]; 68 | cx q[8], q[4]; 69 | x q[11]; 70 | x q[12]; 71 | x q[0]; 72 | x q[10]; 73 | x q[14]; 74 | cx q[7], q[9]; 75 | cx q[3], q[5]; 76 | cx q[8], q[4]; 77 | -------------------------------------------------------------------------------- /iccad20/benchmark/tof_5_after_heavy.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[9]; 5 | h q[5]; 6 | h q[6]; 7 | h q[7]; 8 | h q[8]; 9 | cx q[1],q[5]; 10 | tdg q[5]; 11 | cx q[0],q[5]; 12 | t q[5]; 13 | cx q[1],q[5]; 14 | tdg q[5]; 15 | cx q[0],q[5]; 16 | t q[5]; 17 | h q[5]; 18 | cx q[5],q[6]; 19 | tdg q[6]; 20 | cx q[2],q[6]; 21 | t q[6]; 22 | cx q[5],q[6]; 23 | tdg q[6]; 24 | cx q[2],q[6]; 25 | t q[6]; 26 | h q[6]; 27 | cx q[6],q[7]; 28 | tdg q[7]; 29 | cx q[3],q[7]; 30 | t q[7]; 31 | cx q[6],q[7]; 32 | tdg q[7]; 33 | cx q[3],q[7]; 34 | t q[7]; 35 | h q[7]; 36 | cx q[7],q[8]; 37 | tdg q[8]; 38 | cx q[4],q[8]; 39 | t q[8]; 40 | cx q[7],q[8]; 41 | tdg q[8]; 42 | cx q[4],q[8]; 43 | cx q[4],q[7]; 44 | t q[8]; 45 | tdg q[7]; 46 | h q[8]; 47 | cx q[4],q[7]; 48 | t q[4]; 49 | t q[7]; 50 | h q[7]; 51 | cx q[6],q[7]; 52 | t q[7]; 53 | cx q[3],q[7]; 54 | tdg q[7]; 55 | cx q[6],q[7]; 56 | h q[6]; 57 | t q[7]; 58 | cx q[3],q[7]; 59 | cx q[5],q[6]; 60 | t q[6]; 61 | tdg q[7]; 62 | cx q[2],q[6]; 63 | h q[7]; 64 | tdg q[6]; 65 | cx q[5],q[6]; 66 | h q[5]; 67 | t q[6]; 68 | cx q[1],q[5]; 69 | cx q[2],q[6]; 70 | t q[5]; 71 | tdg q[6]; 72 | cx q[0],q[5]; 73 | h q[6]; 74 | tdg q[5]; 75 | cx q[1],q[5]; 76 | t q[5]; 77 | cx q[0],q[5]; 78 | tdg q[5]; 79 | h q[5]; 80 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder_ibmqx2_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[4]; 4 | creg c[4]; 5 | u3(3.141592653589793,0,3.141592653589793) node[0]; 6 | u1(0.7853981633974483) node[0]; 7 | u3(3.141592653589793,0,3.141592653589793) node[2]; 8 | u1(0.7853981633974483) node[2]; 9 | cx node[2],node[0]; 10 | u2(0,3.141592653589793) node[3]; 11 | cx node[2],node[3]; 12 | cx node[1],node[2]; 13 | cx node[2],node[3]; 14 | cx node[1],node[2]; 15 | u1(0.7853981633974483) node[1]; 16 | cx node[1],node[2]; 17 | u1(-0.7853981633974483) node[3]; 18 | cx node[2],node[3]; 19 | cx node[1],node[2]; 20 | cx node[0],node[1]; 21 | cx node[2],node[3]; 22 | cx node[3],node[2]; 23 | cx node[2],node[0]; 24 | u1(-0.7853981633974483) node[0]; 25 | u1(-0.7853981633974483) node[2]; 26 | cx node[2],node[0]; 27 | cx node[2],node[3]; 28 | cx node[1],node[2]; 29 | cx node[2],node[3]; 30 | cx node[1],node[2]; 31 | u1(-0.7853981633974483) node[1]; 32 | u1(0.7853981633974483) node[3]; 33 | cx node[2],node[3]; 34 | cx node[1],node[2]; 35 | cx node[2],node[3]; 36 | cx node[1],node[2]; 37 | u1(1.5707963267948966) node[3]; 38 | cx node[3],node[2]; 39 | u2(0,3.141592653589793) node[3]; 40 | measure node[2] -> c[0]; 41 | measure node[0] -> c[1]; 42 | measure node[1] -> c[2]; 43 | measure node[3] -> c[3]; 44 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/or_melbourne/or_ibmq14_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[14]; 5 | u3(3.14159265358979,0.785398163397448,3.14159265358979) q[2]; 6 | u1(0.785398163397448) q[3]; 7 | u2(0,3.14159265358979) q[11]; 8 | cx q[11],q[3]; 9 | u1(0.785398163397448) q[3]; 10 | u1(0.785398163397448) q[11]; 11 | cx q[2],q[3]; 12 | u1(0.785398163397448) q[3]; 13 | u1(1.5707963267949) q[11]; 14 | cx q[11],q[3]; 15 | u2(0,3.14159265358979) q[3]; 16 | u2(0,3.14159265358979) q[11]; 17 | cx q[11],q[3]; 18 | u2(0,3.14159265358979) q[3]; 19 | u2(0,3.14159265358979) q[11]; 20 | cx q[11],q[3]; 21 | u2(0,3.14159265358979) q[2]; 22 | u2(0,3.14159265358979) q[3]; 23 | cx q[2],q[3]; 24 | u2(0.785398163397448,3.14159265358979) q[2]; 25 | u2(0,3.14159265358979) q[11]; 26 | cx q[11],q[3]; 27 | u2(0,3.14159265358979) q[2]; 28 | u2(0.785398163397448,3.14159265358979) q[11]; 29 | cx q[2],q[3]; 30 | u2(0,3.14159265358979) q[2]; 31 | u2(0,3.14159265358979) q[3]; 32 | cx q[11],q[3]; 33 | u2(0,3.14159265358979) q[3]; 34 | u2(0,3.14159265358979) q[11]; 35 | cx q[11],q[3]; 36 | u2(0,3.14159265358979) q[3]; 37 | u2(0,3.14159265358979) q[11]; 38 | cx q[11],q[3]; 39 | cx q[2],q[3]; 40 | u2(0,3.14159265358979) q[11]; 41 | measure q[2] -> c[0]; 42 | measure q[11] -> c[2]; 43 | measure q[3] -> c[1]; 44 | -------------------------------------------------------------------------------- /iccad20/result/olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[0]; 6 | u2(0,3.141592653589793) q[1]; 7 | u1(0.7853981633974483) q[1]; 8 | cx q[3],q[2]; 9 | u3(3.141592653589793,0,3.141592653589793) q[2]; 10 | u1(0.7853981633974483) q[2]; 11 | cx q[0],q[2]; 12 | cx q[1],q[0]; 13 | u1(-0.7853981633974483) q[0]; 14 | cx q[2],q[1]; 15 | u1(0.7853981633974483) q[1]; 16 | cx q[2],q[0]; 17 | u1(-0.7853981633974483) q[0]; 18 | cx q[1],q[0]; 19 | cx q[0],q[2]; 20 | cx q[2],q[0]; 21 | cx q[0],q[2]; 22 | u1(-0.7853981633974483) q[0]; 23 | cx q[0],q[1]; 24 | u2(0,3.141592653589793) q[1]; 25 | u2(0,3.141592653589793) q[1]; 26 | u1(0.7853981633974483) q[1]; 27 | cx q[2],q[0]; 28 | u1(0.7853981633974483) q[0]; 29 | u1(0.7853981633974483) q[4]; 30 | cx q[2],q[4]; 31 | cx q[4],q[2]; 32 | cx q[2],q[4]; 33 | cx q[2],q[0]; 34 | cx q[1],q[2]; 35 | cx q[0],q[1]; 36 | u1(0.7853981633974483) q[1]; 37 | u1(-0.7853981633974483) q[2]; 38 | cx q[0],q[2]; 39 | u1(-0.7853981633974483) q[0]; 40 | u1(-0.7853981633974483) q[2]; 41 | cx q[1],q[2]; 42 | cx q[0],q[1]; 43 | u2(0,3.141592653589793) q[1]; 44 | cx q[2],q[0]; 45 | cx q[0],q[1]; 46 | measure q[4] -> c[0]; 47 | measure q[3] -> c[1]; 48 | measure q[2] -> c[2]; 49 | measure q[0] -> c[3]; 50 | measure q[1] -> c[4]; 51 | -------------------------------------------------------------------------------- /iccad20/result/olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[0]; 6 | u2(0,3.141592653589793) q[1]; 7 | u1(0.7853981633974483) q[1]; 8 | cx q[3],q[2]; 9 | u3(3.141592653589793,0,3.141592653589793) q[2]; 10 | u1(0.7853981633974483) q[2]; 11 | cx q[0],q[2]; 12 | cx q[1],q[0]; 13 | u1(-0.7853981633974483) q[0]; 14 | cx q[2],q[1]; 15 | u1(0.7853981633974483) q[1]; 16 | cx q[2],q[0]; 17 | u1(-0.7853981633974483) q[0]; 18 | cx q[1],q[0]; 19 | u1(-0.7853981633974483) q[2]; 20 | cx q[2],q[1]; 21 | cx q[0],q[2]; 22 | u2(0,3.141592653589793) q[1]; 23 | u2(0,3.141592653589793) q[1]; 24 | u1(0.7853981633974483) q[1]; 25 | u1(0.7853981633974483) q[2]; 26 | cx q[0],q[2]; 27 | cx q[2],q[0]; 28 | cx q[0],q[2]; 29 | u1(0.7853981633974483) q[4]; 30 | cx q[2],q[4]; 31 | cx q[4],q[2]; 32 | cx q[2],q[4]; 33 | cx q[2],q[0]; 34 | cx q[1],q[2]; 35 | cx q[0],q[1]; 36 | u1(0.7853981633974483) q[1]; 37 | u1(-0.7853981633974483) q[2]; 38 | cx q[0],q[2]; 39 | u1(-0.7853981633974483) q[0]; 40 | u1(-0.7853981633974483) q[2]; 41 | cx q[1],q[2]; 42 | cx q[0],q[1]; 43 | u2(0,3.141592653589793) q[1]; 44 | cx q[2],q[0]; 45 | cx q[0],q[1]; 46 | measure q[4] -> c[0]; 47 | measure q[3] -> c[1]; 48 | measure q[2] -> c[2]; 49 | measure q[0] -> c[3]; 50 | measure q[1] -> c[4]; 51 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) q[1]; 6 | u1(0.7853981633974483) q[1]; 7 | u1(0.7853981633974483) q[2]; 8 | cx q[2],q[0]; 9 | cx q[1],q[2]; 10 | cx q[0],q[1]; 11 | u1(0.7853981633974483) q[1]; 12 | u1(-0.7853981633974483) q[2]; 13 | cx q[0],q[2]; 14 | u1(-0.7853981633974483) q[0]; 15 | u1(-0.7853981633974483) q[2]; 16 | cx q[1],q[2]; 17 | cx q[0],q[1]; 18 | u2(0,3.141592653589793) q[1]; 19 | cx q[2],q[0]; 20 | cx q[0],q[1]; 21 | u1(-0.7853981633974483) q[0]; 22 | cx q[0],q[1]; 23 | u2(0,3.141592653589793) q[1]; 24 | u2(0,3.141592653589793) q[1]; 25 | u1(0.7853981633974483) q[1]; 26 | cx q[2],q[4]; 27 | cx q[4],q[2]; 28 | cx q[2],q[4]; 29 | cx q[2],q[0]; 30 | u1(0.7853981633974483) q[0]; 31 | cx q[0],q[2]; 32 | cx q[2],q[0]; 33 | cx q[0],q[2]; 34 | u1(0.7853981633974483) q[0]; 35 | cx q[3],q[2]; 36 | u3(3.141592653589793,0,3.141592653589793) q[2]; 37 | u1(0.7853981633974483) q[2]; 38 | cx q[0],q[2]; 39 | cx q[1],q[0]; 40 | u1(-0.7853981633974483) q[0]; 41 | cx q[2],q[1]; 42 | u1(0.7853981633974483) q[1]; 43 | cx q[2],q[0]; 44 | u1(-0.7853981633974483) q[0]; 45 | cx q[1],q[0]; 46 | measure q[2] -> c[0]; 47 | measure q[3] -> c[1]; 48 | measure q[4] -> c[2]; 49 | measure q[0] -> c[3]; 50 | measure q[1] -> c[4]; 51 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/adder_ibmqx2/adder_ibmqx2_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u3(3.14159265358979,0.785398163397448,3.14159265358979) q[2]; 6 | u2(0,3.14159265358979) q[4]; 7 | u3(3.14159265358979,0.785398163397448,3.14159265358979) q[0]; 8 | cx q[3],q[4]; 9 | cx q[2],q[0]; 10 | u1(0.785398163397448) q[3]; 11 | u1(0.785398163397448) q[4]; 12 | cx q[3],q[4]; 13 | cx q[4],q[2]; 14 | cx q[2],q[0]; 15 | u2(0,3.14159265358979) q[2]; 16 | u2(0,3.14159265358979) q[0]; 17 | cx q[2],q[0]; 18 | u2(0,3.14159265358979) q[2]; 19 | u2(0,3.14159265358979) q[0]; 20 | cx q[2],q[0]; 21 | u2(0,3.14159265358979) q[2]; 22 | u2(0,3.14159265358979) q[3]; 23 | cx q[3],q[2]; 24 | u2(0,3.14159265358979) q[2]; 25 | u2(0,3.14159265358979) q[3]; 26 | cx q[2],q[0]; 27 | u2(0,3.14159265358979) q[2]; 28 | u2(0,3.14159265358979) q[0]; 29 | cx q[2],q[0]; 30 | u2(0,3.14159265358979) q[2]; 31 | u2(0,3.14159265358979) q[0]; 32 | cx q[2],q[0]; 33 | cx q[2],q[0]; 34 | cx q[3],q[4]; 35 | u1(0.785398163397448) q[2]; 36 | u1(0.785398163397448) q[3]; 37 | u1(0.785398163397448) q[4]; 38 | u1(0.785398163397448) q[0]; 39 | cx q[2],q[0]; 40 | cx q[3],q[4]; 41 | u1(1.5707963267949) q[4]; 42 | cx q[4],q[2]; 43 | u2(0,3.14159265358979) q[4]; 44 | measure q[2] -> c[0]; 45 | measure q[3] -> c[2]; 46 | measure q[0] -> c[1]; 47 | measure q[4] -> c[3]; 48 | -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | creg c[16]; 5 | u3(pi,0,pi) q[0]; 6 | u3(pi,0,pi) q[1]; 7 | cx q[1],q[0]; 8 | u3(pi,0,pi) q[3]; 9 | cx q[2],q[3]; 10 | cx q[1],q[2]; 11 | u3(pi,0,pi) q[2]; 12 | u3(pi,0,pi) q[4]; 13 | cx q[5],q[4]; 14 | u3(pi,0,pi) q[6]; 15 | u3(pi,0,pi) q[7]; 16 | u3(pi,0,pi) q[7]; 17 | u3(pi,0,pi) q[8]; 18 | cx q[0],q[8]; 19 | cx q[1],q[0]; 20 | u3(pi,0,pi) q[0]; 21 | cx q[1],q[2]; 22 | u3(pi,0,pi) q[8]; 23 | cx q[10],q[9]; 24 | u3(pi,0,pi) q[10]; 25 | u3(pi,0,pi) q[9]; 26 | cx q[10],q[9]; 27 | u3(pi,0,pi) q[9]; 28 | u3(pi,0,pi) q[11]; 29 | u3(pi,0,pi) q[12]; 30 | u3(pi,0,pi) q[12]; 31 | u3(pi,0,pi) q[12]; 32 | cx q[12],q[4]; 33 | u3(pi,0,pi) q[12]; 34 | u3(pi,0,pi) q[13]; 35 | u3(pi,0,pi) q[13]; 36 | cx q[14],q[15]; 37 | cx q[14],q[15]; 38 | cx q[14],q[13]; 39 | u3(pi,0,pi) q[15]; 40 | cx q[14],q[15]; 41 | cx q[14],q[15]; 42 | measure q[8] -> c[0]; 43 | measure q[12] -> c[1]; 44 | measure q[13] -> c[2]; 45 | measure q[10] -> c[3]; 46 | measure q[4] -> c[4]; 47 | measure q[5] -> c[5]; 48 | measure q[0] -> c[6]; 49 | measure q[11] -> c[7]; 50 | measure q[14] -> c[8]; 51 | measure q[9] -> c[9]; 52 | measure q[2] -> c[10]; 53 | measure q[3] -> c[11]; 54 | measure q[15] -> c[12]; 55 | measure q[6] -> c[13]; 56 | measure q[1] -> c[14]; 57 | measure q[7] -> c[15]; 58 | -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | creg c[16]; 5 | u3(pi,0,pi) q[0]; 6 | u3(pi,0,pi) q[2]; 7 | cx q[1],q[2]; 8 | u3(pi,0,pi) q[3]; 9 | cx q[4],q[5]; 10 | cx q[4],q[5]; 11 | u3(pi,0,pi) q[5]; 12 | u3(pi,0,pi) q[6]; 13 | u3(pi,0,pi) q[6]; 14 | u3(pi,0,pi) q[8]; 15 | cx q[0],q[8]; 16 | cx q[0],q[1]; 17 | u3(pi,0,pi) q[1]; 18 | u3(pi,0,pi) q[9]; 19 | cx q[8],q[9]; 20 | cx q[0],q[8]; 21 | cx q[0],q[1]; 22 | u3(pi,0,pi) q[8]; 23 | u3(pi,0,pi) q[9]; 24 | cx q[10],q[11]; 25 | u3(pi,0,pi) q[10]; 26 | u3(pi,0,pi) q[11]; 27 | cx q[10],q[11]; 28 | u3(pi,0,pi) q[11]; 29 | u3(pi,0,pi) q[12]; 30 | u3(pi,0,pi) q[12]; 31 | cx q[4],q[12]; 32 | cx q[4],q[5]; 33 | cx q[4],q[5]; 34 | u3(pi,0,pi) q[13]; 35 | u3(pi,0,pi) q[14]; 36 | u3(pi,0,pi) q[14]; 37 | u3(pi,0,pi) q[14]; 38 | u3(pi,0,pi) q[15]; 39 | cx q[7],q[15]; 40 | cx q[14],q[15]; 41 | u3(pi,0,pi) q[14]; 42 | measure q[9] -> c[0]; 43 | measure q[14] -> c[1]; 44 | measure q[12] -> c[2]; 45 | measure q[10] -> c[3]; 46 | measure q[15] -> c[4]; 47 | measure q[7] -> c[5]; 48 | measure q[8] -> c[6]; 49 | measure q[13] -> c[7]; 50 | measure q[4] -> c[8]; 51 | measure q[11] -> c[9]; 52 | measure q[1] -> c[10]; 53 | measure q[2] -> c[11]; 54 | measure q[5] -> c[12]; 55 | measure q[3] -> c[13]; 56 | measure q[0] -> c[14]; 57 | measure q[6] -> c[15]; 58 | -------------------------------------------------------------------------------- /iccad20/result/olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | creg c[16]; 5 | u3(pi,0,pi) q[0]; 6 | u3(pi,0,pi) q[2]; 7 | cx q[1],q[2]; 8 | u3(pi,0,pi) q[3]; 9 | u3(pi,0,pi) q[3]; 10 | cx q[4],q[5]; 11 | u3(pi,0,pi) q[4]; 12 | u3(pi,0,pi) q[5]; 13 | cx q[4],q[5]; 14 | u3(pi,0,pi) q[5]; 15 | u3(pi,0,pi) q[6]; 16 | u3(pi,0,pi) q[7]; 17 | u3(pi,0,pi) q[7]; 18 | u3(pi,0,pi) q[8]; 19 | cx q[0],q[8]; 20 | cx q[0],q[1]; 21 | u3(pi,0,pi) q[1]; 22 | u3(pi,0,pi) q[9]; 23 | cx q[8],q[9]; 24 | cx q[0],q[8]; 25 | cx q[0],q[1]; 26 | u3(pi,0,pi) q[8]; 27 | u3(pi,0,pi) q[9]; 28 | cx q[11],q[10]; 29 | cx q[11],q[10]; 30 | u3(pi,0,pi) q[10]; 31 | cx q[11],q[3]; 32 | cx q[11],q[10]; 33 | cx q[11],q[10]; 34 | u3(pi,0,pi) q[13]; 35 | cx q[12],q[13]; 36 | u3(pi,0,pi) q[14]; 37 | u3(pi,0,pi) q[14]; 38 | u3(pi,0,pi) q[14]; 39 | cx q[14],q[13]; 40 | u3(pi,0,pi) q[14]; 41 | u3(pi,0,pi) q[15]; 42 | measure q[9] -> c[0]; 43 | measure q[14] -> c[1]; 44 | measure q[3] -> c[2]; 45 | measure q[4] -> c[3]; 46 | measure q[13] -> c[4]; 47 | measure q[12] -> c[5]; 48 | measure q[8] -> c[6]; 49 | measure q[15] -> c[7]; 50 | measure q[11] -> c[8]; 51 | measure q[5] -> c[9]; 52 | measure q[1] -> c[10]; 53 | measure q[2] -> c[11]; 54 | measure q[10] -> c[12]; 55 | measure q[6] -> c[13]; 56 | measure q[0] -> c[14]; 57 | measure q[7] -> c[15]; 58 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | creg c[16]; 5 | cx q[1],q[2]; 6 | u3(pi,0,pi) q[1]; 7 | u3(pi,0,pi) q[2]; 8 | cx q[1],q[2]; 9 | u3(pi,0,pi) q[2]; 10 | u3(pi,0,pi) q[3]; 11 | u3(pi,0,pi) q[4]; 12 | cx q[6],q[5]; 13 | cx q[6],q[5]; 14 | u3(pi,0,pi) q[5]; 15 | u3(pi,0,pi) q[7]; 16 | u3(pi,0,pi) q[7]; 17 | cx q[6],q[7]; 18 | cx q[6],q[5]; 19 | cx q[6],q[5]; 20 | u3(pi,0,pi) q[8]; 21 | cx q[0],q[8]; 22 | u3(pi,0,pi) q[9]; 23 | u3(pi,0,pi) q[9]; 24 | u3(pi,0,pi) q[9]; 25 | cx q[9],q[8]; 26 | u3(pi,0,pi) q[9]; 27 | u3(pi,0,pi) q[10]; 28 | cx q[11],q[10]; 29 | u3(pi,0,pi) q[12]; 30 | cx q[12],q[4]; 31 | cx q[12],q[11]; 32 | u3(pi,0,pi) q[11]; 33 | cx q[4],q[3]; 34 | cx q[12],q[4]; 35 | cx q[12],q[11]; 36 | u3(pi,0,pi) q[3]; 37 | u3(pi,0,pi) q[4]; 38 | u3(pi,0,pi) q[13]; 39 | u3(pi,0,pi) q[14]; 40 | u3(pi,0,pi) q[14]; 41 | u3(pi,0,pi) q[15]; 42 | measure q[3] -> c[0]; 43 | measure q[9] -> c[1]; 44 | measure q[7] -> c[2]; 45 | measure q[1] -> c[3]; 46 | measure q[8] -> c[4]; 47 | measure q[0] -> c[5]; 48 | measure q[4] -> c[6]; 49 | measure q[15] -> c[7]; 50 | measure q[6] -> c[8]; 51 | measure q[2] -> c[9]; 52 | measure q[11] -> c[10]; 53 | measure q[10] -> c[11]; 54 | measure q[5] -> c[12]; 55 | measure q[13] -> c[13]; 56 | measure q[12] -> c[14]; 57 | measure q[14] -> c[15]; 58 | -------------------------------------------------------------------------------- /olsq/olsq_cirq/input.py: -------------------------------------------------------------------------------- 1 | from cirq import Circuit 2 | 3 | 4 | def input_cirq(circuit: Circuit, map_physical_qubit_to: dict): 5 | """Handle a Cirq circuit object as input. 6 | In Cirq, the qubits are objects, in OLSQ IR, qubits are integers, so 7 | we need to store a mapping from indices to Cirq qubits. 8 | 9 | Args: 10 | circuit: a Cirq Circuit object 11 | map_physical_qubit_to: a mapping from Cirq qubits to indices 12 | 13 | Returns: 14 | count_program_qubit: in OLSQ IR 15 | list_gate_qubits: in OLSQ IR 16 | list_gate_name: in OLSQ IR, not merely string, but Cirq objects 17 | """ 18 | 19 | list_gate_qubits = [] 20 | list_gate_name = [] 21 | 22 | for operation in circuit.all_operations(): 23 | list_gate_name.append(operation.gate) 24 | if len(operation.qubits) == 1: 25 | list_gate_qubits.append( 26 | (map_physical_qubit_to[operation.qubits[0]],) ) 27 | elif len(operation.qubits) == 2: 28 | list_gate_qubits.append( 29 | (map_physical_qubit_to[operation.qubits[0]], 30 | map_physical_qubit_to[operation.qubits[1]] ) ) 31 | else: 32 | raise ValueError("Only support single-qubit and two-qubit gates.") 33 | 34 | return [len(circuit.all_qubits()), tuple(list_gate_qubits), 35 | tuple(list_gate_name)] 36 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_wille.qasm: -------------------------------------------------------------------------------- 1 | 2 | // 0->4, 1->3, 2->0, 3->1, 4->2 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | qreg q[5]; 6 | creg c[5]; 7 | cx q[2], q[4]; 8 | h q[4]; 9 | t q[3]; 10 | t q[2]; 11 | t q[4]; 12 | cx q[2], q[3]; 13 | cx q[4], q[2]; 14 | cx q[3], q[4]; 15 | tdg q[2]; 16 | cx q[3], q[2]; 17 | tdg q[3]; 18 | tdg q[2]; 19 | t q[4]; 20 | cx q[4], q[2]; 21 | cx q[3], q[4]; 22 | cx q[2], q[3]; 23 | h q[4]; 24 | h q[2]; 25 | t q[1]; 26 | t q[0]; 27 | t q[2]; 28 | cx q[0], q[1]; 29 | cx q[2], q[0]; 30 | cx q[1], q[2]; 31 | tdg q[0]; 32 | cx q[1], q[0]; 33 | 34 | // 0->4, 1->3, 2->0, 3->1, 4->2 35 | tdg q[1]; 36 | tdg q[0]; 37 | t q[2]; 38 | cx q[2], q[0]; 39 | cx q[1], q[2]; 40 | cx q[0], q[1]; 41 | h q[2]; 42 | h q[4]; 43 | t q[3]; 44 | t q[2]; 45 | t q[4]; 46 | cx q[2], q[3]; 47 | cx q[4], q[2]; 48 | cx q[3], q[4]; 49 | tdg q[2]; 50 | cx q[3], q[2]; 51 | tdg q[3]; 52 | tdg q[2]; 53 | t q[4]; 54 | cx q[4], q[2]; 55 | cx q[3], q[4]; 56 | cx q[2], q[3]; 57 | h q[4]; 58 | 59 | // 0->4, 1->3, 2->0, 3->1, 4->2 60 | h q[2]; 61 | t q[1]; 62 | t q[0]; 63 | t q[2]; 64 | cx q[0], q[1]; 65 | cx q[2], q[0]; 66 | cx q[1], q[2]; 67 | tdg q[0]; 68 | cx q[1], q[0]; 69 | tdg q[1]; 70 | tdg q[0]; 71 | t q[2]; 72 | cx q[2], q[0]; 73 | cx q[1], q[2]; 74 | cx q[0], q[1]; 75 | h q[2]; 76 | cx q[4], q[2]; 77 | 78 | measure q[4]->c[0]; 79 | measure q[3]->c[1]; 80 | measure q[0]->c[2]; 81 | measure q[1]->c[3]; 82 | measure q[2]->c[4]; 83 | -------------------------------------------------------------------------------- /iccad20/result/olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_olsq_depth.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) q[0]; 6 | u1(0.7853981633974483) q[0]; 7 | cx q[2],q[1]; 8 | u3(3.141592653589793,0,3.141592653589793) q[1]; 9 | u1(0.7853981633974483) q[1]; 10 | u1(0.7853981633974483) q[3]; 11 | u1(0.7853981633974483) q[4]; 12 | cx q[2],q[4]; 13 | cx q[4],q[2]; 14 | cx q[2],q[4]; 15 | cx q[2],q[1]; 16 | cx q[0],q[2]; 17 | cx q[1],q[0]; 18 | u1(0.7853981633974483) q[0]; 19 | u1(-0.7853981633974483) q[2]; 20 | cx q[1],q[2]; 21 | u1(-0.7853981633974483) q[1]; 22 | u1(-0.7853981633974483) q[2]; 23 | cx q[0],q[2]; 24 | cx q[1],q[0]; 25 | u2(0,3.141592653589793) q[0]; 26 | u2(0,3.141592653589793) q[0]; 27 | u1(0.7853981633974483) q[0]; 28 | cx q[2],q[1]; 29 | u1(0.7853981633974483) q[1]; 30 | cx q[3],q[4]; 31 | cx q[4],q[3]; 32 | cx q[3],q[4]; 33 | cx q[2],q[4]; 34 | cx q[4],q[2]; 35 | cx q[2],q[4]; 36 | cx q[2],q[1]; 37 | cx q[0],q[2]; 38 | cx q[1],q[0]; 39 | u1(0.7853981633974483) q[0]; 40 | u1(-0.7853981633974483) q[2]; 41 | cx q[1],q[2]; 42 | u1(-0.7853981633974483) q[1]; 43 | u1(-0.7853981633974483) q[2]; 44 | cx q[0],q[2]; 45 | cx q[1],q[0]; 46 | u2(0,3.141592653589793) q[0]; 47 | cx q[2],q[1]; 48 | cx q[1],q[0]; 49 | cx q[3],q[4]; 50 | cx q[4],q[3]; 51 | cx q[3],q[4]; 52 | measure q[3] -> c[0]; 53 | measure q[4] -> c[1]; 54 | measure q[2] -> c[2]; 55 | measure q[1] -> c[3]; 56 | measure q[0] -> c[4]; 57 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_4_melbourne/tof_4_after_heavy_ibmq14_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[7]; 5 | u1(-pi/4) q[12]; 6 | cx q[11],q[12]; 7 | cx q[11],q[3]; 8 | u1(pi/4) q[12]; 9 | u2(0,pi) q[12]; 10 | u1(-pi/4) q[3]; 11 | cx q[11],q[3]; 12 | u1(pi/4) q[11]; 13 | cx q[11],q[12]; 14 | cx q[12],q[11]; 15 | cx q[11],q[12]; 16 | u2(0,pi) q[11]; 17 | u1(pi/4) q[3]; 18 | u2(0,pi) q[3]; 19 | cx q[4],q[3]; 20 | u1(pi/4) q[3]; 21 | cx q[2],q[3]; 22 | u1(-pi/4) q[3]; 23 | cx q[4],q[3]; 24 | u1(pi/4) q[3]; 25 | cx q[2],q[3]; 26 | u1(-pi/4) q[3]; 27 | u2(0,pi) q[3]; 28 | u2(0,pi) q[3]; 29 | u2(0,pi) q[4]; 30 | cx q[10],q[4]; 31 | u1(pi/4) q[4]; 32 | cx q[5],q[4]; 33 | u1(-pi/4) q[4]; 34 | cx q[10],q[4]; 35 | u1(pi/4) q[4]; 36 | cx q[5],q[4]; 37 | u1(-pi/4) q[4]; 38 | u2(0,pi) q[4]; 39 | u2(0,pi) q[4]; 40 | cx q[10],q[4]; 41 | u1(-pi/4) q[4]; 42 | cx q[5],q[4]; 43 | u1(pi/4) q[4]; 44 | cx q[10],q[4]; 45 | u1(-pi/4) q[4]; 46 | cx q[5],q[4]; 47 | u1(pi/4) q[4]; 48 | u2(0,pi) q[4]; 49 | cx q[4],q[3]; 50 | u1(-pi/4) q[3]; 51 | cx q[2],q[3]; 52 | u1(pi/4) q[3]; 53 | cx q[4],q[3]; 54 | u1(-pi/4) q[3]; 55 | cx q[2],q[3]; 56 | u1(pi/4) q[3]; 57 | u2(0,pi) q[3]; 58 | cx q[3],q[11]; 59 | u1(-pi/4) q[11]; 60 | cx q[12],q[11]; 61 | u1(pi/4) q[11]; 62 | cx q[3],q[11]; 63 | measure q[5] -> c[0]; 64 | measure q[10] -> c[1]; 65 | measure q[2] -> c[2]; 66 | measure q[11] -> c[3]; 67 | measure q[4] -> c[4]; 68 | measure q[3] -> c[5]; 69 | measure q[12] -> c[6]; 70 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_4_melbourne/tof_4_after_heavy_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[7]; 5 | u1(-pi/4) q[6]; 6 | cx q[8],q[6]; 7 | u1(pi/4) q[6]; 8 | u2(0,pi) q[6]; 9 | cx q[8],q[9]; 10 | u1(-pi/4) q[9]; 11 | cx q[8],q[9]; 12 | u1(pi/4) q[8]; 13 | cx q[6],q[8]; 14 | cx q[8],q[6]; 15 | cx q[6],q[8]; 16 | u2(0,pi) q[8]; 17 | u1(pi/4) q[9]; 18 | u2(0,pi) q[9]; 19 | cx q[10],q[9]; 20 | u1(pi/4) q[9]; 21 | cx q[5],q[9]; 22 | u1(-pi/4) q[9]; 23 | cx q[10],q[9]; 24 | u2(0,pi) q[10]; 25 | u1(pi/4) q[9]; 26 | cx q[5],q[9]; 27 | u1(-pi/4) q[9]; 28 | u2(0,pi) q[9]; 29 | u2(0,pi) q[9]; 30 | cx q[11],q[10]; 31 | u1(pi/4) q[10]; 32 | cx q[4],q[10]; 33 | u1(-pi/4) q[10]; 34 | cx q[11],q[10]; 35 | u1(pi/4) q[10]; 36 | cx q[4],q[10]; 37 | u1(-pi/4) q[10]; 38 | u2(0,pi) q[10]; 39 | u2(0,pi) q[10]; 40 | cx q[11],q[10]; 41 | u1(-pi/4) q[10]; 42 | cx q[4],q[10]; 43 | u1(pi/4) q[10]; 44 | cx q[11],q[10]; 45 | u1(-pi/4) q[10]; 46 | cx q[4],q[10]; 47 | u1(pi/4) q[10]; 48 | u2(0,pi) q[10]; 49 | cx q[10],q[9]; 50 | u1(-pi/4) q[9]; 51 | cx q[5],q[9]; 52 | u1(pi/4) q[9]; 53 | cx q[10],q[9]; 54 | u1(-pi/4) q[9]; 55 | cx q[5],q[9]; 56 | u1(pi/4) q[9]; 57 | u2(0,pi) q[9]; 58 | cx q[9],q[8]; 59 | u1(-pi/4) q[8]; 60 | cx q[6],q[8]; 61 | u1(pi/4) q[8]; 62 | cx q[9],q[8]; 63 | measure q[4] -> c[0]; 64 | measure q[11] -> c[1]; 65 | measure q[5] -> c[2]; 66 | measure q[8] -> c[3]; 67 | measure q[10] -> c[4]; 68 | measure q[9] -> c[5]; 69 | measure q[6] -> c[6]; 70 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4mod5-v1_22_ibmqx2/4mod5-v1_22_ibmqx2_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u3(3.14159265358979,0,3.14159265358979) q[1]; 6 | cx q[4],q[2]; 7 | cx q[2],q[0]; 8 | u2(0,3.14159265358979) q[2]; 9 | u2(0,3.14159265358979) q[0]; 10 | cx q[2],q[0]; 11 | u2(0,3.14159265358979) q[2]; 12 | u2(0,3.14159265358979) q[0]; 13 | cx q[2],q[0]; 14 | cx q[3],q[2]; 15 | u1(0.785398163397448) q[2]; 16 | u2(0.785398163397448,3.14159265358979) q[1]; 17 | u1(0.785398163397448) q[0]; 18 | cx q[2],q[0]; 19 | u2(0,3.14159265358979) q[2]; 20 | u2(0,3.14159265358979) q[1]; 21 | cx q[2],q[1]; 22 | u2(0,3.14159265358979) q[2]; 23 | u2(0,3.14159265358979) q[0]; 24 | cx q[1],q[0]; 25 | u2(0,3.92699081698724) q[2]; 26 | u2(0.785398163397448,3.14159265358979) q[1]; 27 | cx q[2],q[0]; 28 | u3(-0.785398163397448,1.5707963267949,4.71238898038469) q[2]; 29 | u2(0,3.14159265358979) q[1]; 30 | u2(0.785398163397448,3.14159265358979) q[0]; 31 | cx q[2],q[1]; 32 | u2(0,3.14159265358979) q[2]; 33 | u2(0,3.14159265358979) q[0]; 34 | cx q[1],q[0]; 35 | u2(0,3.14159265358979) q[1]; 36 | u2(0,3.14159265358979) q[0]; 37 | cx q[2],q[0]; 38 | u2(0,3.14159265358979) q[2]; 39 | u2(0,3.14159265358979) q[1]; 40 | u2(0,3.14159265358979) q[0]; 41 | cx q[2],q[0]; 42 | u2(0,3.14159265358979) q[2]; 43 | u2(0,3.14159265358979) q[0]; 44 | cx q[2],q[1]; 45 | measure q[4] -> c[0]; 46 | measure q[0] -> c[2]; 47 | measure q[3] -> c[1]; 48 | measure q[2] -> c[3]; 49 | measure q[1] -> c[4]; 50 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_ibmqx2/4gt13_92.in: -------------------------------------------------------------------------------- 1 | 5 66 2 | 0 CNOT 2 4 0 0 3 | 1 H 1 0 1 0 4 | 2 T 1 1 0 5 | 3 T 1 4 1 0 6 | 4 T 1 0 1 1 7 | 5 CNOT 2 4 1 2 3 2 8 | 6 CNOT 2 0 4 2 4 5 9 | 7 CNOT 2 1 0 2 5 6 10 | 8 T 1 4 1 6 11 | 9 CNOT 2 1 4 2 7 8 12 | 10 T 1 1 1 9 13 | 11 T 1 4 1 9 14 | 12 T 1 0 1 7 15 | 13 CNOT 2 0 4 2 12 11 16 | 14 CNOT 2 1 0 2 10 13 17 | 15 CNOT 2 4 1 2 13 14 18 | 16 H 1 0 1 14 19 | 17 H 1 4 1 15 20 | 18 T 1 3 0 21 | 19 T 1 2 0 22 | 20 T 1 4 1 17 23 | 21 CNOT 2 2 3 2 19 18 24 | 22 CNOT 2 4 2 2 20 21 25 | 23 CNOT 2 3 4 2 21 22 26 | 24 T 1 2 1 22 27 | 25 CNOT 2 3 2 2 23 24 28 | 26 T 1 3 1 25 29 | 27 T 1 2 1 25 30 | 28 T 1 4 1 23 31 | 29 CNOT 2 4 2 2 28 27 32 | 30 CNOT 2 3 4 2 26 29 33 | 31 CNOT 2 2 3 2 29 30 34 | 32 H 1 4 1 30 35 | 33 H 1 0 1 16 36 | 34 T 1 1 1 15 37 | 35 T 1 4 1 32 38 | 36 T 1 0 1 33 39 | 37 CNOT 2 4 1 2 35 34 40 | 38 CNOT 2 0 4 2 36 37 41 | 39 CNOT 2 1 0 2 37 38 42 | 40 T 1 4 1 38 43 | 41 CNOT 2 1 4 2 39 40 44 | 42 T 1 1 1 41 45 | 43 T 1 4 1 41 46 | 44 T 1 0 1 39 47 | 45 CNOT 2 0 4 2 44 43 48 | 46 CNOT 2 1 0 2 42 45 49 | 47 CNOT 2 4 1 2 45 46 50 | 48 H 1 0 1 46 51 | 49 H 1 4 1 47 52 | 50 T 1 3 1 31 53 | 51 T 1 2 1 31 54 | 52 T 1 4 1 49 55 | 53 CNOT 2 2 3 2 51 50 56 | 54 CNOT 2 4 2 2 52 53 57 | 55 CNOT 2 3 4 2 53 54 58 | 56 T 1 2 1 54 59 | 57 CNOT 2 3 2 2 55 56 60 | 58 T 1 3 1 57 61 | 59 T 1 2 1 57 62 | 60 T 1 4 1 55 63 | 61 CNOT 2 4 2 2 60 59 64 | 62 CNOT 2 3 4 2 58 61 65 | 63 CNOT 2 2 3 2 61 62 66 | 64 H 1 4 1 62 67 | 65 CNOT 2 0 4 2 48 64 68 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_melbourne/4gt13_92.in: -------------------------------------------------------------------------------- 1 | 5 66 2 | 0 CNOT 2 4 0 0 3 | 1 H 1 0 1 0 4 | 2 T 1 1 0 5 | 3 T 1 4 1 0 6 | 4 T 1 0 1 1 7 | 5 CNOT 2 4 1 2 3 2 8 | 6 CNOT 2 0 4 2 4 5 9 | 7 CNOT 2 1 0 2 5 6 10 | 8 T 1 4 1 6 11 | 9 CNOT 2 1 4 2 7 8 12 | 10 T 1 1 1 9 13 | 11 T 1 4 1 9 14 | 12 T 1 0 1 7 15 | 13 CNOT 2 0 4 2 12 11 16 | 14 CNOT 2 1 0 2 10 13 17 | 15 CNOT 2 4 1 2 13 14 18 | 16 H 1 0 1 14 19 | 17 H 1 4 1 15 20 | 18 T 1 3 0 21 | 19 T 1 2 0 22 | 20 T 1 4 1 17 23 | 21 CNOT 2 2 3 2 19 18 24 | 22 CNOT 2 4 2 2 20 21 25 | 23 CNOT 2 3 4 2 21 22 26 | 24 T 1 2 1 22 27 | 25 CNOT 2 3 2 2 23 24 28 | 26 T 1 3 1 25 29 | 27 T 1 2 1 25 30 | 28 T 1 4 1 23 31 | 29 CNOT 2 4 2 2 28 27 32 | 30 CNOT 2 3 4 2 26 29 33 | 31 CNOT 2 2 3 2 29 30 34 | 32 H 1 4 1 30 35 | 33 H 1 0 1 16 36 | 34 T 1 1 1 15 37 | 35 T 1 4 1 32 38 | 36 T 1 0 1 33 39 | 37 CNOT 2 4 1 2 35 34 40 | 38 CNOT 2 0 4 2 36 37 41 | 39 CNOT 2 1 0 2 37 38 42 | 40 T 1 4 1 38 43 | 41 CNOT 2 1 4 2 39 40 44 | 42 T 1 1 1 41 45 | 43 T 1 4 1 41 46 | 44 T 1 0 1 39 47 | 45 CNOT 2 0 4 2 44 43 48 | 46 CNOT 2 1 0 2 42 45 49 | 47 CNOT 2 4 1 2 45 46 50 | 48 H 1 0 1 46 51 | 49 H 1 4 1 47 52 | 50 T 1 3 1 31 53 | 51 T 1 2 1 31 54 | 52 T 1 4 1 49 55 | 53 CNOT 2 2 3 2 51 50 56 | 54 CNOT 2 4 2 2 52 53 57 | 55 CNOT 2 3 4 2 53 54 58 | 56 T 1 2 1 54 59 | 57 CNOT 2 3 2 2 55 56 60 | 58 T 1 3 1 57 61 | 59 T 1 2 1 57 62 | 60 T 1 4 1 55 63 | 61 CNOT 2 4 2 2 60 59 64 | 62 CNOT 2 3 4 2 58 61 65 | 63 CNOT 2 2 3 2 61 62 66 | 64 H 1 4 1 62 67 | 65 CNOT 2 0 4 2 48 64 68 | -------------------------------------------------------------------------------- /olsq/benchmarks/mod_mult_55.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[9]; 5 | h q[6]; 6 | h q[7]; 7 | h q[8]; 8 | cx q[0],q[7]; 9 | t q[7]; 10 | cx q[2],q[7]; 11 | t q[7]; 12 | cx q[0],q[7]; 13 | tdg q[7]; 14 | cx q[2],q[7]; 15 | cx q[2],q[0]; 16 | tdg q[7]; 17 | sdg q[0]; 18 | h q[7]; 19 | tdg q[0]; 20 | cx q[7],q[6]; 21 | cx q[2],q[0]; 22 | t q[6]; 23 | cx q[1],q[6]; 24 | cx q[2],q[8]; 25 | tdg q[6]; 26 | t q[8]; 27 | cx q[0],q[8]; 28 | cx q[7],q[6]; 29 | t q[6]; 30 | t q[8]; 31 | cx q[1],q[6]; 32 | cx q[2],q[8]; 33 | cx q[1],q[7]; 34 | tdg q[6]; 35 | tdg q[8]; 36 | cx q[0],q[8]; 37 | h q[6]; 38 | t q[7]; 39 | cx q[1],q[7]; 40 | cx q[6],q[5]; 41 | tdg q[8]; 42 | cx q[6],q[3]; 43 | tdg q[7]; 44 | h q[8]; 45 | h q[3]; 46 | h q[6]; 47 | cx q[8],q[7]; 48 | cx q[7],q[3]; 49 | cx q[8],q[6]; 50 | t q[3]; 51 | t q[6]; 52 | cx q[1],q[6]; 53 | t q[6]; 54 | cx q[8],q[6]; 55 | tdg q[6]; 56 | cx q[1],q[6]; 57 | cx q[1],q[8]; 58 | tdg q[6]; 59 | h q[6]; 60 | tdg q[8]; 61 | cx q[1],q[8]; 62 | cx q[6],q[4]; 63 | cx q[1],q[3]; 64 | tdg q[8]; 65 | t q[3]; 66 | cx q[5],q[8]; 67 | cx q[7],q[3]; 68 | h q[5]; 69 | h q[8]; 70 | cx q[2],q[8]; 71 | t q[3]; 72 | cx q[1],q[3]; 73 | t q[8]; 74 | cx q[0],q[8]; 75 | cx q[1],q[5]; 76 | t q[3]; 77 | h q[3]; 78 | tdg q[5]; 79 | t q[8]; 80 | cx q[2],q[8]; 81 | cx q[7],q[5]; 82 | tdg q[2]; 83 | tdg q[5]; 84 | tdg q[8]; 85 | cx q[0],q[8]; 86 | cx q[1],q[5]; 87 | t q[0]; 88 | t q[5]; 89 | tdg q[8]; 90 | cx q[7],q[5]; 91 | h q[8]; 92 | t q[5]; 93 | sdg q[7]; 94 | h q[5]; 95 | cx q[5],q[8]; 96 | -------------------------------------------------------------------------------- /iccad20/benchmark/mod_mult_55_after_heavy.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[9]; 5 | h q[6]; 6 | h q[7]; 7 | h q[8]; 8 | cx q[0],q[7]; 9 | t q[7]; 10 | cx q[2],q[7]; 11 | t q[7]; 12 | cx q[0],q[7]; 13 | tdg q[7]; 14 | cx q[2],q[7]; 15 | cx q[2],q[0]; 16 | tdg q[7]; 17 | sdg q[0]; 18 | h q[7]; 19 | tdg q[0]; 20 | cx q[7],q[6]; 21 | cx q[2],q[0]; 22 | t q[6]; 23 | cx q[1],q[6]; 24 | cx q[2],q[8]; 25 | tdg q[6]; 26 | t q[8]; 27 | cx q[0],q[8]; 28 | cx q[7],q[6]; 29 | t q[6]; 30 | t q[8]; 31 | cx q[1],q[6]; 32 | cx q[2],q[8]; 33 | cx q[1],q[7]; 34 | tdg q[6]; 35 | tdg q[8]; 36 | cx q[0],q[8]; 37 | h q[6]; 38 | t q[7]; 39 | cx q[1],q[7]; 40 | cx q[6],q[5]; 41 | tdg q[8]; 42 | cx q[6],q[3]; 43 | tdg q[7]; 44 | h q[8]; 45 | h q[3]; 46 | h q[6]; 47 | cx q[8],q[7]; 48 | cx q[7],q[3]; 49 | cx q[8],q[6]; 50 | t q[3]; 51 | t q[6]; 52 | cx q[1],q[6]; 53 | t q[6]; 54 | cx q[8],q[6]; 55 | tdg q[6]; 56 | cx q[1],q[6]; 57 | cx q[1],q[8]; 58 | tdg q[6]; 59 | h q[6]; 60 | tdg q[8]; 61 | cx q[1],q[8]; 62 | cx q[6],q[4]; 63 | cx q[1],q[3]; 64 | tdg q[8]; 65 | t q[3]; 66 | cx q[5],q[8]; 67 | cx q[7],q[3]; 68 | h q[5]; 69 | h q[8]; 70 | cx q[2],q[8]; 71 | t q[3]; 72 | cx q[1],q[3]; 73 | t q[8]; 74 | cx q[0],q[8]; 75 | cx q[1],q[5]; 76 | t q[3]; 77 | h q[3]; 78 | tdg q[5]; 79 | t q[8]; 80 | cx q[2],q[8]; 81 | cx q[7],q[5]; 82 | tdg q[2]; 83 | tdg q[5]; 84 | tdg q[8]; 85 | cx q[0],q[8]; 86 | cx q[1],q[5]; 87 | t q[0]; 88 | t q[5]; 89 | tdg q[8]; 90 | cx q[7],q[5]; 91 | h q[8]; 92 | t q[5]; 93 | sdg q[7]; 94 | h q[5]; 95 | cx q[5],q[8]; 96 | -------------------------------------------------------------------------------- /olsq/benchmarks/vbe_adder_3.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[10]; 5 | h q[3]; 6 | h q[6]; 7 | t q[7]; 8 | t q[8]; 9 | h q[9]; 10 | cx q[2],q[3]; 11 | cx q[5],q[6]; 12 | cx q[8],q[9]; 13 | tdg q[3]; 14 | tdg q[6]; 15 | tdg q[9]; 16 | cx q[1],q[3]; 17 | cx q[4],q[6]; 18 | cx q[7],q[9]; 19 | cx q[2],q[3]; 20 | cx q[5],q[6]; 21 | cx q[8],q[9]; 22 | tdg q[3]; 23 | tdg q[6]; 24 | tdg q[9]; 25 | cx q[1],q[3]; 26 | cx q[4],q[6]; 27 | cx q[7],q[9]; 28 | cx q[1],q[2]; 29 | cx q[4],q[5]; 30 | cx q[7],q[8]; 31 | cx q[2],q[3]; 32 | cx q[5],q[6]; 33 | cx q[8],q[9]; 34 | cx q[0],q[3]; 35 | t q[3]; 36 | cx q[2],q[3]; 37 | tdg q[3]; 38 | cx q[0],q[3]; 39 | s q[3]; 40 | h q[3]; 41 | cx q[3],q[6]; 42 | t q[6]; 43 | cx q[5],q[6]; 44 | tdg q[6]; 45 | cx q[3],q[6]; 46 | s q[6]; 47 | h q[6]; 48 | t q[6]; 49 | cx q[6],q[9]; 50 | t q[9]; 51 | cx q[8],q[9]; 52 | tdg q[9]; 53 | cx q[6],q[9]; 54 | cx q[6],q[8]; 55 | s q[9]; 56 | h q[6]; 57 | tdg q[8]; 58 | h q[9]; 59 | sdg q[6]; 60 | cx q[5],q[6]; 61 | cx q[3],q[6]; 62 | tdg q[6]; 63 | cx q[5],q[6]; 64 | cx q[4],q[5]; 65 | t q[6]; 66 | cx q[3],q[6]; 67 | cx q[5],q[6]; 68 | t q[6]; 69 | cx q[4],q[6]; 70 | cx q[5],q[6]; 71 | cx q[3],q[5]; 72 | t q[6]; 73 | h q[3]; 74 | cx q[4],q[6]; 75 | sdg q[3]; 76 | cx q[4],q[5]; 77 | h q[6]; 78 | cx q[2],q[3]; 79 | cx q[0],q[3]; 80 | tdg q[3]; 81 | cx q[2],q[3]; 82 | cx q[1],q[2]; 83 | t q[3]; 84 | cx q[0],q[3]; 85 | cx q[2],q[3]; 86 | t q[3]; 87 | cx q[1],q[3]; 88 | cx q[2],q[3]; 89 | cx q[0],q[2]; 90 | t q[3]; 91 | cx q[1],q[3]; 92 | cx q[1],q[2]; 93 | h q[3]; 94 | -------------------------------------------------------------------------------- /iccad20/benchmark/vbe_adder_3_after_heavy.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[10]; 5 | h q[3]; 6 | h q[6]; 7 | t q[7]; 8 | t q[8]; 9 | h q[9]; 10 | cx q[2],q[3]; 11 | cx q[5],q[6]; 12 | cx q[8],q[9]; 13 | tdg q[3]; 14 | tdg q[6]; 15 | tdg q[9]; 16 | cx q[1],q[3]; 17 | cx q[4],q[6]; 18 | cx q[7],q[9]; 19 | cx q[2],q[3]; 20 | cx q[5],q[6]; 21 | cx q[8],q[9]; 22 | tdg q[3]; 23 | tdg q[6]; 24 | tdg q[9]; 25 | cx q[1],q[3]; 26 | cx q[4],q[6]; 27 | cx q[7],q[9]; 28 | cx q[1],q[2]; 29 | cx q[4],q[5]; 30 | cx q[7],q[8]; 31 | cx q[2],q[3]; 32 | cx q[5],q[6]; 33 | cx q[8],q[9]; 34 | cx q[0],q[3]; 35 | t q[3]; 36 | cx q[2],q[3]; 37 | tdg q[3]; 38 | cx q[0],q[3]; 39 | s q[3]; 40 | h q[3]; 41 | cx q[3],q[6]; 42 | t q[6]; 43 | cx q[5],q[6]; 44 | tdg q[6]; 45 | cx q[3],q[6]; 46 | s q[6]; 47 | h q[6]; 48 | t q[6]; 49 | cx q[6],q[9]; 50 | t q[9]; 51 | cx q[8],q[9]; 52 | tdg q[9]; 53 | cx q[6],q[9]; 54 | cx q[6],q[8]; 55 | s q[9]; 56 | h q[6]; 57 | tdg q[8]; 58 | h q[9]; 59 | sdg q[6]; 60 | cx q[5],q[6]; 61 | cx q[3],q[6]; 62 | tdg q[6]; 63 | cx q[5],q[6]; 64 | cx q[4],q[5]; 65 | t q[6]; 66 | cx q[3],q[6]; 67 | cx q[5],q[6]; 68 | t q[6]; 69 | cx q[4],q[6]; 70 | cx q[5],q[6]; 71 | cx q[3],q[5]; 72 | t q[6]; 73 | h q[3]; 74 | cx q[4],q[6]; 75 | sdg q[3]; 76 | cx q[4],q[5]; 77 | h q[6]; 78 | cx q[2],q[3]; 79 | cx q[0],q[3]; 80 | tdg q[3]; 81 | cx q[2],q[3]; 82 | cx q[1],q[2]; 83 | t q[3]; 84 | cx q[0],q[3]; 85 | cx q[2],q[3]; 86 | t q[3]; 87 | cx q[1],q[3]; 88 | cx q[2],q[3]; 89 | cx q[0],q[2]; 90 | t q[3]; 91 | cx q[1],q[3]; 92 | cx q[1],q[2]; 93 | h q[3]; 94 | -------------------------------------------------------------------------------- /test_olsq.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from olsq.device import qcdevice 4 | from olsq import OLSQ 5 | 6 | circuit_str = "OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[3];\nh q[2];\n" \ 7 | "cx q[1], q[2];\ntdg q[2];\ncx q[0], q[2];\nt q[2];\n" \ 8 | "cx q[1], q[2];\ntdg q[2];\ncx q[0], q[2];\nt q[1];\nt q[2];\n" \ 9 | "cx q[0], q[1];\nh q[2];\nt q[0];\ntdg q[1];\ncx q[0], q[1];\n" 10 | 11 | circuit_file = open("olsq/benchmarks/toffoli.qasm", "r").read() 12 | 13 | device_tmp = qcdevice("ourense", 5, [(0, 1), (1, 2), (1, 3), (3, 4)], 3) 14 | 15 | device_file = qcdevice("default_ourense") 16 | 17 | def test_olsq_depth_normal_circstr_devtmp(): 18 | lsqc_solver = OLSQ("depth", "normal") 19 | lsqc_solver.setdevice(device_tmp) 20 | lsqc_solver.setprogram(circuit_str) 21 | assert lsqc_solver.solve()[2] == 14 22 | 23 | def test_olsq_swap_normal_circfile_devfile(): 24 | lsqc_solver = OLSQ("swap", "normal") 25 | lsqc_solver.setdevice(device_file) 26 | lsqc_solver.setprogram(circuit_file) 27 | assert lsqc_solver.solve()[2] == 1 28 | 29 | def test_olsq_depth_transition_circfile_devfile(): 30 | lsqc_solver = OLSQ("depth", "transition") 31 | lsqc_solver.setdevice(device_file) 32 | lsqc_solver.setprogram(circuit_file) 33 | assert lsqc_solver.solve()[2] == 2 34 | 35 | def test_olsq_swap_transition_circstr_devtmp(): 36 | lsqc_solver = OLSQ("swap", "transition") 37 | lsqc_solver.setdevice(device_tmp) 38 | lsqc_solver.setprogram(circuit_str) 39 | assert lsqc_solver.solve()[2] == 1 40 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_melbourne/mod5mils_65_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[5]; 5 | u1(-0.7853981633974483) q[10]; 6 | cx q[10],q[9]; 7 | cx q[4],q[10]; 8 | u1(-0.7853981633974483) q[4]; 9 | u2(0,3.141592653589793) q[9]; 10 | cx q[10],q[9]; 11 | cx q[10],q[4]; 12 | u1(-0.7853981633974483) q[4]; 13 | cx q[5],q[9]; 14 | cx q[9],q[5]; 15 | cx q[5],q[9]; 16 | cx q[5],q[4]; 17 | cx q[5],q[4]; 18 | cx q[9],q[10]; 19 | cx q[10],q[9]; 20 | cx q[9],q[10]; 21 | cx q[9],q[5]; 22 | cx q[10],q[9]; 23 | u1(0.7853981633974483) q[5]; 24 | cx q[5],q[4]; 25 | cx q[4],q[5]; 26 | cx q[5],q[4]; 27 | u2(0,3.141592653589793) q[4]; 28 | u2(0,3.141592653589793) q[4]; 29 | u1(0.7853981633974483) q[4]; 30 | cx q[4],q[10]; 31 | cx q[10],q[4]; 32 | cx q[4],q[10]; 33 | u1(0.7853981633974483) q[10]; 34 | cx q[10],q[4]; 35 | u1(0.7853981633974483) q[5]; 36 | u1(0.7853981633974483) q[9]; 37 | cx q[5],q[9]; 38 | cx q[5],q[4]; 39 | cx q[4],q[5]; 40 | cx q[5],q[4]; 41 | u1(-0.7853981633974483) q[9]; 42 | cx q[9],q[10]; 43 | cx q[9],q[10]; 44 | cx q[4],q[10]; 45 | cx q[10],q[4]; 46 | cx q[4],q[10]; 47 | u2(0,3.141592653589793) q[4]; 48 | u1(0.7853981633974483) q[4]; 49 | cx q[9],q[5]; 50 | u1(-0.7853981633974483) q[5]; 51 | u1(0.7853981633974483) q[5]; 52 | cx q[8],q[9]; 53 | u3(3.141592653589793,0,3.141592653589793) q[9]; 54 | u1(0.7853981633974483) q[9]; 55 | cx q[5],q[9]; 56 | cx q[4],q[5]; 57 | u1(-0.7853981633974483) q[5]; 58 | measure q[5] -> c[0]; 59 | measure q[8] -> c[1]; 60 | measure q[4] -> c[2]; 61 | measure q[9] -> c[3]; 62 | measure q[10] -> c[4]; 63 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_melbourne/mod5mils_65_ibmq14_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[5]; 5 | u1(-0.7853981633974483) q[3]; 6 | cx q[3],q[4]; 7 | cx q[2],q[3]; 8 | u2(0,3.141592653589793) q[4]; 9 | cx q[3],q[4]; 10 | cx q[2],q[3]; 11 | cx q[3],q[2]; 12 | cx q[2],q[3]; 13 | u1(-0.7853981633974483) q[3]; 14 | cx q[2],q[3]; 15 | u1(-0.7853981633974483) q[3]; 16 | cx q[4],q[3]; 17 | cx q[4],q[3]; 18 | cx q[3],q[4]; 19 | cx q[4],q[3]; 20 | u2(0,3.141592653589793) q[3]; 21 | u2(0,3.141592653589793) q[3]; 22 | u1(0.7853981633974483) q[3]; 23 | cx q[3],q[4]; 24 | cx q[2],q[3]; 25 | u1(0.7853981633974483) q[3]; 26 | cx q[2],q[3]; 27 | cx q[3],q[2]; 28 | cx q[2],q[3]; 29 | u1(-0.7853981633974483) q[3]; 30 | cx q[3],q[2]; 31 | u1(0.7853981633974483) q[4]; 32 | cx q[11],q[3]; 33 | u1(0.7853981633974483) q[3]; 34 | cx q[4],q[3]; 35 | cx q[2],q[3]; 36 | cx q[3],q[2]; 37 | cx q[2],q[3]; 38 | cx q[3],q[11]; 39 | cx q[2],q[3]; 40 | u1(0.7853981633974483) q[3]; 41 | cx q[11],q[12]; 42 | cx q[12],q[11]; 43 | cx q[11],q[12]; 44 | cx q[11],q[3]; 45 | u1(-0.7853981633974483) q[12]; 46 | cx q[2],q[12]; 47 | cx q[1],q[2]; 48 | u1(-0.7853981633974483) q[12]; 49 | u1(0.7853981633974483) q[12]; 50 | u3(3.141592653589793,0,3.141592653589793) q[2]; 51 | u1(0.7853981633974483) q[2]; 52 | cx q[12],q[2]; 53 | cx q[3],q[11]; 54 | cx q[11],q[3]; 55 | u2(0,3.141592653589793) q[11]; 56 | u1(0.7853981633974483) q[11]; 57 | cx q[11],q[12]; 58 | measure q[12] -> c[0]; 59 | measure q[1] -> c[1]; 60 | measure q[4] -> c[2]; 61 | measure q[2] -> c[3]; 62 | measure q[3] -> c[4]; 63 | -------------------------------------------------------------------------------- /iccad20/script/tb-olsq/tket_test.py: -------------------------------------------------------------------------------- 1 | import pytket 2 | from pytket.routing import Architecture, route 3 | from pytket.qiskit import tk_to_qiskit 4 | from pytket.qasm import circuit_from_qasm, circuit_to_qasm 5 | from pytket.transform import Transform 6 | from pytket.passes import DecomposeSwapsToCXs 7 | from device import qcdevice 8 | from info import qiskit_info_after, qiskit_info_original 9 | from pytket.device import Device 10 | from pytket.predicates import CompilationUnit 11 | from pytket.passes import DecomposeSwapsToCXs 12 | from qiskit import QuantumCircuit 13 | import sys 14 | 15 | 16 | def tket_run(file_name, device_name): 17 | connection_list = qcdevice(device_name).list_qubit_edge 18 | circ = circuit_from_qasm(file_name) 19 | circ.measure_all() 20 | arc = Architecture(connection_list) 21 | dev = Device(arc) 22 | routed_circ = route(circ, arc) 23 | # cu = CompilationUnit(routed_circ) 24 | Transform.DecomposeBRIDGE().apply(routed_circ) 25 | # pass1 = DecomposeSwapsToCXs(dev) 26 | # pass1.apply(cu) 27 | # circ2 = cu.circuit 28 | return routed_circ 29 | 30 | 31 | file_name = sys.argv[1] 32 | device_name = sys.argv[2] 33 | new_file_name = "result/paper/" + file_name.split('/')[-1].replace('.qasm', "_{}_tket".format(device_name)) 34 | 35 | original_cx_count = qiskit_info_original(file_name, new_file_name)[1] 36 | 37 | 38 | routed_circ = tket_run(file_name, device_name) 39 | # circuit_to_qasm(circ, "result/paper/" + file_name.split('/')[-1] + "_tket.qasm") 40 | circ = tk_to_qiskit(routed_circ) 41 | qiskit_info_after(circ, new_file_name, original_cx_count) 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Daniel (Bochen) Tan 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_10_3_aspen-4/16QBT_10CYC_TFL_3.in: -------------------------------------------------------------------------------- 1 | 16 73 2 | 0 X 1 0 0 3 | 1 X 1 2 0 4 | 2 X 1 10 0 5 | 3 X 1 9 0 6 | 4 X 1 7 0 7 | 5 CNOT 2 14 12 0 8 | 6 CNOT 2 13 6 0 9 | 7 X 1 0 1 0 10 | 8 X 1 7 1 4 11 | 9 X 1 11 0 12 | 10 X 1 4 0 13 | 11 X 1 5 0 14 | 12 CNOT 2 12 1 1 5 15 | 13 CNOT 2 6 10 2 6 2 16 | 14 X 1 7 1 8 17 | 15 CNOT 2 0 11 2 7 9 18 | 16 CNOT 2 12 1 2 12 12 19 | 17 CNOT 2 9 5 2 3 11 20 | 18 CNOT 2 2 8 1 1 21 | 19 X 1 10 1 13 22 | 20 X 1 9 1 17 23 | 21 X 1 4 1 10 24 | 22 X 1 8 1 18 25 | 23 X 1 3 0 26 | 24 CNOT 2 11 14 2 15 5 27 | 25 CNOT 2 15 2 1 18 28 | 26 CNOT 2 12 7 2 16 14 29 | 27 CNOT 2 13 0 2 6 15 30 | 28 X 1 11 1 24 31 | 29 X 1 7 1 26 32 | 30 X 1 3 1 23 33 | 31 X 1 12 1 26 34 | 32 X 1 14 1 24 35 | 33 X 1 8 1 22 36 | 34 CNOT 2 6 10 2 13 19 37 | 35 CNOT 2 13 0 2 27 27 38 | 36 X 1 11 1 28 39 | 37 X 1 8 1 33 40 | 38 X 1 1 1 16 41 | 39 X 1 14 1 32 42 | 40 X 1 13 1 35 43 | 41 CNOT 2 12 7 2 31 29 44 | 42 CNOT 2 3 5 2 30 17 45 | 43 X 1 9 1 20 46 | 44 X 1 10 1 34 47 | 45 CNOT 2 11 14 2 36 39 48 | 46 CNOT 2 12 1 2 41 38 49 | 47 CNOT 2 2 8 2 25 37 50 | 48 X 1 11 1 45 51 | 49 X 1 2 1 47 52 | 50 X 1 4 1 21 53 | 51 X 1 15 1 25 54 | 52 X 1 8 1 47 55 | 53 X 1 14 1 45 56 | 54 CNOT 2 13 6 2 40 34 57 | 55 CNOT 2 7 9 2 41 43 58 | 56 CNOT 2 12 1 2 46 46 59 | 57 X 1 11 1 48 60 | 58 X 1 7 1 55 61 | 59 X 1 9 1 55 62 | 60 X 1 1 1 56 63 | 61 CNOT 2 14 12 2 53 56 64 | 62 CNOT 2 13 6 2 54 54 65 | 63 CNOT 2 3 5 2 42 42 66 | 64 CNOT 2 8 4 2 52 50 67 | 65 X 1 11 1 57 68 | 66 X 1 12 1 61 69 | 67 X 1 0 1 35 70 | 68 X 1 10 1 44 71 | 69 X 1 14 1 61 72 | 70 CNOT 2 7 9 2 58 59 73 | 71 CNOT 2 3 5 2 63 63 74 | 72 CNOT 2 8 4 2 64 64 75 | -------------------------------------------------------------------------------- /iccad20/script/info.py: -------------------------------------------------------------------------------- 1 | from qiskit import QuantumCircuit 2 | 3 | 4 | def qiskit_info_original(file_name, new_file_name): 5 | original_circ = QuantumCircuit.from_qasm_file(file_name) 6 | original_depth = original_circ.depth() 7 | original_gate_count = original_circ.count_ops() 8 | print("depth =", original_depth) 9 | print("gate count =", original_gate_count) 10 | with open(new_file_name + ".txt", 'w') as file: 11 | file.write("before:\n") 12 | file.write("depth " + str(original_depth) + '\n') 13 | for type, count in original_gate_count.items(): 14 | file.write(type + ' ' + str(count) + '\n') 15 | file.close() 16 | original_cx_count = original_gate_count['cx'] 17 | return [original_depth, original_cx_count] 18 | 19 | def qiskit_info_after(circ, new_file_name, original_cx_count): 20 | if isinstance(circ, str): 21 | circ = QuantumCircuit.from_qasm_file(circ) 22 | circ_qiskit = circ.decompose() 23 | 24 | circ_qiskit.qasm(filename=new_file_name + '.qasm') 25 | print(circ_qiskit) 26 | depth = circ_qiskit.depth() 27 | gate_count = circ_qiskit.count_ops() 28 | print("depth =", depth) 29 | print("gate count =", gate_count) 30 | with open(new_file_name + ".txt", 'a') as file: 31 | file.write("after:\n") 32 | file.write("depth " + str(depth) + '\n') 33 | for type, count in gate_count.items(): 34 | file.write(type + ' ' + str(count) + '\n') 35 | additional_cx_count = gate_count['cx'] - original_cx_count 36 | file.write("additional cx " + str(additional_cx_count)) 37 | file.close() 38 | return additional_cx_count 39 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_4_melbourne/barenco_tof_4_after_heavy_ibmq14_triq.in: -------------------------------------------------------------------------------- 1 | 7 72 2 | 0 T 1 4 0 3 | 1 T 1 5 0 4 | 2 H 1 6 0 5 | 3 CNOT 2 5 6 2 1 2 6 | 4 T 1 6 1 3 7 | 5 CNOT 2 3 6 1 4 8 | 6 T 1 6 1 5 9 | 7 CNOT 2 5 6 2 3 6 10 | 8 CNOT 2 3 5 2 5 7 11 | 9 T 1 5 1 8 12 | 10 CNOT 2 3 5 2 8 9 13 | 11 H 1 5 1 10 14 | 12 CNOT 2 4 5 2 0 11 15 | 13 T 1 5 1 12 16 | 14 CNOT 2 2 5 1 13 17 | 15 T 1 5 1 14 18 | 16 CNOT 2 4 5 2 12 15 19 | 17 CNOT 2 2 4 2 14 16 20 | 18 T 1 4 1 17 21 | 19 CNOT 2 2 4 2 17 18 22 | 20 H 1 4 1 19 23 | 21 CNOT 2 1 4 1 20 24 | 22 T 1 4 1 21 25 | 23 CNOT 2 0 4 1 22 26 | 24 T 1 4 1 23 27 | 25 CNOT 2 1 4 2 21 24 28 | 26 T 1 4 1 25 29 | 27 CNOT 2 0 4 2 23 26 30 | 28 T 1 4 1 27 31 | 29 H 1 4 1 28 32 | 30 CNOT 2 4 5 2 29 16 33 | 31 T 1 5 1 30 34 | 32 CNOT 2 2 5 2 19 31 35 | 33 T 1 5 1 32 36 | 34 CNOT 2 4 5 2 30 33 37 | 35 H 1 5 1 34 38 | 36 CNOT 2 5 6 2 35 7 39 | 37 T 1 6 1 36 40 | 38 CNOT 2 3 6 2 10 37 41 | 39 T 1 6 1 38 42 | 40 CNOT 2 5 6 2 36 39 43 | 41 CNOT 2 3 5 2 38 40 44 | 42 H 1 6 1 40 45 | 43 T 1 5 1 41 46 | 44 CNOT 2 3 5 2 41 43 47 | 45 T 1 5 1 44 48 | 46 H 1 5 1 45 49 | 47 CNOT 2 4 5 2 34 46 50 | 48 T 1 5 1 47 51 | 49 CNOT 2 2 5 2 32 48 52 | 50 T 1 5 1 49 53 | 51 CNOT 2 4 5 2 47 50 54 | 52 H 1 4 1 51 55 | 53 CNOT 2 1 4 2 25 52 56 | 54 T 1 4 1 53 57 | 55 CNOT 2 0 4 2 27 54 58 | 56 T 1 4 1 55 59 | 57 CNOT 2 1 4 2 53 56 60 | 58 T 1 4 1 57 61 | 59 CNOT 2 0 4 2 55 58 62 | 60 T 1 4 1 59 63 | 61 H 1 4 1 60 64 | 62 CNOT 2 4 5 2 61 51 65 | 63 T 1 5 1 62 66 | 64 CNOT 2 2 5 2 49 63 67 | 65 T 1 5 1 64 68 | 66 CNOT 2 4 5 2 62 65 69 | 67 CNOT 2 2 4 2 64 66 70 | 68 H 1 5 1 66 71 | 69 T 1 4 1 67 72 | 70 CNOT 2 2 4 2 67 69 73 | 71 T 1 4 1 70 74 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_5_melbourne/tof_5_after_heavy_ibmq14_triq.in: -------------------------------------------------------------------------------- 1 | 9 75 2 | 0 H 1 5 0 3 | 1 H 1 6 0 4 | 2 H 1 7 0 5 | 3 H 1 8 0 6 | 4 CNOT 2 1 5 1 0 7 | 5 T 1 5 1 4 8 | 6 CNOT 2 0 5 1 5 9 | 7 T 1 5 1 6 10 | 8 CNOT 2 1 5 2 4 7 11 | 9 T 1 5 1 8 12 | 10 CNOT 2 0 5 2 6 9 13 | 11 T 1 5 1 10 14 | 12 H 1 5 1 11 15 | 13 CNOT 2 5 6 2 12 1 16 | 14 T 1 6 1 13 17 | 15 CNOT 2 2 6 1 14 18 | 16 T 1 6 1 15 19 | 17 CNOT 2 5 6 2 13 16 20 | 18 T 1 6 1 17 21 | 19 CNOT 2 2 6 2 15 18 22 | 20 T 1 6 1 19 23 | 21 H 1 6 1 20 24 | 22 CNOT 2 6 7 2 21 2 25 | 23 T 1 7 1 22 26 | 24 CNOT 2 3 7 1 23 27 | 25 T 1 7 1 24 28 | 26 CNOT 2 6 7 2 22 25 29 | 27 T 1 7 1 26 30 | 28 CNOT 2 3 7 2 24 27 31 | 29 T 1 7 1 28 32 | 30 H 1 7 1 29 33 | 31 CNOT 2 7 8 2 30 3 34 | 32 T 1 8 1 31 35 | 33 CNOT 2 4 8 1 32 36 | 34 T 1 8 1 33 37 | 35 CNOT 2 7 8 2 31 34 38 | 36 T 1 8 1 35 39 | 37 CNOT 2 4 8 2 33 36 40 | 38 CNOT 2 4 7 2 37 35 41 | 39 T 1 8 1 37 42 | 40 T 1 7 1 38 43 | 41 H 1 8 1 39 44 | 42 CNOT 2 4 7 2 38 40 45 | 43 T 1 4 1 42 46 | 44 T 1 7 1 42 47 | 45 H 1 7 1 44 48 | 46 CNOT 2 6 7 2 26 45 49 | 47 T 1 7 1 46 50 | 48 CNOT 2 3 7 2 28 47 51 | 49 T 1 7 1 48 52 | 50 CNOT 2 6 7 2 46 49 53 | 51 H 1 6 1 50 54 | 52 T 1 7 1 50 55 | 53 CNOT 2 3 7 2 48 52 56 | 54 CNOT 2 5 6 2 17 51 57 | 55 T 1 6 1 54 58 | 56 T 1 7 1 53 59 | 57 CNOT 2 2 6 2 19 55 60 | 58 H 1 7 1 56 61 | 59 T 1 6 1 57 62 | 60 CNOT 2 5 6 2 54 59 63 | 61 H 1 5 1 60 64 | 62 T 1 6 1 60 65 | 63 CNOT 2 1 5 2 8 61 66 | 64 CNOT 2 2 6 2 57 62 67 | 65 T 1 5 1 63 68 | 66 T 1 6 1 64 69 | 67 CNOT 2 0 5 2 10 65 70 | 68 H 1 6 1 66 71 | 69 T 1 5 1 67 72 | 70 CNOT 2 1 5 2 63 69 73 | 71 T 1 5 1 70 74 | 72 CNOT 2 0 5 2 67 71 75 | 73 T 1 5 1 72 76 | 74 H 1 5 1 73 77 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_ibmqx2/mod5mils_65_ibmqx2_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) node[1]; 6 | cx node[2],node[0]; 7 | u3(3.141592653589793,0,3.141592653589793) node[0]; 8 | u1(0.7853981633974483) node[0]; 9 | cx node[1],node[0]; 10 | u2(0,3.141592653589793) node[3]; 11 | u1(0.7853981633974483) node[3]; 12 | u1(0.7853981633974483) node[4]; 13 | measure node[2] -> c[1]; 14 | cx node[2],node[3]; 15 | cx node[3],node[2]; 16 | cx node[2],node[3]; 17 | cx node[2],node[1]; 18 | cx node[0],node[2]; 19 | u1(-0.7853981633974483) node[1]; 20 | cx node[0],node[1]; 21 | u1(-0.7853981633974483) node[0]; 22 | u1(-0.7853981633974483) node[1]; 23 | u1(0.7853981633974483) node[2]; 24 | cx node[2],node[1]; 25 | cx node[0],node[2]; 26 | cx node[1],node[0]; 27 | u1(0.7853981633974483) node[0]; 28 | measure node[1] -> c[0]; 29 | u2(0,3.141592653589793) node[2]; 30 | u2(0,3.141592653589793) node[2]; 31 | u1(0.7853981633974483) node[2]; 32 | cx node[0],node[2]; 33 | cx node[2],node[4]; 34 | cx node[0],node[2]; 35 | cx node[2],node[4]; 36 | cx node[2],node[4]; 37 | cx node[0],node[2]; 38 | u1(0.7853981633974483) node[2]; 39 | u1(-0.7853981633974483) node[4]; 40 | cx node[2],node[4]; 41 | cx node[0],node[2]; 42 | cx node[2],node[4]; 43 | cx node[0],node[2]; 44 | u1(-0.7853981633974483) node[0]; 45 | u1(-0.7853981633974483) node[4]; 46 | cx node[2],node[4]; 47 | cx node[0],node[2]; 48 | u2(0,3.141592653589793) node[2]; 49 | cx node[0],node[2]; 50 | cx node[2],node[0]; 51 | cx node[0],node[2]; 52 | cx node[4],node[2]; 53 | cx node[2],node[0]; 54 | measure node[4] -> c[2]; 55 | measure node[2] -> c[3]; 56 | measure node[0] -> c[4]; 57 | -------------------------------------------------------------------------------- /test_olsq_qiskit.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from qiskit import IBMQ 3 | from qiskit import QuantumCircuit 4 | 5 | from olsq.device import qcdevice 6 | from olsq.olsq_qiskit import OLSQ_qiskit 7 | 8 | circuit_str = "OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[3];\nh q[2];\n" \ 9 | "cx q[1], q[2];\ntdg q[2];\ncx q[0], q[2];\nt q[2];\n" \ 10 | "cx q[1], q[2];\ntdg q[2];\ncx q[0], q[2];\nt q[1];\nt q[2];\n" \ 11 | "cx q[0], q[1];\nh q[2];\nt q[0];\ntdg q[1];\ncx q[0], q[1];\n" 12 | circuit_qiskit = QuantumCircuit() 13 | circuit_qiskit = circuit_qiskit.from_qasm_str(circuit_str) 14 | 15 | device_tmp = qcdevice("ourense", 5, [(0, 1), (1, 2), (1, 3), (3, 4)], 3) 16 | 17 | def test_olsq_depth_normal_devibm(): 18 | lsqc_solver = OLSQ_qiskit("depth", "normal") 19 | 20 | provider = IBMQ.load_account() 21 | backend = provider.get_backend("ibmq_lima") # belem, quito also works 22 | lsqc_solver.setdevice(backend, "ibm") 23 | 24 | lsqc_solver.setprogram(circuit_qiskit) 25 | assert lsqc_solver.solve()[2] == 14 26 | 27 | def test_olsq_swap_normal(): 28 | lsqc_solver = OLSQ_qiskit("swap", "normal") 29 | lsqc_solver.setdevice(device_tmp) 30 | lsqc_solver.setprogram(circuit_qiskit) 31 | assert lsqc_solver.solve()[2] == 1 32 | 33 | def test_olsq_depth_transition(): 34 | lsqc_solver = OLSQ_qiskit("depth", "transition") 35 | lsqc_solver.setdevice(device_tmp) 36 | lsqc_solver.setprogram(circuit_qiskit) 37 | assert lsqc_solver.solve()[2] == 2 38 | 39 | def test_olsq_swap_transition(): 40 | lsqc_solver = OLSQ_qiskit("swap", "transition") 41 | lsqc_solver.setdevice(device_tmp) 42 | lsqc_solver.setprogram(circuit_qiskit) 43 | assert lsqc_solver.solve()[2] == 1 44 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/mod5mils_65_melbourne/mod5mils_65_ibmq14_tket.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg node[12]; 4 | creg c[5]; 5 | u2(0,3.141592653589793) node[2]; 6 | u1(0.7853981633974483) node[2]; 7 | u1(0.7853981633974483) node[3]; 8 | cx node[5],node[4]; 9 | u3(3.141592653589793,0,3.141592653589793) node[4]; 10 | u1(0.7853981633974483) node[4]; 11 | cx node[3],node[4]; 12 | cx node[2],node[3]; 13 | u1(-0.7853981633974483) node[3]; 14 | cx node[4],node[3]; 15 | cx node[3],node[4]; 16 | cx node[4],node[3]; 17 | cx node[3],node[2]; 18 | u1(0.7853981633974483) node[2]; 19 | cx node[3],node[4]; 20 | u1(-0.7853981633974483) node[3]; 21 | cx node[2],node[3]; 22 | cx node[3],node[2]; 23 | cx node[2],node[3]; 24 | u1(-0.7853981633974483) node[4]; 25 | cx node[3],node[4]; 26 | cx node[2],node[3]; 27 | u2(0,3.141592653589793) node[3]; 28 | u2(0,3.141592653589793) node[3]; 29 | u1(0.7853981633974483) node[3]; 30 | cx node[2],node[3]; 31 | cx node[3],node[2]; 32 | cx node[2],node[3]; 33 | cx node[4],node[3]; 34 | u1(0.7853981633974483) node[3]; 35 | u1(0.7853981633974483) node[11]; 36 | cx node[11],node[3]; 37 | cx node[2],node[3]; 38 | cx node[3],node[2]; 39 | cx node[2],node[3]; 40 | cx node[3],node[11]; 41 | u1(-0.7853981633974483) node[11]; 42 | cx node[2],node[3]; 43 | u1(0.7853981633974483) node[3]; 44 | cx node[11],node[3]; 45 | cx node[3],node[11]; 46 | cx node[11],node[3]; 47 | cx node[2],node[3]; 48 | u1(-0.7853981633974483) node[2]; 49 | u1(-0.7853981633974483) node[3]; 50 | cx node[11],node[3]; 51 | cx node[2],node[3]; 52 | cx node[3],node[2]; 53 | cx node[2],node[3]; 54 | cx node[3],node[11]; 55 | u2(0,3.141592653589793) node[11]; 56 | cx node[2],node[3]; 57 | cx node[3],node[11]; 58 | measure node[4] -> c[0]; 59 | measure node[5] -> c[1]; 60 | measure node[2] -> c[2]; 61 | measure node[3] -> c[3]; 62 | measure node[11] -> c[4]; 63 | -------------------------------------------------------------------------------- /olsq/benchmarks/barenco_tof_5.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[9]; 5 | t q[5]; 6 | t q[6]; 7 | t q[7]; 8 | h q[8]; 9 | cx q[7],q[8]; 10 | tdg q[8]; 11 | cx q[4],q[8]; 12 | t q[8]; 13 | cx q[7],q[8]; 14 | cx q[4],q[7]; 15 | tdg q[7]; 16 | cx q[4],q[7]; 17 | h q[7]; 18 | cx q[6],q[7]; 19 | tdg q[7]; 20 | cx q[3],q[7]; 21 | t q[7]; 22 | cx q[6],q[7]; 23 | cx q[3],q[6]; 24 | tdg q[6]; 25 | cx q[3],q[6]; 26 | h q[6]; 27 | cx q[5],q[6]; 28 | tdg q[6]; 29 | cx q[2],q[6]; 30 | t q[6]; 31 | cx q[5],q[6]; 32 | cx q[2],q[5]; 33 | tdg q[5]; 34 | cx q[2],q[5]; 35 | h q[5]; 36 | cx q[1],q[5]; 37 | tdg q[5]; 38 | cx q[0],q[5]; 39 | t q[5]; 40 | cx q[1],q[5]; 41 | tdg q[5]; 42 | cx q[0],q[5]; 43 | t q[5]; 44 | h q[5]; 45 | cx q[5],q[6]; 46 | tdg q[6]; 47 | cx q[2],q[6]; 48 | t q[6]; 49 | cx q[5],q[6]; 50 | h q[6]; 51 | cx q[6],q[7]; 52 | tdg q[7]; 53 | cx q[3],q[7]; 54 | t q[7]; 55 | cx q[6],q[7]; 56 | h q[7]; 57 | cx q[7],q[8]; 58 | tdg q[8]; 59 | cx q[4],q[8]; 60 | t q[8]; 61 | cx q[7],q[8]; 62 | cx q[4],q[7]; 63 | h q[8]; 64 | t q[7]; 65 | cx q[4],q[7]; 66 | tdg q[7]; 67 | h q[7]; 68 | cx q[6],q[7]; 69 | tdg q[7]; 70 | cx q[3],q[7]; 71 | t q[7]; 72 | cx q[6],q[7]; 73 | h q[6]; 74 | cx q[5],q[6]; 75 | tdg q[6]; 76 | cx q[2],q[6]; 77 | t q[6]; 78 | cx q[5],q[6]; 79 | h q[5]; 80 | cx q[1],q[5]; 81 | t q[5]; 82 | cx q[0],q[5]; 83 | tdg q[5]; 84 | cx q[1],q[5]; 85 | t q[5]; 86 | cx q[0],q[5]; 87 | tdg q[5]; 88 | h q[5]; 89 | cx q[5],q[6]; 90 | tdg q[6]; 91 | cx q[2],q[6]; 92 | t q[6]; 93 | cx q[5],q[6]; 94 | cx q[2],q[5]; 95 | h q[6]; 96 | t q[5]; 97 | cx q[6],q[7]; 98 | cx q[2],q[5]; 99 | tdg q[7]; 100 | cx q[3],q[7]; 101 | tdg q[5]; 102 | t q[7]; 103 | cx q[6],q[7]; 104 | cx q[3],q[6]; 105 | h q[7]; 106 | t q[6]; 107 | cx q[3],q[6]; 108 | tdg q[6]; 109 | -------------------------------------------------------------------------------- /iccad20/benchmark/barenco_tof_5_after_heavy.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | 4 | qreg q[9]; 5 | t q[5]; 6 | t q[6]; 7 | t q[7]; 8 | h q[8]; 9 | cx q[7],q[8]; 10 | tdg q[8]; 11 | cx q[4],q[8]; 12 | t q[8]; 13 | cx q[7],q[8]; 14 | cx q[4],q[7]; 15 | tdg q[7]; 16 | cx q[4],q[7]; 17 | h q[7]; 18 | cx q[6],q[7]; 19 | tdg q[7]; 20 | cx q[3],q[7]; 21 | t q[7]; 22 | cx q[6],q[7]; 23 | cx q[3],q[6]; 24 | tdg q[6]; 25 | cx q[3],q[6]; 26 | h q[6]; 27 | cx q[5],q[6]; 28 | tdg q[6]; 29 | cx q[2],q[6]; 30 | t q[6]; 31 | cx q[5],q[6]; 32 | cx q[2],q[5]; 33 | tdg q[5]; 34 | cx q[2],q[5]; 35 | h q[5]; 36 | cx q[1],q[5]; 37 | tdg q[5]; 38 | cx q[0],q[5]; 39 | t q[5]; 40 | cx q[1],q[5]; 41 | tdg q[5]; 42 | cx q[0],q[5]; 43 | t q[5]; 44 | h q[5]; 45 | cx q[5],q[6]; 46 | tdg q[6]; 47 | cx q[2],q[6]; 48 | t q[6]; 49 | cx q[5],q[6]; 50 | h q[6]; 51 | cx q[6],q[7]; 52 | tdg q[7]; 53 | cx q[3],q[7]; 54 | t q[7]; 55 | cx q[6],q[7]; 56 | h q[7]; 57 | cx q[7],q[8]; 58 | tdg q[8]; 59 | cx q[4],q[8]; 60 | t q[8]; 61 | cx q[7],q[8]; 62 | cx q[4],q[7]; 63 | h q[8]; 64 | t q[7]; 65 | cx q[4],q[7]; 66 | tdg q[7]; 67 | h q[7]; 68 | cx q[6],q[7]; 69 | tdg q[7]; 70 | cx q[3],q[7]; 71 | t q[7]; 72 | cx q[6],q[7]; 73 | h q[6]; 74 | cx q[5],q[6]; 75 | tdg q[6]; 76 | cx q[2],q[6]; 77 | t q[6]; 78 | cx q[5],q[6]; 79 | h q[5]; 80 | cx q[1],q[5]; 81 | t q[5]; 82 | cx q[0],q[5]; 83 | tdg q[5]; 84 | cx q[1],q[5]; 85 | t q[5]; 86 | cx q[0],q[5]; 87 | tdg q[5]; 88 | h q[5]; 89 | cx q[5],q[6]; 90 | tdg q[6]; 91 | cx q[2],q[6]; 92 | t q[6]; 93 | cx q[5],q[6]; 94 | cx q[2],q[5]; 95 | h q[6]; 96 | t q[5]; 97 | cx q[6],q[7]; 98 | cx q[2],q[5]; 99 | tdg q[7]; 100 | cx q[3],q[7]; 101 | tdg q[5]; 102 | t q[7]; 103 | cx q[6],q[7]; 104 | cx q[3],q[6]; 105 | h q[7]; 106 | t q[6]; 107 | cx q[3],q[6]; 108 | tdg q[6]; 109 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_5_melbourne/tof_5_after_heavy_ibmq14_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[9]; 5 | u1(-pi/4) q[0]; 6 | cx q[1],q[0]; 7 | u1(pi/4) q[0]; 8 | u2(0,pi) q[0]; 9 | cx q[1],q[2]; 10 | u1(-pi/4) q[2]; 11 | cx q[1],q[2]; 12 | u1(pi/4) q[1]; 13 | cx q[1],q[0]; 14 | cx q[0],q[1]; 15 | cx q[1],q[0]; 16 | u2(0,pi) q[1]; 17 | u1(pi/4) q[2]; 18 | u2(0,pi) q[2]; 19 | cx q[3],q[2]; 20 | u1(pi/4) q[2]; 21 | cx q[12],q[2]; 22 | u1(-pi/4) q[2]; 23 | cx q[3],q[2]; 24 | u1(pi/4) q[2]; 25 | cx q[12],q[2]; 26 | u1(-pi/4) q[2]; 27 | u2(0,pi) q[2]; 28 | u2(0,pi) q[2]; 29 | u2(0,pi) q[3]; 30 | cx q[4],q[3]; 31 | u1(pi/4) q[3]; 32 | cx q[11],q[3]; 33 | u1(-pi/4) q[3]; 34 | cx q[4],q[3]; 35 | u1(pi/4) q[3]; 36 | cx q[11],q[3]; 37 | u1(-pi/4) q[3]; 38 | u2(0,pi) q[3]; 39 | u2(0,pi) q[3]; 40 | u2(0,pi) q[4]; 41 | cx q[5],q[4]; 42 | u1(pi/4) q[4]; 43 | cx q[10],q[4]; 44 | u1(-pi/4) q[4]; 45 | cx q[5],q[4]; 46 | u1(pi/4) q[4]; 47 | cx q[10],q[4]; 48 | u1(-pi/4) q[4]; 49 | u2(0,pi) q[4]; 50 | u2(0,pi) q[4]; 51 | cx q[5],q[4]; 52 | u1(-pi/4) q[4]; 53 | cx q[10],q[4]; 54 | u1(pi/4) q[4]; 55 | cx q[5],q[4]; 56 | u1(-pi/4) q[4]; 57 | cx q[10],q[4]; 58 | u1(pi/4) q[4]; 59 | u2(0,pi) q[4]; 60 | cx q[4],q[3]; 61 | u1(-pi/4) q[3]; 62 | cx q[11],q[3]; 63 | u1(pi/4) q[3]; 64 | cx q[4],q[3]; 65 | u1(-pi/4) q[3]; 66 | cx q[11],q[3]; 67 | u1(pi/4) q[3]; 68 | u2(0,pi) q[3]; 69 | cx q[3],q[2]; 70 | u1(-pi/4) q[2]; 71 | cx q[12],q[2]; 72 | u1(pi/4) q[2]; 73 | cx q[3],q[2]; 74 | u1(-pi/4) q[2]; 75 | cx q[12],q[2]; 76 | u1(pi/4) q[2]; 77 | u2(0,pi) q[2]; 78 | cx q[2],q[1]; 79 | u1(-pi/4) q[1]; 80 | cx q[0],q[1]; 81 | u1(pi/4) q[1]; 82 | cx q[2],q[1]; 83 | measure q[10] -> c[0]; 84 | measure q[5] -> c[1]; 85 | measure q[11] -> c[2]; 86 | measure q[12] -> c[3]; 87 | measure q[1] -> c[4]; 88 | measure q[4] -> c[5]; 89 | measure q[3] -> c[6]; 90 | measure q[2] -> c[7]; 91 | measure q[0] -> c[8]; 92 | -------------------------------------------------------------------------------- /iccad20/result/qaoa-olsq/output.py: -------------------------------------------------------------------------------- 1 | import glob 2 | import csv 3 | import ast 4 | 5 | with open('data.csv', 'w') as data: 6 | datawriter = csv.writer(data, delimiter=',') 7 | datawriter.writerow(["size", "tket_depth", "tket_swap", "our_depth", "our_swap", 8 | "swap_ratio", "depth_ratio", "time", "edges"]) 9 | for file_name in glob.glob('qaoa_exp_*'): 10 | print(file_name) 11 | dataline = dict() 12 | dataline["size"] = int(file_name.split('_')[-2]) 13 | with open(file_name, 'r') as datum: 14 | datumlines = datum.readlines() 15 | our_swap = 0 16 | for datumline in datumlines: 17 | if datumline.startswith('['): 18 | dataline["edges"] = ast.literal_eval(datumline) 19 | if datumline.startswith('num_swap'): 20 | dataline["tket_swap"] = int(datumline.split(' ')[1]) 21 | dataline["tket_depth"] = int(datumline.split(' ')[-1].split('\\')[0]) 22 | if datumline.startswith("A swap gate"): 23 | our_swap += 1 24 | if datumline.startswith("final depth"): 25 | dataline["our_depth"] = int(datumline.split(' ')[-1].split('\\')[0]) 26 | if datumline.startswith("Compilation time"): 27 | dataline["time"] = str(datumline.split(' ')[-1])[:-2] 28 | dataline['our_swap'] = our_swap 29 | print(dataline) 30 | datawriter.writerow([dataline["size"], dataline["tket_depth"], 31 | dataline["tket_swap"], dataline["our_depth"], dataline["our_swap"], 32 | dataline["tket_swap"] / dataline["our_swap"], 33 | dataline["tket_depth"] / dataline["our_depth"], 34 | dataline["time"], dataline["edges"]]) 35 | datum.close() 36 | data.close() 37 | -------------------------------------------------------------------------------- /olsq/benchmarks/queko_15_1.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | x q[15]; 5 | x q[5]; 6 | x q[2]; 7 | cx q[13], q[10]; 8 | x q[15]; 9 | x q[11]; 10 | cx q[14], q[8]; 11 | cx q[6], q[7]; 12 | cx q[10], q[4]; 13 | cx q[5], q[3]; 14 | x q[15]; 15 | x q[1]; 16 | x q[14]; 17 | x q[8]; 18 | x q[11]; 19 | cx q[9], q[0]; 20 | x q[15]; 21 | x q[13]; 22 | x q[5]; 23 | x q[1]; 24 | cx q[4], q[11]; 25 | cx q[10], q[2]; 26 | x q[15]; 27 | x q[6]; 28 | x q[10]; 29 | x q[9]; 30 | x q[13]; 31 | cx q[2], q[12]; 32 | cx q[0], q[8]; 33 | cx q[11], q[7]; 34 | cx q[14], q[4]; 35 | cx q[1], q[5]; 36 | x q[15]; 37 | x q[7]; 38 | x q[13]; 39 | x q[9]; 40 | x q[2]; 41 | cx q[1], q[5]; 42 | cx q[4], q[11]; 43 | x q[3]; 44 | x q[13]; 45 | x q[8]; 46 | cx q[15], q[6]; 47 | cx q[9], q[0]; 48 | cx q[1], q[5]; 49 | cx q[4], q[11]; 50 | x q[2]; 51 | x q[6]; 52 | x q[10]; 53 | x q[13]; 54 | cx q[12], q[15]; 55 | cx q[5], q[3]; 56 | cx q[0], q[8]; 57 | cx q[14], q[4]; 58 | cx q[11], q[7]; 59 | x q[15]; 60 | x q[6]; 61 | x q[12]; 62 | x q[2]; 63 | x q[1]; 64 | cx q[14], q[8]; 65 | cx q[4], q[11]; 66 | cx q[9], q[0]; 67 | x q[9]; 68 | x q[11]; 69 | x q[13]; 70 | x q[4]; 71 | x q[8]; 72 | x q[12]; 73 | x q[2]; 74 | x q[10]; 75 | x q[0]; 76 | cx q[15], q[6]; 77 | cx q[1], q[5]; 78 | x q[5]; 79 | x q[8]; 80 | x q[2]; 81 | cx q[12], q[15]; 82 | cx q[13], q[10]; 83 | cx q[6], q[7]; 84 | cx q[4], q[11]; 85 | x q[1]; 86 | x q[13]; 87 | x q[8]; 88 | x q[4]; 89 | cx q[12], q[15]; 90 | cx q[5], q[3]; 91 | cx q[9], q[0]; 92 | x q[15]; 93 | x q[5]; 94 | cx q[0], q[8]; 95 | cx q[1], q[9]; 96 | cx q[13], q[10]; 97 | cx q[4], q[11]; 98 | cx q[2], q[12]; 99 | x q[15]; 100 | x q[14]; 101 | x q[2]; 102 | x q[5]; 103 | x q[3]; 104 | cx q[10], q[4]; 105 | cx q[11], q[7]; 106 | x q[15]; 107 | x q[11]; 108 | x q[6]; 109 | x q[4]; 110 | x q[0]; 111 | x q[8]; 112 | cx q[5], q[3]; 113 | -------------------------------------------------------------------------------- /iccad20/benchmark/16QBT_15CYC_TFL_1.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | x q[15]; 5 | x q[5]; 6 | x q[2]; 7 | cx q[13], q[10]; 8 | x q[15]; 9 | x q[11]; 10 | cx q[14], q[8]; 11 | cx q[6], q[7]; 12 | cx q[10], q[4]; 13 | cx q[5], q[3]; 14 | x q[15]; 15 | x q[1]; 16 | x q[14]; 17 | x q[8]; 18 | x q[11]; 19 | cx q[9], q[0]; 20 | x q[15]; 21 | x q[13]; 22 | x q[5]; 23 | x q[1]; 24 | cx q[4], q[11]; 25 | cx q[10], q[2]; 26 | x q[15]; 27 | x q[6]; 28 | x q[10]; 29 | x q[9]; 30 | x q[13]; 31 | cx q[2], q[12]; 32 | cx q[0], q[8]; 33 | cx q[11], q[7]; 34 | cx q[14], q[4]; 35 | cx q[1], q[5]; 36 | x q[15]; 37 | x q[7]; 38 | x q[13]; 39 | x q[9]; 40 | x q[2]; 41 | cx q[1], q[5]; 42 | cx q[4], q[11]; 43 | x q[3]; 44 | x q[13]; 45 | x q[8]; 46 | cx q[15], q[6]; 47 | cx q[9], q[0]; 48 | cx q[1], q[5]; 49 | cx q[4], q[11]; 50 | x q[2]; 51 | x q[6]; 52 | x q[10]; 53 | x q[13]; 54 | cx q[12], q[15]; 55 | cx q[5], q[3]; 56 | cx q[0], q[8]; 57 | cx q[14], q[4]; 58 | cx q[11], q[7]; 59 | x q[15]; 60 | x q[6]; 61 | x q[12]; 62 | x q[2]; 63 | x q[1]; 64 | cx q[14], q[8]; 65 | cx q[4], q[11]; 66 | cx q[9], q[0]; 67 | x q[9]; 68 | x q[11]; 69 | x q[13]; 70 | x q[4]; 71 | x q[8]; 72 | x q[12]; 73 | x q[2]; 74 | x q[10]; 75 | x q[0]; 76 | cx q[15], q[6]; 77 | cx q[1], q[5]; 78 | x q[5]; 79 | x q[8]; 80 | x q[2]; 81 | cx q[12], q[15]; 82 | cx q[13], q[10]; 83 | cx q[6], q[7]; 84 | cx q[4], q[11]; 85 | x q[1]; 86 | x q[13]; 87 | x q[8]; 88 | x q[4]; 89 | cx q[12], q[15]; 90 | cx q[5], q[3]; 91 | cx q[9], q[0]; 92 | x q[15]; 93 | x q[5]; 94 | cx q[0], q[8]; 95 | cx q[1], q[9]; 96 | cx q[13], q[10]; 97 | cx q[4], q[11]; 98 | cx q[2], q[12]; 99 | x q[15]; 100 | x q[14]; 101 | x q[2]; 102 | x q[5]; 103 | x q[3]; 104 | cx q[10], q[4]; 105 | cx q[11], q[7]; 106 | x q[15]; 107 | x q[11]; 108 | x q[6]; 109 | x q[4]; 110 | x q[0]; 111 | x q[8]; 112 | cx q[5], q[3]; 113 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/tof_5_melbourne/tof_5_after_heavy_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[9]; 5 | cx q[8],q[6]; 6 | u1(pi/4) q[6]; 7 | u2(0,pi) q[6]; 8 | cx q[8],q[9]; 9 | u1(-pi/4) q[9]; 10 | cx q[8],q[9]; 11 | u1(pi/4) q[8]; 12 | cx q[6],q[8]; 13 | cx q[8],q[6]; 14 | cx q[6],q[8]; 15 | u2(0,pi) q[8]; 16 | u1(pi/4) q[9]; 17 | u2(0,pi) q[9]; 18 | cx q[10],q[9]; 19 | u1(pi/4) q[9]; 20 | cx q[5],q[9]; 21 | u1(-pi/4) q[9]; 22 | cx q[10],q[9]; 23 | u2(0,pi) q[10]; 24 | u1(pi/4) q[9]; 25 | cx q[5],q[9]; 26 | u1(-pi/4) q[9]; 27 | u2(0,pi) q[9]; 28 | u2(0,pi) q[9]; 29 | cx q[11],q[10]; 30 | u1(pi/4) q[10]; 31 | cx q[4],q[10]; 32 | u1(-pi/4) q[10]; 33 | cx q[11],q[10]; 34 | u1(pi/4) q[10]; 35 | u2(0,pi) q[11]; 36 | cx q[4],q[10]; 37 | u1(-pi/4) q[10]; 38 | u2(0,pi) q[10]; 39 | u2(0,pi) q[10]; 40 | cx q[12],q[11]; 41 | u1(pi/4) q[11]; 42 | cx q[3],q[11]; 43 | u1(-pi/4) q[11]; 44 | cx q[12],q[11]; 45 | u1(pi/4) q[11]; 46 | cx q[3],q[11]; 47 | u1(-pi/4) q[11]; 48 | u2(0,pi) q[11]; 49 | u2(0,pi) q[11]; 50 | cx q[12],q[11]; 51 | u1(-pi/4) q[11]; 52 | cx q[3],q[11]; 53 | u1(pi/4) q[11]; 54 | cx q[12],q[11]; 55 | u1(-pi/4) q[11]; 56 | cx q[3],q[11]; 57 | u1(pi/4) q[11]; 58 | u2(0,pi) q[11]; 59 | cx q[11],q[10]; 60 | u1(-pi/4) q[10]; 61 | cx q[4],q[10]; 62 | u1(pi/4) q[10]; 63 | cx q[11],q[10]; 64 | u1(-pi/4) q[10]; 65 | cx q[4],q[10]; 66 | u1(pi/4) q[10]; 67 | u2(0,pi) q[10]; 68 | cx q[10],q[9]; 69 | u1(-pi/4) q[9]; 70 | cx q[5],q[9]; 71 | u1(pi/4) q[9]; 72 | cx q[10],q[9]; 73 | u1(-pi/4) q[9]; 74 | cx q[5],q[9]; 75 | u1(pi/4) q[9]; 76 | u2(0,pi) q[9]; 77 | cx q[9],q[8]; 78 | u1(-pi/4) q[8]; 79 | cx q[6],q[8]; 80 | u1(pi/4) q[8]; 81 | cx q[9],q[8]; 82 | u1(-pi/4) q[8]; 83 | measure q[3] -> c[0]; 84 | measure q[12] -> c[1]; 85 | measure q[4] -> c[2]; 86 | measure q[5] -> c[3]; 87 | measure q[8] -> c[4]; 88 | measure q[11] -> c[5]; 89 | measure q[10] -> c[6]; 90 | measure q[9] -> c[7]; 91 | measure q[6] -> c[8]; 92 | -------------------------------------------------------------------------------- /iccad20/script/qaoa-olsq/qaoa_exp.py: -------------------------------------------------------------------------------- 1 | import networkx as nx 2 | from smt_qaoa import qaoa_exp_smt 3 | import pytket 4 | import cirq 5 | from pytket.cirq import tk_to_cirq 6 | from pytket.routing import route, Architecture 7 | from pytket.transform import Transform 8 | import sys 9 | 10 | 11 | M = int(sys.argv[1]) 12 | graph = nx.random_regular_graph(3, M) 13 | edges = list(graph.edges()) 14 | print(edges) 15 | 16 | connection_list = [(0, 2), (1, 2), (2, 3), (1, 5), (2, 6), (3, 7), 17 | (4, 5), (5, 6), (6, 7), (7, 8), 18 | (4, 10), (5, 11), (6, 12), (7, 13), 19 | (9, 10), (10, 11), (11, 12), (12, 13), 20 | (9, 15), (10, 16), (11, 17), (12, 18), 21 | (14, 15), (15, 16), (16, 17), (17, 18), 22 | (15, 19), (16, 20), (17, 21), (19, 20), (20, 21), (20, 22)] 23 | 24 | 25 | 26 | circ = pytket.Circuit(23, 0) 27 | for edge in edges: 28 | circ.ZZPhase(angle=0.75, qubit0=edge[0], qubit1=edge[1]) 29 | 30 | routed_circ = route(circ, Architecture(connection_list), decompose_swaps=False) 31 | Transform.DecomposeBRIDGE().apply(routed_circ) 32 | 33 | cirq_circuit = tk_to_cirq(routed_circ) 34 | num_swap = 0 35 | for layer in cirq_circuit: 36 | for gate in layer: 37 | if gate.__str__().startswith('SWAP'): 38 | num_swap += 1 39 | tket_depth = len(cirq_circuit) 40 | print("num_swap", num_swap, " depth", tket_depth) 41 | for layer in cirq_circuit: 42 | print(layer) 43 | 44 | [our_depth, our_swap] = qaoa_exp_smt(M, edges) 45 | 46 | with open('result', 'a') as file: 47 | file.write(str(M) + '\n') 48 | file.write(str(edges) + '\n') 49 | file.write('tket depth ' + str(tket_depth) + ' SWAP ' + str(num_swap) + '\n') 50 | file.write('our depth ' + str(our_depth) + ' SWAP ' + str(our_swap) + '\n\n') 51 | file.close() 52 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_triq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | creg c[16]; 5 | u3(3.14159265358979,0,3.14159265358979) q[8]; 6 | u3(3.14159265358979,0,3.14159265358979) q[5]; 7 | u3(3.14159265358979,0,3.14159265358979) q[6]; 8 | u3(3.14159265358979,0,3.14159265358979) q[4]; 9 | u3(3.14159265358979,0,3.14159265358979) q[3]; 10 | u3(3.14159265358979,0,3.14159265358979) q[13]; 11 | u3(3.14159265358979,0,3.14159265358979) q[9]; 12 | cx q[7],q[15]; 13 | cx q[0],q[1]; 14 | u3(3.14159265358979,0,3.14159265358979) q[8]; 15 | u3(3.14159265358979,0,3.14159265358979) q[11]; 16 | u3(3.14159265358979,0,3.14159265358979) q[14]; 17 | u3(3.14159265358979,0,3.14159265358979) q[2]; 18 | cx q[12],q[13]; 19 | u3(3.14159265358979,0,3.14159265358979) q[3]; 20 | cx q[4],q[5]; 21 | u3(3.14159265358979,0,3.14159265358979) q[7]; 22 | u3(3.14159265358979,0,3.14159265358979) q[15]; 23 | cx q[0],q[1]; 24 | cx q[10],q[11]; 25 | u3(3.14159265358979,0,3.14159265358979) q[3]; 26 | u3(3.14159265358979,0,3.14159265358979) q[14]; 27 | cx q[5],q[6]; 28 | cx q[4],q[12]; 29 | cx q[7],q[15]; 30 | u3(3.14159265358979,0,3.14159265358979) q[1]; 31 | cx q[0],q[8]; 32 | cx q[3],q[11]; 33 | u3(3.14159265358979,0,3.14159265358979) q[6]; 34 | u3(3.14159265358979,0,3.14159265358979) q[12]; 35 | cx q[4],q[5]; 36 | u3(3.14159265358979,0,3.14159265358979) q[15]; 37 | cx q[0],q[1]; 38 | u3(3.14159265358979,0,3.14159265358979) q[5]; 39 | u3(3.14159265358979,0,3.14159265358979) q[3]; 40 | cx q[4],q[12]; 41 | cx q[0],q[1]; 42 | measure q[6] -> c[0]; 43 | measure q[8] -> c[2]; 44 | measure q[3] -> c[1]; 45 | measure q[7] -> c[3]; 46 | measure q[11] -> c[4]; 47 | measure q[10] -> c[5]; 48 | measure q[5] -> c[6]; 49 | measure q[2] -> c[7]; 50 | measure q[0] -> c[8]; 51 | measure q[15] -> c[9]; 52 | measure q[12] -> c[10]; 53 | measure q[13] -> c[11]; 54 | measure q[1] -> c[12]; 55 | measure q[9] -> c[13]; 56 | measure q[4] -> c[14]; 57 | measure q[14] -> c[15]; 58 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/queko_05_0_aspen-4/16QBT_05CYC_TFL_0_aspen4_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | creg c[16]; 5 | u3(3.141592653589793,0,3.141592653589793) q[1]; 6 | cx q[2],q[1]; 7 | u3(3.141592653589793,0,3.141592653589793) q[3]; 8 | u3(3.141592653589793,0,3.141592653589793) q[4]; 9 | cx q[3],q[4]; 10 | cx q[3],q[2]; 11 | u3(3.141592653589793,0,3.141592653589793) q[2]; 12 | u3(3.141592653589793,0,3.141592653589793) q[5]; 13 | cx q[4],q[5]; 14 | cx q[3],q[4]; 15 | cx q[3],q[2]; 16 | u3(3.141592653589793,0,3.141592653589793) q[4]; 17 | u3(3.141592653589793,0,3.141592653589793) q[5]; 18 | u3(3.141592653589793,0,3.141592653589793) q[6]; 19 | u3(3.141592653589793,0,3.141592653589793) q[7]; 20 | u3(3.141592653589793,0,3.141592653589793) q[7]; 21 | cx q[0],q[8]; 22 | u3(3.141592653589793,0,3.141592653589793) q[0]; 23 | u3(3.141592653589793,0,3.141592653589793) q[8]; 24 | cx q[0],q[8]; 25 | u3(3.141592653589793,0,3.141592653589793) q[8]; 26 | u3(3.141592653589793,0,3.141592653589793) q[9]; 27 | u3(3.141592653589793,0,3.141592653589793) q[9]; 28 | cx q[10],q[11]; 29 | cx q[10],q[11]; 30 | cx q[10],q[9]; 31 | u3(3.141592653589793,0,3.141592653589793) q[11]; 32 | cx q[10],q[11]; 33 | cx q[10],q[11]; 34 | u3(3.141592653589793,0,3.141592653589793) q[12]; 35 | u3(3.141592653589793,0,3.141592653589793) q[14]; 36 | cx q[13],q[14]; 37 | u3(3.141592653589793,0,3.141592653589793) q[15]; 38 | u3(3.141592653589793,0,3.141592653589793) q[15]; 39 | u3(3.141592653589793,0,3.141592653589793) q[15]; 40 | cx q[15],q[14]; 41 | u3(3.141592653589793,0,3.141592653589793) q[15]; 42 | measure q[5] -> c[0]; 43 | measure q[15] -> c[1]; 44 | measure q[9] -> c[2]; 45 | measure q[0] -> c[3]; 46 | measure q[14] -> c[4]; 47 | measure q[13] -> c[5]; 48 | measure q[4] -> c[6]; 49 | measure q[12] -> c[7]; 50 | measure q[10] -> c[8]; 51 | measure q[8] -> c[9]; 52 | measure q[2] -> c[10]; 53 | measure q[1] -> c[11]; 54 | measure q[11] -> c[12]; 55 | measure q[6] -> c[13]; 56 | measure q[3] -> c[14]; 57 | measure q[7] -> c[15]; 58 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_olsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[1]; 6 | cx q[2],q[0]; 7 | u2(0,3.141592653589793) q[0]; 8 | u1(0.7853981633974483) q[0]; 9 | u1(0.7853981633974483) q[2]; 10 | cx q[2],q[1]; 11 | cx q[0],q[2]; 12 | cx q[1],q[0]; 13 | u1(0.7853981633974483) q[0]; 14 | u1(-0.7853981633974483) q[2]; 15 | cx q[1],q[2]; 16 | u1(-0.7853981633974483) q[1]; 17 | u1(-0.7853981633974483) q[2]; 18 | cx q[0],q[2]; 19 | cx q[1],q[0]; 20 | u2(0,3.141592653589793) q[0]; 21 | u2(0,3.141592653589793) q[0]; 22 | u1(0.7853981633974483) q[0]; 23 | cx q[2],q[1]; 24 | u1(0.7853981633974483) q[1]; 25 | u2(0,3.141592653589793) q[2]; 26 | u1(0.7853981633974483) q[2]; 27 | u1(0.7853981633974483) q[3]; 28 | u1(0.7853981633974483) q[4]; 29 | cx q[4],q[3]; 30 | cx q[2],q[4]; 31 | cx q[3],q[2]; 32 | u1(0.7853981633974483) q[2]; 33 | u1(-0.7853981633974483) q[4]; 34 | cx q[3],q[4]; 35 | u1(-0.7853981633974483) q[3]; 36 | u1(-0.7853981633974483) q[4]; 37 | cx q[2],q[4]; 38 | cx q[3],q[2]; 39 | u2(0,3.141592653589793) q[2]; 40 | u1(0.7853981633974483) q[2]; 41 | cx q[2],q[1]; 42 | cx q[0],q[2]; 43 | cx q[1],q[0]; 44 | u1(0.7853981633974483) q[0]; 45 | u1(-0.7853981633974483) q[2]; 46 | cx q[1],q[2]; 47 | u1(-0.7853981633974483) q[1]; 48 | u1(-0.7853981633974483) q[2]; 49 | cx q[0],q[2]; 50 | cx q[1],q[0]; 51 | u2(0,3.141592653589793) q[0]; 52 | cx q[2],q[1]; 53 | u2(0,3.141592653589793) q[2]; 54 | u1(0.7853981633974483) q[2]; 55 | cx q[4],q[3]; 56 | u1(0.7853981633974483) q[3]; 57 | u1(0.7853981633974483) q[4]; 58 | cx q[4],q[3]; 59 | cx q[2],q[4]; 60 | cx q[3],q[2]; 61 | u1(0.7853981633974483) q[2]; 62 | u1(-0.7853981633974483) q[4]; 63 | cx q[3],q[4]; 64 | u1(-0.7853981633974483) q[3]; 65 | u1(-0.7853981633974483) q[4]; 66 | cx q[2],q[4]; 67 | cx q[3],q[2]; 68 | u2(0,3.141592653589793) q[2]; 69 | cx q[0],q[2]; 70 | cx q[4],q[3]; 71 | measure q[0] -> c[0]; 72 | measure q[1] -> c[1]; 73 | measure q[4] -> c[2]; 74 | measure q[3] -> c[3]; 75 | measure q[2] -> c[4]; 76 | -------------------------------------------------------------------------------- /iccad20/result/olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_olsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[1]; 6 | cx q[2],q[0]; 7 | u2(0,3.141592653589793) q[0]; 8 | u1(0.7853981633974483) q[0]; 9 | u1(0.7853981633974483) q[2]; 10 | cx q[2],q[1]; 11 | cx q[0],q[2]; 12 | cx q[1],q[0]; 13 | u1(0.7853981633974483) q[0]; 14 | u1(-0.7853981633974483) q[2]; 15 | cx q[1],q[2]; 16 | u1(-0.7853981633974483) q[1]; 17 | u1(-0.7853981633974483) q[2]; 18 | cx q[0],q[2]; 19 | cx q[1],q[0]; 20 | u2(0,3.141592653589793) q[0]; 21 | u2(0,3.141592653589793) q[0]; 22 | u1(0.7853981633974483) q[0]; 23 | cx q[2],q[1]; 24 | u1(0.7853981633974483) q[1]; 25 | u2(0,3.141592653589793) q[2]; 26 | u1(0.7853981633974483) q[2]; 27 | u1(0.7853981633974483) q[3]; 28 | u1(0.7853981633974483) q[4]; 29 | cx q[3],q[4]; 30 | cx q[2],q[3]; 31 | u1(-0.7853981633974483) q[3]; 32 | cx q[4],q[2]; 33 | u1(0.7853981633974483) q[2]; 34 | cx q[4],q[3]; 35 | u1(-0.7853981633974483) q[3]; 36 | cx q[2],q[3]; 37 | u1(-0.7853981633974483) q[4]; 38 | cx q[4],q[2]; 39 | u2(0,3.141592653589793) q[2]; 40 | u1(0.7853981633974483) q[2]; 41 | cx q[2],q[1]; 42 | cx q[0],q[2]; 43 | cx q[1],q[0]; 44 | u1(0.7853981633974483) q[0]; 45 | u1(-0.7853981633974483) q[2]; 46 | cx q[1],q[2]; 47 | u1(-0.7853981633974483) q[1]; 48 | u1(-0.7853981633974483) q[2]; 49 | cx q[0],q[2]; 50 | cx q[1],q[0]; 51 | u2(0,3.141592653589793) q[0]; 52 | cx q[2],q[1]; 53 | u2(0,3.141592653589793) q[2]; 54 | u1(0.7853981633974483) q[2]; 55 | cx q[3],q[4]; 56 | u1(0.7853981633974483) q[3]; 57 | u1(0.7853981633974483) q[4]; 58 | cx q[3],q[4]; 59 | cx q[2],q[3]; 60 | u1(-0.7853981633974483) q[3]; 61 | cx q[4],q[2]; 62 | u1(0.7853981633974483) q[2]; 63 | cx q[4],q[3]; 64 | u1(-0.7853981633974483) q[3]; 65 | cx q[2],q[3]; 66 | u1(-0.7853981633974483) q[4]; 67 | cx q[4],q[2]; 68 | u2(0,3.141592653589793) q[2]; 69 | cx q[0],q[2]; 70 | cx q[3],q[4]; 71 | measure q[0] -> c[0]; 72 | measure q[1] -> c[1]; 73 | measure q[3] -> c[2]; 74 | measure q[4] -> c[3]; 75 | measure q[2] -> c[4]; 76 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[0]; 6 | u1(0.7853981633974483) q[1]; 7 | cx q[0],q[1]; 8 | cx q[2],q[3]; 9 | u1(0.7853981633974483) q[2]; 10 | u2(0,3.141592653589793) q[3]; 11 | u1(0.7853981633974483) q[3]; 12 | u1(0.7853981633974483) q[4]; 13 | cx q[2],q[4]; 14 | cx q[3],q[2]; 15 | u1(-0.7853981633974483) q[2]; 16 | cx q[4],q[3]; 17 | u1(0.7853981633974483) q[3]; 18 | cx q[4],q[2]; 19 | u1(-0.7853981633974483) q[2]; 20 | cx q[3],q[2]; 21 | u1(-0.7853981633974483) q[4]; 22 | cx q[4],q[3]; 23 | cx q[2],q[4]; 24 | u2(0,3.141592653589793) q[2]; 25 | u1(0.7853981633974483) q[2]; 26 | cx q[2],q[0]; 27 | u1(-0.7853981633974483) q[0]; 28 | cx q[1],q[2]; 29 | cx q[1],q[0]; 30 | u1(-0.7853981633974483) q[0]; 31 | u1(-0.7853981633974483) q[1]; 32 | u1(0.7853981633974483) q[2]; 33 | cx q[2],q[0]; 34 | cx q[1],q[2]; 35 | cx q[0],q[1]; 36 | u1(0.7853981633974483) q[0]; 37 | u1(0.7853981633974483) q[1]; 38 | cx q[0],q[1]; 39 | u2(0,3.141592653589793) q[2]; 40 | u1(0.7853981633974483) q[2]; 41 | u2(0,3.141592653589793) q[3]; 42 | u2(0,3.141592653589793) q[3]; 43 | u1(0.7853981633974483) q[3]; 44 | u1(0.7853981633974483) q[4]; 45 | cx q[2],q[4]; 46 | cx q[3],q[2]; 47 | u1(-0.7853981633974483) q[2]; 48 | cx q[4],q[3]; 49 | u1(0.7853981633974483) q[3]; 50 | cx q[4],q[2]; 51 | u1(-0.7853981633974483) q[2]; 52 | cx q[3],q[2]; 53 | u1(-0.7853981633974483) q[4]; 54 | cx q[4],q[3]; 55 | cx q[2],q[4]; 56 | u2(0,3.141592653589793) q[2]; 57 | u1(0.7853981633974483) q[2]; 58 | cx q[2],q[0]; 59 | u1(-0.7853981633974483) q[0]; 60 | cx q[1],q[2]; 61 | cx q[1],q[0]; 62 | u1(-0.7853981633974483) q[0]; 63 | u1(-0.7853981633974483) q[1]; 64 | u1(0.7853981633974483) q[2]; 65 | cx q[2],q[0]; 66 | cx q[1],q[2]; 67 | cx q[0],q[1]; 68 | u2(0,3.141592653589793) q[2]; 69 | u2(0,3.141592653589793) q[3]; 70 | cx q[3],q[2]; 71 | measure q[3] -> c[0]; 72 | measure q[4] -> c[1]; 73 | measure q[0] -> c[2]; 74 | measure q[1] -> c[3]; 75 | measure q[2] -> c[4]; 76 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/4gt_13_92_ibmqx2/4gt13_92_ibmqx2_tbolsq_fidelity.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[5]; 4 | creg c[5]; 5 | u1(0.7853981633974483) q[1]; 6 | cx q[2],q[0]; 7 | u2(0,3.141592653589793) q[0]; 8 | u1(0.7853981633974483) q[0]; 9 | u1(0.7853981633974483) q[2]; 10 | cx q[2],q[1]; 11 | cx q[0],q[2]; 12 | cx q[1],q[0]; 13 | u1(0.7853981633974483) q[0]; 14 | u1(-0.7853981633974483) q[2]; 15 | cx q[1],q[2]; 16 | u1(-0.7853981633974483) q[1]; 17 | u1(-0.7853981633974483) q[2]; 18 | cx q[0],q[2]; 19 | cx q[1],q[0]; 20 | u2(0,3.141592653589793) q[0]; 21 | u2(0,3.141592653589793) q[0]; 22 | u1(0.7853981633974483) q[0]; 23 | cx q[2],q[1]; 24 | u1(0.7853981633974483) q[1]; 25 | u2(0,3.141592653589793) q[2]; 26 | u1(0.7853981633974483) q[2]; 27 | u1(0.7853981633974483) q[3]; 28 | u1(0.7853981633974483) q[4]; 29 | cx q[4],q[3]; 30 | cx q[2],q[4]; 31 | cx q[3],q[2]; 32 | u1(0.7853981633974483) q[2]; 33 | u1(-0.7853981633974483) q[4]; 34 | cx q[3],q[4]; 35 | u1(-0.7853981633974483) q[3]; 36 | u1(-0.7853981633974483) q[4]; 37 | cx q[2],q[4]; 38 | cx q[3],q[2]; 39 | u2(0,3.141592653589793) q[2]; 40 | u1(0.7853981633974483) q[2]; 41 | cx q[2],q[1]; 42 | cx q[0],q[2]; 43 | cx q[1],q[0]; 44 | u1(0.7853981633974483) q[0]; 45 | u1(-0.7853981633974483) q[2]; 46 | cx q[1],q[2]; 47 | u1(-0.7853981633974483) q[1]; 48 | u1(-0.7853981633974483) q[2]; 49 | cx q[0],q[2]; 50 | cx q[1],q[0]; 51 | u2(0,3.141592653589793) q[0]; 52 | cx q[2],q[1]; 53 | u2(0,3.141592653589793) q[2]; 54 | u1(0.7853981633974483) q[2]; 55 | cx q[4],q[3]; 56 | u1(0.7853981633974483) q[3]; 57 | u1(0.7853981633974483) q[4]; 58 | cx q[4],q[3]; 59 | cx q[2],q[4]; 60 | cx q[3],q[2]; 61 | u1(0.7853981633974483) q[2]; 62 | u1(-0.7853981633974483) q[4]; 63 | cx q[3],q[4]; 64 | u1(-0.7853981633974483) q[3]; 65 | u1(-0.7853981633974483) q[4]; 66 | cx q[2],q[4]; 67 | cx q[3],q[2]; 68 | u2(0,3.141592653589793) q[2]; 69 | cx q[0],q[2]; 70 | cx q[4],q[3]; 71 | measure q[0] -> c[0]; 72 | measure q[1] -> c[1]; 73 | measure q[4] -> c[2]; 74 | measure q[3] -> c[3]; 75 | measure q[2] -> c[4]; 76 | -------------------------------------------------------------------------------- /iccad20/result/tb-olsq/barenco_tof_4_melbourne/barenco_tof_4_after_heavy_ibmq14_tbolsq_swap.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[14]; 4 | creg c[7]; 5 | cx q[2],q[1]; 6 | u2(0,pi) q[1]; 7 | cx q[12],q[2]; 8 | u1(pi/4) q[2]; 9 | cx q[12],q[2]; 10 | u1(-pi/4) q[2]; 11 | cx q[1],q[2]; 12 | cx q[2],q[1]; 13 | cx q[1],q[2]; 14 | cx q[3],q[2]; 15 | u1(pi/4) q[2]; 16 | cx q[3],q[2]; 17 | cx q[11],q[3]; 18 | u1(-pi/4) q[2]; 19 | u2(0,pi) q[2]; 20 | cx q[1],q[2]; 21 | u1(-pi/4) q[2]; 22 | cx q[12],q[2]; 23 | u1(pi/4) q[2]; 24 | cx q[1],q[2]; 25 | u2(0,pi) q[1]; 26 | cx q[3],q[11]; 27 | cx q[11],q[3]; 28 | cx q[13],q[1]; 29 | u1(pi/4) q[1]; 30 | cx q[0],q[1]; 31 | u1(-pi/4) q[1]; 32 | cx q[13],q[1]; 33 | u1(pi/4) q[1]; 34 | cx q[0],q[1]; 35 | u1(-pi/4) q[1]; 36 | u2(0,pi) q[1]; 37 | cx q[1],q[2]; 38 | u2(0,pi) q[1]; 39 | cx q[13],q[1]; 40 | u1(-pi/4) q[1]; 41 | cx q[0],q[1]; 42 | u1(pi/4) q[1]; 43 | cx q[13],q[1]; 44 | u1(-pi/4) q[1]; 45 | cx q[0],q[1]; 46 | u1(pi/4) q[1]; 47 | u2(0,pi) q[1]; 48 | u1(-pi/4) q[2]; 49 | cx q[12],q[2]; 50 | u1(pi/4) q[2]; 51 | cx q[1],q[2]; 52 | u1(-pi/4) q[2]; 53 | cx q[12],q[2]; 54 | u1(pi/4) q[2]; 55 | cx q[1],q[2]; 56 | u2(0,pi) q[2]; 57 | cx q[2],q[3]; 58 | u1(-pi/4) q[3]; 59 | cx q[11],q[3]; 60 | u1(pi/4) q[3]; 61 | cx q[2],q[3]; 62 | cx q[12],q[2]; 63 | cx q[2],q[12]; 64 | cx q[12],q[2]; 65 | cx q[11],q[12]; 66 | u1(-pi/4) q[12]; 67 | cx q[11],q[12]; 68 | u2(0,pi) q[12]; 69 | cx q[2],q[1]; 70 | u1(-pi/4) q[1]; 71 | cx q[2],q[1]; 72 | cx q[13],q[1]; 73 | cx q[1],q[13]; 74 | cx q[13],q[1]; 75 | u1(pi/4) q[13]; 76 | cx q[13],q[12]; 77 | u1(-pi/4) q[12]; 78 | cx q[2],q[12]; 79 | u1(pi/4) q[12]; 80 | cx q[13],q[12]; 81 | cx q[12],q[2]; 82 | cx q[2],q[12]; 83 | cx q[12],q[2]; 84 | u1(pi/4) q[2]; 85 | u2(0,pi) q[3]; 86 | u2(0,pi) q[3]; 87 | cx q[2],q[3]; 88 | u1(-pi/4) q[3]; 89 | cx q[11],q[3]; 90 | u1(pi/4) q[3]; 91 | cx q[2],q[3]; 92 | measure q[0] -> c[0]; 93 | measure q[1] -> c[1]; 94 | measure q[2] -> c[2]; 95 | measure q[11] -> c[3]; 96 | measure q[13] -> c[4]; 97 | measure q[12] -> c[5]; 98 | measure q[3] -> c[6]; 99 | --------------------------------------------------------------------------------