Expand description
Execution backend abstractions for the Libket quantum computing library.
This module defines the traits and data types that decouple the compiler front-end from the concrete quantum hardware or simulator backend:
LiveExecution: a backend that receives gates one at a time and returns measurement results immediately (mid-circuit feedback). Use this mode when the circuit outcome influences subsequent gate choices (e.g., adaptive circuits, mid-circuit resets).BatchExecution: a backend that receives a fully-compiled native gate sequence and returns aggregate results (histograms, expectation values). Use this mode for variational algorithms, sampling, and expectation-value estimation where the full circuit is known upfront.NativeGateSet: an optional translation layer that maps the Libket gate IR to a hardware-specific gate vocabulary. If omitted, the built-inRzRyCXtranslation is used, which emitsrz,ry, andcnotnative gates.QuantumExecution: the union of both execution modes, stored inside acrate::process::Process.
§Error handling
All trait methods return Result<_, KetError>. Backends should return
KetError::ExecutionFailed for unrecoverable hardware faults and
KetError::ShotCountInvalid when a requested shot count is out of range.
Structs§
- Dump
Data - The quantum-state snapshot returned by a
dumpoperation.
Enums§
- ExpValue
Strategy - Strategy for computing expectation values in batch mode.
- Gradient
Strategy - Strategy for computing parameter-shift gradients.
- Quantum
Execution - The execution target attached to a
crate::process::Process.
Traits§
- Batch
Execution - A backend that receives a fully-compiled gate sequence and returns aggregate results without mid-circuit feedback.
- Live
Execution - A backend that executes gates as they arrive and can return mid-circuit measurement results immediately.
- Native
Gate Set - Translates Libket IR gates into hardware-specific native gate sequences.
Type Aliases§
- BitString
- A bit-string measurement outcome encoded as a vector of 64-bit words.
- Native
Gate - A hardware-native gate:
(name, angles, qubit_indices). - RzRyCX
- The {RZ, RY, CNOT} native gateset.
- Sample
Data - The result of a
sampleoperation:(bit_strings, counts).