average_gate_fidelity_from_process_matrices

average_gate_fidelity_from_process_matrices(process_matrix_1, process_matrix_2)

Return the average gate fidelity between two process matrices.

Parameters:
  • process_matrix_1 (ndarray | Array) – The first process matrix, representing the ideal or target quantum operation.

  • process_matrix_2 (ndarray | Array) – The second process matrix, representing the implemented or actual quantum operation. It could be a multidimensional array where the last two dimensions correspond to the process matrices themselves.

Return type:

float | ndarray | Array

Returns:

The average gate fidelity between the two process matrices. If process_matrix_2 is multidimensional, it is an array.

Raises:

SimphonyError – If the provided matrices are not of the same shape, are not square, or do not have dimensions that are a power of 4.

Note

The formula used for calculating the average gate fidelity \(F\) is:

\[F = \frac{d \cdot \text{Tr}(\chi_1 \chi_2) + 1}{d + 1},\]

where \(d\) is the dimension of the matrices.