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() and train.local run 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, the kings, square and triangular lattices with a filling mask, and from_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_size and count_sets up to 24 vertices, and report. reservoir: windowed global-detuning segments with exact or sampled \(\langle n_i \rangle\) and \(\langle n_i n_j \rangle\), a torch Ridge, poly_features and narma2. iqp (the qiskit extra): Qiskit’s iqp and zz_feature_map on the register’s CZ graph, their distribution on the digital path’s simulator, and the fidelity kernel, exact or through SamplerV2.

  • 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) and LIB_CZ_GRAPH (an IQP interaction off the register’s CZ pairs).

  • cosmiq.AnalogProgram: a neutral-atom program as a torch.nn.Module. Subclasses implement drive(self, *inputs); forward(*inputs) returns the Schedule, so program(x), nn.Sequential, torch.func.functional_call and forward hooks all work, and the batch axis comes from the inputs. to_target(device, strict=False) binds a device (program.target holds its DeviceSpec), rounds the register onto the device’s position grid and checks it at once, and runs a trial evaluation when drive() 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 raises ConstraintError listing 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.report is the DiscretizationReport of the last schedule a targeted evaluation returned.

  • Violations of value rules name the parameters and inputs behind the bad value, found with torch.autograd.grad on 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_call with plain tensors) they read “unknown (evaluated without autograd)”.

  • cosmiq.program(register, drive_fn, parameters), the functional form, registers its parameters in an nn.ParameterDict named params (floats become float64 parameters).

  • cosmiq.bounded and cosmiq.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 at field when 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 in state_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, and blockade="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 through Emulator.run in your process: a job carries no space, so cq.remote sessions (and cq.remote.local()) and the cosmiq.remote PennyLane device refuse an Emulator(space="blockade") with a RemoteError of code blockade_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 with cq.project_(program), or with cq.project_(program, after=optimizer), which does it after every optimizer.step() and returns the hook’s handle. A clamp-mode value left outside its limits raises FormatError when it’s called. mode="sigmoid" is the default. A Bounded value’s state_dict records its mode; loading one into a value of the other mode raises FormatError.

  • A device spec’s calibration keys are a fixed vocabulary, each with its unit and range (cosmiq.emulator.NoiseModel.KEYS lists 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 µ as u, µ or μ. The committed schemas/device-1.json lists the known keys (propertyNames), so an external validator refuses what the loader refuses.

  • Calibration.valid_from and valid_until are timezone-aware datetime objects in UTC, parsed from ISO 8601 text (a time zone is required), and written back as 2026-10-25T00:00:00Z, so a device document round-trips byte for byte. The committed schemas/device-1.json marks them date-time. valid_until must be after valid_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.discretize takes a bundled device’s id as well as a DeviceSpec; an unknown id raises FormatError naming the bundled devices.

  • cosmiq.conventions.CONVENTIONS.state_order says 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, so noise="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), on torch-kron or torch-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 channel K0 = |g><g|, K1 = |g><r| at the end of its loss cell. Gradients come from autograd, checkpointed per cell (gradient_mode reads "autograd"), with noise="hardware" and vjp too. Against a dense Lindblad solver at \(N \le 4\), tol=1e-11 gives \(\rho\) within 1e-10; without T2 or loss, \(\rho\) equals |ψ><ψ| of split to 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 a DiscretizationReport of every rounding. Value rounding is straight-through, so gradients pass unchanged. exact=True raises instead of rounding. It checks the rounded schedule and raises ConstraintError when 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 structured Violation objects naming the rule, device, field, channel, breakpoint, time window, batch row, value, limit and a fix. With rounded_from=, violations that only discretisation caused are marked; with strict=True, the strict envelope is checked too. check_register checks the register alone. The check uses numpy only. check, check_register and the exporters’ spec= refuse (FormatError) a schedule labelled for another device than spec; 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, so rounded_from and strict cost 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; also cosmiq-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; the qiskit extra): target(device, register) gives a Qiskit Target (cz on atoms in range, r and rz on every atom, measure), and SamplerV2 and EstimatorV2 run 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) and DIGITAL_DEVICE (a device with no digital profile).

  • The digital path, remote (docs/qiskit.md, “Remote”): SamplerV2(session=...) and EstimatorV2(session=...) on a vqpu:* session or cq.remote.local(). A pub goes as one job per chunk of min(256, 100,000 // shots) parameter rows, each carrying the native circuit once (the digital payload of cosmiq.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 vqpu block names its profile_version, and cq.remote.verify checks that a digital job’s receipt signs it.

  • New refusals: DIGITAL_TARGET (a digital job on an emu:* session) and, in a rehearsal, REHEARSAL_DIGITAL (rehearsing digital jobs is deferred).

  • cosmiq.emulator.Emulator, an nn.Module that 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 with spec= (and dt= for finer cells), or a loaded ScheduleData, and steps on the cells of Schedule.sample: the device clock by default. forward(schedule) returns the constructor’s observable, so nn.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 unless allow_large=True), projector(bitstrings) and diagonal(weights_or_fn, name=), whose weights may be a vector, a trainable tensor, or a function of the bits.

  • EmulationResult holds the expectations by name, the final state with keep_state=True, a lazy probabilities(), one Shots per batch row in shot mode, and an EmulationReport: the engine’s method, backend, dtype, substeps, error estimate and, after backward(), 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 pre and post images. 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, the correlation() 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. dense is the exact product of per-cell matrix exponentials (complex128, up to 12 atoms, differentiable by plain autograd), the reference the other methods converge to. split is 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 in torch-ref (one multiply-add per atom) and torch-kron (five atoms per batched 32x32 GEMM) implementations. krylov is a batched Lanczos step per cell with per-row stopping, forward only.

  • split controls its own error against tol (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" uses split, and switches to krylov only for runs without gradients that would need too many substeps.

  • Exact gradients through split by 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, which gradient="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" runs krylov in complex64 from 20 atoms when no gradient is needed (faster than double on an RTX 3090, and more accurate), and complex128 otherwise; an explicit precision="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, or max_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, for backend="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], in CONVENTIONS.state_order, each row of norm 1. Gradients flow back to psi, 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) and NoiseModel.none(), or values by hand in the units of NoiseModel.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.crosstalk and the readout errors. A trainable thermal.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.* and ramp.* 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_sigma needs a calibration_id, which seeds the offset. A model that draws nothing per trajectory runs once per row, so cosmiq-ref-1-ideal gives 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 (and vjp) 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, reports verified=False and is counted, as the other bypasses are. Every call through a gradient="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 that gradient=); "spsa" and "finite-diff" (central) sample, as the hardware would have to, on the raw parameters, with every seed derived from seed=; "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’s method ("autograd" for a dense emulator). A clamp-mode bounded value 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.spsa and cosmiq.gradients.finite_diff, the two estimators for any function of a flat parameter vector, return a Jacobian (value, standard error, evaluations). Both take low= and high=, [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.ScheduleData and cosmiq.Schedule have a capabilities_version field (default None): the device’s capabilities version a schedule was checked against. Schedule.from_data keeps it and to_data writes it back; devices.discretize sets it to the target’s.

  • formats.loads keeps a document’s capabilities version, through a Schedule too, 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 a UserWarning that says so. A schedule document that names a bundled device without its capabilities_version is 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 on split (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 the ramp.* 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) and NoiseModel.from_spec(spec, hardware=True) build that model (a hardware property says so); scaled(f) scales the rates 1/T1 and the dephasing rate and the ramp filter’s time constant, and scaled(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 NoiseModel with coherence.* or ramp.* keys needs hardware=True, and so does from_spec(include=...) naming those groups; without it, the report lists them as unused with the reason “opt-in: noise=’hardware’”. On split, noise="hardware" is forward only unless gradient="trajectory"; "krylov" and "dense" refuse it, it never runs on Triton, and method="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 the pennylane extra: 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 each RydbergEvolution block is targeted at target (rounded and checked, as to_target does) and run by the emulator on the current state. Its capabilities are a TOML file (schema 3) shipped in the package.

  • Measurements: expval, var and probs (exact, or from shots), and sample and counts with shots, of PauliX, PauliY, PauliZ, Identity and Projector, 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’s seed.

  • 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, and compute_derivatives for every output from one run), and SPSA from shots (cosmiq.gradients.spsa, its samples and step from the QNode’s gradient_kwargs; a clamp-mode value’s steps stay inside its limits). Both work through the torch and autograd interfaces.

  • Refusals raise DeviceError with “not supported”: multi-qubit gates, noise channels, mid-circuit measurements, other measurements and observables, a var, probs, sample or counts of 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 an Emulator(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) and docs/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 a FutureWarning, so users see it by default.

  • cosmiq.ScheduleData and cosmiq.ChannelData, the torch-free form of a schedule that Schedule.to_data() and formats.loads return and devices.check reads, are public, so code and type checkers can name them.

  • cosmiq.devices.check and check_register take a Schedule as well as a ScheduleData (for both the schedule and rounded_from), as the exporters do. An argument of any other type, or a spec that isn’t a DeviceSpec, raises TypeError.

  • formats.dumps(schedule, jacobian_wrt=..., assume_affine=True) writes one shared Jacobian with affine: true, so a reader may evaluate \(s_0 + J\theta\) at other parameters. The flag is your promise that drive() 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 writes affine: false when any of them fails. Without assume_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 a CustomWaveform of 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, needs spec= (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’) raises CapabilityError.

  • 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 raises CapabilityError unless loss="fold" writes it as Rydberg.

  • QEC with atom loss in decoding (cosmiq.qec, docs/qec.md; the qec extra: 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.Code and qec.Decoder protocols, qec.register_code and qec.register_decoder. A decoder gets a neutral qec.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_device maps 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 in qec.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) and QEC_CALIBRATION (a device missing a calibration value that noise_from_device maps; never taken as 0).

  • Three bundled reference devices, cosmiq-ref-1, cosmiq-ref-1-ideal (the same limits, no noise) and cosmiq-ref-1-future (every error 2x better), loaded with cosmiq.devices.get and listed by cosmiq.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_version is 2.0.0, and so is the strict envelope’s; DeviceInfo.capabilities_version states 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 corrections ramp.rabi_correction_52ns, _100ns and _200ns come from a stated model, 1 - exp(-t/τ) with τ = 25 ns, rounded to 4 decimals (0.8751, 0.9817, 0.9997; -future halves the shortfall). The calibrations’ ids are <device>/2026-10-31T00:00Z.

  • cosmiq.devices.strictest(), the strict envelope: every bundled device’s limits at once, which check(..., 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, rectangular and triangular centre the array on the origin (exactly symmetric) unless center=False; Register(...) and from_coordinates keep 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, raising FormatError. Device limits are checked when a program is targeted. distances, translated, to_dict and from_dict are 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 every cq.remote.session of 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 (a cq.runtime.Rehearsal, also rehearsal.json) gives the jobs, shots and projected seconds, with each job’s booking and outcome lines in rehearsal-jobs.jsonl. The snapshot of the target is fetched once (GET /v1/targets), or supplied as a TargetStatus or as a run’s rehearsal-snapshot.json, and checked.

  • New refusals: REHEARSAL_TARGET, REHEARSAL_SNAPSHOT, REHEARSAL_NO_SITE, and REHEARSAL_UNVERIFIED: an emulator call that bypassed a refusal anywhere in a rehearsal ends it failed with a refused report. rehearse= with resume_from= is NOT_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/1 vjp job’s cotangents may be ndarray objects (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_digest isn’t the digest of the job sent, or a job view of another job, raises RemoteError with code="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 the with block ends unless keep=True. session.run(schedule, ...) takes Emulator.run’s arguments and returns its EmulationResult; submit(...) returns a RemoteJob (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 by cq.remote.execute(job), the pure function a box answers a job with. Its results equal Emulator.run’s bitwise.

  • cq.gradients.estimate(..., emulator=session) takes a cq.remote session: 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) and cosmiq.result/1 (ignores them), as plain dicts through dumps and loads, with size caps of 1 MiB and 8 MiB, decimal-string seeds and base64 ndarray outputs; formats.schema("job" | "result"), and schemas/job-1.json, result-1.json. formats.loads returns such a document as a dict, besides a ScheduleData or a DeviceSpec: narrow its result with isinstance.

  • 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) runs cosmiq.emulator’s circuits on your own box through a cq.remote session: qml.device("cosmiq.remote", wires=4, session=box), or session=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-row cosmiq.schedule/1 built and checked on the laptop from its drive_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’s drive_fn by 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/1 carries 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/1 returns them in outputs.circuits and derivatives.circuits (a job of gates alone runs no block, so its result has no reports). cq.remote.execute runs them with PennyLane on the box, and a box without it refuses them with unsupported_field. The schemas in schemas/ follow.

  • cosmiq.runtime (docs/runtime.md): a whole training function, shipped as source, with checkpoints. @cq.runtime(target="emu:gpu", max_minutes=..., include=[...]) (or from cosmiq.runtime import runtime) makes a module-level function a runtime; train(cfg) stays the plain function and train.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 a LocalRun (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 saves state (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 a checkpoint_fallback event. 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 one slow_step event. 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 a cq.runtime.RefusedError with a code.

  • 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 a cq.runtime.RemoteRun (status, code, events(), stop(), resume(), result(), checkpoint(), logs(), box_seconds, the unverified labels). cq.runtime.attach(run_id) and cq.runtime.list(active=True) find runs from any process. Ctrl+C in events() or result() detaches and never stops the run. A remote run’s cfg is 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_UNREACHABLE and NOTHING_TO_RESUME; the site’s PLAN_LIMIT, SESSION_TOO_SHORT, LINEAGE_BUSY, CODE_MISMATCH and QUOTA are live. submit and run.resume() inside any run on a box are ALREADY_ON_A_BOX. submit refuses, 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 in names order ([B, P] broadcasts), and drive_fn takes them as cosmiq’s named parameters. Wire i is atom i. It has no matrix, decomposition, generator or shift rule, so only cosmiq.emulator runs it, and it passes qml.ops.functions.assert_valid.

  • RydbergEvolution.from_program(program, wires) builds one from a cq.program or any AnalogProgram: its register, its parameters’ current values, and a drive_fn that evaluates program.drive() with given values in their place (bounded values and parameters of several values included). op.limits() gives each value’s closed limits, (low, high) [P] float64 (\(\pm\infty\) for none): a from_program block keeps its clamp-mode bounded values’ limits, so theta.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 of dt, naming it: the cell around it would be sampled wrong (a 1 µs pulse with 0.1 µs ramps at dt=0.25 would lose its ramps). Targeted schedules sampled on their device clock always pass.

  • cosmiq.formats: the versioned JSON formats cosmiq.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) and cosmiq.device/1. dumps writes canonical JSON (RFC 8785 style, so other languages get the same bytes), loads reads either format, parses it strictly and rejects unknown physics fields, NaN, oversized documents, digest mismatches and documents that break the structural checks every Schedule keeps (labels, positions, RT, R15, R16), digest hashes the skeleton, and schema returns the JSON Schemas, which are also committed under schemas/.

  • cosmiq.Schedule: a program evaluated to float64 tensors, shaped [B, K] per channel with \(B \ge 1\) always. Schedule.from_drive evaluates 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() and from_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.sample and Schedule.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. Without dt, 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, and Shots.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 misses tol predicts 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 meets tol, since its backward pass pays for every step. method="auto" without gradients moves to krylov before the error control would run split past N_SUB_MAX rotation layers a cell, from the guess or a probe pair’s prediction. Triton, when its gate passes, also runs the probes.

  • EngineInfo.probes records every run of the error control (substeps, scheme, backend, dtype, seconds), the kept one included, and the notes list them without their times; EngineInfo.order is the split order. estimate_seconds is the error control’s time beside the kept run’s own, about half a forward pass when the first pair meets tol.

  • EngineOptions.n_sub and EngineOptions.order (given together) run split at those substeps and that order, without the error control; the result then has no error estimate, tol is 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 on emu:gpu, with at most k (1 to 3) at once. events() tags each event with its point, results() keeps point order, and runs, pending and stop() show and end the runs. The same key replays the points already started, and a changed function, include or cfg under it is SWEEP_CHANGED. PLAN_LIMIT with a run of the sweep active waits for one to end, and a 429 waits out its Retry-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, and budget() returns a cq.remote.Budget. A job past a cap raises RemoteError("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). run and submit refuse a job past them with the site’s invalid_job text, as a rehearsal does, and cq.gradients.estimate on a vQPU session splits its jobs within them.

  • New refusals: SWEEP_SIZE, SWEEP_BOXES, SWEEP_TARGET, SWEEP_SESSION and SWEEP_CHANGED. A rehearsal refuses a session’s caps as NOT_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, at bond_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 a TN_* code, and none of them can be bypassed through unverified= in v0.1. The report’s tensor field 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 with space="tensor": None, or the cell’s tested value (32 at \(N \le 12\), 64 at \(N = 16\)).

  • Emulator(gradient="trajectory") (experimental) takes gradients through noise="hardware"’s quantum jumps and mid-sequence losses on split, up to 6 atoms, the size it’s tested at against method="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 p with 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”, and gradient_mode reads "trajectory" after backward(). 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 as torch-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, as torch-kron does. Against torch-kron they match to a relative 1e-12 in complex128 and 1e-5 in complex64 (checked under TRITON_INTERPRET=1 up 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 uses torch-kron’s reductions. Under backend="auto" they’re off until a GPU session measures them faster than torch-kron’s, so an automatic Triton run’s gradient uses torch-kron’s reductions.

  • cosmiq.units.format_frequency shows 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 under precision="auto" (the report says so). Each such call warns once (cq.UnverifiedWarning), reports verified=False and is counted by cq.emulator.unverified_bypass_count(), as in space="blockade". Every call through a gradient="trajectory" emulator with precision="single" is labelled, forward calls included. No accuracy claim of any kind applies to such a result. The memory guard stays ENG_MEMORY on 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 in space="blockade".

  • Emulator(..., unverified="reason") (docs/emulator.md, “Running outside the tested range”): in space="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, another dt (one that divides 2 µs) and another C6 run, and each such call emits one cq.UnverifiedWarning naming 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 the cosmiq.emulator logger 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, .bypassed and .reason say whether a call bypassed a refusal; Emulator.last_report is the report of the emulator’s last successful call, for forward() 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 carry codes; the memory refusals ([ENG_MEMORY], [BLK_MEMORY], [PROBS_LARGE]) and the two runtime ones ([BLK_FRAME], [ENG_CONVERGE]) also derive from cq.CosmiqError.

  • space="blockade" has a memory guard for the calls that bypassed a refusal through unverified=: 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 in space="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’s emulator=, the cosmiq.remote PennyLane device (RemoteError, code unverified_local_only), the local PennyLane device ([PL_UNVERIFIED]) and cq.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 no max_minutes (emu:* targets still require it) and starts nothing. Its run and submit take shots (1 to 1,000 per row) and clock (“fast” or “realistic”) only: the box owns every option that changes the physics, so observables, gradients, noise, seed, trajectories, dt, spec, emulator, initial and keep_state are refused before anything is sent, and a vQPU job that carries anything else is refused with invalid_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 a SessionStatus or, on a vQPU session, the target’s TargetStatus from GET /v1/targets (status, queue depth, next maintenance window, calibration, shot rate, job overhead, emulated-atom cap and receipt keys). RemoteJob.receipt(verify=True) and cq.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 extra cosmiq[verify] (cryptography).

  • cosmiq.job/1 takes vqpu:* targets with an optional "vqpu": {"clock"} field, and run.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 seeded child_seed(lease seed, "group", k), the schedule rounded onto the device’s grid and checked (discretize), then noise= "hardware", samples-only, one trajectory per shot, complex128 on torch-kron. cosmiq.result/1 has an optional vqpu block, 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’s lease.

  • Waveforms: cosmiq.pwl (piecewise-linear), cosmiq.pwc (piecewise-constant), cosmiq.constant, cosmiq.sampled (piecewise- linear through its samples) and cosmiq.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)\)) and cosmiq.Drive, which combines them. Wrong waveform classes raise FormatError under rule R16. A phase built with cosmiq.constant is stored as one PWC segment.

Deprecations#

  • As on every PennyLane device, shots= on the cosmiq.emulator constructor 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.verify checks that its job_id is the view’s id (and job_id= when given) and, given the job sent, that its target is 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 a job_digest). Every failure on hostile input is RemoteError("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-only noise="hardware" runs detach it.

  • method="density_matrix" refuses backend="triton", precision="single", order=4, gradient="adjoint" and "checkpoint", keep_state=True, and any device but the CPU. Above its atom limits, run raises 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_ahs and to_pulser and run on the exporters’ own offline simulators: Braket’s RydbergAtomSimulator at 0.5 ns steps for \(10^5\) shots, graded by a G-test (\(p \ge 10^{-4}\)), and Pulser’s QutipEmulator, 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 failed with RESULT_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.channels is 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 with noise="hardware" (or a NoiseModel with hardware=True) whose T2 or loss acts, on method="split" or "auto" with torch-kron or torch-ref, with Strang (order=4 is refused), in complex128 on the CPU (it’s tested on CPU only: precision="single" and other devices are refused); every other gradient refuses "hardware" on split, and the refusal names method="density_matrix" and gradient="trajectory". The job format doesn’t take it. The ramp filter keeps \(\Omega\)’s graph under it.