class_docstr: Test that sequences of any single-qubit rotations are fully fused.
class_docstr_tok: ["Test","that","sequences","of","any","single-qubit","rotations","are","fully","fused","."]
docstr: Test that all sequences of single-qubit gates across multiple qubits fuse properly.
docstr_tok: ["Test","that","all","sequences","of","single-qubit","gates","across","multiple","qubits","fuse","properly","."]
code: def test_single_qubit_fusion_multiple_qubits(self):
      """Test that all sequences of single-qubit gates across multiple qubits fuse properly."""
  
      def qfunc():
          qml.RZ(0.3, wires="a")
          qml.RY(0.5, wires="a")
          qml.Rot(0.1, 0.2, 0.3, wires="b")
          qml.RX(0.1, wires="a")
          qml.CNOT(wires=["b", "a"])
          qml.SX(wires="b")
          qml.S(wires="b")
          qml.PhaseShift(0.3, wires="b")
  
      transformed_qfunc = single_qubit_fusion(qfunc)
      transformed_ops = qml.tape.make_qscript(
          transformed_qfunc
      )().operations
  
      names_expected = ["Rot", "Rot", "CNOT", "Rot"]
      wires_expected = [
          Wires("a"),
          Wires("b"),
          Wires(["b", "a"]),
          Wires("b"),
      ]
      compare_operation_lists(
          transformed_ops, names_expected, wires_expected
      )
  
      # Check matrix representation
      matrix_expected = qml.matrix(qfunc, ["a", "b"])()
  
      matrix_obtained = qml.matrix(transformed_qfunc, ["a", "b"])()
  
      assert check_matrix_equivalence(matrix_expected, matrix_obtained)
  
imports: import pytest
  from utils import compare_operation_lists, check_matrix_equivalence
  from pennylane import numpy
  import pennylane
  from pennylane.wires import Wires
  from pennylane.transforms.optimization import single_qubit_fusion
label_desc: Use image node_id 7 for calling the TestSingleQubitFusion obj's underlying member method code with example usage: obj.test_single_qubit_fusion_multiple_qubits() without return types