Skip to content

feat: spin-orbit coupling for spin-flip TDDFT - #5

Merged
wtpeter merged 2 commits into
mainfrom
feat/sftda-soc
Jul 13, 2026
Merged

feat: spin-orbit coupling for spin-flip TDDFT#5
wtpeter merged 2 commits into
mainfrom
feat/sftda-soc

Conversation

@wtpeter

@wtpeter wtpeter commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator
  • Add AO SOC integrals and a shared SOC driver.
  • Support SOC calculations for SF-TDA and SF-TDDFT with ROKS/UKS references.
  • Add numerical tests and an example workflow.

@wtpeter
wtpeter merged commit 6a5c760 into main Jul 13, 2026
2 checks passed
@wtpeter
wtpeter requested a review from Copilot July 13, 2026 06:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces spin–orbit coupling (SOC) support for spin-flip excited-state methods in NEST, including AO-basis SOC integral construction and a shared SOC Hamiltonian driver that works with SF-TDA and SF-TDDFT (ROKS/UKS references). It also adds numerical regression tests and an example script to demonstrate end-to-end usage.

Changes:

  • Add AO SOC integral builders (1e, Zeff, SOMF, X2CAMF) and a symmetrization step to enforce tensor Hermiticity.
  • Add a generic SOC Hamiltonian builder/diagonalizer and an SF-TDA/SF-TDDFT-specific SOC driver that constructs reduced transition densities.
  • Add regression tests for AO SOC and SF-TDA/SF-TDDFT SOC outputs, plus a runnable example workflow.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/nest/soc/soc_ao.py Implements AO-basis SOC integrals for multiple SOC types and returns a Hermitian spherical-tensor representation.
src/nest/soc/soc.py Adds shared SOC Hamiltonian machinery (state representation, CG coefficients, block assembly, diagonalization, analysis).
src/nest/soc/sftda.py Adds SOC driver for SF-TDA/SF-TDDFT objects, including reduced transition density construction.
src/nest/soc/init.py Exposes SOC components from the new nest.soc package.
src/nest/sftda/uhf_sf.py Adds a SOC() convenience method to SF-TDA/SF-TDDFT results to construct the SOC driver.
src/nest/soc/tests/test_soc_ao.py Adds numerical regression tests for AO SOC integrals (1e, Zeff, SOMF; includes UKS case).
src/nest/soc/tests/test_sftda_soc.py Adds regression tests for SF-TDA SOC (ROKS/UKS) and CG coefficient sanity checks.
src/nest/soc/tests/test_sftddft_soc.py Adds regression tests for SF-TDDFT SOC (ROKS/UKS).
examples/soc/01_sftda_soc.py Adds an example script demonstrating an SF-TDA SOC workflow and analysis output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +5
# Copyright 2026 The NEST Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

Comment on lines +1 to +5
# Copyright 2026 The NEST Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

Comment thread src/nest/soc/soc_ao.py
Comment on lines +24 to +31
def sozeff(atom, zeff_type="one"):
"""
Calculate effective nuclear charge for given atomic number
copied from: https://github.com/masaya0222/PyGraSO/blob/main/pygraso/calc_ao_element.py
Author: Masaya Hagai <hagai.masaya.v9@s.mail.nagoya-u.ac.jp>
"""
assert zeff_type in ["one", "orca", "pysoc"], f"{zeff_type=} is not valid"
neval = {
Comment thread src/nest/soc/soc_ao.py
Comment on lines +173 to +174
except Exception as e:
print(f"Warning: failed to increase stack size: {e}")
Comment thread src/nest/soc/soc_ao.py
Comment on lines +175 to +180
try:
from socutils.somf import somf_pt
except ImportError:
raise ImportError("Please install socutils package to use X2CAMF SOC integrals." \
"https://github.com/wtpeter/socutils")
ao_soc = 2j * somf_pt.get_psoc_x2camf(mol, xresp=X2CAMF_XRESP)
@wtpeter
wtpeter deleted the feat/sftda-soc branch July 19, 2026 08:08
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