Conventions#

Every cosmiq object means the same physics, written once on this page: the Hamiltonian, its signs, the units, positions, the bit order and time. The same conventions are in code as cosmiq.conventions.CONVENTIONS. Results record which version of these conventions they use, and changing any meaning below is a breaking change that bumps the version.

This is conventions version 1.

The Hamiltonian#

A program describes this Hamiltonian, written as \(H/\hbar\) in rad/µs:

\[\begin{split}\begin{aligned} \frac{H(t)}{\hbar} ={}& \sum_i \frac{\Omega(t)}{2}\left(e^{i\varphi(t)}|r_i\rangle\langle g_i| + e^{-i\varphi(t)}|g_i\rangle\langle r_i|\right) \\ &- \sum_i \big(\Delta(t) + c_i\,\delta(t)\big)\,n_i \\ &+ \sum_{i<j} \frac{C_6}{|\mathbf r_i - \mathbf r_j|^6}\,n_i n_j \end{aligned}\end{split}\]

Here \(n_i = |r_i\rangle\langle r_i|\) counts a Rydberg excitation on atom \(i\).

Symbol

Meaning

cosmiq channel

Waveform shape

Sign

\(\Omega\)

Rabi frequency

amplitude

piecewise-linear

\(\Omega \ge 0\)

\(\Delta\)

global detuning

detuning

piecewise-linear

either

\(\varphi\)

laser phase

phase

piecewise-constant

either

\(\delta\)

local detuning

local_detuning

piecewise-linear

\(\delta \le 0\)

\(c_i\)

weight of atom \(i\) in the \(\delta\) term

LocalDetuning.weights

fixed numbers

\(c_i \in [0, 1]\)

\(C_6\)

van der Waals coefficient

the device’s species.c6

a constant

\(C_6 > 0\)

  • cq.constant and cq.sampled are piecewise-linear, so they count as PWL for \(\Omega\), \(\Delta\) and \(\delta\). A phase may be one value (phase=0.5), a cq.pwc, or a cq.constant, which is constant and so is stored as one PWC segment.

  • \(C_6\) comes from the device, never from a global constant: each device sets its own.

  • The signs (\(\Omega \ge 0\), \(\delta \le 0\)) and the range of \(c_i\) are device limits. They’re checked when a program is targeted at a device, not when it’s built.

The phase sign#

\(+\varphi\) sits on \(|r\rangle\langle g|\): the drive term is \((\Omega/2)\left(e^{i\varphi}|r\rangle\langle g| + \mathrm{h.c.}\right)\).

The local-detuning sign#

The local term enters as \(-(\Delta + c_i \delta)\, n_i\), with \(\delta \le 0\). A site with \(c_i = 1\) is shifted by the full \(\delta\); a site with \(c_i = 0\) isn’t shifted.

  • Pulser uses exactly this term: its per-qubit detuning is the global one plus \(w_i \delta_\mathrm{DMM}\), entering as \(-\delta n\), with \(\delta_\mathrm{DMM} \le 0\). It maps directly.

  • Braket writes \(H_\mathrm{shift} = -\Delta_\mathrm{local}(t) \sum_k h_k n_k\) with \(\Delta_\mathrm{local} \ge 0\): the same operator with the opposite allowed sign. So the Braket export rewrites it exactly:

    • \(\Delta' = \Delta + \delta\) (the global detuning);

    • \(h' = 1 - c\) (the pattern);

    • \(\Delta_\mathrm{local}' = -\delta \ge 0\).

    The check:

    \[ -(\Delta + \delta)\, n - (1 - c)(-\delta)\, n = -(\Delta + c\,\delta)\, n.\]

    The exporter re-checks \(\Delta'\) against the global range and slew rate. local_detuning="direct" keeps the sign as is, for simulators that accept either.

How the signs are tested. A resonance between two atoms fixes the signs of \(\Delta\) and \(\delta\), and a Ramsey sequence then fixes \(\varphi\)’s (how the signs are tested).

Units#

cosmiq computes in one system. Plain numbers always mean these units:

Quantity

Unit

Multipliers in cosmiq.units

time

µs

us, ns, ms, s

distance

µm

um, nm, m

angular frequency

rad/µs

rad_per_us, MHz, kHz

phase

rad

slew rate

\(\mathrm{rad/\mu s^2}\)

\(C_6\)

\(\mathrm{rad \cdot \mu m^6/\mu s}\)

MHz is for input and display only. 1 * MHz is \(2\pi\,\mathrm{rad/\mu s}\); nothing is stored in MHz. Messages show both, with cosmiq.units.format_frequency: "9.425 rad/µs (2π·1.500 MHz)".

A device limit isn’t always a value the device can play: see Keeping a parameter inside the device’s limits.

Schedule values are float64 tensors with a batch axis first: shape [B, K] per channel, with \(B \ge 1\) always present.

Positions#

  • Positions are absolute, in µm, measured from the beam axis at (0, 0). The field of view is the window \(|x| \le\) half_width, \(|y| \le\) half_height of the device’s geometry.

  • The Register constructors (chain, square, rectangular, triangular) centre the array on the origin by default: the middle of its bounding box sits on the beam axis, exactly. Pass center=False to put atom 0 at the origin instead. Register(...) and Register.from_coordinates(...) keep the positions you give.

  • Positions are 2D. Exporters translate positions when an upstream format needs it.

  • Targeting rounds the positions onto the device’s position grid, and the register rules (atom count, field of view, spacing) are checked on the rounded positions.

Atom order and bits#

  • Atom order is the register’s order, atom 0 first, in every array and result.

  • Measured labels are uint8:

    Label

    Meaning

    0

    ground

    1

    Rydberg

    2

    lost (the atom wasn’t seen)

  • State order (CONVENTIONS.state_order): a state vector or a probability vector over \(N\) atoms has \(2^N\) entries, and entry \(b\) is the basis state with \(b = \sum_i s_i \cdot 2^{N-1-i}\), where \(s_i = 0\) for \(g\) and \(1\) for \(r\). Atom 0 is the most significant bit, so the entries read like their bitstrings, atom 0 first: for two atoms the order is gg, gr, rg, rr. Pulser’s state vectors use the basis order [r, g], so its index for the same state is \(2^N - 1 - b\).

  • The emulator uses this order for its states (EmulationResult.state), its probabilities(), the bits a diagonal(fn) weight function gets, and its bitstrings (projector("0110"), atom 0 first). The emulator has the details.

Time#

  • Breakpoint times are fixed Python floats, in µs. They start at 0 and increase strictly. PWL waveforms have a value at each breakpoint and are linear in between; PWC waveforms have \(K + 1\) segment edges and a value on each \([t_k, t_{k+1})\).

  • All channels end together. cq.pad_to(waveform, t) is the explicit way to make a shorter channel reach \(t\). Ends that differ only by floating-point rounding count as equal.

  • Sampling (Schedule.sample(dt)) uses the midpoint rule: cell \(j\) covers \([j \cdot dt, (j+1) \cdot dt)\) and is represented by its midpoint. PWL channels are interpolated there, which is their exact average over the cell, since every breakpoint lies on the grid: the duration and every breakpoint must be whole numbers of dt, and sample names a breakpoint that isn’t. PWC channels take the value of the segment that holds the midpoint. Without a dt, a targeted schedule is sampled on its device’s clock period (4 ns on cosmiq-ref-1).

  • The emulator holds each value for one clock tick, as the device plays it: every channel stays at its cell’s midpoint value for the whole cell, a 4 ns staircase on cosmiq-ref-1. An untargeted schedule can use finer cells (dt=), down to whatever divides its breakpoints.