Skip to content

Commit

Permalink
Create quantum_circuit.qasm
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 3, 2024
1 parent 7887376 commit b646d8c
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# quantum_circuit.qasm

OPENQASM 2.0;

// Quantum registers
qreg q[5]; // 5-qubit quantum register
creg c[5]; // 5-bit classical register

// Quantum circuit
gate h q[0]; // Hadamard gate on qubit 0
gate cx q[0], q[1]; // Controlled-NOT gate from qubit 0 to qubit 1
gate ry(π/4) q[2]; // Rotation gate on qubit 2
gate cz q[1], q[3]; // Controlled-Z gate from qubit 1 to qubit 3
gate x q[4]; // Pauli-X gate on qubit 4

// Measurement
measure q -> c; // Measure all qubits and store results in classical register

0 comments on commit b646d8c

Please sign in to comment.