Simulation utilities
qiskit_addon_cutting.utils.simulation
Simulation of precise measurement outcome probabilities.
simulate_statevector_outcomes
simulate_statevector_outcomes(qc, /)
Return each classical outcome along with its precise probability.
Circuit can contain mid-circuit, projective measurements.
All gates are supported, along with measurements and reset operations.
Return type
Parameters
qc (QuantumCircuit)
ExactSampler
class ExactSampler(*, options=None)
Bases: BaseSamplerV1
Sampler which returns exact probabilities for each possible outcome.
This sampler supports:
- all unitary gates
- projective measurements, anywhere in the circuit
- reset operations, anywhere in the circuit
- some (or all) classical bits can remain unused
- classical bits can be written more than once
The samplers provided by qiskit.primitives
and qiskit_aer.primitives
do not currently support all of the above functionality. Related upstream issues:
- https://github.com/Qiskit/qiskit/issues/9657
- https://github.com/Qiskit/qiskit-aer/issues/1810
- https://github.com/Qiskit/qiskit-aer/issues/1811
Parameters
options (dict | None) – Default options.
options
Type: Options
Return options values for the estimator.
Returns
options
run
run(circuits, parameter_values=None, **run_options)
Run the job of the sampling of bitstrings.
Parameters
- circuits (QuantumCircuit | Sequence[QuantumCircuit]) – One of more circuit objects.
- parameter_values (Sequence[float] | Sequence[Sequence[float]] | None) – Parameters to be bound to the circuit.
- run_options – Backend runtime options used for circuit execution.
Return type
T
Returns
The job object of the result of the sampler. The i-th result corresponds to circuits[i]
evaluated with parameters bound as parameter_values[i]
.
Raises
ValueError – Invalid arguments are given.
set_options
set_options(**fields)
Set options values for the estimator.
Parameters
**fields – The fields to update the options