class_docstr: QubitUnitary(U, wires)
  Apply an arbitrary unitary matrix with a dimension that is a power of two.
  
  **Details:**
  
  * Number of wires: Any (the operation can act on any number of wires)
  * Number of parameters: 1
  * Number of dimensions per parameter: (2,)
  * Gradient recipe: None
  
  Args:
      U (array[complex]): square unitary matrix
      wires (Sequence[int] or int): the wire(s) the operation acts on
      id (str): custom label given to an operator instance,
          can be useful for some applications where the instance has to be identified
      unitary_check (bool): check for unitarity of the given matrix
  
  Raises:
      ValueError: if the number of wires doesn't fit the dimensions of the matrix
  
  **Example**
  
  >>> dev = qml.device('default.qubit', wires=1)
  >>> U = 1 / np.sqrt(2) * np.array([[1, 1], [1, -1]])
  >>> @qml.qnode(dev)
  ... def example_circuit():
  ...     qml.QubitUnitary(U, wires=0)
  ...     return qml.expval(qml.PauliZ(0))
  >>> print(example_circuit())
  0.0
class_docstr_tok: ["QubitUnitary","(","U",",","wires",")","Apply","an","arbitrary","unitary","matrix","with","a","dimension","that","is","a","power","of","two",".","*","*","Details",":","*","*","*","Number","of","wires",":","Any","(","the","operation","can","act","on","any","number","of","wires",")","*","Number","of","parameters",":","1","*","Number","of","dimensions","per","parameter",":","(","2",",",")","*","Gradient","recipe",":","None","Args",":","U","(","array","[","complex","]",")",":","square","unitary","matrix","wires","(","Sequence","[","int","]","or","int",")",":","the","wire","(","s",")","the","operation","acts","on","id","(","str",")",":","custom","label","given","to","an","operator","instance",",","can","be","useful","for","some","applications","where","the","instance","has","to","be","identified","unitary_check","(","bool",")",":","check","for","unitarity","of","the","given","matrix","Raises",":","ValueError",":","if","the","number","of","wires","does","n't","fit","the","dimensions","of","the","matrix","*","*","Example","*","*",">",">",">","dev","=","qml.device","(","'default.qubit","'",",","wires=1",")",">",">",">","U","=","1","\/","np.sqrt","(","2",")","*","np.array","(","[","[","1",",","1","]",",","[","1",",","-1","]","]",")",">",">",">","@","qml.qnode","(","dev",")","...","def","example_circuit","(",")",":","...","qml.QubitUnitary","(","U",",","wires=0",")","...","return","qml.expval","(","qml.PauliZ","(","0",")",")",">",">",">","print","(","example_circuit","(",")",")","0.0"]
docstr: Representation of the operator as a canonical matrix in the computational basis (static method).
  
  The canonical matrix is the textbook matrix representation that does not consider wires.
  Implicitly, this assumes that the wires of the operator correspond to the global wire order.
  
  .. seealso:: :meth:`~.QubitUnitary.matrix`
  
  Args:
      U (tensor_like): unitary matrix
  
  Returns:
      tensor_like: canonical matrix
  
  **Example**
  
  >>> U = np.array([[0.98877108+0.j, 0.-0.14943813j], [0.-0.14943813j, 0.98877108+0.j]])
  >>> qml.QubitUnitary.compute_matrix(U)
  [[0.98877108+0.j, 0.-0.14943813j],
  [0.-0.14943813j, 0.98877108+0.j]]
docstr_tok: ["Representation","of","the","operator","as","a","canonical","matrix","in","the","computational","basis","(","static","method",")",".","The","canonical","matrix","is","the","textbook","matrix","representation","that","does","not","consider","wires",".","Implicitly",",","this","assumes","that","the","wires","of","the","operator","correspond","to","the","global","wire","order",".","..","seealso",":",":",":","meth",":","`","~.QubitUnitary.matrix","`","Args",":","U","(","tensor_like",")",":","unitary","matrix","Returns",":","tensor_like",":","canonical","matrix","*","*","Example","*","*",">",">",">","U","=","np.array","(","[","[","0.98877108+0.j",",","0.-0.14943813j","]",",","[","0.-0.14943813j",",","0.98877108+0.j","]","]",")",">",">",">","qml.QubitUnitary.compute_matrix","(","U",")","[","[","0.98877108+0.j",",","0.-0.14943813j","]",",","[","0.-0.14943813j",",","0.98877108+0.j","]","]"]
code: def compute_matrix(U):  # pylint: disable=arguments-differ
      r"""Representation of the operator as a canonical matrix in the computational basis (static method).
  
      The canonical matrix is the textbook matrix representation that does not consider wires.
      Implicitly, this assumes that the wires of the operator correspond to the global wire order.
  
      .. seealso:: :meth:`~.QubitUnitary.matrix`
  
      Args:
          U (tensor_like): unitary matrix
  
      Returns:
          tensor_like: canonical matrix
  
      **Example**
  
      >>> U = np.array([[0.98877108+0.j, 0.-0.14943813j], [0.-0.14943813j, 0.98877108+0.j]])
      >>> qml.QubitUnitary.compute_matrix(U)
      [[0.98877108+0.j, 0.-0.14943813j],
      [0.-0.14943813j, 0.98877108+0.j]]
      """
      return U
  
imports: import warnings
  from itertools import product
  import numpy
  from scipy.linalg import fractional_matrix_power
  from pennylane.math import norm, cast, eye, zeros, transpose, conj, sqrt, sqrt_matrix
  from pennylane import numpy
  import pennylane
  from pennylane.operation import AnyWires, DecompositionUndefinedError, Operation
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the QubitUnitary obj's underlying member method code with example usage: obj.compute_matrix(U) and returns: U