class_docstr: Tests for the ControlledQutritUnitary operation
class_docstr_tok: ["Tests","for","the","ControlledQutritUnitary","operation"]
docstr: Test the _controlled method for ControlledQutritUnitary.
docstr_tok: ["Test","the","_controlled","method","for","ControlledQutritUnitary","."]
code: def test_controlled(self):
      """Test the _controlled method for ControlledQutritUnitary."""
  
      U = TSWAP
  
      original = qml.ControlledQutritUnitary(
          U, control_wires=(0, 1), wires=[4, 2]
      )
      expected = qml.ControlledQutritUnitary(
          U, control_wires=(0, 1, "a"), wires=[4, 2]
      )
  
      out = original._controlled("a")
      assert qml.equal(out, expected)
  
      original = qml.ControlledQutritUnitary(
          U, control_wires=(0, 1), wires=[4, 2], control_values="01"
      )
      expected = qml.ControlledQutritUnitary(
          U,
          control_wires=(0, 1, "a"),
          wires=[4, 2],
          control_values="012",
      )
  
      out = original._controlled("a")
      assert qml.equal(out, expected)
  
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 14 for calling the TestControlledQutritUnitary obj's underlying member method code with example usage: obj.test_controlled() without return types