qat.core.HardwareSpecs

class qat.core.HardwareSpecs(nbqbits=None, **kwargs)

Simple higher level wrapper for the serializable HardwareSpecs class.

Instance attributes:
  • nbqbits (int): number of qubits

  • topology (Topology): topology

  • gateset (GateSet): the gate set of the hardware

  • description (str): description of the hardware

  • processing_types (list<ProcessingType>): list of supported processing types

as_graph(nqbits=None)

Returns a networkx.Graph object corresponding to the topology. This function calls the method to_nx() of the class Topology

from qat.devices import RIGETTI_ASPEN

# Cast the device into a networkx graph
nx_graph = RIGETTI_ASPEN.as_graph()
Returns

graph describing the topology of this hardware specs

Return type

networkx.Graph

as_quameleon()

Returns a QuameleonPlugin instance enforcing the device’s connectivity for easy inclusion in a QLM stack

from qat.devices import RIGETTI_ASPEN
from qat.qpus import get_default_qpu

# Create a stack
stack = RIGETTI_ASPEN.as_quameleon() | get_default_qpu()
print(stack)
QuameleonPlugin | ScipyMinimizePlugin | CLinalg
Returns

Quameleon plugin

Return type

QuameleonPlugin

dump(fname)

Dumps the HardwareSpecs inside a file in binary format.

Parameters

fname (str) – the file name

classmethod from_thrift(tobject)

Builds a HardwareSpecs object from a thrift object

static load(fname)

Loads a HardwareSpecs from a file.

Parameters

fname (str) – the file name

Returns

HardwareSpecs

property nbqbits

Number of qubits composing the hardware