Module: pennylane.init

cvqnn_layer_uniform(n_wires, low=0, high=6.283185307179586, mean_active=0, std_active=0.1, seed=None)[source]

Creates a list of eleven parameter arrays for CVNeuralNetLayer(), where non-active gate parameters are drawn from a uniform distribution and active parameters from a normal distribution.

The shape of the arrays is (n_wires*(n_wires-1)/2) for the parameters used in an interferometer, and (n_wires) else.

All gate parameters are drawn uniformly from the interval [low, high], except from the three types of ‘active gate parameters’: the displacement amplitude, squeezing amplitude and kerr parameter. These active gate parameters are sampled from a normal distribution with mean mean_active and standard deviation std_active. Since they influence the mean photon number (or energy) of the quantum system, one typically wants to initialize them with values close to zero.


n_wires (int) – number of modes of the CV Neural Net

Keyword Arguments:
  • low (float) – minimum value of uniformly drawn non-active gate parameters
  • high (float) – maximum value of uniformly drawn non-active gate parameters
  • mean_active (float) – mean of active gate parameters
  • std_active (float) – standard deviation of active gate parameters
  • seed (int) – seed used in sampling the parameters, makes function call deterministic

list of parameter arrays