qml.devices.default_gaussian.fock_expectation

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

Calculates the expectation and variance of a Fock state probability.

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

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

  • params (Sequence[int]) – the Fock state to return the expectation value for

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

Returns

the Fock state expectation and variance

Return type

tuple

Contents

Using PennyLane

Development

API