Release notes#
Every change to cosmiq comes with a release note, written with
reno in the repository’s releasenotes/notes/. This page is
generated from them at each build, newest version first. 0.1.0 is the first release.
0.1.0#
Prelude#
Version 0.1.0, the first release of cosmiq: neutral-atom programs as PyTorch modules, checked against a device as you build them; an emulator with exact gradients and the device’s noise; the digital path and Qiskit; PennyLane devices; the algorithm library; QEC with atom loss; exports to Braket and Pulser; remote jobs and the runtime. The notes below list what it ships. It’s alpha: the API may still change between minor releases, always with a deprecation first (CONTRIBUTING.md). Remote jobs and remote runs aren’t open to the public yet:
cq.remote.local()andtrain.localrun the same code on your machine. The bundled devices’ capabilities version is 2.0.0.
New features#
The algorithm library (
cosmiq.library, docs/library.md).graphs:Graph, thekings,squareandtriangularlattices with a filling mask, andfrom_positions, each refused unless every edge has \(V \ge 2.5\,\Omega\) and every non-edge \(V \le 0.5\,\Omega\) at the drive’s \(\Omega\).mis: the standard sweep inside cosmiq-ref-1’s limits, greedy repair then fill,exact_sizeandcount_setsup to 24 vertices, andreport.reservoir: windowed global-detuning segments with exact or sampled \(\langle n_i \rangle\) and \(\langle n_i n_j \rangle\), a torchRidge,poly_featuresandnarma2.iqp(theqiskitextra): Qiskit’siqpandzz_feature_mapon the register’s CZ graph, their distribution on the digital path’s simulator, and the fidelity kernel, exact or throughSamplerV2.New refusals, each by name:
LIB_MARGIN(a lattice or positions whose unit-disk graph isn’t clean at the drive’s \(\Omega\)),LIB_SIZE(exact answers above 24 vertices) andLIB_CZ_GRAPH(an IQP interaction off the register’s CZ pairs).cosmiq.AnalogProgram: a neutral-atom program as atorch.nn.Module. Subclasses implementdrive(self, *inputs);forward(*inputs)returns theSchedule, soprogram(x),nn.Sequential,torch.func.functional_calland forward hooks all work, and the batch axis comes from the inputs.to_target(device, strict=False)binds a device (program.targetholds itsDeviceSpec), rounds the register onto the device’s position grid and checks it at once, and runs a trial evaluation whendrive()takes no inputs. On any error it leaves the program as it was. A targeted program discretises every evaluation onto the device’s grid, checks it, and raisesConstraintErrorlisting the violations. The rules that depend only on the register and the times are checked once per skeleton, so repeated evaluations check only the values.AnalogProgram.reportis theDiscretizationReportof the last schedule a targeted evaluation returned.Violations of value rules name the parameters and inputs behind the bad value, found with
torch.autograd.gradon the error path only. A slew (R10) names the sources of both ends of its segment. Without an autograd graph (no_grad,inference_mode, frozen parameters,functional_callwith plain tensors) they read “unknown (evaluated without autograd)”.cosmiq.program(register, drive_fn, parameters), the functional form, registers its parameters in annn.ParameterDictnamedparams(floats become float64 parameters).cosmiq.boundedandcosmiq.Bounded: a value kept inside its limits by a sigmoid (or a softplus, with one limit). A"device"limit is read from the target’s spec atfieldwhen the program is targeted, and moved onto the device’s grid (the largest multiple of the resolution inside a maximum, the smallest inside a minimum), so rounding can’t push the value over. Retargeting keeps the current value, and the limits are saved instate_dict.Emulator(space="blockade"), the blockade fast mode: local SW3 at r_c = 2 in the blockade subspace, one Chebyshev expansion per 20 ns cell (not the device’s 4 ns clock), read in the lab frame through the first-order \(e^{-S_1}\). It runs only on the cells that were tested and passed: chains of 8, 12, 16, 20, 24 and 28 atoms (no lengths in between), the triangular patches 3x3 to 5x7 and the square lattices 3x4 to 4x6 at 4.8 µm, andblockade="kings"on 3x3 to 4x6 at (4.8 µm, \(\Omega\) 3.4), (5.2, 2.2) and (5.6, 1.4); the standard sweep, the constant drive, the kings programs, one phase step at exactly 2 µs and the six-knot gradient layout, each at its tested sizes, precisions and observables (the table in docs/emulator.md). A program matches a class as a function of time, not on the 20 ns cells. Everything else is refused with a CapabilityError naming the limit, the gradient layout on tri 3x3 (it missed the 1e-3 density rule against the 4 ns clock) and on square 4x6 (its Jacobians weren’t run) included. No error estimate is computed or shown. Every batch row passes the regime check (\(\kappa = 10\)) and, with a phase step, the 1e-4 jump rule before any row runs. Gradients of final densities with respect to the gradient layout’s six knots come from autograd, checkpointed cell by cell. complex128 runs on the CPU at every cell, and on CUDA only at the cells the GPU validation session passed (\(N \ge 24\)), with a phase step only inside the program it was tested in there (the constant drive on chain, tri and kings); on CUDA, square 4x6’s sweep and a step inside it are refused by name (the sweep had no case of its own there), so nothing runs on square registers on CUDA. complex64 runs on CUDA only, in densities only, at chain 24 and 28 (the sweep at 24 only) and tri 24, 28 and 32. T3 readout errors are the only noise, and on the CPU only (refused on CUDA). It runs only throughEmulator.runin your process: a job carries no space, socq.remotesessions (andcq.remote.local()) and thecosmiq.remotePennyLane device refuse anEmulator(space="blockade")with aRemoteErrorof codeblockade_local_only.cq.bounded(..., mode="clamp")stores the value itself, inside closed limits, for an optimum that lies on a limit (full \(\Omega\), for example). Project it after each optimiser step withcq.project_(program), or withcq.project_(program, after=optimizer), which does it after everyoptimizer.step()and returns the hook’s handle. A clamp-mode value left outside its limits raisesFormatErrorwhen it’s called.mode="sigmoid"is the default. ABoundedvalue’sstate_dictrecords its mode; loading one into a value of the other mode raisesFormatError.A device spec’s calibration keys are a fixed vocabulary, each with its unit and range (
cosmiq.emulator.NoiseModel.KEYSlists them). A spec with an unknown key ("spam.false_postive"), a value in another unit, or a value out of range doesn’t load; the error names the key, and suggests the nearest known one. Units may write µ asu,µorμ. The committedschemas/device-1.jsonlists the known keys (propertyNames), so an external validator refuses what the loader refuses.Calibration.valid_fromandvalid_untilare timezone-awaredatetimeobjects in UTC, parsed from ISO 8601 text (a time zone is required), and written back as2026-10-25T00:00:00Z, so a device document round-trips byte for byte. The committedschemas/device-1.jsonmarks themdate-time.valid_untilmust be aftervalid_from.cosmiq.units.format_frequency(value, versus=None): given the value it’s shown beside, the MHz part gets the digits that tell the two apart. Check messages use it, so a value just inside a limit never prints as the limit’s own text.cosmiq.devices.discretizetakes a bundled device’s id as well as aDeviceSpec; an unknown id raisesFormatErrornaming the bundled devices.cosmiq.conventions.CONVENTIONS.state_ordersays how a state vector or a probability vector is indexed: entry \(b\) is the basis state with \(b = \sum_i s_i \cdot 2^{N-1-i}\), where \(s_i\) is 0 for \(g\) and 1 for r, so atom 0 is the most significant bit. The conventions version is “1”.Emulator(method="density_matrix")evolves the density matrix, sonoise="hardware"’s T2 and mid-sequence loss are exact channels instead of quantum-jump trajectories. Up to 12 atoms forward and 10 with a gradient, in complex128, on the CPU (it’s tested on CPU only), ontorch-kronortorch-ref. Each substep is \(D(\tau/2)\,\mathrm{Strang}(\tau)\,D(\tau/2)\) on \(\rho\) held as a 2N-atom state, with D the exact single-atom relaxation and dephasing channels; the error control is split’s, on the full problem, in the Hilbert-Schmidt norm. T2 alone runs one row (K = 1); T0, T1 and the lost atoms are drawn per row. A lost atom gets the channelK0 = |g><g|,K1 = |g><r|at the end of its loss cell. Gradients come from autograd, checkpointed per cell (gradient_modereads"autograd"), withnoise="hardware"andvjptoo. Against a dense Lindblad solver at \(N \le 4\),tol=1e-11gives \(\rho\) within 1e-10; without T2 or loss, \(\rho\) equals|ψ><ψ|ofsplitto 1e-12 at \(N \le 10\).cosmiq.devices.discretize(schedule, spec)puts times on the device clock, values on their resolutions and positions on the position grid, with ties to even (judged on the binary value, so 1.0005 rounds to 1.000 but 2.0005 to 2.001 on a 0.001 grid), and returns aDiscretizationReportof every rounding. Value rounding is straight-through, so gradients pass unchanged.exact=Trueraises instead of rounding. It checks the rounded schedule and raisesConstraintErrorwhen it breaks a rule (with the violations rounding caused marked), so a device label always means a check passed. To see a rounded schedule’s violations, catch the error.cosmiq.devices.check(data, spec)checks a schedule against every device rule (atom count, field of view, spacing, grids, ranges, slew rates, segment and total durations, waveform classes, the local detuning map, finite values and time order) and returns structuredViolationobjects naming the rule, device, field, channel, breakpoint, time window, batch row, value, limit and a fix. Withrounded_from=, violations that only discretisation caused are marked; withstrict=True, the strict envelope is checked too.check_registerchecks the register alone. The check uses numpy only.check,check_registerand the exporters’spec=refuse (FormatError) a schedule labelled for another device thanspec; another capabilities version of the same device is fine.check_register(..., strict=True, rounded_from=...)checks the register alone, against the strict envelope too, and marks the violations that rounding the positions caused. The strict envelope is checked for every range, slew, spacing and duration rule, but not for the grids, since a schedule is discretised for its own target. A passing schedule is checked in one fused numpy pass, sorounded_fromandstrictcost almost nothing unless something fails.The digital path (
cosmiq.digital, docs/digital.md): gate-model circuits on the register’s atoms, simulated on the CPU with a torch state vector for up to 16 qubits (every size from 1 to 16 tested). Each device’s native gates, timing and Pauli noise live in its own digital profile,cosmiq.digital.profile("cosmiq-ref-1")(profile_version 1.0.0; alsocosmiq-ref-1-ideal, every rate 0). The profile is separate from the device file, so cosmiq-ref-1’s capabilities version stays 2.0.0.Qiskit on cosmiq (
cosmiq.qiskit, docs/qiskit.md; theqiskitextra):target(device, register)gives a QiskitTarget(czon atoms in range,randrzon every atom,measure), andSamplerV2andEstimatorV2run on this machine, noise-free or with the profile’s Pauli trajectories. Parameters stay unbound until the simulator, as affine expressions.New refusals, each by name:
DIGITAL_SIZE(17 or more qubits),DIGITAL_MIDCIRCUIT(measurement before the end, a second measurement, reset, control flow),DIGITAL_GATE(a non-native instruction),DIGITAL_RANGE(a CZ out of range, a qubit outside the register, a duplicate operand),DIGITAL_PARAM_EXPR(a non-affine angle) andDIGITAL_DEVICE(a device with no digital profile).The digital path, remote (docs/qiskit.md, “Remote”):
SamplerV2(session=...)andEstimatorV2(session=...)on avqpu:*session orcq.remote.local(). A pub goes as one job per chunk of min(256, 100,000 // shots) parameter rows, each carrying the native circuit once (thedigitalpayload ofcosmiq.job/1); the box binds the rows itself, without Qiskit, at the digital profile’s full noise. The remote estimator measures qubit-wise commuting groups at \(\mathrm{shots} = \lceil 1/\mathrm{precision}^2 \rceil\), at most 1,000.A digital result’s
vqpublock names itsprofile_version, andcq.remote.verifychecks that a digital job’s receipt signs it.New refusals:
DIGITAL_TARGET(a digital job on anemu:*session) and, in a rehearsal,REHEARSAL_DIGITAL(rehearsing digital jobs is deferred).cosmiq.emulator.Emulator, annn.Modulethat runs a program on a simulated device:Emulator(device=None, precision="auto", method="auto", backend="auto", gradient="auto", tol=None, samples_only=False, observable=None, max_memory=None).run(schedule, observables=..., shots=..., noise=..., trajectories=..., seed=..., spec=..., dt=..., keep_state=...)takes a targeted schedule, any schedule withspec=(anddt=for finer cells), or a loadedScheduleData, and steps on the cells ofSchedule.sample: the device clock by default.forward(schedule)returns the constructor’sobservable, sonn.Sequential(program, emulator)works.Diagonal observables, reduced from the state in float64:
density()[B, N],correlation()[B, N, N],probabilities()\([B, 2^N]\) (refused above 2 GiB unlessallow_large=True),projector(bitstrings)anddiagonal(weights_or_fn, name=), whose weights may be a vector, a trainable tensor, or a function of the bits.EmulationResultholds the expectations by name, the final state withkeep_state=True, a lazyprobabilities(), oneShotsper batch row in shot mode, and anEmulationReport: the engine’s method, backend, dtype, substeps, error estimate and, afterbackward(), its certificate and gradient mode; the noise used and left out, the standard error over the trajectories, the calibration id, the seed, the device ref, the chunks, the wall time and every automatic choice.Emulator.vjp(data, observables, cotangents)returns \(\partial L/\partial\,\mathrm{slots}\) [B, n_slots] for a loaded document, \(L = \sum \mathrm{cotangent} \cdot \mathrm{value}\): the server side of a gradient, which the client multiplies by its document’s Jacobian.Shots are sampled with a float64 cumulative sum, so any N works, with labels 0, 1, 2 and the
preandpostimages.Emulator(samples_only=True)returns shots only, read as the analog hardware reads them: a lost atom reads 1 (Rydberg).The batch of rows and trajectories is cut into chunks that fit the memory budget, with the engine’s
memory_estimate; a gradient run in more than one chunk checkpoints each chunk.A site empty in every trajectory of a row has no density: its
density()entry, thecorrelation()entries it’s in (and pairs never present together) and their standard errors are NaN, while every other entry and every gradient stays finite. The report names those atoms.The emulator’s engine: a full-space state-vector integrator for the cell model, with an explicit batch axis.
denseis the exact product of per-cell matrix exponentials (complex128, up to 12 atoms, differentiable by plain autograd), the reference the other methods converge to.splitis a symmetric splitting of each cell: Strang (order 2) or Blanes and Moan’s six-stage method (order 4), with the interaction phase taken in float64 and reduced mod \(2\pi\), and the single-atom factors in closed form. It comes intorch-ref(one multiply-add per atom) andtorch-kron(five atoms per batched 32x32 GEMM) implementations.krylovis a batched Lanczos step per cell with per-row stopping, forward only.splitcontrols its own error againsttol(1e-6 in complex128, 1e-4 in complex64), on the problem itself, with probe runs (see the note on its error control below). The estimate adds the state’s rounding, which grows linearly with the number of steps (most visibly in complex64; a complex64 run is rescaled to its starting norm, which removes most of it). Nothing is cached, so a result depends only on the problem and the options.method="auto"usessplit, and switches tokrylovonly for runs without gradients that would need too many substeps.Exact gradients through
splitby the reversible adjoint: one autograd Function per run keeps only \(\psi(T)\), rebuilds the states on the way back, and returns the cotangents of each cell’s 2x2 factors, which autograd differentiates in closed form. The backward pass costs about 3-4x the forward. Every backward pass reports a certificate, \(\lVert\psi_0^\mathrm{rebuilt} - \psi_0\rVert_2\). When it’s above 1e-8 (complex128) or 1e-4 (complex64), the gradient is recomputed by checkpointing, whichgradient="checkpoint"also forces; it stores at most 64 states, with more levels of recomputation for longer runs. Memory doesn’t grow with the number of cells beyond the per-cell inputs: the closed-form factors are built and differentiated a piece at a time, and the tensors the backward pass needs are freed after it.A precision policy and a memory model: complex128 on the CPU, complex64 storage with float64 phases, norms and reductions on CUDA, MPS refused. When complex64’s rounding would keep the estimate above
tol,precision="auto"runskrylovin complex64 from 20 atoms when no gradient is needed (faster than double on an RTX 3090, and more accurate), and complex128 otherwise; an explicitprecision="single"keeps complex64 and says so in the report. The engine estimates the memory a batch needs (states, the per-cell arrays and its bounded buffers; tests check it against the measured peak) and refuses one that can’t fit (by default 80% of the free CUDA memory, or half of the RAM). Its choices of method, order and precision weigh a fixed figure (80% of the device’s total memory, ormax_memory), so they don’t depend on how much happens to be free.An optional fused Triton kernel for the split step on CUDA. It’s used only after a one-time self-test against
torch-kron, and, forbackend="auto", only at sizes where a benchmark measured it faster: on an RTX 3090, from 22 atoms, or from 20 atoms with a batch of 16 or more.Emulator.run(..., initial=psi)starts a run from a given state instead of every atom in g: complex,[2^N]for every row or[B, 2^N], inCONVENTIONS.state_order, each row of norm 1. Gradients flow back topsi, so gates and runs chain into one torch graph. Noiseless runs only; samples-only mode refuses it.cosmiq.emulator.NoiseModel: a device’s calibration as emulator noise.NoiseModel.from_spec(spec, include=...),.without(...),.scaled(factor)andNoiseModel.none(), or values by hand in the units ofNoiseModel.KEYS, checked when the model is built.run(noise="device")uses every mechanism the target’s calibration has a value for.Three tiers. T0, classical per shot: empty sites (left out of densities), atoms badly prepared (not driven, and read as ground: our model), loss at readout (label 2). T1, quasi-static per trajectory and reparameterised, so gradients pass to the pulse, and to these noise values when they’re given as tensors that require grad:
laser.amplitude_sigma,laser.waist,laser.detuning_sigma,laser.detuning_offset_sigma,thermal.doppler_sigma,local.weight_sigma,local.crosstalkand the readout errors. A trainablethermal.position_sigma, or a trainable probability of empty sites, preparation errors or loss, is refused: a gradient would silently miss it. The T1 mechanisms are the Rabi frequency’s scale, the beam profile (our model: the beam propagates along \(y\), so \(\Omega_i = \Omega \exp(-x_i^2/w^2)\)), detuning jitter, a calibration offset drawn once per snapshot from its id, Doppler shifts, position jitter, local-weight errors and crosstalk within 1.5 nearest-neighbour distances. T3, the readout map: on shots, and exactly on densities, correlations (with their cross terms) and probabilities.coherence.*andramp.*are reported as unused.Expectation mode averages exact values over K trajectories (100 by default) and reports their standard error; shot mode draws one trajectory per shot up to 1,000, then spreads the shots (which then share their trajectory’s noise, empty sites included), and reports the effective sample size. A hand-built model with
laser.detuning_offset_sigmaneeds acalibration_id, which seeds the offset. A model that draws nothing per trajectory runs once per row, socosmiq-ref-1-idealgives exactly the noiseless answer.Every draw comes from a CPU float64 generator, seeded per (row, trajectory) from one root seed, so a run reproduces whatever its chunking and whatever the rest of its batch. The root is recorded in the report and in every
Shots.seed.Emulator(..., unverified="reason")also bypasses the density matrix’s gradients (andvjp) above 10 atoms (DM_GRAD_SIZE) and the trajectory gradient above 6 atoms (TRAJ_SIZE): their memory estimates cover the measured peak at the measured cells (docs/emulator.md, “Running outside the tested range”). Such a call warns once, reportsverified=Falseand is counted, as the other bypasses are. Every call through agradient="trajectory"emulator above 6 atoms is labelled, forward calls included. No accuracy claim of any kind applies to such a result, and the estimate isn’t claimed as a bound anywhere it wasn’t measured.cosmiq.gradients, one gradient selector:estimate(program, loss_fn, method=...)returns \(\partial\,\mathrm{loss}/\partial\theta\) for every parameter that requires grad, with its standard error, the shots used and the emulator runs."adjoint"and"checkpoint"are exact (a copy of the emulator runs with thatgradient=);"spsa"and"finite-diff"(central) sample, as the hardware would have to, on the raw parameters, with every seed derived fromseed=;"auto"takes SPSA in samples-only mode, and otherwise the emulator’s own choice: the adjoint, falling back to checkpointing when its certificate fails, with the mode used in the result’smethod("autograd"for a dense emulator). A clamp-modeboundedvalue whose step would cross a limit takes a second-order one-sided difference anchored at its value (bias \(O(h^2)\)), so no evaluation leaves the limits and the estimate stays right on the limit itself.cosmiq.gradients.spsaandcosmiq.gradients.finite_diff, the two estimators for any function of a flat parameter vector, return aJacobian(value, standard error, evaluations). Both takelow=andhigh=, [P] limits, for those one-sided differences; SPSA then holds a value at a limit still in its random steps. No shift rule of any kind.cosmiq.ScheduleDataandcosmiq.Schedulehave acapabilities_versionfield (defaultNone): the device’s capabilities version a schedule was checked against.Schedule.from_datakeeps it andto_datawrites it back;devices.discretizesets it to the target’s.formats.loadskeeps a document’s capabilities version, through aScheduletoo, so the digest survives a round trip. A document for a bundled device whose version here differs still loads, so it can be checked against the limits in force, with aUserWarningthat says so. A schedule document that names a bundled device without itscapabilities_versionis refused (FormatError): the limits it was checked against would be unknown. cosmiq always writes the version for a bundled device.Emulator.run(noise="hardware"):noise="device"plus everything else the calibration describes. T2 by quantum jumps: per atom, relaxation \(\sqrt{1/T_1}\,|g\rangle\langle r|\) (coherence.t1_rydberg; the atom returns to g and stays driven, as in Pulser’s model) and dephasing \(\sqrt{2 \cdot \mathrm{rate}}\; n\) (coherence.dephasing_rate, so the \(g\)-\(r\) coherence decays at the rate, Pulser’s convention). Each trajectory evolves under the non-Hermitian H_eff onsplit(its damping is a magnitude on the diagonal phase step), is renormalised at every cell, and jumps at the end of the cell where its float64 integrated-rate clock passes a threshold E = -ln(u): first order in the cell, at most one jump per cell. The ramp filter: the global amplitude through a first-order low-pass whose time constant comes from theramp.*corrections (cosmiq-ref-1: τ ≈ 25 ns). Loss during the sequence: the atoms the T0 loss draw loses (the same atoms as under"device"for the same seed) are measured at a uniform time, put in g and masked, then read as lost.NoiseModel(..., hardware=True)andNoiseModel.from_spec(spec, hardware=True)build that model (ahardwareproperty says so);scaled(f)scales the rates 1/T1 and the dephasing rate and the ramp filter’s time constant, andscaled(0)switches each off without raising. A trajectory’s jumps come from a stream of their own,"jumps", with a pinned layout, so switching T2 off, or chunking a run, moves no other draw.A hand-built
NoiseModelwithcoherence.*orramp.*keys needshardware=True, and so doesfrom_spec(include=...)naming those groups; without it, the report lists them as unused with the reason “opt-in: noise=’hardware’”. Onsplit,noise="hardware"is forward only unlessgradient="trajectory";"krylov"and"dense"refuse it, it never runs on Triton, andmethod="density_matrix"takes it with gradients. Its error control runs on the problem without the jumps, and its report says the jumps’ part is statistical.The PennyLane device
cosmiq.emulator(cosmiq.pennylane.EmulatorDevice), with thepennylaneextra:qml.device("cosmiq.emulator", wires=N, target="cosmiq-ref-1", seed=None, emulator=None). A tape runs on one state vector from every atom in g: the single-qubit gates RX, RY, RZ, Hadamard, PhaseShift, Rot, Identity and GlobalPhase are ideal matrices applied in torch (other single-qubit gates decompose into them), and eachRydbergEvolutionblock is targeted attarget(rounded and checked, asto_targetdoes) and run by the emulator on the current state. Its capabilities are a TOML file (schema 3) shipped in the package.Measurements:
expval,varandprobs(exact, or from shots), andsampleandcountswith shots, of PauliX, PauliY, PauliZ, Identity andProjector, and their products and sums (nᵢ = qml.Projector([1], wires=i)). Measurements that read their shared wires in one basis share their shots. Shots come from the tape, seeded by the device’sseed.Device gradients, with
diff_method="device", device_vjp=True: exact in analytic mode (cosmiq’s adjoint, through the gates and the blocks as one torch graph;compute_vjp, andcompute_derivativesfor every output from one run), and SPSA from shots (cosmiq.gradients.spsa, itssamplesandstepfrom the QNode’sgradient_kwargs; a clamp-mode value’s steps stay inside its limits). Both work through the torch and autograd interfaces.Refusals raise
DeviceErrorwith “not supported”: multi-qubit gates, noise channels, mid-circuit measurements, other measurements and observables, avar,probs,sampleorcountsof a sum, and any gradient of a trainable block other than the device’s VJP (PennyLane’s gradient transforms, parameter-shift included, would treat its vector of values as one number), exact gradients through a block with anEmulator(gradient="none"), a clamp-mode value outside its limits, and the JAX and TensorFlow interfaces.Two tutorials,
docs/tutorials/02_pennylane_variational.py(gates around a block, trained with torch; SPSA from shots) anddocs/tutorials/03_pennylane_mis.py(a maximum independent set on a unit-disk graph), and a guide,docs/pennylane.md.cosmiq.CosmiqDeprecationWarning, the warning every deprecated cosmiq name raises. It is aFutureWarning, so users see it by default.cosmiq.ScheduleDataandcosmiq.ChannelData, the torch-free form of a schedule thatSchedule.to_data()andformats.loadsreturn anddevices.checkreads, are public, so code and type checkers can name them.cosmiq.devices.checkandcheck_registertake aScheduleas well as aScheduleData(for both the schedule androunded_from), as the exporters do. An argument of any other type, or aspecthat isn’t aDeviceSpec, raisesTypeError.formats.dumps(schedule, jacobian_wrt=..., assume_affine=True)writes one shared Jacobian withaffine: true, so a reader may evaluate \(s_0 + J\theta\) at other parameters. The flag is your promise thatdrive()has no value-dependent control flow; cosmiq still requires an affine autograd graph, the same \(J\) and \(s_0\) in every row and no free slot moved by rounding, and writesaffine: falsewhen any of them fails. Withoutassume_affine=True, the Jacobian is per row (affine: false), exact at the written parameters.cosmiq.export.to_pulser(schedule, spec=None)writes a schedule as Pulser’s abstract representation (a JSON string), with one pulse per phase segment and the local detuning as a DMM. Each sloped piece of a piecewise-linear channel is aCustomWaveformof its per-nanosecond midpoint samples, so each segment’s area is exact and \(\Omega\) never goes negative. The device is a Pulser virtual device built from the schedule’s target (spec=, or the schedule’s bundled device): named after it, with its \(C_6\), atom count, spacing, \(\Omega\) and \(|\Delta|\) maxima, clock, minimum segment and duration, and a DMM down to its \(\delta\) minimum, so Pulser enforces those limits too. An untargeted schedule, or one for a device that isn’t bundled, needsspec=(FormatError). Pulser takes \(C_6\) only from its Rydberg level, so a target whose \(C_6\) isn’t Pulser’s level-70 value (5420158.53, the bundled devices’) raisesCapabilityError.cosmiq.export.to_braket_ahs(schedule)writes a schedule as a Braket AHS program in SI units. Because Braket’s local detuning is non-negative where cosmiq’s is non-positive, the export rewrites it exactly by default (\(\Delta' = \Delta + \delta\), \(h' = 1 - c\), \(\Delta_\mathrm{local}' = -\delta\)) and re-checks the new global detuning against the device’s limits (spec=, or the schedule’s bundled device);local_detuning="direct"passes it through instead.cosmiq.export.shots_to_braket_bits(shots)converts shots to Braket’s pre- and post-sequence bits. Braket’s bits can’t show an atom lost during the sequence, so that raisesCapabilityErrorunlessloss="fold"writes it as Rydberg.QEC with atom loss in decoding (
cosmiq.qec, docs/qec.md; theqecextra: Stim and networkx).qec.memory_experiment("surface", d=5, noise=qec.Noise(p=1e-3, p_loss=0.01), shots=..., decoder="loss_aware")runs Stim’s generated surface or repetition memory circuit at d = 3 or 5 with rounds = d. Circuit-level depolarising noise, readout and reset flips, and atom loss as a heralded erasure on every qubit in every round. Decoding is our own minimum-weight perfect matching (networkx’s Dijkstra and blossom algorithm): loss-blind, or loss-aware, where an erased location’s edges weigh 0 in that shot.Plug-in seams for later codes and decoders: the
qec.Codeandqec.Decoderprotocols,qec.register_codeandqec.register_decoder. A decoder gets a neutralqec.Problem: the circuit, its undecomposed detector error model and an erasure map keyed by error mechanism, so a code whose model isn’t graphlike runs through it.qec.noise_from_devicemaps cosmiq-ref-1’s loss and preparation calibration and its digital profile’s gate and readout rates onto the noise model. That mapping is a modelling choice, listed inqec.DEVICE_MAPPING, and not the device’s QEC performance.New refusals, each by name:
QEC_CODE(a code that isn’t built in or registered),QEC_DISTANCE(a built-in code at d other than 3 or 5, or rounds other than d) andQEC_CALIBRATION(a device missing a calibration value thatnoise_from_devicemaps; never taken as 0).Three bundled reference devices,
cosmiq-ref-1,cosmiq-ref-1-ideal(the same limits, no noise) andcosmiq-ref-1-future(every error 2x better), loaded withcosmiq.devices.getand listed bycosmiq.devices.available. Each is a synthetic reference device built from published averages; it does not model any vendor’s machine. Limits are stored exactly (for example \(2\pi \cdot 2.4\,\mathrm{MHz} = 15.079644737231007\,\mathrm{rad/\mu s}\)) and every one records its provenance.Their limits are cosmiq’s own reference design choices within published ranges: at most 120 atoms, \(\Omega\) at most \(2\pi \cdot 2.4\,\mathrm{MHz}\), \(|\Delta|\) and the local \(\delta\) minimum \(2\pi \cdot 18\,\mathrm{MHz} = 113.09733552923255\,\mathrm{rad/\mu s}\), a minimum spacing of 4.8 µm, at most 5 µs, and a generic 4 ns electronics clock. Their
capabilities_versionis 2.0.0, and so is the strict envelope’s;DeviceInfo.capabilities_versionstates the version’s rules. \(C_6\) cites Pulser’s table (Apache-2.0), which Pulser computed with ARC. The noise snapshot is rounded averages of published values, and the ramp correctionsramp.rabi_correction_52ns,_100nsand_200nscome from a stated model, 1 - exp(-t/τ) with τ = 25 ns, rounded to 4 decimals (0.8751, 0.9817, 0.9997;-futurehalves the shortfall). The calibrations’ ids are<device>/2026-10-31T00:00Z.cosmiq.devices.strictest(), the strict envelope: every bundled device’s limits at once, whichcheck(..., strict=True)also applies.cosmiq.Register: N atoms in 2D, in a fixed order, with absolute positions in µm measured from the beam axis. It is immutable.chain,square,rectangularandtriangularcentre the array on the origin (exactly symmetric) unlesscenter=False;Register(...)andfrom_coordinateskeep the positions given. Construction checks the structure only: 2D positions (RD), finite values (RF), at least one atom, unique labels and no two atoms at one point, raisingFormatError. Device limits are checked when a program is targeted.distances,translated,to_dictandfrom_dictare included.Rehearsal (docs/runtime.md, “Rehearsal”):
train.local(cfg, rehearse="vqpu:cosmiq-ref-1", rehearse_seed=None, rehearse_snapshot=None)runs the function locally, and everycq.remote.sessionof that target in it is a rehearsed session. Each job is checked against the site’s modelled rules (the job’s own rules, the site’s caps of 256 rows and 100,000 shots x rows, and the target’s atom cap), booked with the site’s projected seconds, and run at once on this machine along the virtual QPU’s own path. No job leaves the machine, and nothing is priced.LocalRun.rehearsal(acq.runtime.Rehearsal, alsorehearsal.json) gives the jobs, shots and projected seconds, with each job’s booking and outcome lines inrehearsal-jobs.jsonl. The snapshot of the target is fetched once (GET /v1/targets), or supplied as aTargetStatusor as a run’srehearsal-snapshot.json, and checked.New refusals:
REHEARSAL_TARGET,REHEARSAL_SNAPSHOT,REHEARSAL_NO_SITE, andREHEARSAL_UNVERIFIED: an emulator call that bypassed a refusal anywhere in a rehearsal ends itfailedwith arefusedreport.rehearse=withresume_from=isNOT_IN_V1.cq.remote.session("vqpu:...")checks its keywords (max_minutes,idle_minutes,tier,keep) before the runtime’s hook, so a rehearsed session refuses exactly what a real one does.A
cosmiq.job/1vjp job’s cotangents may bendarrayobjects (f8, shaped like their values) as well as nested numbers; the remote client sends ndarrays, exact and about half the size. On the vjp path,run()refuses a run whose backward job would exceed the 1 MiB job cap before it sends anything, naming how many rows would fit and the largest observable.The remote client checks every result against its job: a result whose
job_digestisn’t the digest of the job sent, or a job view of another job, raisesRemoteErrorwithcode="mismatched_result", and its values are never used.cosmiq.remote: run cosmiq work on your own rented box (docs/remote.md).cq.remote.session(target, *, max_minutes, idle_minutes=None, tier=None, keep=False, api_key=None, url=None)opens or reuses a session on a CPU or GPU box through the site, waits until it’s ready (logging its boot marks), and stops it when thewithblock ends unlesskeep=True.session.run(schedule, ...)takesEmulator.run’s arguments and returns itsEmulationResult;submit(...)returns aRemoteJob(id,status(),result(timeout=None),cancel()). A job is data, never code, and a warm training step is one request.Exact gradients through a remote run: the expectations come back attached to the caller’s graph through the schedule’s slots, so
loss.backward()is local autograd’s chain rule,drive()and the device’s rounding included.gradient="auto"takes the Jacobian of the slots in the same job while a row has at most 64 scalar outputs and \(B \cdot O \cdot S\) stays under 524,288; beyond that it warns once and takes the vjp path, a second job in the backward pass.cq.remote.local(*, emulator=None): the same API in this process, each job checked and run bycq.remote.execute(job), the pure function a box answers a job with. Its results equalEmulator.run’s bitwise.cq.gradients.estimate(..., emulator=session)takes acq.remotesession: SPSA and finite differences send every evaluation point in one job, one row group per point seeded as the local estimator seeds that run, and equal the local estimate bitwise in the same image and precision. The exact methods go through the gradient bridge.Two formats in
cosmiq.formats:cosmiq.job/1(forbids unknown fields) andcosmiq.result/1(ignores them), as plain dicts throughdumpsandloads, with size caps of 1 MiB and 8 MiB, decimal-string seeds and base64ndarrayoutputs;formats.schema("job" | "result"), andschemas/job-1.json,result-1.json.formats.loadsreturns such a document as adict, besides aScheduleDataor aDeviceSpec: narrow its result withisinstance.The box’s job process,
python -m cosmiq.remote._worker: newline-delimited JSON on stdin and stdout, a ready line first, one job at a time, logs on stderr.The PennyLane device
cosmiq.remote(cosmiq.pennylane.RemoteDevice) runscosmiq.emulator’s circuits on your own box through acq.remotesession:qml.device("cosmiq.remote", wires=4, session=box), orsession=cq.remote.local()in this process. Analytic mode only; shots are refused (shot mode is a planned follow-up). A tape travels as data: its gates, each block as a one-rowcosmiq.schedule/1built and checked on the laptop from itsdrive_fn, and its measurements. The values and gradients are the local device’s (gradients to about 1e-15). A training step is one request: the forward job brings the Jacobian back, the device keeps it, and the backward pass contracts it on the laptop, through each block’sdrive_fnby autograd. The tapes of one call go in one job, or, past a job’s limits (64 tapes, 1 MiB), in as few jobs as hold them, all sent before any is waited for. See docs/pennylane.md.cosmiq.job/1carries circuits as well as schedules ("payload": {"circuits": [...]}): gates, blocks, observable trees and the trainable parameters, analytic and noise-free, with a Jacobian as the only gradient;cosmiq.result/1returns them inoutputs.circuitsandderivatives.circuits(a job of gates alone runs no block, so its result has no reports).cq.remote.executeruns them with PennyLane on the box, and a box without it refuses them withunsupported_field. The schemas inschemas/follow.cosmiq.runtime(docs/runtime.md): a whole training function, shipped as source, with checkpoints.@cq.runtime(target="emu:gpu", max_minutes=..., include=[...])(orfrom cosmiq.runtime import runtime) makes a module-level function a runtime;train(cfg)stays the plain function andtrain.local(cfg, run_dir=None, resume_from=None)packs its source as a remote run will ship it and runs it in a fresh local process, returning aLocalRun(status,exit_code,result,run_dir,events,unverified,checkpoint()).cq.runtime.steps(total, state=..., save_every=...)yields the loop’s steps; inside a run it savesstate(modules, optimizers, LR schedulers, generators, dicts, lists, tensors, arrays) and every global generator at step boundaries, commits each save with a marker, keeps the latest 3, and resumes from the newest committed one that verifies, falling back with acheckpoint_fallbackevent. The first Ctrl+C stops at the next boundary with a saved checkpoint, committed if that happens within 100 s (cq.runtime.Stopped); a second stops at once. A step over 60 s gets oneslow_stepevent.cq.runtime.log(**fields)records JSON values as events.cosmiq.checkpoint/1: a JSON header and one raw blob under one sha256, with no pickle;cq.runtime.load_checkpoint(path | bytes)decodes one on the CPU and refuses a damaged one by the first rule it breaks. Every refusal is acq.runtime.RefusedErrorwith acode.On the CPU, a resumed run continues bitwise identical to an uninterrupted run started with the same seeds (Python, NumPy, torch), on the same machine, thread count and versions; seed all three. There is no CUDA claim.
Remote runs on your own GPU box (docs/runtime.md, “Remote runs”):
train.submit(cfg, session=None, tier=None, idempotency_key=None)packs the function’s source against the site’s pinned image, uploads it and queues the run, returning acq.runtime.RemoteRun(status,code,events(),stop(),resume(),result(),checkpoint(),logs(),box_seconds, theunverifiedlabels).cq.runtime.attach(run_id)andcq.runtime.list(active=True)find runs from any process. Ctrl+C inevents()orresult()detaches and never stops the run. A remote run’scfgis a JSON object. Remote runs are GPU-only in this release.On the box, the run’s checkpoints are committed at the site by a thread of their own (create, upload, commit; an upload whose answer is lost commits first; at most two cycles), its events go to the site from a spool on disk, and the training loop makes no network call. A stop ends within its first SIGINT + 105 s, and a run never outlives its deadline: it asks itself to stop at the deadline less 120 s and exits at less 5 s. On the box no SIGINT interrupts the loop, so a stop’s boundary save always happens.
New refusals:
IMAGE_UNPINNED,IMAGE_CHANGED,RUNTIME_ACCESS,RUN_NOT_FOUND,RUN_ENDED_WITHOUT_RESULT,CHECKPOINT_UNREACHABLEandNOTHING_TO_RESUME; the site’sPLAN_LIMIT,SESSION_TOO_SHORT,LINEAGE_BUSY,CODE_MISMATCHandQUOTAare live.submitandrun.resume()inside any run on a box areALREADY_ON_A_BOX.submitrefuses, before anything is billed, a package the box would refuse: more than 1,997 files, a file over 16 MiB, more than 64 MiB unpacked with its manifest, or a name with leading or trailing whitespace.cosmiq.pennylane.RydbergEvolution(params, *, register, drive_fn, names, wires, dt=None), a PennyLane operation for a cosmiq drive over the whole register: its data is one 1-D tensor of values innamesorder ([B, P]broadcasts), anddrive_fntakes them as cosmiq’s named parameters. Wire i is atom i. It has no matrix, decomposition, generator or shift rule, so onlycosmiq.emulatorruns it, and it passesqml.ops.functions.assert_valid.RydbergEvolution.from_program(program, wires)builds one from acq.programor anyAnalogProgram: its register, its parameters’ current values, and a drive_fn that evaluatesprogram.drive()with given values in their place (boundedvalues and parameters of several values included).op.limits()gives each value’s closed limits,(low, high)[P] float64 (\(\pm\infty\) for none): afrom_programblock keeps its clamp-modeboundedvalues’ limits, sotheta.clamp_(*op.limits())after an optimiser step keeps a trained tensor inside them.Schedule.sample(dt)refuses a breakpoint (or a PWC edge) that isn’t a whole number ofdt, naming it: the cell around it would be sampled wrong (a 1 µs pulse with 0.1 µs ramps atdt=0.25would lose its ramps). Targeted schedules sampled on their device clock always pass.cosmiq.formats: the versioned JSON formatscosmiq.schedule/1(a skeleton of fixed structure and values, a slot table of the free values, one row of slot values per batch entry, and an optional Jacobian of the slots with respect to named parameters) andcosmiq.device/1.dumpswrites canonical JSON (RFC 8785 style, so other languages get the same bytes),loadsreads either format, parses it strictly and rejects unknown physics fields, NaN, oversized documents, digest mismatches and documents that break the structural checks everySchedulekeeps (labels, positions, RT, R15, R16),digesthashes the skeleton, andschemareturns the JSON Schemas, which are also committed underschemas/.cosmiq.Schedule: a program evaluated to float64 tensors, shaped [B, K] per channel with \(B \ge 1\) always.Schedule.from_driveevaluates a drive with the structural checks (channels end together, R15; waveform classes, R16; finite values, RF), broadcasting batch size 1 to the others.to_data()andfrom_data()convert to and from the torch-free form that the device check, the formats and the exporters read.print(schedule)shows the register and every breakpoint in rad/µs and MHz.cosmiq.sampleandSchedule.sample(dt)put a schedule on a uniform grid with the midpoint rule: PWL channels are interpolated at each cell’s midpoint, PWC channels take their segment’s exact value. Withoutdt, a targeted schedule is sampled on its device’s clock period. The result,cosmiq.Samples, is differentiable in the schedule values.cosmiq.results.Shots: measured shots as uint8 labels (0 ground, 1 Rydberg, 2 lost) with optional pre- and post-sequence occupancy images, validated on construction, andShots.rydberg_density.split’s error control runs one probe pair, and the run it keeps is one of that pair. The order (Strang or the fourth-order scheme) is chosen before any probe, by the rotation layers each is guessed to cost, from the drive’s bound and the problem (a truncation model fitted on measured errors): its probe pair, and in a gradient run its backward pass. The pair’s fine run is the result, and its error estimate is Richardson’s on that pair, \(\lVert\psi_{n/2} - \psi_n\rVert_2/(2^p - 1)\) for order \(p\), with a margin (1.2 for Strang, 1.25 for the fourth-order scheme), plus the rounding term: an empirically honest leading-term estimate of the state returned, not an extrapolation to another number of substeps. Both runs of the pair keep \(\Omega\) and \(\Delta\) within one radian over a substep, and the largest local field within one radian over the scheme’s largest stage, and a pair reports its fine run only with the coarse one at 2 substeps or more (a pair at 1 and 2 reports its coarse run). A pair that missestolpredicts the number that meets it; the next pair reuses the fine run as its coarse one when that number is at most twice its own. A gradient run keeps the pair’s coarse run when it already meetstol, since its backward pass pays for every step.method="auto"without gradients moves tokrylovbefore the error control would runsplitpastN_SUB_MAXrotation layers a cell, from the guess or a probe pair’s prediction. Triton, when its gate passes, also runs the probes.EngineInfo.probesrecords every run of the error control (substeps, scheme, backend, dtype, seconds), the kept one included, and the notes list them without their times;EngineInfo.orderis the split order.estimate_secondsis the error control’s time beside the kept run’s own, about half a forward pass when the first pair meetstol.EngineOptions.n_subandEngineOptions.order(given together) runsplitat those substeps and that order, without the error control; the result then has no error estimate,tolis refused with them, and a note says when n_sub is below the error control’s floor for the drive’s angles. A gradient run in more than one chunk recomputes each chunk with its first forward’s backend, precision, substeps and order, so its gradient is the gradient of the state it returned.Sweeps (docs/runtime.md, “Sweeps”):
cq.runtime.sweep(train, cfgs, boxes=k, key=None)runs 1 to 16 points, each as its own remote run onemu:gpu, with at mostk(1 to 3) at once.events()tags each event with its point,results()keeps point order, andruns,pendingandstop()show and end the runs. The samekeyreplays the points already started, and a changed function, include or cfg under it isSWEEP_CHANGED.PLAN_LIMITwith a run of the sweep active waits for one to end, and a 429 waits out itsRetry-After. Ctrl+C detaches: the started runs go on and nothing more starts.vQPU caps (docs/remote.md, “Caps”):
cq.remote.session("vqpu:...", max_vqpu_seconds=, max_shots=, max_jobs=)checks each job before it’s sent, on the site’s own projection (job_overhead_s + shots_total / shot_rate_hz), for analog and digital jobs, andbudget()returns acq.remote.Budget. A job past a cap raisesRemoteError("vqpu_budget")and nothing is sent. The caps are counted in vQPU seconds, shots and jobs, with no money units.The client keeps to the site’s request caps on a vQPU job (256 rows, 100,000 shots x rows).
runandsubmitrefuse a job past them with the site’sinvalid_jobtext, as a rehearsal does, andcq.gradients.estimateon a vQPU session splits its jobs within them.New refusals:
SWEEP_SIZE,SWEEP_BOXES,SWEEP_TARGET,SWEEP_SESSIONandSWEEP_CHANGED. A rehearsal refuses a session’s caps asNOT_IN_V1.Emulator(space="tensor")(docs/emulator.md, “The tensor space”): an MPS evolved by two-site TDVP on the emulator’s 20 ns cells, atbond_dim=32(64 at N = 16), complex128 on the CPU, with an exact MPO holding every pair. It runs only on the chains, programs and sizes its tests covered: a uniform 4.8 µm chain, the six-knot gradient layout and the constant drive, densities and correlations in expectation, and gradients of densities with respect to the layout’s six knots in the gradient cells. Everything else is refused by aTN_*code, and none of them can be bypassed throughunverified=in v0.1. The report’stensorfield gives the bond dimension used, the substeps, the dropped tail and the discarded weight, which is a diagnostic, not an error bound or estimate. At \(N \ge 28\) there is no reference to the exact dynamics: what was tested there is agreement with \(\chi = 64\) and with TeNPy’s TDVP.Emulator(bond_dim=...): valid only withspace="tensor": None, or the cell’s tested value (32 at \(N \le 12\), 64 at \(N = 16\)).Emulator(gradient="trajectory")(experimental) takes gradients throughnoise="hardware"’s quantum jumps and mid-sequence losses onsplit, up to 6 atoms, the size it’s tested at againstmethod="density_matrix"’s gradients for T2, loss and both. The forward run records each trajectory’s jumps and loss outcomes; a replay of the same trajectories under autograd, checkpointed per cell and following the record, sums each one’s log p(record) (the jump clock from the replayed norms, the channel and atom chosen, the loss outcomes’ Born probabilities), and the gradient adds the score term(O - b)·∇log pwith a leave-one-out baseline to the pathwise one. K is 4,096 by default; the run must fit one chunk; a record with a deferred jump is refused. The report notes “experimental: trajectory gradient”, andgradient_modereads"trajectory"afterbackward(). Against the jump scheme’s exact expectation for one atom it’s unbiased within its standard error.backend="triton"also runs the gradient’s reductions in Triton: at every rotation layer of the backward sweep, each group’s \(G = \lambda^\mathsf{T} \bar\psi\) over its spectator bits, and each atom’s partial trace of it, into the same accumulators astorch-kron. complex128 is float64 throughout; complex64 multiplies and sums runs of at most 1,024 spectator rows in float32 and adds the runs in float64, astorch-krondoes. Againsttorch-kronthey match to a relative 1e-12 in complex128 and 1e-5 in complex64 (checked underTRITON_INTERPRET=1up to 12 atoms, both schemes). They run only after a backward self-test at 14 atoms, once per device and precision; if it fails, the sweep usestorch-kron’s reductions. Underbackend="auto"they’re off until a GPU session measures them faster thantorch-kron’s, so an automatic Triton run’s gradient usestorch-kron’s reductions.cosmiq.units.format_frequencyshows an angular frequency in both units, for example"15.708 rad/µs (2π·2.500 MHz)". Very small and very large magnitudes switch to scientific notation, so a resolution such as 1e-6 rad/µs doesn’t print as zero.Emulator(..., unverified="reason")in the full space (docs/emulator.md, “Running outside the tested range”): three refusals for lack of evidence don’t stop the call.method="density_matrix"above 12 atoms, forward (DM_SIZE), runs on the same engine, as asked;gradient="trajectory"in complex64 (TRAJ_C64) runs the record pass and its replay in complex64; and either off the CPU (ENG_CPU) runs there, the trajectory gradient in complex128 underprecision="auto"(the report says so). Each such call warns once (cq.UnverifiedWarning), reportsverified=Falseand is counted bycq.emulator.unverified_bypass_count(), as inspace="blockade". Every call through agradient="trajectory"emulator withprecision="single"is labelled, forward calls included. No accuracy claim of any kind applies to such a result. The memory guard staysENG_MEMORYon every call; CUDA execution under the flag was not run.Through an unverified emulator, a refusal that comes after a bypassed one, before the run or during it (
ENG_MEMORY,ENG_TOL_FLOOR, …), ends with “this call had bypassed: <codes>”, in the full space as inspace="blockade".Emulator(..., unverified="reason")(docs/emulator.md, “Running outside the tested range”): inspace="blockade", a refusal for lack of evidence (UNTESTED) or for a missed rule (FAILED) doesn’t stop the call. A tested family at another size, a cell outside the table, the refused tri 3x3 and square 4x6 gradient cells, complex64 on the CPU, CUDA where it wasn’t run, the observables of a density-only cell, gradients outside the tested gradient layout, anotherdt(one that divides 2 µs) and another C6 run, and each such call emits onecq.UnverifiedWarningnaming what it bypassed, the reason and where the emulator was built. No accuracy claim of any kind applies to such a result. The flag lives on the object only (no global switch, context manager or environment variable), is read-only, and is logged at WARNING on thecosmiq.emulatorlogger when the emulator is built and when it’s unpickled. Everything else stays refused: unrecognised registers and programs, the 5.15-5.45 µm band, the regime check (necessary, not sufficient; under the flag the only accuracy guard left), the jump rule, and every NOT_IMPLEMENTED, INVALID and LIMIT refusal. CUDA execution under the flag was not run.EmulationReport.verified,.bypassedand.reasonsay whether a call bypassed a refusal;Emulator.last_reportis the report of the emulator’s last successful call, forforward()users;cq.emulator.unverified_bypass_count()counts the calls in this process that bypassed a refusal (monotonic; a forked child inherits it, a spawned one starts at 0).Every refusal the emulator raises on purpose has a code and a kind in one registry (
[BLK_SIZE] ...,[ENG_MEMORY] ...), listed in docs/emulator.md; a hard refusal’s message names its fix. A message starts with its code,[CODE], and every bypassable blockade refusal of a call is listed in one error, one line each. The errors keep their types (CapabilityError, FormatError, MemoryError, RuntimeError), as private subclasses that carrycodes; the memory refusals ([ENG_MEMORY],[BLK_MEMORY],[PROBS_LARGE]) and the two runtime ones ([BLK_FRAME],[ENG_CONVERGE]) also derive fromcq.CosmiqError.space="blockade"has a memory guard for the calls that bypassed a refusal throughunverified=: before anything of the subspace’s size is allocated, it counts the subspace exactly and estimates the call’s bytes, and refuses a call above the budget (BLK_MEMORY, a MemoryError). A tested call, strict or through an unverified emulator, doesn’t meet it.max_memory=is accepted inspace="blockade"as that budget by an unverified emulator only (a strict one still refuses it); the default is half the machine’s total RAM or, on Linux, the memory available, whichever is less, on the CPU. The gradient part of the estimate holds one fitted term (the checkpointed graph’s bytes per operation). More than 63 atoms is refused (BLK_ATOMS_63).Remote sessions,
cq.remote.local(), a run’semulator=, thecosmiq.remotePennyLane device (RemoteError, codeunverified_local_only), the local PennyLane device ([PL_UNVERIFIED]) andcq.gradients.estimate([GE_UNVERIFIED]) refuse an unverified emulator: their results carry no report.The virtual QPU, client side:
cq.remote.session("vqpu:cosmiq-ref-1")(or-ideal,-future) takes nomax_minutes(emu:*targets still require it) and starts nothing. Itsrunandsubmittakeshots(1 to 1,000 per row) andclock(“fast” or “realistic”) only: the box owns every option that changes the physics, so observables, gradients,noise,seed,trajectories,dt,spec,emulator,initialandkeep_stateare refused before anything is sent, and a vQPU job that carries anything else is refused withinvalid_job, naming the field and the rule. Results hold shots without seeds and the reports’ whitelist.cq.gradients.estimate(..., emulator=<vqpu session>, shots=n)sends one job with null seeds.RemoteSession.status()returns aSessionStatusor, on a vQPU session, the target’sTargetStatusfromGET /v1/targets(status, queue depth, next maintenance window, calibration, shot rate, job overhead, emulated-atom cap and receipt keys).RemoteJob.receipt(verify=True)andcq.remote.verify(view, keys, job=...)check the site’s signed receipt beside a vQPU result: its domain, its key and that key’s validity, the ed25519 signature over its RFC 8785 canonical JSON, the result’s digest and the job’s. A receipt proves that the site accepted the result for that job from one of its pool boxes, not the computation itself. The signature check needs the optional extracosmiq[verify](cryptography).cosmiq.job/1takesvqpu:*targets with an optional"vqpu": {"clock"}field, andrun.noise: "hardware"on any target (forward only: a gradient with it is refused).cosmiq.remote.execute(job, *, lease=None)runs a vQPU job only with the site’s lease (its seed and atom cap): each group seededchild_seed(lease seed, "group", k), the schedule rounded onto the device’s grid and checked (discretize), thennoise= "hardware", samples-only, one trajectory per shot, complex128 ontorch-kron.cosmiq.result/1has an optionalvqpublock, and its reports’ fields beyond the whitelist are optional.The job process,
python -m cosmiq.remote._worker, takes--once(one job, then exit 0) and--prespawn(the same, warmed up before its ready line), and a job line may carry the site’slease.Waveforms:
cosmiq.pwl(piecewise-linear),cosmiq.pwc(piecewise-constant),cosmiq.constant,cosmiq.sampled(piecewise- linear through its samples) andcosmiq.pad_to, the explicit way to make channels end together. Times are fixed floats in µs, starting at 0 and increasing strictly (RT). Values may be floats, 0-d tensors or [B] tensors that require grad;Waveform.tensor()stacks them into one float64 [B, K] tensor that keeps the autograd graph.Drives:
cosmiq.GlobalDrive(amplitude \(\Omega\) and detuning \(\Delta\), piecewise-linear; phase \(\varphi\), piecewise-constant or one value),cosmiq.LocalDetuning(a fixed weight per atom and one piecewise-linear \(\delta(t)\)) andcosmiq.Drive, which combines them. Wrong waveform classes raiseFormatErrorunder rule R16. A phase built withcosmiq.constantis stored as one PWC segment.
Deprecations#
As on every PennyLane device,
shots=on thecosmiq.emulatorconstructor is accepted with PennyLane’s deprecation warning; give the QNode its shots (qml.set_shots).
Security#
No traceback frame of the remote client holds the API key (tools that record frame locals, such as error reporters, could have stored it). Text from the site (error messages, boot marks) is shown with control characters replaced, and the test-only plain HTTP switch allows loopback and RFC 1918 addresses only.
The remote client verifies TLS certificates always, follows no redirect, refuses plain HTTP outside a test-only switch (
COSMIQ_INSECURE_HTTP_FOR_TESTS=1, local addresses only), refuses a credentials file others can read, and never logs the API key or puts it in an error.A vQPU receipt is bound to its job:
cq.remote.verifychecks that itsjob_idis the view’sid(andjob_id=when given) and, given the job sent, that itstargetis the job’s;RemoteJob.receipt()passes its own id, so a receipt of one job never verifies for another with the same document (they share ajob_digest). Every failure on hostile input isRemoteError("bad_receipt").
Other notes#
The MIS quality claim covers the default 4 µs sweep on kings graphs of 8-12 atoms with noise off; other durations run, ungraded. No quantum benefit is claimed for the reservoir (its test reports polynomial baselines) or the kernels. Not built: an embedder for arbitrary graphs, weighted MIS, QAOA, graph kernels, the reservoir on the virtual QPU, remote batching.
Programs with \(\varphi\) ramps and per-atom \(\Omega\) weights aren’t open through the API: a cosmiq program can’t express them (its phase is piecewise-constant, R16), so a local detuning is refused in
space="blockade". The 20 ns step’s own error was measured at \(N \le 12\), at \(N = 16\) (18 programs) and at \(N = 20\) (one program: kings 4x5 at (4.8 µm, \(\Omega\) 3.4), the gradient layout on one tested pulse) only; elsewhere it is not claimed. Time and peak memory on CUDA were measured at one cap only (the chain 28 sweep in complex128); at the other caps they are not measured.The ramp filter keeps \(\Omega\)’s graph under
method="density_matrix", so gradients pass through it;split’s forward-onlynoise="hardware"runs detach it.method="density_matrix"refusesbackend="triton",precision="single",order=4,gradient="adjoint"and"checkpoint",keep_state=True, and any device but the CPU. Above its atom limits,runraises the FormatError that names the limit before it estimates memory. The job format and the virtual QPU don’t take it.Not built: moves, zones, pulse-level CZ, mid-circuit measurement, gradients through the primitives, mitigation and shot noise in the estimator. No CUDA claim.
Tested against
local()and the in-process box path, not on the virtual QPU’s boxes. Digital vQPU jobs are switched off on the site (VQPU_DIGITAL_DISABLED) until a real-box run passes. Not offered:emu:*digital jobs, loss flags in results, mitigation.Export conformance (docs/export.md). A fixed corpus of 12 programs inside cosmiq-ref-1’s limits (N = 1 to 6) is exported with
to_braket_ahsandto_pulserand run on the exporters’ own offline simulators: Braket’sRydbergAtomSimulatorat 0.5 ns steps for \(10^5\) shots, graded by a G-test (\(p \ge 10^{-4}\)), and Pulser’sQutipEmulator, graded by the total variation distance (\(\le 10^{-3}\)). The reference is cosmiq’s emulator, noise off. Three corrupted exports (the detuning x 1.02, the phase sign flipped, the local pattern reversed) must fail the same rules. Noise off, \(N \le 6\) and the corpus only; no claim about any real QPU.Not built: persistent loss, leakage, qLDPC codes, BP or OSD decoders, a fast decoder (ours is pure Python), QEC on the virtual QPU. No novelty claim.
Rehearsal’s totals are the site’s formula applied to the jobs the run sent (tested); they have not yet been compared with the vQPU pool. Only the job’s rules, the row and shots-total caps and the atom cap are modelled: no queue, window, credential, plan limit, wall-time limit, cancellation or money figure. CUDA is untested: on a GPU machine a rehearsal’s jobs run on CUDA, where nothing is claimed.
cq.remote.session("emu:...")called inside a runtime is refused (RUNTIME_LOCAL_ONLY): the emulator runs in the run’s own process there.A box that dies is declared lost within about 160 s. A site outage longer than the last 30 s of a run’s end leaves a run that returned
failedwithRESULT_MISSING. There is no claim that a CUDA run continues bitwise after a resume.Channel ends that differ only by float noise (at most 1e-9 µs, as in \(39 \times 0.1 = 3.9000000000000004\)) count as equal, and are stored as one value. Schedules, channels and samples compare by identity, since tensors have no single truth value.
Schedule.channelsis read-only: the exporters and formats trust a schedule that a targeted forward returned.Tested against the in-process fake sites, and not run on real boxes. The caps hold within one process, across its threads. They aren’t enforced across processes or by the site. Deferred: the job pool and box reuse, CPU boxes for sweeps, money caps, and a sweep on real boxes.
gradient="trajectory"runs only withnoise="hardware"(or aNoiseModelwithhardware=True) whose T2 or loss acts, onmethod="split"or"auto"withtorch-kronortorch-ref, with Strang (order=4is refused), in complex128 on the CPU (it’s tested on CPU only:precision="single"and other devices are refused); every othergradientrefuses"hardware"onsplit, and the refusal namesmethod="density_matrix"andgradient="trajectory". The job format doesn’t take it. The ramp filter keeps \(\Omega\)’s graph under it.