qrunch.quantum.groupers.shot_distributors.shot_distributors_protocols

Module containing protocols for shot distributors.

Classes

ShotDistributor

Represent a strategy for generating a probability distribution over groups.

class ShotDistributor

Bases: Protocol

Represent a strategy for generating a probability distribution over groups.

This distribution can be used to allocate measurement shots to different groups of Pauli strings.

__init__(*args, **kwargs)
distribute_shots(groups: Sequence[PartialMeasurementGroup], total_shots: int | None) tuple[MeasurementGroup, ...]

Allocate measurement shots to each group based on the built distribution.

Parameters:
  • groups (Sequence[PartialMeasurementGroup]) – A list of Hermitian Pauli sum groups.

  • total_shots (int | None) – The total number of measurement shots to allocate.

Return type:

tuple[MeasurementGroup, …]