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 callsrun_async(), waits for theJobto finish, and returns the measurement results wrapped inMeasurementResultobjects. The result type mirrors the input: a singleMeasurementResultfor a single circuit, or alistof 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’sshotsoption is used by default.
- Returns:
- MeasurementResult or list[MeasurementResult]
A pre-populated
MeasurementResultwhen 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.