qml.devices.default_gaussian.fock_expectation¶
- fock_expectation(cov, mu, params, hbar=2.0)[source]¶
Calculates the expectation and variance of a Fock state probability.
- Parameters
cov (array) – \(2N\times 2N\) covariance matrix
mu (array) – length-\(2N\) vector of means
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
code/api/pennylane.devices.default_gaussian.fock_expectation
Download Python script
Download Notebook
View on GitHub