Spin polarized calculation with xTB

328 views
Skip to first unread message

Mauro Sgroi

unread,
Mar 5, 2021, 3:33:18 AM3/5/21
to cp2k
Dear all,
I'm trying to understand if it is possible to use xTB to perform spin polarized calculations.
If yes, which is the right way to proceed?
Is there an howto to follow?

Thannks a lot and best regards,
Mauro Sgroi
Centro Ricerche FIAT
Italy

hut...@chem.uzh.ch

unread,
Mar 5, 2021, 10:42:38 AM3/5/21
to cp...@googlegroups.com
Hi

you can use unrestricted calculations also with xTB. However,
the xTB Hamiltonian doesn't have a spin dependence. So what you
get is the same as using a restricted open shell calculation.
Unrestricted is double the work, but can use OT methods.
Restricted open shell (ROKS will not work btw) will need
diagonalization and smearing. What is more efficient in the end
might depend on your system.

best regards

Juerg Hutter
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Mauro Sgroi"
Sent by: cp...@googlegroups.com
Date: 03/05/2021 09:33AM
Subject: [CP2K:14881] Spin polarized calculation with xTB
--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/f6049f47-2a0d-4d21-bdd7-8a1fa320dfb3n%40googlegroups.com.

Mauro Sgroi

unread,
Mar 5, 2021, 11:10:43 AM3/5/21
to cp...@googlegroups.com
Dear Prof. Hutter,
thanks a lot for the clarification.
Best regards,
Mauro Sgroi.


You received this message because you are subscribed to a topic in the Google Groups "cp2k" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cp2k/yQtcVS59jEk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/OFDF4C8D2B.FF7BE2D3-ONC125868F.0056498D-C125868F.0056498E%40lotus.uzh.ch.

Pierre-André Cazade

unread,
Mar 5, 2021, 11:16:39 AM3/5/21
to cp...@googlegroups.com
Dear Juerg,

It's a very interesting topic. Provided what you described in your reply, is it possible to use xTB for a triplet state? If yes, is it necessary to use UKS, since the Hamiltonian doesn't have spin-dependence?

Regards,
Pierre

hut...@chem.uzh.ch

unread,
Mar 5, 2021, 1:09:23 PM3/5/21
to cp...@googlegroups.com
Hi

you can calculate a triplet using UKS. For xTB the results should
show equal orbital energies for alpha and beta spin, even though
the occupations will be different.

regards

Juerg
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: cp...@googlegroups.com
From: "Pierre-André Cazade"
Sent by: cp...@googlegroups.com
Date: 03/05/2021 05:16PM
Subject: Re: [CP2K:14885] Spin polarized calculation with xTB
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/CAFnf9gqvD3jnN_wRAgbYZGaN%2BC1%2BGANJHs8-Nqf-ruYMGjKHHQ%40mail.gmail.com.

Dmitry Ryndyk

unread,
Jun 8, 2026, 9:36:11 AM (yesterday) Jun 8
to cp2k
Dear all,

What is going on at present?

The xTB site states that spin-polarized calculations with tblite are possible, and spin-dependent Hamiltonians are described in the 2023 paper.

Moreover, at the CP2K site, it is written:
Spin-polarized CP2K/tblite calculations are selected with the regular DFT/UKS keyword or its LSD/SPIN_POLARIZED aliases; DFT/MULTIPLICITY sets the number of unpaired electrons. UKS uses tblite’s spin-polarized Hamiltonian.

At the moment, however, it seems to be blocked. One always gets restricted orbitals.
Any ideas?

Best wishes,
Dmitry

Jürg Hutter

unread,
Jun 8, 2026, 10:12:08 AM (yesterday) Jun 8
to cp...@googlegroups.com
Hi

This extension is not included in the CP2K native gfn0/1 xTB Hamiltonians.

I don't know if it is available through tblite, but most likely it has to be triggered by a
keyword and defaults to the original spinless Hamiltonian.
Probably this keyword is not yet accessible through the CP2K input?

best regards
JH

________________________________________
From: cp...@googlegroups.com <cp...@googlegroups.com> on behalf of Dmitry Ryndyk <dmitry...@tu-dresden.de>
Sent: Monday, June 8, 2026 3:36 PM
To: cp2k
Subject: Re: [CP2K:22267] Spin polarized calculation with xTB

Dear all,

What is going on at present?

The xTB site<https://xtb-docs.readthedocs.io/en/latest/spgfn.html#spgfnn-xtb> states that spin-polarized calculations with tblite are possible, and spin-dependent Hamiltonians are described in the 2023 paper<https://onlinelibrary.wiley.com/doi/10.1002/jcc.27185>.

Moreover, at the CP2K site<https://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS/XTB/TBLITE.html>, it is written:
Spin-polarized CP2K/tblite calculations are selected with the regular DFT/UKS keyword or its LSD/SPIN_POLARIZED aliases; DFT/MULTIPLICITY sets the number of unpaired electrons. UKS uses tblite’s spin-polarized Hamiltonian.

At the moment, however, it seems to be blocked. One always gets restricted orbitals.
Any ideas?

Best wishes,
Dmitry

hut...@chem.uzh.ch schrieb am Freitag, 5. März 2021 um 19:09:23 UTC+1:
Hi

you can calculate a triplet using UKS. For xTB the results should
show equal orbital energies for alpha and beta spin, even though
the occupations will be different.

regards

Juerg
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491<tel:+41%2044%20635%2044%2091>
Institut für Chemie C FAX : ++41 44 635 6838<tel:+41%2044%20635%2068%2038>
Juerg Hutter Phone : ++41 44 635 4491<tel:+41%2044%20635%2044%2091>
Institut für Chemie C FAX : ++41 44 635 6838<tel:+41%2044%20635%2068%2038>
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com<mailto:cp2k+uns...@googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/05c0af2b-f6cb-4bdb-817c-521bcf5acfb9n%40googlegroups.com<https://groups.google.com/d/msgid/cp2k/05c0af2b-f6cb-4bdb-817c-521bcf5acfb9n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Michael LaCount

unread,
Jun 8, 2026, 4:36:23 PM (yesterday) Jun 8
to cp2k
I looked into this earlier this year.

Tblite does seem to support the spin polarized version (spGFNn) see https://onlinelibrary.wiley.com/doi/pdfdirect/10.1002/jcc.27185 "All (sp)GFNn-xTB calculations were performed with the tblite v. 0.3.0 development version either as a standalone or in the xtb v. 6.5.1 development version." A bit ambiguous but it seems to me to read like tblite supported spGFN-xTB.

But I'll note that I found using LSD with TBLITE GFN1 doesn't work properly (at least in v2026.1) (see https://github.com/cp2k/cp2k/issues/4818 and https://github.com/cp2k/cp2k/pull/4804). Also TBLITE with GFN2 has (or at least had) some odd behavior assigning electrons for nitrogen.

In short, at least as of CP2K 2026.1 there is no way (to my knowledge) to get a proper spGFNn calculation done with CP2K. The best you can do is triplet GFN0/1 using the internal CP2K implementation of XTB.

Best,
Michael

Thomas Kühne

unread,
Jun 8, 2026, 6:30:36 PM (yesterday) Jun 8
to cp...@googlegroups.com
Hi everybody, 

there have been some recent new developments. In conjunction with tblite 0.6.0 
CP2K now supports GFN2 for periodic systems incl. k-points and via analytic 
gradients and stress tensor for RKS and UKS. Have a look at the recent preprint,  
for representative sample inputs. 

Greetings, 
Thomas

Dmitry Ryndyk

unread,
1:23 AM (18 hours ago) 1:23 AM
to cp2k
Dear Jürg, Michael, Thomas,
Thank you for the answers. I use the master git branch, and the UKS tblite simply doesn't work as UKS. I hope to get a reply from someone who cares about tblite integration into CP2K just now.

But meanwhile, I do not understand the internal spin-dependent now. Please have a look at the attachment. I tried 
Multiplicity=3 and got a strange result. There is no spin difference at the end! 
And it has nothing to do with xTB; the same is for DFT PBE.
Only with OT do I get the expected result.
What do I not understand?

Thank you in advance,
Dmitry
H2SO4_spin.inp
H2SO4_spin_m3.out

Jürg Hutter

unread,
5:21 AM (14 hours ago) 5:21 AM
to cp...@googlegroups.com
Hi
1) The implemented xTB Hamiltonians don't have a spin dependence.
You will always get the same orbital energies for alpha and beta electrons.
2) Occupation of the orbital levels depends on a combination of input parameters.
a) No smearing: Number of alpha and beta electrons is determined from the Multiplicity keyword.
b) With smearing: default is a single Fermi energy and electrons are allowed to move from alpha
to beta. This is default because this is what most people want for DFT Mermin functional calculations.
If you want to keep the number of electrons to be fixed, you need to specify
FIXED_MAGNETIC_MOMENT 2
This together with a FD temperature of 300 is the default in tblite (if I'm correct).

regards
JH

________________________________________
From: cp...@googlegroups.com <cp...@googlegroups.com> on behalf of Dmitry Ryndyk <dmitry...@tu-dresden.de>
Sent: Tuesday, June 9, 2026 7:23 AM
To: cp2k
Subject: Re: [CP2K:22273] Spin polarized calculation with xTB

Dear Jürg, Michael, Thomas,
Thank you for the answers. I use the master git branch, and the UKS tblite simply doesn't work as UKS. I hope to get a reply from someone who cares about tblite integration into CP2K just now.

But meanwhile, I do not understand the internal spin-dependent now. Please have a look at the attachment. I tried
Multiplicity=3 and got a strange result. There is no spin difference at the end!
And it has nothing to do with xTB; the same is for DFT PBE.
Only with OT do I get the expected result.
What do I not understand?

Thank you in advance,
Dmitry

Thomas Kühne schrieb am Dienstag, 9. Juni 2026 um 00:30:36 UTC+2:
Hi everybody,

there have been some recent new developments. In conjunction with tblite 0.6.0
CP2K now supports GFN2 for periodic systems incl. k-points and via analytic
gradients and stress tensor for RKS and UKS. Have a look at the recent preprint,
as well as the recent regtests and https://github.com/DCM-Uni-Paderborn/Periodic-GFN2-Benchmarks
for representative sample inputs.

Greetings,
Thomas

<https://chemrxiv.org/doi/abs/10.26434/chemrxiv.15003939/v1>
chemrxiv.org<https://chemrxiv.org/doi/abs/10.26434/chemrxiv.15003939/v1>
[X]<https://chemrxiv.org/doi/abs/10.26434/chemrxiv.15003939/v1>
Juerg Hutter Phone : ++41 44 635 4491<tel:+41%2044%20635%2044%2091><tel:+41%2044%20635%2044%2091>
Institut für Chemie C FAX : ++41 44 635 6838<tel:+41%2044%20635%2068%2038><tel:+41%2044%20635%2068%2038>
Juerg Hutter Phone : ++41 44 635 4491<tel:+41%2044%20635%2044%2091><tel:+41%2044%20635%2044%2091>
Institut für Chemie C FAX : ++41 44 635 6838<tel:+41%2044%20635%2068%2038><tel:+41%2044%20635%2068%2038>
To view this discussion visit https://groups.google.com/d/msgid/cp2k/25710ec6-ea83-4356-80e3-69a6dfae4d27n%40googlegroups.com<https://groups.google.com/d/msgid/cp2k/25710ec6-ea83-4356-80e3-69a6dfae4d27n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com<mailto:cp2k+uns...@googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/bb989d03-22dd-4a73-9264-1a24d83d98a3n%40googlegroups.com<https://groups.google.com/d/msgid/cp2k/bb989d03-22dd-4a73-9264-1a24d83d98a3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Dmitry Ryndyk

unread,
5:36 AM (14 hours ago) 5:36 AM
to cp2k
Oh!
Thank you!
I forgot to use FIXED_MAGNETIC_MOMENT with SMEAR.

Best wishes,
Dmitry

Dmitry Ryndyk

unread,
7:47 AM (12 hours ago) 7:47 AM
to cp2k
I made new tests, sorry for any misunderstanding. I used smearing incorrectly. 
As I see now, tblite works with UKS and gives some results that look reasonable.

Thank you for your comments,
Dmitry

Thomas Kühne

unread,
7:52 AM (12 hours ago) 7:52 AM
to cp...@googlegroups.com
Thanks for the info! I was already wondering how we could have messed up so badly ;)

Greetings, 
Thomas

Reply all
Reply to author
Forward
0 new messages