pennylane_calculquebec.utility.optimization.find_previous_gate

pennylane_calculquebec.utility.optimization.find_previous_gate#

pennylane_calculquebec.utility.optimization.find_previous_gate(index: int, wires: list[int], op_list: list[Operation]) int#

find first operation that shares a list of wires prior to an index in a list

Parameters:
  • index (int) – the index from which to start

  • wires (list[int]) – the wires on which to act

  • op_list (list[Operation]) – the list of operation to consider

Returns:

the index of the previous operation. None if none were found

Return type:

int