class_docstr: Implements an arbitrary state preparation on the specified wires.
  
  An arbitrary state on :math:`n` wires is parametrized by :math:`2^{n+1} - 2`
  independent real parameters. This templates uses Pauli word rotations to
  parametrize the unitary.
  
  Args:
      weights (tensor_like): Angles of the Pauli word rotations. Needs to have length :math:`2^{n+1} - 2`
          where :math:`n` is the number of wires the template acts upon.
      wires (Iterable): wires that the template acts on
  
  **Example**
  
  ArbitraryStatePreparation can be used to train state preparations,
  for example using a circuit with some measurement observable ``H``:
  
  .. code-block:: python
  
      dev = qml.device("default.qubit", wires=4)
  
      @qml.qnode(dev)
      def vqe(weights):
          qml.ArbitraryStatePreparation(weights, wires=[0, 1, 2, 3])
  
          return qml.expval(qml.Hermitian(H, wires=[0, 1, 2, 3]))
  
  The shape of the weights parameter can be computed as follows:
  
  .. code-block:: python
  
      shape = qml.ArbitraryStatePreparation.shape(n_wires=4)
docstr: Returns the required shape for the weight tensor.
  
  Args:
          n_wires (int): number of wires
  
  Returns:
      tuple[int]: shape
docstr_tok: ["Returns","the","required","shape","for","the","weight","tensor",".","Args",":","n_wires","(","int",")",":","number","of","wires","Returns",":","tuple","[","int","]",":","shape"]
code: def shape(n_wires):
      r"""Returns the required shape for the weight tensor.
  
      Args:
              n_wires (int): number of wires
  
      Returns:
          tuple[int]: shape
      """
      return (2 ** (n_wires + 1) - 2,)
  
file_path: pennylane/pennylane/templates/state_preparations/arbitrary_state_preparation.py
imports: import functools
  import pennylane
  from pennylane.operation import Operation, AnyWires
label_desc: Use image node_id 4 for calling the ArbitraryStatePreparation obj's underlying member method code with example usage: obj.shape(n_wires) and returns: unknown