class_docstr: Tests generic controlled gates
class_docstr_tok: ["Tests","generic","controlled","gates"]
docstr: Checks the control symbols for a tape with some version of a controlled qubit unitary.
code: def check_tape_controlled_qubit_unitary(self, tape):
      """Checks the control symbols for a tape with some version of a controlled qubit unitary."""
      _, ax = tape_mpl(
          tape, style="rcParams"
      )  # use plt.rcParams values
      layer = 0
  
      # 5 wires -> 4 control, 1 target
      assert len(ax.patches) == 5
      # Circle for control values are positioned correctly
      # Circle color matched according to the control value
      assert ax.patches[0].center == (layer, 0)
      assert ax.patches[0].get_facecolor() == mpl.colors.to_rgba(
          plt.rcParams["lines.color"]
      )
      assert ax.patches[1].center == (layer, 1)
      assert ax.patches[1].get_facecolor() == mpl.colors.to_rgba(
          plt.rcParams["axes.facecolor"]
      )
      assert ax.patches[2].center == (layer, 2)
      assert ax.patches[2].get_facecolor() == mpl.colors.to_rgba(
          plt.rcParams["lines.color"]
      )
      assert ax.patches[3].center == (layer, 3)
      assert ax.patches[3].get_facecolor() == mpl.colors.to_rgba(
          plt.rcParams["axes.facecolor"]
      )
  
      # five wires, one control line
      assert len(ax.lines) == 6
      control_line = ax.lines[5]
      assert control_line.get_data() == ((layer, layer), (0, 4))
  
      plt.close()
  
imports: import pytest
  import pennylane
  from pennylane.drawer import tape_mpl
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 5 for calling the TestControlledGates obj's underlying member method code with example usage: obj.check_tape_controlled_qubit_unitary(tape) without return types