uniqc.backend_info module#

Unified backend information data structures.

This module defines the canonical BackendInfo dataclass that all quantum cloud platforms are normalised into, plus helpers for parsing and formatting backend identifiers.

class uniqc.backend_info.BackendInfo(platform, name, description='', num_qubits=0, topology=(), status='unknown', is_simulator=False, is_hardware=False, extra=<factory>, avg_1q_fidelity=None, avg_2q_fidelity=None, avg_readout_fidelity=None, coherence_t1=None, coherence_t2=None)[source]#

Bases: object

Canonical description of a single quantum backend / chip / simulator.

One BackendInfo object corresponds to one real device or cloud simulator exposed by a platform. The object is hashable (frozen) so it can be stored in sets.

Parameters:
avg_1q_fidelity: float | None#
avg_2q_fidelity: float | None#
avg_readout_fidelity: float | None#
coherence_t1: float | None#
coherence_t2: float | None#
description: str#
extra: dict[str, Any]#
classmethod from_dict(d)[source]#
Parameters:

d (dict[str, Any])

Return type:

BackendInfo

full_id()[source]#

Return the globally-unique identifier: platform:name.

Return type:

str

is_hardware: bool#
is_simulator: bool#
name: str#
num_qubits: int#
platform: Platform#
status: str#
to_dict()[source]#
Return type:

dict[str, Any]

topology: tuple[QubitTopology, ...]#
class uniqc.backend_info.Platform(*values)[source]#

Bases: Enum

IBM = 'ibm'#
ORIGINQ = 'originq'#
QUAFU = 'quafu'#
class uniqc.backend_info.QubitTopology(u, v)[source]#

Bases: object

Directed edge in a qubit connectivity graph.

Parameters:
classmethod from_dict(d)[source]#
Parameters:

d (dict[str, Any])

Return type:

QubitTopology

to_dict()[source]#
Return type:

dict[str, int]

u: int#
v: int#
uniqc.backend_info.parse_backend_id(identifier)[source]#

Parse a backend identifier into (Platform, name).

Supports two forms:
  • platform:name (e.g. originq:HanYuan_01)

  • bare name (ambiguous; tries to match across all platforms)

Parameters:

identifier (str) – Full or partial backend identifier.

Returns:

(Platform, backend_name) tuple.

Raises:

ValueError – If the format is invalid or the platform is unknown.

Return type:

tuple[Platform, str]