Quasi-Probabilities (quanguru.QuantumToolbox.quasiProbabilities
)#
Contains functions to calculate quasi-probability distributions (adapted from qutip).
Functions#
|
An iterative method to evaluate the Wigner functions for the states |
|
Q-function of a given state vector or density matrix at points vec + i * vec |
|
Calculates the Q-function for a pure state. |
Function Name |
Docstrings |
Examples |
Unit Tests |
Tutorials |
---|---|---|---|---|
Wigner |
✅ |
❌ |
❌ |
❌ |
HusimiQ |
✅ |
❌ |
❌ |
❌ |
_qfuncPure |
✅ |
❌ |
❌ |
❌ |
- Wigner(rho: Union[scipy.sparse._base.spmatrix, numpy.ndarray], vec: Union[numpy.ndarray, list], g: float = 1.4142135623730951) numpy.ndarray [source]#
An iterative method to evaluate the Wigner functions for the states
and use them in a weighted sum to calculate Wigner function of any arbitrary state.
The Wigner function is calculated as
where
is the Wigner function for the density matrix
.
In this implementation, for each row m, Wlist contains the Wigner functions Wlist =
. As soon as one
Wigner function is calculated, the corresponding contribution is added to the total Wigner function, weighted by the corresponding element in the density matrix
.
- Parameters
rho (Matrix) – Density matrix or ket state.
vec (ndOrList) – An array (or list) to define the (coarse-grained) Phase space. This creates a square grid of the phase space.
g (float) – Scaling factor for a = 0.5 * g * (x + iy), default g = sqrt(2).
- Returns
Values representing the Wigner-function calculated over the specified range [vec, vec].
- Return type
ndarray
Examples
# TODO
- HusimiQ(state: Union[scipy.sparse._base.spmatrix, numpy.ndarray], vec: Union[numpy.ndarray, list], g: float = 1.4142135623730951) numpy.ndarray [source]#
Q-function of a given state vector or density matrix at points vec + i * vec
- Parameters
rho (Matrix) – density matrix or ket state
vec (ndOrList) – An array (or list) to define the (coarse-grained) Phase space. This creates a square grid of the phase space.
g (float) – Scaling factor for a = 0.5 * g * (x + iy), default g = sqrt(2).
- Returns
Values representing the Q-function calculated over the specified range [vec, vec].
- Return type
array
Examples
# TODO
- _qfuncPure(psi: Union[scipy.sparse._base.spmatrix, numpy.ndarray], alphaMat: numpy.ndarray) numpy.ndarray [source]#
Calculates the Q-function for a pure state.
- Parameters
psi (Matrix) – a pure state
vec (ndOrList) – an array (or list) to define the (coarse-grained) Phase space. This creates a square grid of the phase space.
g (float) – Scaling factor for a = 0.5 * g * (x + iy), default g = sqrt(2).
- Returns
Values representing the Q-function calculated over the specified range [vec, vec].
- Return type
array
Examples
# TODO