# GFN spin-polarization constants W^A_{ll'} for the spGFN1/spGFN2-xTB methods.
#
# ---------------------------------------------------------------------------
# PROVENANCE
# ---------------------------------------------------------------------------
# Source repository : tblite  <https://github.com/tblite/tblite>
# Source file       : src/tblite/data/spin.f90  (module `tblite_data_spin`,
#                     parameter array `spin_constants(6, 86)`)
# Pinned commit     : 66175172f1e80b899fd67f79128ee27b2be8dafa
#                     ("Addition of GFN lanthanide spin constants & minor
#                      adjustments (#274)", authored 2025-07-22)
# Permalink         : https://github.com/tblite/tblite/blob/66175172f1e80b899fd67f79128ee27b2be8dafa/src/tblite/data/spin.f90
# Retrieved         : 2026-08-21
# Original license  : LGPL-3.0-or-later (SPDX header of the source file).
#                     gfn2-rs is GPL-3.0-or-later, which may incorporate
#                     LGPL-3.0-or-later material; see THIRD_PARTY_NOTICES.md.
#
# ---------------------------------------------------------------------------
# REFERENCE PUBLICATION
# ---------------------------------------------------------------------------
# spin.f90 itself carries no citation. The method these constants belong to is
# documented by xtb (which delegates spin-polarized xTB to tblite) as:
#
#   H. Neugebauer, B. Baedorf, S. Ehlert, A. Hansen, S. Grimme,
#   "High-throughput screening of spin states for transition metal complexes
#    with spin-polarized extended tight-binding methods",
#   J. Comput. Chem. 2023, 44(27), 2120. DOI 10.1002/jcc.27185
#   (cited in grimme-lab/xtb_docs, source/spgfn.rst).
#
# How the numbers were produced, per the tblite pull requests that wrote them:
#   * PR #155 "Updated spGFN2 spin constants" (2025-02-13): recomputed with a
#     more sophisticated script; rare gases fixed to use PBE (previously HF by
#     accident); Cr, Cu, Y, Zr, Pd, Pt, Au electron configurations adjusted.
#   * PR #274 (2025-07-22): lanthanide constants added, computed the same way
#     as the rest, i.e. atomic calculations at the PBE/def2-QZVPP level;
#     broken-symmetry outliers (Gd, Tb, Dy, plus Tm pd, Pd sp, Ag pp, Re sp,
#     Au pp) replaced by interpolated values.
#
# ---------------------------------------------------------------------------
# UNITS AND SCALING
# ---------------------------------------------------------------------------
# Hartree (atomic units), transcribed VERBATIM: the conversion factor applied
# here is exactly 1.0 and no digits were altered.
#
# Justification: tblite works in atomic units throughout. The values feed
# `tblite_spin::get_energy` as
#     E = 1/2 * sum_A sum_{l,l' in A} p_{Al} p_{Al'} W^A_{ll'}
# with shell magnetizations p in electrons, which yields Hartree directly, and
# the corresponding shell potential is v_{Al} = sum_{l'} p_{Al'} W^A_{ll'}.
# gfn2-rs `spin::spin_polarization_state` uses the identical expressions.
# The Fortran CLI (`app/driver_run.f90::get_spin_constants`) assigns
# `wll(jsh, ish, izp) = get_spin_constant(jl, il, num)` with NO conversion or
# prefactor. The only multiplier anywhere is `wscale` in the C API
# (`src/tblite/api/container.f90`, `wll = wscale * wll`), documented in
# `include/tblite/container.h` as "Scaling factor for spin polarization
# (default: 1)" -- a user knob, not a unit conversion. Sanity check: W_ss(H) =
# -0.0716250 Eh matches the customary DFTB spin constant for hydrogen
# (~ -0.072 Eh), confirming Hartree rather than eV.
#
# ---------------------------------------------------------------------------
# FORMAT
# ---------------------------------------------------------------------------
# One element per line, in the packed symmetric form understood by
# `SpinPolarizationParameters::from_str`:
#
#     <El>  ss  sp  pp  sd  pd  dd
#
# which is exactly the column order of the tblite array (its own comment reads
# "! ss, sp, pp, sd, pd, dd"). Missing shell pairs are stored by tblite as
# 0.0000000 and are reproduced here as 0.0000000 rather than as "-", so that
# every Z=1..86 entry is *present* and this file reproduces tblite bit for bit
# for any basis, including shells that tblite would read as zero.
#
# Coverage: Z = 1..86 (H..Rn), all 6 shell pairs each -- the complete table.

H   -0.0716250    0.0000000    0.0000000    0.0000000    0.0000000    0.0000000   # Z=1   tblite spin.f90 line 40
He  -0.0865500   -0.0386630   -0.0674250    0.0000000    0.0000000    0.0000000   # Z=2   tblite spin.f90 line 41
Li  -0.0178000   -0.0139500   -0.0180500    0.0000000    0.0000000    0.0000000   # Z=3   tblite spin.f90 line 42
Be  -0.0229750   -0.0186250   -0.0175750    0.0000000    0.0000000    0.0000000   # Z=4   tblite spin.f90 line 43
B   -0.0272500   -0.0219370   -0.0195750    0.0000000    0.0000000    0.0000000   # Z=5   tblite spin.f90 line 44
C   -0.0305000   -0.0250250   -0.0226750    0.0000000    0.0000000    0.0000000   # Z=6   tblite spin.f90 line 45
N   -0.0330750   -0.0275000   -0.0254500    0.0000000    0.0000000    0.0000000   # Z=7   tblite spin.f90 line 46
O   -0.0350750   -0.0295380   -0.0278500    0.0000000    0.0000000    0.0000000   # Z=8   tblite spin.f90 line 47
F   -0.0369000   -0.0311870   -0.0299250    0.0000000    0.0000000    0.0000000   # Z=9   tblite spin.f90 line 48
Ne  -0.0383000   -0.0326250   -0.0317250   -0.0141250   -0.0152500   -0.0413500   # Z=10  tblite spin.f90 line 49
Na  -0.0150750   -0.0133370   -0.0229250    0.0000000    0.0000000    0.0000000   # Z=11  tblite spin.f90 line 50
Mg  -0.0165000   -0.0130750   -0.0175000   -0.0093750   -0.0179630   -0.0223500   # Z=12  tblite spin.f90 line 51
Al  -0.0182500   -0.0138380   -0.0139750   -0.0082250   -0.0117000   -0.0129000   # Z=13  tblite spin.f90 line 52
Si  -0.0195250   -0.0150000   -0.0143750   -0.0084500   -0.0116120   -0.0140000   # Z=14  tblite spin.f90 line 53
P   -0.0205750   -0.0161250   -0.0149000   -0.0093000   -0.0119870   -0.0148250   # Z=15  tblite spin.f90 line 54
S   -0.0213250   -0.0170130   -0.0155000   -0.0100370   -0.0121750   -0.0149500   # Z=16  tblite spin.f90 line 55
Cl  -0.0217500   -0.0177130   -0.0160500   -0.0109750   -0.0126620   -0.0150750   # Z=17  tblite spin.f90 line 56
Ar  -0.0221500   -0.0183630   -0.0165500   -0.0118870   -0.0131130   -0.0153000   # Z=18  tblite spin.f90 line 57
K   -0.0106500   -0.0109000   -0.0164750    0.0000000    0.0000000    0.0000000   # Z=19  tblite spin.f90 line 58
Ca  -0.0118000   -0.0104500   -0.0134500   -0.0055000   -0.0035130   -0.0101750   # Z=20  tblite spin.f90 line 59
Sc  -0.0127250   -0.0108620   -0.0138500   -0.0047880   -0.0024130   -0.0125250   # Z=21  tblite spin.f90 line 60
Ti  -0.0134250   -0.0112380   -0.0146500   -0.0043380   -0.0019750   -0.0138750   # Z=22  tblite spin.f90 line 61
V   -0.0140750   -0.0114630   -0.0152750   -0.0040500   -0.0017250   -0.0149250   # Z=23  tblite spin.f90 line 62
Cr  -0.0144750   -0.0116120   -0.0160000   -0.0037250   -0.0014630   -0.0157750   # Z=24  tblite spin.f90 line 63
Mn  -0.0149000   -0.0118000   -0.0167250   -0.0034870   -0.0013120   -0.0165000   # Z=25  tblite spin.f90 line 64
Fe  -0.0154000   -0.0120250   -0.0177500   -0.0032880   -0.0011630   -0.0171250   # Z=26  tblite spin.f90 line 65
Co  -0.0157000   -0.0120250   -0.0187000   -0.0031500   -0.0010250   -0.0177500   # Z=27  tblite spin.f90 line 66
Ni  -0.0161500   -0.0122000   -0.0197000   -0.0030370   -0.0009130   -0.0183000   # Z=28  tblite spin.f90 line 67
Cu  -0.0166500   -0.0123500   -0.0203000   -0.0028250   -0.0008620   -0.0188250   # Z=29  tblite spin.f90 line 68
Zn  -0.0168500   -0.0123250   -0.0214500    0.0000000    0.0000000    0.0000000   # Z=30  tblite spin.f90 line 69
Ga  -0.0172250   -0.0128120   -0.0134000   -0.0085250   -0.0130000   -0.0157750   # Z=31  tblite spin.f90 line 70
Ge  -0.0174500   -0.0133500   -0.0135500   -0.0081120   -0.0128130   -0.0175250   # Z=32  tblite spin.f90 line 71
As  -0.0178750   -0.0137630   -0.0135750   -0.0080500   -0.0123250   -0.0176500   # Z=33  tblite spin.f90 line 72
Se  -0.0180000   -0.0141250   -0.0136250   -0.0081500   -0.0120130   -0.0172000   # Z=34  tblite spin.f90 line 73
Br  -0.0181000   -0.0143750   -0.0136750   -0.0082750   -0.0117500   -0.0167750   # Z=35  tblite spin.f90 line 74
Kr  -0.0181250   -0.0145500   -0.0137000   -0.0086880   -0.0118000   -0.0164250   # Z=36  tblite spin.f90 line 75
Rb  -0.0095500   -0.0096000   -0.0167250    0.0000000    0.0000000    0.0000000   # Z=37  tblite spin.f90 line 76
Sr  -0.0105750   -0.0092870   -0.0125500   -0.0074000   -0.0059000   -0.0079500   # Z=38  tblite spin.f90 line 77
Y   -0.0115000   -0.0098250   -0.0136000   -0.0072880   -0.0046250   -0.0090000   # Z=39  tblite spin.f90 line 78
Zr  -0.0121500   -0.0099880   -0.0162250   -0.0066250   -0.0036250   -0.0098750   # Z=40  tblite spin.f90 line 79
Nb  -0.0125750   -0.0102620   -0.0191750   -0.0060630   -0.0029250   -0.0104750   # Z=41  tblite spin.f90 line 80
Mo  -0.0129000   -0.0105000   -0.0222250   -0.0055750   -0.0024250   -0.0109000   # Z=42  tblite spin.f90 line 81
Tc  -0.0131250   -0.0106250   -0.0247250   -0.0051250   -0.0020120   -0.0113000   # Z=43  tblite spin.f90 line 82
Ru  -0.0133500   -0.0107620   -0.0276000   -0.0047370   -0.0016750   -0.0116000   # Z=44  tblite spin.f90 line 83
Rh  -0.0135500   -0.0108380   -0.0320500   -0.0043750   -0.0014250   -0.0118750   # Z=45  tblite spin.f90 line 84
Pd  -0.0136500   -0.0109440   -0.0287000   -0.0041250   -0.0012880   -0.0121250   # Z=46  tblite spin.f90 line 85
Ag  -0.0139250   -0.0110500   -0.0241750   -0.0038870   -0.0009630   -0.0124000   # Z=47  tblite spin.f90 line 86
Cd  -0.0138500   -0.0105000   -0.0196500    0.0000000    0.0000000    0.0000000   # Z=48  tblite spin.f90 line 87
In  -0.0142250   -0.0105500   -0.0115750   -0.0050370   -0.0093750   -0.0100000   # Z=49  tblite spin.f90 line 88
Sn  -0.0143000   -0.0108750   -0.0116750   -0.0046880   -0.0090750   -0.0118750   # Z=50  tblite spin.f90 line 89
Sb  -0.0145250   -0.0111250   -0.0116250   -0.0043750   -0.0087130   -0.0124250   # Z=51  tblite spin.f90 line 90
Te  -0.0145250   -0.0112500   -0.0115750   -0.0041870   -0.0081750   -0.0121750   # Z=52  tblite spin.f90 line 91
I   -0.0146500   -0.0113870   -0.0114750   -0.0044620   -0.0083620   -0.0128250   # Z=53  tblite spin.f90 line 92
Xe  -0.0146500   -0.0114250   -0.0114500   -0.0048750   -0.0085750   -0.0132000   # Z=54  tblite spin.f90 line 93
Cs  -0.0082000   -0.0085880   -0.0153000    0.0000000    0.0000000    0.0000000   # Z=55  tblite spin.f90 line 94
Ba  -0.0092500   -0.0083000   -0.0113750   -0.0063870   -0.0042250   -0.0079250   # Z=56  tblite spin.f90 line 95
La  -0.0099000   -0.0084250   -0.0114000   -0.0059370   -0.0033750   -0.0090250   # Z=57  tblite spin.f90 line 96
Ce  -0.0881750   -0.0066380   -0.0019250   -0.0017000   -0.0017000   -0.0234250   # Z=58  tblite spin.f90 line 97
Pr  -0.0890750   -0.0065000   -0.0009500   -0.0015370   -0.0017370   -0.0237000   # Z=59  tblite spin.f90 line 98
Nd  -0.0901000   -0.0063750   -0.0000750   -0.0014630   -0.0016250   -0.0230250   # Z=60  tblite spin.f90 line 99
Pm  -0.0908000   -0.0064880    0.0004500   -0.0013000   -0.0016500   -0.0226250   # Z=61  tblite spin.f90 line 100
Sm  -0.0918250   -0.0065380    0.0014000   -0.0012750   -0.0017250   -0.0222250   # Z=62  tblite spin.f90 line 101
Eu  -0.0922250   -0.0065380    0.0017250   -0.0012000   -0.0018000   -0.0218250   # Z=63  tblite spin.f90 line 102
Gd  -0.0928812   -0.0065798    0.0024101   -0.0011021   -0.0016846   -0.0209135   # Z=64  tblite spin.f90 line 103
Tb  -0.0936096   -0.0066189    0.0030779   -0.0010125   -0.0016808   -0.0201625   # Z=65  tblite spin.f90 line 104
Dy  -0.0943380   -0.0066581    0.0037457   -0.0009229   -0.0016769   -0.0194115   # Z=66  tblite spin.f90 line 105
Ho  -0.0951750   -0.0067500    0.0042250   -0.0008380   -0.0016250   -0.0190000   # Z=67  tblite spin.f90 line 106
Er  -0.0956500   -0.0067250    0.0040000   -0.0007370   -0.0007630   -0.0176000   # Z=68  tblite spin.f90 line 107
Tm  -0.0963500   -0.0067370    0.0044000   -0.0006750   -0.0007065   -0.0160000   # Z=69  tblite spin.f90 line 108
Yb  -0.0958500   -0.0066500    0.0024000   -0.0007500   -0.0008000   -0.0175500   # Z=70  tblite spin.f90 line 109
Lu  -0.1086250   -0.0079000    0.0063250   -0.0047000   -0.0007120   -0.0269000   # Z=71  tblite spin.f90 line 110
Hf  -0.0121750   -0.0096750   -0.0126250   -0.0076250   -0.0041130   -0.0104250   # Z=72  tblite spin.f90 line 111
Ta  -0.0123000   -0.0095750   -0.0134000   -0.0071380   -0.0034630   -0.0109250   # Z=73  tblite spin.f90 line 112
W   -0.0125000   -0.0094620   -0.0144500   -0.0066880   -0.0029130   -0.0112500   # Z=74  tblite spin.f90 line 113
Re  -0.0126000   -0.0093310   -0.0148000   -0.0063000   -0.0026130   -0.0114500   # Z=75  tblite spin.f90 line 114
Os  -0.0127000   -0.0092000   -0.0205750   -0.0059380   -0.0021120   -0.0115500   # Z=76  tblite spin.f90 line 115
Ir  -0.0127500   -0.0092750   -0.0209250   -0.0056880   -0.0019120   -0.0116000   # Z=77  tblite spin.f90 line 116
Pt  -0.0127500   -0.0092250   -0.0222500   -0.0054370   -0.0017870   -0.0117000   # Z=78  tblite spin.f90 line 117
Au  -0.0129000   -0.0089380   -0.0257625   -0.0052500   -0.0015000   -0.0117750   # Z=79  tblite spin.f90 line 118
Hg  -0.0129250   -0.0091870   -0.0292750    0.0000000    0.0000000    0.0000000   # Z=80  tblite spin.f90 line 119
Tl  -0.0133500   -0.0091120   -0.0107250    0.0000000    0.0000000    0.0000000   # Z=81  tblite spin.f90 line 120
Pb  -0.0135750   -0.0094250   -0.0110000    0.0000000    0.0000000    0.0000000   # Z=82  tblite spin.f90 line 121
Bi  -0.0136750   -0.0095380   -0.0109500    0.0000000    0.0000000    0.0000000   # Z=83  tblite spin.f90 line 122
Po  -0.0137500   -0.0096380   -0.0108500    0.0000000    0.0000000    0.0000000   # Z=84  tblite spin.f90 line 123
At  -0.0137750   -0.0096750   -0.0107250   -0.0026000   -0.0073630   -0.0119000   # Z=85  tblite spin.f90 line 124
Rn  -0.0139000   -0.0097380   -0.0106500   -0.0028750   -0.0078120   -0.0130000   # Z=86  tblite spin.f90 line 125
