:math:F = \frac{F_e d + 1}{d + 1} where d is the matrix dimension.
U_actual Matrix whose fidelity to U_ideal will be computed. This may be a non-unitary matrix, i.e. the projection of a larger unitary matrix into the computational subspace.
U_ideal Unitary matrix to which U_actual will be compared.