qat.core.TopologyType

class qat.core.TopologyType

This class is an enumeration describing the type of a Topology. Currently, there are three types of topologies:

All To All (ALL_TO_ALL)

This type describes topologies for which two-qubit gates can be applied on any pair of qubits

from qat.core import Topology, TopologyType

all_to_all = Topology(type=TopologyType.ALL_TO_ALL)
Linear (LNN)

This type describes topologies for which two-qubit gates can only be applied on qubits having consecutive indexes (i.e. a two-qubit gate can only be applied on the qubits of indexes \(i\) and \(i \pm 1\))

from qat.core import Topology, TopologyType

lnn = Topology(type=TopologyType.LNN)
Custom (CUSTOM)

This type describes a custom topology. Objects of type Topology having a custom topology type must have a graph

from qat.core import Topology, TopologyType

# Init topology
custom = Topology(type=TopologyType.CUSTOM)

# Graph definition
custom.add_edge(0, 1)
custom.add_edge(0, 2)