sf.ops.Gaussian¶

class
Gaussian
(V, r=None, decomp=True, tol=1e06)[source]¶ Bases:
strawberryfields.ops.Preparation
,strawberryfields.ops.Decomposition
Prepare the specified modes in a Gaussian state.
This operation uses the Williamson decomposition to prepare quantum modes into a given Gaussian state, specified by a vector of means and a covariance matrix.
The Williamson decomposition decomposes the Gaussian state into a Gaussian transformation (represented by a symplectic matrix) acting on
Thermal
states. The Gaussian transformation is then further decomposed into an array of beamsplitters and local squeezing and rotation gates, by way of theGaussianTransform
andInterferometer
decompositions.Alternatively, the decomposition can be explicitly turned off, and the backend can be explicitly prepared in the Gaussian state provided. This is only supported by backends using the Gaussian representation.
 Parameters
V (array[float]) – an \(2N\times 2N\) (real and positive definite) covariance matrix
r (array[float] or None) – Length \(2N\) vector of means, of the form \((\x_0,\dots,\x_{N1},\p_0,\dots,\p_{N1})\). If None, it is assumed that \(r=0\).
decomp (bool) – Should the operation be decomposed into a sequence of elementary gates? If False, the state preparation is performed directly via the backend API.
tol (float) – the tolerance used when checking if the matrix is symmetric: \(VV^T \leq\) tol
Attributes
Extra dependencies due to parameters that depend on measurements.

measurement_deps
¶ Extra dependencies due to parameters that depend on measurements.
 Returns
dependencies
 Return type
set[RegRef]

ns
= None¶
Methods
apply
(reg, backend, **kwargs)Ask a local backend to execute the operation on the current register state right away.
decompose
(reg, **kwargs)Decompose the operation into elementary operations supported by the backend API.
merge
(other)Merge the operation with another (acting on the exact same set of subsystems).

apply
(reg, backend, **kwargs)¶ Ask a local backend to execute the operation on the current register state right away.
Takes care of parameter evaluations and any pending formal transformations (like dagger) and then calls
Operation._apply()
. Parameters
reg (Sequence[RegRef]) – subsystem(s) the operation is acting on
backend (BaseBackend) – backend to execute the operation
 Returns
the result of self._apply
 Return type
Any

decompose
(reg, **kwargs)¶ Decompose the operation into elementary operations supported by the backend API.
See
strawberryfields.backends.base
.

merge
(other)¶ Merge the operation with another (acting on the exact same set of subsystems).
Note
For subclass overrides: merge may return a newly created object, or self, or other, but it must never modify self or other because the same Operation objects may be also used elsewhere.
 Parameters
other (Operation) – operation to merge this one with
 Returns
other * self. The return value None represents the identity gate (doing nothing).
 Return type
Operation, None
 Raises
MergeFailure – if the two operations cannot be merged
Downloads