POVMSampler¶
- class POVMSampler(sampler: BaseSamplerV2)[source]¶
Bases:
object
A
BaseSamplerV2
-compatible interface for sampling POVMs.Initialize the POVM Sampler.
- Parameters:
sampler (BaseSamplerV2) – the
BaseSampler
that will be used to collect the POVM samples.
Methods
- run(pubs: Iterable[QuantumCircuit | tuple[QuantumCircuit] | tuple[QuantumCircuit, Mapping[Parameter | str | Tuple[Parameter | str, ...], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]]] | tuple[QuantumCircuit, Mapping[Parameter | str | Tuple[Parameter | str, ...], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]], Integral | None] | tuple[QuantumCircuit, Mapping[Parameter | str | Tuple[Parameter | str, ...], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]], Integral | None, POVMImplementation | None]], *, shots: int | None = None, povm: POVMImplementation | None = None, pass_manager: StagedPassManager | None = None) POVMSamplerJob [source]¶
Run and collect samples from each pub.
- Parameters:
pubs (Iterable[QuantumCircuit | tuple[QuantumCircuit] | tuple[QuantumCircuit, Mapping[Parameter | str | Tuple[Parameter | str, ...], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]]] | tuple[QuantumCircuit, Mapping[Parameter | str | Tuple[Parameter | str, ...], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]], Integral | None] | tuple[QuantumCircuit, Mapping[Parameter | str | Tuple[Parameter | str, ...], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]], Integral | None, POVMImplementation | None]]) – An iterable of pub-like objects. For example, a list of circuits or tuples
(circuit, parameter_values, shots, povm)
.shots (int | None) – The total number of shots to sample for each pub that does not specify its own shots. If
None
, the default number of shots of the POVM sampler is used.povm (POVMImplementation | None) – A POVM implementation that defines the measurement to perform for each pub that does not specify it own POVM. If
None
, each pub has to specify its own POVM.pass_manager (StagedPassManager | None) – An optional pass manager. For each pub, its circuit will be composed with the associated measurement circuit. If a pass manager is provided, it will transpile the composed circuits.
- Returns:
The POVM sampler job object.
- Return type: