├── .editorconfig ├── .git_archival.txt ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ └── feature-request.yml ├── SECURITY.md ├── codecov.yml ├── contributing.md ├── pull_request_template.md ├── release-drafter.yml ├── renovate.json5 ├── support.md └── workflows │ ├── cd.yml │ ├── ci.yml │ └── release-drafter.yml ├── .gitignore ├── .license-tools-config.json ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── LICENSE.md ├── README.md ├── docs ├── AnalogInfo.md ├── Contributing.md ├── DevelopmentGuide.md ├── Encoders.md ├── Installation.md ├── LightsOutDecoder.md ├── Publications.md ├── StatePrep.md ├── Support.md ├── _static │ ├── custom.css │ ├── mqt_dark.png │ └── mqt_light.png ├── _templates │ └── page.html ├── conf.py ├── full_ft_scheme.svg ├── images │ ├── 488_color_code.svg │ ├── cc.png │ ├── full_ft_scheme.svg │ ├── lights-out.png │ ├── lo.png │ └── steane-ex.png ├── index.md ├── refs.bib └── templates │ └── page.html ├── examples ├── lp_(4,8)-[[1024,18,nan]]_hx.txt ├── lp_(4,8)-[[1024,18,nan]]_hz.txt ├── mkmn_24_6_10.txt ├── test │ ├── hgp_(4,7)-[[900,36,10]]_hx.txt │ ├── hgp_(4,7)-[[900,36,10]]_hz.txt │ ├── hgp_(4,8)-[[5408,18,26]]_hx.txt │ ├── inCodes │ │ └── toric_(nan,nan)-[[8,2,2]]_hx.txt │ ├── testCode.txt │ ├── toric_(nan,nan)-[[18,2,3]]_hx.txt │ ├── toric_(nan,nan)-[[32,2,4]]_hx.txt │ └── toric_(nan,nan)-[[8,2,2]]_hx.txt ├── toric │ ├── toric_(nan,nan)-[[1058,2,23]]_hx.txt │ ├── toric_(nan,nan)-[[200,2,10]]_hx.txt │ └── toric_(nan,nan)-[[512,2,16]]_hx.txt └── toricCodes │ ├── toric_(nan,nan)-[[128,2,8]]_hz.txt │ ├── toric_(nan,nan)-[[162,2,9]]_hz.txt │ ├── toric_(nan,nan)-[[18,2,3]]_hz.txt │ ├── toric_(nan,nan)-[[200,2,10]]_hz.txt │ ├── toric_(nan,nan)-[[32,2,4]]_hz.txt │ ├── toric_(nan,nan)-[[50,2,5]]_hz.txt │ ├── toric_(nan,nan)-[[72,2,6]]_hz.txt │ ├── toric_(nan,nan)-[[8,2,2]]_hz.txt │ └── toric_(nan,nan)-[[98,2,7]]_hz.txt ├── noxfile.py ├── pyproject.toml ├── scripts ├── cc_decoder │ ├── plotting │ │ ├── plot_convergence_rate.ipynb │ │ ├── plot_pseudothresholds.ipynb │ │ └── plots.py │ ├── run.sh │ └── run_color_code_phenomenological_noise.py ├── constructHGPcodes.py ├── examples │ ├── atd_example.py │ ├── decoding-performance-simulations.py │ ├── readme_example.py │ └── runtime-simulations.py ├── ft_stateprep │ ├── eval │ │ ├── README.md │ │ ├── circuits │ │ │ ├── carbon │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── cc_4_8_8 │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ └── zero_non_ft_heuristic.stim │ │ │ ├── cc_4_8_8_d7 │ │ │ │ ├── zero_ft_heuristic_mixed.qasm │ │ │ │ ├── zero_ft_heuristic_mixed.stim │ │ │ │ ├── zero_ft_naive.qasm │ │ │ │ ├── zero_ft_naive.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ └── zero_non_ft_heuristic.stim │ │ │ ├── cc_6_6_6 │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ └── zero_non_ft_heuristic.stim │ │ │ ├── hamming │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── rotated_surface_d3 │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── rotated_surface_d5 │ │ │ │ ├── zero_ft_heuristic_naive.qasm │ │ │ │ ├── zero_ft_heuristic_naive.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ └── zero_non_ft_heuristic.stim │ │ │ ├── shor │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── steane │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ └── tetrahedral │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ ├── estimate_logical_error_rate.py │ │ ├── luts │ │ │ └── decoder_488_7.pickle │ │ ├── run_d7.py │ │ └── run_eval_on_code.sh │ └── eval_det │ │ ├── circuits │ │ ├── 11_1_3 │ │ │ └── zero_heuristic.qasm │ │ ├── 16_2_4 │ │ │ └── zero_heuristic.qasm │ │ ├── carbon │ │ │ ├── zero_heuristic.qasm │ │ │ └── zero_opt.qasm │ │ ├── hamming │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ └── zero_ft_opt.qasm │ │ ├── hypercube │ │ │ └── zero_heuristic.qasm │ │ ├── shor │ │ │ ├── zero_heuristic.qasm │ │ │ └── zero_opt.qasm │ │ ├── steane │ │ │ ├── zero_heuristic.qasm │ │ │ └── zero_opt.qasm │ │ ├── surface_3 │ │ │ ├── plus_heuristic.qasm │ │ │ ├── plus_opt.qasm │ │ │ ├── zero_heuristic.qasm │ │ │ └── zero_opt.qasm │ │ └── tetrahedral │ │ │ ├── plus_heuristic.qasm │ │ │ ├── zero_heuristic.qasm │ │ │ └── zero_opt.qasm │ │ ├── eval.py │ │ ├── plot.ipynb │ │ └── results.csv └── numerics │ ├── code_construct │ ├── constructHGPcodes.py │ ├── constructLPcodes.py │ ├── constructToricCodes.py │ ├── lifted_hgp.py │ └── mkmn_24_6_10.txt │ ├── data │ ├── decodingPerformance │ │ └── 1024_lp_code │ │ │ ├── dp-heur-singlerandomg-100k-runs.json │ │ │ ├── dp-heur-singlesmallest-100k-runs.json │ │ │ ├── dp-heur-standardg-100k-runs.json │ │ │ └── dp-original-stdgrowth-100k-runs.json │ └── runtime │ │ ├── rt-heur-1k-50s.json │ │ └── rt-original-1k-01.json │ ├── pers.txt │ └── visualize │ ├── visualizeDecodingRuntime.py │ └── visualizeWordErrRate.py ├── sitecustomize.py ├── src └── mqt │ └── qecc │ ├── __init__.py │ ├── _version.pyi │ ├── analog_information_decoding │ ├── code_construction │ │ ├── code_constructor.py │ │ ├── compute_distances.sh │ │ ├── compute_distances_3D.sh │ │ └── sparse_code_constructor.py │ ├── codes │ │ └── lifted_product │ │ │ ├── lp_l=16_hx.npz │ │ │ ├── lp_l=16_hz.npz │ │ │ ├── lp_l=21_hx.npz │ │ │ ├── lp_l=21_hz.npz │ │ │ ├── lp_l=30_hx.npz │ │ │ └── lp_l=30_hz.npz │ ├── results │ │ └── bp-parameter-comparison │ │ │ └── A comparison of BPOSD Settings.pdf │ ├── simulators │ │ ├── analog_tannergraph_decoding.py │ │ ├── memory_experiment_v2.py │ │ ├── quasi_single_shot_v2.py │ │ └── simulation.py │ └── utils │ │ ├── data_utils.py │ │ └── simulation_utils.py │ ├── cc_decoder │ ├── __init__.py │ ├── cli.py │ ├── comparison │ │ └── tn_decoder.py │ ├── decoder.py │ └── stim_interface │ │ ├── color_code_stim.py │ │ ├── dem_to_matrices.py │ │ ├── max_sat_sinter_decoder.py │ │ └── max_sat_stim_decoder.py │ ├── circuit_synthesis │ ├── __init__.py │ ├── circuit_utils.py │ ├── encoding.py │ ├── encoding_circuits │ │ ├── 10_1_2.qasm │ │ ├── 4_2_2.qasm │ │ ├── 6_2_2.qasm │ │ ├── carbon.qasm │ │ ├── hamming.qasm │ │ ├── shor.qasm │ │ ├── steane.qasm │ │ ├── surface.qasm │ │ └── tetrahedral.qasm │ ├── examples │ │ ├── Encoding_Circuit.ipynb │ │ └── Non_CSS_Ancillas.ipynb │ ├── non_css_ancillas │ │ ├── five_qubit_code.qasm │ │ ├── five_qubit_code_verified.qasm │ │ ├── gottesman_8_3_3.qasm │ │ └── gottesman_8_3_3_verified.qasm │ ├── simulation.py │ ├── simulation_det.py │ ├── state_prep.py │ ├── state_prep_det.py │ ├── stateprep_eval │ │ ├── README.md │ │ ├── circuits │ │ │ ├── carbon │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── cc_4_8_8 │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ └── zero_non_ft_heuristic.stim │ │ │ ├── cc_6_6_6 │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ └── zero_non_ft_heuristic.stim │ │ │ ├── hamming │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── rotated_surface_d3 │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── rotated_surface_d5 │ │ │ │ ├── zero_ft_heuristic_naive.qasm │ │ │ │ ├── zero_ft_heuristic_naive.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ └── zero_non_ft_heuristic.stim │ │ │ ├── shor │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ ├── steane │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_ft_opt_opt.qasm │ │ │ │ ├── plus_ft_opt_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── plus_non_ft_opt.qasm │ │ │ │ ├── plus_non_ft_opt.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ │ └── tetrahedral │ │ │ │ ├── plus_ft_heuristic_heuristic.qasm │ │ │ │ ├── plus_ft_heuristic_heuristic.stim │ │ │ │ ├── plus_ft_heuristic_opt.qasm │ │ │ │ ├── plus_ft_heuristic_opt.stim │ │ │ │ ├── plus_non_ft_heuristic.qasm │ │ │ │ ├── plus_non_ft_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_heuristic.qasm │ │ │ │ ├── zero_ft_heuristic_heuristic.stim │ │ │ │ ├── zero_ft_heuristic_opt.qasm │ │ │ │ ├── zero_ft_heuristic_opt.stim │ │ │ │ ├── zero_ft_opt_opt.qasm │ │ │ │ ├── zero_ft_opt_opt.stim │ │ │ │ ├── zero_non_ft_heuristic.qasm │ │ │ │ ├── zero_non_ft_heuristic.stim │ │ │ │ ├── zero_non_ft_opt.qasm │ │ │ │ └── zero_non_ft_opt.stim │ │ ├── estimate_logical_error_rate.py │ │ └── run_eval_on_code.sh │ └── synthesis_utils.py │ ├── codes │ ├── __init__.py │ ├── bb_codes.py │ ├── carbon │ │ ├── hx.npy │ │ └── hz.npy │ ├── cc_4_8_8_d5 │ │ ├── hx.npy │ │ └── hz.npy │ ├── color_code.py │ ├── concatenation.py │ ├── constructions.py │ ├── css_code.py │ ├── golay │ │ ├── hx.npy │ │ └── hz.npy │ ├── hamming_15 │ │ ├── hx.npy │ │ └── hz.npy │ ├── hexagonal_color_code.py │ ├── pauli.py │ ├── rotated_surface_d3 │ │ ├── hx.npy │ │ └── hz.npy │ ├── rotated_surface_d5 │ │ ├── hx.npy │ │ └── hz.npy │ ├── shor │ │ ├── hx.npy │ │ └── hz.npy │ ├── square_octagon_color_code.py │ ├── stabilizer_code.py │ ├── steane │ │ ├── hx.npy │ │ └── hz.npy │ ├── symplectic.py │ └── tetrahedral │ │ ├── hx.npy │ │ └── hz.npy │ └── py.typed ├── test └── python │ ├── __init__.py │ ├── analog_info │ ├── test_analog_tannergraph_decoding.py │ ├── test_memory_experiment.py │ ├── test_qss.py │ ├── test_simulation_utils.py │ └── test_ss_simulation.py │ ├── cc_decoder │ ├── __init__.py │ ├── test_cc_decoder.py │ ├── test_color_code_stim.py │ ├── test_dem_to_matrices.py │ ├── test_max_sat_sinter_decoder.py │ ├── test_max_sat_stim_decoder.py │ ├── test_square_octagon_color_code.py │ └── test_utils.py │ ├── circuit_synthesis │ ├── __init__.py │ ├── test_deterministic.py │ ├── test_encoder_synthesis.py │ ├── test_simulation.py │ ├── test_stateprep.py │ ├── test_utils.py │ └── utils.py │ └── test_code.py └── uv.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.{py,pyi}] 12 | indent_size = 4 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | 17 | [{*.{cmake,cmake.in},CMakeLists.txt}] 18 | max_line_length = 100 19 | -------------------------------------------------------------------------------- /.git_archival.txt: -------------------------------------------------------------------------------- 1 | node: 70e86c0660dbedbd002e9ace7fa4e2a032759c6c 2 | node-date: 2025-06-27T10:49:46Z 3 | describe-name: v1.9.0-44-g70e86c06 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | .git_archival.txt export-subst 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: 🐛 Bug report 2 | description: Something is not working correctly. 3 | title: "🐛 " 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: >- 8 | **Thank you for wanting to report a bug for this project!** 9 | 10 | ⚠ 11 | Verify first that your issue is not [already reported on GitHub](https://github.com/munich-quantum-toolkit/qecc/search?q=is%3Aissue&type=issues). 12 | 13 | If you have general questions, please consider [starting a discussion](https://github.com/munich-quantum-toolkit/qecc/discussions). 14 | - type: textarea 15 | attributes: 16 | label: Environment information 17 | description: >- 18 | Please provide information about your environment. For example, OS, mqt.qecc version etc. 19 | placeholder: | 20 | - OS: 21 | - Additional environment information: 22 | validations: 23 | required: true 24 | - type: textarea 25 | attributes: 26 | label: Description 27 | description: A clear and concise description of what the bug is. 28 | validations: 29 | required: true 30 | - type: textarea 31 | attributes: 32 | label: Expected behavior 33 | description: A clear and concise description of what you expected to happen. 34 | - type: textarea 35 | attributes: 36 | label: How to Reproduce 37 | description: Please provide steps to reproduce this bug. 38 | placeholder: | 39 | 1. Get package from '...' 40 | 2. Then run '...' 41 | 3. An error occurs. 42 | validations: 43 | required: true 44 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: ✨ Feature request 2 | description: Suggest an idea 3 | title: "✨ <title>" 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: > 8 | **Thank you for wanting to suggest a feature for this project!** 9 | 10 | ⚠ 11 | Verify first that your idea is not [already requested on GitHub](https://github.com/cda-tum/qecc/search?q=is%3Aissue&type=issues). 12 | 13 | - type: textarea 14 | attributes: 15 | label: What's the problem this feature will solve? 16 | description: >- 17 | What are you trying to do, that you are unable to achieve as it currently stands? 18 | placeholder: >- 19 | I'm trying to do X and I'm missing feature Y for this to be 20 | easily achievable. 21 | validations: 22 | required: true 23 | 24 | - type: textarea 25 | attributes: 26 | label: Describe the solution you'd like 27 | description: > 28 | Clear and concise description of what you want to happen. 29 | placeholder: >- 30 | When I do X, I want to achieve Y in a situation when Z. 31 | validations: 32 | required: true 33 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Security updates are applied only to the most recent releases. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | To report vulnerabilities, you can privately report a potential security issue 10 | via the GitHub security vulnerabilities feature. This can be done here: 11 | 12 | https://github.com/munich-quantum-toolkit/qecc/security/advisories 13 | 14 | Please do **not** open a public issue about a potential security vulnerability. 15 | 16 | You can find more details on the security vulnerability feature in the GitHub 17 | documentation here: 18 | 19 | https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability 20 | -------------------------------------------------------------------------------- /.github/codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "test/**/*" 3 | - "src/mqt/qecc/analog_information_decoding/utils/data_utils.py" 4 | - "src/mqt/qecc/analog_information_decoding/code_construction/*" 5 | - "src/mqt/qecc/circuit_synthesis/simulation_det.py" 6 | 7 | coverage: 8 | range: 60..90 9 | precision: 1 10 | status: 11 | project: off 12 | patch: off 13 | 14 | flag_management: 15 | default_rules: 16 | carryforward: true 17 | statuses: 18 | - type: project 19 | target: auto 20 | threshold: 0.5% 21 | removed_code_behavior: adjust_base 22 | - type: patch 23 | target: 90% 24 | threshold: 1% 25 | individual_flags: 26 | - name: python 27 | paths: 28 | - "src/mqt/**/*.py" 29 | statuses: 30 | - type: project 31 | threshold: 0.5% 32 | removed_code_behavior: adjust_base 33 | - type: patch 34 | target: 95% 35 | threshold: 1% 36 | 37 | comment: 38 | layout: "reach, diff, flags, files" 39 | require_changes: true 40 | show_carryforward_flags: true 41 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. 4 | List any dependencies that are required for this change. 5 | 6 | Fixes # (issue) 7 | 8 | ## Checklist: 9 | 10 | <!--- 11 | This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. 12 | --> 13 | 14 | - [ ] The pull request only contains commits that are related to it. 15 | - [ ] I have added appropriate tests and documentation. 16 | - [ ] I have made sure that all CI jobs on GitHub pass. 17 | - [ ] The pull request introduces no new warnings and follows the project's style guidelines. 18 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: "MQT QECC $RESOLVED_VERSION Release" 2 | tag-template: "v$RESOLVED_VERSION" 3 | categories: 4 | - title: "🚀 Features and Enhancements" 5 | labels: 6 | - "feature" 7 | - "enhancement" 8 | - "usability" 9 | - "refactor" 10 | - title: "🐛 Bug Fixes" 11 | labels: 12 | - "bug" 13 | - "fix" 14 | - title: "📄 Documentation" 15 | labels: 16 | - "documentation" 17 | - title: "📦 Packaging" 18 | labels: 19 | - "packaging" 20 | - title: "🧹 Code Quality" 21 | labels: 22 | - "code quality" 23 | - title: "🤖 CI" 24 | labels: 25 | - "continuous integration" 26 | - title: "⬆️ Dependencies" 27 | collapse-after: 5 28 | labels: 29 | - "dependencies" 30 | - "submodules" 31 | - "github_actions" 32 | - "pre-commit" 33 | change-template: "- $TITLE @$AUTHOR (#$NUMBER)" 34 | change-title-escapes: '\<*_&' 35 | version-resolver: 36 | major: 37 | labels: 38 | - "major" 39 | minor: 40 | labels: 41 | - "minor" 42 | patch: 43 | labels: 44 | - "patch" 45 | default: patch 46 | 47 | template: | 48 | ## 👀 What Changed 49 | 50 | $CHANGES 51 | 52 | **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION 53 | -------------------------------------------------------------------------------- /.github/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | $schema: "https://docs.renovatebot.com/renovate-schema.json", 3 | extends: ["config:recommended", ":gitSignOff"], 4 | prHourlyLimit: 10, 5 | enabledManagers: ["github-actions", "pre-commit", "pep621"], 6 | "pre-commit": { 7 | enabled: true 8 | }, 9 | lockFileMaintenance: { 10 | "enabled": true, 11 | "automerge": true, 12 | }, 13 | configMigration: true, 14 | labels: ["dependencies"], 15 | schedule: ["every weekend"], 16 | packageRules: [ 17 | { 18 | matchManagers: ["github-actions"], 19 | addLabels: ["github-actions"], 20 | commitMessagePrefix: "⬆\uFE0F\uD83D\uDC68\u200D\uD83D\uDCBB" 21 | }, 22 | { 23 | matchManagers: ["pep621"], 24 | addLabels: ["python"], 25 | commitMessagePrefix: "⬆\uFE0F\uD83D\uDC0D" 26 | }, 27 | { 28 | matchManagers: ["pre-commit"], 29 | addLabels: ["pre-commit"], 30 | commitMessagePrefix: "⬆\uFE0F\uD83E\uDE9D", 31 | }, 32 | { 33 | "description": "Automerge patch updates", 34 | "matchUpdateTypes": ["patch"], 35 | "automerge": true 36 | }, 37 | { 38 | description: "Automerge minor updates for stable dependencies", 39 | matchManagers: ["pep621", "pre-commit"], 40 | matchUpdateTypes: ["minor", "patch"], 41 | matchCurrentVersion: "!/^0/", 42 | automerge: true 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /.github/support.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | If you are stuck with a problem using MQT QECC or have questions, please get in touch at our [Issues](https://github.com/munich-quantum-toolkit/qecc/issues) or [Discussions](https://github.com/munich-quantum-toolkit/qecc/discussions). We'd love to help. 4 | 5 | You can save time by following this procedure when reporting a problem: 6 | 7 | - Do try to solve the problem on your own first. 8 | - Search through past [Issues](https://github.com/munich-quantum-toolkit/qecc/issues) and [Discussions](https://github.com/munich-quantum-toolkit/qecc/discussions) to see if someone else already had the same problem. 9 | - Before filing a bug report, try to create a minimal working example (MWE) that reproduces the problem. It is much easier to identify the cause for the problem if a handful of lines suffice to show that something is not working. 10 | 11 | You can also always reach us at [quantum.cda@xcit.tum.de](mailto:quantum.cda@xcit.tum.de). 12 | -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: CD 2 | on: 3 | release: 4 | types: [published] 5 | workflow_dispatch: 6 | pull_request: 7 | paths: 8 | - .github/workflows/cd.yml 9 | 10 | jobs: 11 | python-packaging: 12 | name: 🐍 Packaging 13 | uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging.yml@v1.11 14 | with: 15 | pure-python: true 16 | 17 | deploy: 18 | if: github.event_name == 'release' && github.event.action == 'published' 19 | name: 🚀 Deploy to PyPI 20 | runs-on: ubuntu-latest 21 | environment: 22 | name: pypi 23 | url: https://pypi.org/p/mqt.qecc 24 | permissions: 25 | id-token: write 26 | attestations: write 27 | contents: read 28 | needs: [python-packaging] 29 | steps: 30 | - uses: actions/download-artifact@v4 31 | with: 32 | pattern: cibw-* 33 | path: dist 34 | merge-multiple: true 35 | - name: Generate artifact attestation for sdist and wheel(s) 36 | uses: actions/attest-build-provenance@v2 37 | with: 38 | subject-path: "dist/*" 39 | - uses: pypa/gh-action-pypi-publish@release/v1 40 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | types: [opened, reopened, synchronize] 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | update_release_draft: 15 | name: Run 16 | permissions: 17 | contents: write 18 | pull-requests: write 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: release-drafter/release-drafter@v6 22 | env: 23 | GITHUB_TOKEN: ${{ github.token }} 24 | -------------------------------------------------------------------------------- /.license-tools-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Chair for Design Automation, TUM", 4 | "years": [2023, 2025] 5 | }, 6 | "force_author": true, 7 | "license": "MIT", 8 | "title": false, 9 | "include": ["**/*"], 10 | "style_override_for_suffix": { 11 | ".pyi": "DOCSTRING_STYLE", 12 | ".in": "POUND_STYLE", 13 | ".mlir": "SLASH_STYLE", 14 | ".td": "SLASH_STYLE", 15 | ".yaml": "POUND_STYLE", 16 | ".toml": "POUND_STYLE" 17 | }, 18 | "exclude": [ 19 | "^\\.[^/]+", 20 | "/\\.[^/]+", 21 | ".*\\.qasm", 22 | ".*\\.stim", 23 | ".*\\.txt", 24 | ".*\\.csv", 25 | ".*\\.md", 26 | ".*\\.bib", 27 | ".*\\.css", 28 | ".*\\.ipynb", 29 | ".*\\.json", 30 | ".*\\.html", 31 | "uv\\.lock", 32 | ".*\\.rst", 33 | "py\\.typed", 34 | ".*build.*" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | formats: 4 | - htmlzip 5 | # - pdf 6 | 7 | build: 8 | os: ubuntu-24.04 9 | tools: 10 | python: "3.12" 11 | jobs: 12 | post_checkout: 13 | # Skip docs build if the commit message contains "skip ci" 14 | - (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip ci") || exit 183 15 | # Skip docs build if there are no changes related to docs 16 | - | 17 | if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml src/mqt/ src/python include/*/python .github/contributing* .github/support*; 18 | then 19 | exit 183; 20 | fi 21 | # Unshallow the git clone and fetch tags to get proper version information 22 | - git fetch --unshallow --tags 23 | pre_build: 24 | # Set up uv 25 | - asdf plugin add uv 26 | - asdf install uv latest 27 | - asdf global uv latest 28 | build: 29 | html: 30 | - uv run --frozen --no-dev --group docs -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html 31 | htmlzip: 32 | - uv run --frozen --no-dev --group docs -m sphinx -T -b dirhtml -d docs/_build/doctrees -D language=en docs docs/_build/dirhtml 33 | - mkdir -p $READTHEDOCS_OUTPUT/htmlzip 34 | - zip -r $READTHEDOCS_OUTPUT/htmlzip/html.zip docs/_build/dirhtml/* 35 | # pdf: 36 | # - uv run --frozen --no-dev --group docs -m sphinx -T -b latex -d docs/_build/doctrees -D language=en docs docs/_build/latex 37 | # - cd docs/_build/latex && latexmk -pdf -f -dvi- -ps- -interaction=nonstopmode -jobname=$READTHEDOCS_PROJECT 38 | # - mkdir -p $READTHEDOCS_OUTPUT/pdf 39 | # - cp docs/_build/latex/$READTHEDOCS_PROJECT.pdf $READTHEDOCS_OUTPUT/pdf/$READTHEDOCS_PROJECT.pdf 40 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Chair for Design Automation, Technical University of Munich 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/Contributing.md: -------------------------------------------------------------------------------- 1 | ```{include} ../.github/contributing.md 2 | 3 | ``` 4 | -------------------------------------------------------------------------------- /docs/Publications.md: -------------------------------------------------------------------------------- 1 | # Publications 2 | 3 | _QECC_ is academic software. Thus, many of its built-in algorithms have been published as scientific papers. 4 | 5 | If you use _QECC_ in your work, we would appreciate if you cite the respective paper 6 | {cite:labelpar}`berent2022software`, {cite:labelpar}`berent2023decoding`, {cite:labelpar}`grurl2023eccframework`, {cite:labelpar}`peham2024automated`, {cite:labelpar}`schmid2024deterministic`. 7 | 8 | ```{eval-rst} 9 | .. bibliography:: 10 | ``` 11 | -------------------------------------------------------------------------------- /docs/Support.md: -------------------------------------------------------------------------------- 1 | ```{include} ../.github/support.md 2 | 3 | ``` 4 | -------------------------------------------------------------------------------- /docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | .acknowledgements { 2 | margin-top: 1rem; 3 | padding-bottom: 1rem; 4 | padding-top: 1rem; 5 | border-top: 1px solid var(--color-background-border); 6 | font-size: var(--font-size--small); 7 | color: var(--color-foreground-secondary); 8 | } 9 | 10 | .acknowledgements-logos { 11 | display: grid; 12 | grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); 13 | grid-gap: 1em; 14 | align-items: center; 15 | margin-top: 0.5rem; 16 | } 17 | .acknowledgement { 18 | display: flex; 19 | flex-direction: column; 20 | align-items: center; 21 | justify-content: center; 22 | } 23 | 24 | /* override the default background color for literal strings */ 25 | body:not([data-theme="light"]) .highlight .sa, 26 | .highlight .sb, 27 | .highlight .sc, 28 | .highlight .dl, 29 | .highlight .sd, 30 | .highlight .s2, 31 | .highlight .se, 32 | .highlight .sh, 33 | .highlight .si, 34 | .highlight .sx, 35 | .highlight .sr, 36 | .highlight .s1, 37 | .highlight .ss, 38 | .highlight .s1, 39 | .highlight .s { 40 | background-color: #00000001; 41 | } 42 | 43 | /* provide dark mode overrides for mystnb variables */ 44 | body:not([data-theme="light"]) { 45 | --mystnb-source-bg-color: #131416; 46 | --mystnb-stdout-bg-color: #1a1c1e; 47 | --mystnb-stderr-bg-color: #442222; 48 | --mystnb-traceback-bg-color: #202020; 49 | } 50 | 51 | body:not([data-theme="light"]) .highlight .gp { 52 | color: #c65d09; 53 | } 54 | -------------------------------------------------------------------------------- /docs/_static/mqt_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/docs/_static/mqt_dark.png -------------------------------------------------------------------------------- /docs/_static/mqt_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/docs/_static/mqt_light.png -------------------------------------------------------------------------------- /docs/images/cc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/docs/images/cc.png -------------------------------------------------------------------------------- /docs/images/lights-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/docs/images/lights-out.png -------------------------------------------------------------------------------- /docs/images/lo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/docs/images/lo.png -------------------------------------------------------------------------------- /docs/images/steane-ex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/docs/images/steane-ex.png -------------------------------------------------------------------------------- /examples/mkmn_24_6_10.txt: -------------------------------------------------------------------------------- 1 | 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 2 | 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 3 | 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 4 | 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 5 | 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 6 | 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 7 | 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 8 | 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 9 | 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 10 | 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 11 | 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 12 | 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 13 | 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 14 | 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 15 | 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 16 | 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 17 | 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 18 | 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 19 | -------------------------------------------------------------------------------- /examples/test/inCodes/toric_(nan,nan)-[[8,2,2]]_hx.txt: -------------------------------------------------------------------------------- 1 | 1 0 1 0 1 1 0 0 2 | 0 1 0 1 1 1 0 0 3 | 1 0 1 0 0 0 1 1 4 | 0 1 0 1 0 0 1 1 5 | -------------------------------------------------------------------------------- /examples/test/testCode.txt: -------------------------------------------------------------------------------- 1 | 1 0 0 1 0 1 1 2 | 0 1 0 1 1 0 1 3 | 0 0 1 0 1 1 1 4 | -------------------------------------------------------------------------------- /examples/test/toric_(nan,nan)-[[18,2,3]]_hx.txt: -------------------------------------------------------------------------------- 1 | 1 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 2 | 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 3 | 0 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 4 | 0 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 0 0 5 | 0 0 0 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 6 | 0 0 0 0 0 1 0 0 1 0 0 0 0 1 1 0 0 0 7 | 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 8 | 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 9 | 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 10 | -------------------------------------------------------------------------------- /examples/test/toric_(nan,nan)-[[32,2,4]]_hx.txt: -------------------------------------------------------------------------------- 1 | 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 2 | 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 | 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 4 | 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 5 | 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 6 | 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 7 | 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 8 | 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 9 | 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 10 | 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 11 | 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 12 | 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 13 | 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 14 | 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 15 | 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 16 | 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 17 | -------------------------------------------------------------------------------- /examples/test/toric_(nan,nan)-[[8,2,2]]_hx.txt: -------------------------------------------------------------------------------- 1 | 1 0 1 0 1 1 0 0 2 | 0 1 0 1 1 1 0 0 3 | 1 0 1 0 0 0 1 1 4 | 0 1 0 1 0 0 1 1 5 | -------------------------------------------------------------------------------- /examples/toricCodes/toric_(nan,nan)-[[18,2,3]]_hz.txt: -------------------------------------------------------------------------------- 1 | 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 2 | 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 3 | 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 4 | 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 5 | 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 6 | 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 7 | 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 8 | 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 9 | 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 10 | -------------------------------------------------------------------------------- /examples/toricCodes/toric_(nan,nan)-[[32,2,4]]_hz.txt: -------------------------------------------------------------------------------- 1 | 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 2 | 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 3 | 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 4 | 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 5 | 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 6 | 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 7 | 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 8 | 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 9 | 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 10 | 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 11 | 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 12 | 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 13 | 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 14 | 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 15 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 16 | 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 17 | -------------------------------------------------------------------------------- /examples/toricCodes/toric_(nan,nan)-[[8,2,2]]_hz.txt: -------------------------------------------------------------------------------- 1 | 1 1 0 0 1 0 1 0 2 | 1 1 0 0 0 1 0 1 3 | 0 0 1 1 1 0 1 0 4 | 0 0 1 1 0 1 0 1 5 | -------------------------------------------------------------------------------- /scripts/cc_decoder/run.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 3 | # All rights reserved. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # 7 | # Licensed under the MIT License 8 | 9 | # set number of parallel processes 10 | N=16 11 | export export LC_NUMERIC=C 12 | # run the simulations 13 | parallel -j $N mqt.qecc.cc-decoder {1} {2} --nr_sims 10000 --results_dir ./results/maxsat --decoder maxsat ::: $(seq 3 2 21) ::: $(seq 0.001 0.001 0.175) 14 | parallel -j $N mqt.qecc.cc-decoder {1} {2} --nr_sims 10000 --results_dir ./results/tn --decoder tn ::: $(seq 3 2 21) ::: $(seq 0.001 0.001 0.175) 15 | -------------------------------------------------------------------------------- /scripts/constructHGPcodes.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Construction of HGP codes.""" 9 | 10 | from __future__ import annotations 11 | 12 | import numpy as np 13 | from bposd.hgp import hgp 14 | 15 | # med sized HGP code from 16 | 17 | h = np.loadtxt("./mkmn_24_6_10.txt").astype(int) 18 | seed_code = np.loadtxt("./mkmn_24_6_10.txt").astype(int) 19 | # print(seed_code) 20 | qcode = hgp(seed_code, compute_distance=True) 21 | qcode.canonical_logicals() 22 | qcode.test() 23 | print(qcode.code_params) 24 | print(qcode.hx) 25 | print("hx:") 26 | print(qcode.hz) 27 | np.savetxt(f"./hgp_{qcode.code_params}_hz.txt", qcode.hz, fmt="%d", newline="\n") 28 | np.savetxt(f"./hgp_{qcode.code_params}_hx.txt", qcode.hx, fmt="%d", newline="\n") 29 | 30 | # larger code 31 | # a1 = pt.array([ 32 | # [(0), (11), (7), (12)], 33 | # [(1), (8), (1), (8)], 34 | # [(11), (0), (4), (8)], 35 | # [(6), (2), (4), (12)]]) 36 | # H = a1.to_binary(lift_parameter=13) 37 | # qcode = hgp(H, H, compute_distance=True) 38 | # qcode.test() 39 | # np.savetxt(f"./hgp_{qcode.code_params}_hz.txt", qcode.hz, fmt='%d', newline='\n') 40 | -------------------------------------------------------------------------------- /scripts/examples/decoding-performance-simulations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Simulate the decoding performance of the UF heuristic decoder.""" 9 | 10 | from __future__ import annotations 11 | 12 | from pathlib import Path 13 | 14 | from mqt import qecc 15 | 16 | code = qecc.Code( 17 | "../../examples/lp_(4,8)-[[1024,18,nan]]_hx.txt", 18 | "../../examples/lp_(4,8)-[[1024,18,nan]]_hz.txt", 19 | ) 20 | code.K = 18 21 | outpath = "./dp-sims-bindings.out" 22 | 23 | runs_per_p = 1 24 | curr_p = 0.00001 25 | max_per = 0.00003 26 | step_size = 0.00001 27 | nr_failed_runs = 0 28 | code_k = code.K 29 | 30 | with Path(outpath).open("w", encoding="utf-8") as outfile: 31 | while curr_p < max_per: 32 | nr_failed_runs = 0 33 | for _ in range(runs_per_p): 34 | decoder = qecc.UFHeuristic() 35 | decoder.set_code(code) 36 | err = qecc.sample_iid_pauli_err(code.N, curr_p) 37 | decoder.decode(code.get_x_syndrome(err)) 38 | result = decoder.result.estimate 39 | if not code.is_stabilizer(result): 40 | nr_failed_runs += 1 41 | frac_fails = nr_failed_runs / runs_per_p 42 | wer = frac_fails / code_k 43 | res = str(curr_p) + ":" + str(wer) + "\n" 44 | print(res) 45 | outfile.write(res) 46 | curr_p += step_size 47 | -------------------------------------------------------------------------------- /scripts/examples/readme_example.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Example of using the UF heuristic decoder.""" 9 | 10 | from __future__ import annotations 11 | 12 | import numpy as np 13 | 14 | from mqt import qecc 15 | 16 | code = qecc.Code("/path/to/Hx", "path/to/Hz") 17 | decoder = qecc.UFHeuristic() 18 | decoder.set_code(code) 19 | x_err = qecc.sample_iid_pauli_err(code.N, 0.05) 20 | decoder.decode(code.get_x_syndrome(x_err)) 21 | result = decoder.result 22 | print(result) 23 | residual_err = np.array(x_err) ^ np.array(result.estimate) 24 | print(code.is_x_stabilizer(residual_err)) 25 | -------------------------------------------------------------------------------- /scripts/examples/runtime-simulations.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Compute average runtimes for the UF heuristic on toric codes.""" 9 | 10 | from __future__ import annotations 11 | 12 | from pathlib import Path 13 | 14 | from mqt import qecc 15 | 16 | codes = [ 17 | "../../examples/toricCodes/toric_(nan,nan)-[[8,2,2]]_hz.txt", 18 | "../../examples/toricCodes/toric_(nan,nan)-[[18,2,3]]_hz.txt", 19 | "../../examples/toricCodes/toric_(nan,nan)-[[32,2,4]]_hz.txt", 20 | "../../examples/toricCodes/toric_(nan,nan)-[[50,2,5]]_hz.txt", 21 | "../../examples/toricCodes/toric_(nan,nan)-[[72,2,6]]_hz.txt", 22 | "../../examples/toricCodes/toric_(nan,nan)-[[98,2,7]]_hz.txt", 23 | "../../examples/toricCodes/toric_(nan,nan)-[[128,2,8]]_hz.txt", 24 | "../../examples/toricCodes/toric_(nan,nan)-[[162,2,9]]_hz.txt", 25 | "../../examples/toricCodes/toric_(nan,nan)-[[200,2,10]]_hz.txt", 26 | ] 27 | outpath: str = "./rt-sims-bindings.out" 28 | 29 | nr_samples: int = 1 30 | nr_runs: int = 1 31 | per: float = 0.01 32 | 33 | with Path(outpath).open("w", encoding="utf-8") as outfile: 34 | for code_path in codes: 35 | sample_sum = 0.0 36 | for _ in range(nr_samples): 37 | runs_sum = 0.0 38 | for _ in range(nr_runs): 39 | code = qecc.Code(code_path) 40 | err = qecc.sample_iid_pauli_err(code.N, per) 41 | decoder = qecc.UFHeuristic() 42 | decoder.set_code(code) 43 | syndr = code.get_x_syndrome(err) 44 | decoder.decode(syndr) 45 | time = decoder.result.decoding_time 46 | runs_sum += time 47 | sample_sum += runs_sum 48 | outp = code_path + ":" + str(sample_sum / nr_samples) 49 | print(outp) 50 | outfile.write(outp + "\n") 51 | outfile.flush() 52 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/README.md: -------------------------------------------------------------------------------- 1 | If you want to run evaluations on the example circuits in this directory, do the following. 2 | 3 | To estimate the logical error rate for a physical error rate p_err, run 4 | 5 | `python estimate_logical_error_rate CODE -p p_err` 6 | 7 | The script prints 4 numbers: logical error rate per qubit, acceptance rate (if using post-selection), number of logical errors, total number of shots 8 | 9 | The python script has further options with which you can select which circuits to construct, how many logical errors should occur before stopping and more. 10 | 11 | To generate these values for a circuit for a range between p_err = 0.5 and p_err = 0.00005, the script `run_eval_on_code FILENAME ARGS` can be used. It runs multiple instances of `estimate_logical_error_rate` in parallel (using GNU Parallel) and stores the results in `FILENAME.csv`. 12 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | qreg z_anc[2]; 5 | qreg x_anc[1]; 6 | qreg a47[1]; 7 | creg z_c[2]; 8 | creg x_c[1]; 9 | creg c47[1]; 10 | h q[0]; 11 | h q[1]; 12 | h q[2]; 13 | h q[4]; 14 | h q[7]; 15 | cx q[7],q[11]; 16 | cx q[1],q[5]; 17 | cx q[7],q[9]; 18 | cx q[4],q[10]; 19 | cx q[2],q[8]; 20 | cx q[1],q[3]; 21 | cx q[0],q[6]; 22 | cx q[10],q[9]; 23 | cx q[8],q[7]; 24 | cx q[6],q[11]; 25 | cx q[4],q[3]; 26 | cx q[2],q[1]; 27 | cx q[0],q[5]; 28 | cx q[11],q[10]; 29 | cx q[9],q[8]; 30 | cx q[7],q[6]; 31 | cx q[5],q[4]; 32 | cx q[3],q[2]; 33 | cx q[1],q[0]; 34 | cx q[1],z_anc[0]; 35 | cx q[4],z_anc[0]; 36 | cx q[7],z_anc[0]; 37 | cx q[10],z_anc[0]; 38 | cx q[1],z_anc[1]; 39 | cx q[2],z_anc[1]; 40 | cx q[7],z_anc[1]; 41 | cx q[8],z_anc[1]; 42 | measure z_anc[0] -> z_c[0]; 43 | measure z_anc[1] -> z_c[1]; 44 | h x_anc[0]; 45 | cx x_anc[0],q[0]; 46 | cx x_anc[0],a47[0]; 47 | cx x_anc[0],q[2]; 48 | cx x_anc[0],q[4]; 49 | cx x_anc[0],q[6]; 50 | cx x_anc[0],q[8]; 51 | cx x_anc[0],a47[0]; 52 | measure a47[0] -> c47[0]; 53 | cx x_anc[0],q[10]; 54 | h x_anc[0]; 55 | measure x_anc[0] -> x_c[0]; 56 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 7 2 | CX 7 11 1 5 7 9 4 10 2 8 1 3 0 6 10 9 8 7 6 11 4 3 2 1 0 5 11 10 9 8 7 6 5 4 3 2 1 0 1 12 4 12 7 12 10 12 1 13 2 13 7 13 8 13 3 | MR 12 13 4 | H 14 5 | CX 14 0 14 15 14 2 14 4 14 6 14 8 14 15 6 | MR 15 7 | CX 14 10 8 | H 14 9 | MR 14 10 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | qreg z_anc[1]; 5 | qreg a9[1]; 6 | qreg x_anc[1]; 7 | qreg a10[1]; 8 | creg z_c[1]; 9 | creg c9[1]; 10 | creg x_c[1]; 11 | creg c10[1]; 12 | h q[1]; 13 | h q[2]; 14 | h q[4]; 15 | h q[6]; 16 | h q[8]; 17 | cx q[1],q[7]; 18 | cx q[6],q[9]; 19 | cx q[2],q[5]; 20 | cx q[7],q[0]; 21 | cx q[7],q[6]; 22 | cx q[4],q[10]; 23 | cx q[5],q[11]; 24 | cx q[9],q[3]; 25 | cx q[10],q[1]; 26 | cx q[8],q[5]; 27 | cx q[7],q[2]; 28 | cx q[8],q[4]; 29 | cx q[8],q[9]; 30 | cx q[2],q[8]; 31 | cx q[9],q[0]; 32 | cx q[4],q[7]; 33 | cx q[0],z_anc[0]; 34 | h a9[0]; 35 | cx a9[0],z_anc[0]; 36 | cx q[2],z_anc[0]; 37 | cx q[3],z_anc[0]; 38 | cx q[4],z_anc[0]; 39 | cx q[10],z_anc[0]; 40 | cx a9[0],z_anc[0]; 41 | h a9[0]; 42 | measure a9[0] -> c9[0]; 43 | cx q[11],z_anc[0]; 44 | measure z_anc[0] -> z_c[0]; 45 | measure z_anc[0] -> z_c[0]; 46 | h x_anc[0]; 47 | cx x_anc[0],q[0]; 48 | cx x_anc[0],a10[0]; 49 | cx x_anc[0],q[3]; 50 | cx x_anc[0],q[7]; 51 | cx x_anc[0],q[8]; 52 | cx x_anc[0],q[10]; 53 | cx x_anc[0],a10[0]; 54 | measure a10[0] -> c10[0]; 55 | cx x_anc[0],q[11]; 56 | h x_anc[0]; 57 | measure x_anc[0] -> x_c[0]; 58 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 0 12 3 | H 13 4 | CX 13 12 2 12 3 12 4 12 10 12 13 12 5 | H 13 6 | MR 13 7 | CX 11 12 8 | MR 12 12 9 | H 14 10 | CX 14 0 14 15 14 3 14 7 14 8 14 10 14 15 11 | MR 15 12 | CX 14 11 13 | H 14 14 | MR 14 15 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | qreg z_anc[1]; 5 | qreg x_anc[1]; 6 | qreg a62[1]; 7 | creg z_c[1]; 8 | creg x_c[1]; 9 | creg c62[1]; 10 | h q[1]; 11 | h q[2]; 12 | h q[4]; 13 | h q[6]; 14 | h q[8]; 15 | cx q[1],q[7]; 16 | cx q[6],q[9]; 17 | cx q[2],q[5]; 18 | cx q[7],q[0]; 19 | cx q[7],q[6]; 20 | cx q[4],q[10]; 21 | cx q[5],q[11]; 22 | cx q[9],q[3]; 23 | cx q[10],q[1]; 24 | cx q[8],q[5]; 25 | cx q[7],q[2]; 26 | cx q[8],q[4]; 27 | cx q[8],q[9]; 28 | cx q[2],q[8]; 29 | cx q[9],q[0]; 30 | cx q[4],q[7]; 31 | cx q[0],z_anc[0]; 32 | cx q[2],z_anc[0]; 33 | cx q[3],z_anc[0]; 34 | cx q[4],z_anc[0]; 35 | cx q[10],z_anc[0]; 36 | cx q[11],z_anc[0]; 37 | measure z_anc[0] -> z_c[0]; 38 | h x_anc[0]; 39 | cx x_anc[0],q[0]; 40 | cx x_anc[0],a62[0]; 41 | cx x_anc[0],q[1]; 42 | cx x_anc[0],q[5]; 43 | cx x_anc[0],q[6]; 44 | cx x_anc[0],q[7]; 45 | cx x_anc[0],a62[0]; 46 | measure a62[0] -> c62[0]; 47 | cx x_anc[0],q[11]; 48 | h x_anc[0]; 49 | measure x_anc[0] -> x_c[0]; 50 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 0 12 2 12 3 12 4 12 10 12 11 12 3 | MR 12 4 | H 13 5 | CX 13 0 13 14 13 1 13 5 13 6 13 7 13 14 6 | MR 14 7 | CX 13 11 8 | H 13 9 | MR 13 10 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | h q[1]; 5 | h q[2]; 6 | h q[4]; 7 | h q[6]; 8 | h q[8]; 9 | cx q[1],q[7]; 10 | cx q[6],q[9]; 11 | cx q[2],q[5]; 12 | cx q[7],q[0]; 13 | cx q[7],q[6]; 14 | cx q[4],q[10]; 15 | cx q[5],q[11]; 16 | cx q[9],q[3]; 17 | cx q[10],q[1]; 18 | cx q[8],q[5]; 19 | cx q[7],q[2]; 20 | cx q[8],q[4]; 21 | cx q[8],q[9]; 22 | cx q[2],q[8]; 23 | cx q[9],q[0]; 24 | cx q[4],q[7]; 25 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | h q[1]; 5 | h q[2]; 6 | h q[4]; 7 | h q[6]; 8 | h q[8]; 9 | cx q[1],q[7]; 10 | cx q[6],q[9]; 11 | cx q[2],q[5]; 12 | cx q[7],q[0]; 13 | cx q[7],q[6]; 14 | cx q[4],q[10]; 15 | cx q[5],q[11]; 16 | cx q[9],q[3]; 17 | cx q[10],q[1]; 18 | cx q[8],q[5]; 19 | cx q[7],q[2]; 20 | cx q[8],q[4]; 21 | cx q[8],q[9]; 22 | cx q[2],q[8]; 23 | cx q[9],q[0]; 24 | cx q[4],q[7]; 25 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/carbon/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_4_8_8/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 9 10 2 | CX 4 8 10 15 4 6 9 15 5 12 4 7 3 14 2 6 14 16 10 13 9 11 8 5 3 7 1 4 0 2 12 9 1 13 0 3 15 8 6 16 5 11 4 10 2 14 1 17 5 17 9 17 10 17 15 17 0 18 2 18 7 18 16 18 0 19 2 19 7 19 16 19 1 20 3 20 4 20 6 20 14 20 1 21 4 21 9 21 11 21 3 | MR 17 18 19 20 21 4 | H 22 5 | CX 22 0 22 25 22 1 22 26 22 8 22 10 22 27 22 11 22 12 22 25 6 | MR 25 7 | CX 22 14 22 27 8 | MR 27 9 | CX 22 26 10 | MR 26 11 | CX 22 16 12 | H 22 13 | MR 22 14 | H 23 15 | CX 23 5 23 28 23 10 23 12 23 28 16 | MR 28 17 | CX 23 13 18 | H 23 19 | MR 23 20 | H 24 21 | CX 24 1 24 29 24 4 24 10 24 29 22 | MR 29 23 | CX 24 13 24 | H 24 25 | MR 24 26 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_4_8_8/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[17]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[9]; 11 | h q[10]; 12 | cx q[4],q[8]; 13 | cx q[10],q[15]; 14 | cx q[4],q[6]; 15 | cx q[9],q[15]; 16 | cx q[5],q[12]; 17 | cx q[4],q[7]; 18 | cx q[3],q[14]; 19 | cx q[2],q[6]; 20 | cx q[14],q[16]; 21 | cx q[10],q[13]; 22 | cx q[9],q[11]; 23 | cx q[8],q[5]; 24 | cx q[3],q[7]; 25 | cx q[1],q[4]; 26 | cx q[0],q[2]; 27 | cx q[12],q[9]; 28 | cx q[1],q[13]; 29 | cx q[0],q[3]; 30 | cx q[15],q[8]; 31 | cx q[6],q[16]; 32 | cx q[5],q[11]; 33 | cx q[4],q[10]; 34 | cx q[2],q[14]; 35 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_4_8_8/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 9 10 2 | CX 4 8 10 15 4 6 9 15 5 12 4 7 3 14 2 6 14 16 10 13 9 11 8 5 3 7 1 4 0 2 12 9 1 13 0 3 15 8 6 16 5 11 4 10 2 14 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_4_8_8_d7/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[31]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[6]; 11 | h q[8]; 12 | h q[9]; 13 | h q[10]; 14 | h q[11]; 15 | h q[12]; 16 | h q[17]; 17 | h q[19]; 18 | h q[20]; 19 | cx q[9],q[30]; 20 | cx q[5],q[22]; 21 | cx q[22],q[29]; 22 | cx q[12],q[23]; 23 | cx q[9],q[14]; 24 | cx q[5],q[16]; 25 | cx q[4],q[27]; 26 | cx q[3],q[24]; 27 | cx q[24],q[26]; 28 | cx q[19],q[25]; 29 | cx q[16],q[12]; 30 | cx q[10],q[27]; 31 | cx q[9],q[15]; 32 | cx q[8],q[23]; 33 | cx q[6],q[14]; 34 | cx q[3],q[21]; 35 | cx q[2],q[5]; 36 | cx q[1],q[4]; 37 | cx q[0],q[29]; 38 | cx q[26],q[16]; 39 | cx q[25],q[28]; 40 | cx q[24],q[14]; 41 | cx q[21],q[0]; 42 | cx q[20],q[9]; 43 | cx q[19],q[22]; 44 | cx q[17],q[2]; 45 | cx q[15],q[1]; 46 | cx q[11],q[3]; 47 | cx q[10],q[13]; 48 | cx q[8],q[18]; 49 | cx q[6],q[7]; 50 | cx q[20],q[18]; 51 | cx q[17],q[19]; 52 | cx q[14],q[16]; 53 | cx q[11],q[13]; 54 | cx q[29],q[6]; 55 | cx q[27],q[21]; 56 | cx q[23],q[30]; 57 | cx q[12],q[15]; 58 | cx q[9],q[8]; 59 | cx q[5],q[28]; 60 | cx q[4],q[26]; 61 | cx q[3],q[10]; 62 | cx q[2],q[25]; 63 | cx q[1],q[24]; 64 | cx q[0],q[7]; 65 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_4_8_8_d7/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 6 8 9 10 11 12 17 19 20 2 | CX 9 30 5 22 22 29 12 23 9 14 5 16 4 27 3 24 24 26 19 25 16 12 10 27 9 15 8 23 6 14 3 21 2 5 1 4 0 29 26 16 25 28 24 14 21 0 20 9 19 22 17 2 15 1 11 3 10 13 8 18 6 7 20 18 17 19 14 16 11 13 29 6 27 21 23 30 12 15 9 8 5 28 4 26 3 10 2 25 1 24 0 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_6_6_6/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 6 10 12 2 | CX 6 16 4 13 3 7 12 17 10 18 7 11 6 3 4 8 2 16 1 15 0 14 11 12 10 13 8 9 6 0 5 2 4 3 1 7 17 18 14 15 5 9 16 4 13 11 12 10 7 6 2 8 0 1 0 19 5 19 6 19 9 19 12 19 13 19 15 19 18 19 4 20 5 20 6 20 7 20 8 20 0 21 2 21 3 21 7 21 8 21 15 21 1 22 6 22 11 22 13 22 14 22 1 23 2 23 5 23 15 23 16 23 4 24 5 24 9 24 16 24 3 | MR 19 20 21 22 23 24 4 | H 25 5 | CX 25 1 25 31 25 2 25 32 25 4 25 5 25 33 25 10 25 11 25 31 6 | MR 31 7 | CX 25 15 25 33 8 | MR 33 9 | CX 25 32 10 | MR 32 11 | CX 25 17 12 | H 25 13 | MR 25 14 | H 26 15 | CX 26 1 26 34 26 3 26 35 26 5 26 7 26 34 16 | MR 34 17 | CX 26 9 26 35 18 | MR 35 19 | CX 26 14 20 | H 26 21 | MR 26 22 | H 27 23 | CX 27 0 27 36 27 1 27 14 27 36 24 | MR 36 25 | CX 27 15 26 | H 27 27 | MR 27 28 | H 28 29 | CX 28 1 28 37 28 3 28 38 28 12 28 13 28 37 30 | MR 37 31 | CX 28 15 28 38 32 | MR 38 33 | CX 28 18 34 | H 28 35 | MR 28 36 | H 29 37 | CX 29 2 29 39 29 3 29 40 29 9 29 12 29 39 38 | MR 39 39 | CX 29 16 29 40 40 | MR 40 41 | CX 29 17 42 | H 29 43 | MR 29 44 | H 30 45 | CX 30 0 30 41 30 3 30 42 30 5 30 7 30 41 46 | MR 41 47 | CX 30 9 30 42 48 | MR 42 49 | CX 30 15 50 | H 30 51 | MR 30 52 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_6_6_6/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[19]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[6]; 11 | h q[10]; 12 | h q[12]; 13 | cx q[6],q[16]; 14 | cx q[4],q[13]; 15 | cx q[3],q[7]; 16 | cx q[12],q[17]; 17 | cx q[10],q[18]; 18 | cx q[7],q[11]; 19 | cx q[6],q[3]; 20 | cx q[4],q[8]; 21 | cx q[2],q[16]; 22 | cx q[1],q[15]; 23 | cx q[0],q[14]; 24 | cx q[11],q[12]; 25 | cx q[10],q[13]; 26 | cx q[8],q[9]; 27 | cx q[6],q[0]; 28 | cx q[5],q[2]; 29 | cx q[4],q[3]; 30 | cx q[1],q[7]; 31 | cx q[17],q[18]; 32 | cx q[14],q[15]; 33 | cx q[5],q[9]; 34 | cx q[16],q[4]; 35 | cx q[13],q[11]; 36 | cx q[12],q[10]; 37 | cx q[7],q[6]; 38 | cx q[2],q[8]; 39 | cx q[0],q[1]; 40 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/cc_6_6_6/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 6 10 12 2 | CX 6 16 4 13 3 7 12 17 10 18 7 11 6 3 4 8 2 16 1 15 0 14 11 12 10 13 8 9 6 0 5 2 4 3 1 7 17 18 14 15 5 9 16 4 13 11 12 10 7 6 2 8 0 1 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[2]; 5 | creg x_c[2]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[8]; 11 | h q[9]; 12 | h q[10]; 13 | h q[11]; 14 | h q[12]; 15 | h q[13]; 16 | h q[14]; 17 | cx q[11],q[7]; 18 | cx q[5],q[3]; 19 | cx q[2],q[1]; 20 | cx q[13],q[11]; 21 | cx q[9],q[7]; 22 | cx q[6],q[5]; 23 | cx q[4],q[3]; 24 | cx q[2],q[0]; 25 | cx q[14],q[13]; 26 | cx q[12],q[11]; 27 | cx q[10],q[9]; 28 | cx q[8],q[7]; 29 | cx q[5],q[1]; 30 | cx q[4],q[0]; 31 | cx q[6],q[2]; 32 | cx q[11],q[3]; 33 | cx q[9],q[1]; 34 | cx q[8],q[0]; 35 | cx q[13],q[5]; 36 | cx q[12],q[4]; 37 | cx q[10],q[2]; 38 | cx q[14],q[6]; 39 | h x_anc[0]; 40 | cx x_anc[0],q[0]; 41 | cx x_anc[0],q[2]; 42 | cx x_anc[0],q[4]; 43 | cx x_anc[0],q[6]; 44 | cx x_anc[0],q[7]; 45 | cx x_anc[0],q[9]; 46 | cx x_anc[0],q[11]; 47 | cx x_anc[0],q[13]; 48 | h x_anc[0]; 49 | h x_anc[1]; 50 | cx x_anc[1],q[5]; 51 | cx x_anc[1],q[9]; 52 | cx x_anc[1],q[12]; 53 | cx x_anc[1],q[13]; 54 | cx x_anc[1],q[14]; 55 | h x_anc[1]; 56 | measure x_anc[0] -> x_c[0]; 57 | measure x_anc[1] -> x_c[1]; 58 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 8 9 10 11 12 13 14 2 | CX 11 7 5 3 2 1 13 11 9 7 6 5 4 3 2 0 14 13 12 11 10 9 8 7 5 1 4 0 6 2 11 3 9 1 8 0 13 5 12 4 10 2 14 6 3 | H 15 4 | CX 15 0 15 2 15 4 15 6 15 7 15 9 15 11 15 13 5 | H 15 16 6 | CX 16 5 16 9 16 12 16 13 16 14 7 | H 16 8 | MR 15 16 9 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[2]; 5 | creg x_c[2]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[8]; 11 | h q[9]; 12 | h q[10]; 13 | h q[11]; 14 | h q[12]; 15 | h q[13]; 16 | h q[14]; 17 | cx q[11],q[7]; 18 | cx q[5],q[3]; 19 | cx q[2],q[1]; 20 | cx q[13],q[11]; 21 | cx q[9],q[7]; 22 | cx q[6],q[5]; 23 | cx q[4],q[3]; 24 | cx q[2],q[0]; 25 | cx q[14],q[13]; 26 | cx q[12],q[11]; 27 | cx q[10],q[9]; 28 | cx q[8],q[7]; 29 | cx q[5],q[1]; 30 | cx q[4],q[0]; 31 | cx q[6],q[2]; 32 | cx q[11],q[3]; 33 | cx q[9],q[1]; 34 | cx q[8],q[0]; 35 | cx q[13],q[5]; 36 | cx q[12],q[4]; 37 | cx q[10],q[2]; 38 | cx q[14],q[6]; 39 | h x_anc[0]; 40 | cx x_anc[0],q[5]; 41 | cx x_anc[0],q[10]; 42 | cx x_anc[0],q[12]; 43 | cx x_anc[1],q[1]; 44 | h x_anc[0]; 45 | h x_anc[1]; 46 | cx x_anc[1],q[3]; 47 | cx x_anc[1],q[8]; 48 | cx x_anc[1],q[14]; 49 | h x_anc[1]; 50 | measure x_anc[0] -> x_c[0]; 51 | measure x_anc[1] -> x_c[1]; 52 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 8 9 10 11 12 13 14 2 | CX 11 7 5 3 2 1 13 11 9 7 6 5 4 3 2 0 14 13 12 11 10 9 8 7 5 1 4 0 6 2 11 3 9 1 8 0 13 5 12 4 10 2 14 6 3 | H 15 4 | CX 15 5 15 10 15 12 16 1 5 | H 15 16 6 | CX 16 3 16 8 16 14 7 | H 16 8 | MR 15 16 9 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[2]; 5 | creg x_c[2]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[6]; 11 | h q[7]; 12 | h q[8]; 13 | h q[9]; 14 | h q[10]; 15 | h q[13]; 16 | h q[14]; 17 | cx q[10],q[0]; 18 | cx q[0],q[1]; 19 | cx q[7],q[1]; 20 | cx q[3],q[12]; 21 | cx q[6],q[10]; 22 | cx q[8],q[1]; 23 | cx q[4],q[11]; 24 | cx q[11],q[3]; 25 | cx q[13],q[11]; 26 | cx q[9],q[8]; 27 | cx q[14],q[0]; 28 | cx q[10],q[12]; 29 | cx q[3],q[1]; 30 | cx q[5],q[6]; 31 | cx q[0],q[11]; 32 | cx q[6],q[0]; 33 | cx q[7],q[0]; 34 | cx q[1],q[10]; 35 | cx q[11],q[1]; 36 | cx q[9],q[4]; 37 | cx q[2],q[4]; 38 | cx q[4],q[5]; 39 | h x_anc[0]; 40 | cx x_anc[0],q[0]; 41 | cx x_anc[0],q[9]; 42 | cx x_anc[0],q[10]; 43 | h x_anc[0]; 44 | measure x_anc[0] -> x_c[0]; 45 | h x_anc[1]; 46 | cx x_anc[1],q[4]; 47 | cx x_anc[1],q[8]; 48 | cx x_anc[1],q[11]; 49 | h x_anc[1]; 50 | measure x_anc[1] -> x_c[1]; 51 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 3 4 5 6 7 8 9 10 13 14 2 | CX 10 0 0 1 7 1 3 12 6 10 8 1 4 11 11 3 13 11 9 8 14 0 10 12 3 1 5 6 0 11 6 0 7 0 1 10 11 1 9 4 2 4 4 5 3 | H 15 4 | CX 15 0 15 9 15 10 5 | H 15 6 | MR 15 7 | H 16 8 | CX 16 4 16 8 16 11 9 | H 16 10 | MR 16 11 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | h q[8]; 9 | h q[9]; 10 | h q[10]; 11 | h q[11]; 12 | h q[12]; 13 | h q[13]; 14 | h q[14]; 15 | cx q[11],q[7]; 16 | cx q[5],q[3]; 17 | cx q[2],q[1]; 18 | cx q[13],q[11]; 19 | cx q[9],q[7]; 20 | cx q[6],q[5]; 21 | cx q[4],q[3]; 22 | cx q[2],q[0]; 23 | cx q[14],q[13]; 24 | cx q[12],q[11]; 25 | cx q[10],q[9]; 26 | cx q[8],q[7]; 27 | cx q[5],q[1]; 28 | cx q[4],q[0]; 29 | cx q[6],q[2]; 30 | cx q[11],q[3]; 31 | cx q[9],q[1]; 32 | cx q[8],q[0]; 33 | cx q[13],q[5]; 34 | cx q[12],q[4]; 35 | cx q[10],q[2]; 36 | cx q[14],q[6]; 37 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 8 9 10 11 12 13 14 2 | CX 11 7 5 3 2 1 13 11 9 7 6 5 4 3 2 0 14 13 12 11 10 9 8 7 5 1 4 0 6 2 11 3 9 1 8 0 13 5 12 4 10 2 14 6 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[7]; 11 | h q[8]; 12 | h q[9]; 13 | h q[12]; 14 | h q[13]; 15 | cx q[4],q[3]; 16 | cx q[2],q[11]; 17 | cx q[1],q[2]; 18 | cx q[3],q[10]; 19 | cx q[9],q[14]; 20 | cx q[14],q[4]; 21 | cx q[12],q[3]; 22 | cx q[11],q[9]; 23 | cx q[7],q[14]; 24 | cx q[0],q[12]; 25 | cx q[5],q[4]; 26 | cx q[2],q[3]; 27 | cx q[4],q[2]; 28 | cx q[8],q[4]; 29 | cx q[13],q[9]; 30 | cx q[3],q[8]; 31 | cx q[12],q[11]; 32 | cx q[8],q[11]; 33 | cx q[14],q[10]; 34 | cx q[6],q[10]; 35 | cx q[9],q[3]; 36 | cx q[10],q[11]; 37 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 5 6 7 8 9 12 13 2 | CX 4 3 2 11 1 2 3 10 9 14 14 4 12 3 11 9 7 14 0 12 5 4 2 3 4 2 8 4 13 9 3 8 12 11 8 11 14 10 6 10 9 3 10 11 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | h q[7]; 10 | cx q[7],q[11]; 11 | cx q[3],q[5]; 12 | cx q[1],q[2]; 13 | cx q[11],q[13]; 14 | cx q[7],q[9]; 15 | cx q[5],q[6]; 16 | cx q[3],q[4]; 17 | cx q[0],q[2]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[9],q[10]; 21 | cx q[7],q[8]; 22 | cx q[1],q[5]; 23 | cx q[0],q[4]; 24 | cx q[2],q[6]; 25 | cx q[3],q[11]; 26 | cx q[1],q[9]; 27 | cx q[0],q[8]; 28 | cx q[5],q[13]; 29 | cx q[4],q[12]; 30 | cx q[2],q[10]; 31 | cx q[6],q[14]; 32 | cx q[0],z_anc[0]; 33 | cx q[2],z_anc[0]; 34 | cx q[4],z_anc[0]; 35 | cx q[6],z_anc[0]; 36 | cx q[7],z_anc[0]; 37 | cx q[9],z_anc[0]; 38 | cx q[11],z_anc[0]; 39 | cx q[13],z_anc[0]; 40 | cx q[5],z_anc[1]; 41 | cx q[9],z_anc[1]; 42 | cx q[12],z_anc[1]; 43 | cx q[13],z_anc[1]; 44 | cx q[14],z_anc[1]; 45 | measure z_anc[0] -> z_c[0]; 46 | measure z_anc[1] -> z_c[1]; 47 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 7 2 | CX 7 11 3 5 1 2 11 13 7 9 5 6 3 4 0 2 13 14 11 12 9 10 7 8 1 5 0 4 2 6 3 11 1 9 0 8 5 13 4 12 2 10 6 14 0 15 2 15 4 15 6 15 7 15 9 15 11 15 13 15 5 16 9 16 12 16 13 16 14 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | h q[7]; 10 | cx q[7],q[11]; 11 | cx q[3],q[5]; 12 | cx q[1],q[2]; 13 | cx q[11],q[13]; 14 | cx q[7],q[9]; 15 | cx q[5],q[6]; 16 | cx q[3],q[4]; 17 | cx q[0],q[2]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[9],q[10]; 21 | cx q[7],q[8]; 22 | cx q[1],q[5]; 23 | cx q[0],q[4]; 24 | cx q[2],q[6]; 25 | cx q[3],q[11]; 26 | cx q[1],q[9]; 27 | cx q[0],q[8]; 28 | cx q[5],q[13]; 29 | cx q[4],q[12]; 30 | cx q[2],q[10]; 31 | cx q[6],q[14]; 32 | cx q[5],z_anc[0]; 33 | cx q[10],z_anc[0]; 34 | cx q[12],z_anc[0]; 35 | cx q[1],z_anc[1]; 36 | cx q[3],z_anc[1]; 37 | cx q[8],z_anc[1]; 38 | cx q[14],z_anc[1]; 39 | measure z_anc[0] -> z_c[0]; 40 | measure z_anc[1] -> z_c[1]; 41 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 7 2 | CX 7 11 3 5 1 2 11 13 7 9 5 6 3 4 0 2 13 14 11 12 9 10 7 8 1 5 0 4 2 6 3 11 1 9 0 8 5 13 4 12 2 10 6 14 5 15 10 15 12 15 1 16 3 16 8 16 14 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[11]; 9 | h q[12]; 10 | cx q[0],q[10]; 11 | cx q[1],q[0]; 12 | cx q[1],q[7]; 13 | cx q[12],q[3]; 14 | cx q[10],q[6]; 15 | cx q[1],q[8]; 16 | cx q[11],q[4]; 17 | cx q[3],q[11]; 18 | cx q[11],q[13]; 19 | cx q[8],q[9]; 20 | cx q[0],q[14]; 21 | cx q[12],q[10]; 22 | cx q[1],q[3]; 23 | cx q[6],q[5]; 24 | cx q[11],q[0]; 25 | cx q[0],q[6]; 26 | cx q[0],q[7]; 27 | cx q[10],q[1]; 28 | cx q[1],q[11]; 29 | cx q[4],q[9]; 30 | cx q[4],q[2]; 31 | cx q[5],q[4]; 32 | cx q[0],z_anc[0]; 33 | cx q[9],z_anc[0]; 34 | cx q[10],z_anc[0]; 35 | cx q[4],z_anc[1]; 36 | cx q[8],z_anc[1]; 37 | cx q[11],z_anc[1]; 38 | measure z_anc[0] -> z_c[0]; 39 | measure z_anc[1] -> z_c[1]; 40 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 11 12 2 | CX 0 10 1 0 1 7 12 3 10 6 1 8 11 4 3 11 11 13 8 9 0 14 12 10 1 3 6 5 11 0 0 6 0 7 10 1 1 11 4 9 4 2 5 4 0 15 9 15 10 15 4 16 8 16 11 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | h q[7]; 10 | cx q[7],q[11]; 11 | cx q[3],q[5]; 12 | cx q[1],q[2]; 13 | cx q[11],q[13]; 14 | cx q[7],q[9]; 15 | cx q[5],q[6]; 16 | cx q[3],q[4]; 17 | cx q[0],q[2]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[9],q[10]; 21 | cx q[7],q[8]; 22 | cx q[1],q[5]; 23 | cx q[0],q[4]; 24 | cx q[2],q[6]; 25 | cx q[3],q[11]; 26 | cx q[1],q[9]; 27 | cx q[0],q[8]; 28 | cx q[5],q[13]; 29 | cx q[4],q[12]; 30 | cx q[2],q[10]; 31 | cx q[6],q[14]; 32 | cx q[0],z_anc[0]; 33 | cx q[2],z_anc[0]; 34 | cx q[4],z_anc[0]; 35 | cx q[6],z_anc[0]; 36 | cx q[7],z_anc[0]; 37 | cx q[9],z_anc[0]; 38 | cx q[11],z_anc[0]; 39 | cx q[13],z_anc[0]; 40 | cx q[5],z_anc[1]; 41 | cx q[9],z_anc[1]; 42 | cx q[12],z_anc[1]; 43 | cx q[13],z_anc[1]; 44 | cx q[14],z_anc[1]; 45 | measure z_anc[0] -> z_c[0]; 46 | measure z_anc[1] -> z_c[1]; 47 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 7 2 | CX 7 11 3 5 1 2 11 13 7 9 5 6 3 4 0 2 13 14 11 12 9 10 7 8 1 5 0 4 2 6 3 11 1 9 0 8 5 13 4 12 2 10 6 14 0 15 2 15 4 15 6 15 7 15 9 15 11 15 13 15 5 16 9 16 12 16 13 16 14 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[0]; 5 | h q[1]; 6 | h q[11]; 7 | h q[12]; 8 | cx q[0],q[10]; 9 | cx q[1],q[0]; 10 | cx q[1],q[7]; 11 | cx q[12],q[3]; 12 | cx q[10],q[6]; 13 | cx q[1],q[8]; 14 | cx q[11],q[4]; 15 | cx q[3],q[11]; 16 | cx q[11],q[13]; 17 | cx q[8],q[9]; 18 | cx q[0],q[14]; 19 | cx q[12],q[10]; 20 | cx q[1],q[3]; 21 | cx q[6],q[5]; 22 | cx q[11],q[0]; 23 | cx q[0],q[6]; 24 | cx q[0],q[7]; 25 | cx q[10],q[1]; 26 | cx q[1],q[11]; 27 | cx q[4],q[9]; 28 | cx q[4],q[2]; 29 | cx q[5],q[4]; 30 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/hamming/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 11 12 2 | CX 0 10 1 0 1 7 12 3 10 6 1 8 11 4 3 11 11 13 8 9 0 14 12 10 1 3 6 5 11 0 0 6 0 7 10 1 1 11 4 9 4 2 5 4 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[7]; 11 | cx q[7],q[3]; 12 | cx q[5],q[1]; 13 | cx q[4],q[3]; 14 | cx q[2],q[1]; 15 | cx q[7],q[8]; 16 | cx q[6],q[3]; 17 | cx q[4],q[2]; 18 | cx q[1],q[0]; 19 | h x_anc[0]; 20 | cx x_anc[0],q[2]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 7 2 | CX 7 3 5 1 4 3 2 1 7 8 6 3 4 2 1 0 3 | H 9 4 | CX 9 2 9 5 5 | H 9 6 | MR 9 7 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[7]; 11 | cx q[7],q[3]; 12 | cx q[5],q[1]; 13 | cx q[4],q[3]; 14 | cx q[2],q[1]; 15 | cx q[7],q[8]; 16 | cx q[6],q[3]; 17 | cx q[4],q[2]; 18 | cx q[1],q[0]; 19 | h x_anc[0]; 20 | cx x_anc[0],q[2]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 7 2 | CX 7 3 5 1 4 3 2 1 7 8 6 3 4 2 1 0 3 | H 9 4 | CX 9 2 9 5 5 | H 9 6 | MR 9 7 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[0]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[7]; 11 | cx q[0],q[1]; 12 | cx q[4],q[2]; 13 | cx q[7],q[8]; 14 | cx q[3],q[6]; 15 | cx q[1],q[2]; 16 | cx q[5],q[4]; 17 | cx q[8],q[3]; 18 | cx q[4],q[6]; 19 | h x_anc[0]; 20 | cx x_anc[0],q[2]; 21 | cx x_anc[0],q[3]; 22 | cx x_anc[0],q[4]; 23 | h x_anc[0]; 24 | measure x_anc[0] -> x_c[0]; 25 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 7 2 | CX 0 1 4 2 7 8 3 6 1 2 5 4 8 3 4 6 3 | H 9 4 | CX 9 2 9 3 9 4 5 | H 9 6 | MR 9 7 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | h q[7]; 9 | cx q[7],q[3]; 10 | cx q[5],q[1]; 11 | cx q[4],q[3]; 12 | cx q[2],q[1]; 13 | cx q[7],q[8]; 14 | cx q[6],q[3]; 15 | cx q[4],q[2]; 16 | cx q[1],q[0]; 17 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 7 2 | CX 5 1 7 3 2 1 4 3 7 8 1 0 4 2 6 3 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[3]; 6 | h q[4]; 7 | h q[5]; 8 | h q[7]; 9 | cx q[0],q[1]; 10 | cx q[4],q[2]; 11 | cx q[7],q[8]; 12 | cx q[3],q[6]; 13 | cx q[1],q[2]; 14 | cx q[5],q[4]; 15 | cx q[8],q[3]; 16 | cx q[4],q[6]; 17 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 7 2 | CX 0 1 4 2 7 8 3 6 1 2 5 4 8 3 4 6 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[2]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[8]; 11 | cx q[0],q[4]; 12 | cx q[5],q[7]; 13 | cx q[0],q[3]; 14 | cx q[7],q[4]; 15 | cx q[6],q[3]; 16 | cx q[2],q[5]; 17 | cx q[0],q[1]; 18 | cx q[0],z_anc[0]; 19 | cx q[2],z_anc[0]; 20 | cx q[4],z_anc[0]; 21 | cx q[5],z_anc[0]; 22 | measure z_anc[0] -> z_c[0]; 23 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 5 6 2 | CX 5 8 0 4 5 7 0 3 7 4 6 3 2 5 0 1 0 9 2 9 4 9 5 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[2]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[8]; 11 | cx q[0],q[4]; 12 | cx q[5],q[7]; 13 | cx q[0],q[3]; 14 | cx q[7],q[4]; 15 | cx q[6],q[3]; 16 | cx q[2],q[5]; 17 | cx q[0],q[1]; 18 | cx q[0],z_anc[0]; 19 | cx q[4],z_anc[0]; 20 | cx q[8],z_anc[0]; 21 | measure z_anc[0] -> z_c[0]; 22 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 2 5 6 2 | CX 5 8 0 4 5 7 0 3 7 4 6 3 2 5 0 1 0 9 4 9 8 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[3]; 7 | h q[4]; 8 | h q[5]; 9 | h q[8]; 10 | cx q[8],q[0]; 11 | cx q[0],q[1]; 12 | cx q[3],q[6]; 13 | cx q[5],q[2]; 14 | cx q[4],q[8]; 15 | cx q[8],q[5]; 16 | cx q[1],q[3]; 17 | cx q[8],q[7]; 18 | cx q[1],z_anc[0]; 19 | cx q[4],z_anc[0]; 20 | cx q[7],z_anc[0]; 21 | measure z_anc[0] -> z_c[0]; 22 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 3 4 5 8 2 | CX 8 0 0 1 3 6 5 2 4 8 8 5 1 3 8 7 1 9 4 9 7 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[2]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[5],q[8]; 9 | cx q[0],q[4]; 10 | cx q[5],q[7]; 11 | cx q[0],q[3]; 12 | cx q[7],q[4]; 13 | cx q[6],q[3]; 14 | cx q[2],q[5]; 15 | cx q[0],q[1]; 16 | cx q[0],z_anc[0]; 17 | cx q[2],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[5],z_anc[0]; 20 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 5 6 2 | CX 0 4 5 8 0 3 5 7 0 1 2 5 6 3 7 4 0 9 2 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[3]; 5 | h q[4]; 6 | h q[5]; 7 | h q[8]; 8 | cx q[8],q[0]; 9 | cx q[0],q[1]; 10 | cx q[3],q[6]; 11 | cx q[5],q[2]; 12 | cx q[4],q[8]; 13 | cx q[8],q[5]; 14 | cx q[1],q[3]; 15 | cx q[8],q[7]; 16 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d3/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 3 4 5 8 2 | CX 8 0 0 1 3 6 5 2 4 8 8 5 1 3 8 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d5/zero_ft_heuristic_naive.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 5 7 11 14 15 18 21 24 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 2 | CX 2 3 1 6 4 9 5 10 7 13 11 17 14 19 15 20 18 23 1 2 4 3 7 8 11 12 14 13 18 22 24 23 0 1 6 7 8 12 11 16 18 17 21 22 2 26 4 27 5 6 9 8 10 11 15 16 19 18 20 21 0 25 3 26 2 38 4 39 1 25 7 26 9 27 0 37 3 38 5 25 8 26 1 37 49 0 3 | MR 27 4 | CX 6 25 5 28 8 30 49 1 61 0 5 | MR 26 6 | CX 10 28 6 29 9 30 5 37 7 | H 49 8 | CX 50 1 9 | MR 25 10 | CX 7 29 13 30 10 31 6 37 9 39 5 40 61 1 50 73 11 | MR 28 49 12 | CX 11 29 14 30 7 38 10 40 6 41 50 2 53 5 13 | H 61 14 | CX 62 1 15 | MR 37 39 16 | CX 12 29 11 31 14 33 8 38 7 41 10 43 50 6 51 2 65 5 53 75 62 81 17 | MR 30 40 61 18 | CX 15 31 12 32 19 33 11 41 8 42 51 3 53 6 62 2 50 73 65 83 19 | MR 29 38 20 | CX 16 31 13 32 15 34 12 41 9 42 11 43 50 7 21 | H 51 22 | CX 52 3 53 10 62 6 63 2 23 | MR 33 73 24 | CX 17 32 20 34 16 35 13 42 15 43 12 44 25 | H 50 26 | CX 54 7 63 3 65 6 52 74 53 75 62 81 27 | MR 31 41 51 28 | CX 18 32 17 35 14 42 16 43 13 44 15 46 52 4 53 11 62 7 29 | H 63 30 | CX 64 3 65 10 54 76 31 | MR 34 50 75 81 32 | CX 21 35 18 36 17 44 14 45 20 46 16 47 52 8 33 | H 53 34 | CX 55 11 57 15 35 | H 62 36 | CX 66 7 64 82 65 83 37 | MR 32 42 43 63 38 | CX 22 35 19 36 18 44 17 47 54 8 64 4 65 11 69 15 52 74 55 77 57 79 66 84 39 | MR 46 53 62 83 40 | CX 23 36 19 45 21 47 18 48 52 9 54 12 64 8 41 | H 65 42 | CX 67 11 69 87 43 | MR 35 44 74 44 | CX 24 36 22 47 19 48 45 | H 52 46 | CX 55 12 66 8 54 76 64 82 67 85 47 | MR 45 65 48 | CX 23 48 54 13 55 16 64 9 66 12 49 | MR 36 47 52 76 82 50 | CX 24 48 51 | H 54 52 | CX 56 13 57 16 53 | H 64 54 | CX 67 12 55 77 66 84 55 17 57 20 66 13 67 16 56 78 55 | MR 48 54 64 77 84 56 | H 55 57 | CX 56 14 58 17 58 | H 66 59 | CX 68 13 69 16 57 79 67 85 56 18 57 21 67 17 69 20 58 80 68 86 60 | MR 55 66 79 85 61 | H 57 62 | CX 58 18 59 21 63 | H 67 64 | CX 68 14 70 17 56 78 69 87 56 19 58 22 68 18 69 21 70 88 65 | MR 57 67 78 87 66 | H 56 67 | CX 59 22 68 | H 69 69 | CX 70 18 71 21 58 80 68 86 58 23 70 | H 59 71 | CX 68 19 70 22 72 | MR 56 69 80 86 73 | H 58 74 | CX 60 23 75 | H 68 76 | CX 71 22 70 88 77 | MR 59 78 | CX 60 24 70 23 79 | H 71 80 | MR 58 68 88 81 | H 60 70 82 | CX 72 23 83 | MR 71 84 | CX 72 24 85 | MR 60 70 86 | H 72 87 | MR 72 88 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d5/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 5 7 11 14 15 18 21 24 30 31 32 33 2 | CX 2 3 1 6 4 9 5 10 7 13 11 17 14 19 15 20 18 23 1 2 4 3 7 8 11 12 14 13 18 22 24 23 0 1 6 7 8 12 11 16 18 17 21 22 2 25 5 6 9 8 10 11 15 16 19 18 20 21 3 25 2 27 30 1 6 25 3 27 31 1 30 34 8 25 7 27 6 28 30 3 31 38 10 25 8 26 7 28 31 3 30 35 13 25 9 26 8 27 11 28 30 6 16 25 13 26 30 8 31 6 3 | MR 27 4 | CX 17 25 15 26 13 28 30 36 31 38 19 25 16 26 30 11 31 7 5 | MR 38 6 | CX 21 25 17 26 16 29 30 13 7 | H 31 8 | CX 32 7 22 25 18 26 17 28 30 37 32 39 9 | MR 31 10 | CX 18 28 17 29 30 16 32 8 11 | MR 25 26 12 | CX 21 29 30 36 32 40 13 | MR 28 14 | CX 22 29 30 18 32 11 15 | MR 36 16 | CX 32 13 30 34 17 | MR 29 18 | CX 30 21 32 39 19 | MR 34 20 | CX 32 16 30 37 21 | MR 39 22 | CX 30 35 32 40 23 | MR 37 24 | CX 30 23 32 17 25 | MR 35 40 26 | H 30 32 27 | CX 33 17 33 41 28 | MR 30 32 29 | CX 33 18 33 21 33 41 33 23 30 | MR 41 31 | H 33 32 | MR 33 33 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d5/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[25]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[7]; 10 | h q[11]; 11 | h q[14]; 12 | h q[15]; 13 | h q[18]; 14 | h q[21]; 15 | h q[24]; 16 | cx q[18],q[23]; 17 | cx q[11],q[17]; 18 | cx q[7],q[13]; 19 | cx q[18],q[22]; 20 | cx q[11],q[12]; 21 | cx q[7],q[8]; 22 | cx q[2],q[3]; 23 | cx q[1],q[6]; 24 | cx q[21],q[22]; 25 | cx q[18],q[17]; 26 | cx q[15],q[20]; 27 | cx q[14],q[19]; 28 | cx q[11],q[16]; 29 | cx q[8],q[12]; 30 | cx q[6],q[7]; 31 | cx q[5],q[10]; 32 | cx q[4],q[9]; 33 | cx q[1],q[2]; 34 | cx q[24],q[23]; 35 | cx q[20],q[21]; 36 | cx q[19],q[18]; 37 | cx q[15],q[16]; 38 | cx q[14],q[13]; 39 | cx q[10],q[11]; 40 | cx q[9],q[8]; 41 | cx q[5],q[6]; 42 | cx q[4],q[3]; 43 | cx q[0],q[1]; 44 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/rotated_surface_d5/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 5 7 11 14 15 18 21 24 2 | CX 2 3 1 6 4 9 5 10 7 13 11 17 14 19 15 20 18 23 1 2 4 3 7 8 11 12 14 13 18 22 24 23 0 1 6 7 8 12 11 16 18 17 21 22 5 6 9 8 10 11 15 16 19 18 20 21 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[5]; 6 | h q[8]; 7 | cx q[8],q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[7]; 11 | cx q[3],q[4]; 12 | cx q[0],q[1]; 13 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 5 8 2 | CX 2 0 5 3 8 6 0 1 3 4 6 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[5]; 6 | h q[8]; 7 | cx q[8],q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[7]; 11 | cx q[3],q[4]; 12 | cx q[0],q[1]; 13 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 5 8 2 | CX 2 0 5 3 8 6 0 1 3 4 6 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[4]; 6 | h q[6]; 7 | cx q[2],q[0]; 8 | cx q[4],q[5]; 9 | cx q[6],q[7]; 10 | cx q[5],q[3]; 11 | cx q[7],q[8]; 12 | cx q[2],q[1]; 13 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 2 | CX 2 0 4 5 6 7 2 1 5 3 7 8 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[5]; 6 | h q[8]; 7 | cx q[8],q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[7]; 11 | cx q[3],q[4]; 12 | cx q[0],q[1]; 13 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 5 8 2 | CX 2 0 5 3 8 6 0 1 3 4 6 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[4]; 6 | h q[6]; 7 | cx q[2],q[0]; 8 | cx q[4],q[5]; 9 | cx q[6],q[7]; 10 | cx q[5],q[3]; 11 | cx q[7],q[8]; 12 | cx q[2],q[1]; 13 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 2 | CX 2 0 4 5 6 7 2 1 5 3 7 8 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[2]; 8 | cx q[2],q[6]; 9 | cx q[0],q[3]; 10 | cx q[6],q[8]; 11 | cx q[3],q[4]; 12 | cx q[2],q[0]; 13 | cx q[6],q[7]; 14 | cx q[4],q[5]; 15 | cx q[3],q[2]; 16 | cx q[0],q[1]; 17 | cx q[3],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[1],z_anc[1]; 20 | cx q[3],z_anc[1]; 21 | cx q[7],z_anc[1]; 22 | measure z_anc[0] -> z_c[0]; 23 | measure z_anc[1] -> z_c[1]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 2 | CX 0 3 2 6 2 0 3 4 6 8 0 1 3 2 4 5 6 7 3 9 1 10 4 9 3 10 7 10 3 | MR 9 10 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[2]; 8 | cx q[2],q[6]; 9 | cx q[0],q[3]; 10 | cx q[6],q[8]; 11 | cx q[3],q[4]; 12 | cx q[2],q[0]; 13 | cx q[6],q[7]; 14 | cx q[4],q[5]; 15 | cx q[3],q[2]; 16 | cx q[0],q[1]; 17 | cx q[1],z_anc[0]; 18 | cx q[2],z_anc[0]; 19 | cx q[2],z_anc[1]; 20 | cx q[5],z_anc[1]; 21 | cx q[7],z_anc[1]; 22 | measure z_anc[0] -> z_c[0]; 23 | measure z_anc[1] -> z_c[1]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 2 2 | CX 0 3 2 6 2 0 3 4 6 8 0 1 3 2 4 5 6 7 1 9 2 9 2 10 3 | MR 9 4 | CX 5 10 7 10 5 | MR 10 6 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[2]; 7 | h q[7]; 8 | cx q[7],q[4]; 9 | cx q[2],q[7]; 10 | cx q[2],q[0]; 11 | cx q[4],q[5]; 12 | cx q[7],q[8]; 13 | cx q[4],q[3]; 14 | cx q[7],q[6]; 15 | cx q[0],q[1]; 16 | cx q[1],z_anc[0]; 17 | cx q[4],z_anc[0]; 18 | cx q[7],z_anc[0]; 19 | measure z_anc[0] -> z_c[0]; 20 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 7 2 | CX 7 4 4 5 2 7 2 0 4 3 7 8 0 1 7 6 1 9 4 9 7 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[2]; 6 | cx q[2],q[6]; 7 | cx q[0],q[3]; 8 | cx q[6],q[8]; 9 | cx q[3],q[4]; 10 | cx q[2],q[0]; 11 | cx q[6],q[7]; 12 | cx q[4],q[5]; 13 | cx q[3],q[2]; 14 | cx q[0],q[1]; 15 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 2 | CX 0 3 2 6 2 0 3 4 6 8 0 1 3 2 4 5 6 7 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[7]; 6 | cx q[7],q[4]; 7 | cx q[2],q[7]; 8 | cx q[2],q[0]; 9 | cx q[4],q[5]; 10 | cx q[7],q[8]; 11 | cx q[4],q[3]; 12 | cx q[7],q[6]; 13 | cx q[0],q[1]; 14 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/shor/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 7 2 | CX 7 4 4 5 2 7 2 0 4 3 7 8 0 1 7 6 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[3]; 11 | cx q[2],q[0]; 12 | cx q[6],q[5]; 13 | cx q[4],q[3]; 14 | cx q[0],q[1]; 15 | cx q[6],q[2]; 16 | cx q[5],q[1]; 17 | cx q[4],q[0]; 18 | h x_anc[0]; 19 | cx x_anc[0],q[2]; 20 | cx x_anc[0],q[4]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 2 | CX 5 3 2 0 6 5 4 3 0 1 6 2 5 1 4 0 3 | H 7 4 | CX 7 2 7 4 7 5 5 | H 7 6 | MR 7 7 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[3]; 11 | cx q[2],q[0]; 12 | cx q[6],q[5]; 13 | cx q[4],q[3]; 14 | cx q[0],q[1]; 15 | cx q[6],q[2]; 16 | cx q[5],q[1]; 17 | cx q[4],q[0]; 18 | h x_anc[0]; 19 | cx x_anc[0],q[2]; 20 | cx x_anc[0],q[4]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 2 | CX 5 3 2 0 6 5 4 3 0 1 6 2 5 1 4 0 3 | H 7 4 | CX 7 2 7 4 7 5 5 | H 7 6 | MR 7 7 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[0]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | cx q[3],q[1]; 11 | cx q[4],q[3]; 12 | cx q[4],q[6]; 13 | cx q[0],q[2]; 14 | cx q[5],q[0]; 15 | cx q[5],q[6]; 16 | cx q[2],q[3]; 17 | cx q[3],q[5]; 18 | h x_anc[0]; 19 | cx x_anc[0],q[2]; 20 | cx x_anc[0],q[4]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 2 | CX 3 1 4 3 4 6 0 2 5 0 5 6 2 3 3 5 3 | H 7 4 | CX 7 2 7 4 7 5 5 | H 7 6 | MR 7 7 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[2]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[5]; 11 | cx q[4],q[3]; 12 | cx q[0],q[1]; 13 | cx q[6],q[2]; 14 | cx q[5],q[1]; 15 | cx q[4],q[0]; 16 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 2 | CX 5 3 2 0 6 5 4 3 0 1 6 2 5 1 4 0 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[3]; 6 | h q[4]; 7 | h q[5]; 8 | cx q[3],q[1]; 9 | cx q[4],q[3]; 10 | cx q[4],q[6]; 11 | cx q[0],q[2]; 12 | cx q[5],q[0]; 13 | cx q[5],q[6]; 14 | cx q[2],q[3]; 15 | cx q[3],q[5]; 16 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 2 | CX 3 1 4 3 4 6 0 2 5 0 5 6 2 3 3 5 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | cx q[3],q[5]; 10 | cx q[0],q[2]; 11 | cx q[5],q[6]; 12 | cx q[3],q[4]; 13 | cx q[1],q[0]; 14 | cx q[2],q[6]; 15 | cx q[1],q[5]; 16 | cx q[0],q[4]; 17 | cx q[2],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[5],z_anc[0]; 20 | measure z_anc[0] -> z_c[0]; 21 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 2 | CX 3 5 0 2 5 6 3 4 1 0 2 6 1 5 0 4 2 7 4 7 5 7 3 | MR 7 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | cx q[3],q[5]; 10 | cx q[0],q[2]; 11 | cx q[5],q[6]; 12 | cx q[3],q[4]; 13 | cx q[1],q[0]; 14 | cx q[2],q[6]; 15 | cx q[1],q[5]; 16 | cx q[0],q[4]; 17 | cx q[1],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[6],z_anc[0]; 20 | measure z_anc[0] -> z_c[0]; 21 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 2 | CX 3 5 0 2 5 6 3 4 1 0 2 6 1 5 0 4 1 7 4 7 6 7 3 | MR 7 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[3]; 8 | h q[5]; 9 | cx q[3],q[1]; 10 | cx q[5],q[4]; 11 | cx q[0],q[2]; 12 | cx q[4],q[3]; 13 | cx q[1],q[0]; 14 | cx q[1],q[6]; 15 | cx q[2],q[4]; 16 | cx q[4],q[6]; 17 | cx q[2],z_anc[0]; 18 | cx q[3],z_anc[0]; 19 | cx q[6],z_anc[0]; 20 | measure z_anc[0] -> z_c[0]; 21 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 5 2 | CX 3 1 5 4 0 2 4 3 1 0 1 6 2 4 4 6 2 7 3 7 6 7 3 | MR 7 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[1]; 6 | h q[3]; 7 | cx q[3],q[5]; 8 | cx q[0],q[2]; 9 | cx q[5],q[6]; 10 | cx q[3],q[4]; 11 | cx q[1],q[0]; 12 | cx q[2],q[6]; 13 | cx q[1],q[5]; 14 | cx q[0],q[4]; 15 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 2 | CX 3 5 0 2 5 6 3 4 1 0 2 6 1 5 0 4 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[3]; 6 | h q[5]; 7 | cx q[3],q[1]; 8 | cx q[5],q[4]; 9 | cx q[0],q[2]; 10 | cx q[4],q[3]; 11 | cx q[1],q[0]; 12 | cx q[1],q[6]; 13 | cx q[2],q[4]; 14 | cx q[4],q[6]; 15 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/steane/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 5 2 | CX 3 1 5 4 0 2 4 3 1 0 1 6 2 4 4 6 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[6]; 9 | h q[10]; 10 | h q[13]; 11 | cx q[13],q[11]; 12 | cx q[11],q[12]; 13 | cx q[6],q[5]; 14 | cx q[10],q[3]; 15 | cx q[4],q[1]; 16 | cx q[11],q[9]; 17 | cx q[12],q[8]; 18 | cx q[4],q[7]; 19 | cx q[3],q[5]; 20 | cx q[2],q[1]; 21 | cx q[7],q[14]; 22 | cx q[6],q[13]; 23 | cx q[2],q[9]; 24 | cx q[1],q[8]; 25 | cx q[3],q[0]; 26 | cx q[5],q[4]; 27 | cx q[13],q[14]; 28 | cx q[9],q[10]; 29 | cx q[1],q[0]; 30 | cx q[4],q[12]; 31 | cx q[6],q[7]; 32 | cx q[5],q[11]; 33 | cx q[2],q[3]; 34 | h x_anc[0]; 35 | cx x_anc[0],q[1]; 36 | cx x_anc[0],q[3]; 37 | cx x_anc[0],q[5]; 38 | cx x_anc[0],q[7]; 39 | cx x_anc[0],q[9]; 40 | cx x_anc[0],q[12]; 41 | cx x_anc[0],q[13]; 42 | h x_anc[0]; 43 | measure x_anc[0] -> x_c[0]; 44 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 10 13 15 2 | CX 4 1 6 5 10 3 13 11 2 1 3 5 4 7 11 12 6 13 3 0 5 4 11 9 12 8 7 14 6 7 1 8 2 9 5 11 4 12 13 14 1 0 2 3 9 10 15 1 15 3 15 5 15 7 15 9 15 12 15 13 3 | H 15 4 | MR 15 5 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[6]; 9 | h q[10]; 10 | h q[13]; 11 | cx q[13],q[11]; 12 | cx q[11],q[12]; 13 | cx q[6],q[5]; 14 | cx q[10],q[3]; 15 | cx q[4],q[1]; 16 | cx q[11],q[9]; 17 | cx q[12],q[8]; 18 | cx q[4],q[7]; 19 | cx q[3],q[5]; 20 | cx q[2],q[1]; 21 | cx q[7],q[14]; 22 | cx q[6],q[13]; 23 | cx q[2],q[9]; 24 | cx q[1],q[8]; 25 | cx q[3],q[0]; 26 | cx q[5],q[4]; 27 | cx q[13],q[14]; 28 | cx q[9],q[10]; 29 | cx q[1],q[0]; 30 | cx q[4],q[12]; 31 | cx q[6],q[7]; 32 | cx q[5],q[11]; 33 | cx q[2],q[3]; 34 | h x_anc[0]; 35 | cx x_anc[0],q[1]; 36 | cx x_anc[0],q[3]; 37 | cx x_anc[0],q[5]; 38 | cx x_anc[0],q[7]; 39 | cx x_anc[0],q[9]; 40 | cx x_anc[0],q[12]; 41 | cx x_anc[0],q[13]; 42 | h x_anc[0]; 43 | measure x_anc[0] -> x_c[0]; 44 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 10 13 15 2 | CX 4 1 6 5 10 3 13 11 2 1 3 5 4 7 11 12 6 13 3 0 5 4 11 9 12 8 7 14 6 7 1 8 2 9 5 11 4 12 13 14 1 0 2 3 9 10 15 1 15 3 15 5 15 7 15 9 15 12 15 13 3 | H 15 4 | MR 15 5 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[4]; 6 | h q[6]; 7 | h q[10]; 8 | h q[13]; 9 | cx q[13],q[11]; 10 | cx q[11],q[12]; 11 | cx q[6],q[5]; 12 | cx q[10],q[3]; 13 | cx q[4],q[1]; 14 | cx q[11],q[9]; 15 | cx q[12],q[8]; 16 | cx q[4],q[7]; 17 | cx q[3],q[5]; 18 | cx q[2],q[1]; 19 | cx q[7],q[14]; 20 | cx q[6],q[13]; 21 | cx q[2],q[9]; 22 | cx q[1],q[8]; 23 | cx q[3],q[0]; 24 | cx q[5],q[4]; 25 | cx q[13],q[14]; 26 | cx q[9],q[10]; 27 | cx q[1],q[0]; 28 | cx q[4],q[12]; 29 | cx q[6],q[7]; 30 | cx q[5],q[11]; 31 | cx q[2],q[3]; 32 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 10 13 2 | CX 4 1 6 5 10 3 13 11 2 1 3 5 4 7 11 12 6 13 3 0 5 4 11 9 12 8 7 14 6 7 1 8 2 9 5 11 4 12 13 14 1 0 2 3 9 10 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[4]; 10 | cx q[4],q[11]; 11 | cx q[2],q[9]; 12 | cx q[1],q[8]; 13 | cx q[11],q[13]; 14 | cx q[9],q[10]; 15 | cx q[4],q[6]; 16 | cx q[2],q[3]; 17 | cx q[0],q[1]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[8],q[9]; 21 | cx q[6],q[7]; 22 | cx q[4],q[5]; 23 | cx q[0],q[3]; 24 | cx q[1],q[2]; 25 | cx q[10],q[13]; 26 | cx q[8],q[12]; 27 | cx q[0],q[7]; 28 | cx q[9],q[11]; 29 | cx q[3],q[6]; 30 | cx q[1],q[4]; 31 | cx q[2],q[5]; 32 | cx q[3],z_anc[0]; 33 | cx q[4],z_anc[0]; 34 | cx q[11],z_anc[0]; 35 | measure z_anc[0] -> z_c[0]; 36 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 2 | CX 1 8 2 9 4 11 0 1 2 3 4 6 9 10 11 13 1 2 0 3 4 5 6 7 8 9 11 12 13 14 1 4 2 5 3 6 0 7 9 11 8 12 10 13 3 15 4 15 11 15 3 | MR 15 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[4]; 10 | cx q[4],q[11]; 11 | cx q[2],q[9]; 12 | cx q[1],q[8]; 13 | cx q[11],q[13]; 14 | cx q[9],q[10]; 15 | cx q[4],q[6]; 16 | cx q[2],q[3]; 17 | cx q[0],q[1]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[8],q[9]; 21 | cx q[6],q[7]; 22 | cx q[4],q[5]; 23 | cx q[0],q[3]; 24 | cx q[1],q[2]; 25 | cx q[10],q[13]; 26 | cx q[8],q[12]; 27 | cx q[0],q[7]; 28 | cx q[9],q[11]; 29 | cx q[3],q[6]; 30 | cx q[1],q[4]; 31 | cx q[2],q[5]; 32 | cx q[0],z_anc[0]; 33 | cx q[5],z_anc[0]; 34 | cx q[11],z_anc[0]; 35 | measure z_anc[0] -> z_c[0]; 36 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 2 | CX 1 8 2 9 4 11 0 1 2 3 4 6 9 10 11 13 1 2 0 3 4 5 6 7 8 9 11 12 13 14 1 4 2 5 3 6 0 7 9 11 8 12 10 13 0 15 5 15 11 15 3 | MR 15 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[2]; 7 | h q[6]; 8 | h q[7]; 9 | h q[14]; 10 | cx q[6],q[9]; 11 | cx q[7],q[11]; 12 | cx q[2],q[11]; 13 | cx q[14],q[3]; 14 | cx q[3],q[1]; 15 | cx q[11],q[6]; 16 | cx q[7],q[12]; 17 | cx q[9],q[1]; 18 | cx q[14],q[7]; 19 | cx q[2],q[0]; 20 | cx q[7],q[13]; 21 | cx q[0],q[8]; 22 | cx q[6],q[14]; 23 | cx q[11],q[7]; 24 | cx q[13],q[5]; 25 | cx q[1],q[13]; 26 | cx q[7],q[10]; 27 | cx q[6],q[7]; 28 | cx q[11],q[4]; 29 | cx q[3],q[11]; 30 | cx q[9],q[2]; 31 | cx q[1],q[8]; 32 | cx q[1],z_anc[0]; 33 | cx q[2],z_anc[0]; 34 | cx q[10],z_anc[0]; 35 | measure z_anc[0] -> z_c[0]; 36 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 6 7 14 2 | CX 6 9 7 11 14 3 3 1 2 11 7 12 2 0 9 1 11 6 14 7 0 8 9 2 7 13 6 14 11 7 13 5 7 10 11 4 1 13 6 7 1 8 3 11 1 15 2 15 10 15 3 | MR 15 4 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[6]; 6 | h q[7]; 7 | h q[14]; 8 | cx q[6],q[9]; 9 | cx q[7],q[11]; 10 | cx q[2],q[11]; 11 | cx q[14],q[3]; 12 | cx q[3],q[1]; 13 | cx q[11],q[6]; 14 | cx q[7],q[12]; 15 | cx q[9],q[1]; 16 | cx q[14],q[7]; 17 | cx q[2],q[0]; 18 | cx q[7],q[13]; 19 | cx q[0],q[8]; 20 | cx q[6],q[14]; 21 | cx q[11],q[7]; 22 | cx q[13],q[5]; 23 | cx q[1],q[13]; 24 | cx q[7],q[10]; 25 | cx q[6],q[7]; 26 | cx q[11],q[4]; 27 | cx q[3],q[11]; 28 | cx q[9],q[2]; 29 | cx q[1],q[8]; 30 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 6 7 14 2 | CX 6 9 7 11 14 3 3 1 2 11 7 12 2 0 9 1 11 6 14 7 0 8 9 2 7 13 6 14 11 7 13 5 7 10 11 4 1 13 6 7 1 8 3 11 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[6]; 6 | h q[7]; 7 | h q[14]; 8 | cx q[6],q[9]; 9 | cx q[7],q[11]; 10 | cx q[2],q[11]; 11 | cx q[14],q[3]; 12 | cx q[3],q[1]; 13 | cx q[11],q[6]; 14 | cx q[7],q[12]; 15 | cx q[9],q[1]; 16 | cx q[14],q[7]; 17 | cx q[2],q[0]; 18 | cx q[7],q[13]; 19 | cx q[0],q[8]; 20 | cx q[6],q[14]; 21 | cx q[11],q[7]; 22 | cx q[13],q[5]; 23 | cx q[1],q[13]; 24 | cx q[7],q[10]; 25 | cx q[6],q[7]; 26 | cx q[11],q[4]; 27 | cx q[3],q[11]; 28 | cx q[9],q[2]; 29 | cx q[1],q[8]; 30 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/circuits/tetrahedral/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 6 7 14 2 | CX 6 9 7 11 14 3 3 1 2 11 7 12 2 0 9 1 11 6 14 7 0 8 9 2 7 13 6 14 11 7 13 5 7 10 11 4 1 13 6 7 1 8 3 11 3 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/luts/decoder_488_7.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/scripts/ft_stateprep/eval/luts/decoder_488_7.pickle -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/run_d7.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Estimate logical error rate for d=7 square-octagon color code zero state preparation circuit for a given physical error rate.""" 9 | 10 | from __future__ import annotations 11 | 12 | import argparse 13 | import pickle # noqa: S403 14 | from pathlib import Path 15 | 16 | from qiskit import QuantumCircuit 17 | 18 | from mqt.qecc.circuit_synthesis import ( 19 | NoisyNDFTStatePrepSimulator, 20 | ) 21 | from mqt.qecc.codes import SquareOctagonColorCode 22 | 23 | 24 | def main() -> None: 25 | """Run the simulation.""" 26 | parser = argparse.ArgumentParser(description="Estimate logical error rate for CSS state preparation circuits") 27 | parser.add_argument("-p", "--p_error", type=float, help="Physical error rate") 28 | parser.add_argument("-p_idle_factor", "--p_idle_factor", type=float, default=0.01, help="Idling error rate") 29 | parser.add_argument("--naive_ver", default=False, action="store_true", help="Use naive verification") 30 | parser.add_argument("-n", "--n_errors", type=int, default=500, help="Number of errors to sample") 31 | 32 | args = parser.parse_args() 33 | code = SquareOctagonColorCode(7) 34 | prefix = (Path(__file__) / "../circuits/cc_4_8_8_d7/").resolve() 35 | circ_name = "zero_ft_heuristic_mixed.qasm" if not args.naive_ver else "zero_ft_naive.qasm" 36 | qc = QuantumCircuit.from_qasm_file(prefix / circ_name) 37 | 38 | lut_path = (Path(__file__) / "../luts/decoder_488_7.pickle").resolve() 39 | with lut_path.open("rb") as f: 40 | lut = pickle.load(f) # noqa: S301 41 | sim = NoisyNDFTStatePrepSimulator(qc, code, decoder=lut, p=args.p_error, p_idle=args.p_idle_factor * args.p_error) 42 | res = sim.logical_error_rate(min_errors=args.n_errors) 43 | print(",".join([str(x) for x in [args.p_error, *res]])) 44 | 45 | 46 | if __name__ == "__main__": 47 | main() 48 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval/run_eval_on_code.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 3 | # All rights reserved. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # 7 | # Licensed under the MIT License 8 | 9 | # Description: Estimate logical error rates for given code in parallel. Results are saved in a csv file described by the first argument. All other arguments are passed to the python script. 10 | 11 | declare -a p=("0.00005" "0.00006" "0.00007" "0.00008" "0.00009" "0.0001" "0.0002" "0.0003" "0.0004" "0.0005" "0.0006" "0.0007" "0.0008" "0.0009" "0.001" "0.002" "0.003" "0.004" "0.005" "0.006" "0.007" "0.008" "0.009" "0.01" "0.02" "0.03" "0.04" "0.05" "0.06" "0.07" "0.08" "0.09" "0.1" "0.2" "0.3" "0.4" "0.5") 12 | 13 | echo "p p_l acceptance errors runs" > "$1.csv" 14 | 15 | run_and_write() { 16 | local res=$(python estimate_logical_error_rate.py ${@:2:$#-2} "-p" "${@: -1}") 17 | local line="${@: -1} ${res}" 18 | (flock -e 200 echo $line >> "$1.csv") 200>lock 19 | } 20 | 21 | export -f run_and_write 22 | 23 | parallel --load 16 --link run_and_write $@ ::: ${p[@]} 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/11_1_3/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[11]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | cx q[4],q[9]; 10 | cx q[4],q[7]; 11 | cx q[3],q[5]; 12 | cx q[4],q[10]; 13 | cx q[2],q[9]; 14 | cx q[1],q[7]; 15 | cx q[0],q[5]; 16 | cx q[3],q[6]; 17 | cx q[1],q[10]; 18 | cx q[9],q[5]; 19 | cx q[7],q[8]; 20 | cx q[1],q[9]; 21 | cx q[0],q[7]; 22 | cx q[10],q[6]; 23 | cx q[5],q[8]; 24 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/16_2_4/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[6]; 11 | cx q[5],q[12]; 12 | cx q[4],q[12]; 13 | cx q[2],q[10]; 14 | cx q[6],q[7]; 15 | cx q[5],q[8]; 16 | cx q[3],q[11]; 17 | cx q[1],q[9]; 18 | cx q[0],q[10]; 19 | cx q[12],q[13]; 20 | cx q[6],q[11]; 21 | cx q[4],q[7]; 22 | cx q[3],q[8]; 23 | cx q[13],q[14]; 24 | cx q[12],q[9]; 25 | cx q[10],q[15]; 26 | cx q[6],q[12]; 27 | cx q[5],q[11]; 28 | cx q[4],q[8]; 29 | cx q[3],q[7]; 30 | cx q[2],q[13]; 31 | cx q[1],q[15]; 32 | cx q[0],q[14]; 33 | cx q[9],q[10]; 34 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/carbon/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[7]; 9 | cx q[7],q[11]; 10 | cx q[1],q[5]; 11 | cx q[7],q[9]; 12 | cx q[4],q[10]; 13 | cx q[2],q[8]; 14 | cx q[1],q[3]; 15 | cx q[0],q[6]; 16 | cx q[10],q[9]; 17 | cx q[8],q[7]; 18 | cx q[6],q[11]; 19 | cx q[4],q[3]; 20 | cx q[2],q[1]; 21 | cx q[0],q[5]; 22 | cx q[11],q[10]; 23 | cx q[9],q[8]; 24 | cx q[7],q[6]; 25 | cx q[5],q[4]; 26 | cx q[3],q[2]; 27 | cx q[1],q[0]; 28 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/carbon/zero_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | h q[1]; 5 | h q[2]; 6 | h q[4]; 7 | h q[6]; 8 | h q[8]; 9 | cx q[1],q[7]; 10 | cx q[6],q[9]; 11 | cx q[2],q[5]; 12 | cx q[7],q[0]; 13 | cx q[7],q[6]; 14 | cx q[4],q[10]; 15 | cx q[5],q[11]; 16 | cx q[9],q[3]; 17 | cx q[10],q[1]; 18 | cx q[8],q[5]; 19 | cx q[7],q[2]; 20 | cx q[8],q[4]; 21 | cx q[8],q[9]; 22 | cx q[2],q[8]; 23 | cx q[9],q[0]; 24 | cx q[4],q[7]; 25 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/hamming/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[0]; 5 | h q[1]; 6 | h q[3]; 7 | h q[7]; 8 | cx q[7],q[11]; 9 | cx q[3],q[5]; 10 | cx q[1],q[2]; 11 | cx q[11],q[13]; 12 | cx q[7],q[9]; 13 | cx q[5],q[6]; 14 | cx q[3],q[4]; 15 | cx q[0],q[2]; 16 | cx q[13],q[14]; 17 | cx q[11],q[12]; 18 | cx q[9],q[10]; 19 | cx q[7],q[8]; 20 | cx q[1],q[5]; 21 | cx q[0],q[4]; 22 | cx q[2],q[6]; 23 | cx q[3],q[11]; 24 | cx q[1],q[9]; 25 | cx q[0],q[8]; 26 | cx q[5],q[13]; 27 | cx q[4],q[12]; 28 | cx q[2],q[10]; 29 | cx q[6],q[14]; 30 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/hamming/zero_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[0]; 5 | h q[1]; 6 | h q[11]; 7 | h q[12]; 8 | cx q[0],q[10]; 9 | cx q[1],q[0]; 10 | cx q[1],q[7]; 11 | cx q[12],q[3]; 12 | cx q[10],q[6]; 13 | cx q[1],q[8]; 14 | cx q[11],q[4]; 15 | cx q[3],q[11]; 16 | cx q[11],q[13]; 17 | cx q[8],q[9]; 18 | cx q[0],q[14]; 19 | cx q[12],q[10]; 20 | cx q[1],q[3]; 21 | cx q[6],q[5]; 22 | cx q[11],q[0]; 23 | cx q[0],q[6]; 24 | cx q[0],q[7]; 25 | cx q[10],q[1]; 26 | cx q[1],q[11]; 27 | cx q[4],q[9]; 28 | cx q[4],q[2]; 29 | cx q[5],q[4]; 30 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/hypercube/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | h q[0]; 5 | h q[1]; 6 | h q[3]; 7 | h q[7]; 8 | h q[11]; 9 | cx q[3],q[12]; 10 | cx q[1],q[9]; 11 | cx q[0],q[8]; 12 | cx q[12],q[14]; 13 | cx q[11],q[8]; 14 | cx q[9],q[10]; 15 | cx q[7],q[3]; 16 | cx q[1],q[5]; 17 | cx q[0],q[4]; 18 | cx q[14],q[15]; 19 | cx q[12],q[13]; 20 | cx q[11],q[10]; 21 | cx q[7],q[4]; 22 | cx q[5],q[6]; 23 | cx q[1],q[2]; 24 | cx q[8],q[9]; 25 | cx q[3],q[0]; 26 | cx q[11],q[15]; 27 | cx q[7],q[6]; 28 | cx q[10],q[14]; 29 | cx q[8],q[12]; 30 | cx q[4],q[5]; 31 | cx q[3],q[2]; 32 | cx q[9],q[13]; 33 | cx q[0],q[1]; 34 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/shor/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[2]; 6 | cx q[2],q[6]; 7 | cx q[0],q[3]; 8 | cx q[6],q[8]; 9 | cx q[3],q[4]; 10 | cx q[2],q[0]; 11 | cx q[6],q[7]; 12 | cx q[4],q[5]; 13 | cx q[3],q[2]; 14 | cx q[0],q[1]; 15 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/shor/zero_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[7]; 6 | cx q[7],q[4]; 7 | cx q[2],q[7]; 8 | cx q[2],q[0]; 9 | cx q[4],q[5]; 10 | cx q[7],q[8]; 11 | cx q[4],q[3]; 12 | cx q[7],q[6]; 13 | cx q[0],q[1]; 14 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/steane/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[1]; 6 | h q[3]; 7 | cx q[3],q[5]; 8 | cx q[0],q[2]; 9 | cx q[5],q[6]; 10 | cx q[3],q[4]; 11 | cx q[1],q[0]; 12 | cx q[2],q[6]; 13 | cx q[1],q[5]; 14 | cx q[0],q[4]; 15 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/steane/zero_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[3]; 6 | h q[5]; 7 | cx q[3],q[1]; 8 | cx q[5],q[4]; 9 | cx q[0],q[2]; 10 | cx q[4],q[3]; 11 | cx q[1],q[0]; 12 | cx q[1],q[6]; 13 | cx q[2],q[4]; 14 | cx q[4],q[6]; 15 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/surface_3/plus_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | h q[7]; 9 | cx q[7],q[3]; 10 | cx q[5],q[1]; 11 | cx q[4],q[3]; 12 | cx q[2],q[1]; 13 | cx q[7],q[8]; 14 | cx q[6],q[3]; 15 | cx q[4],q[2]; 16 | cx q[1],q[0]; 17 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/surface_3/plus_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[3]; 6 | h q[4]; 7 | h q[5]; 8 | h q[7]; 9 | cx q[0],q[1]; 10 | cx q[4],q[2]; 11 | cx q[7],q[8]; 12 | cx q[3],q[6]; 13 | cx q[1],q[2]; 14 | cx q[5],q[4]; 15 | cx q[8],q[3]; 16 | cx q[4],q[6]; 17 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/surface_3/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[2]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[5],q[8]; 9 | cx q[0],q[4]; 10 | cx q[5],q[7]; 11 | cx q[0],q[3]; 12 | cx q[7],q[4]; 13 | cx q[6],q[3]; 14 | cx q[2],q[5]; 15 | cx q[0],q[1]; 16 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/surface_3/zero_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[3]; 5 | h q[4]; 6 | h q[5]; 7 | h q[8]; 8 | cx q[8],q[0]; 9 | cx q[0],q[1]; 10 | cx q[3],q[6]; 11 | cx q[5],q[2]; 12 | cx q[4],q[8]; 13 | cx q[8],q[5]; 14 | cx q[1],q[3]; 15 | cx q[8],q[7]; 16 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/tetrahedral/plus_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[4]; 6 | h q[6]; 7 | h q[10]; 8 | h q[13]; 9 | cx q[13],q[11]; 10 | cx q[11],q[12]; 11 | cx q[6],q[5]; 12 | cx q[10],q[3]; 13 | cx q[4],q[1]; 14 | cx q[11],q[9]; 15 | cx q[12],q[8]; 16 | cx q[4],q[7]; 17 | cx q[3],q[5]; 18 | cx q[2],q[1]; 19 | cx q[7],q[14]; 20 | cx q[6],q[13]; 21 | cx q[2],q[9]; 22 | cx q[1],q[8]; 23 | cx q[3],q[0]; 24 | cx q[5],q[4]; 25 | cx q[13],q[14]; 26 | cx q[9],q[10]; 27 | cx q[1],q[0]; 28 | cx q[4],q[12]; 29 | cx q[6],q[7]; 30 | cx q[5],q[11]; 31 | cx q[2],q[3]; 32 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/tetrahedral/zero_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[6]; 6 | h q[7]; 7 | h q[14]; 8 | cx q[6],q[9]; 9 | cx q[7],q[11]; 10 | cx q[2],q[11]; 11 | cx q[14],q[3]; 12 | cx q[3],q[1]; 13 | cx q[11],q[6]; 14 | cx q[7],q[12]; 15 | cx q[9],q[1]; 16 | cx q[14],q[7]; 17 | cx q[2],q[0]; 18 | cx q[7],q[13]; 19 | cx q[0],q[8]; 20 | cx q[6],q[14]; 21 | cx q[11],q[7]; 22 | cx q[13],q[5]; 23 | cx q[1],q[13]; 24 | cx q[7],q[10]; 25 | cx q[6],q[7]; 26 | cx q[11],q[4]; 27 | cx q[3],q[11]; 28 | cx q[9],q[2]; 29 | cx q[1],q[8]; 30 | -------------------------------------------------------------------------------- /scripts/ft_stateprep/eval_det/circuits/tetrahedral/zero_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[6]; 6 | h q[7]; 7 | h q[14]; 8 | cx q[6],q[9]; 9 | cx q[7],q[11]; 10 | cx q[2],q[11]; 11 | cx q[14],q[3]; 12 | cx q[3],q[1]; 13 | cx q[11],q[6]; 14 | cx q[7],q[12]; 15 | cx q[9],q[1]; 16 | cx q[14],q[7]; 17 | cx q[2],q[0]; 18 | cx q[7],q[13]; 19 | cx q[0],q[8]; 20 | cx q[6],q[14]; 21 | cx q[11],q[7]; 22 | cx q[13],q[5]; 23 | cx q[1],q[13]; 24 | cx q[7],q[10]; 25 | cx q[6],q[7]; 26 | cx q[11],q[4]; 27 | cx q[3],q[11]; 28 | cx q[9],q[2]; 29 | cx q[1],q[8]; 30 | -------------------------------------------------------------------------------- /scripts/numerics/code_construct/constructHGPcodes.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Hypergraph product code construction from Roffe's LDPC library.""" 9 | 10 | from __future__ import annotations 11 | 12 | import ldpc.protograph as pt 13 | import numpy as np 14 | from bposd.hgp import hgp 15 | 16 | # med sized HGP code from https://github.com/quantumgizmos/bp_osd 17 | 18 | h = np.loadtxt("examples/mkmn_24_6_10.txt").astype(int) 19 | seed_code = np.loadtxt("examples/mkmn_24_6_10.txt").astype(int) 20 | # print(seed_code) 21 | qcode = hgp(seed_code, compute_distance=True) 22 | qcode.canonical_logicals() 23 | qcode.test() 24 | print(qcode.code_params) 25 | print(qcode.hx) 26 | print("hx:") 27 | print(qcode.hx) 28 | np.savetxt(f"./hgp_{qcode.code_params}_hx.txt", qcode.hx, fmt="%d", newline="\n") 29 | 30 | # larger code 31 | a1 = pt.array([ 32 | [(0), (11), (7), (12)], 33 | [(1), (8), (1), (8)], 34 | [(11), (0), (4), (8)], 35 | [(6), (2), (4), (12)], 36 | ]) 37 | H = a1.to_binary(lift_parameter=10) 38 | qcode = hgp(H, H, compute_distance=True) 39 | qcode.test() 40 | np.savetxt(f"./hgp_{qcode.code_params}_hx.txt", qcode.hx, fmt="%d", newline="\n") 41 | -------------------------------------------------------------------------------- /scripts/numerics/code_construct/constructLPcodes.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Constructs the lifted parity check codes for the lifted parity check codes.""" 9 | 10 | # using tools from https://github.com/quantumgizmos/bp_osd 11 | from __future__ import annotations 12 | 13 | import ldpc.protograph as pt 14 | import numpy as np 15 | from lifted_hgp import LiftedHgp 16 | 17 | a1 = pt.array([ 18 | [(0), (11), (7), (12)], 19 | [(1), (8), (1), (8)], 20 | [(11), (0), (4), (8)], 21 | [(6), (2), (4), (12)], 22 | ]) 23 | 24 | qcode = LiftedHgp(lift_parameter=32, a=a1, b=a1) 25 | if qcode.test: 26 | np.savetxt(f"./lp_{qcode.code_params}_hz.txt", qcode.hz, fmt="%d", newline="\n") 27 | np.savetxt(f"./lp_{qcode.code_params}_hx.txt", qcode.hx, fmt="%d", newline="\n") 28 | -------------------------------------------------------------------------------- /scripts/numerics/code_construct/constructToricCodes.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Toric code construction.""" 9 | 10 | # using tools from https://github.com/quantumgizmos/bp_osd 11 | from __future__ import annotations 12 | 13 | import numpy as np 14 | from bposd.hgp import hgp 15 | from ldpc.codes import ring_code 16 | 17 | # toric code 18 | for i in range(2, 100): 19 | h1 = ring_code(i) 20 | h2 = ring_code(i) 21 | 22 | qcode = hgp(h1, h2, compute_distance=True) 23 | if qcode.test: # to make sure it is a valid css code 24 | np.savetxt(f"./toric_{qcode.code_params}_hz.txt", qcode.hz, fmt="%d", newline="\n") 25 | -------------------------------------------------------------------------------- /scripts/numerics/code_construct/mkmn_24_6_10.txt: -------------------------------------------------------------------------------- 1 | 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 2 | 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 3 | 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 4 | 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 5 | 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 6 | 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 7 | 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 8 | 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 9 | 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 10 | 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 11 | 0 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 12 | 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 13 | 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 14 | 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 15 | 0 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 16 | 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 17 | 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 18 | 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 19 | -------------------------------------------------------------------------------- /scripts/numerics/data/decodingPerformance/1024_lp_code/dp-heur-singlerandomg-100k-runs.json: -------------------------------------------------------------------------------- 1 | { 2 | "1e-05": 0.000551111, 3 | "2e-05": 0.00109611, 4 | "3e-05": 0.00168167, 5 | "4e-05": 0.00225611, 6 | "5e-05": 0.00279222, 7 | "6e-05": 0.00324278, 8 | "7e-05": 0.00382111, 9 | "8e-05": 0.00433778, 10 | "9e-05": 0.00485389, 11 | "0.0001": 0.00545778, 12 | "0.0002": 0.0101178, 13 | "0.0003": 0.0145828, 14 | "0.0004": 0.0185044, 15 | "0.0005": 0.0221878, 16 | "0.0006": 0.0253417, 17 | "0.0007": 0.028195, 18 | "0.0008": 0.0309322, 19 | "0.0009": 0.0332522, 20 | "0.001": 0.0354744, 21 | "0.002": 0.0481978, 22 | "0.004": 0.0546317, 23 | "0.003": 0.0529211, 24 | "0.006": 0.0554317, 25 | "0.007": 0.0555078, 26 | "0.005": 0.0552294, 27 | "0.008": 0.0555439, 28 | "0.009": 0.0555506 29 | } 30 | -------------------------------------------------------------------------------- /scripts/numerics/data/decodingPerformance/1024_lp_code/dp-heur-singlesmallest-100k-runs.json: -------------------------------------------------------------------------------- 1 | { 2 | "1e-05": 0.000516111, 3 | "2e-05": 0.00111333, 4 | "3e-05": 0.00165556, 5 | "4e-05": 0.00214333, 6 | "5e-05": 0.00271611, 7 | "6e-05": 0.00316944, 8 | "7e-05": 0.00377278, 9 | "8e-05": 0.00430389, 10 | "9e-05": 0.00475444, 11 | "0.0001": 0.00516444, 12 | "0.0002": 0.0100089, 13 | "0.0003": 0.0141189, 14 | "0.0004": 0.0182283, 15 | "0.0005": 0.0218606, 16 | "0.0006": 0.0250333, 17 | "0.0007": 0.0276528, 18 | "0.0009": 0.0329433, 19 | "0.0008": 0.0304867, 20 | "0.001": 0.0350878, 21 | "0.002": 0.0478489, 22 | "0.003": 0.0527228, 23 | "0.007": 0.0555106, 24 | "0.004": 0.0545217, 25 | "0.008": 0.0555411, 26 | "0.005": 0.0551783, 27 | "0.006": 0.055395, 28 | "0.009": 0.05555 29 | } 30 | -------------------------------------------------------------------------------- /scripts/numerics/data/decodingPerformance/1024_lp_code/dp-heur-standardg-100k-runs.json: -------------------------------------------------------------------------------- 1 | { 2 | "1e-05": 0.000557222, 3 | "2e-05": 0.00107056, 4 | "3e-05": 0.00160889, 5 | "4e-05": 0.00221611, 6 | "5e-05": 0.00276944, 7 | "6e-05": 0.00329889, 8 | "7e-05": 0.00389056, 9 | "8e-05": 0.00432778, 10 | "9e-05": 0.00494389, 11 | "0.0001": 0.00542778, 12 | "0.0002": 0.0103456, 13 | "0.0003": 0.0147422, 14 | "0.0004": 0.0187461, 15 | "0.0005": 0.0222594, 16 | "0.0006": 0.0254261, 17 | "0.0007": 0.0284939, 18 | "0.0008": 0.0309894, 19 | "0.0009": 0.0335594, 20 | "0.001": 0.0354439, 21 | "0.002": 0.0483606, 22 | "0.003": 0.05301, 23 | "0.004": 0.0546572, 24 | "0.005": 0.0552078, 25 | "0.006": 0.0554483, 26 | "0.009": 0.0555517, 27 | "0.008": 0.0555411, 28 | "0.007": 0.0555172 29 | } 30 | -------------------------------------------------------------------------------- /scripts/numerics/data/decodingPerformance/1024_lp_code/dp-original-stdgrowth-100k-runs.json: -------------------------------------------------------------------------------- 1 | { 2 | "1e-05": 0.000581111, 3 | "2e-05": 0.00115333, 4 | "3e-05": 0.00165611, 5 | "4e-05": 0.00228, 6 | "5e-05": 0.00275111, 7 | "6e-05": 0.00334778, 8 | "7e-05": 0.00381167, 9 | "8e-05": 0.00436333, 10 | "9e-05": 0.00479778, 11 | "0.0001": 0.00537, 12 | "0.0002": 0.0102894, 13 | "0.0003": 0.0146433, 14 | "0.0004": 0.0187906, 15 | "0.0005": 0.0223056, 16 | "0.0006": 0.0254161, 17 | "0.0007": 0.0285367, 18 | "0.0008": 0.0309889, 19 | "0.001": 0.0356678, 20 | "0.0009": 0.0334194, 21 | "0.002": 0.0484083, 22 | "0.003": 0.053, 23 | "0.004": 0.0546094, 24 | "0.005": 0.0552244, 25 | "0.007": 0.0555194, 26 | "0.006": 0.0554461, 27 | "0.008": 0.0555422, 28 | "0.009": 0.0555494 29 | } 30 | -------------------------------------------------------------------------------- /scripts/numerics/data/runtime/rt-original-1k-01.json: -------------------------------------------------------------------------------- 1 | { 2 | "0.01": { 3 | "18": 0, 4 | "128": 749, 5 | "162": 1044, 6 | "242": 2228, 7 | "1058": 32245, 8 | "1152": 40597, 9 | "32": 0, 10 | "1352": 45731, 11 | "1250": 47179, 12 | "338": 4823, 13 | "1568": 54324, 14 | "1458": 75665, 15 | "1800": 75197, 16 | "392": 5717, 17 | "1682": 94730, 18 | "2178": 127871, 19 | "450": 8322, 20 | "1922": 139656, 21 | "2048": 163787, 22 | "2450": 194676, 23 | "50": 0, 24 | "512": 11113, 25 | "2592": 229545, 26 | "2738": 279761, 27 | "2888": 289471, 28 | "578": 15150, 29 | "3200": 334634, 30 | "3042": 371810, 31 | "648": 17522, 32 | "722": 23185, 33 | "72": 0, 34 | "8": 0, 35 | "3362": 376654, 36 | "882": 24052, 37 | "98": 62, 38 | "3698": 400849, 39 | "968": 30001, 40 | "3872": 426684, 41 | "3528": 440620, 42 | "4418": 457700, 43 | "4232": 511320, 44 | "4050": 453985, 45 | "4802": 618274, 46 | "4608": 582185, 47 | "5202": 691766, 48 | "5000": 605638, 49 | "5618": 880878 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /scripts/numerics/pers.txt: -------------------------------------------------------------------------------- 1 | 0.00001 2 | 0.00002 3 | 0.00003 4 | 0.00004 5 | 0.00005 6 | 0.00006 7 | 0.00007 8 | 0.00008 9 | 0.00009 10 | 0.0001 11 | 0.0002 12 | 0.0003 13 | 0.0004 14 | 0.0005 15 | 0.0006 16 | 0.0007 17 | 0.0008 18 | 0.0009 19 | 0.001 20 | 0.002 21 | 0.003 22 | 0.004 23 | 0.005 24 | 0.006 25 | 0.007 26 | 0.008 27 | 0.009 28 | 0.01 29 | 0.02 30 | 0.03 31 | 0.04 32 | 0.05 33 | 0.06 34 | 0.07 35 | 0.08 36 | 0.09 37 | 0.1 38 | -------------------------------------------------------------------------------- /sitecustomize.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Site customization shim to enable multiprocess coverage collection in tests. 9 | 10 | See https://coverage.readthedocs.io/en/latest/subprocess.html. 11 | """ 12 | 13 | from __future__ import annotations 14 | 15 | try: 16 | import coverage 17 | 18 | coverage.process_startup() 19 | except ImportError: 20 | # The 'coverage' module is optional 21 | # If it is not installed, we do not enable multiprocess coverage collection 22 | pass 23 | -------------------------------------------------------------------------------- /src/mqt/qecc/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """MQT QECC library. 9 | 10 | This file is part of the MQT QECC library released under the MIT license. 11 | See README.md or go to https://github.com/cda-tum/qecc for more information. 12 | """ 13 | 14 | from __future__ import annotations 15 | 16 | from ._version import __version__ 17 | from .analog_information_decoding.simulators.analog_tannergraph_decoding import AnalogTannergraphDecoder, AtdSimulator 18 | from .analog_information_decoding.simulators.quasi_single_shot_v2 import QssSimulator 19 | from .codes import CSSCode, StabilizerCode 20 | 21 | __all__ = [ 22 | "AnalogTannergraphDecoder", 23 | "AtdSimulator", 24 | "CSSCode", 25 | "QssSimulator", 26 | "StabilizerCode", 27 | "__version__", 28 | ] 29 | -------------------------------------------------------------------------------- /src/mqt/qecc/_version.pyi: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | __version__: str 9 | version: str 10 | __version_tuple__: tuple[int, int, int, str, str] | tuple[int, int, int] 11 | version_tuple: tuple[int, int, int, str, str] | tuple[int, int, int] 12 | -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/code_construction/compute_distances.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 3 | # All rights reserved. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # 7 | # Licensed under the MIT License 8 | 9 | path=$1 10 | 11 | gap -q << EOF > $path/info.txt 12 | LoadPackage("QDistRnd");; 13 | hx:=ReadMTXE("$path/hx.mtx");; 14 | 15 | hz:=ReadMTXE("$path/hz.mtx");; 16 | 17 | Print("dZ = ", DistRandCSS(hx[3], hz[3], 150, 0,2), "\n"); 18 | Print("dX = ", DistRandCSS(hz[3], hx[3], 150, 0,2), "\n"); 19 | 20 | file := IO_File("$path/mx.txt"); 21 | lines := IO_ReadLines(file); 22 | parityCheckMatrix := []; 23 | 24 | for l in lines do 25 | row := ReplacedString(l, "\n", ""); 26 | r := SplitString(row, " "); 27 | newr := []; 28 | for b in r do 29 | c := Int(b); 30 | Add(newr,c); 31 | od; 32 | Add(parityCheckMatrix, newr); 33 | od; 34 | 35 | xcode := CheckMatCode(parityCheckMatrix, GF(2)); 36 | 37 | file := IO_File("$path/mz.txt"); 38 | lines := IO_ReadLines(file); 39 | parityCheckMatrix := []; 40 | 41 | for l in lines do 42 | row := ReplacedString(l, "\n", ""); 43 | r := SplitString(row, " "); 44 | newr := []; 45 | for b in r do 46 | c := Int(b); 47 | Add(newr,c); 48 | od; 49 | Add(parityCheckMatrix, newr); 50 | od; 51 | 52 | zcode := CheckMatCode(parityCheckMatrix, GF(2)); 53 | 54 | 55 | 56 | # Print("dMx = ", MinimumDistance(xcode), "\n"); only works for small codes quickly 57 | Print("dMx = ", MinimumDistanceLeon(xcode), "\n"); #https://gap-packages.github.io/guava/doc/chap4_mj.html#X8170B52D7C154247:~:text=4.8%2D4%20MinimumDistanceLeon 58 | Print("dMz = ", MinimumDistanceLeon(zcode), "\n"); 59 | 60 | EOF 61 | -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/code_construction/compute_distances_3D.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 3 | # All rights reserved. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # 7 | # Licensed under the MIT License 8 | 9 | path=$1 10 | 11 | gap -q << EOF > $path/info.txt 12 | LoadPackage("QDistRnd");; 13 | hx:=ReadMTXE("$path/hx.mtx");; 14 | 15 | hz:=ReadMTXE("$path/hz.mtx");; 16 | 17 | Print("dZ = ", DistRandCSS(hx[3], hz[3], 150, 0,2), "\n"); 18 | Print("dX = ", DistRandCSS(hz[3], hx[3], 150, 0,2), "\n"); 19 | 20 | EOF 21 | -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=16_hx.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=16_hx.npz -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=16_hz.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=16_hz.npz -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=21_hx.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=21_hx.npz -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=21_hz.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=21_hz.npz -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=30_hx.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=30_hx.npz -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=30_hz.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/analog_information_decoding/codes/lifted_product/lp_l=30_hz.npz -------------------------------------------------------------------------------- /src/mqt/qecc/analog_information_decoding/results/bp-parameter-comparison/A comparison of BPOSD Settings.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/analog_information_decoding/results/bp-parameter-comparison/A comparison of BPOSD Settings.pdf -------------------------------------------------------------------------------- /src/mqt/qecc/cc_decoder/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Contains the implementation of the tensor network decoder for the hexagonal color code.""" 9 | 10 | from __future__ import annotations 11 | 12 | from ..codes.color_code import ColorCode, LatticeType 13 | from ..codes.hexagonal_color_code import HexagonalColorCode 14 | from ..codes.square_octagon_color_code import SquareOctagonColorCode 15 | from .comparison import tn_decoder 16 | 17 | 18 | def code_from_string(lattice_type: str, distance: int) -> ColorCode: 19 | """Construct a color code from a string defining the lattice and a distance.""" 20 | if lattice_type == LatticeType.HEXAGON: 21 | return HexagonalColorCode(distance) 22 | if lattice_type == LatticeType.SQUARE_OCTAGON: 23 | return SquareOctagonColorCode(distance) 24 | msg = f"Unknown lattice type {lattice_type}. Please choose either hexagon or square_octagon." 25 | raise ValueError(msg) 26 | 27 | 28 | __all__ = [ 29 | "ColorCode", 30 | "HexagonalColorCode", 31 | "LatticeType", 32 | "SquareOctagonColorCode", 33 | "code_from_string", 34 | "tn_decoder", 35 | ] 36 | -------------------------------------------------------------------------------- /src/mqt/qecc/cc_decoder/cli.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Command line interface for the CC decoder.""" 9 | 10 | from __future__ import annotations 11 | 12 | import argparse 13 | 14 | from . import decoder 15 | from .comparison import tn_decoder 16 | 17 | 18 | def cli() -> None: 19 | """Run the CC decoder as cli.""" 20 | parser = argparse.ArgumentParser() 21 | parser.add_argument("distance", type=int, help="the distance of the code") 22 | parser.add_argument("error_rate", type=float, help="the error rate") 23 | parser.add_argument( 24 | "--type", 25 | type=str, 26 | default="hexagon", 27 | help="type of the code lattice (hexagon or square_octagon). Default: hexagon", 28 | ) 29 | parser.add_argument( 30 | "--nr_sims", 31 | type=int, 32 | default=10000, 33 | help="the number of simulations to run. Default: 10000", 34 | ) 35 | parser.add_argument( 36 | "--results_dir", 37 | type=str, 38 | default="./results", 39 | help="the directory to save the results to. Default: ./results", 40 | ) 41 | parser.add_argument( 42 | "--decoder", 43 | type=str, 44 | default="maxsat", 45 | help="the decoder to use (maxsat or tn). Default: maxsat", 46 | ) 47 | 48 | parser.add_argument( 49 | "--solver", 50 | type=str, 51 | default="z3", 52 | help="maxsat solver to use (path to a executable). Default: z3", 53 | ) 54 | 55 | args = parser.parse_args() 56 | 57 | if args.decoder == "maxsat": 58 | decoder.run( 59 | args.type, 60 | args.distance, 61 | args.error_rate, 62 | args.nr_sims, 63 | args.results_dir, 64 | args.solver, 65 | ) 66 | elif args.decoder == "tn": 67 | tn_decoder.run(args.distance, args.error_rate, args.nr_sims, args.results_dir) 68 | else: 69 | msg = f"Unknown decoder {args.decoder}. Please choose either maxsat or tn." 70 | raise ValueError(msg) 71 | -------------------------------------------------------------------------------- /src/mqt/qecc/cc_decoder/comparison/tn_decoder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Decoding simulation using the tensor network implementation of the qecsim package.""" 9 | 10 | from __future__ import annotations 11 | 12 | import json 13 | from pathlib import Path 14 | 15 | from qecsim import app 16 | from qecsim.models.color import Color666Code, Color666MPSDecoder 17 | from qecsim.models.generic import BitFlipErrorModel 18 | 19 | 20 | def run( 21 | distance: int, 22 | error_rate: float, 23 | nr_sims: int = 10000, 24 | results_dir: str = "./results_tn", 25 | ) -> None: 26 | """Run the decoder for the hexagonal color code. 27 | 28 | :param distance: distance to run 29 | :param error_rate: error rate to run 30 | :param nr_sims: number of samples to run 31 | :param results_dir: directory to store results. 32 | """ 33 | code = Color666Code(distance) 34 | error_model = BitFlipErrorModel() 35 | decoder = Color666MPSDecoder(chi=8) 36 | data = app.run(code, error_model, decoder, error_rate, max_runs=nr_sims) 37 | filename = f"distance={distance},p={round(error_rate, 4)}.json" 38 | path = Path(results_dir) 39 | path.mkdir(parents=True, exist_ok=True) 40 | with (path / filename).open("w") as out: 41 | out.write(json.dumps(data)) 42 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Methods and utilities for synthesizing fault-tolerant circuits and gadgets.""" 9 | 10 | from __future__ import annotations 11 | 12 | from .encoding import depth_optimal_encoding_circuit, gate_optimal_encoding_circuit, heuristic_encoding_circuit 13 | from .simulation import LutDecoder, NoisyNDFTStatePrepSimulator 14 | from .state_prep import ( 15 | StatePrepCircuit, 16 | depth_optimal_prep_circuit, 17 | gate_optimal_prep_circuit, 18 | gate_optimal_verification_circuit, 19 | gate_optimal_verification_stabilizers, 20 | heuristic_prep_circuit, 21 | heuristic_verification_circuit, 22 | heuristic_verification_stabilizers, 23 | naive_verification_circuit, 24 | ) 25 | from .state_prep_det import DeterministicVerification, DeterministicVerificationHelper 26 | from .synthesis_utils import qiskit_to_stim_circuit 27 | 28 | __all__ = [ 29 | "DeterministicVerification", 30 | "DeterministicVerificationHelper", 31 | "LutDecoder", 32 | "NoisyNDFTStatePrepSimulator", 33 | "StatePrepCircuit", 34 | "depth_optimal_encoding_circuit", 35 | "depth_optimal_prep_circuit", 36 | "gate_optimal_encoding_circuit", 37 | "gate_optimal_prep_circuit", 38 | "gate_optimal_verification_circuit", 39 | "gate_optimal_verification_stabilizers", 40 | "heuristic_encoding_circuit", 41 | "heuristic_prep_circuit", 42 | "heuristic_verification_circuit", 43 | "heuristic_verification_stabilizers", 44 | "naive_verification_circuit", 45 | "qiskit_to_stim_circuit", 46 | ] 47 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/circuit_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """General circuit constructions.""" 9 | 10 | from __future__ import annotations 11 | 12 | from qiskit.circuit import QuantumCircuit, QuantumRegister 13 | 14 | 15 | def reorder_qubits(circ: QuantumCircuit, qubit_mapping: dict[int, int]) -> QuantumCircuit: 16 | """Reorders the qubits in a QuantumCircuit based on the given mapping. 17 | 18 | Parameters: 19 | circuit: The original quantum circuit. 20 | qubit_mapping: A dictionary mapping original qubit indices to new qubit indices. 21 | 22 | Returns: 23 | A new quantum circuit with qubits reordered. 24 | """ 25 | # Validate the qubit_mapping 26 | if sorted(qubit_mapping.keys()) != list(range(len(circ.qubits))) or sorted(qubit_mapping.values()) != list( 27 | range(len(circ.qubits)) 28 | ): 29 | msg = "Invalid qubit_mapping: It must be a permutation of the original qubit indices." 30 | raise ValueError(msg) 31 | 32 | # Create a new quantum register 33 | num_qubits = len(circ.qubits) 34 | new_register = QuantumRegister(num_qubits, "q") 35 | new_circuit = QuantumCircuit(new_register) 36 | 37 | # Remap instructions based on the qubit_mapping 38 | for instruction, qubits, clbits in circ.data: 39 | new_qubits = [new_register[qubit_mapping[circ.find_bit(q)[0]]] for q in qubits] 40 | new_circuit.append(instruction, new_qubits, clbits) 41 | 42 | return new_circuit 43 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/10_1_2.qasm: -------------------------------------------------------------------------------- 1 | # Encoding qubits: 6 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | qreg q[10]; 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | cx q[1],q[8]; 10 | cx q[0],q[7]; 11 | cx q[6],q[0]; 12 | cx q[2],q[5]; 13 | cx q[1],q[4]; 14 | cx q[6],q[4]; 15 | cx q[5],q[9]; 16 | cx q[2],q[3]; 17 | cx q[0],q[1]; 18 | cx q[9],q[6]; 19 | cx q[4],q[5]; 20 | cx q[0],q[3]; 21 | cx q[1],q[2]; 22 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/4_2_2.qasm: -------------------------------------------------------------------------------- 1 | # Encoding qubits: 0, 1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | qreg q[4]; 6 | h q[2]; 7 | cx q[1],q[3]; 8 | cx q[2],q[0]; 9 | cx q[2],q[3]; 10 | cx q[0],q[1]; 11 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/6_2_2.qasm: -------------------------------------------------------------------------------- 1 | # Encoding qubits: 0, 1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | qreg q[6]; 6 | h q[2]; 7 | h q[4]; 8 | cx q[1],q[5]; 9 | cx q[4],q[0]; 10 | cx q[1],q[3]; 11 | cx q[2],q[0]; 12 | cx q[4],q[5]; 13 | cx q[2],q[3]; 14 | cx q[0],q[1]; 15 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/carbon.qasm: -------------------------------------------------------------------------------- 1 | # Encoding Qubits: 0,4 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[12]; 5 | h q[5]; 6 | h q[8]; 7 | h q[9]; 8 | h q[10]; 9 | h q[11]; 10 | cx q[9],q[2]; 11 | cx q[5],q[2]; 12 | cx q[11],q[1]; 13 | cx q[8],q[7]; 14 | cx q[5],q[4]; 15 | cx q[10],q[3]; 16 | cx q[9],q[1]; 17 | cx q[2],q[0]; 18 | cx q[11],q[7]; 19 | cx q[0],q[6]; 20 | cx q[1],q[4]; 21 | cx q[8],q[3]; 22 | cx q[4],q[7]; 23 | cx q[10],q[6]; 24 | cx q[3],q[2]; 25 | cx q[1],q[0]; 26 | cx q[6],q[11]; 27 | cx q[5],q[10]; 28 | cx q[7],q[9]; 29 | cx q[0],q[8]; 30 | cx q[2],q[1]; 31 | cx q[4],q[3]; 32 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/hamming.qasm: -------------------------------------------------------------------------------- 1 | # Encoding Qubits: 0,1,2,3,4,6,12 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[15]; 5 | h q[7]; 6 | h q[10]; 7 | h q[11]; 8 | h q[13]; 9 | cx q[13],q[8]; 10 | cx q[7],q[1]; 11 | cx q[7],q[8]; 12 | cx q[1],q[6]; 13 | cx q[13],q[9]; 14 | cx q[6],q[8]; 15 | cx q[8],q[12]; 16 | cx q[2],q[9]; 17 | cx q[1],q[9]; 18 | cx q[12],q[5]; 19 | cx q[11],q[4]; 20 | cx q[10],q[5]; 21 | cx q[8],q[4]; 22 | cx q[9],q[0]; 23 | cx q[11],q[14]; 24 | cx q[2],q[10]; 25 | cx q[5],q[4]; 26 | cx q[1],q[3]; 27 | cx q[7],q[0]; 28 | cx q[6],q[14]; 29 | cx q[10],q[13]; 30 | cx q[4],q[12]; 31 | cx q[3],q[11]; 32 | cx q[0],q[5]; 33 | cx q[13],q[14]; 34 | cx q[6],q[10]; 35 | cx q[11],q[8]; 36 | cx q[5],q[3]; 37 | cx q[4],q[2]; 38 | cx q[12],q[11]; 39 | cx q[9],q[7]; 40 | cx q[5],q[2]; 41 | cx q[8],q[0]; 42 | cx q[4],q[6]; 43 | cx q[14],q[10]; 44 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/shor.qasm: -------------------------------------------------------------------------------- 1 | # Encoding Qubits: 2 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[9]; 5 | h q[0]; 6 | h q[6]; 7 | cx q[6],q[2]; 8 | cx q[0],q[3]; 9 | cx q[6],q[8]; 10 | cx q[3],q[4]; 11 | cx q[2],q[0]; 12 | cx q[6],q[7]; 13 | cx q[4],q[5]; 14 | cx q[3],q[2]; 15 | cx q[0],q[1]; 16 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/steane.qasm: -------------------------------------------------------------------------------- 1 | # Encoding Qubits: 2 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[7]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[5],q[1]; 9 | cx q[1],q[2]; 10 | cx q[4],q[0]; 11 | cx q[6],q[4]; 12 | cx q[5],q[3]; 13 | cx q[2],q[0]; 14 | cx q[6],q[3]; 15 | cx q[4],q[5]; 16 | cx q[0],q[1]; 17 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/surface.qasm: -------------------------------------------------------------------------------- 1 | # Encoding Qubits: 0 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[9]; 5 | h q[3]; 6 | h q[5]; 7 | h q[6]; 8 | h q[7]; 9 | cx q[7],q[4]; 10 | cx q[3],q[0]; 11 | cx q[3],q[4]; 12 | cx q[5],q[2]; 13 | cx q[0],q[1]; 14 | cx q[7],q[8]; 15 | cx q[4],q[5]; 16 | cx q[1],q[2]; 17 | cx q[6],q[3]; 18 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/encoding_circuits/tetrahedral.qasm: -------------------------------------------------------------------------------- 1 | # Encoding Qubits: 8 2 | OPENQASM 2.0; 3 | include "qelib1.inc"; 4 | qreg q[15]; 5 | h q[0]; 6 | h q[1]; 7 | h q[2]; 8 | h q[14]; 9 | cx q[8],q[10]; 10 | cx q[2],q[9]; 11 | cx q[1],q[12]; 12 | cx q[0],q[7]; 13 | cx q[14],q[7]; 14 | cx q[12],q[8]; 15 | cx q[10],q[0]; 16 | cx q[9],q[11]; 17 | cx q[2],q[5]; 18 | cx q[1],q[4]; 19 | cx q[14],q[12]; 20 | cx q[11],q[13]; 21 | cx q[9],q[10]; 22 | cx q[5],q[6]; 23 | cx q[2],q[3]; 24 | cx q[7],q[4]; 25 | cx q[0],q[1]; 26 | cx q[14],q[13]; 27 | cx q[12],q[11]; 28 | cx q[8],q[9]; 29 | cx q[7],q[6]; 30 | cx q[0],q[3]; 31 | cx q[4],q[5]; 32 | cx q[1],q[2]; 33 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/non_css_ancillas/five_qubit_code.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[10]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[4]; 8 | cx q[2],q[9]; 9 | cx q[4],q[8]; 10 | cx q[1],q[9]; 11 | cx q[0],q[6]; 12 | cx q[4],q[7]; 13 | cx q[2],q[8]; 14 | cx q[1],q[5]; 15 | cx q[0],q[3]; 16 | cx q[6],q[7]; 17 | cx q[5],q[3]; 18 | cx q[4],q[1]; 19 | cx q[2],q[0]; 20 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/non_css_ancillas/five_qubit_code_verified.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[10]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[4]; 10 | cx q[2],q[9]; 11 | cx q[4],q[8]; 12 | cx q[1],q[9]; 13 | cx q[0],q[6]; 14 | cx q[4],q[7]; 15 | cx q[2],q[8]; 16 | cx q[1],q[5]; 17 | cx q[0],q[3]; 18 | cx q[6],q[7]; 19 | cx q[5],q[3]; 20 | cx q[4],q[1]; 21 | cx q[2],q[0]; 22 | cx q[2],z_anc[0]; 23 | cx q[3],z_anc[0]; 24 | cx q[4],z_anc[0]; 25 | cx q[7],z_anc[0]; 26 | cx q[9],z_anc[0]; 27 | measure z_anc[0] -> z_c[0]; 28 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/non_css_ancillas/gottesman_8_3_3.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | h q[0]; 5 | h q[1]; 6 | h q[3]; 7 | h q[5]; 8 | h q[8]; 9 | cx q[5],q[10]; 10 | cx q[3],q[12]; 11 | cx q[1],q[9]; 12 | cx q[12],q[14]; 13 | cx q[10],q[11]; 14 | cx q[8],q[9]; 15 | cx q[3],q[4]; 16 | cx q[1],q[2]; 17 | cx q[0],q[5]; 18 | cx q[14],q[15]; 19 | cx q[12],q[13]; 20 | cx q[8],q[10]; 21 | cx q[4],q[6]; 22 | cx q[1],q[7]; 23 | cx q[0],q[2]; 24 | cx q[9],q[11]; 25 | cx q[5],q[3]; 26 | cx q[8],q[12]; 27 | cx q[0],q[6]; 28 | cx q[10],q[14]; 29 | cx q[9],q[13]; 30 | cx q[5],q[7]; 31 | cx q[2],q[4]; 32 | cx q[11],q[15]; 33 | cx q[3],q[1]; 34 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/non_css_ancillas/gottesman_8_3_3_verified.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[16]; 4 | qreg z_anc[2]; 5 | qreg x_anc[1]; 6 | qreg a7[1]; 7 | creg z_c[2]; 8 | creg x_c[1]; 9 | creg c7[1]; 10 | h q[0]; 11 | h q[1]; 12 | h q[3]; 13 | h q[5]; 14 | h q[8]; 15 | cx q[5],q[10]; 16 | cx q[3],q[12]; 17 | cx q[1],q[9]; 18 | cx q[12],q[14]; 19 | cx q[10],q[11]; 20 | cx q[8],q[9]; 21 | cx q[3],q[4]; 22 | cx q[1],q[2]; 23 | cx q[0],q[5]; 24 | cx q[14],q[15]; 25 | cx q[12],q[13]; 26 | cx q[8],q[10]; 27 | cx q[4],q[6]; 28 | cx q[1],q[7]; 29 | cx q[0],q[2]; 30 | cx q[9],q[11]; 31 | cx q[5],q[3]; 32 | cx q[8],q[12]; 33 | cx q[0],q[6]; 34 | cx q[10],q[14]; 35 | cx q[9],q[13]; 36 | cx q[5],q[7]; 37 | cx q[2],q[4]; 38 | cx q[11],q[15]; 39 | cx q[3],q[1]; 40 | cx q[6],z_anc[0]; 41 | cx q[7],z_anc[0]; 42 | cx q[9],z_anc[0]; 43 | cx q[14],z_anc[0]; 44 | cx q[3],z_anc[1]; 45 | cx q[4],z_anc[1]; 46 | cx q[12],z_anc[1]; 47 | cx q[15],z_anc[1]; 48 | measure z_anc[0] -> z_c[0]; 49 | measure z_anc[1] -> z_c[1]; 50 | h x_anc[0]; 51 | cx x_anc[0],q[1]; 52 | cx x_anc[0],a7[0]; 53 | cx x_anc[0],q[2]; 54 | cx x_anc[0],q[5]; 55 | cx x_anc[0],q[6]; 56 | cx x_anc[0],q[9]; 57 | cx x_anc[0],q[10]; 58 | cx x_anc[0],q[12]; 59 | cx x_anc[0],a7[0]; 60 | measure a7[0] -> c7[0]; 61 | cx x_anc[0],q[15]; 62 | h x_anc[0]; 63 | measure x_anc[0] -> x_c[0]; 64 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/README.md: -------------------------------------------------------------------------------- 1 | If you want to run evaluations on the example circuits in this directory, do the following. 2 | 3 | To estimate the logical error rate for a physical error rate p_err, run 4 | 5 | `python estimate_logical_error_rate CODE -p p_err` 6 | 7 | The script prints 4 numbers: logical error rate per qubit, acceptance rate (if using post-selection), number of logical errors, total number of shots 8 | 9 | The python script has further options with which you can select which circuits to construct, how many logical errors should occur before stopping and more. 10 | 11 | To generate these values for a circuit for a range between p_err = 0.5 and p_err = 0.00005, the script `run_eval_on_code FILENAME ARGS` can be used. It runs multiple instances of `estimate_logical_error_rate` in parallel (using GNU Parallel) and stores the results in `FILENAME.csv`. 12 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | qreg z_anc[2]; 5 | qreg x_anc[1]; 6 | qreg a47[1]; 7 | creg z_c[2]; 8 | creg x_c[1]; 9 | creg c47[1]; 10 | h q[0]; 11 | h q[1]; 12 | h q[2]; 13 | h q[4]; 14 | h q[7]; 15 | cx q[7],q[11]; 16 | cx q[1],q[5]; 17 | cx q[7],q[9]; 18 | cx q[4],q[10]; 19 | cx q[2],q[8]; 20 | cx q[1],q[3]; 21 | cx q[0],q[6]; 22 | cx q[10],q[9]; 23 | cx q[8],q[7]; 24 | cx q[6],q[11]; 25 | cx q[4],q[3]; 26 | cx q[2],q[1]; 27 | cx q[0],q[5]; 28 | cx q[11],q[10]; 29 | cx q[9],q[8]; 30 | cx q[7],q[6]; 31 | cx q[5],q[4]; 32 | cx q[3],q[2]; 33 | cx q[1],q[0]; 34 | cx q[1],z_anc[0]; 35 | cx q[4],z_anc[0]; 36 | cx q[7],z_anc[0]; 37 | cx q[10],z_anc[0]; 38 | cx q[1],z_anc[1]; 39 | cx q[2],z_anc[1]; 40 | cx q[7],z_anc[1]; 41 | cx q[8],z_anc[1]; 42 | measure z_anc[0] -> z_c[0]; 43 | measure z_anc[1] -> z_c[1]; 44 | h x_anc[0]; 45 | cx x_anc[0],q[0]; 46 | cx x_anc[0],a47[0]; 47 | cx x_anc[0],q[2]; 48 | cx x_anc[0],q[4]; 49 | cx x_anc[0],q[6]; 50 | cx x_anc[0],q[8]; 51 | cx x_anc[0],a47[0]; 52 | measure a47[0] -> c47[0]; 53 | cx x_anc[0],q[10]; 54 | h x_anc[0]; 55 | measure x_anc[0] -> x_c[0]; 56 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 7 2 | CX 7 11 1 5 7 9 4 10 2 8 1 3 0 6 10 9 8 7 6 11 4 3 2 1 0 5 11 10 9 8 7 6 5 4 3 2 1 0 1 12 4 12 7 12 10 12 1 13 2 13 7 13 8 13 3 | MR 12 13 4 | H 14 5 | CX 14 0 14 15 14 2 14 4 14 6 14 8 14 15 6 | MR 15 7 | CX 14 10 8 | H 14 9 | MR 14 10 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | qreg z_anc[1]; 5 | qreg a9[1]; 6 | qreg x_anc[1]; 7 | qreg a10[1]; 8 | creg z_c[1]; 9 | creg c9[1]; 10 | creg x_c[1]; 11 | creg c10[1]; 12 | h q[1]; 13 | h q[2]; 14 | h q[4]; 15 | h q[6]; 16 | h q[8]; 17 | cx q[1],q[7]; 18 | cx q[6],q[9]; 19 | cx q[2],q[5]; 20 | cx q[7],q[0]; 21 | cx q[7],q[6]; 22 | cx q[4],q[10]; 23 | cx q[5],q[11]; 24 | cx q[9],q[3]; 25 | cx q[10],q[1]; 26 | cx q[8],q[5]; 27 | cx q[7],q[2]; 28 | cx q[8],q[4]; 29 | cx q[8],q[9]; 30 | cx q[2],q[8]; 31 | cx q[9],q[0]; 32 | cx q[4],q[7]; 33 | cx q[0],z_anc[0]; 34 | h a9[0]; 35 | cx a9[0],z_anc[0]; 36 | cx q[2],z_anc[0]; 37 | cx q[3],z_anc[0]; 38 | cx q[4],z_anc[0]; 39 | cx q[10],z_anc[0]; 40 | cx a9[0],z_anc[0]; 41 | h a9[0]; 42 | measure a9[0] -> c9[0]; 43 | cx q[11],z_anc[0]; 44 | measure z_anc[0] -> z_c[0]; 45 | measure z_anc[0] -> z_c[0]; 46 | h x_anc[0]; 47 | cx x_anc[0],q[0]; 48 | cx x_anc[0],a10[0]; 49 | cx x_anc[0],q[3]; 50 | cx x_anc[0],q[7]; 51 | cx x_anc[0],q[8]; 52 | cx x_anc[0],q[10]; 53 | cx x_anc[0],a10[0]; 54 | measure a10[0] -> c10[0]; 55 | cx x_anc[0],q[11]; 56 | h x_anc[0]; 57 | measure x_anc[0] -> x_c[0]; 58 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 0 12 3 | H 13 4 | CX 13 12 2 12 3 12 4 12 10 12 13 12 5 | H 13 6 | MR 13 7 | CX 11 12 8 | MR 12 12 9 | H 14 10 | CX 14 0 14 15 14 3 14 7 14 8 14 10 14 15 11 | MR 15 12 | CX 14 11 13 | H 14 14 | MR 14 15 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | qreg z_anc[1]; 5 | qreg x_anc[1]; 6 | qreg a62[1]; 7 | creg z_c[1]; 8 | creg x_c[1]; 9 | creg c62[1]; 10 | h q[1]; 11 | h q[2]; 12 | h q[4]; 13 | h q[6]; 14 | h q[8]; 15 | cx q[1],q[7]; 16 | cx q[6],q[9]; 17 | cx q[2],q[5]; 18 | cx q[7],q[0]; 19 | cx q[7],q[6]; 20 | cx q[4],q[10]; 21 | cx q[5],q[11]; 22 | cx q[9],q[3]; 23 | cx q[10],q[1]; 24 | cx q[8],q[5]; 25 | cx q[7],q[2]; 26 | cx q[8],q[4]; 27 | cx q[8],q[9]; 28 | cx q[2],q[8]; 29 | cx q[9],q[0]; 30 | cx q[4],q[7]; 31 | cx q[0],z_anc[0]; 32 | cx q[2],z_anc[0]; 33 | cx q[3],z_anc[0]; 34 | cx q[4],z_anc[0]; 35 | cx q[10],z_anc[0]; 36 | cx q[11],z_anc[0]; 37 | measure z_anc[0] -> z_c[0]; 38 | h x_anc[0]; 39 | cx x_anc[0],q[0]; 40 | cx x_anc[0],a62[0]; 41 | cx x_anc[0],q[1]; 42 | cx x_anc[0],q[5]; 43 | cx x_anc[0],q[6]; 44 | cx x_anc[0],q[7]; 45 | cx x_anc[0],a62[0]; 46 | measure a62[0] -> c62[0]; 47 | cx x_anc[0],q[11]; 48 | h x_anc[0]; 49 | measure x_anc[0] -> x_c[0]; 50 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 0 12 2 12 3 12 4 12 10 12 11 12 3 | MR 12 4 | H 13 5 | CX 13 0 13 14 13 1 13 5 13 6 13 7 13 14 6 | MR 14 7 | CX 13 11 8 | H 13 9 | MR 13 10 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | h q[1]; 5 | h q[2]; 6 | h q[4]; 7 | h q[6]; 8 | h q[8]; 9 | cx q[1],q[7]; 10 | cx q[6],q[9]; 11 | cx q[2],q[5]; 12 | cx q[7],q[0]; 13 | cx q[7],q[6]; 14 | cx q[4],q[10]; 15 | cx q[5],q[11]; 16 | cx q[9],q[3]; 17 | cx q[10],q[1]; 18 | cx q[8],q[5]; 19 | cx q[7],q[2]; 20 | cx q[8],q[4]; 21 | cx q[8],q[9]; 22 | cx q[2],q[8]; 23 | cx q[9],q[0]; 24 | cx q[4],q[7]; 25 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[12]; 4 | h q[1]; 5 | h q[2]; 6 | h q[4]; 7 | h q[6]; 8 | h q[8]; 9 | cx q[1],q[7]; 10 | cx q[6],q[9]; 11 | cx q[2],q[5]; 12 | cx q[7],q[0]; 13 | cx q[7],q[6]; 14 | cx q[4],q[10]; 15 | cx q[5],q[11]; 16 | cx q[9],q[3]; 17 | cx q[10],q[1]; 18 | cx q[8],q[5]; 19 | cx q[7],q[2]; 20 | cx q[8],q[4]; 21 | cx q[8],q[9]; 22 | cx q[2],q[8]; 23 | cx q[9],q[0]; 24 | cx q[4],q[7]; 25 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/carbon/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 1 2 4 6 8 2 | CX 1 7 6 9 2 5 7 0 7 6 4 10 5 11 9 3 10 1 8 5 7 2 8 4 8 9 2 8 9 0 4 7 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/cc_4_8_8/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 9 10 2 | CX 4 8 10 15 4 6 9 15 5 12 4 7 3 14 2 6 14 16 10 13 9 11 8 5 3 7 1 4 0 2 12 9 1 13 0 3 15 8 6 16 5 11 4 10 2 14 1 17 5 17 9 17 10 17 15 17 0 18 2 18 7 18 16 18 0 19 2 19 7 19 16 19 1 20 3 20 4 20 6 20 14 20 1 21 4 21 9 21 11 21 3 | MR 17 18 19 20 21 4 | H 22 5 | CX 22 0 22 25 22 1 22 26 22 8 22 10 22 27 22 11 22 12 22 25 6 | MR 25 7 | CX 22 14 22 27 8 | MR 27 9 | CX 22 26 10 | MR 26 11 | CX 22 16 12 | H 22 13 | MR 22 14 | H 23 15 | CX 23 5 23 28 23 10 23 12 23 28 16 | MR 28 17 | CX 23 13 18 | H 23 19 | MR 23 20 | H 24 21 | CX 24 1 24 29 24 4 24 10 24 29 22 | MR 29 23 | CX 24 13 24 | H 24 25 | MR 24 26 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/cc_4_8_8/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[17]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[9]; 11 | h q[10]; 12 | cx q[4],q[8]; 13 | cx q[10],q[15]; 14 | cx q[4],q[6]; 15 | cx q[9],q[15]; 16 | cx q[5],q[12]; 17 | cx q[4],q[7]; 18 | cx q[3],q[14]; 19 | cx q[2],q[6]; 20 | cx q[14],q[16]; 21 | cx q[10],q[13]; 22 | cx q[9],q[11]; 23 | cx q[8],q[5]; 24 | cx q[3],q[7]; 25 | cx q[1],q[4]; 26 | cx q[0],q[2]; 27 | cx q[12],q[9]; 28 | cx q[1],q[13]; 29 | cx q[0],q[3]; 30 | cx q[15],q[8]; 31 | cx q[6],q[16]; 32 | cx q[5],q[11]; 33 | cx q[4],q[10]; 34 | cx q[2],q[14]; 35 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/cc_4_8_8/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 9 10 2 | CX 4 8 10 15 4 6 9 15 5 12 4 7 3 14 2 6 14 16 10 13 9 11 8 5 3 7 1 4 0 2 12 9 1 13 0 3 15 8 6 16 5 11 4 10 2 14 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/cc_6_6_6/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 6 10 12 2 | CX 6 16 4 13 3 7 12 17 10 18 7 11 6 3 4 8 2 16 1 15 0 14 11 12 10 13 8 9 6 0 5 2 4 3 1 7 17 18 14 15 5 9 16 4 13 11 12 10 7 6 2 8 0 1 0 19 5 19 6 19 9 19 12 19 13 19 15 19 18 19 4 20 5 20 6 20 7 20 8 20 0 21 2 21 3 21 7 21 8 21 15 21 1 22 6 22 11 22 13 22 14 22 1 23 2 23 5 23 15 23 16 23 4 24 5 24 9 24 16 24 3 | MR 19 20 21 22 23 24 4 | H 25 5 | CX 25 1 25 31 25 2 25 32 25 4 25 5 25 33 25 10 25 11 25 31 6 | MR 31 7 | CX 25 15 25 33 8 | MR 33 9 | CX 25 32 10 | MR 32 11 | CX 25 17 12 | H 25 13 | MR 25 14 | H 26 15 | CX 26 1 26 34 26 3 26 35 26 5 26 7 26 34 16 | MR 34 17 | CX 26 9 26 35 18 | MR 35 19 | CX 26 14 20 | H 26 21 | MR 26 22 | H 27 23 | CX 27 0 27 36 27 1 27 14 27 36 24 | MR 36 25 | CX 27 15 26 | H 27 27 | MR 27 28 | H 28 29 | CX 28 1 28 37 28 3 28 38 28 12 28 13 28 37 30 | MR 37 31 | CX 28 15 28 38 32 | MR 38 33 | CX 28 18 34 | H 28 35 | MR 28 36 | H 29 37 | CX 29 2 29 39 29 3 29 40 29 9 29 12 29 39 38 | MR 39 39 | CX 29 16 29 40 40 | MR 40 41 | CX 29 17 42 | H 29 43 | MR 29 44 | H 30 45 | CX 30 0 30 41 30 3 30 42 30 5 30 7 30 41 46 | MR 41 47 | CX 30 9 30 42 48 | MR 42 49 | CX 30 15 50 | H 30 51 | MR 30 52 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/cc_6_6_6/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[19]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[6]; 11 | h q[10]; 12 | h q[12]; 13 | cx q[6],q[16]; 14 | cx q[4],q[13]; 15 | cx q[3],q[7]; 16 | cx q[12],q[17]; 17 | cx q[10],q[18]; 18 | cx q[7],q[11]; 19 | cx q[6],q[3]; 20 | cx q[4],q[8]; 21 | cx q[2],q[16]; 22 | cx q[1],q[15]; 23 | cx q[0],q[14]; 24 | cx q[11],q[12]; 25 | cx q[10],q[13]; 26 | cx q[8],q[9]; 27 | cx q[6],q[0]; 28 | cx q[5],q[2]; 29 | cx q[4],q[3]; 30 | cx q[1],q[7]; 31 | cx q[17],q[18]; 32 | cx q[14],q[15]; 33 | cx q[5],q[9]; 34 | cx q[16],q[4]; 35 | cx q[13],q[11]; 36 | cx q[12],q[10]; 37 | cx q[7],q[6]; 38 | cx q[2],q[8]; 39 | cx q[0],q[1]; 40 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/cc_6_6_6/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 3 4 5 6 10 12 2 | CX 6 16 4 13 3 7 12 17 10 18 7 11 6 3 4 8 2 16 1 15 0 14 11 12 10 13 8 9 6 0 5 2 4 3 1 7 17 18 14 15 5 9 16 4 13 11 12 10 7 6 2 8 0 1 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[2]; 5 | creg x_c[2]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[8]; 11 | h q[9]; 12 | h q[10]; 13 | h q[11]; 14 | h q[12]; 15 | h q[13]; 16 | h q[14]; 17 | cx q[11],q[7]; 18 | cx q[5],q[3]; 19 | cx q[2],q[1]; 20 | cx q[13],q[11]; 21 | cx q[9],q[7]; 22 | cx q[6],q[5]; 23 | cx q[4],q[3]; 24 | cx q[2],q[0]; 25 | cx q[14],q[13]; 26 | cx q[12],q[11]; 27 | cx q[10],q[9]; 28 | cx q[8],q[7]; 29 | cx q[5],q[1]; 30 | cx q[4],q[0]; 31 | cx q[6],q[2]; 32 | cx q[11],q[3]; 33 | cx q[9],q[1]; 34 | cx q[8],q[0]; 35 | cx q[13],q[5]; 36 | cx q[12],q[4]; 37 | cx q[10],q[2]; 38 | cx q[14],q[6]; 39 | h x_anc[0]; 40 | cx x_anc[0],q[0]; 41 | cx x_anc[0],q[2]; 42 | cx x_anc[0],q[4]; 43 | cx x_anc[0],q[6]; 44 | cx x_anc[0],q[7]; 45 | cx x_anc[0],q[9]; 46 | cx x_anc[0],q[11]; 47 | cx x_anc[0],q[13]; 48 | h x_anc[0]; 49 | h x_anc[1]; 50 | cx x_anc[1],q[5]; 51 | cx x_anc[1],q[9]; 52 | cx x_anc[1],q[12]; 53 | cx x_anc[1],q[13]; 54 | cx x_anc[1],q[14]; 55 | h x_anc[1]; 56 | measure x_anc[0] -> x_c[0]; 57 | measure x_anc[1] -> x_c[1]; 58 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 8 9 10 11 12 13 14 2 | CX 11 7 5 3 2 1 13 11 9 7 6 5 4 3 2 0 14 13 12 11 10 9 8 7 5 1 4 0 6 2 11 3 9 1 8 0 13 5 12 4 10 2 14 6 3 | H 15 4 | CX 15 0 15 2 15 4 15 6 15 7 15 9 15 11 15 13 5 | H 15 16 6 | CX 16 5 16 9 16 12 16 13 16 14 7 | H 16 8 | MR 15 16 9 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[2]; 5 | creg x_c[2]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[8]; 11 | h q[9]; 12 | h q[10]; 13 | h q[11]; 14 | h q[12]; 15 | h q[13]; 16 | h q[14]; 17 | cx q[11],q[7]; 18 | cx q[5],q[3]; 19 | cx q[2],q[1]; 20 | cx q[13],q[11]; 21 | cx q[9],q[7]; 22 | cx q[6],q[5]; 23 | cx q[4],q[3]; 24 | cx q[2],q[0]; 25 | cx q[14],q[13]; 26 | cx q[12],q[11]; 27 | cx q[10],q[9]; 28 | cx q[8],q[7]; 29 | cx q[5],q[1]; 30 | cx q[4],q[0]; 31 | cx q[6],q[2]; 32 | cx q[11],q[3]; 33 | cx q[9],q[1]; 34 | cx q[8],q[0]; 35 | cx q[13],q[5]; 36 | cx q[12],q[4]; 37 | cx q[10],q[2]; 38 | cx q[14],q[6]; 39 | h x_anc[0]; 40 | cx x_anc[0],q[5]; 41 | cx x_anc[0],q[10]; 42 | cx x_anc[0],q[12]; 43 | cx x_anc[1],q[1]; 44 | h x_anc[0]; 45 | h x_anc[1]; 46 | cx x_anc[1],q[3]; 47 | cx x_anc[1],q[8]; 48 | cx x_anc[1],q[14]; 49 | h x_anc[1]; 50 | measure x_anc[0] -> x_c[0]; 51 | measure x_anc[1] -> x_c[1]; 52 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 8 9 10 11 12 13 14 2 | CX 11 7 5 3 2 1 13 11 9 7 6 5 4 3 2 0 14 13 12 11 10 9 8 7 5 1 4 0 6 2 11 3 9 1 8 0 13 5 12 4 10 2 14 6 3 | H 15 4 | CX 15 5 15 10 15 12 16 1 5 | H 15 16 6 | CX 16 3 16 8 16 14 7 | H 16 8 | MR 15 16 9 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[2]; 5 | creg x_c[2]; 6 | h q[2]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[6]; 11 | h q[7]; 12 | h q[8]; 13 | h q[9]; 14 | h q[10]; 15 | h q[13]; 16 | h q[14]; 17 | cx q[10],q[0]; 18 | cx q[0],q[1]; 19 | cx q[7],q[1]; 20 | cx q[3],q[12]; 21 | cx q[6],q[10]; 22 | cx q[8],q[1]; 23 | cx q[4],q[11]; 24 | cx q[11],q[3]; 25 | cx q[13],q[11]; 26 | cx q[9],q[8]; 27 | cx q[14],q[0]; 28 | cx q[10],q[12]; 29 | cx q[3],q[1]; 30 | cx q[5],q[6]; 31 | cx q[0],q[11]; 32 | cx q[6],q[0]; 33 | cx q[7],q[0]; 34 | cx q[1],q[10]; 35 | cx q[11],q[1]; 36 | cx q[9],q[4]; 37 | cx q[2],q[4]; 38 | cx q[4],q[5]; 39 | h x_anc[0]; 40 | cx x_anc[0],q[0]; 41 | cx x_anc[0],q[9]; 42 | cx x_anc[0],q[10]; 43 | h x_anc[0]; 44 | measure x_anc[0] -> x_c[0]; 45 | h x_anc[1]; 46 | cx x_anc[1],q[4]; 47 | cx x_anc[1],q[8]; 48 | cx x_anc[1],q[11]; 49 | h x_anc[1]; 50 | measure x_anc[1] -> x_c[1]; 51 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 3 4 5 6 7 8 9 10 13 14 2 | CX 10 0 0 1 7 1 3 12 6 10 8 1 4 11 11 3 13 11 9 8 14 0 10 12 3 1 5 6 0 11 6 0 7 0 1 10 11 1 9 4 2 4 4 5 3 | H 15 4 | CX 15 0 15 9 15 10 5 | H 15 6 | MR 15 7 | H 16 8 | CX 16 4 16 8 16 11 9 | H 16 10 | MR 16 11 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | h q[8]; 9 | h q[9]; 10 | h q[10]; 11 | h q[11]; 12 | h q[12]; 13 | h q[13]; 14 | h q[14]; 15 | cx q[11],q[7]; 16 | cx q[5],q[3]; 17 | cx q[2],q[1]; 18 | cx q[13],q[11]; 19 | cx q[9],q[7]; 20 | cx q[6],q[5]; 21 | cx q[4],q[3]; 22 | cx q[2],q[0]; 23 | cx q[14],q[13]; 24 | cx q[12],q[11]; 25 | cx q[10],q[9]; 26 | cx q[8],q[7]; 27 | cx q[5],q[1]; 28 | cx q[4],q[0]; 29 | cx q[6],q[2]; 30 | cx q[11],q[3]; 31 | cx q[9],q[1]; 32 | cx q[8],q[0]; 33 | cx q[13],q[5]; 34 | cx q[12],q[4]; 35 | cx q[10],q[2]; 36 | cx q[14],q[6]; 37 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 8 9 10 11 12 13 14 2 | CX 11 7 5 3 2 1 13 11 9 7 6 5 4 3 2 0 14 13 12 11 10 9 8 7 5 1 4 0 6 2 11 3 9 1 8 0 13 5 12 4 10 2 14 6 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[7]; 11 | h q[8]; 12 | h q[9]; 13 | h q[12]; 14 | h q[13]; 15 | cx q[4],q[3]; 16 | cx q[2],q[11]; 17 | cx q[1],q[2]; 18 | cx q[3],q[10]; 19 | cx q[9],q[14]; 20 | cx q[14],q[4]; 21 | cx q[12],q[3]; 22 | cx q[11],q[9]; 23 | cx q[7],q[14]; 24 | cx q[0],q[12]; 25 | cx q[5],q[4]; 26 | cx q[2],q[3]; 27 | cx q[4],q[2]; 28 | cx q[8],q[4]; 29 | cx q[13],q[9]; 30 | cx q[3],q[8]; 31 | cx q[12],q[11]; 32 | cx q[8],q[11]; 33 | cx q[14],q[10]; 34 | cx q[6],q[10]; 35 | cx q[9],q[3]; 36 | cx q[10],q[11]; 37 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 5 6 7 8 9 12 13 2 | CX 4 3 2 11 1 2 3 10 9 14 14 4 12 3 11 9 7 14 0 12 5 4 2 3 4 2 8 4 13 9 3 8 12 11 8 11 14 10 6 10 9 3 10 11 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | h q[7]; 10 | cx q[7],q[11]; 11 | cx q[3],q[5]; 12 | cx q[1],q[2]; 13 | cx q[11],q[13]; 14 | cx q[7],q[9]; 15 | cx q[5],q[6]; 16 | cx q[3],q[4]; 17 | cx q[0],q[2]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[9],q[10]; 21 | cx q[7],q[8]; 22 | cx q[1],q[5]; 23 | cx q[0],q[4]; 24 | cx q[2],q[6]; 25 | cx q[3],q[11]; 26 | cx q[1],q[9]; 27 | cx q[0],q[8]; 28 | cx q[5],q[13]; 29 | cx q[4],q[12]; 30 | cx q[2],q[10]; 31 | cx q[6],q[14]; 32 | cx q[0],z_anc[0]; 33 | cx q[2],z_anc[0]; 34 | cx q[4],z_anc[0]; 35 | cx q[6],z_anc[0]; 36 | cx q[7],z_anc[0]; 37 | cx q[9],z_anc[0]; 38 | cx q[11],z_anc[0]; 39 | cx q[13],z_anc[0]; 40 | cx q[5],z_anc[1]; 41 | cx q[9],z_anc[1]; 42 | cx q[12],z_anc[1]; 43 | cx q[13],z_anc[1]; 44 | cx q[14],z_anc[1]; 45 | measure z_anc[0] -> z_c[0]; 46 | measure z_anc[1] -> z_c[1]; 47 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 7 2 | CX 7 11 3 5 1 2 11 13 7 9 5 6 3 4 0 2 13 14 11 12 9 10 7 8 1 5 0 4 2 6 3 11 1 9 0 8 5 13 4 12 2 10 6 14 0 15 2 15 4 15 6 15 7 15 9 15 11 15 13 15 5 16 9 16 12 16 13 16 14 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | h q[7]; 10 | cx q[7],q[11]; 11 | cx q[3],q[5]; 12 | cx q[1],q[2]; 13 | cx q[11],q[13]; 14 | cx q[7],q[9]; 15 | cx q[5],q[6]; 16 | cx q[3],q[4]; 17 | cx q[0],q[2]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[9],q[10]; 21 | cx q[7],q[8]; 22 | cx q[1],q[5]; 23 | cx q[0],q[4]; 24 | cx q[2],q[6]; 25 | cx q[3],q[11]; 26 | cx q[1],q[9]; 27 | cx q[0],q[8]; 28 | cx q[5],q[13]; 29 | cx q[4],q[12]; 30 | cx q[2],q[10]; 31 | cx q[6],q[14]; 32 | cx q[5],z_anc[0]; 33 | cx q[10],z_anc[0]; 34 | cx q[12],z_anc[0]; 35 | cx q[1],z_anc[1]; 36 | cx q[3],z_anc[1]; 37 | cx q[8],z_anc[1]; 38 | cx q[14],z_anc[1]; 39 | measure z_anc[0] -> z_c[0]; 40 | measure z_anc[1] -> z_c[1]; 41 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 7 2 | CX 7 11 3 5 1 2 11 13 7 9 5 6 3 4 0 2 13 14 11 12 9 10 7 8 1 5 0 4 2 6 3 11 1 9 0 8 5 13 4 12 2 10 6 14 5 15 10 15 12 15 1 16 3 16 8 16 14 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[11]; 9 | h q[12]; 10 | cx q[0],q[10]; 11 | cx q[1],q[0]; 12 | cx q[1],q[7]; 13 | cx q[12],q[3]; 14 | cx q[10],q[6]; 15 | cx q[1],q[8]; 16 | cx q[11],q[4]; 17 | cx q[3],q[11]; 18 | cx q[11],q[13]; 19 | cx q[8],q[9]; 20 | cx q[0],q[14]; 21 | cx q[12],q[10]; 22 | cx q[1],q[3]; 23 | cx q[6],q[5]; 24 | cx q[11],q[0]; 25 | cx q[0],q[6]; 26 | cx q[0],q[7]; 27 | cx q[10],q[1]; 28 | cx q[1],q[11]; 29 | cx q[4],q[9]; 30 | cx q[4],q[2]; 31 | cx q[5],q[4]; 32 | cx q[0],z_anc[0]; 33 | cx q[9],z_anc[0]; 34 | cx q[10],z_anc[0]; 35 | cx q[4],z_anc[1]; 36 | cx q[8],z_anc[1]; 37 | cx q[11],z_anc[1]; 38 | measure z_anc[0] -> z_c[0]; 39 | measure z_anc[1] -> z_c[1]; 40 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 11 12 2 | CX 0 10 1 0 1 7 12 3 10 6 1 8 11 4 3 11 11 13 8 9 0 14 12 10 1 3 6 5 11 0 0 6 0 7 10 1 1 11 4 9 4 2 5 4 0 15 9 15 10 15 4 16 8 16 11 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | h q[7]; 10 | cx q[7],q[11]; 11 | cx q[3],q[5]; 12 | cx q[1],q[2]; 13 | cx q[11],q[13]; 14 | cx q[7],q[9]; 15 | cx q[5],q[6]; 16 | cx q[3],q[4]; 17 | cx q[0],q[2]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[9],q[10]; 21 | cx q[7],q[8]; 22 | cx q[1],q[5]; 23 | cx q[0],q[4]; 24 | cx q[2],q[6]; 25 | cx q[3],q[11]; 26 | cx q[1],q[9]; 27 | cx q[0],q[8]; 28 | cx q[5],q[13]; 29 | cx q[4],q[12]; 30 | cx q[2],q[10]; 31 | cx q[6],q[14]; 32 | cx q[0],z_anc[0]; 33 | cx q[2],z_anc[0]; 34 | cx q[4],z_anc[0]; 35 | cx q[6],z_anc[0]; 36 | cx q[7],z_anc[0]; 37 | cx q[9],z_anc[0]; 38 | cx q[11],z_anc[0]; 39 | cx q[13],z_anc[0]; 40 | cx q[5],z_anc[1]; 41 | cx q[9],z_anc[1]; 42 | cx q[12],z_anc[1]; 43 | cx q[13],z_anc[1]; 44 | cx q[14],z_anc[1]; 45 | measure z_anc[0] -> z_c[0]; 46 | measure z_anc[1] -> z_c[1]; 47 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 7 2 | CX 7 11 3 5 1 2 11 13 7 9 5 6 3 4 0 2 13 14 11 12 9 10 7 8 1 5 0 4 2 6 3 11 1 9 0 8 5 13 4 12 2 10 6 14 0 15 2 15 4 15 6 15 7 15 9 15 11 15 13 15 5 16 9 16 12 16 13 16 14 16 3 | MR 15 16 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[0]; 5 | h q[1]; 6 | h q[11]; 7 | h q[12]; 8 | cx q[0],q[10]; 9 | cx q[1],q[0]; 10 | cx q[1],q[7]; 11 | cx q[12],q[3]; 12 | cx q[10],q[6]; 13 | cx q[1],q[8]; 14 | cx q[11],q[4]; 15 | cx q[3],q[11]; 16 | cx q[11],q[13]; 17 | cx q[8],q[9]; 18 | cx q[0],q[14]; 19 | cx q[12],q[10]; 20 | cx q[1],q[3]; 21 | cx q[6],q[5]; 22 | cx q[11],q[0]; 23 | cx q[0],q[6]; 24 | cx q[0],q[7]; 25 | cx q[10],q[1]; 26 | cx q[1],q[11]; 27 | cx q[4],q[9]; 28 | cx q[4],q[2]; 29 | cx q[5],q[4]; 30 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/hamming/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 11 12 2 | CX 0 10 1 0 1 7 12 3 10 6 1 8 11 4 3 11 11 13 8 9 0 14 12 10 1 3 6 5 11 0 0 6 0 7 10 1 1 11 4 9 4 2 5 4 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[7]; 11 | cx q[7],q[3]; 12 | cx q[5],q[1]; 13 | cx q[4],q[3]; 14 | cx q[2],q[1]; 15 | cx q[7],q[8]; 16 | cx q[6],q[3]; 17 | cx q[4],q[2]; 18 | cx q[1],q[0]; 19 | h x_anc[0]; 20 | cx x_anc[0],q[2]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 7 2 | CX 7 3 5 1 4 3 2 1 7 8 6 3 4 2 1 0 3 | H 9 4 | CX 9 2 9 5 5 | H 9 6 | MR 9 7 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | h q[7]; 11 | cx q[7],q[3]; 12 | cx q[5],q[1]; 13 | cx q[4],q[3]; 14 | cx q[2],q[1]; 15 | cx q[7],q[8]; 16 | cx q[6],q[3]; 17 | cx q[4],q[2]; 18 | cx q[1],q[0]; 19 | h x_anc[0]; 20 | cx x_anc[0],q[2]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 7 2 | CX 7 3 5 1 4 3 2 1 7 8 6 3 4 2 1 0 3 | H 9 4 | CX 9 2 9 5 5 | H 9 6 | MR 9 7 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[0]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | h q[7]; 11 | cx q[0],q[1]; 12 | cx q[4],q[2]; 13 | cx q[7],q[8]; 14 | cx q[3],q[6]; 15 | cx q[1],q[2]; 16 | cx q[5],q[4]; 17 | cx q[8],q[3]; 18 | cx q[4],q[6]; 19 | h x_anc[0]; 20 | cx x_anc[0],q[2]; 21 | cx x_anc[0],q[3]; 22 | cx x_anc[0],q[4]; 23 | h x_anc[0]; 24 | measure x_anc[0] -> x_c[0]; 25 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 7 2 | CX 0 1 4 2 7 8 3 6 1 2 5 4 8 3 4 6 3 | H 9 4 | CX 9 2 9 3 9 4 5 | H 9 6 | MR 9 7 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | h q[7]; 9 | cx q[7],q[3]; 10 | cx q[5],q[1]; 11 | cx q[4],q[3]; 12 | cx q[2],q[1]; 13 | cx q[7],q[8]; 14 | cx q[6],q[3]; 15 | cx q[4],q[2]; 16 | cx q[1],q[0]; 17 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 7 2 | CX 5 1 7 3 2 1 4 3 7 8 1 0 4 2 6 3 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[3]; 6 | h q[4]; 7 | h q[5]; 8 | h q[7]; 9 | cx q[0],q[1]; 10 | cx q[4],q[2]; 11 | cx q[7],q[8]; 12 | cx q[3],q[6]; 13 | cx q[1],q[2]; 14 | cx q[5],q[4]; 15 | cx q[8],q[3]; 16 | cx q[4],q[6]; 17 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 7 2 | CX 0 1 4 2 7 8 3 6 1 2 5 4 8 3 4 6 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[2]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[8]; 11 | cx q[0],q[4]; 12 | cx q[5],q[7]; 13 | cx q[0],q[3]; 14 | cx q[7],q[4]; 15 | cx q[6],q[3]; 16 | cx q[2],q[5]; 17 | cx q[0],q[1]; 18 | cx q[0],z_anc[0]; 19 | cx q[2],z_anc[0]; 20 | cx q[4],z_anc[0]; 21 | cx q[5],z_anc[0]; 22 | measure z_anc[0] -> z_c[0]; 23 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 5 6 2 | CX 5 8 0 4 5 7 0 3 7 4 6 3 2 5 0 1 0 9 2 9 4 9 5 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[2]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[8]; 11 | cx q[0],q[4]; 12 | cx q[5],q[7]; 13 | cx q[0],q[3]; 14 | cx q[7],q[4]; 15 | cx q[6],q[3]; 16 | cx q[2],q[5]; 17 | cx q[0],q[1]; 18 | cx q[0],z_anc[0]; 19 | cx q[4],z_anc[0]; 20 | cx q[8],z_anc[0]; 21 | measure z_anc[0] -> z_c[0]; 22 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 2 5 6 2 | CX 5 8 0 4 5 7 0 3 7 4 6 3 2 5 0 1 0 9 4 9 8 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[3]; 7 | h q[4]; 8 | h q[5]; 9 | h q[8]; 10 | cx q[8],q[0]; 11 | cx q[0],q[1]; 12 | cx q[3],q[6]; 13 | cx q[5],q[2]; 14 | cx q[4],q[8]; 15 | cx q[8],q[5]; 16 | cx q[1],q[3]; 17 | cx q[8],q[7]; 18 | cx q[1],z_anc[0]; 19 | cx q[4],z_anc[0]; 20 | cx q[7],z_anc[0]; 21 | measure z_anc[0] -> z_c[0]; 22 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 3 4 5 8 2 | CX 8 0 0 1 3 6 5 2 4 8 8 5 1 3 8 7 1 9 4 9 7 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[2]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[5],q[8]; 9 | cx q[0],q[4]; 10 | cx q[5],q[7]; 11 | cx q[0],q[3]; 12 | cx q[7],q[4]; 13 | cx q[6],q[3]; 14 | cx q[2],q[5]; 15 | cx q[0],q[1]; 16 | cx q[0],z_anc[0]; 17 | cx q[2],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[5],z_anc[0]; 20 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 5 6 2 | CX 0 4 5 8 0 3 5 7 0 1 2 5 6 3 7 4 0 9 2 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[3]; 5 | h q[4]; 6 | h q[5]; 7 | h q[8]; 8 | cx q[8],q[0]; 9 | cx q[0],q[1]; 10 | cx q[3],q[6]; 11 | cx q[5],q[2]; 12 | cx q[4],q[8]; 13 | cx q[8],q[5]; 14 | cx q[1],q[3]; 15 | cx q[8],q[7]; 16 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d3/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 3 4 5 8 2 | CX 8 0 0 1 3 6 5 2 4 8 8 5 1 3 8 7 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d5/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 5 7 11 14 15 18 21 24 30 31 32 33 2 | CX 2 3 1 6 4 9 5 10 7 13 11 17 14 19 15 20 18 23 1 2 4 3 7 8 11 12 14 13 18 22 24 23 0 1 6 7 8 12 11 16 18 17 21 22 2 25 5 6 9 8 10 11 15 16 19 18 20 21 3 25 2 27 30 1 6 25 3 27 31 1 30 34 8 25 7 27 6 28 30 3 31 38 10 25 8 26 7 28 31 3 30 35 13 25 9 26 8 27 11 28 30 6 16 25 13 26 30 8 31 6 3 | MR 27 4 | CX 17 25 15 26 13 28 30 36 31 38 19 25 16 26 30 11 31 7 5 | MR 38 6 | CX 21 25 17 26 16 29 30 13 7 | H 31 8 | CX 32 7 22 25 18 26 17 28 30 37 32 39 9 | MR 31 10 | CX 18 28 17 29 30 16 32 8 11 | MR 25 26 12 | CX 21 29 30 36 32 40 13 | MR 28 14 | CX 22 29 30 18 32 11 15 | MR 36 16 | CX 32 13 30 34 17 | MR 29 18 | CX 30 21 32 39 19 | MR 34 20 | CX 32 16 30 37 21 | MR 39 22 | CX 30 35 32 40 23 | MR 37 24 | CX 30 23 32 17 25 | MR 35 40 26 | H 30 32 27 | CX 33 17 33 41 28 | MR 30 32 29 | CX 33 18 33 21 33 41 33 23 30 | MR 41 31 | H 33 32 | MR 33 33 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d5/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[25]; 4 | h q[0]; 5 | h q[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[7]; 10 | h q[11]; 11 | h q[14]; 12 | h q[15]; 13 | h q[18]; 14 | h q[21]; 15 | h q[24]; 16 | cx q[18],q[23]; 17 | cx q[11],q[17]; 18 | cx q[7],q[13]; 19 | cx q[18],q[22]; 20 | cx q[11],q[12]; 21 | cx q[7],q[8]; 22 | cx q[2],q[3]; 23 | cx q[1],q[6]; 24 | cx q[21],q[22]; 25 | cx q[18],q[17]; 26 | cx q[15],q[20]; 27 | cx q[14],q[19]; 28 | cx q[11],q[16]; 29 | cx q[8],q[12]; 30 | cx q[6],q[7]; 31 | cx q[5],q[10]; 32 | cx q[4],q[9]; 33 | cx q[1],q[2]; 34 | cx q[24],q[23]; 35 | cx q[20],q[21]; 36 | cx q[19],q[18]; 37 | cx q[15],q[16]; 38 | cx q[14],q[13]; 39 | cx q[10],q[11]; 40 | cx q[9],q[8]; 41 | cx q[5],q[6]; 42 | cx q[4],q[3]; 43 | cx q[0],q[1]; 44 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/rotated_surface_d5/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 5 7 11 14 15 18 21 24 2 | CX 2 3 1 6 4 9 5 10 7 13 11 17 14 19 15 20 18 23 1 2 4 3 7 8 11 12 14 13 18 22 24 23 0 1 6 7 8 12 11 16 18 17 21 22 5 6 9 8 10 11 15 16 19 18 20 21 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[5]; 6 | h q[8]; 7 | cx q[8],q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[7]; 11 | cx q[3],q[4]; 12 | cx q[0],q[1]; 13 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 5 8 2 | CX 2 0 5 3 8 6 0 1 3 4 6 7 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[5]; 6 | h q[8]; 7 | cx q[8],q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[7]; 11 | cx q[3],q[4]; 12 | cx q[0],q[1]; 13 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 5 8 2 | CX 2 0 5 3 8 6 0 1 3 4 6 7 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[4]; 6 | h q[6]; 7 | cx q[2],q[0]; 8 | cx q[4],q[5]; 9 | cx q[6],q[7]; 10 | cx q[5],q[3]; 11 | cx q[7],q[8]; 12 | cx q[2],q[1]; 13 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 2 | CX 2 0 4 5 6 7 2 1 5 3 7 8 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[5]; 6 | h q[8]; 7 | cx q[8],q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[7]; 11 | cx q[3],q[4]; 12 | cx q[0],q[1]; 13 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 5 8 2 | CX 2 0 5 3 8 6 0 1 3 4 6 7 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[4]; 6 | h q[6]; 7 | cx q[2],q[0]; 8 | cx q[4],q[5]; 9 | cx q[6],q[7]; 10 | cx q[5],q[3]; 11 | cx q[7],q[8]; 12 | cx q[2],q[1]; 13 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 2 | CX 2 0 4 5 6 7 2 1 5 3 7 8 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[2]; 8 | cx q[2],q[6]; 9 | cx q[0],q[3]; 10 | cx q[6],q[8]; 11 | cx q[3],q[4]; 12 | cx q[2],q[0]; 13 | cx q[6],q[7]; 14 | cx q[4],q[5]; 15 | cx q[3],q[2]; 16 | cx q[0],q[1]; 17 | cx q[3],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[1],z_anc[1]; 20 | cx q[3],z_anc[1]; 21 | cx q[7],z_anc[1]; 22 | measure z_anc[0] -> z_c[0]; 23 | measure z_anc[1] -> z_c[1]; 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 2 | CX 0 3 2 6 2 0 3 4 6 8 0 1 3 2 4 5 6 7 3 9 1 10 4 9 3 10 7 10 3 | MR 9 10 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[2]; 5 | creg z_c[2]; 6 | h q[0]; 7 | h q[2]; 8 | cx q[2],q[6]; 9 | cx q[0],q[3]; 10 | cx q[6],q[8]; 11 | cx q[3],q[4]; 12 | cx q[2],q[0]; 13 | cx q[6],q[7]; 14 | cx q[4],q[5]; 15 | cx q[3],q[2]; 16 | cx q[0],q[1]; 17 | cx q[1],z_anc[0]; 18 | cx q[2],z_anc[0]; 19 | cx q[2],z_anc[1]; 20 | cx q[5],z_anc[1]; 21 | cx q[7],z_anc[1]; 22 | measure z_anc[0] -> z_c[0]; 23 | measure z_anc[1] -> z_c[1]; 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 2 2 | CX 0 3 2 6 2 0 3 4 6 8 0 1 3 2 4 5 6 7 1 9 2 9 2 10 3 | MR 9 4 | CX 5 10 7 10 5 | MR 10 6 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[2]; 7 | h q[7]; 8 | cx q[7],q[4]; 9 | cx q[2],q[7]; 10 | cx q[2],q[0]; 11 | cx q[4],q[5]; 12 | cx q[7],q[8]; 13 | cx q[4],q[3]; 14 | cx q[7],q[6]; 15 | cx q[0],q[1]; 16 | cx q[1],z_anc[0]; 17 | cx q[4],z_anc[0]; 18 | cx q[7],z_anc[0]; 19 | measure z_anc[0] -> z_c[0]; 20 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 7 2 | CX 7 4 4 5 2 7 2 0 4 3 7 8 0 1 7 6 1 9 4 9 7 9 3 | MR 9 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[0]; 5 | h q[2]; 6 | cx q[2],q[6]; 7 | cx q[0],q[3]; 8 | cx q[6],q[8]; 9 | cx q[3],q[4]; 10 | cx q[2],q[0]; 11 | cx q[6],q[7]; 12 | cx q[4],q[5]; 13 | cx q[3],q[2]; 14 | cx q[0],q[1]; 15 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 2 2 | CX 0 3 2 6 2 0 3 4 6 8 0 1 3 2 4 5 6 7 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[9]; 4 | h q[2]; 5 | h q[7]; 6 | cx q[7],q[4]; 7 | cx q[2],q[7]; 8 | cx q[2],q[0]; 9 | cx q[4],q[5]; 10 | cx q[7],q[8]; 11 | cx q[4],q[3]; 12 | cx q[7],q[6]; 13 | cx q[0],q[1]; 14 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/shor/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 7 2 | CX 7 4 4 5 2 7 2 0 4 3 7 8 0 1 7 6 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[3]; 11 | cx q[2],q[0]; 12 | cx q[6],q[5]; 13 | cx q[4],q[3]; 14 | cx q[0],q[1]; 15 | cx q[6],q[2]; 16 | cx q[5],q[1]; 17 | cx q[4],q[0]; 18 | h x_anc[0]; 19 | cx x_anc[0],q[2]; 20 | cx x_anc[0],q[4]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 2 | CX 5 3 2 0 6 5 4 3 0 1 6 2 5 1 4 0 3 | H 7 4 | CX 7 2 7 4 7 5 5 | H 7 6 | MR 7 7 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[5]; 9 | h q[6]; 10 | cx q[5],q[3]; 11 | cx q[2],q[0]; 12 | cx q[6],q[5]; 13 | cx q[4],q[3]; 14 | cx q[0],q[1]; 15 | cx q[6],q[2]; 16 | cx q[5],q[1]; 17 | cx q[4],q[0]; 18 | h x_anc[0]; 19 | cx x_anc[0],q[2]; 20 | cx x_anc[0],q[4]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 2 | CX 5 3 2 0 6 5 4 3 0 1 6 2 5 1 4 0 3 | H 7 4 | CX 7 2 7 4 7 5 5 | H 7 6 | MR 7 7 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[0]; 7 | h q[3]; 8 | h q[4]; 9 | h q[5]; 10 | cx q[3],q[1]; 11 | cx q[4],q[3]; 12 | cx q[4],q[6]; 13 | cx q[0],q[2]; 14 | cx q[5],q[0]; 15 | cx q[5],q[6]; 16 | cx q[2],q[3]; 17 | cx q[3],q[5]; 18 | h x_anc[0]; 19 | cx x_anc[0],q[2]; 20 | cx x_anc[0],q[4]; 21 | cx x_anc[0],q[5]; 22 | h x_anc[0]; 23 | measure x_anc[0] -> x_c[0]; 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 2 | CX 3 1 4 3 4 6 0 2 5 0 5 6 2 3 3 5 3 | H 7 4 | CX 7 2 7 4 7 5 5 | H 7 6 | MR 7 7 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[2]; 5 | h q[4]; 6 | h q[5]; 7 | h q[6]; 8 | cx q[5],q[3]; 9 | cx q[2],q[0]; 10 | cx q[6],q[5]; 11 | cx q[4],q[3]; 12 | cx q[0],q[1]; 13 | cx q[6],q[2]; 14 | cx q[5],q[1]; 15 | cx q[4],q[0]; 16 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 5 6 2 | CX 5 3 2 0 6 5 4 3 0 1 6 2 5 1 4 0 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[3]; 6 | h q[4]; 7 | h q[5]; 8 | cx q[3],q[1]; 9 | cx q[4],q[3]; 10 | cx q[4],q[6]; 11 | cx q[0],q[2]; 12 | cx q[5],q[0]; 13 | cx q[5],q[6]; 14 | cx q[2],q[3]; 15 | cx q[3],q[5]; 16 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/plus_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 4 5 2 | CX 3 1 4 3 4 6 0 2 5 0 5 6 2 3 3 5 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | cx q[3],q[5]; 10 | cx q[0],q[2]; 11 | cx q[5],q[6]; 12 | cx q[3],q[4]; 13 | cx q[1],q[0]; 14 | cx q[2],q[6]; 15 | cx q[1],q[5]; 16 | cx q[0],q[4]; 17 | cx q[2],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[5],z_anc[0]; 20 | measure z_anc[0] -> z_c[0]; 21 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 2 | CX 3 5 0 2 5 6 3 4 1 0 2 6 1 5 0 4 2 7 4 7 5 7 3 | MR 7 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | cx q[3],q[5]; 10 | cx q[0],q[2]; 11 | cx q[5],q[6]; 12 | cx q[3],q[4]; 13 | cx q[1],q[0]; 14 | cx q[2],q[6]; 15 | cx q[1],q[5]; 16 | cx q[0],q[4]; 17 | cx q[1],z_anc[0]; 18 | cx q[4],z_anc[0]; 19 | cx q[6],z_anc[0]; 20 | measure z_anc[0] -> z_c[0]; 21 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 2 | CX 3 5 0 2 5 6 3 4 1 0 2 6 1 5 0 4 1 7 4 7 6 7 3 | MR 7 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[3]; 8 | h q[5]; 9 | cx q[3],q[1]; 10 | cx q[5],q[4]; 11 | cx q[0],q[2]; 12 | cx q[4],q[3]; 13 | cx q[1],q[0]; 14 | cx q[1],q[6]; 15 | cx q[2],q[4]; 16 | cx q[4],q[6]; 17 | cx q[2],z_anc[0]; 18 | cx q[3],z_anc[0]; 19 | cx q[6],z_anc[0]; 20 | measure z_anc[0] -> z_c[0]; 21 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 5 2 | CX 3 1 5 4 0 2 4 3 1 0 1 6 2 4 4 6 2 7 3 7 6 7 3 | MR 7 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[1]; 6 | h q[3]; 7 | cx q[3],q[5]; 8 | cx q[0],q[2]; 9 | cx q[5],q[6]; 10 | cx q[3],q[4]; 11 | cx q[1],q[0]; 12 | cx q[2],q[6]; 13 | cx q[1],q[5]; 14 | cx q[0],q[4]; 15 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 3 2 | CX 3 5 0 2 5 6 3 4 1 0 2 6 1 5 0 4 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[7]; 4 | h q[0]; 5 | h q[3]; 6 | h q[5]; 7 | cx q[3],q[1]; 8 | cx q[5],q[4]; 9 | cx q[0],q[2]; 10 | cx q[4],q[3]; 11 | cx q[1],q[0]; 12 | cx q[1],q[6]; 13 | cx q[2],q[4]; 14 | cx q[4],q[6]; 15 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/steane/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 3 5 2 | CX 3 1 5 4 0 2 4 3 1 0 1 6 2 4 4 6 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/plus_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[6]; 9 | h q[10]; 10 | h q[13]; 11 | cx q[13],q[11]; 12 | cx q[11],q[12]; 13 | cx q[6],q[5]; 14 | cx q[10],q[3]; 15 | cx q[4],q[1]; 16 | cx q[11],q[9]; 17 | cx q[12],q[8]; 18 | cx q[4],q[7]; 19 | cx q[3],q[5]; 20 | cx q[2],q[1]; 21 | cx q[7],q[14]; 22 | cx q[6],q[13]; 23 | cx q[2],q[9]; 24 | cx q[1],q[8]; 25 | cx q[3],q[0]; 26 | cx q[5],q[4]; 27 | cx q[13],q[14]; 28 | cx q[9],q[10]; 29 | cx q[1],q[0]; 30 | cx q[4],q[12]; 31 | cx q[6],q[7]; 32 | cx q[5],q[11]; 33 | cx q[2],q[3]; 34 | h x_anc[0]; 35 | cx x_anc[0],q[1]; 36 | cx x_anc[0],q[3]; 37 | cx x_anc[0],q[5]; 38 | cx x_anc[0],q[7]; 39 | cx x_anc[0],q[9]; 40 | cx x_anc[0],q[12]; 41 | cx x_anc[0],q[13]; 42 | h x_anc[0]; 43 | measure x_anc[0] -> x_c[0]; 44 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/plus_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 10 13 15 2 | CX 4 1 6 5 10 3 13 11 2 1 3 5 4 7 11 12 6 13 3 0 5 4 11 9 12 8 7 14 6 7 1 8 2 9 5 11 4 12 13 14 1 0 2 3 9 10 15 1 15 3 15 5 15 7 15 9 15 12 15 13 3 | H 15 4 | MR 15 5 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/plus_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg x_anc[1]; 5 | creg x_c[1]; 6 | h q[2]; 7 | h q[4]; 8 | h q[6]; 9 | h q[10]; 10 | h q[13]; 11 | cx q[13],q[11]; 12 | cx q[11],q[12]; 13 | cx q[6],q[5]; 14 | cx q[10],q[3]; 15 | cx q[4],q[1]; 16 | cx q[11],q[9]; 17 | cx q[12],q[8]; 18 | cx q[4],q[7]; 19 | cx q[3],q[5]; 20 | cx q[2],q[1]; 21 | cx q[7],q[14]; 22 | cx q[6],q[13]; 23 | cx q[2],q[9]; 24 | cx q[1],q[8]; 25 | cx q[3],q[0]; 26 | cx q[5],q[4]; 27 | cx q[13],q[14]; 28 | cx q[9],q[10]; 29 | cx q[1],q[0]; 30 | cx q[4],q[12]; 31 | cx q[6],q[7]; 32 | cx q[5],q[11]; 33 | cx q[2],q[3]; 34 | h x_anc[0]; 35 | cx x_anc[0],q[1]; 36 | cx x_anc[0],q[3]; 37 | cx x_anc[0],q[5]; 38 | cx x_anc[0],q[7]; 39 | cx x_anc[0],q[9]; 40 | cx x_anc[0],q[12]; 41 | cx x_anc[0],q[13]; 42 | h x_anc[0]; 43 | measure x_anc[0] -> x_c[0]; 44 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/plus_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 10 13 15 2 | CX 4 1 6 5 10 3 13 11 2 1 3 5 4 7 11 12 6 13 3 0 5 4 11 9 12 8 7 14 6 7 1 8 2 9 5 11 4 12 13 14 1 0 2 3 9 10 15 1 15 3 15 5 15 7 15 9 15 12 15 13 3 | H 15 4 | MR 15 5 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/plus_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[4]; 6 | h q[6]; 7 | h q[10]; 8 | h q[13]; 9 | cx q[13],q[11]; 10 | cx q[11],q[12]; 11 | cx q[6],q[5]; 12 | cx q[10],q[3]; 13 | cx q[4],q[1]; 14 | cx q[11],q[9]; 15 | cx q[12],q[8]; 16 | cx q[4],q[7]; 17 | cx q[3],q[5]; 18 | cx q[2],q[1]; 19 | cx q[7],q[14]; 20 | cx q[6],q[13]; 21 | cx q[2],q[9]; 22 | cx q[1],q[8]; 23 | cx q[3],q[0]; 24 | cx q[5],q[4]; 25 | cx q[13],q[14]; 26 | cx q[9],q[10]; 27 | cx q[1],q[0]; 28 | cx q[4],q[12]; 29 | cx q[6],q[7]; 30 | cx q[5],q[11]; 31 | cx q[2],q[3]; 32 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/plus_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 4 6 10 13 2 | CX 4 1 6 5 10 3 13 11 2 1 3 5 4 7 11 12 6 13 3 0 5 4 11 9 12 8 7 14 6 7 1 8 2 9 5 11 4 12 13 14 1 0 2 3 9 10 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_ft_heuristic_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[4]; 10 | cx q[4],q[11]; 11 | cx q[2],q[9]; 12 | cx q[1],q[8]; 13 | cx q[11],q[13]; 14 | cx q[9],q[10]; 15 | cx q[4],q[6]; 16 | cx q[2],q[3]; 17 | cx q[0],q[1]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[8],q[9]; 21 | cx q[6],q[7]; 22 | cx q[4],q[5]; 23 | cx q[0],q[3]; 24 | cx q[1],q[2]; 25 | cx q[10],q[13]; 26 | cx q[8],q[12]; 27 | cx q[0],q[7]; 28 | cx q[9],q[11]; 29 | cx q[3],q[6]; 30 | cx q[1],q[4]; 31 | cx q[2],q[5]; 32 | cx q[3],z_anc[0]; 33 | cx q[4],z_anc[0]; 34 | cx q[11],z_anc[0]; 35 | measure z_anc[0] -> z_c[0]; 36 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_ft_heuristic_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 2 | CX 1 8 2 9 4 11 0 1 2 3 4 6 9 10 11 13 1 2 0 3 4 5 6 7 8 9 11 12 13 14 1 4 2 5 3 6 0 7 9 11 8 12 10 13 3 15 4 15 11 15 3 | MR 15 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_ft_heuristic_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[4]; 10 | cx q[4],q[11]; 11 | cx q[2],q[9]; 12 | cx q[1],q[8]; 13 | cx q[11],q[13]; 14 | cx q[9],q[10]; 15 | cx q[4],q[6]; 16 | cx q[2],q[3]; 17 | cx q[0],q[1]; 18 | cx q[13],q[14]; 19 | cx q[11],q[12]; 20 | cx q[8],q[9]; 21 | cx q[6],q[7]; 22 | cx q[4],q[5]; 23 | cx q[0],q[3]; 24 | cx q[1],q[2]; 25 | cx q[10],q[13]; 26 | cx q[8],q[12]; 27 | cx q[0],q[7]; 28 | cx q[9],q[11]; 29 | cx q[3],q[6]; 30 | cx q[1],q[4]; 31 | cx q[2],q[5]; 32 | cx q[0],z_anc[0]; 33 | cx q[5],z_anc[0]; 34 | cx q[11],z_anc[0]; 35 | measure z_anc[0] -> z_c[0]; 36 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_ft_heuristic_opt.stim: -------------------------------------------------------------------------------- 1 | H 0 1 2 4 2 | CX 1 8 2 9 4 11 0 1 2 3 4 6 9 10 11 13 1 2 0 3 4 5 6 7 8 9 11 12 13 14 1 4 2 5 3 6 0 7 9 11 8 12 10 13 0 15 5 15 11 15 3 | MR 15 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_ft_opt_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | qreg z_anc[1]; 5 | creg z_c[1]; 6 | h q[2]; 7 | h q[6]; 8 | h q[7]; 9 | h q[14]; 10 | cx q[6],q[9]; 11 | cx q[7],q[11]; 12 | cx q[2],q[11]; 13 | cx q[14],q[3]; 14 | cx q[3],q[1]; 15 | cx q[11],q[6]; 16 | cx q[7],q[12]; 17 | cx q[9],q[1]; 18 | cx q[14],q[7]; 19 | cx q[2],q[0]; 20 | cx q[7],q[13]; 21 | cx q[0],q[8]; 22 | cx q[6],q[14]; 23 | cx q[11],q[7]; 24 | cx q[13],q[5]; 25 | cx q[1],q[13]; 26 | cx q[7],q[10]; 27 | cx q[6],q[7]; 28 | cx q[11],q[4]; 29 | cx q[3],q[11]; 30 | cx q[9],q[2]; 31 | cx q[1],q[8]; 32 | cx q[1],z_anc[0]; 33 | cx q[2],z_anc[0]; 34 | cx q[10],z_anc[0]; 35 | measure z_anc[0] -> z_c[0]; 36 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_ft_opt_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 6 7 14 2 | CX 6 9 7 11 14 3 3 1 2 11 7 12 2 0 9 1 11 6 14 7 0 8 9 2 7 13 6 14 11 7 13 5 7 10 11 4 1 13 6 7 1 8 3 11 1 15 2 15 10 15 3 | MR 15 4 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_non_ft_heuristic.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[6]; 6 | h q[7]; 7 | h q[14]; 8 | cx q[6],q[9]; 9 | cx q[7],q[11]; 10 | cx q[2],q[11]; 11 | cx q[14],q[3]; 12 | cx q[3],q[1]; 13 | cx q[11],q[6]; 14 | cx q[7],q[12]; 15 | cx q[9],q[1]; 16 | cx q[14],q[7]; 17 | cx q[2],q[0]; 18 | cx q[7],q[13]; 19 | cx q[0],q[8]; 20 | cx q[6],q[14]; 21 | cx q[11],q[7]; 22 | cx q[13],q[5]; 23 | cx q[1],q[13]; 24 | cx q[7],q[10]; 25 | cx q[6],q[7]; 26 | cx q[11],q[4]; 27 | cx q[3],q[11]; 28 | cx q[9],q[2]; 29 | cx q[1],q[8]; 30 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_non_ft_heuristic.stim: -------------------------------------------------------------------------------- 1 | H 2 6 7 14 2 | CX 6 9 7 11 14 3 3 1 2 11 7 12 2 0 9 1 11 6 14 7 0 8 9 2 7 13 6 14 11 7 13 5 7 10 11 4 1 13 6 7 1 8 3 11 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_non_ft_opt.qasm: -------------------------------------------------------------------------------- 1 | OPENQASM 2.0; 2 | include "qelib1.inc"; 3 | qreg q[15]; 4 | h q[2]; 5 | h q[6]; 6 | h q[7]; 7 | h q[14]; 8 | cx q[6],q[9]; 9 | cx q[7],q[11]; 10 | cx q[2],q[11]; 11 | cx q[14],q[3]; 12 | cx q[3],q[1]; 13 | cx q[11],q[6]; 14 | cx q[7],q[12]; 15 | cx q[9],q[1]; 16 | cx q[14],q[7]; 17 | cx q[2],q[0]; 18 | cx q[7],q[13]; 19 | cx q[0],q[8]; 20 | cx q[6],q[14]; 21 | cx q[11],q[7]; 22 | cx q[13],q[5]; 23 | cx q[1],q[13]; 24 | cx q[7],q[10]; 25 | cx q[6],q[7]; 26 | cx q[11],q[4]; 27 | cx q[3],q[11]; 28 | cx q[9],q[2]; 29 | cx q[1],q[8]; 30 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/circuits/tetrahedral/zero_non_ft_opt.stim: -------------------------------------------------------------------------------- 1 | H 2 6 7 14 2 | CX 6 9 7 11 14 3 3 1 2 11 7 12 2 0 9 1 11 6 14 7 0 8 9 2 7 13 6 14 11 7 13 5 7 10 11 4 1 13 6 7 1 8 3 11 3 | -------------------------------------------------------------------------------- /src/mqt/qecc/circuit_synthesis/stateprep_eval/run_eval_on_code.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 3 | # All rights reserved. 4 | # 5 | # SPDX-License-Identifier: MIT 6 | # 7 | # Licensed under the MIT License 8 | 9 | # Description: Estimate logical error rates for given code in parallel. Results are saved in a csv file described by the first argument. All other arguments are passed to the python script. 10 | 11 | declare -a p=("0.00005" "0.00006" "0.00007" "0.00008" "0.00009" "0.0001" "0.0002" "0.0003" "0.0004" "0.0005" "0.0006" "0.0007" "0.0008" "0.0009" "0.001" "0.002" "0.003" "0.004" "0.005" "0.006" "0.007" "0.008" "0.009" "0.01" "0.02" "0.03" "0.04" "0.05" "0.06" "0.07" "0.08" "0.09" "0.1" "0.2" "0.3" "0.4" "0.5") 12 | 13 | echo "p p_l acceptance errors runs" > "$1.csv" 14 | 15 | run_and_write() { 16 | local res=$(python estimate_logical_error_rate.py ${@:2:$#-2} "-p" "${@: -1}") 17 | local line="${@: -1} ${res}" 18 | (flock -e 200 echo $line >> "$1.csv") 200>lock 19 | } 20 | 21 | export -f run_and_write 22 | 23 | parallel --load 16 --link run_and_write $@ ::: ${p[@]} 24 | -------------------------------------------------------------------------------- /src/mqt/qecc/codes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Module for constructing and manipulating CSS codes.""" 9 | 10 | from __future__ import annotations 11 | 12 | from .bb_codes import construct_bb_code 13 | from .color_code import ColorCode, LatticeType 14 | from .concatenation import ConcatenatedCode, ConcatenatedCSSCode 15 | from .constructions import construct_iceberg_code, construct_many_hypercube_code, construct_quantum_hamming_code 16 | from .css_code import CSSCode, InvalidCSSCodeError 17 | from .hexagonal_color_code import HexagonalColorCode 18 | from .square_octagon_color_code import SquareOctagonColorCode 19 | from .stabilizer_code import InvalidStabilizerCodeError, StabilizerCode 20 | 21 | __all__ = [ 22 | "CSSCode", 23 | "ColorCode", 24 | "ConcatenatedCSSCode", 25 | "ConcatenatedCode", 26 | "HexagonalColorCode", 27 | "InvalidCSSCodeError", 28 | "InvalidStabilizerCodeError", 29 | "LatticeType", 30 | "SquareOctagonColorCode", 31 | "StabilizerCode", 32 | "construct_bb_code", 33 | "construct_iceberg_code", 34 | "construct_many_hypercube_code", 35 | "construct_quantum_hamming_code", 36 | ] 37 | -------------------------------------------------------------------------------- /src/mqt/qecc/codes/carbon/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/carbon/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/carbon/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/carbon/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/cc_4_8_8_d5/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/cc_4_8_8_d5/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/cc_4_8_8_d5/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/cc_4_8_8_d5/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/constructions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Constructions of various known stabilizer codes.""" 9 | 10 | from __future__ import annotations 11 | 12 | from typing import TYPE_CHECKING 13 | 14 | import numpy as np 15 | 16 | from .css_code import CSSCode 17 | 18 | if TYPE_CHECKING: 19 | import numpy.typing as npt 20 | 21 | 22 | def construct_quantum_hamming_code(r: int) -> CSSCode: 23 | """Return the [[2^r, 2^r-r-1, 3]] quantum Hamming code.""" 24 | h = _hamming_code_checks(r) 25 | return CSSCode(h, h, 3) 26 | 27 | 28 | def construct_iceberg_code(m: int) -> CSSCode: 29 | """Return the [[2m, 2m-2, 2]] Iceberg code. 30 | 31 | The Iceberg code is a CSS code with stabilizer generators X^2m and Z^2m. 32 | https://errorcorrectionzoo.org/c/iceberg 33 | """ 34 | n = 2 * m 35 | h = np.array([[1] * n], dtype=np.int8) 36 | return CSSCode(h, h, 2) 37 | 38 | 39 | def construct_many_hypercube_code(level: int) -> CSSCode: 40 | """Return the [[6^l, 4^l, 2^l]] level l many-hypercube code (https://arxiv.org/abs/2403.16054). 41 | 42 | This code is obtained by (l-1)-fold concatenation of the [[6,4,2]] iceberg code with itself. 43 | """ 44 | code = construct_iceberg_code(3) 45 | 46 | for _ in range(1, level): 47 | sx = np.hstack([code.Lx] * 6, dtype=np.int8) 48 | sx_rem = np.kron(np.eye(6, dtype=np.int8), code.Hx) 49 | sx = np.vstack((sx, sx_rem), dtype=np.int8) 50 | sz = sx 51 | code = CSSCode(sx, sz, code.distance * 2) 52 | return code 53 | 54 | 55 | def _hamming_code_checks(r: int) -> npt.NDArray[np.int8]: 56 | """Return the check matrix for the [2^r-1, 2^r-r-1, 3] Hamming code.""" 57 | n = 2**r - 1 58 | h = np.zeros((r, n), dtype=int) 59 | # columns are all binary strings up to 2^r 60 | for i in range(1, n + 1): 61 | h[:, i - 1] = np.array([int(x) for x in f"{i:b}".zfill(r)]) 62 | 63 | return h 64 | -------------------------------------------------------------------------------- /src/mqt/qecc/codes/golay/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/golay/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/golay/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/golay/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/hamming_15/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/hamming_15/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/hamming_15/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/hamming_15/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/rotated_surface_d3/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/rotated_surface_d3/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/rotated_surface_d3/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/rotated_surface_d3/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/rotated_surface_d5/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/rotated_surface_d5/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/rotated_surface_d5/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/rotated_surface_d5/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/shor/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/shor/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/shor/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/shor/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/steane/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/steane/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/steane/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/steane/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/tetrahedral/hx.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/tetrahedral/hx.npy -------------------------------------------------------------------------------- /src/mqt/qecc/codes/tetrahedral/hz.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munich-quantum-toolkit/qecc/70e86c0660dbedbd002e9ace7fa4e2a032759c6c/src/mqt/qecc/codes/tetrahedral/hz.npy -------------------------------------------------------------------------------- /src/mqt/qecc/py.typed: -------------------------------------------------------------------------------- 1 | # Instruct type checkers to look for inline type annotations in this package. 2 | # See PEP 561. 3 | -------------------------------------------------------------------------------- /test/python/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Needed for imports in tests.""" 9 | -------------------------------------------------------------------------------- /test/python/cc_decoder/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Tests for the color code decoder module.""" 9 | -------------------------------------------------------------------------------- /test/python/cc_decoder/test_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Utility functions needed across python tests.""" 9 | 10 | from __future__ import annotations 11 | 12 | import json 13 | from pathlib import Path 14 | from typing import Any 15 | 16 | 17 | def check_and_load_json(file_name: str, results_dir: str) -> dict[str, Any]: 18 | """Check that the results directory contains exactly one file with the given name and load it as JSON.""" 19 | results_path = Path(results_dir) 20 | assert results_path.exists() 21 | assert results_path.is_dir() 22 | assert len(list(results_path.iterdir())) == 1 23 | result_file = results_path / file_name 24 | assert result_file.exists() 25 | assert result_file.is_file() 26 | with result_file.open("r") as f: 27 | result: dict[str, Any] = json.load(f) 28 | 29 | for file in results_path.iterdir(): 30 | file.unlink() 31 | results_path.rmdir() 32 | 33 | return result 34 | -------------------------------------------------------------------------------- /test/python/circuit_synthesis/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM 2 | # All rights reserved. 3 | # 4 | # SPDX-License-Identifier: MIT 5 | # 6 | # Licensed under the MIT License 7 | 8 | """Needed for imports in tests.""" 9 | --------------------------------------------------------------------------------