| 1 |
# |
| 2 |
# File: test14.qasm |
| 3 |
# Date: 22-Mar-04 |
| 4 |
# Author: I. Chuang <[email protected]> |
| 5 |
# |
| 6 |
# Sample qasm input file - three-qubit FT QEC |
| 7 |
# circuit with syndrome measurement |
| 8 |
|
| 9 |
defbox synd,4,0,'\txt{Process\\Syndrome}' |
| 10 |
defbox rop,7,4,'{\symcal R}' |
| 11 |
|
| 12 |
qubit q0 # code data qubits |
| 13 |
qubit q1 |
| 14 |
qubit q2 |
| 15 |
qubit s0,0 # syndrome measurement qubits |
| 16 |
qubit s1,0 |
| 17 |
cbit c0,0 # classical bits to store syndromes |
| 18 |
cbit c1,0 |
| 19 |
|
| 20 |
h s0 # create EPR pair for FT meas |
| 21 |
cnot s0,s1 |
| 22 |
cnot q0,s0 # measure parity of q0,q1 |
| 23 |
nop s1 # prevent cnot's from colliding |
| 24 |
cnot q1,s1 |
| 25 |
cnot s0,s1 # uncreate EPR |
| 26 |
h s0 |
| 27 |
measure s0 # measure syndrome qubits |
| 28 |
nop s1 |
| 29 |
measure s1 |
| 30 |
cnot s0,c0 # copy to classical bits |
| 31 |
nop s1 |
| 32 |
cnot s1,c1 |
| 33 |
space s0 |
| 34 |
|
| 35 |
zero s0 |
| 36 |
zero s1 |
| 37 |
h s0 # create EPR pair for FT meas |
| 38 |
cnot s0,s1 |
| 39 |
cnot q1,s0 # measure parity of q1,q2 |
| 40 |
nop s1 # prevent cnot's from colliding |
| 41 |
cnot q2,s1 |
| 42 |
cnot s0,s1 # uncreate EPR |
| 43 |
h s0 |
| 44 |
measure s0 # measure syndrome qubits |
| 45 |
nop s1 |
| 46 |
measure s1 |
| 47 |
|
| 48 |
synd s0,s1,c0,c1 |
| 49 |
rop s0,s1,c0,c1,q0,q1,q2 |