uniqc.backend_adapter.task.adapters.tianyan_adapter module¶
TianYan (天衍) backend adapter.
Submits QCIS circuits to the TianYan quantum cloud platform using cqlib.
- Installation:
pip install unified-quantum[tianyan]
- uniqc.backend_adapter.task.adapters.tianyan_adapter.TIANYAN_SIMULATOR_NAMES = frozenset({'tianyan_s', 'tianyan_sa', 'tianyan_sw', 'tianyan_tn', 'tianyan_tnn'})¶
Cloud simulator machine names reported by the platform.
- class uniqc.backend_adapter.task.adapters.tianyan_adapter.TianyanAdapter(machine_name=None)[source]¶
Bases:
QuantumAdapterAdapter for the TianYan quantum cloud platform (天衍) using cqlib.
Credentials are read from
uniqc.config.load_tianyan_config()(tianyan.login_key). Both the cqlib SDK import and the credential load are lazy so that importing this module never requires the SDK or a configured account.Note
The cqlib package is required for this adapter. Install with: pip install unified-quantum[tianyan]
- dry_run(originir, *, shots=1000, **kwargs)[source]¶
Dry-run validation for TianYan backends.
Validates offline: OriginIR parses, all gates map to QCIS, and qubit indices fit the
QINITsize. Makes NO network calls and does not require cqlib or credentials.Note
Any dry-run success followed by actual submission failure is a critical bug. Please report it at the UnifiedQuantum issue tracker.
- get_chip_characterization(chip_name)[source]¶
Return per-qubit and per-pair calibration data for a TianYan machine.
Uses cqlib’s authenticated
download_configendpoint. (The unauthenticatedget_machine_config/gplot endpoint sits behind a web-application firewall and is not usable from SDK clients.)- Parameters:
chip_name – TianYan machine name, e.g.
"tianyan176".- Returns:
None when cqlib is unavailable or the machine config cannot be downloaded.
- Return type:
ChipCharacterization or None
- list_backends()[source]¶
Return raw TianYan machine metadata.
query_quantum_computer_list()returns rows of[id, price, status, name](e.g.['1764555284795101186', 'free', 'running', 'tianyan176']). Known simulator machines are appended when the API omits them.- Returns:
name,available,status,machine_id,price,is_simulator,num_qubits,num_qubits_source.- Return type:
List of dicts with keys
num_qubitsis the machine’s live qubit count fromdownload_configwhenever that authenticated call succeeds (num_qubits_source == "live_config"); otherwise it falls back to the digits embedded in the machine name (num_qubits_source == "machine_name"), which is the model name, not necessarily the online qubit count (e.g. tianyan176 has had 66 qubits online).
- max_native_batch_size = 1¶
- name = 'tianyan'¶
- query(taskid)[source]¶
Query a single task’s status (non-blocking).
- Parameters:
taskid – cqlib query_id.
- Returns:
taskid, status, result (counts dict when status is
'success', error payload when'failed').- Return type:
dict with keys
- query_batch(taskids)[source]¶
Query multiple tasks and merge results.
Overall status is the worst case:
failed>running>success.
- submit(circuit, *, shots=1000, **kwargs)[source]¶
Submit a single circuit to TianYan.
- Parameters:
circuit – QCIS text (as produced by
TianyanCircuitAdapter). OriginIR input (detected by itsQINITheader) is translated first for convenience.shots – Number of measurement shots.
**kwargs – Additional options: - machine_name: Target machine (e.g.
"tianyan176") - task_name / exp_name: Optional experiment name - lab_id: Optional lab id passed through to cqlib
- Returns:
cqlib query_id string.