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 MIMIQBackendinstance, or a(circuit, *, nsamples, seed) -> QCSResultscallable.name (
str) – Backend name reported to Qiskit. Defaults to"mimiq".num_qubits (
int) – Qubit count advertised on theTarget. The MIMIQ cloud handles many more; raise this when transpiling wide circuits against the backend.description (
str|None) – Human-readable backend description.
Beyond
shotsandseed,runaccepts 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
- run(run_input, **options)[source]¶
Convert and submit one circuit or a list of circuits to MIMIQ.
- Parameters:
run_input – A
QuantumCircuitor an iterable of them.**options –
shotsandseed, plus any of the MIMIQ-specific run options listed on the class. Options set here override the backend defaults for this call.
- Return type:
- Returns:
A
MimiqJobrunning the whole batch as one MIMIQ job; calljob.result()to block for theqiskit.result.Result.
- property target: Target¶
A
qiskit.transpiler.Targetobject 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.workis a zero-argument callable returning the list ofQCSResults(one per submitted circuit); the whole batch is one MIMIQ job.
- 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")
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]¶
BaseSamplerV2that samples bitstrings on MIMIQ.- Parameters:
backend – A
MimiqBackend, or a connection / MIMIQ backend / runner thatMimiqBackendcan 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. IfNone, the primitive’s default shots value will be used, which can vary by implementation.
- Return type:
- Returns:
The job object of Sampler’s result.
- class mimiq_qiskit.MimiqEstimatorV2(backend, *, seed=None, run_options=None)[source]¶
BaseEstimatorV2that evaluates observables exactly on MIMIQ.Each observable is converted to a MIMIQ
Hamiltonianand 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:
- Returns:
A job object that contains results.
Converters¶
- mimiq_qiskit.qiskit_to_mimiq(qc)[source]¶
Convert a Qiskit
QuantumCircuitto a MIMIQmimiqcircuits.Circuit.- Parameters:
qc – A Qiskit
QuantumCircuit.- Return type:
Circuit- Returns:
A MIMIQ
Circuitwith operations pushed in the same order.- Raises:
UnsupportedGateError – An operation in
qchas no mapping.
- mimiq_qiskit.mimiq_to_qiskit(circuit)[source]¶
Convert a MIMIQ
Circuitback to a QiskitQuantumCircuit.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)