class_docstr: Tests for the ControlledQutritUnitary operation
class_docstr_tok: ["Tests","for","the","ControlledQutritUnitary","operation"]
docstr: Tests the metadata and unitary for a ControlledQutritUnitary raised to a power.
docstr_tok: ["Tests","the","metadata","and","unitary","for","a","ControlledQutritUnitary","raised","to","a","power","."]
code: def test_pow(self, n):
      """Tests the metadata and unitary for a ControlledQutritUnitary raised to a power."""
      U1 = unitary_group.rvs(3, random_state=10)
  
      op = qml.ControlledQutritUnitary(
          U1, control_wires=("b", "c"), wires="a", control_values="01"
      )
  
      pow_ops = op.pow(n)
      assert len(pow_ops) == 1
  
      assert (
          pow_ops[0].hyperparameters["u_wires"]
          == op.hyperparameters["u_wires"]
      )
      assert pow_ops[0].control_wires == op.control_wires
      assert pow_ops[0].control_values == op.control_values
  
      op_mat_to_pow = qml.math.linalg.matrix_power(op.data[0], n)
      assert qml.math.allclose(pow_ops[0].data[0], op_mat_to_pow)
  
imports: import pytest
  import numpy
  from scipy.stats import unitary_group
  from gate_data import TSWAP
  import pennylane
  from pennylane.wires import Wires
  from pennylane.operation import DecompositionUndefinedError
label_desc: Use image node_id 10 for calling the TestControlledQutritUnitary obj's underlying member method code with example usage: obj.test_pow(n) without return types