├── .envrc ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ ├── general-issue.md │ └── general-purprose-issue.md ├── codecov.yml ├── pull_request_template.md ├── release-drafter.yml └── workflows │ ├── deploy.yml │ ├── publish.yml │ ├── rules.yml │ └── selfhosted.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── doc ├── Makefile └── source │ ├── _static │ ├── comp_basis_encoder.png │ ├── css │ │ └── style.css │ ├── entangling_layer.png │ ├── phase_encoder.png │ ├── qibo_logo_dark.svg │ ├── qibo_logo_light.svg │ ├── symplectic_matrix.png │ ├── unary_encoder_ladder.png │ └── unary_encoder_tree.png │ ├── api-reference │ ├── hep.rst │ ├── index.rst │ └── qibo.rst │ ├── appendix │ └── citing-qibo.rst │ ├── code-examples │ ├── advancedexamples.rst │ ├── applications-by-algorithm.rst │ ├── applications-by-topic.rst │ ├── applications.rst │ ├── examples.rst │ ├── index.rst │ └── tutorials │ │ ├── 3_tangle │ │ ├── README.md │ │ └── images │ │ ├── EF_QAE │ │ ├── README.md │ │ └── images │ │ ├── aavqe │ │ ├── README.md │ │ └── images │ │ ├── adiabatic │ │ ├── README.md │ │ └── images │ │ ├── adiabatic3sat │ │ ├── README.md │ │ └── images │ │ ├── adiabatic_qml │ │ ├── adiabatic-qml.ipynb │ │ └── images │ │ ├── anomaly_detection │ │ ├── README.md │ │ └── images │ │ ├── autoencoder │ │ ├── README.md │ │ └── images │ │ ├── bell-variational │ │ ├── README.md │ │ └── images │ │ ├── falqon │ │ ├── README.md │ │ └── images │ │ ├── grover │ │ └── README.md │ │ ├── grover3sat │ │ ├── README.md │ │ └── images │ │ ├── hash-grover │ │ ├── README.md │ │ └── images │ │ ├── mvc │ │ └── README.md │ │ ├── qPDF │ │ └── qPDF.ipynb │ │ ├── qap │ │ └── README.md │ │ ├── qclustering │ │ ├── README.md │ │ └── figures │ │ ├── qcnn_classifier │ │ ├── images │ │ └── qcnn_demo.ipynb │ │ ├── qfiae │ │ ├── images │ │ └── qfiae_demo.ipynb │ │ ├── qsvd │ │ ├── README.md │ │ └── images │ │ ├── reuploading_classifier │ │ ├── README.md │ │ └── images │ │ ├── shor │ │ ├── README.md │ │ └── images │ │ ├── unary │ │ ├── README.md │ │ └── images │ │ ├── variational_classifier │ │ ├── README.md │ │ └── images │ │ └── vqregressor │ │ ├── README.md │ │ └── images │ ├── conf.py │ ├── developer-guides │ ├── contributing.rst │ ├── general.rst │ └── index.rst │ ├── favicon.ico │ ├── getting-started │ ├── backends.png │ ├── backends.rst │ ├── index.rst │ ├── installation.rst │ ├── overview.rst │ ├── overview.svg │ └── quickstart.rst │ ├── index.rst │ └── qibo_ecosystem.png ├── examples ├── 3_tangle │ ├── README.md │ ├── canonizator.py │ ├── images │ │ ├── canonical.png │ │ ├── circuit.png │ │ ├── results.png │ │ └── tangle.png │ └── main.py ├── EF_QAE │ ├── README.md │ ├── images │ │ ├── Ry.png │ │ ├── ansatz.png │ │ ├── autoencoder.png │ │ ├── cost_ising.png │ │ ├── diagram.png │ │ ├── handwritten_cost.png │ │ ├── handwritten_output.png │ │ └── space_ising.png │ └── main.py ├── README.md ├── aavqe │ ├── README.md │ ├── images │ │ ├── Lambda10_Ising.png │ │ ├── Lambdas_Ising.png │ │ ├── ansatz-1.png │ │ └── ising.png │ └── main.py ├── adiabatic │ ├── README.md │ ├── images │ │ ├── dynamics_n4T4.0.png │ │ ├── linears_T15plots_n4.png │ │ ├── poly3_powell_n4.png │ │ └── trotter_error_n6T1.png │ ├── linear.py │ ├── optimize.py │ ├── optparams │ │ ├── poly3_powell_n4_loss.npy │ │ └── poly3_powell_n4_params.npy │ └── trotter_error.py ├── adiabatic3sat │ ├── README.md │ ├── functions.py │ ├── images │ │ ├── H.png │ │ ├── h0.png │ │ ├── hc.png │ │ ├── hp.png │ │ ├── optn10_plot.png │ │ ├── prob_plot.png │ │ └── z-matrix.png │ └── main.py ├── adiabatic_qml │ ├── adiabatic-qml.ipynb │ ├── images │ │ └── pdf_est.png │ ├── qaml_data │ │ ├── best_p.npy │ │ ├── cdf.npy │ │ ├── not_normed_sample.npy │ │ └── xarr.npy │ └── qaml_scripts │ │ ├── evolution.py │ │ ├── rotational_circuit.py │ │ └── training.py ├── anomaly_detection │ ├── README.md │ ├── data │ │ ├── anomalous_data.npy │ │ └── standard_data.npy │ ├── images │ │ ├── Fig1.png │ │ ├── Fig2.png │ │ ├── Fig3.png │ │ ├── Fig4.png │ │ ├── Fig5.png │ │ └── Fig6.png │ ├── parameters │ │ └── trained_params.npy │ ├── test.py │ └── train.py ├── autoencoder │ ├── README.md │ ├── images │ │ ├── ansatz-1.png │ │ └── autoencoder.png │ └── main.py ├── bell-variational │ ├── README.md │ ├── functions.py │ ├── images │ │ ├── chshequation.png │ │ └── circuit.png │ └── main.py ├── benchmarks │ ├── circuits.py │ ├── evolution.py │ ├── example.sh │ ├── images │ │ ├── adiabatic_evolution.png │ │ ├── adiabatic_evolution_dt.png │ │ ├── qft_c128.png │ │ ├── qft_c64.png │ │ ├── qibo_c64_vs_c128.png │ │ ├── qibo_configurations.png │ │ ├── qibo_configurations_small.png │ │ ├── qibo_shots_cpu.png │ │ ├── qibo_shots_gpu.png │ │ ├── var5layer_c128.png │ │ ├── var5layer_c64.png │ │ └── varcircuit.png │ ├── main.py │ ├── qaoa.py │ ├── results │ │ ├── ADIABATIC.md │ │ ├── HARDWARE.md │ │ ├── PRECISION.md │ │ ├── QFT.md │ │ ├── SHOTS.md │ │ └── VAR5.md │ ├── utils.py │ └── vqe.py ├── circuit-draw-mpl │ └── qibo-draw-circuit-matplotlib.ipynb ├── conftest.py ├── data3sat │ ├── 10bit │ │ ├── n10i1.txt │ │ ├── n10i10.txt │ │ ├── n10i2.txt │ │ ├── n10i3.txt │ │ ├── n10i4.txt │ │ ├── n10i5.txt │ │ ├── n10i6.txt │ │ ├── n10i7.txt │ │ ├── n10i8.txt │ │ └── n10i9.txt │ ├── 12bit │ │ ├── n12i1.txt │ │ ├── n12i10.txt │ │ ├── n12i2.txt │ │ ├── n12i3.txt │ │ ├── n12i4.txt │ │ ├── n12i5.txt │ │ ├── n12i6.txt │ │ ├── n12i7.txt │ │ ├── n12i8.txt │ │ └── n12i9.txt │ ├── 14bit │ │ ├── n14i1.txt │ │ ├── n14i10.txt │ │ ├── n14i2.txt │ │ ├── n14i3.txt │ │ ├── n14i4.txt │ │ ├── n14i5.txt │ │ ├── n14i6.txt │ │ ├── n14i7.txt │ │ ├── n14i8.txt │ │ └── n14i9.txt │ ├── 16bit │ │ ├── n16i1.txt │ │ ├── n16i10.txt │ │ ├── n16i2.txt │ │ ├── n16i3.txt │ │ ├── n16i4.txt │ │ ├── n16i5.txt │ │ ├── n16i6.txt │ │ ├── n16i7.txt │ │ ├── n16i8.txt │ │ └── n16i9.txt │ ├── 18bit │ │ ├── n18i1.txt │ │ ├── n18i10.txt │ │ ├── n18i2.txt │ │ ├── n18i3.txt │ │ ├── n18i4.txt │ │ ├── n18i5.txt │ │ ├── n18i6.txt │ │ ├── n18i7.txt │ │ ├── n18i8.txt │ │ └── n18i9.txt │ ├── 20bit │ │ ├── n20i1.txt │ │ ├── n20i10.txt │ │ ├── n20i2.txt │ │ ├── n20i3.txt │ │ ├── n20i4.txt │ │ ├── n20i5.txt │ │ ├── n20i6.txt │ │ ├── n20i7.txt │ │ ├── n20i8.txt │ │ └── n20i9.txt │ ├── 22bit │ │ ├── n22i1.txt │ │ ├── n22i10.txt │ │ ├── n22i2.txt │ │ ├── n22i3.txt │ │ ├── n22i4.txt │ │ ├── n22i5.txt │ │ ├── n22i6.txt │ │ ├── n22i7.txt │ │ ├── n22i8.txt │ │ └── n22i9.txt │ ├── 24bit │ │ ├── n24i1.txt │ │ ├── n24i10.txt │ │ ├── n24i2.txt │ │ ├── n24i3.txt │ │ ├── n24i4.txt │ │ ├── n24i5.txt │ │ ├── n24i6.txt │ │ ├── n24i7.txt │ │ ├── n24i8.txt │ │ └── n24i9.txt │ ├── 26bit │ │ ├── n26i1.txt │ │ ├── n26i10.txt │ │ ├── n26i2.txt │ │ ├── n26i3.txt │ │ ├── n26i4.txt │ │ ├── n26i5.txt │ │ ├── n26i6.txt │ │ ├── n26i7.txt │ │ ├── n26i8.txt │ │ └── n26i9.txt │ ├── 28bit │ │ ├── n28i1.txt │ │ ├── n28i10.txt │ │ ├── n28i2.txt │ │ ├── n28i3.txt │ │ ├── n28i4.txt │ │ ├── n28i5.txt │ │ ├── n28i6.txt │ │ ├── n28i7.txt │ │ ├── n28i8.txt │ │ └── n28i9.txt │ ├── 30bit │ │ ├── n30i1.txt │ │ ├── n30i10.txt │ │ ├── n30i2.txt │ │ ├── n30i3.txt │ │ ├── n30i4.txt │ │ ├── n30i5.txt │ │ ├── n30i6.txt │ │ ├── n30i7.txt │ │ ├── n30i8.txt │ │ └── n30i9.txt │ ├── 4bit │ │ └── n4i1.txt │ └── 8bit │ │ ├── n8i1.txt │ │ ├── n8i10.txt │ │ ├── n8i2.txt │ │ ├── n8i3.txt │ │ ├── n8i4.txt │ │ ├── n8i5.txt │ │ ├── n8i6.txt │ │ ├── n8i7.txt │ │ ├── n8i8.txt │ │ └── n8i9.txt ├── falqon │ ├── README.md │ ├── images │ │ ├── scheme.png │ │ └── schrodinger_equation.png │ └── main.py ├── grover │ ├── README.md │ ├── example1.py │ ├── example2.py │ └── example3.py ├── grover3sat │ ├── README.md │ ├── functions.py │ ├── images │ │ └── grover-circuit-image.png │ └── main.py ├── hash-grover │ ├── README.md │ ├── functions.py │ ├── images │ │ ├── adder-mod2n.png │ │ ├── chacha-perm.png │ │ ├── grover-circuit-image.png │ │ ├── quarter-round.png │ │ └── sponge-oracle.png │ └── main.py ├── mvc │ ├── README.md │ ├── main.py │ ├── mvc.csv │ ├── mvc.py │ └── qubo_utils.py ├── qPDF │ ├── data │ │ ├── full │ │ │ ├── 8evols.dat │ │ │ ├── 8flavours.dat │ │ │ ├── c+.dat │ │ │ ├── c.dat │ │ │ ├── d.dat │ │ │ ├── dbar.dat │ │ │ ├── gluon.dat │ │ │ ├── s.dat │ │ │ ├── sbar.dat │ │ │ ├── singlet.dat │ │ │ ├── t3.dat │ │ │ ├── t8.dat │ │ │ ├── u.dat │ │ │ ├── ubar.dat │ │ │ ├── v.dat │ │ │ ├── v3.dat │ │ │ └── v8.dat │ │ ├── partial │ │ │ ├── 8evols.dat │ │ │ ├── 8flavours.dat │ │ │ ├── c+.dat │ │ │ ├── c.dat │ │ │ ├── d.dat │ │ │ ├── dbar.dat │ │ │ ├── gluon.dat │ │ │ ├── s.dat │ │ │ ├── sbar.dat │ │ │ ├── singlet.dat │ │ │ ├── t3.dat │ │ │ ├── t8.dat │ │ │ ├── u.dat │ │ │ ├── ubar.dat │ │ │ ├── v.dat │ │ │ ├── v3.dat │ │ │ └── v8.dat │ │ ├── pdf_data.dat │ │ ├── pdf_data_full.dat │ │ └── pdf_data_full_evolution_basis.txt │ ├── qPDF.ipynb │ └── results │ │ └── full │ │ ├── 8flavours │ │ ├── Fourier_8_q_2_l_result.pkl │ │ ├── Fourier_8_q_3_l_result.pkl │ │ ├── Fourier_8_q_4_l_result.pkl │ │ ├── Fourier_8_q_5_l_result.pkl │ │ ├── Weighted_8_q_2_l_result.pkl │ │ ├── Weighted_8_q_3_l_result.pkl │ │ ├── Weighted_8_q_4_l_result.pkl │ │ └── Weighted_8_q_5_l_result.pkl │ │ ├── c │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl │ │ ├── d │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl │ │ ├── dbar │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl │ │ ├── gluon │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl │ │ ├── s │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl │ │ ├── sbar │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl │ │ ├── u │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl │ │ └── ubar │ │ ├── Fourier_1_q_1_l_result.pkl │ │ ├── Fourier_1_q_2_l_result.pkl │ │ ├── Fourier_1_q_3_l_result.pkl │ │ ├── Fourier_1_q_4_l_result.pkl │ │ ├── Fourier_1_q_5_l_result.pkl │ │ ├── Fourier_1_q_6_l_result.pkl │ │ ├── Weighted_1_q_1_l_result.pkl │ │ ├── Weighted_1_q_2_l_result.pkl │ │ ├── Weighted_1_q_3_l_result.pkl │ │ ├── Weighted_1_q_4_l_result.pkl │ │ ├── Weighted_1_q_5_l_result.pkl │ │ └── Weighted_1_q_6_l_result.pkl ├── qap │ ├── README.md │ ├── main.py │ ├── qap.py │ ├── qubo_utils.py │ └── tiny04a.dat ├── qclustering │ ├── README.md │ ├── data │ │ ├── latentrep_QCD_sig.h5 │ │ ├── latentrep_QCD_sig_testclustering.h5 │ │ └── latentrep_RSGraviton_WW_NA_35.h5 │ ├── distance_calc.py │ ├── evaluate.py │ ├── figures │ │ ├── DistCirc.png │ │ ├── pseudocode_QKmed.jpeg │ │ └── roc_curve.png │ ├── grover.py │ ├── minimization.py │ ├── oracle.py │ ├── qkmedians.py │ ├── train_qkmedians.py │ └── util.py ├── qcnn_classifier │ ├── images │ │ ├── RT.PNG │ │ ├── RxRyRz.PNG │ │ ├── U.PNG │ │ ├── convolution_4qubits.PNG │ │ ├── data_labels.PNG │ │ ├── pooling_4qubits.PNG │ │ ├── result_confusion_matrix.PNG │ │ ├── structure.PNG │ │ ├── test │ │ └── workflow.PNG │ ├── nqubits_4_data_shuffled_no0.npy │ ├── nqubits_4_labels_shuffled_no0.npy │ └── qcnn_demo.ipynb ├── qfiae │ ├── images │ │ ├── iqae.png │ │ ├── linear_ansatz.png │ │ └── sketch_qfiae.png │ ├── qfiae_demo.ipynb │ ├── utils_qfiae.py │ └── vqregressor_linear_ansatz.py ├── qsvd │ ├── README.md │ ├── images │ │ ├── Entropy_6qubits.png │ │ ├── QSVD.png │ │ ├── ansatz.png │ │ └── error.png │ ├── main.py │ └── qsvd.py ├── reuploading_classifier │ ├── README.md │ ├── datasets.py │ ├── images │ │ ├── bloch_states.png │ │ ├── circuit.png │ │ ├── test_set.png │ │ └── world_map.png │ ├── main.py │ ├── qlassifier.py │ └── saved_parameters.pkl ├── shor │ ├── README.md │ ├── functions.py │ ├── images │ │ ├── determined-fourier-addition.png │ │ ├── order-finding.png │ │ └── semiclassical.png │ └── main.py ├── test_examples.py ├── unary │ ├── README.md │ ├── aux_functions.py │ ├── functions.py │ ├── images │ │ ├── AE.png │ │ ├── Amplitude_Estimation_Results.png │ │ ├── Amplitude_Estimation_Uncertainties.png │ │ └── Probability_distribution.png │ └── main.py ├── variational_classifier │ ├── README.md │ ├── data │ │ ├── iris.data │ │ ├── optimal_angles_ry_4q_4l.npy │ │ └── optimal_angles_ry_4q_5l.npy │ ├── images │ │ └── ansatz.png │ ├── main.py │ └── qclassifier.py └── vqregressor │ ├── README.md │ ├── images │ ├── ansatz.png │ ├── equation_dJ.png │ ├── equation_f.png │ ├── equation_psr.png │ └── results.png │ ├── main.py │ └── vqregressor.py ├── flake.lock ├── flake.nix ├── poetry.lock ├── pyproject.toml ├── selfhosted ├── src └── qibo │ ├── __init__.py │ ├── backends │ ├── __init__.py │ ├── _clifford_operations.py │ ├── _hamming_weight_operations.py │ ├── abstract.py │ ├── clifford.py │ ├── einsum_utils.py │ ├── hamming_weight.py │ ├── npmatrices.py │ ├── numpy.py │ └── qulacs.py │ ├── callbacks.py │ ├── config.py │ ├── derivative.py │ ├── gates │ ├── __init__.py │ ├── abstract.py │ ├── channels.py │ ├── gates.py │ ├── measurements.py │ └── special.py │ ├── hamiltonians │ ├── __init__.py │ ├── abstract.py │ ├── adiabatic.py │ ├── hamiltonians.py │ ├── models.py │ └── terms.py │ ├── measurements.py │ ├── models │ ├── __init__.py │ ├── _openqasm.py │ ├── circuit.py │ ├── distcircuit.py │ ├── encodings.py │ ├── error_mitigation.py │ ├── evolution.py │ ├── grover.py │ ├── hep.py │ ├── iqae.py │ ├── qcnn.py │ ├── qft.py │ ├── tsp.py │ ├── utils.py │ └── variational.py │ ├── noise.py │ ├── optimizers.py │ ├── parallel.py │ ├── parameter.py │ ├── quantum_info │ ├── __init__.py │ ├── _clifford_utils.py │ ├── basis.py │ ├── clifford.py │ ├── entanglement.py │ ├── entropies.py │ ├── hamming_weight.py │ ├── linalg_operations.py │ ├── metrics.py │ ├── quantum_networks.py │ ├── random_ensembles.py │ ├── superoperator_transformations.py │ └── utils.py │ ├── result.py │ ├── solvers.py │ ├── symbols.py │ ├── tomography │ ├── __init__.py │ └── gate_set_tomography.py │ ├── transpiler │ ├── __init__.py │ ├── _exceptions.py │ ├── abstract.py │ ├── asserts.py │ ├── blocks.py │ ├── decompositions.py │ ├── optimizer.py │ ├── pipeline.py │ ├── placer.py │ ├── router.py │ ├── unitary_decompositions.py │ └── unroller.py │ └── ui │ ├── __init__.py │ ├── drawing_utils.py │ ├── mpldrawer.py │ ├── result_visualization.py │ ├── styles.json │ └── symbols.json └── tests ├── __init__.py ├── conftest.py ├── regressions ├── __init__.py ├── aavqe_bfgs.out ├── adiabatic_bfgs.out ├── falqon1.out ├── falqon2.out ├── falqon3.out ├── falqon4.out ├── heisenberg_N3delta0.0.out ├── heisenberg_N3delta0.5.out ├── heisenberg_N3delta1.0.out ├── maxcut_N3.out ├── maxcut_N4.out ├── maxcut_N5.out ├── qaoa_bfgs.out ├── tfim_N3h0.0.out ├── tfim_N3h0.5.out ├── tfim_N3h1.0.out ├── trotter_adiabatic_bfgs.out ├── trotter_qaoa_bfgs.out ├── trotter_qaoa_powell.out ├── tsp_layer2_imag.out ├── tsp_layer2_real.out ├── tsp_layer4_imag.out ├── tsp_layer4_real.out ├── vqc_bfgs.out ├── vqc_powell.out ├── vqe_bfgs.out ├── vqe_powell.out ├── x_N3.out ├── y_N4.out └── z_N5.out ├── test_backends.py ├── test_backends_clifford.py ├── test_backends_global.py ├── test_backends_hamming_weight.py ├── test_backends_qibotn.py ├── test_backends_qulacs.py ├── test_callbacks.py ├── test_cirq.py ├── test_derivative.py ├── test_gates_abstract.py ├── test_gates_channels.py ├── test_gates_density_matrix.py ├── test_gates_gates.py ├── test_gates_special.py ├── test_hamiltonians.py ├── test_hamiltonians_from_symbols.py ├── test_hamiltonians_models.py ├── test_hamiltonians_symbolic.py ├── test_hamiltonians_terms.py ├── test_hamiltonians_trotter.py ├── test_measurements.py ├── test_measurements_collapse.py ├── test_measurements_probabilistic.py ├── test_models_circuit.py ├── test_models_circuit_backpropagation.py ├── test_models_circuit_execution.py ├── test_models_circuit_features.py ├── test_models_circuit_fuse.py ├── test_models_circuit_noise.py ├── test_models_circuit_parametrized.py ├── test_models_circuit_qasm.py ├── test_models_circuit_qasm_cirq.py ├── test_models_distcircuit.py ├── test_models_distcircuit_execution.py ├── test_models_encodings.py ├── test_models_error_mitigation.py ├── test_models_evolution.py ├── test_models_grover.py ├── test_models_hep.py ├── test_models_iqae.py ├── test_models_qcnn.py ├── test_models_qft.py ├── test_models_tsp.py ├── test_models_utils.py ├── test_models_variational.py ├── test_noise.py ├── test_parallel.py ├── test_parameter.py ├── test_prints.py ├── test_quantum_info_basis.py ├── test_quantum_info_clifford.py ├── test_quantum_info_entanglement.py ├── test_quantum_info_entropies.py ├── test_quantum_info_linalg_operations.py ├── test_quantum_info_metrics.py ├── test_quantum_info_quantum_networks.py ├── test_quantum_info_random.py ├── test_quantum_info_superoperator_transformations.py ├── test_quantum_info_utils.py ├── test_result.py ├── test_states.py ├── test_tomography_gate_set_tomography.py ├── test_transpiler_asserts.py ├── test_transpiler_blocks.py ├── test_transpiler_decompositions.py ├── test_transpiler_optimizer.py ├── test_transpiler_pipeline.py ├── test_transpiler_placer.py ├── test_transpiler_router.py ├── test_transpiler_unitary_decompositions.py ├── test_transpiler_unroller.py ├── test_ui_array_images ├── state_visualization_amplitudes_3q.npy ├── state_visualization_frequencies_3q.npy ├── state_visualization_probabilities_3q.npy ├── state_visualization_probabilities_3q_lim.npy ├── test_align_gate.npy ├── test_bigger_circuit_gates_3.npy ├── test_bigger_circuit_gates_4.npy ├── test_bigger_circuit_gates_5.npy ├── test_bigger_circuit_gates_6.npy ├── test_circuit_entangled_entropy_false.npy ├── test_circuit_entangled_entropy_true.npy ├── test_circuit_fused_gates_false.npy ├── test_circuit_fused_gates_true.npy ├── test_circuit_measure_1.npy ├── test_circuit_measure_2.npy ├── test_circuit_measure_3.npy ├── test_complex_circuit_fig1_false.npy ├── test_complex_circuit_fig1_true.npy ├── test_complex_circuit_fig2_false.npy ├── test_complex_circuit_fig2_true.npy ├── test_empty_circuit.npy ├── test_fuse_cluster.npy ├── test_fused_gates.npy ├── test_layered_circuit.npy ├── test_plot_circuit_2.npy ├── test_plot_circuit_3.npy ├── test_plot_circuit_internal_ax1.npy ├── test_plot_circuit_internal_ax2.npy ├── test_plot_global_unitaries_as_circuit.npy ├── test_plot_unitaries.npy ├── test_plot_unitaries_different_init.npy └── test_plot_unitaries_same_init.npy ├── test_ui_mpldrawer.py ├── test_ui_result_visualization.py └── utils.py /.envrc: -------------------------------------------------------------------------------- 1 | if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then 2 | source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" 3 | fi 4 | 5 | watch_file flake.nix 6 | watch_file flake.lock 7 | if ! use flake . --impure; then 8 | echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 9 | fi 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General issue 3 | about: Default GitHub template issue 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general-purprose-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General purprose issue 3 | about: '' 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | -------------------------------------------------------------------------------- /.github/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | project: 4 | default: 5 | threshold: 0.5% 6 | 7 | github_checks: 8 | annotations: false 9 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | Checklist: 3 | - [ ] Reviewers confirm new code works as expected. 4 | - [ ] Tests are passing. 5 | - [ ] Coverage does not decrease. 6 | - [ ] Documentation is updated. 7 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | template: | 2 | ## What's Changed 3 | $CHANGES 4 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | # A single CI script with github workflow 2 | name: Build wheels and deploy 3 | 4 | on: 5 | workflow_dispatch: 6 | push: 7 | merge_group: 8 | release: 9 | types: 10 | - published 11 | 12 | jobs: 13 | build: 14 | strategy: 15 | matrix: 16 | os: [ubuntu-latest, macos-latest, windows-latest] 17 | python-version: ["3.10", "3.11", "3.12", "3.13"] 18 | uses: qiboteam/workflows/.github/workflows/deploy-pip-poetry.yml@v1 19 | with: 20 | os: ${{ matrix.os }} 21 | python-version: ${{ matrix.python-version }} 22 | publish: ${{ github.event_name == 'release' && github.event.action == 'published' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} 23 | poetry-extras: "--with tests,docs" 24 | secrets: inherit 25 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: docs 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [master] 7 | tags: 8 | - "*" 9 | 10 | jobs: 11 | evaluate-label: 12 | runs-on: ubuntu-latest 13 | outputs: 14 | label: ${{ steps.label_step.outputs.version}} 15 | steps: 16 | - name: checks for the label 17 | id: label_step 18 | run: | 19 | if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then 20 | echo "version=latest" >> $GITHUB_OUTPUT 21 | fi 22 | if [[ "${{ github.ref_type }}" == "branch" ]] && [[ "${{ github.ref }}" != "refs/heads/master" ]]; then 23 | exit 1 24 | fi 25 | if [[ "${{ github.ref_type }}" == "tag" ]]; then 26 | echo "version=stable" >> $GITHUB_OUTPUT 27 | fi 28 | 29 | deploy-docs: 30 | needs: [evaluate-label] 31 | uses: qiboteam/workflows/.github/workflows/deploy-ghpages-latest-stable.yml@v1 32 | with: 33 | python-version: "3.11" 34 | package-manager: "poetry" 35 | dependency-path: "**/poetry.lock" 36 | trigger-label: "${{needs.evaluate-label.outputs.label}}" 37 | project: qibo 38 | poetry-extras: --with docs 39 | -------------------------------------------------------------------------------- /.github/workflows/rules.yml: -------------------------------------------------------------------------------- 1 | # A single CI script with github workflow 2 | name: Tests 3 | 4 | on: 5 | workflow_dispatch: 6 | push: 7 | merge_group: 8 | pull_request: 9 | types: [labeled, opened] # opened is required to allow external contributors 10 | 11 | jobs: 12 | build: 13 | if: contains(github.event.pull_request.labels.*.name, 'run-workflow') || github.event_name == 'push' 14 | strategy: 15 | matrix: 16 | os: [ubuntu-latest, macos-latest, windows-latest] 17 | python-version: ["3.10", "3.11", "3.12", "3.13"] 18 | uses: qiboteam/workflows/.github/workflows/rules-poetry.yml@v1 19 | with: 20 | os: ${{ matrix.os }} 21 | python-version: ${{ matrix.python-version }} 22 | doctests: ${{ matrix.os == 'ubuntu-latest'}} 23 | poetry-extras: "--with tests,docs" 24 | secrets: inherit 25 | -------------------------------------------------------------------------------- /.github/workflows/selfhosted.yml: -------------------------------------------------------------------------------- 1 | # CI workflow that runs on selfhosted GPU 2 | name: Tests with gpu 3 | 4 | on: 5 | pull_request: 6 | types: [labeled] 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.head_ref }} 10 | cancel-in-progress: true 11 | 12 | jobs: 13 | build: 14 | if: contains(join(github.event.pull_request.labels.*.name), 'run-on') 15 | uses: qiboteam/workflows/.github/workflows/selfhosted.yml@v1 16 | with: 17 | used-labels: ${{ toJSON(github.event.pull_request.labels.*.name) }} 18 | python-version: "3.11" 19 | artifact-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} 20 | poetry-extras: "--with cuda11,tests" 21 | 22 | secrets: 23 | repo_token: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | autofix_prs: true 3 | repos: 4 | - repo: https://github.com/pre-commit/pre-commit-hooks 5 | rev: v5.0.0 6 | hooks: 7 | - id: trailing-whitespace 8 | - id: end-of-file-fixer 9 | - id: check-yaml 10 | - id: check-toml 11 | - id: debug-statements 12 | - repo: https://github.com/psf/black 13 | rev: 25.1.0 14 | hooks: 15 | - id: black 16 | - repo: https://github.com/pycqa/isort 17 | rev: 6.0.1 18 | hooks: 19 | - id: isort 20 | args: ["--profile", "black"] 21 | - repo: https://github.com/asottile/pyupgrade 22 | rev: v3.20.0 23 | hooks: 24 | - id: pyupgrade 25 | - repo: https://github.com/hadialqattan/pycln 26 | rev: v2.5.0 27 | hooks: 28 | - id: pycln 29 | args: [--config=pyproject.toml] 30 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | 22 | view: html 23 | $(BROWSER) build/html/index.html 24 | -------------------------------------------------------------------------------- /doc/source/_static/comp_basis_encoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/_static/comp_basis_encoder.png -------------------------------------------------------------------------------- /doc/source/_static/css/style.css: -------------------------------------------------------------------------------- 1 | .wy-side-nav-search { 2 | background-color: #6400FF; 3 | } 4 | 5 | .wy-nav-top { 6 | background-color: #6400FF; 7 | } 8 | -------------------------------------------------------------------------------- /doc/source/_static/entangling_layer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/_static/entangling_layer.png -------------------------------------------------------------------------------- /doc/source/_static/phase_encoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/_static/phase_encoder.png -------------------------------------------------------------------------------- /doc/source/_static/symplectic_matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/_static/symplectic_matrix.png -------------------------------------------------------------------------------- /doc/source/_static/unary_encoder_ladder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/_static/unary_encoder_ladder.png -------------------------------------------------------------------------------- /doc/source/_static/unary_encoder_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/_static/unary_encoder_tree.png -------------------------------------------------------------------------------- /doc/source/api-reference/hep.rst: -------------------------------------------------------------------------------- 1 | Models for High Energy Physics 2 | ============================== 3 | 4 | The Qibo package comes with the following extra models: 5 | 6 | * qPDFs_ 7 | 8 | _______________________ 9 | 10 | .. _qPDFs: 11 | 12 | Quantum PDFs 13 | ------------ 14 | 15 | Qibo provides a variational circuit model for parton distribution functions, 16 | named qPDF. This model is based on :class:`qibo.models.Circuit` and provides a 17 | simple API to evaluate PDF flavours at specific values of the momentum fraction 18 | x. Further details and references about this model are presented in the 19 | ``examples/qPDF`` tutorial. 20 | 21 | qPDF circuit model 22 | ^^^^^^^^^^^^^^^^^^ 23 | 24 | .. autoclass:: qibo.models.hep.qPDF 25 | :members: 26 | :member-order: bysource 27 | -------------------------------------------------------------------------------- /doc/source/api-reference/index.rst: -------------------------------------------------------------------------------- 1 | .. _Components: 2 | 3 | API reference 4 | ============= 5 | 6 | In this section we present the main Qibo components and primitives included in 7 | the public API. 8 | 9 | .. toctree:: 10 | :maxdepth: 3 11 | 12 | qibo 13 | hep 14 | -------------------------------------------------------------------------------- /doc/source/code-examples/applications-by-algorithm.rst: -------------------------------------------------------------------------------- 1 | Applications by algorithm 2 | ------------------------- 3 | 4 | Variational Quantum Circuits 5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | 10 | tutorials/aavqe/README.md 11 | tutorials/variational_classifier/README.md 12 | tutorials/reuploading_classifier/README.md 13 | tutorials/vqregressor/README.md 14 | tutorials/autoencoder/README.md 15 | tutorials/qsvd/README.md 16 | tutorials/3_tangle/README.md 17 | tutorials/EF_QAE/README.md 18 | tutorials/unary/README.md 19 | tutorials/bell-variational/README.md 20 | tutorials/qPDF/qPDF.ipynb 21 | tutorials/anomaly_detection/README.md 22 | tutorials/qcnn_classifier/qcnn_demo.ipynb 23 | tutorials/adiabatic_qml/adiabatic-qml.ipynb 24 | 25 | Grover's Algorithm 26 | ^^^^^^^^^^^^^^^^^^ 27 | 28 | .. toctree:: 29 | :maxdepth: 1 30 | 31 | tutorials/grover3sat/README.md 32 | tutorials/hash-grover/README.md 33 | tutorials/grover/README.md 34 | tutorials/qfiae/qfiae_demo.ipynb 35 | 36 | 37 | Shor's Factorization Algorithms 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | .. toctree:: 41 | :maxdepth: 1 42 | 43 | tutorials/shor/README.md 44 | 45 | 46 | Adiabatic Evolution 47 | ^^^^^^^^^^^^^^^^^^^ 48 | 49 | .. toctree:: 50 | :maxdepth: 1 51 | 52 | tutorials/adiabatic/README.md 53 | tutorials/adiabatic3sat/README.md 54 | 55 | 56 | FALQON 57 | ^^^^^^ 58 | 59 | .. toctree:: 60 | :maxdepth: 1 61 | 62 | tutorials/falqon/README.md 63 | 64 | Clustering 65 | ^^^^^^^^^^ 66 | 67 | .. toctree:: 68 | :maxdepth: 1 69 | 70 | tutorials/qclustering/README.md 71 | 72 | 73 | Diagonalization Algorithms 74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 75 | 76 | .. toctree:: 77 | :maxdepth: 1 78 | 79 | tutorials/dbi/README.md 80 | 81 | tutorials/dbi/dbi_tutorial_basic_intro.ipynb 82 | -------------------------------------------------------------------------------- /doc/source/code-examples/applications-by-topic.rst: -------------------------------------------------------------------------------- 1 | Applications by topic 2 | --------------------- 3 | 4 | Complexity theory 5 | ^^^^^^^^^^^^^^^^^ 6 | 7 | .. toctree:: 8 | :maxdepth: 1 9 | 10 | tutorials/grover3sat/README.md 11 | tutorials/adiabatic3sat/README.md 12 | 13 | 14 | Condensed Matter Physics 15 | ^^^^^^^^^^^^^^^^^^^^^^^^ 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | 20 | tutorials/aavqe/README.md 21 | 22 | 23 | Cryptography 24 | ^^^^^^^^^^^^ 25 | 26 | .. toctree:: 27 | :maxdepth: 1 28 | 29 | tutorials/hash-grover/README.md 30 | 31 | 32 | Finance 33 | ^^^^^^^ 34 | 35 | .. toctree:: 36 | :maxdepth: 1 37 | 38 | tutorials/unary/README.md 39 | 40 | 41 | High-Energy Physics 42 | ^^^^^^^^^^^^^^^^^^^ 43 | 44 | .. toctree:: 45 | :maxdepth: 1 46 | 47 | tutorials/qPDF/qPDF.ipynb 48 | tutorials/anomaly_detection/README.md 49 | 50 | 51 | Quantum Physics 52 | ^^^^^^^^^^^^^^^ 53 | 54 | .. toctree:: 55 | :maxdepth: 1 56 | 57 | tutorials/qsvd/README.md 58 | tutorials/3_tangle/README.md 59 | tutorials/adiabatic/README.md 60 | tutorials/shor/README.md 61 | tutorials/bell-variational/README.md 62 | tutorials/falqon/README.md 63 | tutorials/grover/README.md 64 | 65 | Quantum Machine Learning 66 | ^^^^^^^^^^^^^^^^^^^^^^^^ 67 | 68 | .. toctree:: 69 | :maxdepth: 1 70 | 71 | tutorials/variational_classifier/README.md 72 | tutorials/reuploading_classifier/README.md 73 | tutorials/vqregressor/README.md 74 | tutorials/autoencoder/README.md 75 | tutorials/EF_QAE/README.md 76 | tutorials/qfiae/qfiae_demo.ipynb 77 | tutorials/qcnn_classifier/qcnn_demo.ipynb 78 | tutorials/qclustering/README.md 79 | tutorials/adiabatic_qml/adiabatic-qml.ipynb 80 | 81 | Combinatorics 82 | ^^^^^^^^^^^^^ 83 | 84 | .. toctree:: 85 | :maxdepth: 1 86 | 87 | tutorials/qap/README.md 88 | tutorials/mvc/README.md 89 | -------------------------------------------------------------------------------- /doc/source/code-examples/index.rst: -------------------------------------------------------------------------------- 1 | .. _examples: 2 | 3 | Code examples 4 | ============= 5 | 6 | In this section we present code examples from basic to advanced features 7 | implemented in Qibo. Furthermore we include a list of quantum applications for 8 | different topics and quantum algorithms: 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | examples 14 | advancedexamples 15 | applications 16 | -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/3_tangle/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/3_tangle/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/3_tangle/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/3_tangle/images -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/EF_QAE/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/EF_QAE/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/EF_QAE/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/EF_QAE/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/aavqe/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/aavqe/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/aavqe/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/aavqe/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/adiabatic/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/adiabatic/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/adiabatic/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/adiabatic/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/adiabatic3sat/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/adiabatic3sat/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/adiabatic3sat/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/adiabatic3sat/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/adiabatic_qml/adiabatic-qml.ipynb: -------------------------------------------------------------------------------- 1 | ../../../../../examples/adiabatic_qml/adiabatic-qml.ipynb -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/adiabatic_qml/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/adiabatic_qml/images -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/anomaly_detection/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/anomaly_detection/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/anomaly_detection/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/anomaly_detection/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/autoencoder/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/autoencoder/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/autoencoder/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/autoencoder/images -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/bell-variational/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/bell-variational/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/bell-variational/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/bell-variational/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/falqon/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/falqon/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/falqon/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/falqon/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/grover/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/grover/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/grover3sat/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/grover3sat/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/grover3sat/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/grover3sat/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/hash-grover/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/hash-grover/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/hash-grover/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/hash-grover/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/mvc/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/mvc/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qPDF/qPDF.ipynb: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qPDF/qPDF.ipynb -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qap/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qap/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qclustering/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qclustering/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qclustering/figures: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qclustering/figures -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qcnn_classifier/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qcnn_classifier/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qcnn_classifier/qcnn_demo.ipynb: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qcnn_classifier/qcnn_demo.ipynb -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qfiae/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qfiae/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qfiae/qfiae_demo.ipynb: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qfiae/qfiae_demo.ipynb -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qsvd/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qsvd/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/qsvd/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/qsvd/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/reuploading_classifier/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/reuploading_classifier/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/reuploading_classifier/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/reuploading_classifier/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/shor/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/shor/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/shor/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/shor/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/unary/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/unary/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/unary/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/unary/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/variational_classifier/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/variational_classifier/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/variational_classifier/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/variational_classifier/images/ -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/vqregressor/README.md: -------------------------------------------------------------------------------- 1 | ../../../../../examples/vqregressor/README.md -------------------------------------------------------------------------------- /doc/source/code-examples/tutorials/vqregressor/images: -------------------------------------------------------------------------------- 1 | ../../../../../examples/vqregressor/images -------------------------------------------------------------------------------- /doc/source/developer-guides/general.rst: -------------------------------------------------------------------------------- 1 | Code overview 2 | ============= 3 | 4 | The Qibo framework in this repository implements a common system to deal with 5 | classical hardware and future quantum hardware. 6 | 7 | Features 8 | -------- 9 | 10 | The main Qibo objects are circuits, defined in ``qibo/models/circuit.py`` and 11 | gates, defined in ``qibo/gates``. These allow the user to simulate circuits 12 | that follow the gate-based approach of quantum computation or to execute 13 | them on different hardware. These objects are backend agnostic, meaning that 14 | the same circuit can be executed using different backends. 15 | Backends are defined in ``qibo/backends`` and are used to simulate the abstract 16 | circuits or execute them on hardware. 17 | 18 | Qibo provides additional features that are useful for quantum applications, such 19 | as Hamiltonians (``qibo/hamiltonians``), time evolution simulation (``qibo/models/evolution.py``) 20 | and variational models (``qibo/models/variational.py``). 21 | 22 | Including a new backend 23 | ----------------------- 24 | 25 | New backends can be implemented by inheriting 26 | :class:`qibo.backends.abstract.Backend` and implementing its abstract 27 | methods. If the backend is for classical simulation one may prefer to 28 | inherit :class:`qibo.backends.abstract.Simulator` instead. 29 | 30 | 31 | Examples and tutorials 32 | ---------------------- 33 | 34 | The ``examples`` folder contains benchmark code for applications/tutorials 35 | described in :ref:`Applications ` while ``examples/benchmarks`` 36 | contains some code for benchmarking only. 37 | -------------------------------------------------------------------------------- /doc/source/developer-guides/index.rst: -------------------------------------------------------------------------------- 1 | Developer guides 2 | ================ 3 | 4 | In this section we provide a code overview and contribution guidelines for 5 | developers. 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | 10 | general 11 | contributing 12 | -------------------------------------------------------------------------------- /doc/source/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/favicon.ico -------------------------------------------------------------------------------- /doc/source/getting-started/backends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/getting-started/backends.png -------------------------------------------------------------------------------- /doc/source/getting-started/index.rst: -------------------------------------------------------------------------------- 1 | Getting started 2 | =============== 3 | 4 | In this section we present the basic aspects of Qibo design and provide 5 | installation instructions. Please visit the following section in order to learn 6 | the project idea and how to prepare your system for quantum simulation and 7 | hardware control. 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | overview 13 | quickstart 14 | backends 15 | installation 16 | 17 | Already installed all packages? Please visit :ref:`examples ` and learn how to use Qibo in practice. 18 | -------------------------------------------------------------------------------- /doc/source/getting-started/overview.rst: -------------------------------------------------------------------------------- 1 | Why Qibo? 2 | ========= 3 | 4 | The Qibo project targets the development of an open-source full stack API for 5 | quantum simulation and quantum hardware control. 6 | 7 | Quantum technologies, such as NISQ devices, are developed by research 8 | institutions and require a high level of knowledge of the physics and electronic 9 | devices used to prepare, execute and retrieve measurements from the experimental 10 | apparatus. 11 | 12 | In this context, Qibo proposes an agnostic approach to quantum simulation and 13 | hardware control, providing the required components and standards to quickly 14 | connect the classical hardware and experimental setup into a software stack 15 | which automates all aspects of a quantum computation. 16 | 17 | In the picture below, we summarize the major components of the Qibo "ecosystem". 18 | 19 | .. image:: overview.svg 20 | 21 | The first component is the language API, based on Python 3, which defines the 22 | interface for the development of quantum applications, models and new 23 | algorithms. We also provide a large code-base of models and algorithms, 24 | presented with code examples and step-by-step tutorials. Finally, we provide 25 | several tools for the laboratory management and quantum hardware control. 26 | 27 | Qibo provides a plug and play mechanism of :ref:`backend drivers ` which 28 | specializes the code for quantum simulation on different classical hardware 29 | configurations, such as multi-threading CPU, single GPU and multi-GPU, and 30 | similarly for quantum hardware control, from superconducting to ion trap 31 | technologies including FPGA and AWG devices. 32 | -------------------------------------------------------------------------------- /doc/source/getting-started/quickstart.rst: -------------------------------------------------------------------------------- 1 | Quick start 2 | ----------- 3 | 4 | To quickly install Qibo and a lightweight simulator for CPU, open a 5 | terminal with ``python >= 3.8`` and type: 6 | 7 | .. code-block:: bash 8 | 9 | pip install qibo 10 | 11 | This will install the basic primitives to start coding quantum applications. 12 | 13 | Instead, if you use `conda `_ type: 14 | 15 | .. code-block:: bash 16 | 17 | conda install -c conda-forge qibo 18 | 19 | .. note:: 20 | The ``qibo`` package alone includes a lightweight ``numpy`` simulator for 21 | single-thread CPU. Please visit the `backends `_ 22 | documentation for more details about simulation backends. 23 | 24 | Here an example of Quantum Fourier Transform (QFT) to test your installation: 25 | 26 | .. testcode:: 27 | 28 | from qibo.models import QFT 29 | 30 | # Create a QFT circuit with 15 qubits 31 | circuit = QFT(15) 32 | 33 | # Simulate final state wavefunction default initial state is |00> 34 | final_state = circuit() 35 | 36 | Here an example of adding gates and measurements: 37 | 38 | .. testcode:: 39 | 40 | import numpy as np 41 | from qibo import Circuit, gates 42 | 43 | circuit = Circuit(2) 44 | circuit.add(gates.X(0)) 45 | 46 | # Add a measurement register on both qubits 47 | circuit.add(gates.M(0, 1)) 48 | 49 | # Execute the circuit with the default initial state |00>. 50 | result = circuit(nshots=100) 51 | -------------------------------------------------------------------------------- /doc/source/qibo_ecosystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/doc/source/qibo_ecosystem.png -------------------------------------------------------------------------------- /examples/3_tangle/images/canonical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/3_tangle/images/canonical.png -------------------------------------------------------------------------------- /examples/3_tangle/images/circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/3_tangle/images/circuit.png -------------------------------------------------------------------------------- /examples/3_tangle/images/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/3_tangle/images/results.png -------------------------------------------------------------------------------- /examples/3_tangle/images/tangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/3_tangle/images/tangle.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/Ry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/Ry.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/ansatz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/ansatz.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/autoencoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/autoencoder.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/cost_ising.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/cost_ising.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/diagram.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/handwritten_cost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/handwritten_cost.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/handwritten_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/handwritten_output.png -------------------------------------------------------------------------------- /examples/EF_QAE/images/space_ising.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/EF_QAE/images/space_ising.png -------------------------------------------------------------------------------- /examples/aavqe/images/Lambda10_Ising.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/aavqe/images/Lambda10_Ising.png -------------------------------------------------------------------------------- /examples/aavqe/images/Lambdas_Ising.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/aavqe/images/Lambdas_Ising.png -------------------------------------------------------------------------------- /examples/aavqe/images/ansatz-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/aavqe/images/ansatz-1.png -------------------------------------------------------------------------------- /examples/aavqe/images/ising.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/aavqe/images/ising.png -------------------------------------------------------------------------------- /examples/adiabatic/images/dynamics_n4T4.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic/images/dynamics_n4T4.0.png -------------------------------------------------------------------------------- /examples/adiabatic/images/linears_T15plots_n4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic/images/linears_T15plots_n4.png -------------------------------------------------------------------------------- /examples/adiabatic/images/poly3_powell_n4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic/images/poly3_powell_n4.png -------------------------------------------------------------------------------- /examples/adiabatic/images/trotter_error_n6T1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic/images/trotter_error_n6T1.png -------------------------------------------------------------------------------- /examples/adiabatic/optparams/poly3_powell_n4_loss.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic/optparams/poly3_powell_n4_loss.npy -------------------------------------------------------------------------------- /examples/adiabatic/optparams/poly3_powell_n4_params.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic/optparams/poly3_powell_n4_params.npy -------------------------------------------------------------------------------- /examples/adiabatic3sat/images/H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic3sat/images/H.png -------------------------------------------------------------------------------- /examples/adiabatic3sat/images/h0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic3sat/images/h0.png -------------------------------------------------------------------------------- /examples/adiabatic3sat/images/hc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic3sat/images/hc.png -------------------------------------------------------------------------------- /examples/adiabatic3sat/images/hp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic3sat/images/hp.png -------------------------------------------------------------------------------- /examples/adiabatic3sat/images/optn10_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic3sat/images/optn10_plot.png -------------------------------------------------------------------------------- /examples/adiabatic3sat/images/prob_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic3sat/images/prob_plot.png -------------------------------------------------------------------------------- /examples/adiabatic3sat/images/z-matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic3sat/images/z-matrix.png -------------------------------------------------------------------------------- /examples/adiabatic_qml/images/pdf_est.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic_qml/images/pdf_est.png -------------------------------------------------------------------------------- /examples/adiabatic_qml/qaml_data/best_p.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic_qml/qaml_data/best_p.npy -------------------------------------------------------------------------------- /examples/adiabatic_qml/qaml_data/cdf.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic_qml/qaml_data/cdf.npy -------------------------------------------------------------------------------- /examples/adiabatic_qml/qaml_data/not_normed_sample.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic_qml/qaml_data/not_normed_sample.npy -------------------------------------------------------------------------------- /examples/adiabatic_qml/qaml_data/xarr.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/adiabatic_qml/qaml_data/xarr.npy -------------------------------------------------------------------------------- /examples/adiabatic_qml/qaml_scripts/evolution.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from qibo import callbacks, models 4 | 5 | 6 | def generate_schedule(params, schedule="poly"): 7 | """Generate the scheduling used into the adiabatic evolution.""" 8 | nparams = len(params) 9 | 10 | def poly(t): 11 | """General polynomial scheduling satisfying s(0)=0 and s(1)=1""" 12 | f = np.sum(t ** np.arange(1, 1 + nparams) * params) 13 | f /= np.sum(params) 14 | return f 15 | 16 | def derpoly(t): 17 | "Derivative of the polynomial above" 18 | f = np.sum(np.arange(1, 1 + nparams) * (t ** np.arange(0, nparams) * params)) 19 | return f / np.sum(params) 20 | 21 | return poly, derpoly 22 | 23 | 24 | def generate_adiabatic(params, h0, h1, obs_target, dt=1e-1, solver="exp"): 25 | """Generate the adiabatic evolution object.""" 26 | energy = callbacks.Energy(obs_target) 27 | # same scheduling function 28 | schedule, _ = generate_schedule(params, schedule="poly") 29 | return ( 30 | models.AdiabaticEvolution( 31 | h0, 32 | h1, 33 | schedule, 34 | dt=1e-1, 35 | solver="exp", 36 | callbacks=[energy], 37 | ), 38 | energy, 39 | ) 40 | 41 | 42 | # Perform adiabatic evolution (returns energy callback) 43 | def perform_adiabatic(params, finalT, h0, h1, obs_target, dt=1e-1, solver="exp"): 44 | """Return energy callback as an array""" 45 | evolution, energy = generate_adiabatic( 46 | params, h0, h1, obs_target, dt=1e-1, solver="exp" 47 | ) 48 | _ = evolution(final_time=finalT) 49 | return np.array(energy.results) 50 | -------------------------------------------------------------------------------- /examples/anomaly_detection/data/anomalous_data.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/data/anomalous_data.npy -------------------------------------------------------------------------------- /examples/anomaly_detection/data/standard_data.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/data/standard_data.npy -------------------------------------------------------------------------------- /examples/anomaly_detection/images/Fig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/images/Fig1.png -------------------------------------------------------------------------------- /examples/anomaly_detection/images/Fig2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/images/Fig2.png -------------------------------------------------------------------------------- /examples/anomaly_detection/images/Fig3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/images/Fig3.png -------------------------------------------------------------------------------- /examples/anomaly_detection/images/Fig4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/images/Fig4.png -------------------------------------------------------------------------------- /examples/anomaly_detection/images/Fig5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/images/Fig5.png -------------------------------------------------------------------------------- /examples/anomaly_detection/images/Fig6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/images/Fig6.png -------------------------------------------------------------------------------- /examples/anomaly_detection/parameters/trained_params.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/anomaly_detection/parameters/trained_params.npy -------------------------------------------------------------------------------- /examples/autoencoder/images/ansatz-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/autoencoder/images/ansatz-1.png -------------------------------------------------------------------------------- /examples/autoencoder/images/autoencoder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/autoencoder/images/autoencoder.png -------------------------------------------------------------------------------- /examples/bell-variational/images/chshequation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/bell-variational/images/chshequation.png -------------------------------------------------------------------------------- /examples/bell-variational/images/circuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/bell-variational/images/circuit.png -------------------------------------------------------------------------------- /examples/bell-variational/main.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | import numpy as np 4 | from functions import compute_chsh, cost_function, set_parametrized_circuits 5 | 6 | from qibo import set_backend 7 | from qibo.optimizers import optimize 8 | 9 | 10 | def main(nshots, backend): 11 | """Variationally find a maximally entangled state and the correct measurement angle 12 | for violation of Bell inequalities. 13 | Args: 14 | nshots: number of shots to use for the minimization. 15 | backend: choice of backend to run the example in. 16 | 17 | """ 18 | set_backend(backend) 19 | initial_parameters = np.random.uniform(0, 2 * np.pi, 2) 20 | circuits = set_parametrized_circuits() 21 | best, params, _ = optimize( 22 | cost_function, initial_parameters, args=(circuits, nshots) 23 | ) 24 | print(f"Cost: {best}\n") 25 | print(f"Parameters: {params}\n") 26 | print(f"Angles for the RY gates: {(params*180/np.pi)%360} in degrees.\n") 27 | frequencies = [] 28 | for circuit in circuits: 29 | circuit.set_parameters(params) 30 | frequencies.append(circuit(nshots=nshots).frequencies()) 31 | chsh = compute_chsh(frequencies, nshots) 32 | print(f"CHSH inequality value: {chsh}\n") 33 | print(f"Target: {np.sqrt(2)*2}\n") 34 | print(f"Relative distance: {100*np.abs(np.abs(chsh)-np.sqrt(2)*2)/np.sqrt(2)*2}%\n") 35 | 36 | 37 | if __name__ == "__main__": 38 | parser = argparse.ArgumentParser() 39 | parser.add_argument( 40 | "--nshots", 41 | default=10000, 42 | type=int, 43 | help="Number of shots for each circuit base", 44 | ) 45 | parser.add_argument( 46 | "--backend", default="qibojit", type=str, help="Backend to use for the example" 47 | ) 48 | args = vars(parser.parse_args()) 49 | main(**args) 50 | -------------------------------------------------------------------------------- /examples/benchmarks/images/adiabatic_evolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/adiabatic_evolution.png -------------------------------------------------------------------------------- /examples/benchmarks/images/adiabatic_evolution_dt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/adiabatic_evolution_dt.png -------------------------------------------------------------------------------- /examples/benchmarks/images/qft_c128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/qft_c128.png -------------------------------------------------------------------------------- /examples/benchmarks/images/qft_c64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/qft_c64.png -------------------------------------------------------------------------------- /examples/benchmarks/images/qibo_c64_vs_c128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/qibo_c64_vs_c128.png -------------------------------------------------------------------------------- /examples/benchmarks/images/qibo_configurations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/qibo_configurations.png -------------------------------------------------------------------------------- /examples/benchmarks/images/qibo_configurations_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/qibo_configurations_small.png -------------------------------------------------------------------------------- /examples/benchmarks/images/qibo_shots_cpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/qibo_shots_cpu.png -------------------------------------------------------------------------------- /examples/benchmarks/images/qibo_shots_gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/qibo_shots_gpu.png -------------------------------------------------------------------------------- /examples/benchmarks/images/var5layer_c128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/var5layer_c128.png -------------------------------------------------------------------------------- /examples/benchmarks/images/var5layer_c64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/var5layer_c64.png -------------------------------------------------------------------------------- /examples/benchmarks/images/varcircuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/benchmarks/images/varcircuit.png -------------------------------------------------------------------------------- /examples/benchmarks/results/PRECISION.md: -------------------------------------------------------------------------------- 1 | # Simulation precision 2 | 3 | Qibo allows the user to easily switch between single (``complex64``) 4 | and double (``complex128``) precision as described in 5 | [How to modify the simulation precision?](https://qibo.science/qibo/stable/code-examples/examples.html#how-to-modify-the-simulation-precision). 6 | In this section we compare simulation performance of both precisions. 7 | We find that as the number of qubits grows using single precision is ~2 8 | times faster on GPU and ~1.5 faster on CPU. 9 | 10 | 11 | `nqubits` | CPU c64 | CPU c128 | GPU c64 | GPU c128 12 | -- | -- | -- | -- | -- 13 | 23 | 0.41793 | 0.57448 | 0.07276 | 0.09249 14 | 24 | 0.83167 | 1.28207 | 0.09982 | 0.14664 15 | 25 | 1.75593 | 2.68645 | 0.15088 | 0.25463 16 | 26 | 3.68007 | 5.60514 | 0.26269 | 0.47597 17 | 27 | 7.71366 | 11.78381 | 0.48103 | 0.93437 18 | 28 | 16.36245 | 24.84334 | 0.93884 | 1.87903 19 | 29 | 34.66599 | 52.47754 | 1.88652 | 3.8849 20 | 30 | 73.43444 | 110.6095 | 3.90816 | 8.10977 21 | 31 | 155.01974 | 232.35723 | 8.08614 | 22 | 32 | 329.56916 | 488.00321 | | 23 | 33 | 694.67844 | 1021.06619 | | 24 | 34 | 1465.81645 | | | 25 | 26 | ![precision-benchmarks](../images/qibo_c64_vs_c128.png) 27 | -------------------------------------------------------------------------------- /examples/benchmarks/results/SHOTS.md: -------------------------------------------------------------------------------- 1 | # Measurement Shots Benchmark 2 | 3 | Qibo simulates quantum measurements using its standard dense state vector 4 | simulator, followed by sampling from the distribution corresponding to the final 5 | state vector. Since the dense state vector is used instead of repeated circuit 6 | executions, measurement time does not have a strong dependence on the number of 7 | shots. 8 | The plots and numbers below contain only the time required for sampling 9 | as the state vector simulation time (time required to apply gates) has been 10 | subtracted from the total execution time. The circuit used in this benchmark 11 | consists of a layer of ``H`` gates applied to every qubit followed by a 12 | measurement of all qubits. 13 | 14 | 15 | `nshots` | CPU N=12 | GPU N=12 | CPU N=22 | GPU N=22 16 | -- | -- | -- | -- | -- 17 | 10 | 0.00222 | 0.001 | 0.06738 | 0.01154 18 | 50 | 0.00216 | 0.00099 | 0.06737 | 0.01367 19 | 100 | 0.00227 | 0.00099 | 0.06743 | 0.0216 20 | 500 | 0.00227 | 0.00115 | 0.06756 | 0.08641 21 | 1000 | 0.00236 | 0.00101 | 0.06785 | 0.11819 22 | 5000 | 0.00342 | 0.00098 | 0.06934 | 0.11781 23 | 10000 | 0.00452 | 0.00158 | 0.07157 | 0.12264 24 | 50000 | 0.01242 | 0.0069 | 0.08722 | 0.13751 25 | 100000 | 0.01939 | 0.01337 | 0.10656 | 0.15444 26 | 250000 | 0.04117 | 0.03254 | 0.16497 | 0.21442 27 | 500000 | 0.07463 | 0.06422 | 0.26315 | 0.31621 28 | 750000 | 0.11058 | 0.09289 | 0.35994 | 0.40627 29 | 1000000 | 0.13462 | 0.12177 | 0.46654 | 0.50615 30 | 31 | ![shots-cpu](../images/qibo_shots_cpu.png) 32 | ![shots-gpu](../images/qibo_shots_gpu.png) 33 | -------------------------------------------------------------------------------- /examples/benchmarks/utils.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | 4 | 5 | class BenchmarkLogger(list): 6 | def __init__(self, filename=None): 7 | self.filename = filename 8 | if filename is not None and os.path.isfile(filename): 9 | print(f"Extending existing logs from {filename}.") 10 | with open(filename) as file: 11 | super().__init__(json.load(file)) 12 | else: 13 | if filename is not None: 14 | print(f"Creating new logs in {filename}.") 15 | super().__init__() 16 | 17 | def dump(self): 18 | if self.filename is not None: 19 | with open(self.filename, "w") as file: 20 | json.dump(list(self), file) 21 | 22 | def __str__(self): 23 | return "\n".join(f"{k}: {v}" for k, v in self[-1].items()) 24 | 25 | 26 | def parse_accelerators(accelerators): 27 | """Transforms string that specifies accelerators to dictionary. 28 | 29 | The string that is parsed has the following format: 30 | n1device1,n2device2,n3device3,... 31 | and is transformed to the dictionary: 32 | {'device1': n1, 'device2': n2, 'device3': n3, ...} 33 | 34 | Example: 35 | 2/GPU:0,2/GPU:1 --> {'/GPU:0': 2, '/GPU:1': 2} 36 | """ 37 | if accelerators is None: 38 | return None 39 | 40 | def read_digit(x): 41 | i = 0 42 | while x[i].isdigit(): 43 | i += 1 44 | return x[i:], int(x[:i]) 45 | 46 | acc_dict = {} 47 | for entry in accelerators.split(","): 48 | device, n = read_digit(entry) 49 | if device in acc_dict: 50 | acc_dict[device] += n 51 | else: 52 | acc_dict[device] = n 53 | return acc_dict 54 | -------------------------------------------------------------------------------- /examples/conftest.py: -------------------------------------------------------------------------------- 1 | def pytest_addoption(parser): 2 | parser.addoption("--examples-timeout", type=int, default=100000) 3 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i1.txt: -------------------------------------------------------------------------------- 1 | 10 8 4 2 | 0 1 1 0 0 0 0 1 0 1 3 | 4 5 8 4 | 5 6 10 5 | 4 6 8 6 | 3 4 7 7 | 1 2 6 8 | 1 6 8 9 | 1 9 10 10 | 2 5 7 11 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i10.txt: -------------------------------------------------------------------------------- 1 | 10 9 3 2 | 1 0 0 0 0 1 1 0 0 0 3 | 1 9 10 4 | 1 8 10 5 | 2 7 10 6 | 4 6 9 7 | 5 6 10 8 | 2 3 7 9 | 5 6 9 10 | 6 8 10 11 | 1 2 3 12 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i2.txt: -------------------------------------------------------------------------------- 1 | 10 8 5 2 | 0 0 1 0 1 0 0 1 1 1 3 | 1 5 6 4 | 1 4 8 5 | 4 6 9 6 | 1 2 5 7 | 1 6 9 8 | 6 7 8 9 | 4 7 10 10 | 3 6 7 11 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i3.txt: -------------------------------------------------------------------------------- 1 | 10 8 3 2 | 0 0 0 0 1 1 0 0 0 1 3 | 5 7 9 4 | 4 7 10 5 | 2 5 8 6 | 2 3 10 7 | 2 9 10 8 | 6 7 9 9 | 4 6 9 10 | 1 5 8 11 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i4.txt: -------------------------------------------------------------------------------- 1 | 10 9 5 2 | 1 0 0 1 1 0 1 0 1 0 3 | 2 7 8 4 | 2 3 7 5 | 1 8 10 6 | 2 9 10 7 | 5 8 10 8 | 4 6 8 9 | 6 7 8 10 | 2 5 10 11 | 2 5 8 12 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i5.txt: -------------------------------------------------------------------------------- 1 | 10 8 4 2 | 0 1 0 0 0 0 1 0 1 1 3 | 1 2 4 4 | 4 5 7 5 | 4 7 8 6 | 2 4 5 7 | 3 6 7 8 | 3 8 10 9 | 1 2 5 10 | 1 4 9 11 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i6.txt: -------------------------------------------------------------------------------- 1 | 10 9 3 2 | 1 0 0 0 0 1 0 1 0 0 3 | 1 2 7 4 | 3 4 6 5 | 3 6 7 6 | 4 5 8 7 | 1 7 9 8 | 1 2 10 9 | 5 6 9 10 | 2 3 6 11 | 1 3 10 12 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i7.txt: -------------------------------------------------------------------------------- 1 | 10 8 3 2 | 0 0 0 0 1 0 0 0 1 1 3 | 1 5 8 4 | 2 8 9 5 | 1 7 9 6 | 1 4 10 7 | 5 6 8 8 | 2 3 10 9 | 4 5 8 10 | 1 2 5 11 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i8.txt: -------------------------------------------------------------------------------- 1 | 10 9 2 2 | 0 0 0 0 1 1 0 0 0 0 3 | 1 3 6 4 | 3 5 8 5 | 3 6 10 6 | 2 5 9 7 | 4 5 9 8 | 2 6 7 9 | 4 6 9 10 | 1 2 6 11 | 5 7 10 12 | -------------------------------------------------------------------------------- /examples/data3sat/10bit/n10i9.txt: -------------------------------------------------------------------------------- 1 | 10 9 3 2 | 1 0 0 0 0 0 0 0 1 1 3 | 2 3 10 4 | 1 7 8 5 | 2 7 9 6 | 5 6 9 7 | 1 3 4 8 | 2 6 10 9 | 5 6 10 10 | 3 8 10 11 | 1 2 8 12 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i1.txt: -------------------------------------------------------------------------------- 1 | 12 10 5 2 | 0 1 0 1 0 0 1 1 0 0 0 1 3 | 4 6 9 4 | 6 7 11 5 | 5 7 9 6 | 3 5 8 7 | 1 3 7 8 | 1 7 10 9 | 8 9 11 10 | 7 9 10 11 | 1 11 12 12 | 2 6 9 13 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i10.txt: -------------------------------------------------------------------------------- 1 | 12 10 5 2 | 0 1 1 0 1 0 1 0 0 0 1 0 3 | 1 2 9 4 | 7 9 10 5 | 2 8 12 6 | 4 10 11 7 | 2 6 10 8 | 3 6 8 9 | 1 3 10 10 | 3 8 10 11 | 4 5 12 12 | 1 5 9 13 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i2.txt: -------------------------------------------------------------------------------- 1 | 12 11 5 2 | 0 1 1 1 0 1 0 1 0 0 0 0 3 | 1 3 7 4 | 7 8 9 5 | 4 10 11 6 | 1 2 9 7 | 4 5 12 8 | 1 3 9 9 | 8 9 11 10 | 1 6 10 11 | 5 8 9 12 | 4 5 11 13 | 5 6 7 14 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i3.txt: -------------------------------------------------------------------------------- 1 | 12 10 5 2 | 0 1 0 0 0 0 1 0 1 1 0 1 3 | 4 9 11 4 | 3 7 8 5 | 1 3 12 6 | 2 6 11 7 | 5 6 10 8 | 1 2 3 9 | 1 4 10 10 | 1 3 9 11 | 6 8 9 12 | 2 3 6 13 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i4.txt: -------------------------------------------------------------------------------- 1 | 12 9 4 2 | 1 1 0 0 1 0 0 0 0 1 0 0 3 | 2 8 9 4 | 2 3 8 5 | 1 9 12 6 | 2 11 12 7 | 6 10 11 8 | 4 7 10 9 | 3 5 7 10 | 7 8 10 11 | 2 6 12 12 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i5.txt: -------------------------------------------------------------------------------- 1 | 12 11 3 2 | 1 0 0 1 0 1 0 0 0 0 0 0 3 | 3 4 11 4 | 2 3 6 5 | 2 6 9 6 | 1 2 5 7 | 5 6 8 8 | 4 8 10 9 | 3 5 6 10 | 1 2 3 11 | 4 10 11 12 | 4 7 9 13 | 4 10 12 14 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i6.txt: -------------------------------------------------------------------------------- 1 | 12 10 4 2 | 1 0 1 0 1 0 0 0 0 1 0 0 3 | 3 4 6 4 | 1 2 12 5 | 6 7 10 6 | 2 3 7 7 | 2 3 9 8 | 1 4 12 9 | 1 6 9 10 | 2 10 11 11 | 1 8 11 12 | 2 5 12 13 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i7.txt: -------------------------------------------------------------------------------- 1 | 12 10 5 2 | 1 0 0 0 0 0 0 0 1 1 1 1 3 | 6 7 10 4 | 4 6 9 5 | 3 5 12 6 | 4 7 12 7 | 4 5 9 8 | 1 7 8 9 | 1 3 6 10 | 3 8 11 11 | 2 8 9 12 | 4 7 9 13 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i8.txt: -------------------------------------------------------------------------------- 1 | 12 9 5 2 | 1 0 0 0 1 0 1 1 1 0 0 0 3 | 2 4 5 4 | 2 7 12 5 | 6 7 12 6 | 4 9 12 7 | 2 3 9 8 | 1 11 12 9 | 1 10 11 10 | 3 8 12 11 | 4 7 11 12 | -------------------------------------------------------------------------------- /examples/data3sat/12bit/n12i9.txt: -------------------------------------------------------------------------------- 1 | 12 11 5 2 | 0 0 0 1 1 1 1 0 1 0 0 0 3 | 1 5 12 4 | 3 9 10 5 | 2 5 10 6 | 1 4 11 7 | 5 10 12 8 | 3 4 8 9 | 1 2 6 10 | 3 7 10 11 | 3 4 11 12 | 1 6 8 13 | 2 6 8 14 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i1.txt: -------------------------------------------------------------------------------- 1 | 14 11 5 2 | 0 0 1 1 0 0 1 0 0 0 1 1 0 0 3 | 5 7 10 4 | 7 8 13 5 | 5 9 11 6 | 4 6 10 7 | 1 3 8 8 | 5 6 7 9 | 2 8 11 10 | 8 10 11 11 | 1 12 14 12 | 8 12 13 13 | 2 7 10 14 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i10.txt: -------------------------------------------------------------------------------- 1 | 14 11 3 2 | 0 1 0 1 0 0 0 1 0 0 0 0 0 0 3 | 7 8 9 4 | 6 8 12 5 | 4 5 13 6 | 1 2 3 7 | 3 4 10 8 | 2 6 10 9 | 2 3 12 10 | 2 7 14 11 | 7 8 11 12 | 5 8 9 13 | 2 10 12 14 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i2.txt: -------------------------------------------------------------------------------- 1 | 14 11 4 2 | 0 0 0 0 1 0 1 0 0 1 0 1 0 0 3 | 5 9 13 4 | 5 6 11 5 | 6 7 9 6 | 4 9 12 7 | 1 7 11 8 | 1 2 7 9 | 3 5 14 10 | 5 8 11 11 | 4 7 13 12 | 3 9 10 13 | 3 12 13 14 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i3.txt: -------------------------------------------------------------------------------- 1 | 14 13 4 2 | 0 0 0 1 1 0 0 0 0 0 1 0 0 1 3 | 9 11 12 4 | 4 7 13 5 | 7 13 14 6 | 1 11 12 7 | 2 9 11 8 | 3 4 9 9 | 1 10 14 10 | 5 6 13 11 | 3 13 14 12 | 9 10 11 13 | 6 11 13 14 | 5 8 12 15 | 3 11 12 16 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i4.txt: -------------------------------------------------------------------------------- 1 | 14 12 5 2 | 0 1 1 0 1 0 0 0 0 0 0 1 0 1 3 | 5 6 7 4 | 2 8 9 5 | 1 3 7 6 | 3 10 13 7 | 2 9 10 8 | 5 8 11 9 | 8 9 14 10 | 4 7 12 11 | 2 7 9 12 | 6 8 12 13 | 1 5 13 14 | 1 10 14 15 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i5.txt: -------------------------------------------------------------------------------- 1 | 14 11 5 2 | 0 0 0 1 0 0 0 0 1 1 0 1 0 1 3 | 3 7 9 4 | 2 4 5 5 | 1 6 10 6 | 3 4 13 7 | 5 6 12 8 | 3 5 14 9 | 1 5 14 10 | 1 2 9 11 | 8 10 11 12 | 2 4 8 13 | 4 6 11 14 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i6.txt: -------------------------------------------------------------------------------- 1 | 14 12 5 2 | 0 0 0 1 1 1 1 0 0 0 1 0 0 0 3 | 5 9 12 4 | 7 8 14 5 | 3 4 10 6 | 6 8 12 7 | 8 11 14 8 | 1 3 4 9 | 1 6 12 10 | 6 10 13 11 | 4 10 14 12 | 3 4 9 13 | 7 12 13 14 | 2 6 12 15 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i7.txt: -------------------------------------------------------------------------------- 1 | 14 10 5 2 | 1 0 0 0 0 0 0 0 1 1 1 1 0 0 3 | 7 8 10 4 | 1 4 5 5 | 8 11 14 6 | 6 9 13 7 | 2 7 10 8 | 6 11 13 9 | 2 8 11 10 | 3 7 12 11 | 1 8 14 12 | 4 12 13 13 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i8.txt: -------------------------------------------------------------------------------- 1 | 14 11 5 2 | 1 0 1 0 1 0 0 0 0 0 1 0 1 0 3 | 12 13 14 4 | 5 8 9 5 | 3 4 8 6 | 6 8 11 7 | 1 4 12 8 | 1 2 10 9 | 2 10 13 10 | 2 7 11 11 | 3 7 10 12 | 2 4 11 13 | 3 9 12 14 | -------------------------------------------------------------------------------- /examples/data3sat/14bit/n14i9.txt: -------------------------------------------------------------------------------- 1 | 14 11 6 2 | 0 0 1 0 1 0 1 0 0 1 0 0 1 1 3 | 2 5 8 4 | 3 8 9 5 | 3 6 11 6 | 4 6 10 7 | 4 7 12 8 | 1 8 10 9 | 2 3 6 10 | 1 9 13 11 | 2 8 14 12 | 2 11 14 13 | 7 8 9 14 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i1.txt: -------------------------------------------------------------------------------- 1 | 16 14 6 2 | 1 1 1 0 0 1 0 0 1 0 0 0 0 0 1 0 3 | 1 12 14 4 | 3 10 12 5 | 3 4 10 6 | 1 12 16 7 | 6 7 14 8 | 3 14 16 9 | 7 13 15 10 | 5 9 13 11 | 4 6 10 12 | 5 6 7 13 | 9 11 13 14 | 2 11 12 15 | 2 8 16 16 | 4 5 15 17 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i10.txt: -------------------------------------------------------------------------------- 1 | 16 14 4 2 | 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 3 | 7 9 16 4 | 2 12 14 5 | 6 10 11 6 | 5 6 9 7 | 7 9 14 8 | 7 13 16 9 | 7 9 12 10 | 3 6 14 11 | 7 8 13 12 | 6 11 15 13 | 4 12 16 14 | 1 7 8 15 | 6 9 11 16 | 2 9 11 17 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i2.txt: -------------------------------------------------------------------------------- 1 | 16 13 5 2 | 1 0 0 1 0 1 1 0 0 0 0 1 0 0 0 0 3 | 3 4 15 4 | 3 6 16 5 | 1 5 16 6 | 1 2 11 7 | 9 12 13 8 | 2 4 9 9 | 1 9 10 10 | 5 7 13 11 | 4 10 16 12 | 1 15 16 13 | 3 7 14 14 | 6 8 15 15 | 3 10 12 16 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i3.txt: -------------------------------------------------------------------------------- 1 | 16 12 7 2 | 1 1 1 0 0 0 1 0 0 0 1 0 1 0 0 1 3 | 4 9 13 4 | 3 6 15 5 | 1 8 10 6 | 3 8 10 7 | 3 5 15 8 | 2 5 6 9 | 3 4 14 10 | 8 9 11 11 | 11 12 15 12 | 1 5 6 13 | 9 12 16 14 | 7 10 15 15 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i4.txt: -------------------------------------------------------------------------------- 1 | 16 13 6 2 | 1 0 0 0 0 0 1 0 1 0 1 1 1 0 0 0 3 | 10 13 14 4 | 3 4 12 5 | 5 6 12 6 | 4 6 12 7 | 5 13 15 8 | 1 4 16 9 | 1 2 8 10 | 3 11 16 11 | 2 4 7 12 | 4 9 15 13 | 8 10 12 14 | 12 14 15 15 | 4 5 11 16 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i5.txt: -------------------------------------------------------------------------------- 1 | 16 13 5 2 | 0 0 1 1 0 0 0 0 1 0 0 1 1 0 0 0 3 | 8 9 11 4 | 5 9 14 5 | 7 10 12 6 | 3 11 15 7 | 2 4 15 8 | 6 9 11 9 | 4 15 16 10 | 8 9 15 11 | 1 2 13 12 | 4 8 10 13 | 1 8 13 14 | 1 9 15 15 | 2 10 12 16 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i6.txt: -------------------------------------------------------------------------------- 1 | 16 14 6 2 | 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 1 3 | 6 13 16 4 | 5 13 14 5 | 5 8 10 6 | 7 8 10 7 | 1 6 12 8 | 1 2 6 9 | 8 15 16 10 | 5 9 10 11 | 7 9 14 12 | 4 5 14 13 | 1 2 4 14 | 3 4 11 15 | 2 3 14 16 | 2 8 15 17 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i7.txt: -------------------------------------------------------------------------------- 1 | 16 13 7 2 | 1 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 3 | 1 7 12 4 | 3 15 16 5 | 2 9 12 6 | 5 6 8 7 | 6 7 10 8 | 8 12 13 9 | 3 4 11 10 | 10 11 13 11 | 3 13 16 12 | 8 9 11 13 | 5 11 16 14 | 7 8 13 15 | 3 9 14 16 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i8.txt: -------------------------------------------------------------------------------- 1 | 16 13 7 2 | 1 0 0 0 0 0 1 0 1 1 1 0 1 1 0 0 3 | 5 7 12 4 | 9 12 15 5 | 4 8 10 6 | 3 11 12 7 | 5 11 16 8 | 2 7 12 9 | 3 8 9 10 | 4 5 13 11 | 3 14 15 12 | 4 5 10 13 | 1 5 12 14 | 4 5 11 15 | 6 14 16 16 | -------------------------------------------------------------------------------- /examples/data3sat/16bit/n16i9.txt: -------------------------------------------------------------------------------- 1 | 16 13 5 2 | 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 3 | 2 6 10 4 | 6 12 13 5 | 6 8 12 6 | 1 7 8 7 | 3 4 8 8 | 4 10 12 9 | 1 7 12 10 | 9 10 14 11 | 4 7 13 12 | 4 15 16 13 | 5 11 14 14 | 6 8 11 15 | 9 13 16 16 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i1.txt: -------------------------------------------------------------------------------- 1 | 18 14 6 2 | 1 0 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 3 | 3 12 13 4 | 4 15 16 5 | 5 9 16 6 | 9 16 18 7 | 1 14 16 8 | 3 11 14 9 | 3 4 12 10 | 1 13 18 11 | 3 16 17 12 | 8 14 17 13 | 6 10 15 14 | 5 7 11 15 | 10 12 15 16 | 2 9 18 17 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i10.txt: -------------------------------------------------------------------------------- 1 | 18 15 6 2 | 0 0 0 0 0 1 1 0 1 1 0 1 0 0 1 0 0 0 3 | 3 6 8 4 | 7 14 18 5 | 6 13 17 6 | 3 5 9 7 | 2 4 15 8 | 5 6 17 9 | 2 12 13 10 | 9 17 18 11 | 2 15 16 12 | 1 7 18 13 | 4 10 11 14 | 1 12 17 15 | 5 9 16 16 | 7 17 18 17 | 3 7 11 18 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i2.txt: -------------------------------------------------------------------------------- 1 | 18 16 5 2 | 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 0 0 0 3 | 6 11 16 4 | 8 10 18 5 | 4 5 12 6 | 8 10 16 7 | 10 14 18 8 | 2 4 5 9 | 6 13 14 10 | 2 8 15 11 | 7 13 17 12 | 5 13 18 13 | 8 13 15 14 | 9 15 17 15 | 1 7 18 16 | 4 14 15 17 | 3 8 15 18 | 1 6 17 19 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i3.txt: -------------------------------------------------------------------------------- 1 | 18 14 7 2 | 1 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 3 | 3 12 18 4 | 2 5 8 5 | 4 10 17 6 | 9 12 14 7 | 14 16 17 8 | 4 5 13 9 | 4 8 11 10 | 1 13 15 11 | 1 3 14 12 | 5 8 9 13 | 7 10 15 14 | 3 12 17 15 | 6 9 17 16 | 1 2 9 17 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i4.txt: -------------------------------------------------------------------------------- 1 | 18 15 6 2 | 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 3 | 8 15 17 4 | 6 9 12 5 | 6 10 17 6 | 7 8 11 7 | 3 8 17 8 | 3 9 18 9 | 2 6 15 10 | 11 13 15 11 | 4 11 14 12 | 7 14 15 13 | 2 5 10 14 | 9 10 16 15 | 4 6 8 16 | 1 7 14 17 | 6 12 17 18 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i5.txt: -------------------------------------------------------------------------------- 1 | 18 15 5 2 | 1 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 3 | 8 15 18 4 | 8 10 13 5 | 3 7 16 6 | 8 9 15 7 | 6 13 17 8 | 4 13 18 9 | 1 8 9 10 | 7 10 12 11 | 2 11 13 12 | 3 6 7 13 | 10 15 17 14 | 7 10 17 15 | 5 9 12 16 | 8 15 17 17 | 5 14 16 18 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i6.txt: -------------------------------------------------------------------------------- 1 | 18 15 7 2 | 0 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 0 1 3 | 4 6 12 4 | 5 8 13 5 | 6 8 16 6 | 7 11 16 7 | 5 13 17 8 | 9 15 16 9 | 9 11 12 10 | 2 8 9 11 | 3 8 12 12 | 2 15 18 13 | 4 13 15 14 | 4 8 18 15 | 4 5 10 16 | 4 13 14 17 | 1 13 16 18 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i7.txt: -------------------------------------------------------------------------------- 1 | 18 15 7 2 | 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 3 | 7 15 18 4 | 4 10 12 5 | 3 11 14 6 | 2 12 16 7 | 4 14 16 8 | 3 4 6 9 | 1 4 8 10 | 5 6 9 11 | 6 8 18 12 | 1 3 18 13 | 2 5 17 14 | 3 5 7 15 | 12 14 15 16 | 5 9 18 17 | 12 13 15 18 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i8.txt: -------------------------------------------------------------------------------- 1 | 18 15 5 2 | 0 0 1 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 3 | 6 8 15 4 | 4 5 17 5 | 2 3 17 6 | 1 3 16 7 | 6 16 17 8 | 6 10 13 9 | 9 12 13 10 | 1 5 11 11 | 5 14 18 12 | 4 7 11 13 | 3 8 11 14 | 2 5 10 15 | 4 7 14 16 | 11 12 15 17 | 8 10 12 18 | -------------------------------------------------------------------------------- /examples/data3sat/18bit/n18i9.txt: -------------------------------------------------------------------------------- 1 | 18 15 7 2 | 0 1 0 1 1 0 0 0 1 1 0 0 0 0 0 1 0 1 3 | 13 14 18 4 | 1 7 16 5 | 2 14 15 6 | 3 10 13 7 | 1 4 17 8 | 5 7 15 9 | 6 10 13 10 | 5 8 13 11 | 2 15 17 12 | 5 12 15 13 | 2 13 14 14 | 3 9 12 15 | 3 4 8 16 | 10 11 13 17 | 9 13 15 18 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i1.txt: -------------------------------------------------------------------------------- 1 | 20 17 8 2 | 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1 0 0 0 0 3 | 1 17 20 4 | 1 2 8 5 | 2 16 19 6 | 4 13 19 7 | 7 12 17 8 | 9 11 20 9 | 4 5 14 10 | 9 11 18 11 | 11 16 20 12 | 2 4 6 13 | 2 9 17 14 | 8 14 19 15 | 5 14 20 16 | 8 15 17 17 | 10 16 19 18 | 3 9 17 19 | 1 7 19 20 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i10.txt: -------------------------------------------------------------------------------- 1 | 20 17 7 2 | 1 0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 1 1 0 0 3 | 9 13 15 4 | 10 19 20 5 | 9 19 20 6 | 4 10 19 7 | 4 13 18 8 | 1 3 14 9 | 1 6 19 10 | 4 11 18 11 | 1 7 8 12 | 5 11 20 13 | 13 14 17 14 | 2 10 11 15 | 2 8 12 16 | 12 16 20 17 | 8 10 11 18 | 3 4 5 19 | 1 6 14 20 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i2.txt: -------------------------------------------------------------------------------- 1 | 20 16 6 2 | 0 1 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 3 | 6 8 19 4 | 2 3 9 5 | 2 4 20 6 | 1 7 14 7 | 1 3 13 8 | 5 13 14 9 | 4 10 13 10 | 1 4 8 11 | 2 11 19 12 | 4 10 17 13 | 3 7 20 14 | 2 15 18 15 | 8 15 20 16 | 5 12 20 17 | 3 8 15 18 | 13 16 18 19 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i3.txt: -------------------------------------------------------------------------------- 1 | 20 16 8 2 | 0 0 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1 1 0 0 3 | 3 9 14 4 | 2 7 20 5 | 6 9 12 6 | 6 17 20 7 | 1 7 19 8 | 8 14 19 9 | 5 7 16 10 | 3 6 15 11 | 2 4 14 12 | 2 7 12 13 | 5 14 18 14 | 5 11 13 15 | 7 16 20 16 | 6 16 18 17 | 6 10 13 18 | 9 10 12 19 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i4.txt: -------------------------------------------------------------------------------- 1 | 20 17 6 2 | 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 0 1 0 0 3 | 7 14 19 4 | 2 9 15 5 | 4 10 11 6 | 5 6 16 7 | 4 17 18 8 | 5 6 13 9 | 1 6 15 10 | 5 6 14 11 | 3 16 18 12 | 7 17 20 13 | 2 8 12 14 | 7 15 17 15 | 8 10 15 16 | 1 8 10 17 | 3 5 10 18 | 4 12 15 19 | 3 7 15 20 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i5.txt: -------------------------------------------------------------------------------- 1 | 20 16 7 2 | 0 1 0 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 3 | 4 5 16 4 | 6 9 15 5 | 6 9 18 6 | 8 12 18 7 | 6 15 19 8 | 10 16 18 9 | 10 12 13 10 | 3 9 10 11 | 3 8 13 12 | 2 16 20 13 | 4 14 16 14 | 5 9 20 15 | 4 5 11 16 | 7 12 17 17 | 1 14 17 18 | 2 4 20 19 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i6.txt: -------------------------------------------------------------------------------- 1 | 20 16 8 2 | 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 1 1 0 0 1 3 | 10 13 16 4 | 5 6 14 5 | 8 14 18 6 | 9 13 18 7 | 11 19 20 8 | 2 11 12 9 | 11 13 14 10 | 1 5 12 11 | 5 6 15 12 | 8 12 18 13 | 4 10 14 14 | 7 11 19 15 | 1 3 20 16 | 10 11 17 17 | 10 12 19 18 | 7 11 18 19 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i7.txt: -------------------------------------------------------------------------------- 1 | 20 17 8 2 | 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 1 1 3 | 11 12 17 4 | 3 17 18 5 | 6 8 9 6 | 15 17 20 7 | 2 7 12 8 | 3 9 20 9 | 12 17 20 10 | 2 14 19 11 | 10 13 19 12 | 2 14 16 13 | 4 13 20 14 | 1 2 17 15 | 8 14 15 16 | 6 15 20 17 | 10 12 16 18 | 3 10 18 19 | 5 17 19 20 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i8.txt: -------------------------------------------------------------------------------- 1 | 20 17 7 2 | 0 0 1 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 1 3 | 9 17 20 4 | 1 18 19 5 | 5 14 15 6 | 6 8 14 7 | 13 15 19 8 | 1 6 19 9 | 9 13 14 10 | 6 18 19 11 | 8 9 11 12 | 7 8 16 13 | 2 13 14 14 | 2 10 12 15 | 1 7 14 16 | 1 3 17 17 | 4 12 13 18 | 1 2 12 19 | 8 13 20 20 | -------------------------------------------------------------------------------- /examples/data3sat/20bit/n20i9.txt: -------------------------------------------------------------------------------- 1 | 20 17 8 2 | 1 0 0 1 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 0 3 | 3 11 15 4 | 1 5 19 5 | 5 8 17 6 | 6 11 14 7 | 5 9 14 8 | 2 17 19 9 | 5 13 16 10 | 2 14 16 11 | 4 10 13 12 | 3 5 9 13 | 7 8 12 14 | 11 12 15 15 | 10 15 17 16 | 8 14 16 17 | 1 13 15 18 | 15 18 20 19 | 12 15 18 20 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i1.txt: -------------------------------------------------------------------------------- 1 | 22 18 9 2 | 0 1 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 1 0 0 0 0 3 | 1 6 21 4 | 1 11 17 5 | 4 18 20 6 | 1 15 20 7 | 2 9 22 8 | 10 13 18 9 | 4 6 21 10 | 8 10 17 11 | 5 9 22 12 | 7 12 21 13 | 7 8 16 14 | 1 4 11 15 | 3 14 16 16 | 7 12 17 17 | 6 10 19 18 | 3 10 13 19 | 11 13 22 20 | 9 12 19 21 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i10.txt: -------------------------------------------------------------------------------- 1 | 22 17 8 2 | 0 1 0 0 0 0 0 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 3 | 1 13 18 4 | 7 13 16 5 | 8 9 18 6 | 5 18 19 7 | 12 20 21 8 | 5 20 21 9 | 6 9 17 10 | 9 13 15 11 | 5 14 15 12 | 4 5 20 13 | 3 11 13 14 | 11 12 19 15 | 1 10 16 16 | 2 11 18 17 | 16 19 21 18 | 6 10 22 19 | 3 7 13 20 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i2.txt: -------------------------------------------------------------------------------- 1 | 22 19 9 2 | 0 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 1 3 | 3 6 8 4 | 4 5 19 5 | 11 12 15 6 | 15 16 21 7 | 1 7 8 8 | 12 17 21 9 | 9 14 20 10 | 4 21 22 11 | 3 10 15 12 | 9 18 20 13 | 3 12 17 14 | 4 11 18 15 | 2 12 21 16 | 5 19 21 17 | 7 12 13 18 | 4 6 13 19 | 9 13 18 20 | 1 5 18 21 | 1 3 15 22 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i3.txt: -------------------------------------------------------------------------------- 1 | 22 20 8 2 | 0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 3 | 3 8 22 4 | 2 17 20 5 | 9 16 21 6 | 5 14 21 7 | 3 8 16 8 | 13 16 17 9 | 15 17 20 10 | 2 3 12 11 | 2 10 11 12 | 1 18 21 13 | 1 3 4 14 | 8 13 15 15 | 2 4 20 16 | 3 12 19 17 | 4 13 14 18 | 7 13 22 19 | 6 16 17 20 | 4 10 20 21 | 8 9 14 22 | 14 18 19 23 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i4.txt: -------------------------------------------------------------------------------- 1 | 22 17 6 2 | 0 0 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 0 0 0 3 | 1 14 21 4 | 2 12 22 5 | 3 18 22 6 | 11 13 14 7 | 7 12 19 8 | 9 14 16 9 | 4 15 21 10 | 3 5 20 11 | 9 13 15 12 | 6 21 22 13 | 11 12 20 14 | 2 3 18 15 | 5 11 14 16 | 1 10 17 17 | 1 12 21 18 | 9 14 17 19 | 4 8 14 20 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i5.txt: -------------------------------------------------------------------------------- 1 | 22 19 9 2 | 1 0 0 1 0 0 1 0 1 0 0 0 1 1 1 0 0 0 0 1 0 1 3 | 4 10 18 4 | 6 14 18 5 | 5 15 16 6 | 5 8 14 7 | 7 11 12 8 | 7 18 21 9 | 10 16 20 10 | 12 14 19 11 | 3 18 20 12 | 11 16 22 13 | 11 20 21 14 | 5 15 18 15 | 5 8 15 16 | 3 13 18 17 | 1 5 21 18 | 9 17 21 19 | 1 3 18 20 | 2 5 9 21 | 3 7 17 22 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i6.txt: -------------------------------------------------------------------------------- 1 | 22 19 7 2 | 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 3 | 10 18 22 4 | 9 12 16 5 | 4 8 19 6 | 10 11 18 7 | 7 15 21 8 | 5 16 22 9 | 2 3 14 10 | 1 9 11 11 | 9 12 15 12 | 2 13 16 13 | 4 7 9 14 | 5 20 21 15 | 12 18 21 16 | 9 13 20 17 | 6 11 15 18 | 10 18 20 19 | 6 17 20 20 | 15 21 22 21 | 4 13 19 22 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i7.txt: -------------------------------------------------------------------------------- 1 | 22 18 7 2 | 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 0 0 1 0 0 3 | 6 19 21 4 | 2 13 17 5 | 9 10 11 6 | 1 4 10 7 | 3 10 20 8 | 8 17 21 9 | 1 5 18 10 | 1 19 22 11 | 5 13 20 12 | 4 6 22 13 | 15 19 22 14 | 4 7 11 15 | 3 13 16 16 | 19 20 22 17 | 6 7 10 18 | 6 8 10 19 | 6 8 14 20 | 12 14 17 21 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i8.txt: -------------------------------------------------------------------------------- 1 | 22 18 8 2 | 1 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 1 3 | 1 16 19 4 | 19 20 21 5 | 6 9 12 6 | 13 16 17 7 | 1 9 13 8 | 14 15 19 9 | 5 8 21 10 | 3 8 13 11 | 5 12 13 12 | 6 16 21 13 | 1 9 21 14 | 2 7 22 15 | 4 19 20 16 | 8 14 21 17 | 4 16 22 18 | 5 7 9 19 | 11 17 18 20 | 5 10 13 21 | -------------------------------------------------------------------------------- /examples/data3sat/22bit/n22i9.txt: -------------------------------------------------------------------------------- 1 | 22 20 7 2 | 0 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 3 | 2 19 22 4 | 2 18 19 5 | 15 20 21 6 | 5 16 19 7 | 4 17 19 8 | 1 3 20 9 | 5 6 16 10 | 1 6 17 11 | 3 16 22 12 | 10 11 12 13 | 11 16 19 14 | 3 10 14 15 | 8 17 19 16 | 7 11 22 17 | 9 18 21 18 | 5 12 15 19 | 4 13 17 20 | 9 19 22 21 | 2 14 19 22 | 4 16 19 23 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i1.txt: -------------------------------------------------------------------------------- 1 | 24 22 10 2 | 0 1 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 1 1 1 0 3 | 5 18 20 4 | 4 10 20 5 | 1 8 22 6 | 10 19 23 7 | 6 7 16 8 | 2 4 11 9 | 6 13 19 10 | 16 17 18 11 | 5 8 22 12 | 1 12 15 13 | 4 12 15 14 | 4 7 22 15 | 3 7 9 16 | 12 13 16 17 | 16 18 23 18 | 1 7 9 19 | 13 18 23 20 | 10 15 22 21 | 5 23 24 22 | 3 11 17 23 | 10 19 21 24 | 3 14 19 25 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i10.txt: -------------------------------------------------------------------------------- 1 | 24 21 8 2 | 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 1 1 0 1 0 3 | 7 9 19 4 | 11 17 18 5 | 4 5 17 6 | 6 14 20 7 | 1 12 23 8 | 11 15 19 9 | 8 21 22 10 | 4 17 22 11 | 9 16 24 12 | 13 18 19 13 | 6 14 19 14 | 22 23 24 15 | 3 9 23 16 | 1 2 8 17 | 9 13 17 18 | 3 9 17 19 | 1 20 22 20 | 4 12 21 21 | 6 21 22 22 | 9 18 21 23 | 6 10 12 24 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i2.txt: -------------------------------------------------------------------------------- 1 | 24 20 8 2 | 1 1 1 0 0 0 1 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0 3 | 4 12 20 4 | 2 13 23 5 | 6 21 23 6 | 21 22 23 7 | 8 13 14 8 | 4 6 14 9 | 10 14 19 10 | 1 6 20 11 | 1 4 17 12 | 14 18 19 13 | 3 16 23 14 | 7 20 22 15 | 4 12 19 16 | 5 12 16 17 | 2 6 19 18 | 5 15 20 19 | 7 9 23 20 | 2 4 11 21 | 2 5 24 22 | 2 9 17 23 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i3.txt: -------------------------------------------------------------------------------- 1 | 24 20 8 2 | 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 3 | 2 11 15 4 | 3 23 24 5 | 12 13 20 6 | 9 10 17 7 | 15 21 24 8 | 1 16 22 9 | 1 14 21 10 | 3 4 18 11 | 17 22 24 12 | 13 15 21 13 | 1 22 23 14 | 8 16 17 15 | 9 10 16 16 | 1 15 18 17 | 5 7 21 18 | 1 6 16 19 | 3 5 15 20 | 11 17 23 21 | 10 21 23 22 | 8 19 23 23 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i4.txt: -------------------------------------------------------------------------------- 1 | 24 20 9 2 | 0 0 1 0 0 1 0 0 1 0 0 1 1 0 0 0 0 0 1 1 1 0 1 0 3 | 4 14 20 4 | 1 14 21 5 | 11 17 20 6 | 8 10 20 7 | 5 6 22 8 | 2 4 23 9 | 1 3 22 10 | 8 21 22 11 | 8 13 17 12 | 12 15 18 13 | 1 6 14 14 | 7 19 24 15 | 5 9 14 16 | 3 11 15 17 | 2 6 14 18 | 6 7 8 19 | 5 9 18 20 | 14 16 20 21 | 10 13 16 22 | 11 19 22 23 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i5.txt: -------------------------------------------------------------------------------- 1 | 24 19 10 2 | 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 1 1 0 1 1 0 0 1 3 | 16 19 23 4 | 5 10 16 5 | 13 15 18 6 | 4 8 10 7 | 9 19 24 8 | 7 17 23 9 | 3 6 12 10 | 3 5 20 11 | 6 8 23 12 | 3 15 17 13 | 12 23 24 14 | 2 19 21 15 | 2 9 24 16 | 6 13 15 17 | 1 16 23 18 | 7 12 21 19 | 9 22 24 20 | 1 11 12 21 | 3 9 14 22 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i6.txt: -------------------------------------------------------------------------------- 1 | 24 22 9 2 | 1 1 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 0 0 3 | 2 5 14 4 | 1 5 17 5 | 3 7 9 6 | 2 8 15 7 | 1 12 18 8 | 2 3 15 9 | 7 8 20 10 | 3 10 21 11 | 8 9 13 12 | 12 14 22 13 | 1 12 14 14 | 6 16 17 15 | 15 19 21 16 | 1 20 24 17 | 3 8 11 18 | 1 18 24 19 | 3 13 19 20 | 4 14 19 21 | 8 13 17 22 | 3 7 23 23 | 8 17 22 24 | 5 16 18 25 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i7.txt: -------------------------------------------------------------------------------- 1 | 24 18 9 2 | 0 0 0 0 1 0 0 1 0 0 0 0 1 1 1 1 0 0 1 0 1 0 1 0 3 | 6 7 13 4 | 8 18 22 5 | 4 19 20 6 | 4 11 21 7 | 6 13 18 8 | 2 3 16 9 | 6 17 23 10 | 3 5 22 11 | 10 18 23 12 | 11 12 14 13 | 4 6 16 14 | 9 10 19 15 | 11 13 24 16 | 1 6 15 17 | 8 12 17 18 | 7 15 18 19 | 6 18 19 20 | 12 13 18 21 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i8.txt: -------------------------------------------------------------------------------- 1 | 24 21 8 2 | 0 1 0 0 1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 0 1 0 3 | 4 8 14 4 | 1 2 17 5 | 5 6 21 6 | 14 18 24 7 | 2 3 14 8 | 7 12 23 9 | 5 7 20 10 | 15 17 19 11 | 10 18 19 12 | 12 21 23 13 | 5 11 22 14 | 5 6 22 15 | 9 11 22 16 | 11 17 23 17 | 5 7 22 18 | 4 9 20 19 | 11 13 22 20 | 6 10 18 21 | 8 12 16 22 | 2 4 7 23 | 7 10 23 24 | -------------------------------------------------------------------------------- /examples/data3sat/24bit/n24i9.txt: -------------------------------------------------------------------------------- 1 | 24 19 7 2 | 0 1 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 3 | 3 5 7 4 | 6 11 18 5 | 10 11 14 6 | 11 12 14 7 | 4 7 18 8 | 13 14 21 9 | 1 5 7 10 | 4 6 13 11 | 7 16 24 12 | 2 3 18 13 | 2 4 22 14 | 1 12 19 15 | 1 14 18 16 | 3 4 20 17 | 6 17 23 18 | 9 15 22 19 | 1 9 23 20 | 3 20 23 21 | 8 9 13 22 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i1.txt: -------------------------------------------------------------------------------- 1 | 26 21 9 2 | 1 0 1 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 1 3 | 5 9 24 4 | 1 13 16 5 | 4 9 10 6 | 4 13 17 7 | 5 7 24 8 | 4 8 9 9 | 5 6 23 10 | 13 14 17 11 | 17 19 25 12 | 1 8 9 13 | 14 20 25 14 | 10 16 24 15 | 5 25 26 16 | 3 12 18 17 | 11 21 23 18 | 3 15 20 19 | 5 13 21 20 | 2 14 25 21 | 6 22 25 22 | 23 24 25 23 | 4 7 15 24 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i10.txt: -------------------------------------------------------------------------------- 1 | 26 22 9 2 | 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 3 | 1 15 22 4 | 22 23 24 5 | 10 19 26 6 | 11 15 23 7 | 7 21 26 8 | 1 13 14 9 | 7 16 18 10 | 2 9 18 11 | 20 23 25 12 | 4 9 20 13 | 3 9 21 14 | 6 9 12 15 | 15 21 25 16 | 7 18 23 17 | 3 6 17 18 | 9 22 23 19 | 7 8 10 20 | 1 3 13 21 | 3 6 7 22 | 8 20 21 23 | 20 23 24 24 | 5 18 19 25 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i2.txt: -------------------------------------------------------------------------------- 1 | 26 22 10 2 | 0 1 0 0 1 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 1 1 0 0 1 0 3 | 2 6 15 4 | 1 6 18 5 | 3 8 10 6 | 2 8 16 7 | 1 13 20 8 | 2 4 16 9 | 7 8 22 10 | 3 11 23 11 | 9 10 14 12 | 13 16 24 13 | 1 13 15 14 | 6 17 18 15 | 16 21 23 16 | 1 22 26 17 | 3 9 12 18 | 4 5 24 19 | 2 19 26 20 | 3 14 21 21 | 4 16 21 22 | 9 14 18 23 | 3 8 25 24 | 9 18 24 25 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i3.txt: -------------------------------------------------------------------------------- 1 | 26 23 8 2 | 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 1 3 | 3 5 23 4 | 10 20 25 5 | 12 13 15 6 | 4 6 18 7 | 9 11 21 8 | 12 14 26 9 | 1 7 16 10 | 9 12 18 11 | 7 16 20 12 | 7 20 21 13 | 4 5 24 14 | 13 14 19 15 | 7 10 11 16 | 14 19 26 17 | 1 6 8 18 | 1 3 17 19 | 4 18 19 20 | 6 22 23 21 | 1 17 19 22 | 2 16 23 23 | 3 5 26 24 | 6 10 23 25 | 6 12 20 26 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i4.txt: -------------------------------------------------------------------------------- 1 | 26 22 10 2 | 0 1 0 0 0 0 1 1 0 0 0 0 0 1 1 0 1 1 0 0 1 1 0 0 0 1 3 | 6 8 11 4 | 2 9 16 5 | 3 10 22 6 | 9 15 23 7 | 1 8 16 8 | 12 13 15 9 | 4 8 23 10 | 3 15 23 11 | 8 12 16 12 | 8 10 25 13 | 6 12 18 14 | 9 20 21 15 | 10 21 24 16 | 1 14 19 17 | 11 12 15 18 | 2 19 20 19 | 4 20 22 20 | 5 14 24 21 | 11 15 23 22 | 7 10 23 23 | 5 10 17 24 | 6 25 26 25 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i5.txt: -------------------------------------------------------------------------------- 1 | 26 23 9 2 | 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 1 3 | 4 21 25 4 | 1 3 24 5 | 8 10 15 6 | 15 23 25 7 | 1 4 9 8 | 10 14 18 9 | 5 7 12 10 | 2 4 24 11 | 12 13 22 12 | 4 11 22 13 | 11 12 24 14 | 1 19 21 15 | 10 20 23 16 | 16 21 26 17 | 6 7 23 18 | 11 22 23 19 | 1 10 11 20 | 8 20 24 21 | 5 8 21 22 | 7 17 26 23 | 13 14 24 24 | 9 12 17 25 | 2 5 7 26 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i6.txt: -------------------------------------------------------------------------------- 1 | 26 21 10 2 | 0 0 0 0 1 0 0 1 1 1 0 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 3 | 11 16 19 4 | 5 14 21 5 | 3 11 13 6 | 2 3 24 7 | 7 9 21 8 | 12 17 23 9 | 1 10 21 10 | 4 13 21 11 | 9 20 21 12 | 2 13 23 13 | 8 19 22 14 | 5 17 20 15 | 1 23 25 16 | 10 20 22 17 | 6 21 25 18 | 5 15 17 19 | 15 21 25 20 | 2 4 8 21 | 8 14 22 22 | 1 10 18 23 | 2 6 26 24 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i7.txt: -------------------------------------------------------------------------------- 1 | 26 20 9 2 | 0 0 0 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 0 0 1 3 | 9 10 26 4 | 8 21 24 5 | 5 10 14 6 | 18 19 20 7 | 7 13 23 8 | 2 15 18 9 | 2 20 22 10 | 1 15 22 11 | 12 13 20 12 | 3 11 20 13 | 5 7 24 14 | 4 8 9 15 | 8 22 24 16 | 2 11 16 17 | 2 3 4 18 | 8 21 25 19 | 1 7 21 20 | 11 14 24 21 | 2 3 17 22 | 5 6 12 23 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i8.txt: -------------------------------------------------------------------------------- 1 | 26 21 8 2 | 1 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 1 1 0 0 0 0 0 0 3 | 9 19 24 4 | 17 21 26 5 | 6 13 22 6 | 3 17 25 7 | 1 21 22 8 | 6 8 10 9 | 3 5 22 10 | 4 16 19 11 | 3 17 23 12 | 3 7 14 13 | 1 12 24 14 | 4 20 26 15 | 15 25 26 16 | 6 13 16 17 | 6 16 26 18 | 1 3 22 19 | 7 17 25 20 | 7 20 22 21 | 11 19 25 22 | 2 5 24 23 | 5 9 18 24 | -------------------------------------------------------------------------------- /examples/data3sat/26bit/n26i9.txt: -------------------------------------------------------------------------------- 1 | 26 22 9 2 | 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 3 | 8 22 23 4 | 3 19 24 5 | 4 12 16 6 | 6 21 22 7 | 1 8 26 8 | 8 17 25 9 | 8 12 16 10 | 4 10 17 11 | 2 3 23 12 | 5 16 22 13 | 3 9 23 14 | 14 15 17 15 | 2 15 23 16 | 9 11 19 17 | 9 11 17 18 | 5 20 22 19 | 4 20 24 20 | 1 13 14 21 | 7 11 12 22 | 8 10 26 23 | 2 6 23 24 | 8 13 18 25 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i1.txt: -------------------------------------------------------------------------------- 1 | 28 21 8 2 | 1 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 3 | 7 10 23 4 | 9 15 20 5 | 7 12 20 6 | 2 24 26 7 | 7 18 23 8 | 2 20 22 9 | 5 13 18 10 | 4 6 12 11 | 10 11 16 12 | 15 17 20 13 | 14 21 23 14 | 11 19 22 15 | 1 17 21 16 | 21 25 28 17 | 17 21 25 18 | 19 20 23 19 | 8 22 25 20 | 15 16 27 21 | 5 9 27 22 | 5 18 27 23 | 3 13 15 24 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i10.txt: -------------------------------------------------------------------------------- 1 | 28 23 10 2 | 1 0 0 0 1 0 1 0 0 1 0 1 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0 3 | 2 13 28 4 | 13 21 28 5 | 2 21 22 6 | 5 18 23 7 | 22 25 27 8 | 9 14 16 9 | 3 11 12 10 | 1 9 27 11 | 8 10 20 12 | 9 24 26 13 | 11 13 26 14 | 10 11 25 15 | 1 6 9 16 | 8 12 19 17 | 16 21 23 18 | 3 17 21 19 | 3 5 8 20 | 10 18 25 21 | 17 18 28 22 | 4 17 28 23 | 7 9 25 24 | 1 4 19 25 | 5 6 15 26 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i2.txt: -------------------------------------------------------------------------------- 1 | 28 24 9 2 | 0 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 0 1 0 0 3 | 2 4 8 4 | 1 9 12 5 | 3 4 20 6 | 2 15 23 7 | 9 13 25 8 | 3 14 21 9 | 11 19 27 10 | 5 19 20 11 | 6 23 28 12 | 8 17 28 13 | 4 8 28 14 | 6 14 18 15 | 5 19 25 16 | 1 14 18 17 | 2 7 12 18 | 5 10 17 19 | 21 25 26 20 | 3 17 27 21 | 11 12 14 22 | 16 18 26 23 | 9 15 24 24 | 4 16 20 25 | 12 19 24 26 | 18 22 27 27 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i3.txt: -------------------------------------------------------------------------------- 1 | 28 23 9 2 | 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 1 1 1 0 3 | 6 12 18 4 | 15 17 21 5 | 16 27 28 6 | 5 9 12 7 | 11 22 28 8 | 8 20 27 9 | 4 7 13 10 | 3 5 23 11 | 7 9 27 12 | 3 18 20 13 | 14 26 28 14 | 3 22 24 15 | 2 11 28 16 | 6 15 17 17 | 1 19 27 18 | 8 14 25 19 | 10 26 28 20 | 2 13 14 21 | 4 11 16 22 | 1 27 28 23 | 1 22 24 24 | 9 22 23 25 | 3 17 23 26 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i4.txt: -------------------------------------------------------------------------------- 1 | 28 23 10 2 | 0 0 0 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 1 0 0 1 0 0 0 1 1 0 3 | 20 25 26 4 | 14 19 23 5 | 5 9 22 6 | 4 15 18 7 | 12 17 21 8 | 14 27 28 9 | 12 26 28 10 | 5 6 21 11 | 5 14 26 12 | 23 25 26 13 | 5 19 25 14 | 2 4 19 15 | 1 8 26 16 | 5 15 26 17 | 2 10 12 18 | 7 15 28 19 | 17 20 24 20 | 3 13 16 21 | 2 11 17 22 | 16 22 28 23 | 12 13 15 24 | 4 5 7 25 | 14 21 26 26 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i5.txt: -------------------------------------------------------------------------------- 1 | 28 22 9 2 | 1 0 0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 1 3 | 14 22 24 4 | 9 11 15 5 | 1 3 7 6 | 1 5 22 7 | 1 4 14 8 | 13 15 26 9 | 6 19 26 10 | 12 21 28 11 | 10 15 16 12 | 19 25 28 13 | 3 10 14 14 | 8 13 14 15 | 11 23 25 16 | 5 12 24 17 | 1 4 25 18 | 4 26 27 19 | 3 11 15 20 | 10 17 26 21 | 7 22 24 22 | 2 20 27 23 | 5 6 25 24 | 12 16 18 25 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i6.txt: -------------------------------------------------------------------------------- 1 | 28 24 9 2 | 0 1 0 0 1 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 3 | 15 23 24 4 | 16 20 27 5 | 17 26 27 6 | 18 23 25 7 | 15 19 22 8 | 3 24 28 9 | 12 18 23 10 | 12 20 27 11 | 12 15 27 12 | 10 25 27 13 | 3 5 23 14 | 10 11 21 15 | 3 4 22 16 | 6 18 26 17 | 10 11 20 18 | 8 22 26 19 | 2 20 23 20 | 9 11 26 21 | 5 8 9 22 | 3 13 28 23 | 6 22 23 24 | 10 14 15 25 | 7 16 18 26 | 1 4 5 27 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i7.txt: -------------------------------------------------------------------------------- 1 | 28 22 11 2 | 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 1 1 0 0 1 0 0 1 0 0 1 0 3 | 8 11 22 4 | 13 19 21 5 | 5 6 20 6 | 7 17 23 7 | 1 14 26 8 | 13 18 22 9 | 9 24 26 10 | 5 20 25 11 | 11 19 27 12 | 15 21 22 13 | 7 16 22 14 | 25 27 28 15 | 4 10 27 16 | 1 2 10 17 | 11 16 20 18 | 3 11 20 19 | 1 23 26 20 | 4 13 24 21 | 7 24 26 22 | 11 21 25 23 | 6 12 14 24 | 5 20 23 25 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i8.txt: -------------------------------------------------------------------------------- 1 | 28 23 11 2 | 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 3 | 12 13 14 4 | 8 20 27 5 | 3 14 17 6 | 9 14 26 7 | 5 8 16 8 | 18 23 25 9 | 18 20 28 10 | 22 26 27 11 | 1 23 28 12 | 10 11 16 13 | 4 9 10 14 | 10 18 25 15 | 6 14 28 16 | 9 11 19 17 | 4 10 12 18 | 4 19 22 19 | 1 7 15 20 | 17 18 28 21 | 2 3 27 22 | 19 24 27 23 | 1 14 27 24 | 2 7 28 25 | 17 21 26 26 | -------------------------------------------------------------------------------- /examples/data3sat/28bit/n28i9.txt: -------------------------------------------------------------------------------- 1 | 28 22 10 2 | 0 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 1 1 3 | 7 12 23 4 | 6 10 13 5 | 12 20 24 6 | 24 26 27 7 | 3 16 20 8 | 6 22 28 9 | 3 7 15 10 | 4 7 13 11 | 1 5 12 12 | 6 15 26 13 | 7 9 27 14 | 13 21 23 15 | 8 13 19 16 | 7 14 17 17 | 14 25 26 18 | 16 22 24 19 | 2 17 21 20 | 3 4 16 21 | 5 18 26 22 | 7 10 11 23 | 2 4 6 24 | 16 20 25 25 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i1.txt: -------------------------------------------------------------------------------- 1 | 30 23 11 2 | 0 0 0 1 1 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 3 | 8 25 29 4 | 1 10 17 5 | 2 17 22 6 | 3 13 21 7 | 1 14 26 8 | 9 24 29 9 | 3 26 30 10 | 3 24 26 11 | 21 28 29 12 | 7 22 25 13 | 5 24 25 14 | 2 3 27 15 | 6 8 21 16 | 1 8 23 17 | 4 22 30 18 | 10 17 18 19 | 14 15 17 20 | 15 22 26 21 | 4 14 19 22 | 3 28 29 23 | 11 23 26 24 | 12 24 29 25 | 7 16 20 26 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i10.txt: -------------------------------------------------------------------------------- 1 | 30 24 10 2 | 0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 1 0 1 0 1 0 0 0 0 3 | 21 22 27 4 | 11 12 15 5 | 12 24 29 6 | 6 11 30 7 | 11 14 28 8 | 17 21 24 9 | 4 8 18 10 | 7 8 12 11 | 8 12 29 12 | 5 10 14 13 | 6 19 23 14 | 2 13 27 15 | 11 15 20 16 | 1 15 19 17 | 1 7 14 18 | 9 20 27 19 | 16 17 27 20 | 3 15 27 21 | 14 18 28 22 | 19 23 26 23 | 8 11 18 24 | 6 25 29 25 | 14 28 30 26 | 2 4 7 27 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i2.txt: -------------------------------------------------------------------------------- 1 | 30 25 10 2 | 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 3 | 5 19 22 4 | 11 17 27 5 | 5 10 26 6 | 2 24 30 7 | 19 23 24 8 | 9 13 17 9 | 20 26 30 10 | 5 10 17 11 | 9 18 26 12 | 6 13 20 13 | 12 18 21 14 | 5 23 30 15 | 12 23 29 16 | 14 20 26 17 | 14 16 29 18 | 21 28 30 19 | 4 16 21 20 | 2 5 8 21 | 1 9 13 22 | 2 16 25 23 | 10 14 27 24 | 3 15 22 25 | 12 21 29 26 | 7 25 30 27 | 7 15 19 28 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i3.txt: -------------------------------------------------------------------------------- 1 | 30 22 11 2 | 0 0 1 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 1 1 0 1 0 0 0 0 0 0 3 | 6 20 27 4 | 2 5 20 5 | 1 9 28 6 | 5 16 27 7 | 2 10 12 8 | 7 16 30 9 | 19 21 25 10 | 3 14 17 11 | 2 11 18 12 | 18 23 29 13 | 12 14 16 14 | 4 6 8 15 | 1 8 20 16 | 15 22 28 17 | 8 13 23 18 | 9 14 29 19 | 15 16 29 20 | 7 24 29 21 | 9 11 12 22 | 3 8 26 23 | 17 22 28 24 | 2 14 21 25 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i4.txt: -------------------------------------------------------------------------------- 1 | 30 24 9 2 | 0 0 0 1 0 1 0 0 1 1 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 3 | 17 20 24 4 | 5 6 13 5 | 17 20 23 6 | 5 11 20 7 | 16 21 28 8 | 7 11 28 9 | 15 16 25 10 | 25 27 28 11 | 8 15 18 12 | 5 12 16 13 | 7 8 9 14 | 1 12 26 15 | 14 22 23 16 | 2 6 29 17 | 1 6 13 18 | 1 3 4 19 | 3 10 27 20 | 7 22 23 21 | 19 24 28 22 | 12 13 18 23 | 9 21 30 24 | 4 21 24 25 | 9 19 26 26 | 3 6 16 27 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i5.txt: -------------------------------------------------------------------------------- 1 | 30 24 11 2 | 1 0 0 1 0 0 0 0 1 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 3 | 10 13 19 4 | 6 15 19 5 | 5 22 26 6 | 12 23 30 7 | 12 23 25 8 | 10 14 29 9 | 7 9 27 10 | 4 5 20 11 | 13 29 30 12 | 10 20 26 13 | 3 4 18 14 | 8 16 20 15 | 10 28 29 16 | 1 2 24 17 | 2 17 21 18 | 6 9 30 19 | 2 12 18 20 | 5 9 25 21 | 16 21 25 22 | 3 20 28 23 | 6 13 23 24 | 5 8 15 25 | 1 6 25 26 | 1 8 11 27 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i6.txt: -------------------------------------------------------------------------------- 1 | 30 26 14 2 | 0 1 1 1 0 1 1 0 0 1 1 1 0 1 0 0 0 0 0 0 1 1 1 0 1 0 0 0 1 0 3 | 7 8 30 4 | 1 25 30 5 | 1 8 14 6 | 1 23 30 7 | 5 9 22 8 | 3 5 16 9 | 8 11 16 10 | 8 23 24 11 | 4 26 27 12 | 9 15 25 13 | 18 28 29 14 | 9 17 23 15 | 3 17 30 16 | 4 15 16 17 | 6 18 24 18 | 2 15 30 19 | 10 16 26 20 | 13 24 25 21 | 6 16 24 22 | 8 12 24 23 | 10 17 30 24 | 4 8 28 25 | 3 5 9 26 | 4 18 19 27 | 11 19 20 28 | 17 18 21 29 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i7.txt: -------------------------------------------------------------------------------- 1 | 30 26 13 2 | 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 0 3 | 18 20 30 4 | 2 16 28 5 | 22 26 30 6 | 10 19 30 7 | 8 16 18 8 | 2 17 22 9 | 7 11 15 10 | 9 12 28 11 | 9 21 27 12 | 2 15 22 13 | 6 15 16 14 | 8 18 21 15 | 7 10 28 16 | 6 10 20 17 | 8 24 27 18 | 3 28 29 19 | 13 21 22 20 | 7 8 15 21 | 3 10 18 22 | 6 20 24 23 | 7 11 25 24 | 10 14 15 25 | 4 10 29 26 | 15 18 23 27 | 5 9 11 28 | 1 11 25 29 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i8.txt: -------------------------------------------------------------------------------- 1 | 30 24 13 2 | 1 0 1 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 1 1 3 | 11 12 27 4 | 2 8 10 5 | 19 22 27 6 | 7 14 17 7 | 20 24 25 8 | 17 23 24 9 | 10 20 25 10 | 9 18 25 11 | 4 11 13 12 | 3 14 23 13 | 19 20 30 14 | 4 7 21 15 | 7 14 25 16 | 4 10 19 17 | 2 12 28 18 | 6 7 23 19 | 6 26 27 20 | 20 22 30 21 | 1 14 26 22 | 11 18 22 23 | 5 16 21 24 | 3 16 23 25 | 22 26 29 26 | 15 16 19 27 | -------------------------------------------------------------------------------- /examples/data3sat/30bit/n30i9.txt: -------------------------------------------------------------------------------- 1 | 30 26 11 2 | 1 0 0 0 1 0 1 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 1 1 0 1 3 | 11 21 22 4 | 10 19 23 5 | 3 13 28 6 | 5 12 26 7 | 13 17 25 8 | 14 21 30 9 | 7 18 21 10 | 14 24 29 11 | 3 15 27 12 | 5 23 25 13 | 6 9 13 14 | 7 19 25 15 | 2 22 24 16 | 2 11 19 17 | 2 22 30 18 | 21 23 27 19 | 19 20 24 20 | 4 7 20 21 | 16 28 29 22 | 7 21 25 23 | 6 26 30 24 | 15 23 27 25 | 15 17 22 26 | 8 18 30 27 | 1 6 22 28 | 2 12 30 29 | -------------------------------------------------------------------------------- /examples/data3sat/4bit/n4i1.txt: -------------------------------------------------------------------------------- 1 | 4 3 1 2 | 0 1 0 0 3 | 1 2 3 4 | 2 3 4 5 | 1 2 4 6 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i1.txt: -------------------------------------------------------------------------------- 1 | 8 6 3 2 | 0 0 0 0 1 0 1 1 3 | 3 6 8 4 | 2 5 6 5 | 1 2 8 6 | 1 4 7 7 | 3 4 7 8 | 1 3 7 9 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i10.txt: -------------------------------------------------------------------------------- 1 | 8 7 3 2 | 0 0 0 1 0 0 1 1 3 | 1 5 7 4 | 2 3 4 5 | 2 5 7 6 | 2 4 5 7 | 1 4 6 8 | 2 3 8 9 | 5 6 7 10 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i2.txt: -------------------------------------------------------------------------------- 1 | 8 7 3 2 | 1 0 0 0 1 0 0 1 3 | 2 5 7 4 | 1 4 6 5 | 1 2 4 6 | 2 3 8 7 | 3 5 7 8 | 2 4 8 9 | 1 4 7 10 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i3.txt: -------------------------------------------------------------------------------- 1 | 8 6 3 2 | 1 1 1 0 0 0 0 0 3 | 2 5 6 4 | 2 7 8 5 | 2 4 7 6 | 1 6 7 7 | 1 6 8 8 | 3 4 7 9 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i4.txt: -------------------------------------------------------------------------------- 1 | 8 7 2 2 | 0 0 0 0 1 0 0 1 3 | 2 7 8 4 | 4 7 8 5 | 3 5 7 6 | 2 3 5 7 | 5 6 7 8 | 1 4 8 9 | 2 3 8 10 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i5.txt: -------------------------------------------------------------------------------- 1 | 8 7 4 2 | 1 1 0 0 1 0 1 0 3 | 1 4 6 4 | 3 4 5 5 | 3 6 7 6 | 2 3 4 7 | 4 7 8 8 | 3 5 6 9 | 3 7 8 10 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i6.txt: -------------------------------------------------------------------------------- 1 | 8 7 2 2 | 0 0 0 1 0 0 1 0 3 | 1 2 4 4 | 1 3 7 5 | 4 6 8 6 | 1 6 7 7 | 3 7 8 8 | 2 3 7 9 | 5 7 8 10 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i7.txt: -------------------------------------------------------------------------------- 1 | 8 7 3 2 | 1 0 0 1 1 0 0 0 3 | 5 6 8 4 | 1 3 8 5 | 1 2 6 6 | 2 5 6 7 | 3 4 7 8 | 1 6 7 9 | 1 2 8 10 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i8.txt: -------------------------------------------------------------------------------- 1 | 8 6 2 2 | 1 0 0 0 0 0 1 0 3 | 4 5 7 4 | 1 2 5 5 | 1 3 8 6 | 1 4 6 7 | 2 7 8 8 | 1 6 8 9 | -------------------------------------------------------------------------------- /examples/data3sat/8bit/n8i9.txt: -------------------------------------------------------------------------------- 1 | 8 6 2 2 | 0 0 0 1 0 1 0 0 3 | 2 6 8 4 | 3 5 6 5 | 3 4 7 6 | 1 4 5 7 | 4 5 8 8 | 4 5 7 9 | -------------------------------------------------------------------------------- /examples/falqon/images/scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/falqon/images/scheme.png -------------------------------------------------------------------------------- /examples/falqon/images/schrodinger_equation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/falqon/images/schrodinger_equation.png -------------------------------------------------------------------------------- /examples/falqon/main.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | from qibo import hamiltonians, models 4 | 5 | 6 | def main(nqubits, delta_t=0.1, max_layers=100): 7 | # create XXZ Hamiltonian for nqubits qubits 8 | hamiltonian = hamiltonians.XXZ(nqubits) 9 | # create FALQON model for this Hamiltonian 10 | falqon = models.FALQON(hamiltonian) 11 | 12 | best_energy, final_parameters = falqon.minimize(delta_t, max_layers)[:2] 13 | 14 | print("The optimal energy found is", best_energy) 15 | 16 | return best_energy, final_parameters 17 | 18 | 19 | if __name__ == "__main__": 20 | parser = argparse.ArgumentParser() 21 | parser.add_argument("--nqubits", default=5, type=int, help="Number of qubits.") 22 | parser.add_argument( 23 | "--delta_t", 24 | default=0.1, 25 | type=float, 26 | help="Optimization parameter, time step for the first layer", 27 | ) 28 | parser.add_argument( 29 | "--max_layers", default=100, type=int, help="Maximum number of layers" 30 | ) 31 | args = vars(parser.parse_args()) 32 | main(**args) 33 | -------------------------------------------------------------------------------- /examples/grover/example1.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | 3 | from qibo import Circuit, gates 4 | from qibo.models.grover import Grover 5 | 6 | 7 | def main(nqubits): 8 | """Create an oracle, find state |11...11> for a number of qubits. 9 | 10 | Args: 11 | nqubits (int): number of qubits 12 | 13 | Returns: 14 | solution (str): found string 15 | iterations (int): number of iterations needed 16 | """ 17 | superposition = Circuit(nqubits) 18 | superposition.add([gates.H(i) for i in range(nqubits)]) 19 | 20 | oracle = Circuit(nqubits + 1) 21 | oracle.add(gates.X(nqubits).controlled_by(*range(nqubits))) 22 | # Create superoposition circuit: Full superposition over the selected number qubits. 23 | 24 | # Generate and execute Grover class 25 | grover = Grover(oracle, superposition_circuit=superposition, number_solutions=1) 26 | 27 | solution, iterations = grover() 28 | 29 | print("The solution is", solution) 30 | print("Number of iterations needed:", iterations) 31 | 32 | return solution, iterations 33 | 34 | 35 | if __name__ == "__main__": 36 | parser = argparse.ArgumentParser() 37 | parser.add_argument("--nqubits", default=10, type=int, help="Number of qubits.") 38 | args = vars(parser.parse_args()) 39 | main(**args) 40 | -------------------------------------------------------------------------------- /examples/grover3sat/images/grover-circuit-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/grover3sat/images/grover-circuit-image.png -------------------------------------------------------------------------------- /examples/grover3sat/main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import argparse 3 | 4 | import functions 5 | import numpy as np 6 | 7 | 8 | def main(nqubits, instance): 9 | """Grover search for the instance defined by the file_name. 10 | Args: 11 | nqubits (int): number of qubits for the file that contains the information of an Exact Cover instance. 12 | instance (int): intance used for the desired number of qubits. 13 | 14 | Returns: 15 | result of the Grover search and comparison with the expected solution if given. 16 | """ 17 | control, solution, clauses = functions.read_file(nqubits, instance) 18 | qubits = control[0] 19 | clauses_num = control[1] 20 | steps = int((np.pi / 4) * np.sqrt(2**qubits)) 21 | print(f"Qubits encoding the solution: {qubits}\n") 22 | print(f"Total number of qubits used: {qubits + clauses_num + 1}\n") 23 | q, c, ancilla, circuit = functions.create_qc(qubits, clauses_num) 24 | circuit = functions.grover(circuit, q, c, ancilla, clauses, steps) 25 | result = circuit(nshots=100) 26 | frequencies = result.frequencies(binary=True, registers=False) 27 | most_common_bitstring = frequencies.most_common(1)[0][0] 28 | print(f"Most common bitstring: {most_common_bitstring}\n") 29 | if solution: 30 | print(f"Exact cover solution: {''.join(solution)}\n") 31 | 32 | 33 | if __name__ == "__main__": 34 | parser = argparse.ArgumentParser() 35 | parser.add_argument("--nqubits", default=10, type=int) 36 | parser.add_argument("--instance", default=1, type=int) 37 | args = vars(parser.parse_args()) 38 | main(**args) 39 | -------------------------------------------------------------------------------- /examples/hash-grover/images/adder-mod2n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/hash-grover/images/adder-mod2n.png -------------------------------------------------------------------------------- /examples/hash-grover/images/chacha-perm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/hash-grover/images/chacha-perm.png -------------------------------------------------------------------------------- /examples/hash-grover/images/grover-circuit-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/hash-grover/images/grover-circuit-image.png -------------------------------------------------------------------------------- /examples/hash-grover/images/quarter-round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/hash-grover/images/quarter-round.png -------------------------------------------------------------------------------- /examples/hash-grover/images/sponge-oracle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/hash-grover/images/sponge-oracle.png -------------------------------------------------------------------------------- /examples/mvc/mvc.csv: -------------------------------------------------------------------------------- 1 | 0,0,0.4696822179283675 2 | 1,1,0.6917392308135916 3 | 2,2,0.7130420958314817 4 | 3,3,0.49342677332980056 5 | 4,4,0.49661600571433673 6 | 5,5,0.55601135361347 7 | 6,6,0.2831095711244086 8 | 7,7,0.18737823232636885 9 | 0,1,0.98602725407379 10 | 1,2,0.935853268681996 11 | 2,3,0.23080434023289664 12 | 4,5,0.25521731195623476 13 | 5,6,0.37096743935296606 14 | 6,7,0.04408120693490547 15 | 0,2,0.5619060764177991 16 | 4,7,0.48402095290884917 17 | 1,6,0.7106584134580318 18 | -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Fourier_8_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Fourier_8_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Fourier_8_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Fourier_8_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Fourier_8_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Fourier_8_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Fourier_8_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Fourier_8_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Weighted_8_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Weighted_8_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Weighted_8_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Weighted_8_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Weighted_8_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Weighted_8_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/8flavours/Weighted_8_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/8flavours/Weighted_8_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/c/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/c/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/d/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/d/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/dbar/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/dbar/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/gluon/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/gluon/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/s/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/s/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/sbar/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/sbar/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/u/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/u/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Fourier_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Fourier_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Fourier_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Fourier_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Fourier_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Fourier_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Fourier_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Fourier_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Fourier_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Fourier_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Fourier_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Fourier_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Weighted_1_q_1_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Weighted_1_q_1_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Weighted_1_q_2_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Weighted_1_q_2_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Weighted_1_q_3_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Weighted_1_q_3_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Weighted_1_q_4_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Weighted_1_q_4_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Weighted_1_q_5_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Weighted_1_q_5_l_result.pkl -------------------------------------------------------------------------------- /examples/qPDF/results/full/ubar/Weighted_1_q_6_l_result.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qPDF/results/full/ubar/Weighted_1_q_6_l_result.pkl -------------------------------------------------------------------------------- /examples/qap/tiny04a.dat: -------------------------------------------------------------------------------- 1 | 4 2 | 3 | 0.0 0.7796977849571155 0.4304502176328382 0.4329405547124155 4 | 0.7796977849571155 0.0 0.1920096021905386 0.5882961822495594 5 | 0.4304502176328382 0.1920096021905386 0.0 0.47901121613954656 6 | 0.4329405547124155 0.5882961822495594 0.47901121613954656 0.0 7 | 8 | 0.0 0.29541330831110774 0.6844285463729066 0.1988227908746449 9 | 0.29541330831110774 0.0 0.6164922460559509 0.16210678581988341 10 | 0.6844285463729066 0.6164922460559509 0.0 0.7305208755290076 11 | 0.1988227908746449 0.16210678581988341 0.7305208755290076 0.0 12 | -------------------------------------------------------------------------------- /examples/qclustering/data/latentrep_QCD_sig.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qclustering/data/latentrep_QCD_sig.h5 -------------------------------------------------------------------------------- /examples/qclustering/data/latentrep_QCD_sig_testclustering.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qclustering/data/latentrep_QCD_sig_testclustering.h5 -------------------------------------------------------------------------------- /examples/qclustering/data/latentrep_RSGraviton_WW_NA_35.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qclustering/data/latentrep_RSGraviton_WW_NA_35.h5 -------------------------------------------------------------------------------- /examples/qclustering/distance_calc.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | import numpy as np 4 | 5 | from qibo import gates 6 | from qibo.models import Circuit 7 | 8 | 9 | def pad_input(X): 10 | """Add 0s if X log2(X.dim) != round int. 11 | 12 | Args: 13 | X (:class:`numpy.ndarray`): Input data. 14 | 15 | Returns: 16 | :class:`numpy.ndarray`: Padded X. 17 | """ 18 | num_features = len(X) 19 | if not float(np.log2(num_features)).is_integer(): 20 | size_needed = pow(2, math.ceil(math.log(num_features) / math.log(2))) 21 | X = np.pad(X, (0, size_needed - num_features), "constant") 22 | return X 23 | 24 | 25 | def DistCalc(a, b, nshots=10000): 26 | """Distance calculation using destructive interference. 27 | 28 | Args: 29 | a (:class:`numpy.ndarray`): first point - shape = (latent space dimension,) 30 | b (:class:`numpy.ndarray`): second point - shape = (latent space dimension,) 31 | nshots (int, optional): number of shots for executing a quantum circuit to 32 | get frequencies. Defaults to :math:`10^{4}`. 33 | 34 | Returns: 35 | Tuple(float, :class:`qibo.models.Circuit`): (distance, quantum circuit). 36 | 37 | """ 38 | norm = np.linalg.norm(a - b) 39 | a_norm = a / norm 40 | b_norm = b / norm 41 | 42 | a_norm = pad_input(a_norm) 43 | b_norm = pad_input(b_norm) 44 | 45 | amplitudes = np.concatenate((a_norm, b_norm)) 46 | n_qubits = int(np.log2(len(amplitudes))) 47 | 48 | # QIBO 49 | qc = Circuit(n_qubits) 50 | qc.add(gates.H(0)) 51 | qc.add(gates.M(0)) 52 | 53 | result = qc.execute(initial_state=amplitudes, nshots=nshots) 54 | 55 | counts = result.frequencies(binary=True) 56 | distance = norm * math.sqrt(2) * math.sqrt(counts["1"] / nshots) 57 | 58 | return distance, qc 59 | -------------------------------------------------------------------------------- /examples/qclustering/figures/DistCirc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qclustering/figures/DistCirc.png -------------------------------------------------------------------------------- /examples/qclustering/figures/pseudocode_QKmed.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qclustering/figures/pseudocode_QKmed.jpeg -------------------------------------------------------------------------------- /examples/qclustering/figures/roc_curve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/examples/qclustering/figures/roc_curve.png -------------------------------------------------------------------------------- /examples/qclustering/minimization.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | import numpy as np 4 | from grover import grover_qc 5 | from oracle import create_oracle_circ 6 | 7 | import qibo 8 | from qibo import gates 9 | from qibo.models import Circuit 10 | 11 | 12 | def duerr_hoyer_algo(distances): 13 | """Perform Duerr-Hoyer algorithm. 14 | 15 | Parameters 16 | ---------- 17 | distance : :class:`numpy.ndarray` 18 | Array of distances a point to each cluster. 19 | Shape=(1, k) where k is number of cluster centers. 20 | 21 | Returns 22 | ------- 23 | int 24 | New cluster assigned for that point. 25 | """ 26 | qibo.set_backend(backend="qiboml", platform="tensorflow") 27 | tf = qibo.get_backend().tf 28 | 29 | k = len(distances) 30 | n = int(math.floor(math.log2(k)) + 1) 31 | 32 | # choose random threshold 33 | index_rand = np.random.choice(k) 34 | threshold = distances[index_rand] 35 | max_iters = int(math.ceil(np.sqrt(2**n))) 36 | 37 | for _ in range(max_iters): 38 | qc = Circuit(n) 39 | 40 | for i in range(n): 41 | qc.add(gates.H(i)) 42 | 43 | # create oracle 44 | qc_oracle, n_indices_marked = create_oracle_circ(distances, threshold, n) 45 | 46 | # grover circuit 47 | qc = grover_qc(qc, n, qc_oracle, n_indices_marked) 48 | 49 | counts = qc.execute(nshots=1000).frequencies(binary=True) 50 | 51 | # measure highest probability 52 | probs = counts.items() 53 | sorted_probs = dict(sorted(probs, key=lambda item: item[1], reverse=True)) 54 | sorted_probs_keys = list(sorted_probs.keys()) 55 | new_ix = [ 56 | int(sorted_probs_keys[i], 2) 57 | for i, _ in enumerate(sorted_probs_keys) 58 | if int(sorted_probs_keys[i], 2) < k 59 | ] 60 | new_ix = new_ix[0] 61 | threshold = distances[new_ix] 62 | return new_ix 63 | -------------------------------------------------------------------------------- /examples/qclustering/oracle.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from qibo.gates import Unitary 4 | from qibo.models import Circuit 5 | 6 | 7 | def f(x, threshold): 8 | return x < threshold 9 | 10 | 11 | def create_oracle_circ(distances, threshold, n_qubits): 12 | """Create circuit for oracle - for one solution --> I - 2*|i0> 2: 28 | gate.append(gates.TOFFOLI(0, 1, 2)) 29 | toffoli = np.eye(8) 30 | toffoli[-2:, -2:] = np.array([[0, 1], [1, 0]]) 31 | target_matrix = toffoli @ np.kron(target_matrix, np.eye(2)) 32 | backend.assert_allclose(gate.matrix(backend), target_matrix) 33 | -------------------------------------------------------------------------------- /tests/test_models_utils.py: -------------------------------------------------------------------------------- 1 | """Test `fourier_coefficients' in `qibo/models/utils.py`.""" 2 | 3 | import numpy as np 4 | import pytest 5 | 6 | from qibo.models.utils import fourier_coefficients 7 | 8 | 9 | def test_fourier_coefficients_raising_errors(): 10 | result = fourier_coefficients(function, 1, 2, lowpass_filter=True) 11 | with pytest.raises(ValueError): 12 | # n_inputs!=len(degree) 13 | result = fourier_coefficients( 14 | function, n_inputs=1, degree=[2, 2], lowpass_filter=True 15 | ) 16 | with pytest.raises(ValueError): 17 | # n_inputs!=len(filter_threshold) 18 | result = fourier_coefficients( 19 | function, 1, 2, lowpass_filter=True, filter_threshold=[5, 6] 20 | ) 21 | result = fourier_coefficients( 22 | function, n_inputs=1, degree=2, lowpass_filter=True, filter_threshold=5 23 | ) 24 | result = fourier_coefficients(function, n_inputs=1, degree=2, lowpass_filter=False) 25 | 26 | 27 | def test_fourier_coefficients_expected_result(): 28 | result = fourier_coefficients(function, 1, 2, lowpass_filter=True) 29 | # The coefficients should have this form: 30 | coeffs = np.array([1, 1 - 2j, 1.5 - 2.5j, 1.5 + 2.5j, 1 + 2j]) 31 | assert coeffs.all() == result.all() 32 | 33 | 34 | def function(x): 35 | y = 1 + 2 * np.cos(x) + 3 * np.cos(2 * x) + 4 * np.sin(x) + 5 * np.sin(2 * x) 36 | return y 37 | -------------------------------------------------------------------------------- /tests/test_transpiler_optimizer.py: -------------------------------------------------------------------------------- 1 | import networkx as nx 2 | import pytest 3 | 4 | from qibo import gates 5 | from qibo.models import Circuit 6 | from qibo.transpiler.optimizer import Preprocessing, Rearrange 7 | 8 | 9 | def test_preprocessing_error(star_connectivity): 10 | circ = Circuit(7) 11 | preprocesser = Preprocessing(connectivity=star_connectivity()) 12 | with pytest.raises(ValueError): 13 | new_circuit = preprocesser(circuit=circ) 14 | 15 | circ = Circuit(5, wire_names=[0, 1, 2, "q3", "q4"]) 16 | with pytest.raises(ValueError): 17 | new_circuit = preprocesser(circuit=circ) 18 | 19 | 20 | def test_preprocessing_same(star_connectivity): 21 | circ = Circuit(5) 22 | circ.add(gates.CNOT(0, 1)) 23 | preprocesser = Preprocessing(connectivity=star_connectivity()) 24 | new_circuit = preprocesser(circuit=circ) 25 | assert new_circuit.ngates == 1 26 | 27 | 28 | def test_preprocessing_add(star_connectivity): 29 | circ = Circuit(3) 30 | circ.add(gates.CNOT(0, 1)) 31 | preprocesser = Preprocessing(connectivity=star_connectivity()) 32 | new_circuit = preprocesser(circuit=circ) 33 | assert new_circuit.ngates == 1 34 | assert new_circuit.nqubits == 5 35 | 36 | 37 | def test_fusion(): 38 | circuit = Circuit(2) 39 | circuit.add(gates.X(0)) 40 | circuit.add(gates.Z(0)) 41 | circuit.add(gates.Y(0)) 42 | circuit.add(gates.X(1)) 43 | fusion = Rearrange(max_qubits=1) 44 | fused_circ = fusion(circuit) 45 | assert isinstance(fused_circ.queue[0], gates.Unitary) 46 | -------------------------------------------------------------------------------- /tests/test_ui_array_images/state_visualization_amplitudes_3q.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/state_visualization_amplitudes_3q.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/state_visualization_frequencies_3q.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/state_visualization_frequencies_3q.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/state_visualization_probabilities_3q.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/state_visualization_probabilities_3q.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/state_visualization_probabilities_3q_lim.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/state_visualization_probabilities_3q_lim.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_align_gate.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_align_gate.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_bigger_circuit_gates_3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_bigger_circuit_gates_3.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_bigger_circuit_gates_4.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_bigger_circuit_gates_4.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_bigger_circuit_gates_5.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_bigger_circuit_gates_5.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_bigger_circuit_gates_6.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_bigger_circuit_gates_6.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_circuit_entangled_entropy_false.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_circuit_entangled_entropy_false.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_circuit_entangled_entropy_true.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_circuit_entangled_entropy_true.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_circuit_fused_gates_false.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_circuit_fused_gates_false.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_circuit_fused_gates_true.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_circuit_fused_gates_true.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_circuit_measure_1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_circuit_measure_1.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_circuit_measure_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_circuit_measure_2.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_circuit_measure_3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_circuit_measure_3.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_complex_circuit_fig1_false.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_complex_circuit_fig1_false.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_complex_circuit_fig1_true.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_complex_circuit_fig1_true.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_complex_circuit_fig2_false.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_complex_circuit_fig2_false.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_complex_circuit_fig2_true.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_complex_circuit_fig2_true.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_empty_circuit.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_empty_circuit.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_fuse_cluster.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_fuse_cluster.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_fused_gates.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_fused_gates.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_layered_circuit.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_layered_circuit.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_circuit_2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_circuit_2.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_circuit_3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_circuit_3.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_circuit_internal_ax1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_circuit_internal_ax1.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_circuit_internal_ax2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_circuit_internal_ax2.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_global_unitaries_as_circuit.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_global_unitaries_as_circuit.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_unitaries.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_unitaries.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_unitaries_different_init.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_unitaries_different_init.npy -------------------------------------------------------------------------------- /tests/test_ui_array_images/test_plot_unitaries_same_init.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qiboteam/qibo/d10c1e384de9740511c13d900967c35e705bb787/tests/test_ui_array_images/test_plot_unitaries_same_init.npy -------------------------------------------------------------------------------- /tests/utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from scipy import sparse 3 | 4 | 5 | def random_sparse_matrix(backend, n, sparse_type=None): 6 | if backend.platform == "tensorflow": 7 | nonzero = int(0.1 * n * n) 8 | indices = np.random.randint(0, n, size=(nonzero, 2)) 9 | data = np.random.random(nonzero) + 1j * np.random.random(nonzero) 10 | data = backend.cast(data) 11 | 12 | return backend.tf.sparse.SparseTensor(indices, data, (n, n)) 13 | 14 | re = sparse.rand(n, n, format=sparse_type) 15 | im = sparse.rand(n, n, format=sparse_type) 16 | return re + 1j * im 17 | 18 | 19 | def fig2array(fig): 20 | """Convert matplotlib image into numpy array.""" 21 | fig.canvas.draw() 22 | data = np.frombuffer(fig.canvas.buffer_rgba(), dtype=np.uint8) 23 | data = data.reshape(fig.canvas.get_width_height()[::-1] + (4,)) 24 | return data 25 | 26 | 27 | def match_figure_image(fig, arr_path): 28 | """Check whether the two image arrays match.""" 29 | return np.all(fig2array(fig) == np.load(arr_path)) 30 | --------------------------------------------------------------------------------