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
): topologygateset (
GateSet
): the gate set of the hardwaredescription (str): description of the hardware
processing_types (list<
ProcessingType
>): list of supported processing typesmeta_data (dict<str, str>): meta data to provide some custom data of the QPU to users
- as_graph(nqbits=None)
Returns a
networkx.Graph
object corresponding to the topology. This function calls the methodto_nx()
of the classTopology
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 stackfrom 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)
Traceback (most recent call last): File "<stdin>", line 6, in <module> File "qpu.py", line 403, in qat.core.qpu.qpu.CommonQPU.__str__ AttributeError: 'QuameleonPlugin' object has no attribute 'plugins'
- Returns
Quameleon plugin
- Return type
- 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
- property nbqbits
Number of qubits composing the hardware