Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168731
Image: ubuntu2004
from qasm import qasm
qasm(""" qubit q0 qubit q1 h q0 # create EPR pair cnot q0,q1 """)
%qasm 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 nop j2 h j1 c-S j2,j1 h j2 swap j0,j2
%qasm # # File: test9.qasm # Date: 22-Mar-04 # Author: I. Chuang # # 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