Skip to content

Spin refactor - #104

Merged
AvirupSircar merged 14 commits into
mainfrom
spin_refactor
Sep 13, 2026
Merged

AvirupSircar merged 14 commits into
mainfrom
spin_refactor

Conversation

@AvirupSircar

Copy link
Copy Markdown
Contributor

Spin-Polarized DFT Refactor Using MultiVectorProductSpace

  • New MultiVectorProductSpace and MultiVectorProductSpaceBlocked abstractions (linearAlgebra/)

    • Introduced two new wavefunction container classes with a flat M × S × N layout (DOFs × spin spaces × orbitals).
    • MultiVectorProductSpaceBlocked is a type-tag subclass that dispatches collinear spin computations to per-spin-space blocked implementations in eigensolvers and orthonormalization routines.
    • MultiVectorProductSpace handles the coupled non-collinear case, where the two spin components are stored in an interleaved product-space representation.
  • New MultiVectorOps utility library (linearAlgebra/MultiVectorOps.h/.t.cpp)

    • Added a collection of spin-aware multi-vector operations for product-space wavefunctions, including:
      • Orthonormalization
      • Rayleigh–Ritz projection and diagonalization
      • Chebyshev filtering
    • Provides a common interface for both collinear and non-collinear spin calculations.
  • Extended KohnShamDFT constructors

    • Added support for a SpinMode enumeration:
      • Unpolarized
      • Collinear
      • NonCollinear
    • Added per-atom magnetic Z-factors (atomMagZFactors) for constructing the initial collinear magnetization guess.
    • Wavefunction allocation and initialization now branch dynamically based on the selected spin mode.
  • New HamiltonianSpinBlockCopyKernels (ksdft/)

    • Introduced CPU/GPU kernels for assembling K spin-block submatrices into the full S·DOF × S·DOF Hamiltonian.
    • Supports both:
      • DOF-fastest storage layout
      • Spin-fastest storage layout
  • Spin-aware eigensolvers and Hamiltonian operators

    • Updated the following components to operate with the new product-space wavefunction interface and correctly dispatch spin-channel operations:
      • RayleighRitzEigenSolver
      • OrthonormalizationFunctions
      • ChebyshevFilteredEigenSolver
      • DensityCalculator
      • KineticFE
      • ExchangeCorrelationFE
      • ElectrostaticLocalFE
      • ElectrostaticONCVNonLocFE
    • Added spin-channel indexing and runtime dispatch for both collinear and non-collinear calculations throughout the Kohn–Sham DFT workflow.

Avirup Sircar and others added 6 commits July 16, 2026 19:42
@AvirupSircar
AvirupSircar merged commit 6cef650 into main Sep 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants