├── 3Q_GHZ_State.qasm ├── 3Q_GHZ_State_XXX-Measurement.qasm ├── 3Q_GHZ_State_XYY-Measurement.qasm ├── 3Q_GHZ_State_YXY-Measurement.qasm ├── 3Q_GHZ_State_YYX-Measurement.qasm ├── 5Q_Complete_Superposition_Circuit.qasm ├── A_Random_Classical_Circuit.qasm ├── Basic Circuit Identities and Larger Circuits ├── 3Q_Toffoli_state.qasm ├── Approximate_sqrt_T_.qasm ├── CNOT_Reversed_.qasm ├── Controlled-Hadamard.qasm ├── SWAP_Gate.qasm ├── Swap_q_0_and_q_1_.qasm └── Toffoli_with_flips.qasm ├── Bell_State_XV-Measurement.qasm ├── Bell_State_XW-Measurement.qasm ├── Bell_State_ZV-Measurement.qasm ├── Bell_State_ZW-Measurement.qasm ├── Bell_State_ZZ-Measurement.qasm ├── CNOT_input_00_.qasm ├── CNOT_input_10_.qasm ├── CNOT_input_11_.qasm ├── Deutsch-Jozsa Algorithm ├── DJ_N_3_Constant.qasm └── DJ_N_3_Example.qasm ├── Grover's Algorithm ├── Grover_N_2_A_00.qasm ├── Grover_N_2_A_01.qasm ├── Grover_N_2_A_10.qasm └── Grover_N_2_A_11.qasm ├── Learning Parity with Noise └── LPN_circuit_2.qasm ├── Quantum Phase Estimation ├── Phase_Estimation_Circuit_-_.qasm └── Phase_Estimation_Circuit_.qasm ├── Quantum Repetition Code ├── Bit-flip_encoder_and_decoder_tomography_.qasm ├── Encoder_into_bit-flip_code_qubits_1-3_.qasm └── Encoder_into_bit-flip_code_with_parity_checks_qubits_0_1_3_.qasm ├── Readme.md └── Shor's algorithm ├── Multi7x13Mod15.qasm ├── Multi7x1Mod15.qasm ├── Multi7x4Mod15.qasm ├── Multi7x7Mod15.qasm └── PhaseEstimationTgate.qasm /3Q_GHZ_State.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: 3Q GHZ State v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[3]; 8 | creg c[3]; 9 | 10 | h q[0]; 11 | h q[1]; 12 | x q[2]; 13 | cx q[1],q[2]; 14 | cx q[0],q[2]; 15 | h q[0]; 16 | h q[1]; 17 | h q[2]; 18 | measure q[0] -> c[0]; 19 | measure q[1] -> c[1]; 20 | measure q[2] -> c[2]; 21 | -------------------------------------------------------------------------------- /3Q_GHZ_State_XXX-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: 3Q GHZ State XXX-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[3]; 8 | creg c[3]; 9 | 10 | h q[0]; 11 | h q[1]; 12 | x q[2]; 13 | cx q[1],q[2]; 14 | cx q[0],q[2]; 15 | h q[0]; 16 | h q[1]; 17 | h q[2]; 18 | barrier q[0],q[1],q[2]; 19 | h q[0]; 20 | h q[1]; 21 | h q[2]; 22 | measure q[0] -> c[0]; 23 | measure q[1] -> c[1]; 24 | measure q[2] -> c[2]; 25 | -------------------------------------------------------------------------------- /3Q_GHZ_State_XYY-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: 3Q GHZ State XYY-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[3]; 8 | creg c[3]; 9 | 10 | h q[0]; 11 | h q[1]; 12 | x q[2]; 13 | cx q[1],q[2]; 14 | cx q[0],q[2]; 15 | h q[0]; 16 | h q[1]; 17 | h q[2]; 18 | barrier q[0],q[1],q[2]; 19 | sdg q[1]; 20 | sdg q[2]; 21 | h q[0]; 22 | h q[1]; 23 | h q[2]; 24 | measure q[0] -> c[0]; 25 | measure q[1] -> c[1]; 26 | measure q[2] -> c[2]; 27 | -------------------------------------------------------------------------------- /3Q_GHZ_State_YXY-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: 3Q GHZ State YXY-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[3]; 8 | creg c[3]; 9 | 10 | h q[0]; 11 | h q[1]; 12 | x q[2]; 13 | cx q[1],q[2]; 14 | cx q[0],q[2]; 15 | h q[0]; 16 | h q[1]; 17 | h q[2]; 18 | barrier q[0],q[1],q[2]; 19 | sdg q[0]; 20 | sdg q[2]; 21 | h q[0]; 22 | h q[1]; 23 | h q[2]; 24 | measure q[0] -> c[0]; 25 | measure q[1] -> c[1]; 26 | measure q[2] -> c[2]; 27 | -------------------------------------------------------------------------------- /3Q_GHZ_State_YYX-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: 3Q GHZ State YYX-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[3]; 8 | creg c[3]; 9 | 10 | h q[0]; 11 | h q[1]; 12 | x q[2]; 13 | cx q[1],q[2]; 14 | cx q[0],q[2]; 15 | h q[0]; 16 | h q[1]; 17 | h q[2]; 18 | barrier q[0],q[1],q[2]; 19 | sdg q[0]; 20 | sdg q[1]; 21 | h q[0]; 22 | h q[1]; 23 | h q[2]; 24 | measure q[0] -> c[0]; 25 | measure q[1] -> c[1]; 26 | measure q[2] -> c[2]; 27 | -------------------------------------------------------------------------------- /5Q_Complete_Superposition_Circuit.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: 5Q Complete Superposition Circuit v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[5]; 8 | creg c[5]; 9 | 10 | h q[0]; 11 | h q[1]; 12 | h q[2]; 13 | h q[3]; 14 | h q[4]; 15 | measure q[0] -> c[0]; 16 | measure q[1] -> c[1]; 17 | measure q[2] -> c[2]; 18 | measure q[3] -> c[3]; 19 | measure q[4] -> c[4]; 20 | -------------------------------------------------------------------------------- /A_Random_Classical_Circuit.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: A Random Classical Circuit v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[5]; 8 | creg c[5]; 9 | 10 | x q[0]; 11 | x q[2]; 12 | x q[4]; 13 | measure q[0] -> c[0]; 14 | measure q[1] -> c[1]; 15 | measure q[2] -> c[2]; 16 | measure q[3] -> c[3]; 17 | measure q[4] -> c[4]; 18 | -------------------------------------------------------------------------------- /Basic Circuit Identities and Larger Circuits/3Q_Toffoli_state.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: 3Q Toffoli state v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[3]; 8 | creg c[3]; 9 | 10 | h q[0]; 11 | h q[1]; 12 | h q[2]; 13 | cx q[1],q[2]; 14 | tdg q[2]; 15 | cx q[0],q[2]; 16 | t q[2]; 17 | cx q[1],q[2]; 18 | tdg q[2]; 19 | cx q[0],q[2]; 20 | t q[1]; 21 | t q[2]; 22 | cx q[1],q[2]; 23 | h q[1]; 24 | h q[2]; 25 | cx q[1],q[2]; 26 | h q[1]; 27 | h q[2]; 28 | cx q[1],q[2]; 29 | cx q[0],q[2]; 30 | t q[0]; 31 | h q[1]; 32 | tdg q[2]; 33 | cx q[0],q[2]; 34 | measure q[0] -> c[0]; 35 | measure q[1] -> c[1]; 36 | measure q[2] -> c[2]; 37 | -------------------------------------------------------------------------------- /Basic Circuit Identities and Larger Circuits/Approximate_sqrt_T_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Approximate_sqrt_T_ 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[3]; 10 | h q[4]; 11 | bloch q[0]; 12 | h q[1]; 13 | t q[2]; 14 | s q[3]; 15 | z q[4]; 16 | t q[1]; 17 | bloch q[2]; 18 | bloch q[3]; 19 | bloch q[4]; 20 | h q[1]; 21 | t q[1]; 22 | h q[1]; 23 | t q[1]; 24 | s q[1]; 25 | h q[1]; 26 | t q[1]; 27 | h q[1]; 28 | t q[1]; 29 | s q[1]; 30 | h q[1]; 31 | t q[1]; 32 | h q[1]; 33 | t q[1]; 34 | h q[1]; 35 | bloch q[1]; 36 | -------------------------------------------------------------------------------- /Basic Circuit Identities and Larger Circuits/CNOT_Reversed_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: CNOT (Reversed) v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | x q[1]; 11 | h q[0]; 12 | h q[1]; 13 | cx q[0],q[1]; 14 | h q[0]; 15 | h q[1]; 16 | measure q[0] -> c[0]; 17 | measure q[1] -> c[1]; 18 | -------------------------------------------------------------------------------- /Basic Circuit Identities and Larger Circuits/Controlled-Hadamard.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Controlled-Hadamard v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | h q[0]; 11 | s q[0]; 12 | h q[1]; 13 | sdg q[1]; 14 | cx q[0],q[1]; 15 | h q[1]; 16 | t q[1]; 17 | cx q[0],q[1]; 18 | t q[1]; 19 | h q[1]; 20 | s q[1]; 21 | x q[1]; 22 | measure q[0] -> c[0]; 23 | measure q[1] -> c[1]; 24 | -------------------------------------------------------------------------------- /Basic Circuit Identities and Larger Circuits/SWAP_Gate.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: SWAP Gate v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | x q[1]; 11 | cx q[0],q[1]; 12 | h q[0]; 13 | h q[1]; 14 | cx q[0],q[1]; 15 | h q[0]; 16 | h q[1]; 17 | cx q[0],q[1]; 18 | measure q[0] -> c[0]; 19 | measure q[1] -> c[1]; 20 | -------------------------------------------------------------------------------- /Basic Circuit Identities and Larger Circuits/Swap_q_0_and_q_1_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Swap q[0] and q[1] v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[3]; 8 | creg c[3]; 9 | 10 | h q[0]; 11 | cx q[0],q[2]; 12 | h q[0]; 13 | h q[2]; 14 | cx q[0],q[2]; 15 | h q[0]; 16 | h q[2]; 17 | cx q[0],q[2]; 18 | cx q[1],q[2]; 19 | h q[1]; 20 | h q[2]; 21 | cx q[1],q[2]; 22 | h q[1]; 23 | h q[2]; 24 | cx q[1],q[2]; 25 | cx q[0],q[2]; 26 | h q[0]; 27 | h q[2]; 28 | cx q[0],q[2]; 29 | h q[0]; 30 | h q[2]; 31 | cx q[0],q[2]; 32 | measure q[0] -> c[0]; 33 | measure q[1] -> c[1]; 34 | measure q[2] -> c[2]; 35 | -------------------------------------------------------------------------------- /Basic Circuit Identities and Larger Circuits/Toffoli_with_flips.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Toffoli with flips v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[5]; 8 | creg c[5]; 9 | 10 | x q[0]; 11 | x q[1]; 12 | id q[2]; 13 | h q[2]; 14 | cx q[1],q[2]; 15 | tdg q[2]; 16 | cx q[0],q[2]; 17 | t q[2]; 18 | cx q[1],q[2]; 19 | tdg q[2]; 20 | cx q[0],q[2]; 21 | t q[1]; 22 | t q[2]; 23 | h q[2]; 24 | cx q[1],q[2]; 25 | h q[1]; 26 | h q[2]; 27 | cx q[1],q[2]; 28 | h q[1]; 29 | h q[2]; 30 | cx q[1],q[2]; 31 | cx q[0],q[2]; 32 | t q[0]; 33 | tdg q[2]; 34 | cx q[0],q[2]; 35 | measure q[0] -> c[0]; 36 | measure q[1] -> c[1]; 37 | measure q[2] -> c[2]; 38 | -------------------------------------------------------------------------------- /Bell_State_XV-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Bell State XV-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | h q[0]; 11 | cx q[0],q[1]; 12 | h q[0]; 13 | s q[1]; 14 | h q[1]; 15 | tdg q[1]; 16 | h q[1]; 17 | measure q[0] -> c[0]; 18 | measure q[1] -> c[1]; 19 | -------------------------------------------------------------------------------- /Bell_State_XW-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Bell State XW-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | h q[0]; 11 | cx q[0],q[1]; 12 | h q[0]; 13 | s q[1]; 14 | h q[1]; 15 | t q[1]; 16 | h q[1]; 17 | measure q[0] -> c[0]; 18 | measure q[1] -> c[1]; 19 | -------------------------------------------------------------------------------- /Bell_State_ZV-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Bell State ZV-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | h q[0]; 11 | cx q[0],q[1]; 12 | s q[1]; 13 | h q[1]; 14 | tdg q[1]; 15 | h q[1]; 16 | measure q[0] -> c[0]; 17 | measure q[1] -> c[1]; 18 | -------------------------------------------------------------------------------- /Bell_State_ZW-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Bell State ZW-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | h q[0]; 11 | cx q[0],q[1]; 12 | s q[1]; 13 | h q[1]; 14 | t q[1]; 15 | h q[1]; 16 | measure q[0] -> c[0]; 17 | measure q[1] -> c[1]; 18 | -------------------------------------------------------------------------------- /Bell_State_ZZ-Measurement.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Bell State ZZ-Measurement v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | h q[0]; 11 | cx q[0],q[1]; 12 | measure q[0] -> c[0]; 13 | measure q[1] -> c[1]; 14 | -------------------------------------------------------------------------------- /CNOT_input_00_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: CNOT (input 00) v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | cx q[0],q[1]; 11 | measure q[0] -> c[0]; 12 | measure q[1] -> c[1]; 13 | -------------------------------------------------------------------------------- /CNOT_input_10_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: CNOT (input 10) v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | x q[0]; 11 | cx q[0],q[1]; 12 | measure q[0] -> c[0]; 13 | measure q[1] -> c[1]; 14 | -------------------------------------------------------------------------------- /CNOT_input_11_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: CNOT (input 11) v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[2]; 8 | creg c[2]; 9 | 10 | x q[0]; 11 | x q[1]; 12 | cx q[0],q[1]; 13 | measure q[0] -> c[0]; 14 | measure q[1] -> c[1]; 15 | -------------------------------------------------------------------------------- /Deutsch-Jozsa Algorithm/DJ_N_3_Constant.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: DJ_N_3_Constant 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[0]; 10 | h q[1]; 11 | h q[2]; 12 | measure q[0]; 13 | measure q[1]; 14 | measure q[2]; 15 | -------------------------------------------------------------------------------- /Deutsch-Jozsa Algorithm/DJ_N_3_Example.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: DJ_N_3_Example 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[0]; 7 | h q[1]; 8 | h q[2]; 9 | h q[2]; 10 | z q[0]; 11 | cx q[1], q[2]; 12 | h q[2]; 13 | h q[0]; 14 | h q[1]; 15 | h q[2]; 16 | measure q[0]; 17 | measure q[1]; 18 | measure q[2]; 19 | -------------------------------------------------------------------------------- /Grover's Algorithm/Grover_N_2_A_00.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Grover N=2 A=00 v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[5]; 8 | creg c[5]; 9 | 10 | h q[1]; 11 | h q[2]; 12 | s q[1]; 13 | s q[2]; 14 | h q[2]; 15 | cx q[1],q[2]; 16 | h q[2]; 17 | s q[1]; 18 | s q[2]; 19 | h q[1]; 20 | h q[2]; 21 | x q[1]; 22 | x q[2]; 23 | h q[2]; 24 | cx q[1],q[2]; 25 | h q[2]; 26 | x q[1]; 27 | x q[2]; 28 | h q[1]; 29 | h q[2]; 30 | measure q[1] -> c[1]; 31 | measure q[2] -> c[2]; 32 | -------------------------------------------------------------------------------- /Grover's Algorithm/Grover_N_2_A_01.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Grover N=2 A=01 v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[5]; 8 | creg c[5]; 9 | 10 | h q[1]; 11 | h q[2]; 12 | s q[2]; 13 | h q[2]; 14 | cx q[1],q[2]; 15 | h q[2]; 16 | s q[2]; 17 | h q[1]; 18 | h q[2]; 19 | x q[1]; 20 | x q[2]; 21 | h q[2]; 22 | cx q[1],q[2]; 23 | h q[2]; 24 | x q[1]; 25 | x q[2]; 26 | h q[1]; 27 | h q[2]; 28 | measure q[1] -> c[1]; 29 | measure q[2] -> c[2]; 30 | -------------------------------------------------------------------------------- /Grover's Algorithm/Grover_N_2_A_10.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Grover N=2 A=10 v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[5]; 8 | creg c[5]; 9 | 10 | h q[1]; 11 | h q[2]; 12 | s q[1]; 13 | h q[2]; 14 | cx q[1],q[2]; 15 | h q[2]; 16 | s q[1]; 17 | h q[1]; 18 | h q[2]; 19 | x q[1]; 20 | x q[2]; 21 | h q[2]; 22 | cx q[1],q[2]; 23 | h q[2]; 24 | x q[1]; 25 | x q[2]; 26 | h q[1]; 27 | h q[2]; 28 | measure q[1] -> c[1]; 29 | measure q[2] -> c[2]; 30 | -------------------------------------------------------------------------------- /Grover's Algorithm/Grover_N_2_A_11.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Grover N=2 A=11 v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | 7 | qreg q[5]; 8 | creg c[5]; 9 | 10 | h q[1]; 11 | h q[2]; 12 | h q[2]; 13 | cx q[1],q[2]; 14 | h q[2]; 15 | h q[1]; 16 | h q[2]; 17 | x q[1]; 18 | x q[2]; 19 | h q[2]; 20 | cx q[1],q[2]; 21 | h q[2]; 22 | x q[1]; 23 | x q[2]; 24 | h q[1]; 25 | h q[2]; 26 | measure q[1] -> c[1]; 27 | measure q[2] -> c[2]; 28 | -------------------------------------------------------------------------------- /Learning Parity with Noise/LPN_circuit_2.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: LPN circuit 2 v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[0]; 7 | h q[1]; 8 | h q[3]; 9 | h q[4]; 10 | cx q[3], q[2]; 11 | cx q[0], q[2]; 12 | h q[0]; 13 | h q[1]; 14 | h q[2]; 15 | h q[3]; 16 | h q[4]; 17 | measure q[0]; 18 | measure q[1]; 19 | measure q[2]; 20 | measure q[3]; 21 | measure q[4]; 22 | -------------------------------------------------------------------------------- /Quantum Phase Estimation/Phase_Estimation_Circuit_-_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Phase_Estimation_Circuit_-_ 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[2]; 7 | h q[3]; 8 | z q[2]; 9 | cx q[3], q[2]; 10 | h q[3]; 11 | measure q[3]; 12 | -------------------------------------------------------------------------------- /Quantum Phase Estimation/Phase_Estimation_Circuit_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Phase_Estimation_Circuit_ 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[2]; 7 | h q[3]; 8 | cx q[3], q[2]; 9 | h q[3]; 10 | measure q[3]; 11 | -------------------------------------------------------------------------------- /Quantum Repetition Code/Bit-flip_encoder_and_decoder_tomography_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Bit-flip encoder and decoder (tomography) v6 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[2]; 7 | h q[1]; 8 | h q[2]; 9 | h q[3]; 10 | cx q[1], q[2]; 11 | cx q[3], q[2]; 12 | h q[1]; 13 | h q[2]; 14 | h q[3]; 15 | id q[1]; 16 | id q[2]; 17 | id q[3]; 18 | id q[1]; 19 | id q[2]; 20 | id q[3]; 21 | id q[1]; 22 | id q[2]; 23 | id q[3]; 24 | h q[1]; 25 | h q[2]; 26 | h q[3]; 27 | cx q[3], q[2]; 28 | cx q[1], q[2]; 29 | h q[1]; 30 | h q[3]; 31 | cx q[3], q[2]; 32 | tdg q[2]; 33 | cx q[1], q[2]; 34 | t q[2]; 35 | cx q[3], q[2]; 36 | tdg q[2]; 37 | cx q[1], q[2]; 38 | t q[2]; 39 | h q[2]; 40 | bloch q[2]; 41 | -------------------------------------------------------------------------------- /Quantum Repetition Code/Encoder_into_bit-flip_code_qubits_1-3_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Encoder into bit-flip code (qubits 1-3) v1 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[2]; 7 | t q[2]; 8 | h q[2]; 9 | h q[1]; 10 | h q[2]; 11 | h q[3]; 12 | cx q[1], q[2]; 13 | cx q[3], q[2]; 14 | h q[1]; 15 | h q[2]; 16 | h q[3]; 17 | measure q[1]; 18 | measure q[2]; 19 | measure q[3]; 20 | -------------------------------------------------------------------------------- /Quantum Repetition Code/Encoder_into_bit-flip_code_with_parity_checks_qubits_0_1_3_.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Encoder into bit-flip code with parity checks (qubits 0,1,3) v2 2 | 3 | OPENQASM 2.0; 4 | include "qelib1.inc"; 5 | 6 | h q[2]; 7 | t q[2]; 8 | h q[2]; 9 | h q[0]; 10 | h q[1]; 11 | h q[2]; 12 | cx q[1], q[2]; 13 | cx q[0], q[2]; 14 | h q[0]; 15 | h q[1]; 16 | h q[3]; 17 | cx q[3], q[2]; 18 | h q[2]; 19 | h q[3]; 20 | cx q[3], q[2]; 21 | cx q[0], q[2]; 22 | cx q[1], q[2]; 23 | h q[2]; 24 | h q[4]; 25 | cx q[4], q[2]; 26 | h q[2]; 27 | h q[4]; 28 | cx q[4], q[2]; 29 | cx q[1], q[2]; 30 | cx q[3], q[2]; 31 | measure q[2]; 32 | measure q[4]; 33 | measure q[0]; 34 | measure q[1]; 35 | measure q[3]; 36 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | QASM is a simple text-format language for describing acyclic quantum circuits. 2 | 3 | Do your Quantum Computing simulations in in [IBM Quantum Experience](https://quantumexperience.ng.bluemix.net/) -------------------------------------------------------------------------------- /Shor's algorithm/Multi7x13Mod15.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Multi7x13Mod15 v1 2 | // Description: Computes modular multiplication x-> 7x (mod 15). 3 | Initial state x=13 4 | 5 | OPENQASM 2.0; 6 | include "qelib1.inc"; 7 | 8 | x q[1]; 9 | x q[2]; 10 | x q[4]; 11 | x q[1]; 12 | x q[2]; 13 | x q[3]; 14 | x q[4]; 15 | cx q[3], q[2]; 16 | cx q[2], q[3]; 17 | cx q[3], q[2]; 18 | cx q[2], q[1]; 19 | cx q[1], q[2]; 20 | cx q[2], q[1]; 21 | cx q[4], q[1]; 22 | cx q[1], q[4]; 23 | cx q[4], q[1]; 24 | measure q[1]; 25 | measure q[2]; 26 | measure q[3]; 27 | measure q[4]; 28 | -------------------------------------------------------------------------------- /Shor's algorithm/Multi7x1Mod15.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Multi7x1Mod15 v1 2 | // Description: Computes modular multiplication x-> 7x (mod 15). 3 | Initial state x=1 4 | 5 | OPENQASM 2.0; 6 | include "qelib1.inc"; 7 | 8 | x q[4]; 9 | x q[1]; 10 | x q[2]; 11 | x q[3]; 12 | x q[4]; 13 | cx q[3], q[2]; 14 | cx q[2], q[3]; 15 | cx q[3], q[2]; 16 | cx q[2], q[1]; 17 | cx q[1], q[2]; 18 | cx q[2], q[1]; 19 | cx q[4], q[1]; 20 | cx q[1], q[4]; 21 | cx q[4], q[1]; 22 | measure q[1]; 23 | measure q[2]; 24 | measure q[3]; 25 | measure q[4]; 26 | -------------------------------------------------------------------------------- /Shor's algorithm/Multi7x4Mod15.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Multi7x4Mod15 v1 2 | // Description: Computes modular multiplication x-> 7x (mod 15). 3 | Initial state x=4 4 | 5 | OPENQASM 2.0; 6 | include "qelib1.inc"; 7 | 8 | x q[2]; 9 | x q[1]; 10 | x q[2]; 11 | x q[3]; 12 | x q[4]; 13 | cx q[3], q[2]; 14 | cx q[2], q[3]; 15 | cx q[3], q[2]; 16 | cx q[2], q[1]; 17 | cx q[1], q[2]; 18 | cx q[2], q[1]; 19 | cx q[4], q[1]; 20 | cx q[1], q[4]; 21 | cx q[4], q[1]; 22 | measure q[1]; 23 | measure q[2]; 24 | measure q[3]; 25 | measure q[4]; 26 | -------------------------------------------------------------------------------- /Shor's algorithm/Multi7x7Mod15.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: Multi7x7Mod15 v1 2 | // Description: Computes modular multiplication x-> 7x (mod 15). 3 | Initial state x=7 4 | 5 | OPENQASM 2.0; 6 | include "qelib1.inc"; 7 | 8 | x q[2]; 9 | x q[3]; 10 | x q[4]; 11 | x q[1]; 12 | x q[2]; 13 | x q[3]; 14 | x q[4]; 15 | cx q[3], q[2]; 16 | cx q[2], q[3]; 17 | cx q[3], q[2]; 18 | cx q[2], q[1]; 19 | cx q[1], q[2]; 20 | cx q[2], q[1]; 21 | cx q[4], q[1]; 22 | cx q[1], q[4]; 23 | cx q[4], q[1]; 24 | measure q[1]; 25 | measure q[2]; 26 | measure q[3]; 27 | measure q[4]; 28 | -------------------------------------------------------------------------------- /Shor's algorithm/PhaseEstimationTgate.qasm: -------------------------------------------------------------------------------- 1 | // Name of Experiment: PhaseEstimationTgate v1 2 | // Description: Example of a phase estimation for the phase shift pi/4 (T-gate) 3 | 4 | OPENQASM 2.0; 5 | include "qelib1.inc"; 6 | 7 | h q[0]; 8 | h q[1]; 9 | t q[0]; 10 | s q[1]; 11 | h q[0]; 12 | t q[1]; 13 | bloch q[0]; 14 | h q[1]; 15 | bloch q[1]; 16 | --------------------------------------------------------------------------------