git clone https://github.com/Bagoult/dual-quantum.git
make
open Paper/main.pdfmamba activate sage
sageOnce inside of sage, type
load("dual_comp.sage")Then you can play around
Psi = np.array([1 + 2 * ϵ, 1 - ϵ, 1 - ϵ])
ψ = Psi / norm(Psi)
one, two, three = (np.eye(1, 3, i) for i in range(3))
A = outer(one, one)
B = outer(two, two) + outer(three, three)
M1 = A + ϵ * B
M2 = B + ϵ * A
# M1, M2 is a valid measurement operators collection
assert np.all(completeness(M1, M2) - np.identity(3) == 0)
p1 = measure_prob(M1, ψ)
p2 = measure_prob(M2, ψ)
ψ_1 = M1 @ ψ
ψ_2 = M2 @ ψ