sf.ops.GKP¶
-
class
GKP
(state=None, epsilon=0.2, ampl_cutoff=1e-12, representation='real', shape='square')[source]¶ Bases:
strawberryfields.ops.Preparation
Prepare a mode in a finite energy Gottesman-Kitaev-Preskill (GKP) state.
In their ideal form, square lattice GKP states are linear combinations of position eigenkets \(\ket{\cdot}_q\) spaced every \(\sqrt{\pi\hbar}\). Finite energy GKPs are attained by applying the Fock damping operator \(e^{-\epsilon\hat{n}}\) to the ideal states.
GKP states are qubits, with the qubit state defined by:
\[\ket{\psi}_{gkp} = \cos\frac{\theta}{2}\ket{0}_{gkp} + e^{-i\phi}\sin\frac{\theta}{2}\ket{1}_{gkp}\]where the computational basis states are \(\ket{\mu}_{gkp} = \sum_{n} \ket{(2n+\mu)\sqrt{\pi\hbar}}_{q}\).
Square lattice GKPs have Wigner functions with peaks arranged on a square lattice, whereas alternative lattices, such has hexagonal GKPs, can be obtained by applying symplectic transformations to the square lattice GKPs.
- Parameters
state (list) – [theta,phi] for qubit definition above
epsilon (float) – finite energy parameter of the state
cutoff (float) – this determines how many terms to keep
representation (str) –
'real'
or'complex'
reprsentationshape (str) – shape of the lattice; default
'square'
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