mm.physics.overlap

mrmustard.physics.overlap(A, B)[source]

Calculates the overlap between two quantum states.

If the states are both pure it returns \(|<A|B>|^2\), if one is mixed it returns \(<A|B|A>\) and if both are mixed it returns \(Tr[AB]\).

Parameters:
Returns:

the overlap between the two states

Return type:

float