class_docstr: Class to apply pattern matching in the forward direction.
class_docstr_tok: ["Class","to","apply","pattern","matching","in","the","forward","direction","."]
docstr: Create the ForwardMatch class.
  Args:
      circuit_dag (.CommutationDAG): circuit as commutation DAG.
      pattern_dag (.CommutationDAG): pattern as commutation DAG.
      node_id_c (int): index of the first gate matched in the circuit.
      node_id_p (int): index of the first gate matched in the pattern.
code: def __init__(
      self,
      circuit_dag,
      pattern_dag,
      node_id_c,
      node_id_p,
      wires,
      control_wires,
      target_wires,
  ):
      """
      Create the ForwardMatch class.
      Args:
          circuit_dag (.CommutationDAG): circuit as commutation DAG.
          pattern_dag (.CommutationDAG): pattern as commutation DAG.
          node_id_c (int): index of the first gate matched in the circuit.
          node_id_p (int): index of the first gate matched in the pattern.
      """
      # pylint: disable=too-many-branches, too-many-arguments
  
      # Commutation DAG of the circuit
      self.circuit_dag = circuit_dag
  
      # Commutation DAG of the pattern
      self.pattern_dag = pattern_dag
  
      # Node ID in the circuit
      self.node_id_c = node_id_c
  
      # Node ID in the pattern
      self.node_id_p = node_id_p
  
      # List of mapped wires for each node
      self.wires = wires
  
      # List of mapped control wires for each node
      self.control_wires = control_wires
  
      # List of mapped target wires for each node
      self.target_wires = target_wires
  
      # Successors to visit
      self.successors_to_visit = [None] * circuit_dag.size
  
      # Blocked nodes in the circuit
      self.circuit_blocked = [None] * circuit_dag.size
  
      # Matched nodes circuit
      self.circuit_matched_with = [None] * circuit_dag.size
  
      # Matched nodes pattern
      self.pattern_matched_with = [None] * pattern_dag.size
  
      # Updated qubits for each node
      self.updated_qubits = []
  
      # List of match
      self.match = []
  
      # List of candidates for the forward match
      self.candidates = []
  
      # List of nodes in circuit which are matched
      self.matched_nodes_list = []
  
imports: import copy
  import itertools
  from collections import OrderedDict
  from typing import Sequence, Callable
  import numpy
  import pennylane
  from pennylane.transforms import transform
  from pennylane import adjoint
  from pennylane.ops.qubit.attributes import symmetric_over_all_wires
  from pennylane.tape import QuantumTape, QuantumScript
  from pennylane.transforms.commutation_dag import commutation_dag
  from pennylane.wires import Wires
label_desc: Use image node_id 1 to create a new ForwardMatch object  with example: obj = ForwardMatch(circuit_dag, pattern_dag, node_id_c, node_id_p, wires, control_wires, target_wires)