Skip to content

FidelityAlgebra ​

Symmetry, range, unitary invariance and agreement with the overlap

5/5 passed in 117ms

TestWhat it doesResult
test_pure_overlapF=Tr(ρσ) with a pure state on one side, where Λ vanishes.✅ pass
test_range0≤F≤1 over 60 random mixed pairs, with no clamping to make it true.✅ pass
test_symmetryF(a,b)=F(b,a) over 40 random mixed single-mode pairs.✅ pass
test_two_mode_pureTwo pure two-mode squeezed vacua take the n-mode pure branch and match the Fock-basis overlap 1/(cosh2⁡r1cosh2⁡r2(1−t1t2)2) with t=tanh⁡r.✅ pass
test_unitary_invarianceA common symplectic unitary leaves F unchanged: F(UaU†,UbU†)=F(a,b).✅ pass