Channels#
- class DeterministicGaussianChannel(X: ndarray, Y: ndarray)#
Deterministic Gaussian channel.
It is a CP (completely positive) map between Gaussian states which is characterized by the matrices \(X, Y \in \mathbb{R}^{2n \times 2n}\) acting on the mean vector and covariance matrix with the mapping
\[\begin{split}\mu &\mapsto X \mu \\ \sigma &\mapsto X \sigma X^T + Y.\end{split}\]The matrices \(X\) and \(Y\) should satisfy the inequality
\[Y + i \Omega \geq i X \Omega X^T.\]Note
The matrix \(Y\) is dependent on \(\hbar\), but the value of \(\hbar\) is specified later when executed by a simulator. The parameter Y should be specified keeping in mind that it will automatically be scaled with \(\hbar\) during execution.
Note
Currently, this instruction can only be used along with
GaussianState
.- Parameters:
X (numpy.ndarray) – Transformation matrix on the quadrature vectors in xpxp order.
Y (numpy.ndarray) – The additive noise contributing to the covariance matrix in xpxp order.
- Raises:
InvalidParameter – If the specified ‘X’ and/or ‘Y’ matrices are invalid.
- class Attenuator(theta: float, mean_thermal_excitation: float = 0)#
The attenuator channel.
It reduces the first moments’ amplitude by \(\cos \theta\) by mixing the input state with a thermal state using a beamsplitter.
It can also be characterized as a deterministic Gaussian channel with mappings
\[\begin{split}X &= \cos \theta I_{2 \times 2} \\ Y &= ( \sin \theta )^2 (2 \bar{N} + 1) I_{2 \times 2},\end{split}\]where \(\theta \in [0, 2 \pi)\) is the beampsplitters’ mixing angle and \(\bar{N} \in \mathbb{R}^{+}\). \(\bar{N}\) is the mean number of thermal excitations of the system interacting with the environment.
Note
Currently, this instruction can only be used along with
GaussianState
.- Parameters:
- Raises:
InvalidParameter – If the specified mean thermal excitation is not positive.
- class Loss(transmissivity: ndarray)#
Applies a loss channel to the state.
The transmissivity is defined by \(t = \cos \theta\), where \(\theta\) is the beamsplitter parameter and the angle between the initial and resulting state. Considering only one particle, \(1-t^2\) is the probability of losing this particle.
Note
Currently, this instruction can only be used along with
SamplingSimulator
.Note
The parameter transmissivity is usually called transmittance.
- Parameters:
transmissivity (numpy.ndarray) – The transmissivity.
- class LossyInterferometer(matrix: ndarray)#
Applies a lossy interferometer (specified by a matrix) to the state.
The lossy interferometer matrix \(A\) should have singular values in the interval \([0, 1]\).
Applying
LossyInterferometer
with parameter \(A\) on all modes is equivalent to the following:pq.Q() | pq.Interferometer(W) | pq.Loss(np.diag(D)) | pq.Interferometer(V)
where \(A = V D W\), \(V, W\) are unitary matrices and \(D\) a diagonal matrix. The diagonal entries in \(D\) are called the singular values.
Note that the \(W\) and \(V\) interferometer matrices and the vector \(D\) are the results of the singular value decomposition (SVD) of the (possibly lossy) interferometer A.
Note
Currently, this instruction can only be used along with
SamplingSimulator
.- Raises:
InvalidParameter – When the singular values are not in the interval \([0, 1]\).
- Parameters:
matrix (numpy.ndarray) – The matrix representing the lossy interferometer.