# sf.backends¶

Warning

Unless you are a Strawberry Fields developer, you likely do not need to use these classes directly.

See the Engine class for details on loading a particular backend for quantum program execution.

This package contains the modules that make up the Strawberry Fields backends. This includes photonic simulators, shared numerical operations, and states objects returned by statevector simulators.

## Local statevector simulators¶

Below are all available local statevector backends currently provided by Strawberry Fields. These simulators all run locally, provide access to the state after simulation, and the state is preserved between engine runs.

 Implements a simulation of quantum optical circuits in a truncated Fock basis using NumPy, returning a BaseFock state object. The GaussianBackend implements a simulation of quantum optical circuits in NumPy using the Gaussian formalism, returning a GaussianState state object. Implements a simulation of quantum optical circuits in a truncated Fock basis using TensorFlow, returning a FockStateTF state object. The BosonicBackend implements a simulation of quantum optical circuits in NumPy by representing states as linear combinations of Gaussian functions in phase space., returning a BosonicState state object.
 BaseFockState(state_data, num_modes, pure, …) Class for the representation of quantum states in the Fock basis. BaseGaussianState(state_data, num_modes[, …]) Class for the representation of quantum states using the Gaussian formalism. FockStateTF(state_data, num_modes, pure, …) Class for the representation of quantum states in the Fock basis using the TFBackend. BaseBosonicState(state_data, num_modes, …) Class for the representation of quantum states as linear combinations of Gaussian functions in phase space.

## Backend API¶

A list of the abstract base classes that define the statevector backend API

 BaseState(num_modes[, mode_names]) Abstract base class for the representation of quantum states. Abstract base class for backends. Abstract base class for backends capable of Fock state manipulation. Abstract base class for backends that are only capable of Gaussian state manipulation. Abstract base class for backends that are only capable of manipulating states represented as linear combinations of Gaussian functions in phase space.