Quickstart¶
Cloud execution¶
Authenticate against the MIMIQ cloud, wrap the connection in a
MimiqBackend, and run a familiar
QuantumCircuit:
from qiskit import QuantumCircuit
from mimiqlink import MimiqConnection
from mimiq_qiskit import MimiqBackend
conn = MimiqConnection()
conn.connect()
backend = MimiqBackend(conn)
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
job = backend.run(qc, shots=1000)
counts = job.result().get_counts()
The job is executed in a background thread, so backend.run returns
immediately. Block for completion by calling job.result().
Provider helper¶
When you want a Qiskit-style provider entry point:
from mimiq_qiskit import MimiqProvider
provider = MimiqProvider(conn)
backend = provider.get_backend("mimiq")
Batching¶
Pass a list of circuits to run them in one submission:
result = backend.run([qc_a, qc_b, qc_c], shots=2000).result()
counts_a = result.get_counts(0)
MIMIQ run options¶
run forwards MIMIQ-specific options that have no Qiskit equivalent.
Circuit preparation happens before the state is evolved:
fuse/fuse_threshold— merge runs of adjacent unitary gates into wider blocks, skipping circuits narrower than the threshold.canonicaldecompose— decompose the circuit to MIMIQ’s canonical gate basis.reorderqubits— relabel qubits so interacting ones sit close together.Trueasks for the backend’s default search, a name such as"greedy"or"sa"pins one,Falseturns it off.remove_swaps— rewrite trailing swaps into a relabelling (cloud only).simplify— reduce the circuit while keeping its unitary exactly (cancel inverses, merge rotations, resynthesize small blocks). Off unless asked for; local backends only, the cloud refuses it for now.
On a local backend each of these adjusts the backend’s own preparation
rather than replacing it: an option left unset keeps what the backend does
by default, False drops that pass, and any other value installs the
backend’s own pass of that kind. So backend.run(qc, reorderqubits=False)
turns off the backend’s default reordering, and keeps everything else.
The rest tune the simulator or the job itself: bonddim, entdim,
mpscutoff, mpsmethod, mpotraversal for the MPS engine, plus
timelimit, noisemodel, and label.
job = backend.run(qc, shots=1000, fuse=True, bonddim=256)
Options left unset are not sent, so MIMIQ applies its own defaults. Note
that a local mimiqcircuits backend accepts only the preparation
knobs; passing a cloud-only option to one raises TypeError.