sf.ops

This module defines and implements the Python-embedded quantum programming language for continuous-variable (CV) quantum systems. The syntax is modeled after ProjectQ [33].

Functions

New([n])

Adds new subsystems to the quantum register.

Classes

Fouriergate()

Fourier gate.

Xgate(x)

Position displacement gate.

Zgate(p)

Momentum displacement gate.

Rgate(theta)

Rotation gate.

Pgate(s)

Quadratic phase gate.

Vgate(gamma)

Cubic phase gate.

Kgate(kappa)

Kerr gate.

CXgate([s])

Controlled addition or sum gate in the position basis.

CZgate([s])

Controlled phase gate in the position basis.

CKgate(kappa)

Cross-Kerr gate.

Dgate(r[, phi])

Phase space displacement gate.

Sgate(r[, phi])

Phase space squeezing gate.

BSgate([theta, phi])

Beamsplitter gate.

MZgate(phi_in, phi_ex)

Mach-Zehnder interferometer.

S2gate(r[, phi])

Two-mode squeezing gate.

LossChannel(T)

Perform a loss channel operation on the specified mode.

ThermalLossChannel(T, nbar)

Perform a thermal loss channel operation on the specified mode.

MSgate(r[, phi, r_anc, eta_anc, avg])

Phase space measurement-based squeezing gate.

PassiveChannel(T)

Perform an arbitrary multimode passive operation

Vacuum()

Prepare a mode in the vacuum state.

Coherent([r, phi])

Prepare a mode in a coherent state.

Squeezed([r, p])

Prepare a mode in a squeezed vacuum state.

DisplacedSqueezed([r_d, phi_d, r_s, phi_s])

Prepare a mode in a displaced squeezed state.

Fock([n])

Prepare a mode in a Fock basis state.

Catstate([a, phi, p, representation, …])

Prepare a mode in a cat state.

Thermal([n])

Prepare a mode in a thermal state.

Ket(state)

Prepare mode(s) using the given ket vector(s) in the Fock basis.

DensityMatrix(state)

Prepare mode(s) using the given density matrix in the Fock basis.

Bosonic([weights, means, covs])

Prepare a mode as a linear combination of Gaussian functions in phase space.

GKP([state, epsilon, ampl_cutoff, …])

Prepare a mode in a finite energy Gottesman-Kitaev-Preskill (GKP) state.

MeasureFock([select, dark_counts])

Photon counting measurement: measures a set of modes in the Fock basis.

MeasureHomodyne(phi[, select])

Performs a homodyne measurement, measures one quadrature of a mode.

MeasureHeterodyne([select])

Performs a heterodyne measurement on a mode.

MeasureThreshold([select])

Measures a set of modes with thresholded Fock-state measurements, i.e., measuring whether a mode contain zero or nonzero photons.

Interferometer(U[, mesh, drop_identity, tol])

Apply a linear interferometer to the specified qumodes.

BipartiteGraphEmbed(A[, …])

Embed a bipartite graph into an interferometer setup.

GraphEmbed(A[, mean_photon_per_mode, …])

Embed a graph into an interferometer setup.

GaussianTransform(S[, vacuum, tol])

Apply a Gaussian symplectic transformation to the specified qumodes.

Gaussian(V[, r, decomp, tol])

Prepare the specified modes in a Gaussian state.

All(op)

Metaoperation for applying a single-mode operation to every mode in the register.

Variables

Del

Deletes one or more existing modes.

Vac

Prepare a mode in the vacuum state.

MeasureX

Performs a homodyne measurement, measures one quadrature of a mode.

MeasureP

Performs a homodyne measurement, measures one quadrature of a mode.

MeasureHD

Performs a heterodyne measurement on a mode.

Fourier

Fourier gate.

Class Inheritance Diagram

Inheritance diagram of strawberryfields.ops.Fouriergate, strawberryfields.ops.Xgate, strawberryfields.ops.Zgate, strawberryfields.ops.Rgate, strawberryfields.ops.Pgate, strawberryfields.ops.Vgate, strawberryfields.ops.Kgate, strawberryfields.ops.CXgate, strawberryfields.ops.CZgate, strawberryfields.ops.CKgate, strawberryfields.ops.Dgate, strawberryfields.ops.Sgate, strawberryfields.ops.BSgate, strawberryfields.ops.MZgate, strawberryfields.ops.S2gate, strawberryfields.ops.LossChannel, strawberryfields.ops.ThermalLossChannel, strawberryfields.ops.MSgate, strawberryfields.ops.PassiveChannel, strawberryfields.ops.Vacuum, strawberryfields.ops.Coherent, strawberryfields.ops.Squeezed, strawberryfields.ops.DisplacedSqueezed, strawberryfields.ops.Fock, strawberryfields.ops.Catstate, strawberryfields.ops.Thermal, strawberryfields.ops.Ket, strawberryfields.ops.DensityMatrix, strawberryfields.ops.Bosonic, strawberryfields.ops.GKP, strawberryfields.ops.MeasureFock, strawberryfields.ops.MeasureHomodyne, strawberryfields.ops.MeasureHeterodyne, strawberryfields.ops.MeasureThreshold, strawberryfields.ops.Interferometer, strawberryfields.ops.BipartiteGraphEmbed, strawberryfields.ops.GraphEmbed, strawberryfields.ops.GaussianTransform, strawberryfields.ops.Gaussian, strawberryfields.ops.All