class_docstr: Layers consisting of one-parameter single-qubit rotations on each qubit, followed by a closed chain
  or *ring* of CNOT gates.
  
  The ring of CNOT gates connects every qubit with its neighbour,
  with the last qubit being considered as a neighbour to the first qubit.
  
  .. figure:: ../../_static/templates/layers/basic_entangler.png
      :align: center
      :width: 40%
      :target: javascript:void(0);
  
  The number of layers :math:`L` is determined by the first dimension of the argument ``weights``.
  When using a single wire, the template only applies the single
  qubit gates in each layer.
  
  .. note::
  
      This template follows the convention of dropping the entanglement between the last and the first
      qubit when using only two wires, so the entangler is not repeated on the same wires.
      In this case, only one CNOT gate is applied in each layer:
  
      .. figure:: ../../_static/templates/layers/basic_entangler_2wires.png
          :align: center
          :width: 30%
          :target: javascript:void(0);
  
  Args:
      weights (tensor_like): Weight tensor of shape ``(L, len(wires))``. Each weight is used as a parameter
          for the rotation.
      wires (Iterable): wires that the template acts on
      rotation (pennylane.ops.Operation): one-parameter single-qubit gate to use,
          if ``None``, :class:`~pennylane.ops.RX` is used as default
  
  Raises:
      ValueError: if inputs do not have the correct format
  
  .. details::
      :title: Usage Details
  
      The template is used inside a qnode:
  
      .. code-block:: python
  
          import pennylane as qml
          from math import pi
  
          n_wires = 3
          dev = qml.device('default.qubit', wires=n_wires)
  
          @qml.qnode(dev)
          def circuit(weights):
              qml.BasicEntanglerLayers(weights=weights, wires=range(n_wires))
              return [qml.expval(qml.PauliZ(wires=i)) for i in range(n_wires)]
  
      >>> circuit([[pi, pi, pi]])
      [1., 1., -1.]
  
      **Parameter shape**
  
      The shape of the weights argument can be computed by the static method
      :meth:`~.BasicEntanglerLayers.shape` and used when creating randomly
      initialised weight tensors:
  
      .. code-block:: python
  
          shape = qml.BasicEntanglerLayers.shape(n_layers=2, n_wires=2)
          weights = np.random.random(size=shape)
  
      **No periodic boundary for two wires**
  
      When using two wires, the convention is to drop the periodic boundary condition.
      This means that the connection from the second to the first wire is omitted.
  
      .. code-block:: python
  
          n_wires = 2
          dev = qml.device('default.qubit', wires=n_wires)
  
          @qml.qnode(dev)
          def circuit(weights):
              qml.BasicEntanglerLayers(weights=weights, wires=range(n_wires))
              return [qml.expval(qml.PauliZ(wires=i)) for i in range(n_wires)]
  
      >>> circuit([[pi, pi]])
      [-1, 1]
  
  
      **Changing the rotation gate**
  
      Any single-qubit gate can be used as a rotation gate, as long as it only takes a single parameter. The default is the ``RX`` gate.
  
      .. code-block:: python
  
          @qml.qnode(dev)
          def circuit(weights):
              qml.BasicEntanglerLayers(weights=weights, wires=range(n_wires), rotation=qml.RZ)
              return [qml.expval(qml.PauliZ(wires=i)) for i in range(n_wires)]
  
      Accidentally using a gate that expects more parameters throws a
      ``ValueError: Wrong number of parameters``.
docstr: Returns the shape of the weight tensor required for this template.
  
  Args:
      n_layers (int): number of layers
      n_wires (int): number of qubits
  
  Returns:
      tuple[int]: shape
docstr_tok: ["Returns","the","shape","of","the","weight","tensor","required","for","this","template",".","Args",":","n_layers","(","int",")",":","number","of","layers","n_wires","(","int",")",":","number","of","qubits","Returns",":","tuple","[","int","]",":","shape"]
code: def shape(n_layers, n_wires):
      r"""Returns the shape of the weight tensor required for this template.
  
      Args:
          n_layers (int): number of layers
          n_wires (int): number of qubits
  
      Returns:
          tuple[int]: shape
      """
  
      return n_layers, n_wires
  
imports: import pennylane
  from pennylane.operation import Operation, AnyWires
label_desc: Use image node_id 4 for calling the BasicEntanglerLayers obj's underlying member method code with example usage: obj.shape(n_layers, n_wires) and returns: n_layers,  n_wires