feat: compute the first Brillouin zone from the reciprocal lattice - #295
Open
timurbazhirov wants to merge 1 commit into
Open
feat: compute the first Brillouin zone from the reciprocal lattice#295timurbazhirov wants to merge 1 commit into
timurbazhirov wants to merge 1 commit into
Conversation
Adds ReciprocalLattice.brillouinZone, returning the Wigner-Seitz cell of the reciprocal lattice as polygonal faces: the intersection of the half-spaces k.G <= |G|^2/2, with vertices at the plane triple intersections that satisfy every other half-space. The zone follows from the lattice's own vectors rather than its Bravais type, so materials sharing a type but differing in axial ratios — a bulk crystal and a slab padded with vacuum, say — yield correctly differing zones. Consumers currently illustrate the zone with one static image per lattice type, which cannot express that difference (and ships as an asset outside the package). Validated against the material fixtures: silicon gives a truncated octahedron, Na4Cl4 a cube, graphene a hexagonal prism, each closed with V - E + F = 2 and enclosing no reciprocal lattice point but the origin. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FFFpkKD3zHysJXgAbT2uYV
This was referenced Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ReciprocalLattice.brillouinZone— the first Brillouin zone as polygonal faces, computed from the lattice we already have.Why
Consumers illustrate the Brillouin zone with a static PNG per lattice type:
@mat3ra/wovederives/images/brillouin_zone/<lattice>.pngfrom the material and renders it through an injectable component (@mat3ra/move'sBrillouinZoneImageis one). Two problems with that:HEX, but the monolayer's vacuum padding flattens its zone. A per-type image shows them identically.madealready owns the reciprocal lattice and itsreciprocalVectors, so the zone can simply be derived here instead.What
src/js/lattice/reciprocal/brillouin_zone.ts—computeBrillouinZone(reciprocalVectors). The zone is the set of points closer to the origin than to any other reciprocal lattice point, i.e. the intersection of half-spacesk·G ≤ |G|²/2; vertices are the plane triple-intersections satisfying every other half-space, and faces group the vertices on each plane (ordered counter-clockwise about the face normal, so they can be drawn directly).ReciprocalLattice.brillouinZonegetter returning those faces, ornullfor a degenerate lattice.No existing behaviour changes; this is additive.
Validation
Tested against the repo's material fixtures rather than hand-made vectors (
tests/js/lattice/brillouin_zone.ts, 7 tests):Plus invariants on all four: Euler characteristic
V − E + F = 2, and every vertex at least as close to the origin as to a neighbouring reciprocal lattice point. Existinglatticeandlattice_reciprocalsuites still pass (14 tests).Follow-ups (not in this PR)
@mat3ra/move: render this zone, superseding the<img>-basedBrillouinZoneImage.@mat3ra/wove: pass the provider'smaterial/lattice to the injected component instead oflatticeType+ a deadimgSrc.symmetryPointsalongside, labelling Γ/X/L on the drawn zone and overlaying the k-path becomes straightforward — something a static image never allowed.Context: mat3ra/workflow-designer#12 (SOF-8024), where this shipped first as a local stopgap.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FFFpkKD3zHysJXgAbT2uYV
Generated by Claude Code