class_docstr: Unit tests for the to_openqasm() method
class_docstr_tok: ["Unit","tests","for","the","to_openqasm","(",")","method"]
docstr: Test that gates not natively supported by QASM, such as the
  rotation gate, are correctly decomposed and serialized.
docstr_tok: ["Test","that","gates","not","natively","supported","by","QASM",",","such","as","the","rotation","gate",",","are","correctly","decomposed","and","serialized","."]
code: def test_rotation_gate_decomposition(self):
      """Test that gates not natively supported by QASM, such as the
      rotation gate, are correctly decomposed and serialized."""
      with qml.queuing.AnnotatedQueue() as q1:
          qml.Rot(0.3, 0.1, 0.2, wires=1)
  
      circuit1 = qml.tape.QuantumScript.from_queue(q1)
      qasm1 = circuit1.to_openqasm(wires=Wires([0, 1]))
  
      with qml.queuing.AnnotatedQueue() as q2:
          qml.Rot.compute_decomposition(0.3, 0.1, 0.2, wires=1)
  
      circuit2 = qml.tape.QuantumScript.from_queue(q2)
      qasm2 = circuit2.to_openqasm(wires=Wires([0, 1]))
  
      expected = dedent(
          """\
              OPENQASM 2.0;
              include "qelib1.inc";
              qreg q[2];
              creg c[2];
              rz(0.3) q[1];
              ry(0.1) q[1];
              rz(0.2) q[1];
              measure q[0] -> c[0];
              measure q[1] -> c[1];
              """
      )
  
      assert qasm1 == expected
      assert qasm1 == qasm2
  
imports: from textwrap import dedent
  import numpy
  import pytest
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 5 for calling the TestToQasmUnitTests obj's underlying member method code with example usage: obj.test_rotation_gate_decomposition() without return types