CVNeuralNetLayers

Module: pennylane.templates.layers

CVNeuralNetLayers(theta_1, phi_1, varphi_1, r, phi_r, theta_2, phi_2, varphi_2, a, phi_a, k, wires)[source]

A sequence of layers of type CVNeuralNetLayer(), as specified in [killoran2018continuous].

The number of layers \(L\) is inferred from the first dimension of the eleven weight parameters. The layers act on the \(M\) modes given in wires, and include interferometers of \(K=M(M-1)/2\) beamsplitters.

Note

The CV neural network architecture includes Kerr operations. Make sure to use a suitable device, such as the strawberryfields.fock device of the PennyLane-SF plugin.

Parameters:
  • theta_1 (array[float]) – length \((L, K)\) array of transmittivity angles for first interferometer
  • phi_1 (array[float]) – length \((L, K)\) array of phase angles for first interferometer
  • varphi_1 (array[float]) – length \((L, M)\) array of rotation angles to apply after first interferometer
  • r (array[float]) – length \((L, M)\) array of squeezing amounts for Squeezing operations
  • phi_r (array[float]) – length \((L, M)\) array of squeezing angles for Squeezing operations
  • theta_2 (array[float]) – length \((L, K)\) array of transmittivity angles for second interferometer
  • phi_2 (array[float]) – length \((L, K)\) array of phase angles for second interferometer
  • varphi_2 (array[float]) – length \((L, M)\) array of rotation angles to apply after second interferometer
  • a (array[float]) – length \((L, M)\) array of displacement magnitudes for Displacement operations
  • phi_a (array[float]) – length \((L, M)\) array of displacement angles for Displacement operations
  • k (array[float]) – length \((L, M)\) array of kerr parameters for Kerr operations
  • wires (Sequence[int]) – sequence of mode indices that the template acts on