---
title: simulation (latest version)
description: API reference for qiskit_addon_cutting.utils.simulation in the latest version of qiskit-addon-cutting
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-addon-cutting/utils-simulation
---

# Simulation utilities

`qiskit_addon_cutting.utils.simulation`

Simulation of precise measurement outcome probabilities.

### simulate\_statevector\_outcomes

`simulate_statevector_outcomes(qc, /)`

[GitHub](https://github.com/Qiskit/qiskit-addon-cutting/tree/stable/0.10/qiskit_addon_cutting/utils/simulation.py)

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`](https://docs.python.org/3/library/stdtypes.html#dict)\[[`int`](https://docs.python.org/3/library/functions.html#int), [`float`](https://docs.python.org/3/library/functions.html#float)]

**Parameters**

**qc** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit))

### ExactSampler

*class* `ExactSampler(*, options=None)`

[GitHub](https://github.com/Qiskit/qiskit-addon-cutting/tree/stable/0.10/qiskit_addon_cutting/utils/simulation.py)

Bases: [`BaseSamplerV1`](/docs/api/qiskit/qiskit.primitives.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`](/docs/api/qiskit/primitives#module-qiskit.primitives) and [`qiskit_aer.primitives`](https://qiskit.github.io/qiskit-aer/apidocs/aer_primitives.html#module-qiskit_aer.primitives "(in Qiskit Aer v0.16.1)") do not currently support all of the above functionality. Related upstream issues:

- [https://github.com/Qiskit/qiskit/issues/9657](https://github.com/Qiskit/qiskit/issues/9657)
- [https://github.com/Qiskit/qiskit-aer/issues/1810](https://github.com/Qiskit/qiskit-aer/issues/1810)
- [https://github.com/Qiskit/qiskit-aer/issues/1811](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**](https://docs.python.org/3/library/exceptions.html#ValueError) – Invalid arguments are given.

#### set\_options

`set_options(**fields)`

Set options values for the estimator.

**Parameters**

**\*\*fields** – The fields to update the options
