# Measurements¶

Note

In Strawberry Fields we use the convention $$\hbar=2$$ by default, but other conventions can also be chosen by setting the global variable sf.hbar at the beginning of a session. In this document we keep $$\hbar$$ explicit.

## Homodyne measurement¶

Definition

Homodyne measurement is a Gaussian projective measurement given by projecting the state onto the states

$\ket{x_\phi}\bra{x_\phi},$

defined as eigenstates of the Hermitian operator

$\hat{x}_\phi = \cos(\phi) \hat{x} + \sin(\phi)\hat{p}.$

Tip

Implemented in Strawberry Fields as a measurement operator by strawberryfields.ops.MeasureHomodyne

In the Gaussian backend, this is done by projecting onto finitely squeezed states approximating the $$x$$ and $$p$$ eigenstates. Due to the finite squeezing approximation, this results in a measurement variance of $$\sigma_H^2$$, where $$\sigma_H=2\times 10^{-4}$$.

In the Fock backends, this is done by using Hermite polynomials to calculate the $$\x_\phi$$ probability distribution over a specific range and number of bins, before taking a random sample.

## Heterodyne measurement¶

Warning

The heterodyne measurement can only be performed in the Gaussian backend.

Definition

Heterodyne measurement is a Gaussian projective measurement given by projecting the state onto the coherent states,

$\frac{1}{\pi} \ket{\alpha}\bra{\alpha}$

Tip

Implemented in Strawberry Fields as a measurement operator by strawberryfields.ops.MeasureHeterodyne

## Photon counting measurement¶

Warning

Photon counting is available in the Gaussian backend, but the state of the circuit is not updated after measurement (since it would be non-Gaussian).

Definition

Photon counting is a non-Gaussian projective measurement given by

$\ket{n_i}\bra{n_i}$

Tip

Implemented in Strawberry Fields as a measurement operator by strawberryfields.ops.MeasureFock