Skip to main content

QpuSampler

Trait QpuSampler 

Source
pub trait QpuSampler {
    type Shots: ShotHistogram;
    type Calibration;

    // Required methods
    fn sample(
        &self,
        circuit: &QuantumCircuit,
        shots: u64,
    ) -> Result<Self::Shots, QuantumError>;
    fn calibration(&self) -> Self::Calibration;
}
Expand description

The generic sampler seam. Implementations return measurement shots as classical ShotHistogram data at the Kleisli cut; no concrete vendor adapter is shipped by this crate. Used only as a bound S: QpuSampler.

Required Associated Types§

Source

type Shots: ShotHistogram

The classical shot histogram this sampler returns.

Source

type Calibration

The device calibration / topology metadata surfaced to the context channel by qpu_effect.

Required Methods§

Source

fn sample( &self, circuit: &QuantumCircuit, shots: u64, ) -> Result<Self::Shots, QuantumError>

Samples shots executions of circuit, returning the classical outcome histogram or a typed failure. Deterministic implementations reproduce the same histogram for the same input.

Source

fn calibration(&self) -> Self::Calibration

The device calibration surfaced at the Kleisli boundary.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§