iqm.benchmarks.compressive_gst.mgst.reporting.reporting.min_spectral_distance

iqm.benchmarks.compressive_gst.mgst.reporting.reporting.min_spectral_distance#

iqm.benchmarks.compressive_gst.mgst.reporting.reporting.min_spectral_distance(X1: ndarray, X2: ndarray) float#

Computes the average absolute distance between the eigenvlues of two matrices.

The matrices are first diagonalized, then the eigenvalues are matched such that the average distance of matched eigenvalue pairs is minimal. The big advantage of this distance metric is that it is gauge invariant and it can thus be used to if the reconstructed gates are similar to the target gates before any gauge optimization.

Parameters:
  • X1 (ndarray) – The first matrix

  • X2 (ndarray) – The second matrix

Returns:

The minimal distance

Return type:

float