Operations¶
Strawberry Fields supports a wide variety of photonic quantum operations — including gates, state preparations and measurements. These operations are used to construct quantum programs, as in the following example:
with prog.context as q:
Fock(2) | q[0]
Fock(3) | q[1]
BSgate() | (q[0], q[1])
MeasureFock() | q[0]
This program uses Fock state preparation (Fock
), beamsplitters (BSgate
),
and a photon number resolving detector (MeasureFock
).
Below is a list of all quantum operations supported by Strawberry Fields.
Note
In the Strawberry Fields we use the convention \(\hbar=2\) by default, however
this can be changed using the global variable sf.hbar
.
See Conventions and formulas for more details.
Single-mode gates¶
Two-mode gates¶
State preparation¶
Prepare a mode in the vacuum state. Prepare a mode in a coherent state. Prepare a mode in a squeezed vacuum state. Prepare a mode in a displaced squeezed state. Prepare a mode in a thermal state. Prepare a mode in a Fock basis state. Prepare a mode in a cat state. Prepare a mode in a finite energy Gottesman-Kitaev-Preskill (GKP) state. Prepare mode(s) using the given ket vector(s) in the Fock basis. Prepare mode(s) using the given density matrix in the Fock basis. Prepare the specified modes in a Gaussian state.
Vacuum
()Coherent
([r, phi])Squeezed
([r, p])DisplacedSqueezed
([r_d, phi_d, r_s, phi_s])Thermal
([n])Fock
([n])Catstate
([a, phi, p, representation, …])GKP
([state, epsilon, ampl_cutoff, …])Ket
(state)DensityMatrix
(state)Gaussian
(V[, r, decomp, tol])
Measurements¶
Photon counting measurement: measures a set of modes in the Fock basis. Measures a set of modes with thresholded Fock-state measurements, i.e., measuring whether a mode contain zero or nonzero photons. Performs a homodyne measurement, measures one quadrature of a mode. Performs a heterodyne measurement on a mode. Performs a homodyne measurement, measures one quadrature of a mode. Performs a homodyne measurement, measures one quadrature of a mode. Performs a heterodyne measurement on a mode.
MeasureFock
([select, dark_counts])MeasureThreshold
([select])MeasureHomodyne
(phi[, select])MeasureHeterodyne
([select])
See also
See the measurements and post-selection tutorial for more details on applying measurements, post-selection, and classical processing.
Channels¶
Perform a loss channel operation on the specified mode. Perform a thermal loss channel operation on the specified mode. Phase space measurement-based squeezing gate. Perform an arbitrary multimode passive operation
LossChannel
(T)ThermalLossChannel
(T, nbar)MSgate
(r[, phi, r_anc, eta_anc, avg])
Decompositions¶
Apply a linear interferometer to the specified qumodes. Embed a graph into an interferometer setup. Embed a bipartite graph into an interferometer setup. Apply a Gaussian symplectic transformation to the specified qumodes. Prepare the specified modes in a Gaussian state.
Interferometer
(U[, mesh, drop_identity, tol])GraphEmbed
(A[, mean_photon_per_mode, …])BipartiteGraphEmbed
(A[, …])GaussianTransform
(S[, vacuum, tol])Gaussian
(V[, r, decomp, tol])