Simple qubit state: 1/5*[3, 4i]
measurement against |0> should result in 0.36 against |1> → 0.64
import Yao
reg = Yao.ArrayReg([3.0, 4.0im]) # a unnormalized state
Yao.normalize!(reg)
shots = 10000
m=Yao.measure(Yao.ComputationalBasis(), reg; nshots=shots)
global s=0
for i in 1:shots
global s = s + m[i].buf
end
s/shots
result: 0.6306 → this is OK for measurement against |1>
Where is the result for |0>?