Learn STRAWBERRY-FIELDS with Real Code Examples

Updated Nov 25, 2025

Explain

Strawberry Fields allows developers to construct and simulate quantum circuits using continuous-variable quantum computation, unlike qubit-based systems.

It supports both Gaussian and non-Gaussian states, making it suitable for photonic quantum algorithms.

The library abstracts complex quantum photonic operations and integrates with simulators and hardware backends for experimentation.

Core Features

High-level circuit construction using Python API

Built-in simulators (Fock, Gaussian, and TF backends)

Gate and measurement operations for CV systems

Support for quantum state tomography and analysis

Integration with TensorFlow and PyTorch for quantum ML

Basic Concepts Overview

Mode: the photonic equivalent of a qubit in CV systems

Gate: operations on modes (e.g., displacement, squeezing)

Circuit: sequence of gates applied to quantum modes

Measurement: extracting classical information from quantum modes

Backend: simulator or real photonic device executing the circuit

Project Structure

notebooks/ - interactive experiments and tutorials

circuits/ - custom CV quantum circuit definitions

simulations/ - backend simulation results

data/ - measurement outcomes and analyses

scripts/ - automation and utility functions

Building Workflow

Import Strawberry Fields and initialize a program

Add photonic modes to the circuit

Apply Gaussian and non-Gaussian gates

Measure modes to obtain classical outcomes

Simulate or execute on supported hardware backends

Difficulty Use Cases

Beginner: simulate simple Gaussian circuits

Intermediate: implement non-Gaussian operations

Advanced: quantum machine learning experiments

Expert: optimize large photonic circuits

Enterprise: integrate hybrid quantum-classical pipelines

Comparisons

Strawberry Fields vs Qiskit: SF targets CV photonic systems; Qiskit targets qubits on IBM hardware

Strawberry Fields vs Cirq: SF is photonic and CV; Cirq targets qubits on Google hardware

Strawberry Fields vs Pennylane: SF can integrate with Pennylane for hybrid ML

Strawberry Fields vs PyQuil: SF focuses on CV photonics; PyQuil targets Rigetti qubits

Strawberry Fields vs Braket: SF is specialized for CV photonics; Braket is multi-hardware qubit platform

Versioning Timeline

2018 – Initial release of Strawberry Fields by Xanadu

2019 – Fock and Gaussian backends added

2020 – Integration with PennyLane for quantum ML

2021 – TensorFlow backend with automatic differentiation

2023 – Support for multi-mode Gaussian boson sampling and photonic hardware backends

Glossary

Mode: photonic analog of a qubit

Gate: quantum operation on a mode

Circuit: sequence of gate operations

Gaussian state: quantum state with Gaussian statistics

Non-Gaussian state: quantum state with non-Gaussian properties