Closed EnginSahinCE closed 7 years ago
LIQUi|> was not designed to do arbitrary state vector manipulations. It is intended for simulating unitary quantum operations and measurements. I would suggest using something like Sage (http://www.sagemath.org/) which will give you an online (Python notebook based) tool for manipulating general state arithmetic. This is how I debug new gates that I’m working on. Here a few examples:
I1=identity_matrix(2)
I2=identity_matrix(4)
I3=identity_matrix(8)
S=matrix(2,2,[1,0,0,i]); S
X=matrix(2,2,[0,1,1,0]); X
Y=matrix(2,2,[0,-i,i,0]); Y
Z=matrix(2,2,[1,0,0,-1]); Z
H=matrix(2,2,[1,1,1,-1])/sqrt(2.0); H
CNOT=matrix(4,4,[1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0]); CNOT
def R(k):
phi = 2*pi/(2^k)
phiR= cos(phi)
phiI= sin(phi)
return matrix(2,2,[1,0,0,phiR+i*phiI])
R(5)
Z.tensor_product(Z)*i
Sample output from SAGE: https://1drv.ms/i/s!AszgA-iYgA_omOApynXqCTdYjhuyGg
I am new F# and Liquid. my doctorate thesis is about quantum computing. i want to use Liquid for studies. i have a few questions about liquid.
1) for ket state (|0>, |1> or |psi>) liquid have that
my first question: is there anything for bra state (<0|, <1| or <psi|)?
how can i do this operation: |0><0| |psi> or |a>|b><c|
2) let's say we have |a> and |b> states
my second question: how can i get (|a> + |b>) or (|a>⊗|b>) as c or d that is a new qubit state
Thank you for your interest.