StateVector.get_distance_from

StateVector.get_distance_from(other)[source]

Return the distance between self and other.

The distance is given as the infidelity between the two states.

Parameters:

other (StateLike) – The state to measure distance from.

Returns:

A value between 1 and 0, where 0 means the two states are equal up to global phase and 1 means the two states are very unsimilar or far apart.

Return type:

float