Simulation utilities (qiskit_addon_cutting.utils.simulation)

Simulation of precise measurement outcome probabilities.

simulate_statevector_outcomes(qc, /)[source]

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:

dict[int, float]

Parameters:

qc (QuantumCircuit)

class ExactSampler(*, options=None)[source]

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:

Parameters:

options (dict | None) – Default options.

property options: Options

Return options values for the estimator.

Returns:

options

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(**fields)

Set options values for the estimator.

Parameters:

**fields – The fields to update the options