Repository navigation
Releases
Releases · NVIDIA/cudaq-pulse
cudaq-pulse 0.1.0
The first public release, a research preview: APIs, dialects and numerical
behavior may change in any 0.x release.
Added
- Gate calibrations.
pulse.gatesnames the gates a quantum system is
calibrated for (X,X90,Y,Y90,READOUT,CZ), and
get_calibration(gate, transition=(0, 1))gives each one's pulse: in a
kernel from a line,get_drive_line(q).get_calibration(pulse.gates.X)(a
DragPulse, whichdrive(line, pulse)plays) and
get_readout_line(q).get_calibration(pulse.gates.READOUT)(a
ReadoutPulse); outside one from a handle,
dev.qudits[i].get_calibration(...), and from a coupling,
dev.coupling(a, b).get_calibration(pulse.gates.CZ)(aFluxCZ). A
qudit'sdriveandreadout(MicrowaveDrive,DispersiveReadout)
hold its physics; its tuned pulses are given ascalibrations=, by gate,
and read only throughget_calibration, as a coupling's are.
What a quantum system does not publish is derived: anXamplitude from the
pulse's area,X90at half of it,YandY90at +90 degrees; an
unpublishedCZ,READOUTor other transition is an error naming the
coupling or qudit. A qudit'smetadataholds the user's own JSON
values, which the library never reads and which do not make two quantum systems
differ; system files keep them. - Shared lines. A
DriveLineorReadoutLinemay reach several
qudits and play several tones at once: a readout feedline is
ReadoutLine([0, 1, 2, 3], max_concurrent_tones=4)(1 by default, at most
the qudits it reaches). Every line hasqudits; only a dedicated line has
qudit. A kernel'sget_readout_line(q)of a qudit on it gives one of
its tones, forq. The compiler checks that a line reaching several
qudits plays at mostmax_concurrent_tonestones at once (a kernel with
runtime qudits, when a call binds them); spacing andmax_amplitude
apply per tone, waveform memory andmax_frequencies_per_lineper physical
line. Format/2of the controller export lists a shared line once,
with itsmax_concurrent_tones, and gives each event on it its
tone_slotandqudits; format/1raisesUnsupportedErrorfor a
program on a shared line. System files hold one as{"qudits": [...], "max_concurrent_tones": 4, "delay_ns": 12.0}. A qudit is reached by at
most one line of each kind. A program on a delayed shared line does not
export yet. - Pickling, for process pools and caches on disk. Kernels pickle as
functions do: by reference, or with cloudpickle (Ray, Dask) by value
when defined in__main__, at the prompt or inside a function. Quantum systems, qudit handles and registers
pickle as what they were built from and unpickle equal, with equal
hashes; a process builds each quantum system it unpickles once. A quantum system's
fingerprint covers its calibration: a quantum system with and without one are
two quantum systems. A shipped calibration pickles as its name, checked against
the file shipped where it unpickles; any other, as its values. Programs
(ck.lower(...), bound or not) pickle as MLIR bytecode stamped with the
build that compiled them (hashes of its native and Python sources, taken
when it was built) and the Python, and run unpickled (export, simulate, bind)
without compiling again; another build refuses them with
UnsupportedError, saying to compile again. Errors pickle with what they
report, so a process pool re-raises them in the parent as they were
raised. Quantum systems now compare by content. - Controllers with their own clocks. Kernels count cycles of the
quantum system's program clock,pulse.quantum_system(..., clock_ghz=)(or the
quantum system's own). A controller whose clock is slower starts and times operations
only every few program cycles: the scheduler puts each line's operations
on its controller's grid and asyncon the grid its lines share, an
operation off the grid is a compile error naming the line, its controller
and the nearest valid lengths, andpulse.cycles_on(line, n)rounds a
length onto the grid (pulse.Rounding). Controller programs count their
own cycles, with"program_clock_ghz"written when it differs;
ControlSystem.reference_clock_ghzis checked against every controller
clock and exported; the simulator samples generated waveforms at the
line's controller clock. - Runtime qudits. A parameter annotated
QuditorRegister(or
list[Qudit],tuple[Qudit, ...]) is bound at each call, like a float:
the kernel compiles once and runs on any qudits of a quantum system with the same
structure, including a recalibrated one. An unannotated qudit parameter
stays static, whatever the call passes.list[float]parameters are runtime vectors. Their
controller exports carry aprogram_id, shared by every call of one
compile, andsymbols: each symbol's value in the call, and per event the
symbols its qudit, frequency, phase and waveform depend on. - Variadic qudits. A kernel may take
*qudits:
def k(tau: float, *qudits: Qudit)is called ask(tau, q0, q1, ...)or
k(tau, *dev.qudits[0:4]), and from another kernel as
k(tau, *qudits). In the kernelquditsis a register of the call's
qudits, which indexes, slices, iterates and has alen(). Annotated
Quditit is a runtime register, compiled once per number of qudits;
unannotated, the kernel is specialized on the qudits. A call may pass
none. A*parameter takes only qudit handles: another annotation is a
TypeErrorwhen the kernel is defined, another value one when it is
called. Kernels still cannot take**kwargs. A list or tuple of qudit
handles is not a register: pass aRegister(qs.qudits[0:4]) or use
*qudits.kernel.static_parametersandkernel.runtime_parameters
list parameters in the order of the signature. - Control systems. A quantum system can hold the controllers that play it:
pulse.Controller(a controller's limits, the drive and readout lines it
plays, its peer latency, clock skew and alignment tolerance, its
supports,backend,modelandversion) andpulse.ControlSystem
(its controllers, its links by name, eachLinkwith thecontrollers
it reaches).pulse.quantum_system(quantum_system, control_system=...)checks
the wiring against the quantum system and raises one
QuantumSystemDefinitionErrorlisting every problem.compile(kernel, quantum_system=qpu)checks every program against
the system: a line on no controller, each controller's own limits, a
capability (pulse.Capability) a controller lacks, and a call over a link
that does not reach its controllers fail to compile.
compile(kernel, control_system=...)takes a system, or oneController
that stands for a system of it alone: what that controller cannot take is
an error that says to describe the whole system. A system without
controllers states only its links and lanes. A controller that
supportsloopholds a rolled loop's body once againstmax_pulses; one
that does not plays it unrolled, and its limit error names the loop; unrolling adds pulses,
not waveform memory, which holds each shape once.rcpkeeps a branch
on a readout thefeedback_latency_cyclesof the controllers that read out.
A line's calibrated delay is part of its declaration,
Controller(drive_lines=[DriveLine(5, delay_ns=4.0), 6], readout_lines=[ReadoutLine(5, delay_ns=12.0)])(times or numbers of ns;
a bare carrier index is an undelayed line), and a control system's
reference_clock_ghzis its shared clock; new delays alone schedule its
programs again without tracing them. Without a
declaredclock_ghz, a quantum system's program clock is its fastest
controller clock when every other one divides it; clocks that do not
divide evenly are aQuantumSystemDefinitionErrorthat lists the program clocks
that work, and every controller clock must be a whole multiple of the
reference clock. Each controller of a system may run its own clock: every
line is scheduled on its own controller's grid, asyncand a wait from
an answer on the grid all lines share, and a runtime qudit's lines on that
shared grid too, so one schedule fits any qudits a call binds. Each
controller's limits, line delays andrcpreadout latency count its own
cycles, andcustom()samples an envelope at the rate of the line that
plays it, while samples given at another rate fail to compile.
export_to_controller(controller=k)andexport_to_emulator(controller=k)
export controllerk's part of the program in its own cycles: its
lines, the events it plays, submits or takes the answer of, its calls and
its limits, with the program's event and line ids. A program that plays
the lines of more than one controller needscontroller=; a controller
the program does not use exports a valid empty program, and a program
of calls alone is exported by the controller that makes them.
Link(per_controller=True)(per_controller = truein a system file)
gives each controller its own instance of a link, shared by default:
its own slots, so its calls do not wait for another controller's, its own
calls in its export (tagged"controller"), its own processor to place
the link on, and no cross-controller start uncertainty in its budgets. A
call whose measurements and answer are on different controllers fails to
compile.
Budgets between controllers add each one's start uncertainty, its
clock_skew_cyclesplus one of its own cycles without a
reference_clock_ghz: a pulse that branches on, or computes with,
another controller's readout waits for the reader's feedback and peer
latency and both uncertainties (rcpwaits that long for each pair of
reader and user, and a pulse on the reader's controller its feedback
latency alone; starting sooner is aControllerLimitErrornaming the
cycle), and an answer ...
mlir-toolchain-22.1.8
Prebuilt MLIR toolchain used to build cudaq-pulse.