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

MimiqRemoteBackend(connection, *[, ...])

Cloud backend wrapping a mimiqcircuits.remote.RemoteConnection.

class mimiqcircuits.backends.remote.MimiqRemoteBackend(connection, *, algorithm='auto', label=None, poll_interval=1.0)[source]

Bases: RemoteBackend

Cloud backend wrapping a mimiqcircuits.remote.RemoteConnection.

Construct with an authenticated connection (or any object that exposes callable submit(...) and get_results(...) methods). The constructor pins the simulator algorithm (which in turn shapes capabilities()) and the label / poll cadence; all other server knobs (bonddim, entdim, mpscutoff, mpsmethod, mpotraversal, timelimit, noisemodel) are passed at submit() / execute() time.

Caveats:

  1. Capabilities are synthesised client-side. The server has no capability endpoint yet, so capabilities() returns a conservative best-guess (_BASE_REMOTE_CAPABILITIES plus algorithm-conditional MPS tokens).

  2. ``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-empty passes= with the default strict_pass_order=True raises RemotePassOrderError. Opt out with strict_pass_order=False: recognised passes are translated into legacy knobs and unrecognised ones are dropped with a single UserWarning.

  3. ``param_grid=`` raises NotImplementedError. Loop on the client side instead:

    for params in grid:
        backend.execute(c.evaluate(params), nsamples=n, seed=...)
    
  4. ``noisemodel=`` and ``ApplyNoiseModelPass`` are mutually exclusive. Specifying both raises ValueError.

  5. ``_MimiqJob.wait()`` blocks indefinitely by default. Pass timeout=<seconds> for a bounded wait that raises TimeoutError.

  6. ``seed=`` / ``rng=`` are mutually exclusive. The wire seed is a deterministic xor-fold of the four-stream RNGs bundle derived from your input, not literally the integer passed in.

  7. The connection must be authenticated (conn.connect() called) before the first execute(). The constructor does not trigger interactive auth, so an unauthenticated connection produces a 401 at submit time.

  8. Output shape mirrors input: a single Circuit returns a single QCSResults; a list returns a list of matching length.

  9. ``algorithm=”statevector”`` + ``noisemodel=`` is a server-side runtime error — state-vector cannot apply Kraus — and there is currently no client-side guard.

  10. ``algorithm=”statevector”`` makes MPS knobs meaningless (bonddim=, entdim=, mpscutoff=, mpsmethod=, mpotraversal=, BondDim / SchmidtRank instructions). capabilities() correctly omits :bond_dim / :schmidt_rank in that mode and limits() returns max_bond_dim=None, but submit() 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)
__init__(connection, *, algorithm='auto', label=None, poll_interval=1.0)[source]
property name: str
property version: str
capabilities()[source]

Synthesised client-side. Tensor-network annotations (:bond_dim, :schmidt_rank) are declared only when the configured algorithm admits MPS execution.

limits()[source]

Static client-side limits. max_bond_dim is dropped on state-vector deployments where bond dimension is meaningless.

topology()[source]
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 circuits to the remote server.

Returns a _MimiqJob. Calling job.wait() blocks until results are available and post-processes QCSResults.fidelities into typed Fidelity instances.

execute(circuit, *, nsamples=1000, seed=None, rng=None, passes=None, callback=None, param_grid=None, strict_pass_order=True, **kwargs)[source]

Submit circuit to the cloud and wait for results.

seed and rng are mutually exclusive sources of randomness. Submit-time tuning options (bonddim, entdim, mpscutoff, mpsmethod, mpotraversal, timelimit, noisemodel) pass through to submit().

Output shape mirrors input: a single Circuit returns a single QCSResults; list[Circuit] returns list[QCSResults].

To request specific amplitudes, push Amplitude instructions into circuit and read results.zstates.