class_docstr: Tests for single-qubit gates being pushed through controlled gates.
class_docstr_tok: ["Tests","for","single-qubit","gates","being","pushed","through","controlled","gates","."]
docstr: Test that Y-basis gates after controlled-Y-type gates on targets get pushed behind.
docstr_tok: ["Test","that","Y-basis","gates","after","controlled-Y-type","gates","on","targets","get","pushed","behind","."]
code: def test_push_y_gates_left(self):
      """Test that Y-basis gates after controlled-Y-type gates on targets get pushed behind."""
  
      def qfunc():
          qml.CRY(-0.5, wires=["a", 2])
          qml.PauliY(wires=2)
          qml.CNOT(wires=[1, 2])
          qml.CY(wires=["a", 1])
          qml.RY(0.3, wires=1)
  
      transformed_qfunc = commute_controlled(qfunc, direction="left")
  
      ops = qml.tape.make_qscript(transformed_qfunc)().operations
  
      names_expected = ["PauliY", "CRY", "CNOT", "RY", "CY"]
      wires_expected = [
          Wires(2),
          Wires(["a", 2]),
          Wires([1, 2]),
          Wires(1),
          Wires(["a", 1]),
      ]
      compare_operation_lists(ops, names_expected, wires_expected)
  
imports: import pytest
  from utils import compare_operation_lists, check_matrix_equivalence
  import pennylane
  from pennylane import numpy
  from pennylane.wires import Wires
  from pennylane.transforms.optimization import commute_controlled
label_desc: Use image node_id 8 for calling the TestCommuteControlled obj's underlying member method code with example usage: obj.test_push_y_gates_left() without return types