Dynamiqs

Latest version: v0.3.2

Safety actively analyzes 722491 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.3.2

This release introduces several new features and bug fixes. The most significant addition is the new `Event` method for solving the jump stochastic Schrâdinger equation, the result of months of work by dkweiss31, and a major step towards a blazingly fast Monte Carlo solver for the Lindblad master equation. We also fixed an important performance issue with the matrix multiplication of a sparse qarray by a dense qarray on the left, which led to degraded simulation speeds for large systems. Also, a warm welcome to CyrilDeloince, and congratulations on his first contribution! 🍾

πŸ”¨Β Breaking changes

- Renamed the `dq.solver` namespace to [`dq.method`](https://www.dynamiqs.org/stable/python_api/index.html#methods-dqmethod), and renamed the `solver` keyword argument to `method` in [`dq.sesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/sesolve.html), [`dq.mesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/mesolve.html) and all other quantum solvers.
- Renamed the [`dq.set_precision()`](https://www.dynamiqs.org/stable/python_api/utils/global_settings/set_precision.html) argument for single precision to `"single"` instead of `"simple"`.
- Changed the default value for the `progress_meter` options in quantum solvers: use `True` for a tqdm progress meter, `False` for no output, and `None` to use the global default progress meter (see the new [`dq.set_progress_meter()`](https://www.dynamiqs.org/stable/python_api/utils/global_settings/set_progress_meter.html) configuration option).

πŸš€ Features

- Added [`Event`](https://www.dynamiqs.org/stable/python_api/method/Event.html) method to solve jump SSE with [`dq.jssesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/jssesolve.html) (#748).
- Added `normalize` option to the [`Rouchon1`](https://www.dynamiqs.org/stable/python_api/method/Rouchon1.html) method (#904).
- Added [`Rouchon1`](https://www.dynamiqs.org/stable/python_api/method/Rouchon1.html) method to solve diffusive SME with [`dq.dsmesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/dsmesolve.html) (#907).
- Added [`EulerMaruyama`](https://www.dynamiqs.org/stable/python_api/method/EulerMaruyama.html) method support to solve diffusive SSE with [`dq.ssesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/dssesolve.html) (#908).
- Added [`dq.plot.xyz()`](https://www.dynamiqs.org/stable/python_api/plot/xyz.html) to plot expectation values of Pauli operators as a function of time (#909).
- Added `x.mean()` method for qarrays (929).
- Added [`dq.set_progress_meter()`](https://www.dynamiqs.org/stable/python_api/utils/global_settings/set_progress_meter.html) to configure the default progress meter (#931).

πŸ› Bugs

- Removed warning when summing qarrays with zero (903).
- Fixed differentiability of [`dq.wigner()`](https://www.dynamiqs.org/stable/python_api/utils/general/wigner.html) (#917).
- Fixed printing of sparse dia qarrays in scientific format (923).
- Fixed matrix multiplication of sparse dia qarray by dense qarray on the left (924).
- Added `__array_priority__` to qarrays to fix loose conversions to numpy arrays (919).
- Fixed bug when adding two callable time-qarrays (934).

πŸ“– Documentation

- Added diffusive SSE example to the [Continuous diffusive measurement](https://www.dynamiqs.org/stable/documentation/advanced_examples/continuous-diffusive-measurement.html) tutorial (#908).

πŸ“¦ Other changes

- Changed default value of time-qarrays `discontinuity_ts` to empty array instead of `None` (938).

**Full Changelog**: https://github.com/dynamiqs/dynamiqs/compare/v0.3.1...v0.3.2

0.3.1

This release introduces a new quantum solver [`dq.dsmesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/dsmesolve.html) to simulate the diffusive stochastic master equation, and an [accompanying tutorial](https://www.dynamiqs.org/stable/documentation/advanced_examples/continuous-diffusive-measurement.html) showing how to use it for two simple examples (qubit and oscillator). It also includes several minor bug fixes and new features.

πŸš€ Features

- New [`dq.dsmesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/dsmesolve.html) quantum solver for the diffusive SME (see #877). Currently only [`dq.solver.EulerMayurama`](https://www.dynamiqs.org/stable/python_api/solver/EulerMaruyama.html) is supported. Note that this solver is not yet based on Diffrax (see https://github.com/patrick-kidger/diffrax/issues/517). In terms of performance, this new stochastic solver uses array vectorisation to simulate many trajectories simultaneously, which is very advantageous, even for small systems. For example, to simulate 100,000 SME trajectories for a qubit, QuTiP on CPU takes 10 minutes, Dynamiqs on CPU takes 20 seconds (x30 speedup), and Dynamiqs on GPU takes... 0.7 seconds! (x850 speedup). This solver benefits from all the other optimisations of the library, so it can also efficiently simulate quantum trajectories for coupled bosonic modes.
- Added [`dq.purity()`](https://www.dynamiqs.org/stable/python_api/utils/general/purity.html) to compute the purity of a quantum state.
- Added [`dq.signm()`](https://www.dynamiqs.org/stable/python_api/utils/general/signm.html) (also accessible with `x.signm()` for qarrays) to compute the operator sign function.

πŸ› Bugs

- Fixed [`dq.sepropagator()`](https://www.dynamiqs.org/stable/python_api/integrators/sepropagator.html) for composite Hilbert space (see #900).
- Fixed `dims` property of summed time-qarrays (see 900).
- Fixed qarrays implementing `__rtruediv__` instead of `__truediv__` (see 899).

πŸ“– Documentation

- New APIs for other stochastic solvers, only indicative of the planned implementation (we haven't implemented solvers for them yet):
- [`dq.jssesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/jssesolve.html) for the jump SSE,
- [`dq.dssesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/dssesolve.html) for the diffusive SSE,
- [`dq.jsmesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/jsmesolve.html) for the jump SME.
- New [advanced tutorial](https://www.dynamiqs.org/stable/documentation/advanced_examples/continuous-diffusive-measurement.html) on how to use [`dq.dsmesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/dsmesolve.html) to simulate diffusive measurement on two simple systems: continuous measurement of $\sigma_z$ on a qubit and continuous heterodyne measurement of the $X$ and $P$ quadratures of an oscillator.
- We reorganised the quantum solvers documentation to have the solver API, the available options and the result object on the same page. See for example the new [`dq.mesolve()`](https://www.dynamiqs.org/stable/python_api/integrators/mesolve.html) documentation page.

**Full Changelog**: https://github.com/dynamiqs/dynamiqs/compare/v0.3.0...v0.3.1

0.3.0

The introduction of a custom array type gives us a lot more control over the data format, and we have a few tricks up our sleeve to take advantage of it this year, so stay tuned for even faster simulations! 🏎️

🍾 Migration from the previous version (`v0.2.*`)
There is not much to know, the solver and utility APIs are largely unchanged. We'd love to have your feedback on any bugs you might find when running your existing simulations with the new version. Here are some cool new features:
- You can now use the much awaited `x.dag()` (see the list of other `QArray` methods in the [API documentation](https://www.dynamiqs.org/0.3/python_api/qarrays/qarray/QArray.html)).
- When you create operators with Dynamiqs, they now have their own custom type, data format and representation:
python
>>> a = dq.destroy(5)
>>> a
QArray: shape=(5, 5), dims=(5,), dtype=complex64, layout=dia, ndiags=1
[[ β‹… 1. +0.j β‹… β‹… β‹… ]
[ β‹… β‹… 1.414+0.j β‹… β‹… ]
[ β‹… β‹… β‹… 1.732+0.j β‹… ]
[ β‹… β‹… β‹… β‹… 2. +0.j]
[ β‹… β‹… β‹… β‹… β‹… ]]
>>> a.dag() a + 2 * (a + a.dag())
QArray: shape=(5, 5), dims=(5,), dtype=complex64, layout=dia, ndiags=3
[[ β‹… 2. +0.j β‹… β‹… β‹… ]
[2. +0.j 1. +0.j 2.828+0.j β‹… β‹… ]
[ β‹… 2.828+0.j 2. +0.j 3.464+0.j β‹… ]
[ β‹… β‹… 3.464+0.j 3. +0.j 4. +0.j]
[ β‹… β‹… β‹… 4. +0.j 4. +0.j]]

Here, Dynamiqs stores only the nonzero diagonal of the operator.
- There are two different layouts for qarrays: dense or sparse DIA. You can choose a global default layout for new operators with [`dq.set_layout()`](https://www.dynamiqs.org/0.3/python_api/utils/global_settings/set_layout.html), or individually by setting the `layout` keyword argument:
python
>>> dq.destroy(5, layout=dq.dense)
QArray: shape=(5, 5), dims=(5,), dtype=complex64, layout=dense
[[0. +0.j 1. +0.j 0. +0.j 0. +0.j 0. +0.j]
[0. +0.j 0. +0.j 1.414+0.j 0. +0.j 0. +0.j]
[0. +0.j 0. +0.j 0. +0.j 1.732+0.j 0. +0.j]
[0. +0.j 0. +0.j 0. +0.j 0. +0.j 2. +0.j]
[0. +0.j 0. +0.j 0. +0.j 0. +0.j 0. +0.j]]

- All library functions remain compatible with QuTiP Qobjs, NumPy arrays, JAX arrays and Python lists. They now also support the Dynamiqs `QArray` type.
- We added some [qarray utilities](https://www.dynamiqs.org/0.3/python_api/index.html#qarray-utilities) to convert to and from other types, check them out! For example you can use [`dq.asqarray()`](https://www.dynamiqs.org/0.3/python_api/qarrays/utils/asqarray.html) to convert any object to a qarray:
python
>>> dq.asqarray([qt.sigmax(), qt.sigmay(), qt.sigmaz()], layout=dq.dia)
QArray: shape=(3, 2, 2), dims=(2,), dtype=complex64, layout=dia, ndiags=3
[[[ β‹… 1.+0.j]
[ 1.+0.j β‹… ]]

[[ β‹… 0.-1.j]
[ 0.+1.j β‹… ]]

[[ 1.+0.j β‹… ]
[ β‹… -1.+0.j]]]

- `TimeArray` has been renamed to [`TimeQArray`](https://www.dynamiqs.org/0.3/python_api/time_qarray/TimeQArray.html), and has first-class support for qarrays:
python
>>> f = lambda t: jnp.cos(2.0 * jnp.pi * t)
>>> H = dq.modulated(f, dq.sigmax())
>>> H
ModulatedTimeQArray: shape=(2, 2), dims=(2,), dtype=complex64, layout=dia, ndiags=2
>>> H(0.5)
QArray: shape=(2, 2), dims=(2,), dtype=complex64, layout=dia, ndiags=2
[[ β‹… -1.+0.j]
[-1.+0.j β‹… ]]


πŸš€ Features
- New operators [`dq.eye_like()`](https://www.dynamiqs.org/0.3/python_api/utils/operators/eye_like.html) and [`dq.zeros_like()`](https://www.dynamiqs.org/0.3/python_api/utils/operators/zeros_like.html).
- Added GPU support for eig in [`dq.floquet()`](https://www.dynamiqs.org/0.3/python_api/integrators/floquet.html) and [`dq.fidelity()`](https://www.dynamiqs.org/0.3/python_api/utils/general/fidelity.html), following the JAX 0.4.36 release (see [jax.lax.linalg.eig() documentation](https://jax.readthedocs.io/en/latest/_autosummary/jax.lax.linalg.eig.html#jax.lax.linalg.eig)).
- New [`dq.hc`](https://www.dynamiqs.org/0.3/python_api/hermitian_conjugate/hc.html) helper, syntactic sugar for writing hermitian conjugates:
python
two linear drives on two different modes
H = (omega_a * a + dq.hc) + (omega_b * b + dq.hc)

time-dependent linear drive
omega = lambda t: jnp.cos(2.0 * jnp.pi * t)
H = dq.modulated(omega, a) + dq.hc

- [`dq.coherent()`](https://www.dynamiqs.org/0.3/python_api/utils/states/coherent.html) now also accepts a batched displacement (`alpha`) argument for multi-modes.
- New `out_axes` property for result objects for custom vmapping (see 866).

πŸ›Β Bugs
- Fixed [`dq.wigner()`](https://www.dynamiqs.org/0.3/python_api/utils/general/wigner.html) which used to return the wigner transpose, and fixed the missing `.T` in the wigner plotting functions `imshow` which made this bug go unnoticed (thanks to RemiRousseau for finding it, see #849).
- Fixed the definition of [`dq.cd_gate()`](https://www.dynamiqs.org/0.3/python_api/utils/optimal_control/cd_gate.html) to match [`dq.ground()`](https://www.dynamiqs.org/0.3/python_api/utils/states/ground.html) and [`dq.excited()`](https://www.dynamiqs.org/0.3/python_api/utils/states/excited.html).

πŸ“– Documentation
- Added an entry to [The sharp bits πŸ”ͺ](https://www.dynamiqs.org/0.3/documentation/getting_started/sharp-bits.html) tutorial on [Computing the gradient with respect to complex parameters](https://www.dynamiqs.org/0.3/documentation/getting_started/sharp-bits.html#computing-the-gradient-with-respect-to-complex-parameters) (take the conjugate!).
- Separated the solver [options documentation](https://www.dynamiqs.org/0.3/python_api/options/Options.html) between quantum solvers, to add support for solver-specific options.
- New [Global settings](https://www.dynamiqs.org/0.3/python_api/index.html#global-settings) section in the API to group default global configurations (such as precision, dtype, device and layout).

πŸ“¦ Other changes
- Renamed `dq.zero()` to [`dq.zeros()`](https://www.dynamiqs.org/0.3/python_api/utils/operators/zeros.html) (to align with NumPy, PyTorch, JAX, etc.).
- Changed minimum supported Python version from 3.9 to 3.10.

**Full Changelog**: https://github.com/dynamiqs/dynamiqs/compare/v0.2.3...v0.3.0

0.2.3

This new release introduces a [brand new solver](https://www.dynamiqs.org/0.2/python_api/integrators/floquet.html) for your Floquet problems and provides an in-depth tutorial on the [driven-dissipative Kerr oscillator](https://www.dynamiqs.org/0.2/documentation/advanced_examples/kerr-oscillator.html). We are excited to announce that dkweiss31 (Daniel Weiss, postdoc at Yale) has officially joined the Dynamiqs core team! Thank you for your invaluable contributions to the Floquet solver and many other parts of the library. πŸ™

This month we were featured on social media by our sponsoring startup company, Alice & Bob. Check out the [LinkedIn post](https://www.linkedin.com/posts/alice-bob_python-opensource-quantumcomputing-activity-7264624666885951490-OCqN?utm_source=share&utm_medium=member_desktop) and the [blog post](https://alice-bob.com/blog/dynamiqs-gpu-opensource-quantum-simulation-library/) on Alice & Bob's website.

πŸš€ Features
- Discover the new Floquet solver [`dq.floquet()`](https://www.dynamiqs.org/0.2/python_api/integrators/floquet.html) to compute Floquet modes and quasienergies of a periodic closed system (see #681).
- The single-qubit rotation gates [`dq.rx()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/rx.html), [`dq.ry()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/ry.html), [`dq.rz()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/rz.html) now support vectorised angle inputs.

πŸ› Bugs
- Fixed support for unitary evolution in [`dq.mesolve()`](https://www.dynamiqs.org/0.2/python_api/integrators/mesolve.html), you can now pass an empty list of jump operators (see #772).
- Fixed problems with [functions to create states](https://www.dynamiqs.org/0.2/python_api/index.html#states) breaking the JIT (see 808).

πŸ“– Documentation
- We have a new advanced tutorial crafted by gautierronan! An extensive study on the [driven-dissipative Kerr oscillator](https://www.dynamiqs.org/0.2/documentation/advanced_examples/kerr-oscillator.html) with Dynamiqs, including simulations of basic and advanced time evolution, vectorising simulations to explore various parameter regimes, and quantum optimal control to shape a pulse with [Optax](https://github.com/google-deepmind/optax), the Google DeepMind optimisation library.
- We have improved the [contribution guide](https://www.dynamiqs.org/0.2/community/contributing.html) for developers joining the project or contributors fixing bugs.

**Full Changelog**: https://github.com/dynamiqs/dynamiqs/compare/v0.2.2...v0.2.3

0.2.2

This release fixes some bugs and introduces several improvements. A special thank you to our new contributor vaicecaze, welcome aboard! β›΅

πŸš€ Features
- GIFs are now 3x faster to create, and the colormap is nicer (see https://github.com/dynamiqs/dynamiqs/pull/723).
<p align="center">
<img width="250" src="https://github.com/user-attachments/assets/f71cdcd3-9dc2-45dc-ba0b-c6fed41eae47">
</p>

- New qubit gates: [`dq.rx()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/rx.html), [`dq.ry()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/ry.html), [`dq.rz()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/rz.html), [`dq.sgate()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/sgate.html), [`dq.tgate()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/tgate.html), [`dq.cnot()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/cnot.html) and [`dq.toffoli()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/toffoli.html).
- New function [`dq.bloch_coordinates()`](https://www.dynamiqs.org/0.2/python_api/utils/quantum_utils/bloch_coordinates.html) which returns the spherical coordinates $(r,\theta,\phi)$ of a state on the Bloch sphere.
- The number operator function [`dq.number()`](https://www.dynamiqs.org/0.2/python_api/utils/operators/number.html) now supports multiple dimensions. For example, for two modes $a$ (dimension 4) and $b$ (dimension 5), the operators $a^\dagger a \otimes I_5$ and $I_4\otimes b^\dagger b$ can be simply obtained with:
python
na, nb = dq.number(4, 5)

- Added an optional `index` argument to [`dq.set_device()`](https://www.dynamiqs.org/0.2/python_api/utils/jax_utils/set_device.html).
- Support for an empty list of jump operators in [`dq.lindbladian()`](https://www.dynamiqs.org/0.2/python_api/utils/quantum_utils/lindbladian.html) and its vectorized version [`dq.slindbladian()`](https://www.dynamiqs.org/0.2/python_api/utils/vectorization/slindbladian.html), allowing the construction of a Lindbladian from a Hamiltonian only.

πŸ› Bugs
- Fixed a bug that occurred when mixing subplots with colorbars. Everything should look good now (see https://github.com/dynamiqs/dynamiqs/pull/761).

πŸ“– Documentation
- The documentation now includes a version selector next to the search bar, to switch between multiple versions of the library (`dev` = latest commit on the `main` branch of the repository, `dev-qarray` = what we're cooking for the next big release):
<p align="center">
<img width="250" src="https://github.com/user-attachments/assets/7deab806-66f8-4315-8425-cd99a1ed1e33">
</p>

πŸ“¦ Other changes
- We have a new smoother logo from our logo-master gautierronan. Can you spot the seven differences from the previous one (on the left)?
<p align="center">
<img width="250" src="https://github.com/user-attachments/assets/2cd7f583-7c8b-433c-a0c4-c38659e9e770">
</p>

**Full Changelog**: https://github.com/dynamiqs/dynamiqs/compare/v0.2.1...v0.2.2

0.2.1

This release primarily addresses installation issues with the `uv` package manager. The library's official name is now `Dynamiqs` instead of `dynamiqs`, although the repository and Python package will still be named `dynamiqs`.

πŸš€ Features
- Add the `save_extra` option for the `dq.sepropagator()` and `dq.mepropagator()` solvers.
- Support double precision on GPU for `dq.wigner()`.

πŸ“– Documentation
- Add analytical gradient calculations results to the README and documentation basic example.

πŸ“¦ Other changes
- Change the default plot font of `dq.plot.mplstyle()` from `serif` to `sans-serif`.

**Full Changelog**: https://github.com/dynamiqs/dynamiqs/compare/v0.2.0...v0.2.1

Page 1 of 2

Β© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.