qml.init.particle_conserving_u2_uniform

particle_conserving_u2_uniform(n_layers, n_wires, low=0, high=6.283185307179586, seed=None)[source]

Creates a parameter array for ParticleConservingU2(), drawn from a uniform distribution. Each parameter is drawn uniformly at random from the half-open interval [low, high). The parameters define the trainable angles entering the Z rotation \(R_\mathrm{z}(\vec{\theta})\) and particle-conserving gate \(U_{2,\mathrm{ex}}\) implemented by the u2_ex_gate(). :param n_layers: number of layers :type n_layers: int :param n_wires: number of qubits :type n_wires: int :param low: lower endpoint of the parameter interval :type low: float :param high: upper endpoint of the parameter interval :type high: float :param seed: seed used in sampling the parameters, makes function call deterministic :type seed: int

Returns

parameter array

Return type

array

Contents

Using PennyLane

Development

API