Classical solver (dirac_qlb_solver)
dirac_qlb_solver.py is the classical Quantum Lattice Boltzmann solver for the Dirac
equation that provides the reference every circuit is checked against. It is a runnable
script rather than an import-only library: importing it configures a simulation from
its module-level parameters and prints a summary, so it is documented here descriptively
rather than through autodoc.
Note
The circuit library reproduces the operations of this solver exactly. The
operators in qlb_port.operators are kept consistent with
dirac_qlb_solver by a test (qlb_port.test_port).
What it does
The solver advances a four-component Dirac spinor field on a regular lattice by the QLB substep loop – rotate into the characteristic frame, collide, stream by one site, rotate back – with the mass and any scalar potential carried by the \(\mathrm{SU}(2)\) collision. It implements periodic and reflecting (bounce-back) boundaries and a position-dependent potential, and reproduces graphene Klein-tunnelling physics in the massless limit.
Key module-level parameters
Name |
Meaning |
|---|---|
|
lattice sizes per axis (set |
|
physical box lengths |
|
lattice spacings ( |
|
time step, fixed to the light-cone condition |
|
particle rest mass ( |
|
Compton frequency \(m c^2 / \hbar\) |
|
number of time steps to advance |
|
physical constants |
Running it
python dirac_qlb_solver.py
Edit the parameters at the top of the file to change the lattice, mass, potential, or
number of steps. For the ported-circuit equivalents and the validation harness, see
Usage and qlb_port.
Solver tests
test_dirac_qlb_solver.py and test_qlb_validation.py (at the repository root)
validate the solver: matrix properties, massless advection, the dispersion relation,
convergence, and a uniform-potential global-phase check.