Quantum Calculator
plugins = [] [[fetch]] files = ["./quantum.py", "./browser-processor.py"]
# use state command to initialize your vector: state |0011> # alternatively use multistate to initialize with all possible classical inputs: # multistate 4 # classic instructions programmed straight forward: hadamard 0 cnot 0,1 swap 0,2 # large ccnot and cswap gates are also straight forward: ccnot 0,1,3 # rotate gates require an angle parameter as the second argument: rx 0, 90 # custom gates can be done with matrix: # this matrix would be the same as a NOT gate on qubit 0: # matrix 0 [ # 0,1, # 1,0] # this 2-gate matrix would be the same as a cnot 0,1: # matrix 0,1 [ # 1,0,0,0, # 0,1,0,0, # 0,0,0,1, # 0,0,1,0] # 3-gate matrix are also supported: # matrix 0,1,3 [ # 1,0,0,0,0,0,0,0, # 0,1,0,0,0,0,0,0, # 0,0,1,0,0,0,0,0, # 0,0,0,1,0,0,0,0, # 0,0,0,0,1,0,0,0, # 0,0,0,0,0,0,1,0, # 0,0,0,0,0,1,0,0, # 0,0,0,0,0,0,0,1] # by default, the output is the full tensor state # by using the measure command, you collapse to a random possible state: # measure # optionally use partial_measure to get a mixed state: # partial_measure 1
Run Quantum