Running circuits#
Running circuits: one function, many backends.
run(circuit, backend='aer', shots=10000)
Backend strings:
|
Qiskit Aer, ideal. |
|
Aer with the noise model of an IBM fake backend, for example
|
|
Amazon Braket local state-vector simulator (circuit sent as OpenQASM 3; deferred-measurement circuits only). |
|
Braket local density-matrix simulator with depolarising noise p after every gate. |
|
IBM Quantum hardware through the Qiskit Runtime Sampler; needs a saved account. |
|
The least busy operational IBM device. |
|
Amazon Braket managed simulator or QPU; needs AWS credentials; billed. |
run() returns a dict of bit strings to counts in Qiskit’s convention (highest classical bit
first), so the decode functions of quantum_mind.circuits.builders work unchanged for every backend.
Functions
Run a circuit and return counts. |
|
Export a circuit as OpenQASM 3 in Braket's gate names. |
|
Submit a circuit to an IBM device and return counts. |
|
Submit a circuit to an Amazon Braket device and return counts. |
- run(qc, backend='aer', shots=10000, seed=7)[source]#
Run a circuit and return counts.
- Parameters:
- Returns:
dict–{bit string: count}in Qiskit bit order.- Raises:
ValueError – For an unknown backend string.
- to_qasm3(qc)[source]#
Export a circuit as OpenQASM 3 in Braket’s gate names.
The circuit is transpiled to {rz, sx, x, cx, measure};
sxbecomesvandcxbecomescnot, and the stdgates include is removed.- Parameters:
qc (
qiskit.QuantumCircuit)- Returns:
source (
str) – OpenQASM 3 program.transpiled (
qiskit.QuantumCircuit)
- Raises:
ValueError – If the circuit contains a reset (use the deferred-measurement form).
- run_on_ibm_backend(qc, device, shots)[source]#
Submit a circuit to an IBM device and return counts.
Transpiles to the device’s instruction set and runs with the Qiskit Runtime Sampler primitive.