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: QuantumAdapter

Adapter for the LogicalQubit cloud platform (逻辑比特) using lqcloud.

Credentials are read from uniqc.config.load_logicalqubit_config() (logicalqubit.api_key, optional logicalqubit.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 QuantumCircuit construction 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_config exposes the qubit count and the coupling map but no T1/T2 or fidelity calibration data, so the returned ChipCharacterization carries 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

is_available()[source]

Return True if lqcloud is installed and an api_key is configured.

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 with name normalised to str; 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 its QINIT header) 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.

submit_batch(circuits, *, shots=1000, **kwargs)[source]

Submit circuits one by one (one job id per circuit).

lqcloud’s batch API returns a single aggregate Job without child ids, so uniqc slices batches into per-circuit jobs (max_native_batch_size == 1).

translate_circuit(originir)[source]

Convert an OriginIR string to an lqcloud QuantumCircuit (local).

Parameters:

originir – OriginIR format circuit string.

Returns:

lqcloud QuantumCircuit object.

uniqc.backend_adapter.task.adapters.logicalqubit_adapter.MAX_SHOTS = 50000

Server-side shot limit advertised by the lqcloud platform.