The physics module contains high-level functions for performing calculations on quantum objects. It allows for objects with different representations to be used seamlessly in the same calculation, e.g., fidelity(A, B) works whether A and B are in the Fock or Gaussian representation or a mix of both.

All the functions are automatically differentiated and can be used in conjunction with an optimization routine.


fidelity(A, B)

Calculates the fidelity between two quantum states.


Calculates the norm of a quantum state.


Returns the normalized state.

overlap(A, B)

Calculates the overlap between two quantum states.

relative_entropy(A, B)

Calculates the relative entropy between two quantum states.

trace_distance(A, B)

Calculates the trace distance between two quantum states.


Calculates the Von Neumann entropy of a quantum state.