DEM Audiocaroli Documentation
APIGitHub

Nested Dissection


On this page

The transmission needs only the blocks of the Green's function between the orbitals that the leads touch. NestedTwoTerminal and NestedMultiTerminal compute them by geometric nested dissection, the multifrontal method of sparse direct solvers on a tree of separators cut through the sample. Each node of the tree eliminates its separator from a small dense matrix, its front, and passes a Schur complement to its parent. The orbitals of the leads are never eliminated: the root holds the Schur complement of the whole device on them, and its inverse is the Green's function between the leads. An \(n \times n\) sample costs \(O(n^3)\) instead of the \(O(n^4)\) of the recursive Green's function, a long strip \(O(L W^2)\) instead of \(O(L W^3)\). These are the default solvers of caroli.


What is computed

Split the orbitals of the device into those the leads touch, \(K\) (kept), and the interior \(I\). With \(A = z - H - \Sigma\), and \(\Sigma\) nonzero only on \(K\),

$$ A = \begin{pmatrix} z - H_{II} & -H_{IK} \\ -H_{KI} & z - H_{KK} - \Sigma \end{pmatrix}, \qquad (A^{-1})_{KK} = S^{-1}, \qquad S = z - H_{KK} - \Sigma - H_{KI}\, (z - H_{II})^{-1} H_{IK}. $$

The Green's function between the leads is a block of \(S^{-1}\): \(G_{LR} = (S^{-1})_{LR}\) for two leads, every \(G_{pq}\) for several. The interior is eliminated without the leads: \(z - H_{II}\) is the closed interior at the real energy, and its Schur complement is the same whatever the leads. The self-energies are added at the root only, which is why they can be computed once and reused for every disorder configuration with the same leads.

Eliminating \(I\) as a dense matrix would cost \(O(\lvert I \rvert^3)\). Nested dissection orders the elimination so that it only ever works on small dense blocks.

The separator tree

The tree (SiteTree) is built over the interior sites: all but the sites of the two lead slices for NestedTwoTerminal, all but the sites with an orbital coupled to a lead for NestedMultiTerminal. A domain of sites is cut in two along its longest extent in cell coordinates (the lowest axis on a tie). The cut is a layer of sites in the middle, the separator, as thick as the longest hopping along that axis, so that no hopping joins the two halves. Each half is cut again, recursively, down to leaves of at most 16 orbitals or too thin to cut. The nodes are numbered in post-order, children before their parent.

SampleFirst cutsThen
\(n \times n\)A separator of \(n\) sites across the middleEach half cut across its own longest side, alternately
Long strip, \(L \gg W\)Cross-sections of \(W\) sites, halving the lengthOnce the pieces are about square, as above
\(n \times n \times n\)Planes of \(n^2\) sitesEach part cut across its longest side

The tree depends on the geometry only. It is built once per system and shared by the independent blocks of orbitals, each of which takes its own orbitals of every node (SiteTree::tree). A symbolic phase, also run once, ranks every orbital in the order of elimination and gives each node its boundary: the orbitals that are coupled, through \(H\), to the orbitals it eliminates or that appear in its children's boundaries, and that are eliminated later or never.

Fronts and Schur complements

The front of a node is a dense matrix on two sets of variables: those it eliminates, \(E\) (its separator, and any variables its children could not eliminate), then its boundary \(B\),

$$ F = \begin{pmatrix} F_{EE} & F_{EB} \\ F_{BE} & F_{BB} \end{pmatrix}, \qquad X = F_{EE}^{-1} F_{EB}, \qquad S_F = F_{BB} - F_{BE}\, X. $$

It is assembled from the entries of \(z - H\) between its separator and the later variables (the rest of the separator and the boundary), and from the Schur complements of its children, each added at the positions of its variables (the extend-add of the multifrontal method). Every entry of \(H\) is assembled once, at the front where the first of its two orbitals is eliminated, or at the root when both are kept. Eliminating \(E\) leaves the Schur complement \(S_F\) on the boundary, which the parent receives. This is block Gaussian elimination in the order of the tree: since a separator decouples its two halves, the halves are eliminated independently, and the root receives exactly the Schur complement of \(z - H\) on the kept orbitals.

The elimination of a front takes one of two paths:

  • Large fronts (64 variables or more): an LU factorisation of \(F_{EE}\) with partial pivoting, \(X\) by a solve, \(S_F\) by one matrix product (Field::schur), through Accelerate's LAPACK and BLAS on macOS and faer elsewhere (Dense Kernels).
  • Small fronts (fewer than 64 variables): plain Gaussian elimination in a copy of the front, with partial pivoting within the separator rows, without calls to the dense library or further allocations (small_schur), and \(X\) only when it is needed. Below 64 variables, calls, copies and index searches cost more than the arithmetic.

Each front has an assembly plan, computed with the tree: its variables, the positions that receive \(z\) on the diagonal, the list of its entries of \(H\) (row, column, value), and, for each child, the runs of consecutive positions where the child's Schur complement goes. The plan serves at every energy as long as no child delayed a variable (below), the usual case; otherwise the front is assembled from its actual variables. On an M5, one thread, the plans and the small-front path made the square lattice 12 % faster at \(W = 256\) and 9 % at \(W = 512\), and leaves of 16 orbitals instead of 64 brought \(W = 256\) from 0.134 s to 0.106 s per energy (ARCHITECTURE.md).

Only the pending Schur complements are kept: once a parent has absorbed its children's, their memory is freed, and no factor is stored. The scattering states are the exception: they keep \(X\) of every front for a back-substitution.

Delayed pivots

The factorisation of \(F_{EE}\) must be stable: its smallest pivot must exceed PIVOT_TOL times the largest entry of \(F_{EE}\), \(10^{-11}\) in double precision, about \(10^5\) times the rounding error. When it does not, the front eliminates nothing. It hands its whole matrix, unreduced, and all its variables to its parent, whose eliminated set then holds its own separator and the delayed variables. The parent's front is larger, and its block \(F_{EE}\) is usually regular again.

The test fails at, or very near, an eigenvalue of the closed domain of the node: the separator with everything below it, cut off from the rest of the sample with hard walls. The children having been eliminated, \(\det(z - H_D) = \det(z - H_{\mathrm{children}}) \det F_{EE}\) for that domain \(D\), so \(F_{EE}\) is singular exactly when \(z - H_D\) is. A piece of a clean lattice at one of its eigenvalues is the typical case: an \(a \times b\) rectangle of the square lattice has the eigenvalues \(-2\cos(\pi i/(a+1)) - 2\cos(\pi j/(b+1))\), and \(E = 0\) among them whenever \(i/(a+1) + j/(b+1) = 1\), as for every square piece. Disorder makes exact singularities unlikely, but blocks near the eigenvalues of subdomains are ill-conditioned; in single precision, where PIVOT_TOL is \(10^{-5}\), they are what limits the accuracy (Precision).

Variables delayed up to the root are eliminated there, after the self-energies are added: the leads make the open system regular. If it is not, the solver returns GreenError::Singular, as it does when \(S\) itself is singular.

The root

For two terminals, the kept orbitals are those of the left slice, then those of the right slice (once if they coincide, for a device of one slice). The root front holds the variables delayed up to it, then the kept ones. It receives the entries of \(z - H\) between kept orbitals and the Schur complements of the top fronts; then \(\Sigma_L\) and \(\Sigma_R\) are subtracted on their slices, and the delayed variables eliminated. What remains is \(S\), of size \(n_L + n_R\). One LU of \(S\), solved for the \(n_R\) unit columns of the right slice, gives the columns of \(S^{-1}\) on the right slice, whose rows on the left slice are \(G_{LR}\). The transmission is the Caroli formula, \(T = \mathrm{Tr}\,[\Gamma_L\, G_{LR}\, \Gamma_R\, G_{LR}^{\dagger}]\).

For several leads (NestedMultiTerminal), the kept orbitals are the union of the orbitals that the leads couple to, in increasing order, and every \(\Sigma_p\) is subtracted at its positions. \(S^{-1}\) is formed whole, by an LU solved against the identity, and its blocks are the \(G_{pq}\) of every pair of leads. The cost of the root is \(O(K^3)\) for \(K\) kept orbitals, where MultiTerminal inverts the whole device.

The root is always assembled and solved in complex double precision. With Precision::Single, the fronts below it run in complex single precision and their Schur complements are converted when the root receives them; the leads, the delayed variables, the final solve and the trace stay in double precision (Precision).

Cost

SampleNested dissectionRecursive Green's function
\(n \times n\)\(O(n^3)\)\(O(n^4)\)
Strip \(L \times W\), \(L \gg W\)\(O(L W^2)\)\(O(L W^3)\)
\(n \times n \times n\)\(O(n^6)\)\(O(n^7)\)

For an \(n \times n\) sample, the top separator has \(n\) sites and a front of a few times \(n\) variables, which costs \(O(n^3)\). Each level down doubles the number of fronts and divides their size by \(\sqrt 2\): level \(\ell\) costs \(2^{\ell} (n\, 2^{-\ell/2})^3 = n^3\, 2^{-\ell/2}\), a geometric series dominated by the top (George, 1973). In a long strip, a cross-section of \(W\) sites and the two cross-sections that bound its piece make a front of about \(3W\) variables; there are about \(L/W\) of them, as many square pieces of \(O(W^3)\) each, hence \(O(L W^2)\). In three dimensions the top separators are planes of \(n^2\) sites, and their fronts cost \(O(n^6)\). The orbitals per site multiply the front sizes, so \(W\) and \(n\) above count orbitals.

The memory is that of the pending Schur complements, at most a few top fronts: \(O(n^2)\) for an \(n \times n\) sample, against the \(O(n^3)\) of a device stored by dense slices. With the factors kept for the scattering states, it grows as \(O(N \log N)\) for a two-dimensional sample of \(N\) orbitals.

Parallel branches and independent blocks

The two children of a node are eliminated in parallel (rayon::join), recursively, so that one energy uses several cores. On 14 threads, one energy of the square lattice at \(W = 512\) takes half the time it takes on one thread, and one energy of a long strip a fifth (benchmarks of 12 October 2026). transmissions also runs the energies in parallel.

Independent blocks of orbitals (Independent blocks) are found when the system is built, from the nonzero entries of the sparse Hamiltonian and of the lead matrices. Each block has its own elimination tree (its orbitals of the shared site tree), its leads restricted to its orbitals, and its mode solvers; the blocks and their lead self-energies are solved in parallel. A two-terminal block that does not reach both lead slices is dropped. The disordered BHZ samples of the tests split into their two spin blocks (block_count is 2).

Leads anywhere

NestedMultiTerminal takes the interfaces and attached leads of MultiTerminal (Leads anywhere). The sites that a lead couples to stay at the root, with all their orbitals, and the tree is built over the other sites. Its independent blocks are found over the device and the cells of the leads (their \(h_{00}\), \(h_{01}\) and couplings), and each block keeps the part of every lead it reaches. The surface Green's function of a lead is computed once per distinct lead and shared by the leads equal to it, such as the opposite arms of a symmetric cross. From the root come every \(T_{pq}\), the sector transmissions, the scattering matrix and the scattering states (Scattering Matrix and Scattering States).

Accuracy and tests

Against the recursive Green's function (caroli-green/tests/nested.rs, magnetic.rs), \(\lvert \Delta T \rvert < 10^{-9} (1 + T)\) unless stated:

TestSystemEnergies
square_latticeSquare, 14 × 9, clean and with disorder \(w = 2\)Five each, with \(E = 0\), where blocks of the clean lattice are singular
bhz_with_disorderBHZ, 12 × 7, disorder 0.6 on the four orbitals: two blocksFive, from \(-0.4\) to \(0.5\)
graphene_ribbonsGraphene 10 × 6, clean and with disorderSeven
constrictionA 20 × 11 square pinched to three sites in the middle, full-width leadsFour
long_strip_and_short_devicesStrip 80 × 5; devices of one, two and three slices (no interior)Three; two
cubic_samplesCubic, 14 × 6 × 5 and 4 × 9 × 8 along \(x\), 7 × 10 × 6 along \(z\), disorder 2.5Four, with \(E = 0\)
bond_disorderSquare 12 × 7 with random hoppings inside the deviceFour; \(10^{-10}\)
quantum_hall_plateaus, _along_yDisordered ribbons 60 wide at \(b = 0.1\), along \(x\) and along \(y\)Plateaus \(T = 1, 2, 3\) to \(10^{-6}\), and \(10^{-9}\) from the recursive solver

Measured on the square and BHZ cases, the largest differences are \(1.2 \cdot 10^{-14}\) and \(2.0 \cdot 10^{-14}\) (28 November 2026, on Linux with faer's kernels).

Against the dense MultiTerminal (nested_multi.rs), every \(T_{pq}\) to \(10^{-9} (1 + T)\): a disordered square cross (9 × 7 with arms of 3), a BHZ cross (two blocks), graphene with a narrow lead whose first cell bonds to device sites outside the interface slice. Two leads at the ends of a ribbon give the two-terminal transmission in both directions to \(10^{-10}\). In a field, a clean cross keeps its symmetry under a quarter turn, which takes leads along \(x\) into leads along \(y\) in another gauge (to \(10^{-9}\)), and a disordered one obeys \(T_{pq}(b) = T_{qp}(-b)\) to \(10^{-9}\).

The reused self-energies give the system's own transmission to \(10^{-12}\) (reused_self_energies), and self-energies of other leads are refused (self_energies_of_other_leads). Single precision follows double precision to \(10^{-4}\) on a disordered 48 × 40 square and a 36 × 30 cross, and to \(5 \cdot 10^{-4}\) on a 24 × 20 BHZ sample (single_precision, single_precision_cross).

Benchmarks

Per energy on one thread, and one energy on 14 threads, on the idle Mac mini M4 Pro, against Kwant 1.5 (MUMPS on Accelerate, one thread), from benchmarks/results/report-2026-10-12-53d13c9.md. Every code solves the same exported Hamiltonian, and the transmissions agree with Kwant's to \(10^{-10}\) (\(2 \cdot 10^{-7}\) for BHZ at \(W = 256\)).

Problem\(W\)caroli, 1 threadcaroli, 14 threadsKwantSpeed-upPeak memory, caroli / Kwant
Square, disorder \(w = 2\), \(W \times W\)12813 ms5.8 ms164 ms12.639 / 207 MB
25671 ms32 ms1.07 s15.1152 / 655 MB
5120.40 s0.20 s6.81 s16.8545 / 1982 MB
Four-terminal cross, arms of \(W/4\)2560.24 s0.14 s4.69 s19.5855 / 978 MB
Strip, length 20481280.19 s36 ms2.18 s11.7292 / 1313 MB
Graphene, disorder, \(W \times W\)2560.33 s0.25 s2.43 s7.3312 / 947 MB
BHZ, disorder, \(W \times W\)2563.21 s1.51 s29.3 s9.1808 / 2942 MB

On the square lattice the time grows by 5.5 to 5.7 for each doubling of \(W\), below the asymptotic factor of 8. Graphene and BHZ spend most of their time in their leads; BHZ keeps the complex Schur decomposition, since a spin block of BHZ is not a real problem. The recursive Green's function takes 0.73 s on the square lattice at \(W = 256\).

In the code

Crate caroli-green:

ItemWhat
NestedTwoTerminalfrom_model, transmission, transmissions, self_energies, transmission_with, transmission_with_precision, transmissions_checked, block_count
NestedMultiTerminalfrom_model, transmissions, transmissions_with_precision, block_count, lead_count
LeadSelfEnergiesThe lead self-energies of one energy, block by block, to reuse
Precision, PrecisionOptions, checkedSingle-precision fronts, checked against double precision
Field (caroli-dense)The scalar of the fronts (c64, c32), schur and PIVOT_TOL

The tree, the fronts and the plans (SiteTree, Tree, Plan, small_schur) are internal to the crate and shared by the two solvers.

References

  • A. George, Nested dissection of a regular finite element mesh, SIAM J. Numer. Anal. 10, 345 (1973).
  • I. S. Duff, J. K. Reid, The multifrontal solution of indefinite sparse symmetric linear equations, ACM Trans. Math. Softw. 9, 302 (1983).
  • J. W. H. Liu, The multifrontal method for sparse matrix solution: theory and practice, SIAM Rev. 34, 82 (1992).
  • P. R. Amestoy, I. S. Duff, J.-Y. L'Excellent, J. Koster, A fully asynchronous multifrontal solver using distributed dynamic scheduling, SIAM J. Matrix Anal. Appl. 23, 15 (2001): MUMPS, the solver behind Kwant's.
  • C. W. Groth, M. Wimmer, A. R. Akhmerov, X. Waintal, Kwant: a software package for quantum transport, New J. Phys. 16, 063065 (2014).