qml.devices.default_gaussian.photon_number

photon_number(mu, cov, params, hbar=2.0)[source]

Calculates the mean photon number for a given one-mode state.

Parameters
  • mu (array) – length-2 vector of means

  • cov (array) – \(2\times 2\) covariance matrix

  • params (None) – no parameters are used for this expectation value

  • hbar (float) – (default 2) the value of \(\hbar\) in the commutation relation \([\x,\p]=i\hbar\)

Returns

contains the photon number expectation and variance

Return type

tuple

Contents

Using PennyLane

Development

API