qit.gate.dist

qit.gate.dist(A, B)

Distance between two unitary Lmaps.

Parameters
  • A (Lmap) – unitary operator

  • B (Lmap) – unitary operator

Returns

squared Frobenius norm distance between the unitaries, disregarding global phase

Return type

float

\[\mathrm{dist}(A, B) = \inf_{\phi \in \mathbb{R}} \|A - e^{i \phi} B\|_F^2 = 2 (\dim_A - |\mathrm{Tr}(A^\dagger B)|)\]