class_docstr: Class BackwardMatch allows to run backward direction part of the pattern matching algorithm.
class_docstr_tok: ["Class","BackwardMatch","allows","to","run","backward","direction","part","of","the","pattern","matching","algorithm","."]
docstr: Create a ForwardMatch class with necessary arguments.
  Args:
      circuit_dag (DAGDependency): circuit in the dag dependency form.
      pattern_dag (DAGDependency): pattern in the dag dependency form.
      forward_matches (list): list of match obtained in the forward direction.
      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.
      wires (list):
      control_wires (list):
      target_wires (list):
code: def __init__(
      self,
      circuit_dag,
      pattern_dag,
      qubits_conf,
      forward_matches,
      circuit_matched,
      circuit_blocked,
      pattern_matched,
      node_id_c,
      node_id_p,
      wires,
      control_wires,
      target_wires,
  ):
      """
      Create a ForwardMatch class with necessary arguments.
      Args:
          circuit_dag (DAGDependency): circuit in the dag dependency form.
          pattern_dag (DAGDependency): pattern in the dag dependency form.
          forward_matches (list): list of match obtained in the forward direction.
          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.
          wires (list):
          control_wires (list):
          target_wires (list):
      """
      # pylint: disable=too-many-arguments
  
      self.circuit_dag = circuit_dag
      self.pattern_dag = pattern_dag
      self.circuit_matched = circuit_matched
      self.circuit_blocked = circuit_blocked
      self.pattern_matched = pattern_matched
      self.qubits_conf = qubits_conf
      self.wires = wires
      self.control_wires = control_wires
      self.target_wires = target_wires
      self.node_id_c = node_id_c
      self.node_id_p = node_id_p
      self.forward_matches = forward_matches
      self.match_final = []
      self.matching_list = MatchingScenariosList()
  
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 BackwardMatch object  with example: obj = BackwardMatch(circuit_dag, pattern_dag, qubits_conf, forward_matches, circuit_matched, circuit_blocked, pattern_matched, node_id_c, node_id_p, wires, control_wires, target_wires)