Concepts and architecture#
ParaQeet is organized as a stack of layers. Each layer interacts only with the layer above it in the hierarchy, which keeps the codebase modular: you can swap a pulse parametrization, a propagator, or an optimizer without touching the rest of the setup. The codebase follows the modular structure shown below:
The modules#
- Signal (
paraqeet.signal) Pulse parametrizations. Envelope shapes such as
GaussEnvelopeorDCRABEnvelopeare combined by generators like theIQMixer(envelope mixed with a local oscillator) or thePWCGenerator(piecewise-constant bins for GRAPE) into the control signal seen by the system.- Hamiltonian (
paraqeet.hamiltonian) The physical system: Hamiltonians for qubits, transmons, and resonators, couplings and drives, composed with
CompositeHamiltonian. Define your own Hamiltonian by following theHamiltonianclass structure.- Equation of motion (EOM) (
paraqeet.eom) The eom layer turns a Hamiltonian into an equation of motion — the
SchroedingerEquationfor closed systems or the LindbladMasterEquationfor open systems.- Propagation (
paraqeet.propagation) Solvers of the equation of motion, from piecewise matrix exponentials (
Expm) to Euler, Runge-Kutta and Verner ODE integrators. Gradients come from wrapping any of them inGOAT,GRAPEorAutoDiffGradients, which add analytic or automatically differentiated gradients to the propagation they wrap.- Measurement (
paraqeet.measurement) Goal functions: state transfer and unitary fidelities, the Makhlin functional, pulse smoothness, and weighted sums of goals. A measurement reduces a propagated state to the scalar that the optimizer minimizes.
- Optimizers (
paraqeet.optimizers) Gradient-based (
ScipyOptimizerGradient) and gradient-free (CMA-ES, Bayesian) algorithms, including a gradient-based dCRAB optimizer.
Parameters: Quantity and OptimizationMap#
Fundamental classes that connect the various modules across the package:
A
Quantityrepresents every tunable value — amplitude, frequency, coupling strength — together with its bounds and unit. Internally it is stored on a normalized scale, so optimizers always work on well-conditioned values regardless of physical magnitude. Quantities can be derived from other quantities via relations and update automatically.An
Optimizableclass that represents classes that contain parameters that can be optimized. In case anOptimizableclass is alsoDifferentiableit also provides gradients with repspect to its own parameters.An
OptimizationMapcollects which quantities fromOptimizableclasses that are optimized in a given run. This makes the choice of optimization variables explicit and independent of the model definition: the same setup can optimize two parameters or twenty.
Choosing an optimization method#
Method |
Pulse parametrization |
Gradients |
Example |
|---|---|---|---|
GOAT |
Analytic envelopes (Gaussian, flat-top, …) |
Analytic, exact |
|
GRAPE |
Piecewise-constant bins |
Analytic, exact |
|
GOAToverGRAPE |
Analytic envelopes, propagated piecewise |
Chain rule of GOAT through GRAPE |
|
Gradient-free |
Any |
None (CMA-ES, Bayesian) |
As a rule of thumb: use GOAT when a few physical pulse parameters should stay interpretable, GRAPE when you want maximum pulse flexibility per time bin, and GOAToverGRAPE when you want smooth analytic pulses with the propagation efficiency of GRAPE. Gradient-free methods are a fallback for measures without gradients, e.g. when optimizing directly against an experiment.
Refer to the example gallery for examples on all of the above.