diff options
Diffstat (limited to 'graphics/pgf/contrib/yquant/doc/qasm')
18 files changed, 395 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test1.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test1.qasm new file mode 100644 index 0000000000..0f8dc1d4fc --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test1.qasm @@ -0,0 +1,12 @@ +# +# File: test1.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - EPR creation +# + qubit q0 + qubit q1 + + h q0 # create EPR pair + cnot q0,q1 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test10.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test10.qasm new file mode 100644 index 0000000000..4f788eb36c --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test10.qasm @@ -0,0 +1,16 @@ +# +# File: test10.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - multi-qubit gates +# also demonstrates use of classical bits + + qubit q0 + cbit c1 + qubit q2 + + h q0 + Utwo q0,c1 + S q2 + Utwo c1,q2 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test11.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test11.qasm new file mode 100644 index 0000000000..e668be717f --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test11.qasm @@ -0,0 +1,20 @@ +# +# File: test11.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - user-defined +# multi-qubit ops + + defbox fx,2,0,'U_{f(x)}' + defbox fxy,3,0,'U_{f(x,y)}' + + qubit q0 + qubit q1 + qubit q2 + + h q0 + fx q0,q1 + h q1 + fxy q0,q1,q2 + diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test12.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test12.qasm new file mode 100644 index 0000000000..d9a6a7caed --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test12.qasm @@ -0,0 +1,20 @@ +# +# File: test12.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - multi-qubit controlled +# multi-qubit operations + + defbox CU2,3,1,'U' + defbox CV2,3,1,'V' + + qubit q0 + qubit q1 + qubit q2 + + h q0 + CU2 q0,q1,q2 + h q0 + CV2 q2,q0,q1 +
\ No newline at end of file diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test13.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test13.qasm new file mode 100644 index 0000000000..a8def4239c --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test13.qasm @@ -0,0 +1,42 @@ +# +# File: test13.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - three-qubit phase +# estimation circuit with QFT and controlled-U + + defbox CU,3,1,'U' + defbox CU2,3,1,'U^2' + defbox CU4,3,1,'U^4' + def c-S,1,'S' + def c-T,1,'T' + + qubit j0,0 # QFT qubits + qubit j1,0 + qubit j2,0 + qubit s0 # U qubits + qubit s1 + + h j0 # equal superposition + h j1 + h j2 + + CU4 j0,s0,s1 # controlled-U + CU2 j1,s0,s1 + CU j2,s0,s1 + + h j0 # QFT + c-S j0,j1 + h j1 + nop j0 + c-T j0,j2 + c-S j1,j2 + h j2 + nop j0 + nop j0 + nop j1 + + measure j0 # final measurement + measure j1 + measure j2 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test14.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test14.qasm new file mode 100644 index 0000000000..ee83a46a4d --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test14.qasm @@ -0,0 +1,49 @@ +# +# File: test14.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - three-qubit FT QEC +# circuit with syndrome measurement + + defbox synd,4,0,'\txt{Process\\Syndrome}' + defbox rop,7,4,'{\symcal R}' + + qubit q0 # code data qubits + qubit q1 + qubit q2 + qubit s0,0 # syndrome measurement qubits + qubit s1,0 + cbit c0,0 # classical bits to store syndromes + cbit c1,0 + + h s0 # create EPR pair for FT meas + cnot s0,s1 + cnot q0,s0 # measure parity of q0,q1 + nop s1 # prevent cnot's from colliding + cnot q1,s1 + cnot s0,s1 # uncreate EPR + h s0 + measure s0 # measure syndrome qubits + nop s1 + measure s1 + cnot s0,c0 # copy to classical bits + nop s1 + cnot s1,c1 + space s0 + + zero s0 + zero s1 + h s0 # create EPR pair for FT meas + cnot s0,s1 + cnot q1,s0 # measure parity of q1,q2 + nop s1 # prevent cnot's from colliding + cnot q2,s1 + cnot s0,s1 # uncreate EPR + h s0 + measure s0 # measure syndrome qubits + nop s1 + measure s1 + + synd s0,s1,c0,c1 + rop s0,s1,c0,c1,q0,q1,q2 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test15.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test15.qasm new file mode 100644 index 0000000000..0d7ed35ea5 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test15.qasm @@ -0,0 +1,17 @@ +# +# File: test15.qasm +# Date: 24-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - "D-type" measurement +# requested by Nielsen + + def MeasZ,0,'\dmeterwide{HZ_\theta}{18pt}' + + qubit q0,\psi + qubit q1,+ + + nop q0 + ZZ q0,q1 + nop q0 + MeasZ q0 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test16.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test16.qasm new file mode 100644 index 0000000000..1aa78ddfbf --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test16.qasm @@ -0,0 +1,22 @@ +# +# File: test16.qasm +# Date: 24-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - example from Nielsen +# paper on cluster states + + qubit q0,\psi + qubit q1,\psi + qubit q2,\phi + qubit q3,0 + + nop q0 + nop q0 + slash q0 + nop q1 + ZZ q1,q2 + cnot q2,q3 + nop q2 + discard q2 + dmeter q3 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test17.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test17.qasm new file mode 100644 index 0000000000..e1eefac730 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test17.qasm @@ -0,0 +1,22 @@ +# +# File: test17.qasm +# Date: 24-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - example from Nielsen +# paper on cluster states + + def MeasH,0,'\dmeter{H}' + + qubit q0,\psi + qubit q1,+ + qubit q2,+ + qubit q3,\phi + + nop q0 + nop q2 + ZZ q0,q1 + ZZ q2,q3 + ZZ q1,q2 + MeasH q1 + MeasH q2 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test18.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test18.qasm new file mode 100644 index 0000000000..04576ece23 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test18.qasm @@ -0,0 +1,20 @@ +# +# File: test18.qasm +# Date: 25-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - multiple-control bullet op + + def MeasH,0,'\dmeter{H}' + def Z4,3,'bullet' # handled specially + + qubit q0,\psi + qubit q1,+ + qubit q2,+ + qubit q3,\phi + + nop q0 + nop q2 + Z4 q0,q1,q2,q3 + MeasH q1 + MeasH q2 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test2.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test2.qasm new file mode 100644 index 0000000000..9b8ae9af10 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test2.qasm @@ -0,0 +1,20 @@ +# +# File: test2.qasm +# Date: 29-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - simple teleportation circuit +# + qubit q0 + qubit q1 + qubit q2 + + h q1 # create EPR pair + cnot q1,q2 + cnot q0,q1 # Bell basis measurement + h q0 + nop q1 + measure q0 + measure q1 + c-x q1,q2 # correction step + c-z q0,q2 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test3.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test3.qasm new file mode 100644 index 0000000000..01c8247741 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test3.qasm @@ -0,0 +1,13 @@ +# +# File: test3.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - swap circuit +# + qubit q0 + qubit q1 + + cnot q0,q1 + cnot q1,q0 + cnot q0,q1 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test4.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test4.qasm new file mode 100644 index 0000000000..c4dc61ef21 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test4.qasm @@ -0,0 +1,23 @@ +# +# File: test4.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - quantum +# fourier transform on three qubits + + def c-S,1,'S' + def c-T,1,'T' + + qubit j0 + qubit j1 + qubit j2 + + h j0 + c-S j1,j0 + c-T j2,j0 + nop j1 + h j1 + c-S j2,j1 + h j2 + swap j0,j2 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test5.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test5.qasm new file mode 100644 index 0000000000..0a1a7e511b --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test5.qasm @@ -0,0 +1,15 @@ +# +# File: test5.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - demonstrate arbitray qubit matrix ops + + def c-P,1,'\m{e^{i\alpha} & 0 \cr 0 & e^{-i\alpha}}' + def Ryt,0,'\m{\cos{\theta}&-\sin{\theta}\cr\sin{\theta}&\cos{\theta}}' + + qubit j0 + qubit j1 + + c-P j0,j1 + Ryt j0
\ No newline at end of file diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test6.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test6.qasm new file mode 100644 index 0000000000..88d48c87ab --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test6.qasm @@ -0,0 +1,20 @@ +# +# File: test6.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - demonstrate +# multiple-qubit controlled single-q-gates + + def c-U,3,'U' + + qubit j0 + qubit j1 + qubit j2 + qubit j3 + + toffoli j0,j1,j2 + X j0 + c-U j2,j3,j0,j1 + H j2 + measure j3 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test7.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test7.qasm new file mode 100644 index 0000000000..ffc7227b20 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test7.qasm @@ -0,0 +1,21 @@ +# +# File: test7.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - measurement +# of operator with correction + + def c-U,1,'U' + def c-V,1,'V' + + qubit q0 + qubit q1 + + H q0 + c-U q0,q1 + H q0 + measure q0 + c-V q0,q1 + nop q0 + nop q1 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test8.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test8.qasm new file mode 100644 index 0000000000..ba88ef68b4 --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test8.qasm @@ -0,0 +1,23 @@ +# +# File: test8.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - stage in +# simplification of quantum teleportation + + def c-Z,1,'Z' + + qubit q0,\psi + qubit q1,0 + qubit q2,0 + + H q1 + cnot q0,q1 + cnot q1,q2 + cnot q0,q1 + cnot q1,q2 + H q0 + c-Z q2,q0 + H q0 + H q0 diff --git a/graphics/pgf/contrib/yquant/doc/qasm/test9.qasm b/graphics/pgf/contrib/yquant/doc/qasm/test9.qasm new file mode 100644 index 0000000000..fc1486be8d --- /dev/null +++ b/graphics/pgf/contrib/yquant/doc/qasm/test9.qasm @@ -0,0 +1,20 @@ +# +# File: test9.qasm +# Date: 22-Mar-04 +# Author: I. Chuang <ichuang@mit.edu> +# +# Sample qasm input file - two-qubit gate circuit +# implementation of Toffoli + + def c-X,1,'\sqrt{X}' + def c-Xd,1,'{\sqrt{X}}^\dagger' + + qubit q0 + qubit q1 + qubit q2 + + c-X q1,q2 + cnot q0,q1 + c-Xd q1,q2 + cnot q0,q1 + c-X q0,q2 |