uniqc.backend_adapter.task.adapters.logicalqubit_adapter module¶
LogicalQubit (逻辑比特) backend adapter.
Submits circuits to the LogicalQubit cloud platform using lqcloud.
- Installation:
pip install unified-quantum[logicalqubit]
- class uniqc.backend_adapter.task.adapters.logicalqubit_adapter.LogicalQubitAdapter(backend_name=None)[source]¶
Bases:
QuantumAdapterAdapter for the LogicalQubit cloud platform (逻辑比特) using lqcloud.
Credentials are read from
uniqc.config.load_logicalqubit_config()(logicalqubit.api_key, optionallogicalqubit.url). Both the lqcloud SDK import and the credential load are lazy so that importing this module never requires the SDK or a configured account.Note
The lqcloud package is required for this adapter. Install with: pip install unified-quantum[logicalqubit]
- dry_run(originir, *, shots=1000, **kwargs)[source]¶
Dry-run validation for LogicalQubit backends.
Validates offline: OriginIR parses and maps onto lqcloud gates, and the shot count fits the server limit. lqcloud’s
QuantumCircuitconstruction is purely local — this method makes NO network calls.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 topology-level characterization for a LogicalQubit backend.
lqcloud’s
get_backend_configexposes the qubit count and the coupling map but no T1/T2 or fidelity calibration data, so the returnedChipCharacterizationcarries connectivity only (per-qubit fields are left as None).- Parameters:
chip_name – LogicalQubit backend name, e.g.
"QZ01-repetition_code".- Returns:
None when lqcloud is unavailable or the backend config cannot be fetched.
- Return type:
ChipCharacterization or None
- list_backends()[source]¶
Return raw LogicalQubit backend metadata.
LQCloudProvider.get_backends()returns a list of dicts, each carrying at least a"name"key. Entries are passed through withnamenormalised tostr; the registry normaliser handles the rest.
- max_native_batch_size = 1¶
- name = 'logicalqubit'¶
- query(taskid)[source]¶
Query a single task’s status.
- Parameters:
taskid – lqcloud job 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 LogicalQubit.
- Parameters:
circuit – lqcloud QuantumCircuit (as produced by
LogicalQubitCircuitAdapter). OriginIR input (detected by itsQINITheader) is translated first for convenience.shots – Number of measurement shots (server limit: 50000).
**kwargs – Additional options: - backend_name: Target backend name
- Returns:
lqcloud job id string.
- uniqc.backend_adapter.task.adapters.logicalqubit_adapter.MAX_SHOTS = 50000¶
Server-side shot limit advertised by the lqcloud platform.