VF2

Contents

VF2#

class pennylane_calculquebec.processing.steps.placement.VF2(machine_name: str, use_benchmark=True, q1_acceptance=0.5, q2_acceptance=0.5, excluded_qubits=[], excluded_couplers=[])#

Bases: Placement

finds a mapping between the circuit’s wires and the machine’s qubits using the VF2 subgraph isomorphism algorithm

the networkx implementation of VF2 doesn’t allow for largest common subgraph research, so we’re using a combinatorics approach and testing all possibilities from largest to smallest

this “brute force” approach makes the algorithm quite slower than other solutions in the plugin

constructor for placement algorithms

Parameters:
  • use_benchmark (bool, optional) – should we use benchmarks during placement? Defaults to True.

  • q1_acceptance (float, optional) – what is the level of acceptance for state 1 readout? Defaults to 0.5.

  • q2_acceptance (float, optional) – what is the level of acceptance for cz fidelity? Defaults to 0.5.

  • excluded_qubits (list, optional) – what qubits should we exclude from the mapping? Defaults to [].

  • excluded_couplers (list, optional) – what couplers should we exclude from the mapping? Defaults to [].

execute(tape)

places the circuit on the machine's connectivity using VF2 algorithm

execute(tape)#

places the circuit on the machine’s connectivity using VF2 algorithm

If there is no perfect match, the missing nodes are mapped with qubits that minimize the subsequent routing path

  1. find largest common subgraph

  2. for each unmapped node

    1. find the best neighbour (using cost function)

    2. find machine node with shortest path from already mapped machine node

  1. map wires in all operations and measurements

Parameters:

tape (QuantumTape) – the tape to act on

Raises:

Exception – There should be enough space on the machine to run the circuit

Returns:

The transformed quantum tape

Return type:

QuantumTape