feat: Support SOC for overlap, add --soc option in esk, add uniform_noref method for SOC and support s/p/d type for SOC #271
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.
This pull request introduces comprehensive Spin-Orbit Coupling (SOC) support into the overlap SK build. It adds new CLI functionality, improves JSON export, and enhances model configuration to make SOC handling robust and user-friendly. The most important changes are grouped below.
1. SOC support for overlap
The
hr2hk
module did not implement SOC support when overlap was enabled. This made it raise an error ofOverlap is not implemented for SOC
when perform training with both SOC and overlap simultaneously.Implementation:
Implemented SOC-overlap coupling as:$N \times N$ overlap matrix $S(k)$ into a $2N \times 2N$ Kronecker product form.
S_soc = S ⊗ I₂
, transforming theEnforced a strict Hermitian form on the overlap matrix to avoid numerical issues preventing runtime errors . It can be bypassed by setting
"freeze": ["overlap"]
, otherwise it will throw an error out when SOC+overlap is active and"overlap"
is not frozen, like:Now:
Verified training with SOC+overlap is now stable on MoS₂ benchmarks, confirming correct functionality of the new implementation. Results as below:
2. New
--soc
option indptb esk
to get an easy start for soc training--soc
option to thedptb esk
command.onsite
section for schema consistency."s"
orbitals and orbitals containing"*"
→0
"p"
and"d"
orbitals → SOC value (default is 0.2).model_options.nnsk.soc.method
to"uniform_noref"
when SOC is enabled.3. New SOC method:
uniform_noref
, add"s"
,"p"
,"d"
orbital support to soc innnsk
."uniform_noref"
as a optional SOC method name."uniform_noref"
method for"soc"
just as it was implemented in"onsite"
.