sf.ops.Catstate¶
-
class
Catstate
(a=0.0, phi=0.0, p=0, representation='complex', ampl_cutoff=1e-12, D=2)[source]¶ Bases:
strawberryfields.ops.Preparation
Prepare a mode in a cat state.
A cat state is the coherent superposition of two coherent states,
\[\ket{\text{cat}(\alpha)} = \frac{1}{N} (\ket{\alpha} +e^{i\theta} \ket{-\alpha}),\]where \(N = \sqrt{2 (1+\cos(\theta)e^{-2|\alpha|^2})}\) is the normalization factor and \(\alpha = a e^{i\phi}\).
Warning
Cat states are non-Gaussian, and thus can only be used in the Fock and Bosonic backends, not the Gaussian backend.
- Parameters
a (float) – displacement magnitude \(|\alpha|\)
phi (float) – displacement angle \(\phi\)
p (float) – Parity, where \(\theta=p\pi\).
p=0
corresponds to an even cat state, andp=1
an odd cat state.representation (str) – whether to use the
'real'
or'complex'
representation (Bosonic backend only)ampl_cutoff (float) – if using the
'real'
representation, this determines how many terms to keep (Bosonic backend only)D (float) – for
'real'
representation, quality parameter of approximation (Bosonic backend only)
Details and Conventions
Definition
The cat state is a non-Gaussian superposition of coherent states
\[|cat\rangle = \frac{e^{-|\alpha|^2/2}}{\sqrt{2(1+e^{-2|\alpha|^2}\cos(\theta))}} \left(|\alpha\rangle +e^{i\theta}|-\alpha\rangle\right)\]with the even cat state given for \(\theta=0\), and the odd cat state given for \(\theta=\pi\).
Tip
Implemented in Strawberry Fields as a NumPy array by
strawberryfields.utils.cat_state
In the case where \(\alpha<1.2\), the cat state can be approximated by the squeezed single photon state \(S\ket{1}\).
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
= 1¶
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