API reference

Backend

class mimiq_qiskit.MimiqBackend(runner, *, name='mimiq', num_qubits=64, description=None, provider=None)[source]

Qiskit BackendV2 powered by MIMIQ.

Parameters:
  • runner (Any) – A MIMIQ connection, a MIMIQ Backend instance, or a (circuit, *, nsamples, seed) -> QCSResults callable.

  • name (str) – Backend name reported to Qiskit. Defaults to "mimiq".

  • num_qubits (int) – Qubit count advertised on the Target. The MIMIQ cloud handles many more; raise this when transpiling wide circuits against the backend.

  • description (str | None) – Human-readable backend description.

Beyond shots and seed, run accepts MIMIQ-specific options (bonddim, entdim, mpscutoff, mpsmethod, mpotraversal, timelimit, noisemodel, label) which are forwarded to MIMIQ when set.

property max_circuits: int | None

The maximum number of circuits that can be run in a single job.

If there is no limit this will return None

property num_qubits: int

Return the number of qubits the backend has.

run(run_input, **options)[source]

Convert and submit one circuit or a list of circuits to MIMIQ.

Parameters:
  • run_input – A QuantumCircuit or an iterable of them.

  • **optionsshots and seed, plus any of the MIMIQ-specific run options listed on the class. Options set here override the backend defaults for this call.

Return type:

MimiqJob

Returns:

A MimiqJob running the whole batch as one MIMIQ job; call job.result() to block for the qiskit.result.Result.

property target: Target

A qiskit.transpiler.Target object for the backend.

Return type:

Target

class mimiq_qiskit.MimiqJob(backend, *, qiskit_circuits, work, shots, job_id=None)[source]

Background-thread job. One thread per run() call.

work is a zero-argument callable returning the list of QCSResults (one per submitted circuit); the whole batch is one MIMIQ job.

Parameters:
cancel()[source]

Attempt to cancel the job.

Return type:

None

result(timeout=None)[source]

Return the results of the job.

Parameters:

timeout (float | None)

Return type:

Result

status()[source]

Return the status of the job, among the values of JobStatus.

Return type:

JobStatus

submit()[source]

Submit the job to the backend for execution.

Return type:

None

class mimiq_qiskit.MimiqProvider(runner, *, num_qubits=64)[source]

Expose the MIMIQ backend for a single connection or runner.

Example:

from mimiqlink import MimiqConnection
from mimiq_qiskit import MimiqProvider

conn = MimiqConnection(); conn.connect()
provider = MimiqProvider(conn)
backend = provider.get_backend("mimiq")
Parameters:
  • runner (Any)

  • num_qubits (int)

Primitives

Native Qiskit V2 primitives backed by MIMIQ. Prefer these over Qiskit’s generic BackendSamplerV2 / BackendEstimatorV2: the estimator evaluates observables exactly (no shot noise) and both batch a pub’s circuits into a single MIMIQ submission.

class mimiq_qiskit.MimiqSamplerV2(backend, *, default_shots=1024, seed=None, run_options=None)[source]

BaseSamplerV2 that samples bitstrings on MIMIQ.

Parameters:
  • backend – A MimiqBackend, or a connection / MIMIQ backend / runner that MimiqBackend can wrap.

  • default_shots (int) – Shots used for pubs that don’t specify their own.

  • seed – Seed forwarded to MIMIQ. Defaults to the backend’s.

  • run_options – Extra MIMIQ run options (noisemodel, bonddim, …) merged over the backend’s.

run(pubs, *, shots=None)[source]

Run and collect samples from each pub.

Parameters:
  • pubs (Iterable) – An iterable of pub-like objects. For example, a list of circuits or tuples (circuit, parameter_values).

  • shots (int | None) – The total number of shots to sample for each sampler pub that does not specify its own shots. If None, the primitive’s default shots value will be used, which can vary by implementation.

Return type:

PrimitiveJob

Returns:

The job object of Sampler’s result.

class mimiq_qiskit.MimiqEstimatorV2(backend, *, seed=None, run_options=None)[source]

BaseEstimatorV2 that evaluates observables exactly on MIMIQ.

Each observable is converted to a MIMIQ Hamiltonian and its expectation value is computed directly (no measurement sampling), so results carry no shot noise and standard deviations are reported as zero.

Parameters:
  • backend – A MimiqBackend, or anything it can wrap.

  • seed – Seed forwarded to MIMIQ. Defaults to the backend’s.

  • run_options – Extra MIMIQ run options merged over the backend’s.

run(pubs, *, precision=None)[source]

Estimate expectation values for each provided pub (Primitive Unified Bloc).

Parameters:
  • pubs (Iterable) – An iterable of pub-like objects, such as tuples (circuit, observables) or (circuit, observables, parameter_values).

  • precision (float | None) – The target precision for expectation value estimates of each run Estimator Pub that does not specify its own precision. If None the estimator’s default precision value will be used.

Return type:

PrimitiveJob

Returns:

A job object that contains results.

Converters

mimiq_qiskit.qiskit_to_mimiq(qc)[source]

Convert a Qiskit QuantumCircuit to a MIMIQ mimiqcircuits.Circuit.

Parameters:

qc – A Qiskit QuantumCircuit.

Return type:

Circuit

Returns:

A MIMIQ Circuit with operations pushed in the same order.

Raises:

UnsupportedGateError – An operation in qc has no mapping.

mimiq_qiskit.mimiq_to_qiskit(circuit)[source]

Convert a MIMIQ Circuit back to a Qiskit QuantumCircuit.

Gates map onto concrete Qiskit gate classes, so the result is a fully defined circuit that Qiskit can transpile and simulate. The result uses single anonymous quantum and classical registers sized to the circuit; register identity from any original Qiskit circuit is not preserved.

Parameters:

circuit (Circuit)