qrisp.interface.Backend.run#

Backend.run(circuits: QuantumCircuit, shots: int | None = None) MeasurementResult[source]#
Backend.run(circuits: Sequence[QuantumCircuit], shots: int | None = None) list[MeasurementResult]

Submit one or more circuits, block until completion, and return results.

This is a synchronous convenience wrapper around run_async(). It calls run_async(), waits for the Job to finish, and returns the measurement results wrapped in MeasurementResult objects. The result type mirrors the input: a single MeasurementResult for a single circuit, or a list of them for a sequence.

Parameters:
circuitsQuantumCircuit or Sequence[QuantumCircuit]

A single circuit or a sequence of circuits to execute.

shotsint or None, optional

Number of shots. If None, the backend’s shots option is used by default.

Returns:
MeasurementResult or list[MeasurementResult]

A pre-populated MeasurementResult when one circuit is submitted, or a list of them for multiple circuits.

Raises:
TypeError

If shots is not an integer.

ValueError

If shots is not a positive integer.