Skip to content

Feature/dz0scf gradient clean (reopened for review) - #16

Closed
wtpeter wants to merge 13 commits into
NonDFT:mainfrom
jingjjkkyj:feature/dz0scf-gradient-clean
Closed

wtpeter wants to merge 13 commits into
NonDFT:mainfrom
jingjjkkyj:feature/dz0scf-gradient-clean

Conversation

@wtpeter

@wtpeter wtpeter commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Reopens the original #10 branch (jingjjkk/NEST:feature/dz0scf-gradient-clean) against the current main for further inspection and modification. The original PR was merged as #10 and later reverted by #15.

Betty0621 and others added 13 commits August 29, 2026 06:35
Port the average/roks dual-semantics EnsembleRKS reference (fixed
2/1/0 occupations, Dz = 0) and align Dz0SCF with the shared
reference_energy semantics so NTTDA can treat both reference types
uniformly.
Port the NTTDA response/gradient stack (deltaS = -1/0 channels,
XC ledger kernels, ensemble orbital-response backend) and wire
NTTDA.nuc_grad_method to nest.grad.nttda.Gradients.  The linear
solver uses pyscf.tdscf._lr_eig: the nest._lr_eig fork does not
converge on the ensemble orbital Hessian.
Add the ensemble FD/response, scalar-ledger, gradient-layer, and
known-value NTTDA energy suites.
Drop the EnsembleRKS reference path and drive the NTTDA gradient from
Dz0SCF (average-occupation) and ROKS only.  Dz0SCF now exposes the
average-occupation marker plus a charge-RKS companion for the
spin-unpolarized response, rebuilt on every call so a reused mean-field
object (reset/new geometry/xc change) never reuses a stale reference.
Port the ensemble suites to Dz0SCF and add a cache-invalidation
regression test.
Remove the stale spin-lowering-only transition methods that shadow the upstream all-channel implementation after merging main. Restore nest._lr_eig so oscillator strengths retain upstream convergence behavior. The existing all-channel oscillator-strength regression passes without changing its tolerance.
Keep spin-channel amplitudes and coefficients explicit while sharing orbital partitions, reference responses, J/K derivative batching, Fz exchange and adjoint assembly. Consolidate identical GGA and meta-GGA quadrature flows with explicit density dimensions and kernel dispatch. Remove 1216 net lines from the gradient package; retain existing numerical checks and tolerances.
Retain the branch's PySCF response solver: the shared NEST solver fails the existing small-system Dz0SCF convergence checks. Explicitly converge oscillator-strength amplitudes to 1e-9 with lindep=1e-18 rather than relying on the default 1e-5 residual; reference values and assertion tolerances are unchanged. Seven targeted tests and eight subtests pass.
Build channel projections once per gradient and reuse the shared transition-potential projection. Share adjoint assembly and Krylov mechanics while retaining reference-specific Hessians and preconditioners. Use a singleton density-feature axis for LDA to share the GGA/MGGA quadrature loops, retaining distinct pair kernels. Consolidate HF/DFT Fock derivatives and remove unreferenced channel projection wrappers. Net reduction: 604 implementation lines; existing numerical tests and tolerances are unchanged.
@wtpeter wtpeter closed this Sep 25, 2026
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