<pre>Hi Paolo, <br><br><br><br>>><i> the restriction is in this code<br></i>>><i>          if ( ((MOD(NINT(tot_magnetization_),2) == 0) .and. (MOD <br></i>>><i> (NINT(nelec_),2)==1)) .or.   &<br></i>>><i>               ((MOD(NINT(tot_magnetization_),2) == 1) .and. (MOD <br>
</i>>><i> (NINT(nelec_),2)==0))      ) &<br></i>>><i>               CALL errore(' set_nelup_neldw  <br></i>>><i> ',                          &<br></i>>><i>              'tot_magnetization is inconsistent with total number  <br>
</i>>><i> of electrons ', 2 )<br></i><br>>in the new version, this restriction (now a warning, no longer an  <br>>error) applies only if the<br>>number of electrons is integer and if the magnetization is integer.  <br>
>For noninteger charge<br>>or magnetization, it doesn't make sense.<br></pre><pre><br>In fact, increasing the k-point sampling, the unrestricted calculation converges towards <br>0 total magnetization, with a lower energy than magnetization =1, but <br>
setting tot_magnetization=0, or 0.1, 0.2, etc, stops due to the above instruction in versiom 4.2.1. <br>This is one more reason to change to the newest version. <br><br><br><b>You stated something in a previous post</b><a href="mailto:pw_forum%40pwscf.org?Subject=%5BPw_forum%5D%20why%20are%20there%20two%20Fermi%20energies%3F&In-Reply-To=0CD095EE-2EC8-4E33-9F7F-334812E8089C%40sissa.it" title="[Pw_forum] why are there two Fermi energies?" target="_blank"></a><br>
>The "two Fermi energies" of the constrained <br>>case need not to be exactly the same as the (single)<br>>Fermi energy of the unconstrained case, as long as the<br>>occupancies for spin-up and spin-down are the same in the <br>
>two cases.<br><br><font style="font-family: arial,helvetica,sans-serif;" size="2">Why not? Aren't the the energies and occupations related by <br>the Fermi-Dirac function? I verified that the occupations are the same, then I do not understand <br>
why it is possible with different Fermi energies. <br></font><font style="font-family: arial,helvetica,sans-serif;" size="2">These are my KS energies and the occupations, using degauss=0.00019. I think the differences are just numerical noise. <br>
<br>1)  tot_magnetization unset<br>     the Fermi energy is     6.1614 ev<br>!    total energy              =    -502.92571441 Ry     total magnetization       =     1.00 Bohr mag/cell<br>up: 4.8593   4.8594   5.2221   5.2221   5.2222   6.1335   6.1336   6.1338<br>
<br><br>      1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000<br><br>dw: 4.8796   4.8796   5.2528   5.2530   5.2531   6.1595   6.1596   6.1596<br>      1.0000   1.0000   1.0000   1.0000   1.0000   0.6709   0.6661   0.6631<br>
<br>2) tot_magnetization=1<br>     the spin up/dw Fermi energies are     6.3853    6.1614 ev<br>!    total energy              =    -502.92571439 Ry     total magnetization       =     1.00 Bohr mag/cell<br>up: 4.8593   4.8594   5.2221   5.2221   5.2221   6.1335   6.1337   6.1338<br>
<br><br>      1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000   1.0000<br><br>dw: 4.8796   4.8796   5.2528   5.2530   5.2531   6.1595   6.1596   6.1596<br>      1.0000   1.0000   1.0000   1.0000   1.0000   0.6715   0.6660   0.6625</font><br>
<br><font style="font-family: arial,helvetica,sans-serif;" size="2">Finally, I plotted Energy vs magnetization. Indeed, I have a minimum at total magnetization equal 1. However, the <br>behavior is strange. The plot of E vs M is linear at each side of the <br>
minimum, with a kink at M=1. Should'n it be rather like a parable ? <br>Please, see the plots here<br><br><a href="http://www.gnm.cl/emenendez/pmwiki.php/Temp/Plots?action=upload&upname=impurity-energy.eps" target="_blank">http://www.gnm.cl/emenendez/pmwiki.php/Temp/Plots?action=upload&upname=impurity-energy.eps</a><br>
<br><a href="http://www.gnm.cl/emenendez/pmwiki.php/Temp/Plots?action=upload&upname=impurity-fermi.eps" target="_blank">http://www.gnm.cl/emenendez/pmwiki.php/Temp/Plots?action=upload&upname=impurity-fermi.eps</a><br>
</font><br><font style="font-family: arial,helvetica,sans-serif;" size="2"><br>This was using gamma point fo sample the Brillouin zone. That is not converged, using a 3x3x3 grid the lowest energy seems to be <br>for null magnetization (I am doing more calculations). Maybe the kinks are due to insufficient Brillouin zone sampling. </font><br>
<br><br><br>Best regards<br><br></pre><br>-- <br><div><br></div>
<div><br></div>Eduardo Menendez<br>Departamento de Fisica<br>Facultad de Ciencias<br>Universidad de Chile<br>Phone: (56)(2)9787439<br>URL: <a href="http://fisica.ciencias.uchile.cl/%7Eemenendez" target="_blank">http://fisica.ciencias.uchile.cl/~emenendez</a><br>