texmf-dist/doc/latex/yquant/test9.qasm
raw| 1 | # |
| 2 | # File: test9.qasm |
| 3 | # Date: 22-Mar-04 |
| 4 | # Author: I. Chuang <[email protected]> |
| 5 | # |
| 6 | # Sample qasm input file - two-qubit gate circuit |
| 7 | # implementation of Toffoli |
| 8 | |
| 9 | def c-X,1,'\sqrt{X}' |
| 10 | def c-Xd,1,'{\sqrt{X}}^\dagger' |
| 11 | |
| 12 | qubit q0 |
| 13 | qubit q1 |
| 14 | qubit q2 |
| 15 | |
| 16 | c-X q1,q2 |
| 17 | cnot q0,q1 |
| 18 | c-Xd q1,q2 |
| 19 | cnot q0,q1 |
| 20 | c-X q0,q2 |