qcmet.utils.fidelities.fidelity#
- qcmet.utils.fidelities.fidelity(P1, P2)[source]#
Compute the fidelity between two probability distributions.
Fidelity is defined as the square of the sum of the square roots of the product of corresponding probabilities in the two distributions.
- Parameters:
- Returns:
Fidelity value between the two distributions.
- Return type:
- Raises:
AssertionError – If the input distributions are not of the same length.