class_docstr: Tests the built-in patterns ("single", "ring", etc) of the broadcast template constructor.
class_docstr_tok: ["Tests","the","built-in","patterns","(","``","single","''",",","``","ring","''",",","etc",")","of","the","broadcast","template","constructor","."]
docstr: Tests that correct gate queue is created when 'unitary' is a template.
docstr_tok: ["Tests","that","correct","gate","queue","is","created","when","'unitary","'","is","a","template","."]
code: def test_correct_queue_for_template_unitary(
      self, unitary, gates, parameters
  ):
      """Tests that correct gate queue is created when 'unitary' is a template."""
  
      with qml.tape.OperationRecorder() as rec:
          broadcast(
              unitary=unitary,
              pattern="single",
              wires=range(3),
              parameters=parameters,
          )
  
      first_gate = gates[0]
      second_gate = gates[1]
      for idx, gate in enumerate(rec.queue):
          if idx % 2 == 0:
              assert isinstance(gate, first_gate)
          else:
              assert isinstance(gate, second_gate)
  
imports: from math import pi
  import pytest
  import numpy
  import pennylane
  from pennylane.templates import broadcast
  from pennylane.ops import RX, RY, T, S, Rot, CRX, CRot, CNOT
  from pennylane.templates.broadcast import wires_pyramid, wires_all_to_all, wires_ring
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TestBuiltinPatterns obj's underlying member method code with example usage: obj.test_correct_queue_for_template_unitary(unitary, gates, parameters) without return types