---
title: QuantumProgram (latest version)
description: API reference for qiskit_ibm_runtime.quantum_program.QuantumProgram in the latest version of qiskit-ibm-runtime
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-ibm-runtime/quantum-program-quantum-program
---

# QuantumProgram

*class* `QuantumProgram(shots, items=None, noise_maps=None, meas_level='classified', passthrough_data=None)`

[GitHub](https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.49/qiskit_ibm_runtime/quantum_program/quantum_program.py#L211-L338)

Bases: `object`

A quantum runtime executable.

A quantum program consists of a list of ordered elements, each of which contains a single circuit and an array of associated parameter values. Executing a quantum program will sample the outcome of each circuit for the specified number of `shots` for each set of circuit arguments provided.

**Parameters**

- **shots** (*int*) – The number of shots for each circuit execution.

- **items** (*Iterable\[*[*QuantumProgramItem*](/docs/api/qiskit-ibm-runtime/quantum-program-quantum-program-item "qiskit_ibm_runtime.quantum_program.QuantumProgramItem")*] | None*) – Items that comprise the program.

- **noise\_maps** (*dict\[str, PauliLindbladMap] | None*) – Noise maps to use with samplex items.

- **meas\_level** (*Literal\['classified', 'kerneled', 'avg\_kerneled', 'both']*) –

  The level at which to return all classical register measurement results. This value sets the return type of all classical registers in all quantum program items and determines whether the raw complex data from low-level measurement devices is discriminated into bits or not. The supported values are

  > - **”classified”: Classical register data is returned as boolean arrays with the**
  >
  >   intrinsic shape `(num_shots, creg_size)`.
  >
  > - **”kerneled”: Classical register data is returned as a complex array with the**
  >
  >   intrinsic shape `(num_shots, creg_size)`, where each entry represents an IQ data point (resulting from kerneling the measurement trace) in arbitrary units.
  >
  > - **”avg\_kerneled”: Classical register data is returned as a complex array with the**
  >
  >   intrinsic shape `(creg_size,)`, where data is equivalent to “kerneled” except additionally averaged over shots.

  passthrough\_data: Arbitrary nested data passed through execution without modification.

- **passthrough\_data** (*DataTree | None*)

## Methods

### append\_circuit\_item

`append_circuit_item(circuit, *, circuit_arguments=None, chunk_size=None)`

[GitHub](https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.49/qiskit_ibm_runtime/quantum_program/quantum_program.py#L259-L283)

Append a new [`CircuitItem`](/docs/api/qiskit-ibm-runtime/quantum-program-circuit-item "qiskit_ibm_runtime.quantum_program.CircuitItem") to this program.

**Parameters**

- **circuit** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – The circuit of this item.
- **circuit\_arguments** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) – A real-valued array of parameter values for the circuit. The last axis is intrinsic with size equal to the number of circuit parameters. Leading axes are extrinsic and define the sweep grid.
- **chunk\_size** (*int | None*) – The maximum number of bound circuits in each shot loop execution, or `None` to use a server-side heuristic to optimize speed. When not executing in a session, the server-side heuristic is always used and this value is ignored.

**Return type**

None

### append\_samplex\_item

`append_samplex_item(circuit, *, samplex, samplex_arguments=None, shape=None, chunk_size=None)`

[GitHub](https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.49/qiskit_ibm_runtime/quantum_program/quantum_program.py#L285-L329)

Append a new [`SamplexItem`](/docs/api/qiskit-ibm-runtime/quantum-program-samplex-item "qiskit_ibm_runtime.quantum_program.SamplexItem") to this program.

**Parameters**

- **circuit** (*QuantumCircuit*) – The circuit of this item.
- **samplex** (*Samplex*) – A samplex to draw random parameters for the circuit.
- **samplex\_arguments** (*dict\[str, Any] | None*) – A map from argument names to argument values for the samplex. Each argument array has intrinsic axes determined by its type (e.g., `parameter_values` has intrinsic shape `(n,)` for `n` parameters). The extrinsic shapes of all arguments are broadcasted together.
- **shape** (*tuple\[int, ...] | None*) – A shape that the item’s extrinsic shape must be broadcastable to. Axes where `shape` exceeds the shape implicit in `samplex_arguments` enumerate independent randomizations.
- **chunk\_size** (*int | None*) – The maximum number of bound circuits in each shot loop execution, or `None` to use a server-side heuristic to optimize speed. When not executing in a session, the server-side heuristic is always used and this value is ignored.

**Return type**

None
