qrisp.QuantumCircuit.run#

QuantumCircuit.run(shots=10000, backend=None)[source]#

Runs a QuantumCircuit on a given backend.

Parameters
shotsint, optional

The amount of shots to perform. The default is 10000.

backendBackendClient, optional

The backend on which to evaluate the QuantumCircuit. The default is None.

Returns
dict

The resulting counts for the given QuantumCircuit.

Examples

We create a GHZ QuantumCircuit and evaluate the results.

>>> from qrisp import QuantumCircuit
>>> qc = QuantumCircuit(5)
>>> qc.h(0)
>>> qc.cx(0, range(1,5))
>>> qc.measure(range(5))
>>> qc.run()
{'0': 5000, '1': 5000}