Skip to main content

Release Notes

What changed in each version of clerq, and what you need to do about it.

This page is the readable version of the CHANGELOG, which has the full list of changes. Versions are newest first, and Semantic Versioning applies: a minor version adds features, and anything marked breaking will need a change to your code or a recalculation of your results.

Entries before 0.13.0 use the old package name, maxwellbloch, and its old class names, as they were at the time. See MaxwellBloch is now clerq for the rename.

Unreleased

Python 3.11 or later is now required (it was 3.10), because Pillow 13, which fixes a number of security advisories, no longer supports 3.10.

New time functions. clerq.t_funcs has four new pulse shapes: sin2 (a sin-squared pulse of finite duration between on and off), super_gaussian (a flat-top pulse with smooth edges; order 1 is a Gaussian and fwhm is the FWHM at every order), and exp_decay and exp_rise (single-sided exponentials, the envelopes of an emitted and an absorbed photon). square takes n_pi, the pulse area in multiples of \(\pi\), as an alternative to ampl, and sinc takes an optional centre. All work with clerq.autodiff; as with square, the edge time where exp_decay and exp_rise jump (on, off) cannot be differentiated. See Built-in time functions.

0.15.0 — 24 October 2026

Float32 gradients. clerq.autodiff no longer insists on 64-bit precision. It computes in whatever precision JAX is set to, so it runs with JAX’s default (float32) as well as with jax_enable_x64, and the solver tolerances default to values each precision can meet. On the benchmark problems float32 agrees with float64 to \(10^{-6}\) to \(2\times10^{-5}\) in the field and \(6\times10^{-7}\) to \(5\times10^{-5}\) in gradients, and runs 1.1 to 2.1 times faster on the CPU. Keep float64 for finite-difference checks and when you need tight tolerances. See Autodiff performance and validation.

Doppler class spacing. velocity_classes takes a new thermal_delta_spacing, a maximum spacing between the classes, in place of thermal_delta_steps. Pass "auto" for the largest spacing with no spurious Doppler echo: a grid of spacing \(h\) repeats the response of a Doppler-dependent coherence at \(t = 1/(b h)\), and the result is wrong if that falls inside the time window and is not damped by the decay. "auto" uses each level’s Doppler shift and the decay rates, so it depends on the system as well as the window; thermal_delta_echo_tolerance sets how far the echo must be damped, and the spacing is also kept fine enough to resolve the thermal width. See Velocity Classes.

Velocity-class weights (changes results). Each class is now weighted by the detuning interval it represents as well as its Boltzmann density. Before, a non-uniform grid (an inner band from thermal_delta_inner_*) over-weighted the densely sampled region, so such results change. Uniform grids are unchanged. thermal_weights is still the density; the intervals are thermal_widths and the weights used are thermal_quadrature_weights. A savefile solved before this on a non-uniform grid is rejected on load: delete it or pass recalc=True.

0.14.0 — 23 October 2026

Unit conversions. The new clerq.macro module converts laboratory quantities (intensity, beam power, temperature, density, linewidth) to clerq’s MHz, µs and cm units. See Converting from Experimental Units.

DC magnetic field. A system can now sit in a static B-field along the quantisation axis: add a b_field block (magnitude, units, and the per-level g_F and m_F) and each sublevel shifts by \(g_F m_F \mu_B B\). For hyperfine atoms Atom1e.get_zeeman_levels() supplies g_F and m_F, and the field can be a differentiable parameter of to_autodiff(). See the B-field usage page. Without a b_field nothing changes.

Stability checks. solve() now stops with PropagationInstabilityError when the field blows up, and warns when the z-step looks too coarse (estimated from the difference between the Euler and Adams-Bashforth predictions, available as solver.step_error_estimate). Pass z_steps_inner="auto" to refine the step automatically, or check_stability=False to switch the checks off. See Numerical Stability and Step Sizes.

Time-grid checks. solve() also warns when t_steps is too coarse to resolve the fields and coherences, or when the time window cuts off a pulse or its ringing, and suggest_t_steps() estimates a grid from the problem’s frequency scales before you solve.

Gradients through the propagation (optional, experimental). With pip install 'clerq[jax]', solver.to_autodiff() returns a differentiable version of a PropagationSolver problem: exact gradients of any loss of the propagated field with respect to pulse parameters, interaction strengths, detunings, decay rates or a sampled input field, for about the cost of five to six propagations however many parameters there are. It is meant for gradient-based design of pulses and media, and ad.minimize(loss, params) follows the gradient with an optax optimiser (Adam by default). import clerq itself never loads JAX. See the pulse design example and the API reference, and CHANGELOG.md for the supported features and limits.

Each decay’s rate is a parameter too (decay_rates, for spontaneous decay, ground-state decoherence or dephasing), and clerq.autodiff.controls expands a free-form control in a few smooth functions, which stops an optimiser from exploiting the time grid.

WarningDetuned fields: results change

Earlier versions drove the Hamiltonian with the real part of the field only. That is exact for resonant, real fields on a symmetric, equally weighted velocity-class grid (those results are unchanged), but wrong for a single detuned field, a two-photon offset or an asymmetric class grid: a weak probe through an optical depth of 6 at two half-widths detuning came out with transmission 1.1 (unphysical) instead of 0.30. PropagationSolver and to_autodiff() now use the full complex envelope. Rerun any detuned results from older versions. PropagationSolver(real_drive=True) reproduces the old behaviour and is deprecated.

Cyclic field accessor. solver.rabi_freqs_zt is the solved field as a cyclic Rabi frequency, the same unit as rabi_freq in the problem definition, so you no longer divide by \(2\pi\). solver.Omegas_zt (angular) is deprecated but still works, and the arrays returned by solve() are unchanged. The output of to_autodiff() is cyclic too, so it compares directly with rabi_freqs_zt.

NoteUpgrading from 0.13.1

Your code keeps working: the old names still run and raise a DeprecationWarning. Switching to the new names now will save you work when they are removed in a future release.

Clearer names, all available from import clerq.

Before Now
clerq.mb_solve.MBSolve clerq.PropagationSolver
clerq.ob_solve.OBSolve clerq.LindbladSolver
clerq.ob_atom.OBAtom clerq.System
clerq.field.Field clerq.Field
mbsolve(), obsolve() solve()
atom (argument, attribute, JSON key) system
  • “System” replaces “atom” because the solvers work for any few-level open quantum system, not only atoms.
  • The modules are now clerq.propagation, clerq.lindblad, clerq.system and clerq.system_base.
  • Helper functions that take a solver always call that argument solver. Before, it was mb_solve in spectral, fixed and fileio, and mbs in plot.
  • mbsolve_euler() and mbsolve_ab() are deprecated in favour of solve(step=...).
  • The mbsolve and obsolve command-line scripts keep their names.

Fixed: solving twice gave different results. Calling solver.solve() again on the same PropagationSolver (or editing a field’s rabi_freq_t_args and solving again) started from the last solve’s leftover field instead of the pulse you defined, so the second and later results were wrong. Repeated solves now match a fresh solver. If you re-solved the same object, recalculate.

Fixed: Adams-Bashforth output was one inner step early. With the default step="ab" and z_steps_inner > 1 (the default is 2), each stored slice of the field and the states was one inner step short of its nominal z. Slices are now at zlist[j]. Problems with z_steps_inner=1, and step="euler", are unchanged, and so are problems whose medium starts a couple of inner steps after z_min, because a second error cancelled the first there. Problems where the medium reaches z_min (for example z_min=0 with the medium from z=0) shift, by an amount first order in the inner step: re-run them and discard old .qu files. This is a correction; there is nothing to change in your code.

Cached results. A .qu savefile made by an earlier version no longer matches its problem definition (which now has a system key), so it is solved again and overwritten the first time you use it.

Other changes

  • PropagationSolver and System have class docstrings describing their arguments.
  • The release assets on GitHub are now just the wheel, the sdist and their attestations.
  • The documentation has correct API page titles, and several docstrings that disagreed with their signatures are fixed.
  • The lockfile is updated to clear security alerts in documentation and development packages. The installed package is unaffected.

0.13.1 — 9 October 2026

A fix-up release after the rename.

Fixed

  • The mbsolve and obsolve command-line scripts work again. They had been broken since 0.10.0 and 0.11.0, and mbsolve also failed on Python 3.14. The unused --pbarchunksize option is removed.
  • The example notebooks are recalibrated after the 0.13.0 factor-of-2 fix, so each example solves the physical problem it was designed for and gives the same results as in 0.12.0.

Added

  • The stimulated three-pulse photon echo example.
  • CITATION.cff, so GitHub’s “Cite this repository” works.

Changed

  • clerq is described as classical Maxwell fields propagating through open quantum systems, not as a Maxwell–Bloch solver.
  • The documentation outputs are regenerated cleanly, and there is a page explaining the new name.

0.13.0 — 9 October 2026

ImportantBreaking: results change

The Maxwell propagation equation was missing a factor of 2, so the optical depth in earlier versions was half its physical value. Absorption and propagation results change, so recompute any cached .qu results and any figures made with earlier versions. The theory curves in clerq.spectral are updated to match.

  • Renamed from maxwellbloch to clerq. Change import maxwellbloch to import clerq. The PyPI name is also clerq, the Plotly theme is named "clerq", and .qu files record the clerq version.
  • The documentation moved from Sphinx and Read the Docs to Quarto, at clerq.org.

0.12.0 — 6 May 2026

  • Plotting: plot.field_profile and plot.field_z_profile_anim, a show_z_bounds option, and a speed_of_light option to plot in the fixed frame. plot.spectrum accepts x-axis bounds.
  • Faster: the number-density profile is computed once up front, and the inner loop over sigma operators is vectorised.
  • Examples: the SIT, linear absorption, V-system and Λ EIT/slow-light examples are each merged into one notebook.

0.11.0 — 3 May 2026

New

  • Counter-propagating fields: Field(counter_propagating=True) models a field travelling against the others. If the field has depleted so much that forward-only propagation is no longer valid, a CounterPropagatingDepletionError is raised (turn the check off with check_counter_prop_depletion=False).
  • Plotting module plot, built on Plotly with a shared theme: field space-time and envelope plots, spectra, populations, coherences and pulse area. Install it with the plot extra.
  • Spectral windows: the FFT functions in spectral accept a SciPy window, and plot.spectrum gains freq_range, an arcsinh frequency scale and window.
  • New examples: Autler–Townes splitting, CPT dark resonance, adiabatons, two-pulse photon echo, odd-π sech pulses and the Rb 87 D2 cycling transition, plus an examples gallery page.

Breaking

  • The printed progress reports of MBSolve.mbsolve and its pbar_chunk_size argument are replaced by a tqdm progress bar. Use progress (default True) and progress_show_area to control it, and remove any pbar_chunk_size argument.

0.10.0 — 25 April 2026

Breaking

  • OBSolve.solve is renamed OBSolve.obsolve.

New

  • Savefile check: a .qu file stores a hash of its problem definition and the library versions. Loading a file built from a different problem raises ValueError, and older files load with a warning.
  • Generated API reference pages.

Fixed

  • A missing savefile directory is created before the .qu file is written.
  • An IndexError when fields are added to a system after construction.

Changed

  • maxwell_boltzmann moved to utility and gained an offset parameter.

0.9.0 — 24 April 2026

  • About 43× faster inner propagation loop, from building the field interpolation once per z-step with QuTiP 5.
  • Field.upper_levels() and Field.lower_levels() return the sorted level indices a field couples.
  • LevelF checks that |J−I| ≤ F ≤ J+I and raises ValueError for impossible hyperfine quantum numbers.
  • Internal methods are renamed with a leading _ to mark them as private (for example build_H_0 is now _build_H_0). If you called any of these directly, update the name.

0.8.1 — 23 April 2026

Maintenance: type annotations throughout, mutable default arguments fixed, more tests, and a docs build in CI. fixed.rabi_freq_abs is removed; use fixed.rabi_freq(..., part="abs").

0.8.0 — 15 April 2026

A modernisation release.

  • Supports QuTiP 5, NumPy 2 and SciPy 1.14+.
  • Python 3.10 or later is required.
  • Packaging moved to pyproject.toml; uv is the main environment manager.
  • CI moved to GitHub Actions with trusted publishing to PyPI.

Older releases

Version Date Highlights
0.7.1 10 Aug 2020 Fixed a bug when adding multiple fields.
0.7.0 11 Jul 2020 mbsolve and obsolve scripts; set sech pulse width by FWHM and sech/Gaussian amplitude by area in multiples of π; the default Rabi frequency of a field changed from 0.0 to 1.0; Structure, Angular Momentum and Examples docs.
0.6.0 17 May 2020 Fixed Doppler broadening; Usage and Examples docs.
0.5.0 7 Aug 2019 Hyperfine structure: strength factors, Clebsch–Gordan coefficients, Wigner 3j and 6j symbols, isotropic fields; set the initial state; solver options; fixed the detuning term for fields coupling several upper levels.
0.4.0 28 Aug 2018 Atom labels; empty velocity classes allowed; ob_atom renamed atom; fields default to a constant time function; MP4 script fixes.
0.3.0 8 Jan 2018 Spectral and fixed-frame modules; FFT analysis; custom input fields; run from the command line; MP4 and GIF tools; Travis CI.
0.2.0 27 Mar 2017 First release: solves the Maxwell–Bloch equations.