class_docstr: Test converters to_zx and from_zx.
docstr: Test a simple circuit.
docstr_tok: ["Test","a","simple","circuit","."]
code: def test_circuit(self, decompose):
      """Test a simple circuit."""
  
      I = qml.math.eye(2**2)
  
      operations = [
          qml.RZ(5 / 4 * np.pi, wires=0),
          qml.RZ(3 / 4 * np.pi, wires=1),
          qml.PauliY(wires=1),
          qml.RX(0.1, wires=0),
          qml.PauliZ(wires=0),
          qml.RY(0.2, wires=1),
          qml.RZ(0.3, wires=1),
          qml.PauliX(wires=1),
          qml.CNOT(wires=[0, 1]),
          qml.CNOT(wires=[1, 0]),
          qml.SWAP(wires=[0, 1]),
      ]
  
      qs = QuantumScript(operations, [])
      zx_g = qml.transforms.to_zx(qs)
  
      assert isinstance(zx_g, pyzx.graph.graph_s.GraphS)
  
      matrix_qscript = qml.matrix(qs)
      matrix_zx = zx_g.to_matrix()
      # Check whether the two matrices are each others conjugate transposes
      mat_product = qml.math.dot(
          matrix_qscript, qml.math.conj(matrix_zx.T)
      )
      # Remove global phase
      mat_product /= mat_product[0, 0]
      assert qml.math.allclose(mat_product, I)
  
      qscript_back = qml.transforms.from_zx(
          zx_g, decompose_phases=decompose
      )
      assert isinstance(qscript_back, qml.tape.QuantumScript)
  
      matrix_qscript_back = qml.matrix(
          qscript_back, wire_order=list(range(len(qs.wires)))
      )
  
      # Check whether the two matrices are each others conjugate transposes
      mat_product = qml.math.dot(
          matrix_qscript, qml.math.conj(matrix_qscript_back.T)
      )
      # Remove global phase
      mat_product /= mat_product[0, 0]
  
      assert qml.math.allclose(mat_product, I)
  
imports: import sys
  from functools import partial
  import numpy
  import pytest
  import pennylane
  from pennylane.tape import QuantumScript
  from pennylane.transforms.op_transforms import OperationTransformError
label_desc: Use image node_id 6 for calling the TestConvertersZX obj's underlying member method code with example usage: obj.test_circuit(decompose) without return types