Allocators

class pytket_dqc.allocators.Allocator

Abstract class defining the structure of allocators which allocate quantum circuits on networks.

__init__() None
abstract allocate(circ: Circuit, network: NISQNetwork, **kwargs) Distribution
class pytket_dqc.allocators.annealing.Annealing

Allocator taking a simulated annealing approach to quantum circuit distribution.

__init__() None
allocate(circ: Circuit, network: NISQNetwork, **kwargs) Distribution

Distribute quantum circuit using simulated annealing approach.

Parameters:
  • circ (pytket.Circuit) – Circuit to distribute.

  • network (NISQNetwork) – Network onto which circuit is to be distributed.

Returns:

Distribution of circ onto network.

Return type:

Distribution

Key seed:

Seed for randomness. Default is None

Key iterations:

The number of iterations in the annealing procedure. Default is 10000.

Key initial_place_method:

Allocator to use to find the initial placement. Default is Random.

Key cache_limit:

The maximum size of the set of servers whose cost is stored in cache; see GainManager. Default value is 5.

Key initial_temperature:

Initial temperature of annealing procedure. Default value of 3.

class pytket_dqc.allocators.hypergraph_partitioning.HypergraphPartitioning

Distribution technique, making use of existing tools for hypergraph partitioning available through the KaHyPar package. This allocator will ignore weights on hyperedges and assume all hyperedges have weight 1. This allocator will ignore the connectivity of the NISQNetwork.

__init__() None
allocate(circ: Circuit, network: NISQNetwork, **kwargs) Distribution

Distribute circ onto network. The distribution is found by KaHyPar using the connectivity metric. All-to-all connectivity of the network of modules is assumed; you may wish to run the refiner BoundaryReallocation on the output Distribution to take the network topology into account.

Parameters:
  • circ (pytket.Circuit) – Circuit to distribute.

  • network (NISQNetwork) – Network onto which circ should be placed.

Key ini_path:

Path to kahypar ini file. Default points to the ini file within the pytket-dqc repository.

Key seed:

Seed for randomness. Default is None

Returns:

Distribution of circ onto network.

Return type:

Distribution

class pytket_dqc.allocators.brute.Brute

Brute force allocator which searches through all placements for the best one.

__init__() None
allocate(circ: Circuit, network: NISQNetwork, **kwargs) Distribution

Distribute quantum circuit by looking at all possible placements and returning the one with the lowest cost.

Parameters:
  • circ (pytket.Circuit) – Circuit to distribute.

  • network (NISQNetwork) – Network onto which circ should be distributed.

Raises:

Exception – Raised if no valid placement could be found.

Returns:

Distribution of circ onto network.

Return type:

Distribution

class pytket_dqc.allocators.random.Random

Distribute hypergraph vertices onto servers at random. The resulting placement is valid, which is to say vertices will not be placed on servers once that are full.

__init__() None
allocate(circ: Circuit, network: NISQNetwork, **kwargs) Distribution

Distribute circ onto network by randomly placing vertices onto servers. Qubit vertices are placed onto servers until the server is full. Gate vertices are placed on servers at random without restriction.

Parameters:
  • circ (pytket.Circuit) – Circuit to distribute.

  • network (NISQNetwork) – Network onto which circ should be distributed.

Returns:

Distribution of circ onto network.

Return type:

Distribution

class pytket_dqc.allocators.ordered.Ordered

Distribute hypergraph vertices onto servers, populating the largest servers first until all vertices are assigned.

__init__() None
allocate(circ: Circuit, network: NISQNetwork, **kwargs) Distribution

Distribute circ onto network by placing quibts onto servers, in decreasing order of size, until they are full.

Parameters:
  • circ (pytket.Circuit) – Circuit to distribute.

  • network (NISQNetwork) – Network onto which circ should be distributed.

Returns:

Distribution of circ onto network.

Return type:

Distribution