pygsti.tools.optools.eigenvalue_fidelity

pygsti.tools.optools.eigenvalue_fidelity#

eigenvalue_fidelity(x, y, gauge_invariant=True)#

For positive semidefinite matrices (x, y), define M(x,y) = √(√x · y · √x).

The fidelity of (x, y) is defined as F(x,y) = Tr(M(x,y))^2.

Let v(x) and v(y) denote vectors containing the eigenvalues of x and y, sorted in decreasing order.

If gauge_invariant is True, then this function returns ⟨√v(x), √v(y)⟩^2, which is always an upper bound for F(x,y).

If gauge_invariant is False, then this function uses a heuristic to “match” eigenvalues of x and y based on similarity of their corresponding eigenvectors.

Proof#

Let A = √x·√y, so that M(x,y) = √(A A^†). The fact that M(x,y) is a square-root of a Gram matrix of A implies (via the polar decomposition) the existence of a unitary matrix U where A = M(x,y)U. This lets us write fidelity as

F(x,y) = Tr( √x · √y U^† )^2. (1)

Next, let s(z) denote the vector of singular values of a matrix z, in descending order. Assuming the claim from Problem III.6.12 of Bhatia’s Matrix Analysis, we have the inequality

Tr( √x · √y U^† ) ≤ ⟨ s(√x), s(√y U^†) ⟩. (2)

Using the fact that the singular values of √x are the same as its eigenvalues, and the singular values of √y U^† are the eigenvalues of √y, we have

⟨ s(√x), s(√y U^†) ⟩ = ⟨ √v(x), √v(y) ⟩. (3)

Combining (1), (2), and (3) proves our claim.

Parameters:
  • x (ndarray)

  • y (ndarray)

  • gauge_invariant (bool)

Return type:

floating