QMSamplerJob

class QMSamplerJob(backend: QMBackend, pubs: List[SamplerPub], input_type: InputType, **kwargs)[source][source]

Bases: QMPrimitiveJob

Job handle for QMSamplerV2 execution.

Builds a QUA sampler program from pubs and returns classified counts via result(). See program for the compiled QUA source.

Create a sampler job.

Parameters:
  • backend – Backend that compiled the circuits.

  • pubs – Coerced sampler pubs to execute.

  • input_type – How circuit parameters are streamed to the OPX.

  • **kwargs – Additional options forwarded to QUA program generation and backend execution (e.g. shots, meas_level).

submit()[source][source]

Submit the job to the backend.

All QUA programs are first compiled via qm.compile(), then added to the OPX queue via qm.queue.add_compiled(). Separating compilation from execution means the queue never stalls waiting for recompilation of later chunks — all programs are compiled upfront so the OPX can start executing them as soon as the queue is free.

For simulation runs, programs are submitted directly to the simulator (no queue). Results from all chunks are stitched back in _result_function() using the locator built at construction time.

result() PrimitiveResult[SamplerPubResult][source][source]

Build and return classified measurement counts for all pubs.

Returns:

PrimitiveResult with SamplerPubResult entries.