class_docstr: Additional tests for using broadcast with a custom pattern.
class_docstr_tok: ["Additional","tests","for","using","broadcast","with","a","custom","pattern","."]
docstr: Tests that the custom pattern can reproduce the built in patterns.
docstr_tok: ["Tests","that","the","custom","pattern","can","reproduce","the","built","in","patterns","."]
code: def test_reproduce_builtin_patterns(self, custom_pattern, pattern):
      """Tests that the custom pattern can reproduce the built in patterns."""
  
      dev = qml.device("default.qubit", wires=4)
  
      # qnode using custom pattern
      @qml.qnode(dev)
      def circuit1():
          broadcast(
              unitary=qml.CNOT, pattern=custom_pattern, wires=range(4)
          )
          return [qml.expval(qml.PauliZ(wires=w)) for w in range(4)]
  
      # qnode using built-in pattern
      @qml.qnode(dev)
      def circuit2():
          broadcast(unitary=qml.CNOT, pattern=pattern, wires=range(4))
          return [qml.expval(qml.PauliZ(wires=w)) for w in range(4)]
  
      custom = circuit1()
      built_in = circuit2()
      assert np.allclose(custom, built_in)
  
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 1 for calling the TestCustomPattern obj's underlying member method code with example usage: obj.test_reproduce_builtin_patterns(custom_pattern, pattern) and returns: unknown, unknown