quantumtoolbox.jl

Quantum Toolbox in Julia

https://github.com/qutip/quantumtoolbox.jl

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    2 of 12 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.2%) to scientific vocabulary

Keywords

julia lindblad lindblad-master-equation many-body-physics open-quantum-systems physics quantum quantum-dynamics quantum-mechanics quantum-optics quantum-toolbox quantum-trajectories qutip

Keywords from Contributors

matrix-exponential interpretability hack pde numeric meshing standardization pinn quantum-computing projections
Last synced: 6 months ago · JSON representation ·

Repository

Quantum Toolbox in Julia

Basic Info
Statistics
  • Stars: 122
  • Watchers: 5
  • Forks: 31
  • Open Issues: 19
  • Releases: 64
Topics
julia lindblad lindblad-master-equation many-body-physics open-quantum-systems physics quantum quantum-dynamics quantum-mechanics quantum-optics quantum-toolbox quantum-trajectories qutip
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Code of conduct Citation

README.md

QuantumToolbox.jl logo

QuantumToolbox.jl

A. Mercurio and Y.-T. Huang.

| Release | Release License Cite Downloads | |:-----------------:|:-------------| | Runtests | Runtests Coverage | | Code Quality | Code Quality Aqua QA JET | | Documentation | Doc-Stable Doc-Dev | | Benchmark | Benchmarks | | Support | Unitary Fund |

Introduction

QuantumToolbox.jl is a cutting-edge Julia package designed for quantum physics simulations, closely emulating the popular Python QuTiP package. It uniquely combines the simplicity and power of Julia with advanced features like GPU acceleration and distributed computing, making simulation of quantum systems more accessible and efficient.

With this package, moving from Python to Julia for quantum physics simulations has never been easier, due to the similar syntax and functionalities.

Features

QuantumToolbox.jl is equipped with a robust set of features:

  • Quantum State and Operator Manipulation: Easily handle quantum states and operators with a rich set of tools, with the same functionalities as QuTiP.
  • Dynamical Evolution: Advanced solvers for time evolution of quantum systems, thanks to the powerful DifferentialEquations.jl package.
  • GPU Computing: Leverage GPU resources for high-performance computing. Simulate quantum dynamics directly on the GPU with the same syntax as the CPU case.
  • Distributed Computing: Distribute the computation over multiple nodes (e.g., a cluster). For example, you can run hundreds of quantum trajectories in parallel on a cluster, with, again, the same syntax as the simple case. See here for more information.
  • Differentiable Programming: Enable gradient-based optimization for quantum algorithms. Compute gradients of quantum dynamics with respect to their parameters using automatic differentiation. See here for more information.
  • Easy Extension: Easily extend the package, taking advantage of the Julia language features, like multiple dispatch and metaprogramming.

Installation

[!NOTE] QuantumToolbox.jl requires Julia 1.10+.

To install QuantumToolbox.jl, run the following commands inside Julia's interactive session (also known as REPL): julia using Pkg Pkg.add("QuantumToolbox") Alternatively, this can also be done in Julia's Pkg REPL by pressing the key ] in the REPL to use the package mode, and then type the following command: julia-repl (1.10) pkg> add QuantumToolbox More information about Julia's package manager can be found at Pkg.jl.

To load the package and check the version information, use either QuantumToolbox.versioninfo() or QuantumToolbox.about(), namely julia using QuantumToolbox QuantumToolbox.versioninfo() QuantumToolbox.about()

Brief Example

We now provide a brief example to demonstrate the similarity between QuantumToolbox.jl and QuTiP.

Let's consider a quantum harmonic oscillator with a Hamiltonian given by:

$$ \hat{H} = \omega \hat{a}^\dagger \hat{a} $$

where $\hat{a}$ and $\hat{a}^\dagger$ are the annihilation and creation operators, respectively. We can define the Hamiltonian as follows:

```julia using QuantumToolbox

N = 20 # cutoff of the Hilbert space dimension ω = 1.0 # frequency of the harmonic oscillator

a = destroy(N) # annihilation operator

H = ω * a' * a ```

We now introduce some losses in a thermal environment, described by the Lindblad master equation:

$$ \frac{d \hat{\rho}}{dt} = -i [\hat{H}, \hat{\rho}] + \gamma \mathcal{D}[\hat{a}] \hat{\rho} $$

where $\hat{\rho}$ is the density matrix, $\gamma$ is the damping rate, and $\mathcal{D}[\hat{a}]$ is the Lindblad dissipator, defined as:

$$ \mathcal{D}[\hat{a}]\hat{\rho} = \hat{a}\hat{\rho}\hat{a}^\dagger - \frac{1}{2}\hat{a}^\dagger\hat{a}\hat{\rho} - \frac{1}{2}\hat{\rho}\hat{a}^\dagger\hat{a} $$

We now compute the time evolution of the system using the mesolve function, starting from the initial state $\ket{\psi (0)} = \ket{3}$:

```julia γ = 0.1 # damping rate

ψ0 = fock(N, 3) # initial state

tlist = range(0, 10, 100) # time list

cops = [sqrt(γ) * a] eops = [a' * a]

sol = mesolve(H, ψ0, tlist, cops, eops = e_ops) ```

We can extract the expectation value of the number operator $\hat{a}^\dagger \hat{a}$ with the command sol.expect, and the states with the command sol.states.

Support for GPU calculation

We can easily pass the computation to the GPU, by simply passing all the Qobjs to the GPU:

```julia using QuantumToolbox using CUDA CUDA.allowscalar(false) # Avoid unexpected scalar indexing

a_gpu = cu(destroy(N)) # The only difference in the code is the cu() function

Hgpu = ω * agpu' * a_gpu

ψ0_gpu = cu(fock(N, 3))

cops = [sqrt(γ) * agpu] eops = [agpu' * a_gpu]

sol = mesolve(Hgpu, ψ0gpu, tlist, cops, eops = e_ops) ```

Performance comparison with other packages

Here we provide a brief performance comparison between QuantumToolbox.jl and other popular quantum physics simulation packages, such as QuTiP (Python), dynamiqs (Python - JAX) and QuantumOptics.jl (Julia). We clearly show that QuantumToolbox.jl is the fastest package among the four. A detailed code is available here.

Contributing to QuantumToolbox.jl

You are most welcome to contribute to QuantumToolbox.jl development by forking this repository and sending pull requests (PRs), or filing bug reports at the issues page. You can also help out with users' questions, or discuss proposed changes in the QuTiP discussion group.

For more information about contribution, including technical advice, please see the Contributing to Quantum Toolbox in Julia.

Cite QuantumToolbox.jl

If you like QuantumToolbox.jl, we would appreciate it if you starred the repository in order to help us increase its visibility. Furthermore, if you find the framework useful in your research, we would be grateful if you could cite our arXiv preprint [ arXiv:2504.21440 (2025) ] using the following bibtex entry:

bib @article{QuantumToolbox-jl2025, title={{QuantumToolbox.jl}: An efficient {Julia} framework for simulating open quantum systems}, author={Mercurio, Alberto and Huang, Yi-Te and Cai, Li-Xun and Chen, Yueh-Nan and Savona, Vincenzo and Nori, Franco}, journal={arXiv preprint arXiv:2504.21440}, year={2025}, publisher = {arXiv}, eprint={2504.21440}, archivePrefix={arXiv}, primaryClass={quant-ph}, doi = {10.48550/arXiv.2504.21440} }

Acknowledgements

Fundings

QuantumToolbox.jl is supported by the Unitary Fund, a grant program for quantum technology projects.

Unitary Fund logo

Other Acknowledgements

We are also grateful to the Zulip team for providing a free chat service for open-source projects.

Zulip logo

Owner

  • Name: QuTiP
  • Login: qutip
  • Kind: organization

Quantum Toolbox in Python

Citation (CITATION.bib)

@article{QuantumToolbox-jl2025,
    title={{QuantumToolbox.jl}: An efficient {Julia} framework for simulating open quantum systems},
    author={Mercurio, Alberto and Huang, Yi-Te and Cai, Li-Xun and Chen, Yueh-Nan and Savona, Vincenzo and Nori, Franco},
    journal={arXiv preprint arXiv:2504.21440},
    year={2025},
    publisher = {arXiv},
    eprint={2504.21440},
    archivePrefix={arXiv},
    primaryClass={quant-ph},
    doi = {10.48550/arXiv.2504.21440}
}

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 869
  • Total Committers: 12
  • Avg Commits per committer: 72.417
  • Development Distribution Score (DDS): 0.528
Past Year
  • Commits: 519
  • Committers: 10
  • Avg Commits per committer: 51.9
  • Development Distribution Score (DDS): 0.395
Top Committers
Name Email Commits
Yi-Te Huang y****g@p****w 410
Alberto Mercurio a****6@g****m 386
dependabot[bot] 4****] 17
github-actions[bot] 4****] 10
CompatHelper Julia c****y@j****g 10
lgravina1997 9****7 9
Aaron Trowbridge a****e@g****m 7
ilkclord s****3@g****m 6
samu-sys s****7@g****m 5
Lorenzo Fioroni l****i@e****h 4
TestaDiBrigghio 1****o 3
Li-Xun Cai 1****F 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 58
  • Total pull requests: 470
  • Average time to close issues: 25 days
  • Average time to close pull requests: 2 days
  • Total issue authors: 15
  • Total pull request authors: 16
  • Average comments per issue: 1.48
  • Average comments per pull request: 0.92
  • Merged pull requests: 371
  • Bot issues: 0
  • Bot pull requests: 49
Past Year
  • Issues: 40
  • Pull requests: 321
  • Average time to close issues: 8 days
  • Average time to close pull requests: 1 day
  • Issue authors: 13
  • Pull request authors: 11
  • Average comments per issue: 1.53
  • Average comments per pull request: 0.86
  • Merged pull requests: 245
  • Bot issues: 0
  • Bot pull requests: 32
Top Authors
Issue Authors
  • ytdHuang (25)
  • albertomercurio (15)
  • labay11 (4)
  • eunjongkim (2)
  • Gavin-Rockwood (2)
  • LorenzoFioroni (1)
  • MatthewBelzer (1)
  • gh85 (1)
  • LynBar (1)
  • Lightup1 (1)
  • ferrispnugraha (1)
  • aarontrowbridge (1)
  • ColinVendromin (1)
  • oameye (1)
  • ericphanson (1)
Pull Request Authors
  • ytdHuang (222)
  • albertomercurio (167)
  • github-actions[bot] (27)
  • dependabot[bot] (22)
  • TendonFFF (9)
  • lgravina1997 (6)
  • Fe-r-oz (3)
  • TestaDiBrigghio (2)
  • aarontrowbridge (2)
  • labay11 (2)
  • LorenzoFioroni (2)
  • matteosecli (2)
  • alastair-marshall (1)
  • samu-sys (1)
  • sagnikpal2004 (1)
Top Labels
Issue Labels
enhancement (25) bug (13) work-in-progress (5) UnitaryHack2024 (4) UnitaryHack2025 (4) good first issue (4) documentation (2) runtests (1) invalid (1) type instability (1)
Pull Request Labels
Skip ChangeLog (67) dependencies (22) enhancement (3) bug (2) runtests (1) good first issue (1)

Dependencies

.github/workflows/CI.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v2 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-docdeploy v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/register.yml actions
  • julia-actions/RegisterAction latest composite
.github/workflows/CompatHelper.yml actions