# Measurements¶

Note

In the Strawberry Fields we use the convention \(\hbar=2\) by default, but other conventions can also be chosen on engine `initialization`

. 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

defined as eigenstates of the Hermitian operator

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,

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

Tip

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