qoolqit.program
program
Classes:
-
QuantumProgram–A program representing a Sequence acting on a Register of qubits.
QuantumProgram(register: Register, drive: Drive)
A program representing a Sequence acting on a Register of qubits.
Parameters:
-
(registerRegister) –the register of qubits, defining their positions.
-
(driveDrive) –the drive acting on qubits, defining amplitude, detuning and phase.
-
API reference
qoolqit.execution
execution
Methods:
-
compile_to–Compiles the quantum program for execution on a specific device.
Attributes:
-
compiled_sequence(Sequence) –The Pulser sequence compiled to a specific device.
-
drive(Drive) –The driving waveforms.
-
is_compiled(bool) –Check if the program has been compiled.
-
register(Register) –The register of qubits.
Source code in qoolqit/program.py
compiled_sequence: PulserSequence
property
The Pulser sequence compiled to a specific device.
drive: Drive
property
The driving waveforms.
is_compiled: bool
property
Check if the program has been compiled.
register: Register
property
The register of qubits.
compile_to(device: Device, profile: CompilerProfile = CompilerProfile.MAX_ENERGY, device_max_duration_ratio: float | None = None) -> None
Compiles the quantum program for execution on a specific device.
The compilation process adapts the program to the device's constraints while preserving the relative ratios of the original program parameters. Different compilation profiles optimize for specific objectives:
- CompilerProfile.MAX_ENERGY (default): Scales the program to utilize the device's maximum capabilities. The drive amplitude and the register positions are rescaled to achieve respectively the maximum amplitude and the minimum pairwise distance compatible with the input program and the device's constraints.
- CompilerProfile.WORKING_POINT: .
Further options DO NOT preserve the input program, but rather adapts the program to the device's constraint. Programs compiled this way are not guaranteed to be portable across devices.
- device_max_duration_ratio: Rescale the drive duration to a fraction of the device's maximum allowed duration. This option is useful in adiabatic protocols where one simply seek to minimize the time derivative of the drive's amplitude.
Parameters:
-
(deviceDevice) –The target device for compilation. Must be a QoolQit Device.
-
(profileCompilerProfile, default:MAX_ENERGY) –The compilation strategy to optimize the program. Defaults to CompilerProfile.MAX_ENERGY.
-
(device_max_duration_ratiofloat | None, default:None) –Whether to set the program duration to a fraction of the device's maximum allowed duration. Must be a number in the range (0, 1]. Can only be set if the device has a maximum allowed duration.
Raises:
-
CompilationError–If the compilation fails due to device constraints.