StronglyEntanglingLayer

Module: pennylane.templates.layers

StronglyEntanglingLayer(weights, wires, r=1, imprimitive=<class 'pennylane.ops.qubit.CNOT'>)[source]

A layer applying rotations on each qubit followed by cascades of 2-qubit entangling gates.

The 2-qubit or imprimitive gates act on each qubit \(i\) chronologically. The second qubit for each gate is determined by \((i+r)\mod n\), where \(n\) is equal to len(wires) and \(range\) a layer hyperparameter called the range.

This is an example of two 4-qubit strongly entangling layers (ranges \(r=1\) and \(r=2\), respectively) with rotations \(R\) and CNOTs as imprimitives:

../_images/layer_sec.png
Parameters:
  • weights (array[float]) – array of weights of shape (len(wires), 3)
  • wires (Sequence[int]) – sequence of qubit indices that the template acts on
Keyword Arguments:
 
  • r (int) – range of the imprimitive gates of this layer, defaults to 1
  • imprimitive (pennylane.ops.Operation) – two-qubit gate to use, defaults to CNOT