CVOperation

Module: pennylane

class CVOperation(*args, wires=None, do_queue=True)[source]

Base class for continuous-variable quantum operations.

heisenberg_pd(idx)[source]

Partial derivative of the Heisenberg picture transform matrix.

Computed using grad_recipe.

Parameters:idx (int) – index of the parameter with respect to which the partial derivative is computed.
Returns:partial derivative
Return type:array[float]
heisenberg_tr(num_wires, inverse=False)[source]

Heisenberg picture representation of the linear transformation carried out by the gate at current parameter values.

Given a unitary quantum gate \(U\), we may consider its linear transformation in the Heisenberg picture, \(U^\dagger(\cdot) U\).

If the gate is Gaussian, this linear transformation preserves the polynomial order of any observables that are polynomials in \(\mathbf{r} = (\I, \x_0, \p_0, \x_1, \p_1, \ldots)\). This also means it maps \(\text{span}(\mathbf{r})\) into itself:

\[U^\dagger \mathbf{r}_i U = \sum_j \tilde{U}_{ij} \mathbf{r}_j\]

For Gaussian CV gates, this method returns the transformation matrix for the current parameter values of the Operation. The method is not defined for non-Gaussian (and non-CV) gates.

Parameters:
  • num_wires (int) – total number of wires in the quantum circuit
  • inverse (bool) – if True, return the inverse transformation instead
Returns:

\(\tilde{U}\), the Heisenberg picture representation of the linear transformation

Return type:

array[float]