Hey,
why when I am trying to apply this gate on a state:
psi[1,1]=1
I am getting the wrong result ?
and this is the result I am getting for two qubits
Thanks a lot for all the helpers!
Hey,
why when I am trying to apply this gate on a state:
psi[1,1]=1
I am getting the wrong result ?
and this is the result I am getting for two qubits
Thanks a lot for all the helpers!
Just to understand your question, what is the result you were expecting to obtain? And how did the results you got differ from it?
Also what is the definition of the operator you were trying to apply in terms of the operators S^z, and S^x ?
The initial state should not be changed ( |psi> = [1,0,0,0]’ ), and the result I get is |psi>= [0.75,0.125,0,0]'.
According to my calculations the CNOT which I wrote as an OpSum is correct, and if I will construct it as a matrix and then use kron I will get the right matrix, however
Does anyone knows what is the problem in here ?
The check you did of turning the MPO into a single tensor to look at is useful. It looks to me that it’s not actually giving the CNOT gate, which has all zero or one entries only:
https://en.wikipedia.org/wiki/Controlled_NOT_gate
My best guess as to what’s going on, without seeing your calculation, is that your calculation used the Pauli Z and X matrices (\sigma^z and \sigma^x), whereas the operators S^z and S^x have an extra factor of 1/2 included in them: S^z = \frac{1}{2} \sigma^z and S^x = \frac{1}{2} \sigma^x.
For the "S=1/2"
site type, the Pauli operators are named "X"
and "Z"
. Also note that there is a "Qubit"
site type in ITensor which includes a definition of the "CNOT"
gate already. For more info see here:
https://itensor.github.io/ITensors.jl/stable/IncludedSiteTypes.html#“Qubit”-SiteType
ITensor Website
·
Twitter @ITensorLib
© 2022 ITensor Collaboration