Skip to main content

llandau

Smooth scientific slides, drawn live. Decks are written like manim scenes (with manim-slides' steps), but nothing is rendered ahead: every animation is drawn as it plays (wgpu), so there are no videos, no render step and no Qt. Built for presenting riemann: interactive 3D views of atomic trajectories, splines, tangents and proteins sit inside the slides, and plots come straight from numpy arrays.

from llandau import *

class Results(Deck):
    theme = LIGHT
    def construct(self):
        self.title("sampling a double well")
        energy = self.reveal(image("figures/energy.png", R.body.left))
        self.reveal(below(text("$p(x) prop e^(-U(x) \/ k T)$"), energy), anim=Write)
        self.show_svg("figures/sketch.svg", R.body.right)   # one slide step per Inkscape layer

SLIDES = order(Results)

The figures above are placeholders; examples/slides.py is the same deck with plots drawn from numpy, runnable as is.

llandau play slides.py              # present: arrows step, F full screen, the wheel scrubs
llandau play slides.py --only Results --start 3
llandau pdf slides.py               # one page per step
llandau png slides.py OUT_DIR

Install

Wheels for macOS and Linux (Python >= 3.10) are on PyPI (llandau, after Lev Landau):

pip install llandau

or build it (needs Rust): pip install maturin && maturin develop --release (MACOSX_DEPLOYMENT_TARGET=15.0 on macOS).

External tools:

  • typst CLI: all text and math
  • rsvg-convert (librsvg) or Inkscape: rasterizing layered SVGs (or pip install cairosvg)
  • fonts: Linux Biolinum O (text), Libertinus Math (math; falls back to New Computer Modern Math)
  • optional: pillow (llandau pdf | png), matplotlib (its colormaps), contourpy (contour plots), ffmpeg (videos: the explorer's record button; pip install 'llandau[video]' brings one)

Slides

module contents
mobject manim's model: Mobject VMobject VGroup Group ImageMobject SVGMobject, colors, directions
shapes Line Arrow Circle Dot Rectangle Polygon RoundedRectangle SurroundingRectangle ...
animation FadeIn Write Create Transform ReplacementTransform .animate LaggedStart ..., rate functions
scene Scene (add play wait next_slide), updaters, ValueTracker, always_redraw, build
axes manim's NumberLine Axes NumberPlane ParametricFunction FunctionGraph
plot Plot: matplotlib-style plots of numpy data, revealed in steps
figure subplots Figure: plots for papers, saved as SVG, PDF or PNG
theme DARK/LIGHT, FONT, type scale TITLE BODY SMALL LABEL
text text bold italic eq typst title bullets (Typst)
layout R regions (R.body.left.top, hsplit, grid, right_of(mob)...), place, below above left_of right_of align stack row, gaps XS S M L XL
media image svg layered_svg; layered SVGs are split when building, cached in .llandau_cache/
deck Deck (step reveal title show_svg live), order, typewrite
live live_scene, Deck.live: interactive 3D on chosen steps

Animations follow manim's definitions (timing, lag, rate functions); those without a native clip (rotations, path_arc, updaters, custom interpolate_mobject) are stepped at 60 fps when the deck is built. A deck is one timeline of clips; the player evaluates it at any time, so playing, stepping back and scrubbing (the wheel) are the same thing.

Plots

ax = Plot(R.body.right, xlabel="time $t$ (ps)", ylabel="energy (eV)")
md = ax.plot(t, e, label="MD")                       # nothing shown yet
with ax.group() as samples:                          # several commands, one step
    ax.scatter(ts, es, c=w, cmap="viridis", s=30, label="samples")
    ax.fill_between(t, lo, hi, alpha=0.2)
legend = ax.legend()

self.reveal(ax)                                      # frame, ticks and labels first
self.reveal(md, anim=Create)                         # the line draws itself
self.reveal(samples, legend, anim=FadeIn)

plot scatter fill_between axhline axvline bar hist errorbar imshow contour contourf text legend colorbar, with matplotlib's arguments; sizes in points (times scale=2). ax.c2p(x, y) places other mobjects at data coordinates.

Figures for papers

The same plots, saved as files, in print sizes (inches and points) and the thesis matplotlibrc style:

from llandau import subplots

fig, ax = subplots(figsize=(3.0, 2.0))                    # inches
ax.plot(lam, exact, color="k", label="exact")
ax.plot(lam, ode, color="#b8b8b8", label="ODE ($A -> B$)")
ax.scatter(lam[i], ode[i], s=20, color=CB0, zorder=50)
ax.set_xlabel("$lambda_(A -> B)$ [-]")                   # math in Typst syntax
ax.set_xlim([-1.0, 1.0])
ax.legend(bbox_to_anchor=(0.5, 1.0))
fig.savefig("ode.svg")                                    # vector; also .pdf, .png (dpi=)

SVG and PDF are vector, with text as outlines (it looks the same in any document); bbox_inches="tight" and a transparent background are the defaults. fig.show() opens a window. subplots(2, 3) gives an array of plots; fig.add(mobject) puts anything else on the figure; place(fig, R.body, fit="fill") puts a finished figure on a slide. matplotlib's setters work (set_xlabel set_ylabel set_title set_xlim set_ylim set_xscale set_xticks set_aspect grid), as do zorder, colorbar(..., format="%.1f", labelpad=12) and colors like "k", "C0". Math is Typst's: $\lambda_{A\rightarrow B}$ becomes $lambda_(A -> B)$. See examples/paper_figures.py.

Live 3D steps

@live_scene("butane")
def butane(viewer):                          # a llandau.Viewer, in the deck's theme
    viewer.load(positions, numbers)          # (frames, atoms, 3), (atoms,)

class Results(Deck):
    def construct(self):
        self.live("butane", R.body.right)    # the next step shows it over R.body.right
        self.reveal(place(text("3D here"), R.body.left))
        self.live("butane", R.body.right, camera={"azimuth": 30}, frame=60)  # moves there
        self.reveal(...)

Over a live view: drag rotates, right drag pans, the wheel scrubs frames, pinch zooms; , . step frames, P plays, D toggles the discrete states, 0 resets the camera. Exports show a still image of each live view. See llandau.live for the view settings.

Layer conventions for show_svg: steps are ordered by the first number in each Inkscape layer label (layers sharing a number appear together), saved visibility is ignored, and layers whose label starts with _ are skipped.

The viewer

from llandau import Viewer, segment_ids
from llandau.explorer import explore

viewer = Viewer(theme="light").load(positions, numbers, roles=roles)   # (frames, atoms, 3), (atoms,)
viewer.style = "protein"                      # or "atoms" (ball and stick)
viewer.sidechains = "spheres"                 # van der Waals spheres; or "sticks"
viewer.shading = "flat"                       # plain colors with a dark outline (cinemol-like); or "lit"
viewer.set_visible("surface", True)           # translucent molecular surface around the heavy atoms
viewer.set_surface(opacity=0.4, colors="uniform", sharpness=2.0)   # colors="atoms": nearest atom's color
viewer.set_visible("clashes", True)           # vdW overlap > viewer.clash_overlap (Å), beyond 3 bonds
viewer.set_trails(segment_ids=segment_ids(t, spline.segment_boundaries))
viewer.add_vectors("tangent", tangents, scale=1.5)
viewer.color_by("kinetic energy", per_atom_values, cmap="fire")   # then viewer.coloring = "kinetic energy"
viewer.set_ghost(target_positions)            # translucent, in the same style
viewer.set_discrete_frames(states)            # (states, atoms, 3): same atoms, e.g. the discrete trajectory
viewer.scrub_discrete = True                  # `frame` now walks those states instead of the path
viewer.frame = 30
image = viewer.render_image(800, 600)         # (600, 800, 4) uint8
explore(viewer, plots={"action": action}, t=t)

Roles (as riemann's atom_role): 0 hydrogen, 1 side chain heavy atom, 2 backbone N C O, 3 CA. The protein style draws a smooth tube through the CAs and the side chains, no hydrogens; trails follow the CAs only. Themes ("light", "dark") set the background and every non-element color; element colors come from llandau.elements.

explore(viewer, plots=..., t=...) opens a native window (winit + egui) with the 3D view, a panel of controls and plots; it works on macOS, X11 and Wayland. Keys: space plays, , . step frames, D toggles the discrete states, 0 resets the camera, R records, Escape closes. Recording keeps what you do in the 3D view; stopping renders it offscreen into an MP4 (H.264) at a fixed frame rate, without the panel: explore(viewer, record="turn.mp4", record_size=(1920, 1080), record_fps=60), or any frames with llandau.video.Video. Without a GPU, a software Vulkan driver (Mesa's lavapipe) works; WGPU_BACKEND=vulkan|gl|metal picks the backend, Viewer().adapter tells which GPU is in use.

python examples/explore_butane.py                     # explorer window
python examples/explore_trpcage.py 1l2y.pdb           # protein: NMR models as frames
python examples/render_layers.py OUT_DIR 1l2y.pdb     # offscreen PNG of each feature
llandau play examples/live_demo.py                     # a deck with live 3D steps

Layout

  • src/slides/: decks: timeline (clips, marks, manim's animation logic), paint (lyon tessellation, supersampled wgpu drawing), svg (usvg), player (the window), live (3D views in decks)
  • src/: the viewer: camera (z-up turntable), scene (structure and layers -> instances), protein, surface, clash, theme, render (sphere impostors, instanced lathe meshes, two-pass ghost, overlay), window (the explorer), lib (Python bindings)
  • python/llandau/: the Python side of both

Metadata

Release files for llandau 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llandau 0.4.1
File Size Uploaded Provenance
llandau-0.4.1.tar.gz 194.5 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for llandau 0.4.1
File
llandau-0.4.1-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
llandau-0.4.1-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details
llandau-0.4.1-cp310-abi3-macosx_11_0_x86_64.whl CPython 3.10 abi3 macOS 11.0+ x86-64 Details
llandau-0.4.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 27.6 MB

Release files / llandau-0.4.1.tar.gz

Download URL llandau-0.4.1.tar.gz
Size 194.5 kB
Tags Source
SHA-256 checksum
How to use checksums
71efe1472ad3eacd527770bfc75721566ed4e25e47c39cde704747ddb4188b63
BLAKE2b-256 checksum
How to use checksums
da2c85a5b67a1dab466ba6ddd3a9ab24038fd780b181ea8e836f780a0db5ad0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / llandau-0.4.1-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL llandau-0.4.1-cp310-abi3-manylinux_2_28_x86_64.whl
Size 8.1 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
9026618ff2ea23bebf48763a836c8f8412015d7c10723c4d5f6a3a7926c7f02f
BLAKE2b-256 checksum
How to use checksums
bd23c087791fbf089f06ee340a01eaf158f93479be2d23bc71f144879b9623e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / llandau-0.4.1-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL llandau-0.4.1-cp310-abi3-manylinux_2_28_aarch64.whl
Size 7.5 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
1146902a80f7cdf9edd2a5977423c1668bd6e31d76b7054cf2a6e7843228f9b6
BLAKE2b-256 checksum
How to use checksums
5b8fa3ef5ae4252e3c3d6dd1d4e489bb2eea65d9b2766e50018ac2b345aeb905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / llandau-0.4.1-cp310-abi3-macosx_11_0_x86_64.whl

Download URL llandau-0.4.1-cp310-abi3-macosx_11_0_x86_64.whl
Size 6.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
afb3618eaa981d5d0145165a994318bbc8e3a8ea1028dac383d27fedba438b11
BLAKE2b-256 checksum
How to use checksums
e44992aa5aa476cc364285db332cd2df8377866c522076acad1449f0c7fb867f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / llandau-0.4.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL llandau-0.4.1-cp310-abi3-macosx_11_0_arm64.whl
Size 5.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7fc6bb7a49c408097da4f1915c143d32c958502e447cf925e5cffe508ab5c1d1
BLAKE2b-256 checksum
How to use checksums
21e3ab674cf71af11e27819eb700cbc97eb7ca22147c630a9d3dc62d3e7fd4fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for llandau 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for llandau-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page