Compiling a Quantum Program
In this page, you will learn how to:
- create built-in QoolQit devices,
- fetch available hardware devices from a connection,
- build a QoolQit device from a Pulser device,
- understand what compilation does in QoolQit,
- compile a dimensionless program to a target device,
- inspect the compiled Pulser
Sequence, - visualize both the original program and its compiled version.
Compiling a quantum program
Section titled “Compiling a quantum program”A QoolQit program is written entirely in dimensionless units: qubit positions are expressed as dimensionless coordinates, waveforms carry dimensionless amplitudes and detunings, and time is measured in units of a reference interaction energy, that we call . This device-agnostic formulation means that the same program can be compiled and run on any compatible hardware.
Compilation is the step that converts these dimensionless quantities into concrete physical values that a real Pulser device can execute. Concretely, it:
- Selects a physical reference scale that is consistent with the device's hardware constraints.
- Converts all dimensionless times, energies, and distances into their physical counterparts.
- Builds and returns a Pulser
Sequenceready for emulation or execution on a QPU.
The conversion rules are derived from the requirement that the dimensionless Hamiltonian and the physical Hamiltonian generate the same unitary evolution. A full derivation is given in the Adimensionalization page. The key identities are:
Choosing therefore simultaneously sets the physical amplitude scale, the detuning scale, the physical runtime, and the physical atom spacings.
Default compilation
Section titled “Default compilation”A device imposes hardware constraints on the compiled program. The two most important ones for compilation are:
- a maximum drive amplitude , which defines through the relation ;
- a minimum atom spacing , which defines through the distance relation , i.e. .
QoolQit always picks the largest consistent with these hardware constraints, because a larger reference scale realizes the same dimensionless program with a higher physical amplitude and a shorter physical runtime — the most efficient use of the hardware.
Which constraint becomes binding first depends on the dimensionless ratio
which characterizes the program, compared with the corresponding device ratio
These two example are shown in the following figure
The users works by default at . When the program's energy ratio exceeds the device's energy ratio, the drive amplitude bound is reached first (blue line). The largest valid is then obtained by rescaling the amplitude limit to the maximum allowed value (as denoted by the arrow).
In this regime the compiled program runs at maximum device amplitude, and the physical atom spacings are larger than the device minimum.
When the program's energy ratio is within the device budget, the minimum-spacing constraint is reached first (red line). The largest valid is obtained by saturating the distance limit.
In this regime the compiled register uses the smallest physical spacing the device allows, and the resulting amplitude is below .
Working point compilation
Section titled “Working point compilation”In progress...
