caroli Documentation
caroli is a Rust toolbox for electronic phenomena in materials. It builds a tight-binding Hamiltonian, the geometry of a sample and its disorder, and computes what a condensed-matter physicist asks of them: transmissions and conductances between any number of leads, scattering matrices, non-equilibrium densities and currents, disorder-averaged Green's functions, densities of states and conductivities, the evolution of a state in time, and quantum walks coupled to spins. It is used as a library (a Rust workspace of crates) or through the caroli command, which reads a system and its calculations from a TOML file.
The name comes from the Caroli formula for the transmission, \(T = \mathrm{Tr}\,[\Gamma_L\, G\, \Gamma_R\, G^{\dagger}]\), and from the paper of Caroli, Combescot, Nozières and Saint-James (1971), the first non-equilibrium (Keldysh) calculation of a tunnelling current.
Two documentations
- This one, the maths and the physics. For each method: what it computes, its equations, how the code solves them (algorithm, cost, stability, special cases), its accuracy and how it was checked. It is meant to be read by someone who wants to know exactly what a number means before using it.
- The API reference, generated by rustdoc from the code: every crate, type and function, with their arguments, what they return and when they fail.
The source code, its tests and the issue tracker are on GitHub. caroli is free software under the MIT license.
What is in it
| Question | Method | Page |
|---|---|---|
| How much current flows through a sample between leads? | Landauer–Büttiker and the Caroli formula, lead self-energies by mode matching, recursive Green's function, nested dissection | Green's functions and the Caroli formula |
| Which modes are transmitted, with which phases? | Scattering matrix, transmission eigenvalues, shot noise | Scattering matrix and states |
| Where does the current flow, and what is the occupation out of equilibrium? | Keldysh, the lesser Green's function by injection from the leads | Keldysh: densities and currents |
| What do disorder and impurities do on average? | Self-consistent Born approximation | Self-consistent Born approximation |
| Where are the states, and how does a sample conduct in bulk? | Exact spectra and bands, the kernel polynomial method, Kubo–Bastin conductivities | Spectra and bands, Kernel polynomial method |
| How does a state evolve, under a field or not? | Split-operator on tori, Chebyshev propagation, fourth-order Magnus integrator | Time evolution |
| How does a walker spread when it flips spins on its way? | Discrete-time quantum walks on graphs | Quantum walks |
How it is checked
caroli was written from the author's PhD thesis (Fortran 90 and MPI, Python 2), by Claude, Anthropic's AI model, under his supervision. Nothing is accepted on trust. Every method is checked against an independent one (another solver, an analytic result, a conservation law), against the outputs of the thesis codes on 26 small cases, which it reproduces to rounding error, and against other codes of the field (Kwant, TBtrans, Quantica.jl) on the same Hamiltonians. Validation and benchmarks gives the details; How caroli is made tells the story.
Citing caroli
If you use caroli in your research, please cite it with the metadata of its CITATION.cff: A. Demion, caroli: a Rust toolbox for electronic transport in materials, https://github.com/Arnwald/caroli. The methods each have their own references, given on their pages and gathered in References.