Spin Polaization in Kohn-Sham calculations

1,402 views
Skip to first unread message

Ronald Cohen

unread,
Sep 11, 2019, 11:37:40 AM9/11/19
to cp2k
I do not understand the way CP2K does spin-polarized Kohn-Sham. What ought to be done in a crystal
is to have spin up and down channels (called alpha and beta in cp2k), solve them in their separate LSDA (or GGA) potentials for each k-point,
find a common Fermi level by integrating the charge to the correct number of electrons, compute the new charge and spin densities,
compute the new spin dependent potential, and iterate. In an insulator one should obtain an integer integrated spin, since each spin polarized band holds 1
electron. However, in cp2k for insulating O2 (in a cage) , for example, I find a converged integrated spin density of

  Integrated absolute spin density  :                               2.0381878543

instead of 2.


In cp2k, one enters a MULTIPLICITY and RELAX_MULTIPLICITY, and I find disconcerting messages like:

Spin 1

 Re-scaling the density matrix to get the right number of electrons for spin 1
                  # Electrons              Trace(P)               Scaling factor
                           39                40.000                        0.975

 Spin 2
 Re-scaling the density matrix to get the right number of electrons for spin 2
                  # Electrons              Trace(P)               Scaling factor
                           37                36.000                        1.028

There should be nothing like this.

If I do not enter the MULTIPLICITY key word I do not see this message,
but instead see:

Multiplicity                                                             1

and the resulting integrated spin is similar but not identical:

  Integrated absolute spin density  :                               2.0411999533

Any clarification would be greatly appreciated. I cannot find an explanation in the docs.

Sincerely,

Ron

Vladimir Rybkin

unread,
Sep 12, 2019, 6:45:40 AM9/12/19
to cp2k
Dear Ron,

regarding the first point. CP2K does spin polarization in molecular quantum chemistry style: either with spin-unrestricted KS (UKS, or LSD) or with restricted open-shell (ROKS). The first option assumes different (spatial) orbitals for different spins: orbitals for alpha- and beta-channels are found independently and are in general different. That's why Sz and S^2 are no more good quantum numbers. Integrated absolute spin density is non-integer. In the ROKS scheme, spatial orbitals are fixed the same so that the spin symmetry does not break, but some variational flexibility is lost. 

The RELAX_MULTIPLICITY  keyword means, that CP2K should find the electronic state according to the aufbau principle. It does exactly this. The MULTIPLICITY 1 message is perhaps a "bug" of the output. It prints the default multiplicity (1) rather than the one that it will going to find according to aufbau.

Yours,

Vladimir


среда, 11 сентября 2019 г., 17:37:40 UTC+2 пользователь Ronald Cohen написал:

Ron Cohen

unread,
Sep 12, 2019, 7:04:56 AM9/12/19
to cp...@googlegroups.com
Yes, but unfortunately it seems the results are wrong. The spin-polarized kohn-sham equations are not solved using UKS and RELAX_MULTIPLICITY. For an insulator the integrated spin must be an integer, but it is not in cp2k. The results obtained with quantum espresso for the same system are as expected. It is an insulator with integrated spin exactly 2.0, but cp2k gives 2.04. If the ks equations are not being solved, it is not a dft calculation, and the solution is not the minimum energy solution. 

Sent from my iPhone
--
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/dFUIwOAfmWM/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/eefa165c-5471-4186-b935-4e8df89e755b%40googlegroups.com.

Ronald Cohen

unread,
Sep 12, 2019, 7:12:02 AM9/12/19
to cp...@googlegroups.com
I do not understand how you get a non-integer spin if you fill states one electron at a time for up and down states. Perhaps I do not understand ‘Integrated absolute spin density is non-integer.’ Thank you,

Ron

Sent from my iPhone

> On Sep 12, 2019, at 06:45, Vladimir Rybkin <rybk...@gmail.com> wrote:
>

hut...@chem.uzh.ch

unread,
Sep 12, 2019, 7:15:37 AM9/12/19
to cp...@googlegroups.com
Hi

as Vladimir wrote, the value printed is the integrated ABSOLUTE
spin value. The integrated spin value is integer and given by
construction. The printed absolute value gives additional information
on localization of the different spins.

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: cp...@googlegroups.com
From: "Ronald Cohen"
Sent by: cp...@googlegroups.com
Date: 09/12/2019 01:12PM
Subject: Re: [CP2K:12210] Re: Spin Polaization in Kohn-Sham calculations
--
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/836B5B54-F287-4500-BF4B-B1B93249CFC9%40carnegiescience.edu.

Ronald Cohen

unread,
Sep 12, 2019, 7:22:10 AM9/12/19
to cp...@googlegroups.com
Oh I understand. Of course that need not be integer. So the printed multiplicity when relax multiplicity is on is incorrect. What about the number of electrons? It prints a renormalization when Multiplicity =3 and also shows the same number of up anddien when multiplicity =1 even with relax multiplicity on. I can send that output if you like. Thank you! Ron
> 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/dFUIwOAfmWM/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/OF8C565986.64274F05-ONC1258473.003DD972-C1258473.003DD974%40lotus.uzh.ch.

hut...@chem.uzh.ch

unread,
Sep 12, 2019, 7:29:10 AM9/12/19
to cp...@googlegroups.com
Hi

the renormalization is just information from the initial guess.
The superposition of atomic densities can result in initial
densities that are not representing the requested spin state.
A rescaling is used to fix that. As you can see in the output, all
of this happens before KS interations start.

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: cp...@googlegroups.com
From: "Ronald Cohen"
Sent by: cp...@googlegroups.com
Date: 09/12/2019 01:22PM
Subject: Re: [CP2K:12212] Re: Spin Polaization in Kohn-Sham calculations
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/C374FD68-AF16-4372-A542-E2AD68CE38C3%40carnegiescience.edu.

Ronald Cohen

unread,
Sep 12, 2019, 8:21:19 AM9/12/19
to cp...@googlegroups.com
Dear Juerg,

Thank you so much. Here is what I get using the latest version on github:

When I have in the input:
     UKS  T
#     MULTIPLICITY  3
     RELAX_MULTIPLICITY 3


&KIND O2
       BASIS_SET DZVP-MOLOPT-GTH-q6
       ELEMENT O
       POTENTIAL GTH-PBE-q6
       &POTENTIAL
2 4
0.2445543000000000E+00 2 -0.1666721480000000E+02  0.2487311320000000E+01
2
0.2209559200000000E+00 1  0.1833745811000000E+02
0.2113324700000000E+00 0
       &END POTENTIAL
       MAGNETIZATION 2
     &END KIND



The output shows:

DFT| Multiplicity                                                             1
DFT| Number of spin states                                                    2

 Spin 1

 Number of electrons:                                                         38
 Number of occupied orbitals:                                                 38
 Number of molecular orbitals:                                                40

 Spin 2

 Number of electrons:                                                         38
 Number of occupied orbitals:                                                 38
 Number of molecular orbitals:                                                40

 Number of orbital functions:                                                210
 Number of independent orbital functions:                                    210


and this number of electrons is repeated, even though there is a moment:

 grep -B 3 "Number of electrons:" Opt.out
 Spin 1

 Number of electrons:                                                         38
--

 Spin 2

 Number of electrons:                                                         38
--

 Spin 1

 Number of electrons:                                                         38
--

 Spin 2

 Number of electrons:                                                         38
--

 Spin 1

 Number of electrons:                                                         38
--

 Spin 2

 Number of electrons:                                                         38
--

 …

When I have this in the input:


     UKS  T
     MULTIPLICITY  3
     RELAX_MULTIPLICITY 3

I see:

DFT| Multiplicity                                                             3
 DFT| Number of spin states                                                    2

and

grep -B 1 -A 2 "Re-scal" Opt.out.1
 Spin 1
 Re-scaling the density matrix to get the right number of electrons for spin 1
                  # Electrons              Trace(P)               Scaling factor
                           39                40.000                        0.975
--
 Spin 2
 Re-scaling the density matrix to get the right number of electrons for spin 2
                  # Electrons              Trace(P)               Scaling factor
                           37                36.000                        1.028
--
 Spin 1
 Re-scaling the density matrix to get the right number of electrons for spin 1
                  # Electrons              Trace(P)               Scaling factor
                           39                40.000                        0.975
--
 Spin 2
 Re-scaling the density matrix to get the right number of electrons for spin 2
                  # Electrons              Trace(P)               Scaling factor
                           37                36.000                        1.028
--
 Spin 1
 Re-scaling the density matrix to get the right number of electrons for spin 1
                  # Electrons              Trace(P)               Scaling factor
                           39                40.000                        0.975
--
 Spin 2
 Re-scaling the density matrix to get the right number of electrons for spin 2
                  # Electrons              Trace(P)               Scaling factor
                           37                36.000                        1.028
--
 Spin 1
 Re-scaling the density matrix to get the right number of electrons for spin 1
                  # Electrons              Trace(P)               Scaling factor
                           39                40.000                        0.975
--
 Spin 2
 Re-scaling the density matrix to get the right number of electrons for spin 2
                  # Electrons              Trace(P)               Scaling factor
                           37                36.000                        1.028
--
 Spin 1
 Re-scaling the density matrix to get the right number of electrons for spin 1
                  # Electrons              Trace(P)               Scaling factor
                           39                40.000                        0.975
--
 Spin 2
 Re-scaling the density matrix to get the right number of electrons for spin 2
                  # Electrons              Trace(P)               Scaling factor
                           37                36.000                        1.028
--
 Spin 1
 Re-scaling the density matrix to get the right number of electrons for spin 1
                  # Electrons              Trace(P)               Scaling factor
                           39                40.000                        0.975

So it seems it is rescaling over and over? Or is there just a problem with the printout? 
Thank you again,

Ron


---
Ronald Cohen
Extreme Materials Initiative
Geophysical Laboratory
Carnegie Institution
5251 Broad Branch Rd., N.W.
Washington, D.C. 20015
rco...@carnegiescience.edu
office: 202-478-8937
skype: ronaldcohen
twitter: @recohen3

signature.asc

Krack Matthias (PSI)

unread,
Sep 12, 2019, 9:01:46 AM9/12/19
to cp...@googlegroups.com

Dear Ron

 

Please, could you provide the full input file for testing. A value of 3 Hartree for RELAX_MULTIPLICITY is most likely inappropriate. The argument of that keyword is not the (preferred) multiplicity but an energy tolerance allowing for a spin flip between alpha and beta electrons. The assumed multiplicity should still be given via the MULTIPLICITY keyword. In the case of O2 starting with an initial (guessed) multiplicity of 1, the spin flip should happen already in the first SCF iteration step and it should not change thereafter.

 

You should check the output line starting with “Ideal and single determinant S**2” for the final multiplicity. I get for a gas phase O2 molecule starting with

MULTPLICITY 1

RELAX_MULTIPLICTY 0.01

something like:

Ideal and single determinant S**2 :                    2.000000       2.000784

which looks reasonable to me.

 

HTH

 

Matthias

Ronald Cohen

unread,
Sep 12, 2019, 9:21:43 AM9/12/19
to cp...@googlegroups.com
Dear Matthias,

Thank you so much! The input is attached. I did not understand the documentation clearly! It says:

RELAX_MULTIPLICITY {Real}
Do not enforce the occupation of alpha and beta MOs due to the initially defined multiplicity, but rather follow an Aufbau principle. A threshold value greater than zero activates this option. Larger threshold values increase the probability for a spin flip. This option is only valid for unrestricted (i.e. spin polarised) Kohn-Sham (UKS) calculations.

I originally had .5 and then 3, thinking this was a range in allowed multiplicity.

I never saw the line Ideal and single determinant S**2 because I did not allow the jobs to finish, and it seems it is not printed earlier!

Thank you again,

Ron
subsysunitcell.inc
Opt.inp
signature.asc

Krack Matthias (PSI)

unread,
Sep 12, 2019, 10:12:46 AM9/12/19
to cp...@googlegroups.com

Dear Ron

 

You are welcome to improve the keyword description via the "Edit on Github" link.

 

Your system is a bit more advanced than a simple gas phase O2 molecule. Moreover, you use k points with Broyden mixing and Fermi smearing and thus you won’t see the printout “Ideal and single determinant S**2” as indicated by the warning:

 

*** WARNING in qs_scf_post_gpw.F:1717 :: Spin contamination estimate not ***

*** implemented for k-points

 

Alternatively, you may check the final line of the Mulliken population analysis

 

# Orbital  AO symbol  Orbital population (alpha,beta)  Net charge  Spin moment

. . .

# Total charge and spin       39.000000    37.000000    -0.000000     2.000000

 

Best

 

Matthias

 

From: cp...@googlegroups.com <cp...@googlegroups.com> On Behalf Of Ronald Cohen


Sent: Donnerstag, 12. September 2019 15:22
To: cp...@googlegroups.com

--

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.

Ronald Cohen

unread,
Sep 12, 2019, 10:15:40 AM9/12/19
to cp...@googlegroups.com
Yes, I see. I will be glad to contribute. I see also you should delete the line
       SYMMETRY ORTHORHOMBIC
from our *.inc file.

Ron

---
Ron Cohen
reco...@gmail.com
skypename: ronaldcohen
twitter: @recohen3




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/dFUIwOAfmWM/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/FCDF8CAC6EF2504E85F16873A7DF161A4EAA15E0%40MBX214.d.ethz.ch.

signature.asc
Reply all
Reply to author
Forward
0 new messages