mimiqcircuits.backends.remote¶
Concrete RemoteBackend for the MIMIQ cloud service.
MimiqRemoteBackend wraps a
mimiqcircuits.remote.RemoteConnection so cloud execution looks
like every other backend: it advertises a capability set, accepts the
same seed / rng / passes arguments as the local simulators,
and returns the same mimiqcircuits.QCSResults. Submit-level
options like bonddim / mpscutoff are forwarded to
MimiqRemoteBackend.submit().
Classes
|
Cloud backend wrapping a |
- class mimiqcircuits.backends.remote.MimiqRemoteBackend(connection, *, algorithm='auto', label=None, poll_interval=1.0)[source]¶
Bases:
RemoteBackendCloud backend wrapping a
mimiqcircuits.remote.RemoteConnection.Construct with an authenticated connection (or any object that exposes callable
submit(...)andget_results(...)methods). The constructor pins the simulatoralgorithm(which in turn shapescapabilities()) and the label / poll cadence; all other server knobs (bonddim,entdim,mpscutoff,mpsmethod,mpotraversal,timelimit,noisemodel) are passed atsubmit()/execute()time.Caveats:
Capabilities are synthesised client-side. The server has no capability endpoint yet, so
capabilities()returns a conservative best-guess (_BASE_REMOTE_CAPABILITIESplus algorithm-conditional MPS tokens).``pass_order_honored`` is not declared. The server takes a flat bag of booleans (
remove_swaps,fuse, …) with no notion of pipeline order. A non-emptypasses=with the defaultstrict_pass_order=TrueraisesRemotePassOrderError. Opt out withstrict_pass_order=False: recognised passes are translated into legacy knobs and unrecognised ones are dropped with a singleUserWarning.``param_grid=`` raises
NotImplementedError. Loop on the client side instead:for params in grid: backend.execute(c.evaluate(params), nsamples=n, seed=...)
``noisemodel=`` and ``ApplyNoiseModelPass`` are mutually exclusive. Specifying both raises
ValueError.``_MimiqJob.wait()`` blocks indefinitely by default. Pass
timeout=<seconds>for a bounded wait that raisesTimeoutError.``seed=`` / ``rng=`` are mutually exclusive. The wire seed is a deterministic xor-fold of the four-stream
RNGsbundle derived from your input, not literally the integer passed in.The connection must be authenticated (
conn.connect()called) before the firstexecute(). The constructor does not trigger interactive auth, so an unauthenticated connection produces a 401 at submit time.Output shape mirrors input: a single
Circuitreturns a singleQCSResults; a list returns a list of matching length.``algorithm=”statevector”`` + ``noisemodel=`` is a server-side runtime error — state-vector cannot apply Kraus — and there is currently no client-side guard.
``algorithm=”statevector”`` makes MPS knobs meaningless (
bonddim=,entdim=,mpscutoff=,mpsmethod=,mpotraversal=,BondDim/SchmidtRankinstructions).capabilities()correctly omits:bond_dim/:schmidt_rankin that mode andlimits()returnsmax_bond_dim=None, butsubmit()still forwards the kwargs to the server, which is canonical.
Example:
import mimiqcircuits as mc conn = mc.MimiqConnection() conn.connect() backend = mc.backends.MimiqRemoteBackend(conn, algorithm="mps") results = backend.execute(circuit, nsamples=1000, seed=42, bonddim=64)
- capabilities()[source]¶
Synthesised client-side. Tensor-network annotations (
:bond_dim,:schmidt_rank) are declared only when the configuredalgorithmadmits MPS execution.
- limits()[source]¶
Static client-side limits.
max_bond_dimis dropped on state-vector deployments where bond dimension is meaningless.
- submit(circuits, nsamples=1000, *, rngs=None, passes=None, callback=None, param_grid=None, strict_pass_order=True, bonddim=None, entdim=None, mpscutoff=None, mpsmethod=None, mpotraversal=None, timelimit=None, noisemodel=None, **kwargs)[source]¶
Submit
circuitsto the remote server.Returns a
_MimiqJob. Callingjob.wait()blocks until results are available and post-processesQCSResults.fidelitiesinto typedFidelityinstances.
- execute(circuit, *, nsamples=1000, seed=None, rng=None, passes=None, callback=None, param_grid=None, strict_pass_order=True, **kwargs)[source]¶
Submit
circuitto the cloud and wait for results.seedandrngare mutually exclusive sources of randomness. Submit-time tuning options (bonddim,entdim,mpscutoff,mpsmethod,mpotraversal,timelimit,noisemodel) pass through tosubmit().Output shape mirrors input: a single
Circuitreturns a singleQCSResults;list[Circuit]returnslist[QCSResults].To request specific amplitudes, push
Amplitudeinstructions intocircuitand readresults.zstates.