braket.experimental.algorithms.adaptive_shot_allocation.adaptive_allocator_braket_helpers module
Helper functions to handle quantum measurements and adaptive shot allocation experiments on Amazon Braket.
- braket.experimental.algorithms.adaptive_shot_allocation.adaptive_allocator_braket_helpers.observable_from_string(pauli_string: str) Observable[source]
Convert Pauli string to Braket observable.
- Parameters:
s (str) – Pauli string representation (e.g., “IXYZ”)
- Returns:
Observable – Corresponding Braket observable
- braket.experimental.algorithms.adaptive_shot_allocation.adaptive_allocator_braket_helpers.run_fixed_allocation(device: LocalSimulator | AwsDevice, circuit: Circuit, estimator: AdaptiveShotAllocator, shot_allocation: List[int]) List[List[Dict[Tuple[int, int], int]]][source]
Run experiment with a specific shot allocation.
- Parameters:
device – Quantum device to run the experiment on
circuit – Quantum circuit to measure
estimator – AdaptiveShotAllocator instance containing Pauli terms
shot_allocation – Number of shots to use for each measurement group
- Returns:
MeasurementData – Measurement outcomes for each term pair
- braket.experimental.algorithms.adaptive_shot_allocation.adaptive_allocator_braket_helpers.run_adaptive_allocation(device: LocalSimulator | AwsDevice, circuit: Circuit, estimator: AdaptiveShotAllocator, shots_per_round: int, num_rounds: int, verbose: bool = False) List[List[Dict[Tuple[int, int], int]]][source]
Run adaptive shot allocation process.
- Parameters:
device – Quantum device to run the experiment on
circuit – Quantum circuit to measure
estimator – AdaptiveShotAllocator instance
shots_per_round – Number of shots to allocate in each round
num_rounds – Number of adaptation rounds
verbose – Whether to print progress information
- Returns:
MeasurementData – Final measurement outcomes