Skip to content

Added SVD-based projective Wannierization API#146

Open
Alphaharrius wants to merge 2 commits into
mainfrom
dev/wannierization
Open

Added SVD-based projective Wannierization API#146
Alphaharrius wants to merge 2 commits into
mainfrom
dev/wannierization

Conversation

@Alphaharrius
Copy link
Copy Markdown
Owner

Summary

This PR adds a documented SVD-based projection API for momentum-sector gauge alignment and builds a higher-level proj_wannierization() helper on top of it.

Together, these changes make the projective Wannierization workflow easier to call, better documented, and better tested, while also tightening the lattice-inference path used to rebuild Wannier-style output bases from source offsets.

What changed

  • introduced svd_projection() as the explicit API for sectorwise gauge alignment
  • exported svd_projection() from qten.ops
  • documented the sectorwise SVD / polar-factor construction in detail, including rectangular-rank handling and zero-padded sectors
  • clarified and regression-tested the infer_lattice=True path that rebuilds an output lattice from source-side offset labels
  • updated Wannier/Bloch matching to use fractional offset tuples rather than ambient-space-dependent offset identity
  • added proj_wannierization() as a thin helper that performs:
    • Fourier transform of localized real-space trial orbitals into momentum space
    • projection of target band states into the seed-selected gauge via svd_projection()
  • validated tensor ranks and leading-dimension types in proj_wannierization()
  • documented the projective Wannierization workflow, tensor-leg conventions, and lattice-aware output behavior
  • added regression tests for zero-padded projection behavior
  • added tests for rebasing offsets before inferred unit-cell extraction
  • added tests for lattice-backed inferred output labels
  • added tests showing proj_wannierization() matches explicit Fourier-plus-SVD construction

Why

This branch turns a lower-level projection workflow into a clearer public API surface.

At the lower level, svd_projection() gives the momentum-sector projection logic a stable name, explains the underlying math, and makes the lattice-inference behavior more predictable and reviewable.

At the higher level, proj_wannierization() removes repeated boilerplate for the common workflow of taking localized trial orbitals, transforming them into momentum space, and using them to fix the gauge of a target band manifold.

The fractional-coordinate matching change also makes the inferred Wannier construction less sensitive to symbolic ambient-space identity and better aligned with the intended geometric equivalence.

Testing

  • added coverage showing svd_projection() ignores zero-padded filled bands without spurious warnings
  • added coverage showing the projection ignores zero-padded target/source columns sectorwise
  • added coverage for offset rebasing before inferred unit-cell construction
  • added coverage verifying inferred output offsets remain lattice-backed when infer_lattice=True
  • added coverage showing proj_wannierization() matches explicit fourier_transform(...) plus svd_projection(...)
  • added coverage showing proj_wannierization() can return lattice-aware output when the seed columns carry Hilbert labels

Notes for reviewers

  • proj_wannierization() is intentionally a thin orchestration layer; the core numerical alignment remains centralized in svd_projection()
  • the main semantic change beyond docs and API naming is in the lattice-inference path, where matching now depends on fractional coordinates rather than raw offset ambient-space equality

- rename the momentum-space projection API to svd_projection
- document the sectorwise SVD construction with step-by-step math
- clarify how infer_lattice rebuilds the unit cell and Bloch space from source offsets
- export the new API from qten.ops and update band tests
- make Bloch-state matching keys use fractional offset tuples
Implement projective Wannierization as a thin wrapper around the
Fourier transform and SVD projection workflow, with validation,
lattice-inference support, and detailed API documentation.

Add coverage for equivalence with explicit Fourier+SVD projection
and for lattice inference when seed columns carry Hilbert labels.
@Alphaharrius Alphaharrius added this to the v0.4.0-qten milestone May 11, 2026
@Alphaharrius Alphaharrius requested a review from eyjafjallac May 11, 2026 09:28
@Alphaharrius Alphaharrius self-assigned this May 11, 2026
@Alphaharrius Alphaharrius added the enhancement New feature or request label May 11, 2026
Copy link
Copy Markdown
Collaborator

@eyjafjallac eyjafjallac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants