This thread is locked.Only browsing is available.
Top Page > Browsing
SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt
Date: 2019/03/24 20:44
Name: J. Chapman   <jacob.chapman@ukaea.uk>

Dear OpenMX community,

I have found that I get an error in the saved Hamiltonian within the .scfout file (HS.fileout ON) when using the md.type opt.

If I use an input file and do a full geometry optimisation (eg using RF), then the Hamiltonian in the .scfout file is correct. However, if I then take the optimised structure and create a new input file, use md.type opt to self consistently solve the density for the already relaxed structure, the Hamiltonian in the .scfout file is wrong. In particular, I find the spin up and spin down components are equivalent - This is not true for this system nor compared to the reported Hamiltonian for the fully relaxed case. Could you advise on how to correct this? I have so far had no luck trying to debug this myself.

Thank you in advance for reading.

Kind regards,

Jacob Chapman
メンテ
Page: [1]

Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.1 )
Date: 2019/03/25 00:26
Name: Naoya Yamaguchi

Hi,

I have some questions:
1. How did you judge that the SCFOUT file was wrong?
2. You perhaps compared SCFOUT files made from two input files. Are the input files same except the structural information?

And, SCFOUT files are made by a source file "SCF2File.c" which is called by a source file "openmx.c", and you can check writing SCFOUT files through "SCF2File.c". If possible, could you provide more detailed information including your input files?

Regards,
Naoya Yamaguchi
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.2 )
Date: 2019/03/26 20:12
Name: J. Chapman  <jacob.chapman@ukaea.uk>

Hi Naoya,
Thank you for your fast response.
In my case I am using scf.spinpolarization=1 to perform collinear calculations. During the scf optimisation, the DFT routing correctly determines a net magnetisation which I expect from my system. Below is the last stdout md print from the scf optimisation:

******************* MD= 1 SCF=86 *******************
<Poisson> Poisson's equation using FFT...
<Set_Hamiltonian> Hamiltonian matrix for VNA+dVH+Vxc...
<Band> Solving the eigenvalue problem...
KGrids1: -0.33333 0.00000 0.33333
KGrids2: -0.33333 -0.00000 0.33333
KGrids3: -0.33333 0.00000 0.33334
<Band_DFT> Eigen, time=19.209433
<Band_DFT> DM, time=0.000000
1 Fe MulP 7.9226 6.1030 sum 14.0256 diff 1.8196
2 Fe MulP 6.9774 7.0337 sum 14.0111 diff -0.0563
3 Fe MulP 6.9769 7.0341 sum 14.0110 diff -0.0572
4 Fe MulP 7.9219 6.1037 sum 14.0256 diff 1.8183
5 Fe MulP 8.2216 5.7587 sum 13.9803 diff 2.4629
6 Fe MulP 8.1653 5.8349 sum 14.0002 diff 2.3304
7 Fe MulP 8.1388 5.8644 sum 14.0032 diff 2.2745
8 Fe MulP 8.1656 5.8347 sum 14.0002 diff 2.3309
9 Fe MulP 8.2220 5.7583 sum 13.9803 diff 2.4637
10 Fe MulP 8.1968 5.7928 sum 13.9896 diff 2.4040
11 Fe MulP 8.2148 5.7603 sum 13.9752 diff 2.4545
12 Fe MulP 8.1967 5.7928 sum 13.9895 diff 2.4040
13 Fe MulP 8.1188 5.8788 sum 13.9976 diff 2.2401
14 Fe MulP 8.1575 5.8387 sum 13.9962 diff 2.3189
15 Fe MulP 8.1340 5.8687 sum 14.0027 diff 2.2654
16 Fe MulP 8.1583 5.8378 sum 13.9961 diff 2.3206
17 Fe MulP 8.1188 5.8787 sum 13.9976 diff 2.2401
18 Fe MulP 8.1537 5.8447 sum 13.9984 diff 2.3090
19 Fe MulP 8.1540 5.8547 sum 14.0087 diff 2.2993
20 Fe MulP 8.1544 5.8437 sum 13.9981 diff 2.3107
..........
......

Sum of MulP: up = 1046.21599 down = 759.78401
total= 1806.00000 ideal(neutral)= 1806.00000
<DFT> Total Spin Moment (muB) = 286.431971261505
<DFT> Mixing_weight= 0.015000000000
<DFT> Uele =-1957.385711380093 dUele = 0.000000074623
<DFT> NormRD = 0.000090533154 Criterion = 0.000001000000

This is in agreement with what is written to the .md file. However, in the .scfout file, when I recover the Hamiltonian I find that for all sites, the spin up and spin down components are identical. Below I print the first line of the first Hamiltonian block as grabbed using analysis_example.c for the spin =0 and spin=1 case:

Kohn-Sham Hamiltonian spin=0
glbal index=1 local index=0 (grobal=1, Rn=0)
-0.3777485 0.0908518 0.0267714 -0.0000352 -0.0001626 -0.0002356 -0.0009903 0.0006780 0.0013936 0.0018139 0.0018827 0.0020976 -0.0026710 0.0011968 -0.0019978 -0.0028279 -0.0041779 -0.0091562 0.0040632 -0.0070994 -0.0100713 -0.0142999 -0.0022144 0.0012461 0.0006929 0.0002870 -0.0001216


Kohn-Sham Hamiltonian spin=1
glbal index=1 local index=0 (grobal=1, Rn=0)
-0.3777485 0.0908518 0.0267714 -0.0000352 -0.0001626 -0.0002356 -0.0009903 0.0006780 0.0013936 0.0018139 0.0018827 0.0020976 -0.0026710 0.0011968 -0.0019978 -0.0028279 -0.0041779 -0.0091562 0.0040632 -0.0070994 -0.0100713 -0.0142999 -0.0022144 0.0012461 0.0006929 0.0002870 -0.0001216

This is true for all sites. I find that when I do md.type != nomd I get the correct (expected) output (ie H_{up} != H_{down}). However, I cannot always do this. Below I provide an example input file I used to get the .scfout file I have printed above:

#
# File Name
#
System.CurrrentDirectory ./ # default=./
System.Name rerun_final_scf
level.of.stdout 1
level.of.fileout 2 # default=1 (0-2)
DATA.PATH /home/jchapman/Src/openmx_3.8.5/DFT_DATA13
#
# Definition of Atomic Species
#
Species.Number 1
<Definition.of.Atomic.Species
Fe Fe6.0S-s3p3d3 Fe_PBE13S
Definition.of.Atomic.Species>
#
# SCF or Electronic System
#
scf.XcType GGA-PBE # LDA|LSDA-CA|LSDA-PW|GGA-PBE
scf.SpinPolarization On # On|Off|NC
scf.ElectronicTemperature 600.0 # default=300 (K)
scf.energycutoff 600.0 # default=150 (Ry)
scf.maxIter 300 # default=40
scf.EigenvalueSolver Band # DC|GDC|Cluster|Band
scf.Kgrid 3 3 3 # means n1 x n2 x n3
scf.Mixing.Type Rmm-Diisk # Simple|Rmm-Diis|Gr-Pulay|Kerker|Rmm-Diisk
scf.Init.Mixing.Weight 0.01 # default=0.30
scf.Min.Mixing.Weight 0.001 # default=0.001
scf.Max.Mixing.Weight 0.15 # default=0.40
scf.Mixing.History 50 # default=5
scf.Mixing.StartPulay 15 # default=6
scf.criterion 1.0e-6 # default=1.0e-6 (Hartree)
scf.SpinOrbit.Coupling Off
scf.fixed.grid 0.00000000000000000000e+00 0.00000000000000000000e+00 0.00000000000000000000e+00
scf.stress.tensor on # on|off, default=off
scf.Kerker.factor 3.011121
#
# MD or Geometry Optimization
#
MD.Type Nomd # Nomd|Opt|DIIS|NVE|NVT_VS|NVT_NH|RFC5
MD.Opt.DIIS.History 7 # default=7
MD.Opt.StartDIIS 5 # default=5
MD.maxIter 300 # default=1
MD.TimeStep 0.5 # default=0.5 (fs)
MD.Opt.criterion 1.0e-4 # default=1.0e-4 (Hartree/bohr)
MD.Opt.Init.Hessian Schlegel # default=schlegel
Energy.Decomposition on
Atoms.UnitVectors.Unit AU
<Atoms.UnitVectors
2.14893214352834007741e+01 0.00000000000000000000e+00 0.00000000000000000000e+00
0.00000000000000000000e+00 2.14893214352834007741e+01 0.00000000000000000000e+00
0.00000000000000000000e+00 0.00000000000000000000e+00 2.14893214352834007741e+01
Atoms.UnitVectors>
Atoms.Number 129
Atoms.SpeciesAndCoordinates.Unit AU
<Atoms.SpeciesAndCoordinates
1 Fe -2.71994295062179980427e-01 -2.64676834502280022843e-01 -4.06137012416189990827e-01 8.00 6.00
2 Fe 1.03958797427328009100e+00 1.89257560658296997147e+00 2.68515726209940019942e+00 8.00 6.00
3 Fe 4.30734332677793041455e+00 3.48698931874116002660e+00 2.68129437277401994066e+00 8.00 6.00
4 Fe -2.71467316968030003554e-01 -2.65499593301390002242e-01 5.77490174203702011368e+00 8.00 6.00
5 Fe 2.67400626132709984262e+00 2.68976643647763991041e+00 7.99388451630944008031e+00 8.00 6.00
6 Fe -2.31239977648700009705e-02 -3.95725307724999978559e-03 1.07744410857229091505e+01 8.00 6.00
7 Fe 2.67385964540343001872e+00 2.68944219034003983992e+00 1.34280999494275707917e+01 8.00 6.00
8 Fe -2.25883032349500009750e-02 -3.32553740767999993916e-03 1.60824422137023894663e+01 8.00 6.00
9 Fe 2.67419335969991012192e+00 2.69016092635930981203e+00 1.88632465685404788758e+01 8.00 6.00
10 Fe -1.02693948279740002172e-01 5.41703702852028978754e+00 -2.44709313664299987767e-02 8.00 6.00
11 Fe 2.71110245893448009724e+00 8.03440830241832060210e+00 2.68303500770531000441e+00 8.00 6.00
12 Fe -1.03121666510780002346e-01 5.41743056430679015278e+00 5.39103092650257043061e+00 8.00 6.00
13 Fe 2.65302900172636979548e+00 8.10882068355716079111e+00 8.10519081896632975770e+00 8.00 6.00
14 Fe -1.10483198568199995210e-02 5.36652405832554979526e+00 1.07400401211091907072e+01 8.00 6.00
15 Fe 2.66915860445788011290e+00 8.06779079963762946193e+00 1.34266343438659507825e+01 8.00 6.00
16 Fe -1.10220370274099997709e-02 5.36665337703157963034e+00 1.61161253715189509705e+01 8.00 6.00
17 Fe 2.65262956154148987764e+00 8.10850617684132934926e+00 1.87526182053809584716e+01 8.00 6.00
18 Fe -1.06583223980700001615e-02 1.07479863175754903892e+01 4.53853257063000035260e-03 8.00 6.00
19 Fe 2.67396274677544010245e+00 1.34337363149625694803e+01 2.68363567379121015222e+00 8.00 6.00
20 Fe -1.05774187770599995689e-02 1.07482690743656892352e+01 5.36393884072712001654e+00 8.00 6.00
21 Fe 2.67413946644711986167e+00 1.34338772340678893613e+01 8.06060600849371944321e+00 8.00 6.00
22 Fe -1.07725077787099998705e-02 1.07588850793059407351e+01 1.07522200826708491661e+01 8.00 6.00
23 Fe 2.67431460038072987828e+00 1.34340300819080091799e+01 1.34283170963497404671e+01 8.00 6.00
24 Fe -1.05024021457300002075e-02 1.07550866470778601069e+01 1.61017658838195387716e+01 8.00 6.00
25 Fe 2.67407496984808012996e+00 1.34333238609701393074e+01 1.87967115364687984425e+01 8.00 6.00
26 Fe -2.77409448356899998589e-02 1.61046418399232003082e+01 -1.53458861513300001689e-02 8.00 6.00
27 Fe 2.63579315405918013226e+00 1.88337096890836086516e+01 2.68454496689397004161e+00 8.00 6.00
28 Fe -2.81726467229800013603e-02 1.61043439249106405953e+01 5.38387825581806023223e+00 8.00 6.00
29 Fe 2.69406872095732019545e+00 1.87586203867451892791e+01 8.10404417225523943102e+00 8.00 6.00
30 Fe -8.60064844018000075609e-03 1.60958245881521797571e+01 1.07632395829704208268e+01 8.00 6.00
31 Fe 2.67721940261969981734e+00 1.87986582500163095233e+01 1.34286726853258802095e+01 8.00 6.00
32 Fe -8.48936449320999986234e-03 1.60957081093123512971e+01 1.60936063359345489232e+01 8.00 6.00
33 Fe 2.69440448611429017589e+00 1.87590866744704314328e+01 1.87533066572379887305e+01 8.00 6.00
34 Fe 5.44950057090801021076e+00 -3.77469733480199978737e-02 -2.38612078976900010563e-02 8.00 6.00
35 Fe 8.45044569188135952231e+00 2.66861511432160991575e+00 2.68383403052598978888e+00 8.00 6.00
36 Fe 5.44906077334839000770e+00 -3.74729261064999999431e-02 5.39177339779092967831e+00 8.00 6.00
37 Fe 8.11910848188187017627e+00 2.67482053012148979221e+00 8.10431583367300056864e+00 8.00 6.00
38 Fe 5.35643503351328043038e+00 1.03965859091199996217e-02 1.07389464093352895446e+01 8.00 6.00
39 Fe 8.05372505497935087249e+00 2.68172138819195016168e+00 1.34277924024257302449e+01 8.00 6.00
40 Fe 5.35682737393539021298e+00 1.13085200615099992077e-02 1.61167358977807388953e+01 8.00 6.00
41 Fe 8.11852106368688986038e+00 2.67468130150566985037e+00 1.87530517638122091739e+01 8.00 6.00
42 Fe 5.62038749548501037623e+00 5.64527726815594022014e+00 -4.07144676203930022673e-01 8.00 6.00
43 Fe 8.09154262636510068774e+00 8.06120461235219920582e+00 2.68463084573268018218e+00 8.00 6.00
44 Fe 5.61836712209979971533e+00 5.64292024470976016914e+00 5.77396353557207042684e+00 8.00 6.00
45 Fe 8.15412668967188025704e+00 8.18084763781856949549e+00 8.17667567282376062110e+00 8.00 6.00
46 Fe 5.37097146195848029748e+00 5.38221386180434002711e+00 1.07744267140716605269e+01 8.00 6.00
47 Fe 8.05424907684417945575e+00 8.08258754416596048031e+00 1.34274653447115994709e+01 8.00 6.00
48 Fe 5.37084188228346981475e+00 5.38298236817384978536e+00 1.60827648199739208223e+01 8.00 6.00
49 Fe 8.15443046634429080655e+00 8.18212560193068050296e+00 1.86776150278267003557e+01 8.00 6.00
50 Fe 5.37635982764456965555e+00 1.07625836061699295954e+01 -1.48956079800900004217e-02 8.00 6.00
51 Fe 8.05020960814890962354e+00 1.34355604724386701321e+01 2.68375433525803996915e+00 8.00 6.00
52 Fe 5.37551935555195026240e+00 1.07619954250039100430e+01 5.38236558137104026400e+00 8.00 6.00
53 Fe 8.04911204779383027130e+00 1.34461843046904405696e+01 8.07006979165467974724e+00 8.00 6.00
54 Fe 5.35729012656519021363e+00 1.07724890549510696758e+01 1.07616900665660306657e+01 8.00 6.00
55 Fe 8.03707917038220998052e+00 1.34439206826992503352e+01 1.34275209214918707090e+01 8.00 6.00
56 Fe 5.35662333750079966421e+00 1.07712649090531193963e+01 1.60924518905358411303e+01 8.00 6.00
57 Fe 8.04970315700898986222e+00 1.34443189479342795067e+01 1.87849620001266117697e+01 8.00 6.00
58 Fe 5.35833653762835027123e+00 1.61201107895153086247e+01 4.41300663676000032992e-03 8.00 6.00
59 Fe 8.09370946462214035932e+00 1.87841205108176687588e+01 2.68442685184926999042e+00 8.00 6.00
60 Fe 5.35643043268775986832e+00 1.61203482852587782759e+01 5.36369578742796981885e+00 8.00 6.00
61 Fe 8.06149645766986999718e+00 1.87706931995481483000e+01 8.08694984427888030609e+00 8.00 6.00
62 Fe 5.35883657224553022758e+00 1.61105529670218210470e+01 1.07520836536702191211e+01 8.00 6.00
63 Fe 8.04103508208049966299e+00 1.87946667268959402008e+01 1.34273439666690102001e+01 8.00 6.00
64 Fe 5.35993340697926967664e+00 1.61104992672600211279e+01 1.61046938970911099887e+01 8.00 6.00
65 Fe 8.06103129448552024883e+00 1.87711193569833696415e+01 1.87696162570666906788e+01 8.00 6.00
66 Fe 1.08050010646198799691e+01 -6.54644909764200005897e-02 -6.84697404577700036166e-02 8.00 6.00
67 Fe 1.34183134551308995697e+01 2.68948315842817997634e+00 2.68327935595839006666e+00 8.00 6.00
68 Fe 1.08054890847101496831e+01 -6.59337108581899977722e-02 5.43627548991614961693e+00 8.00 6.00
69 Fe 1.34187307070591206326e+01 2.68864875196657004963e+00 8.10649663315911972461e+00 8.00 6.00
70 Fe 1.07386509165534196342e+01 -2.04508040070499989838e-02 1.07676572311068294852e+01 8.00 6.00
71 Fe 1.34188601310791693066e+01 2.68872375452917999894e+00 1.34281146333695797779e+01 8.00 6.00
72 Fe 1.07393304271620291246e+01 -2.07304269945900003502e-02 1.60890802035982893869e+01 8.00 6.00
73 Fe 1.34192281520636704784e+01 2.68858618711018992897e+00 1.87496241122212303765e+01 8.00 6.00
74 Fe 1.08056780794564897263e+01 5.43648695925378966365e+00 -7.49855677256500013916e-02 8.00 6.00
75 Fe 1.34175497760259307967e+01 8.10649690668754985268e+00 2.68361800270902994825e+00 8.00 6.00
76 Fe 1.08064209142353995219e+01 5.43567631832022968297e+00 5.43989054054445020370e+00 8.00 6.00
77 Fe 1.34308215250403808483e+01 8.11650167233528918587e+00 8.11258305804152968221e+00 8.00 6.00
78 Fe 1.07549313879488597223e+01 5.38933475549968044049e+00 1.07792837640698593304e+01 8.00 6.00
79 Fe 1.34290033260937491377e+01 8.08280780507841001281e+00 1.34282692839847701549e+01 8.00 6.00
80 Fe 1.07550183226897395627e+01 5.39026170809037008524e+00 1.60784126011358594610e+01 8.00 6.00
81 Fe 1.34312194782162794837e+01 8.12061311449807021745e+00 1.87414122850898010597e+01 8.00 6.00
82 Fe 1.07456974480856501941e+01 1.07763952554514794713e+01 -1.33196375600999998567e-02 8.00 6.00
83 Fe 1.34187569179324306390e+01 1.34336742719044508476e+01 2.68378884417984009403e+00 8.00 6.00
84 Fe 1.07456530275717998535e+01 1.07763350988285608878e+01 5.38266460937317958724e+00 8.00 6.00
85 Fe 1.34198495598907996396e+01 1.34338138098461499226e+01 8.07509744160184084194e+00 8.00 6.00
86 Fe 1.07564483914456694436e+01 1.07913168104942407410e+01 1.07805257509506500213e+01 8.00 6.00
87 Fe 1.34185080648732597552e+01 1.34340260062089207338e+01 1.34278618674576204484e+01 8.00 6.00
88 Fe 1.07567281388973796652e+01 1.07920827976694599926e+01 1.60738563077589908801e+01 8.00 6.00
89 Fe 1.34191960236510894333e+01 1.34339518161380908623e+01 1.87827327879820202838e+01 8.00 6.00
90 Fe 1.07414361914828493383e+01 1.60922849221953399024e+01 -1.81981169344299989477e-02 8.00 6.00
91 Fe 1.34191999913578197123e+01 1.87600440194988493658e+01 2.68394472843713982613e+00 8.00 6.00
92 Fe 1.07420351392005795077e+01 1.60920156815043000620e+01 5.38629023294472020211e+00 8.00 6.00
93 Fe 1.34064915602794201277e+01 1.87493221775012592900e+01 8.11165935921886926963e+00 8.00 6.00
94 Fe 1.07281296417378406716e+01 1.60995489857824587432e+01 1.07631599511139803838e+01 8.00 6.00
95 Fe 1.34081405499142700677e+01 1.87841348225458908416e+01 1.34270737589983308879e+01 8.00 6.00
96 Fe 1.07280231003357595654e+01 1.60997861031909010876e+01 1.60920504283141596602e+01 8.00 6.00
97 Fe 1.34060299869864003597e+01 1.87489361156042697587e+01 1.87456412745770286676e+01 8.00 6.00
98 Fe 1.60303910347549916082e+01 -5.76463796851399978838e-02 -7.27982850612499954313e-02 8.00 6.00
99 Fe 1.83856489417957789101e+01 2.71015517499122005063e+00 2.68302314035171018958e+00 8.00 6.00
100 Fe 1.60307274093131013615e+01 -5.70301074411799988062e-02 5.44044929451665026932e+00 8.00 6.00
101 Fe 1.87180345074212191037e+01 2.70354283631036018676e+00 8.10392314516501954813e+00 8.00 6.00
102 Fe 1.60829582812116704815e+01 -1.26349453921199995216e-02 1.07776891726427095364e+01 8.00 6.00
103 Fe 1.87827962704915414349e+01 2.69449299215364002080e+00 1.34278537317753894342e+01 8.00 6.00
104 Fe 1.60832425030834613722e+01 -1.17340042256999996240e-02 1.60781123313778309125e+01 8.00 6.00
105 Fe 1.87179708326633011950e+01 2.70361214694599016894e+00 1.87525436159004108561e+01 8.00 6.00
106 Fe 1.60306004778435813307e+01 5.44436247934662009840e+00 -7.01326857012000010050e-02 8.00 6.00
107 Fe 1.87410428817400891432e+01 8.08355298400988075969e+00 2.68348480334823991100e+00 8.00 6.00
108 Fe 1.60315897829277815845e+01 5.44405986006024988910e+00 5.43655604154557980934e+00 8.00 6.00
109 Fe 1.87752902857035586237e+01 8.09723936600643945383e+00 8.08819986427275949836e+00 8.00 6.00
110 Fe 1.60990120144608788166e+01 5.39820365437612004200e+00 1.07682434712227799167e+01 8.00 6.00
111 Fe 1.87959789860830994712e+01 8.07358263472868031840e+00 1.34269808747742391830e+01 8.00 6.00
112 Fe 1.60990489223654016371e+01 5.39843572208700983595e+00 1.60883270524072692353e+01 8.00 6.00
113 Fe 1.87755939259245998585e+01 8.09783806644428061361e+00 1.87693912395833102380e+01 8.00 6.00
114 Fe 1.60950921185125004342e+01 1.07753382486206294999e+01 -1.89270321729600003724e-02 8.00 6.00
115 Fe 1.87857143199218512564e+01 1.34337540066069003331e+01 2.68249324959543011815e+00 8.00 6.00
116 Fe 1.60943735667017513435e+01 1.07746025128585607433e+01 5.38711475306215969994e+00 8.00 6.00
117 Fe 1.87877444042509402777e+01 1.34221897727623904473e+01 8.07110647036491002382e+00 8.00 6.00
118 Fe 1.61086967189287797453e+01 1.07675328839452291163e+01 1.07645077384509608720e+01 8.00 6.00
119 Fe 1.88002535850406395923e+01 1.34230115813217505405e+01 1.34278493311103002128e+01 8.00 6.00
120 Fe 1.61099080263674885316e+01 1.07689018497194801682e+01 1.60915830329236300145e+01 8.00 6.00
121 Fe 1.87899632971708108187e+01 1.34218540131557393380e+01 1.87846663538847984398e+01 8.00 6.00
122 Fe 1.60918431543800508621e+01 1.60916685690985694634e+01 -1.43474364710099999698e-02 8.00 6.00
123 Fe 1.87458387585184311774e+01 1.88054584633885397693e+01 2.68371097895358978747e+00 8.00 6.00
124 Fe 1.60913440423337910090e+01 1.60911471679581907779e+01 5.38147445793472023468e+00 8.00 6.00
125 Fe 1.86831020533990184163e+01 1.86861333287687294558e+01 8.17802607361102040784e+00 8.00 6.00
126 Fe 1.60808035799122208687e+01 1.60752873076043698575e+01 1.07810402604237403068e+01 8.00 6.00
127 Fe 1.87830439507991115988e+01 1.87838825124817994094e+01 1.34281891821116996510e+01 8.00 6.00
128 Fe 1.60801453078397109664e+01 1.60761841034333698985e+01 1.60751489818672297361e+01 8.00 6.00
129 Fe 1.86826368989312001645e+01 1.86866658174930293512e+01 1.86786645994430884343e+01 8.00 6.00
Atoms.SpeciesAndCoordinates>

HS.fileout on

Any help resolving this would be fantastic!
If needed, I can share with you the full input and output files via email/dropbox.
Kind regards,
Jacob Chapman
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.3 )
Date: 2019/03/27 00:29
Name: Naoya Yamaguchi

Dear Jacob,

Thank you for providing information. First, because your system is slightly large, could you share the SCFOUT file if possible? If so, I can check directly the SCFOUT file. The file size may be too large to send it by email, and I think Dropbox is better.

Regards,
Naoya Yamaguchi
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.4 )
Date: 2019/03/27 00:45
Name: J. Chapman  <jacob.chapman@ukaea.uk>

Dear Naoya,
Great thank you. I have put the relevant files into a dropbox folder. Could you provide me with your email so I may share this with you. Feel free to email me directly (jacob.chapman@ukaea.uk) if you would prefer not to include your email in the open forum.
Many thanks,
Jacob Chapman
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.5 )
Date: 2019/03/27 03:24
Name: Naoya Yamaguchi

Dear Jacob,

I checked your SCFOUT file by writting more digits using modified "analysis_example.c", and as you said, the Hamiltonian for spin-up and spin-down states are the same.
And then, I investigated the cause by reading the source code, and I leave the report below in the case of "scf.SpinPolarization On" and "scf.SpinOrbit.Coupling Off".
The Hamiltonian is set through a function "Set_Hamiltonian" in "Set_Hamiltonian.c" as follows:
L111:
/* spin collinear */

else{

for (Mc_AN=1; Mc_AN<=Matomnum; Mc_AN++){
Gc_AN = M2G[Mc_AN];
Cwan = WhatSpecies[Gc_AN];
for (h_AN=0; h_AN<=FNAN[Gc_AN]; h_AN++){
Gh_AN = natn[Gc_AN][h_AN];
Hwan = WhatSpecies[Gh_AN];
for (i=0; i<Spe_Total_NO[Cwan]; i++){
for (j=0; j<Spe_Total_NO[Hwan]; j++){
for (spin=0; spin<=SpinP_switch; spin++){

if (ProExpn_VNA==0){
H[spin][Mc_AN][h_AN][i][j] = F_Kin_flag*H0[0][Mc_AN][h_AN][i][j]
+ F_NL_flag*HNL[spin][Mc_AN][h_AN][i][j];
}
else{
H[spin][Mc_AN][h_AN][i][j] = F_Kin_flag*H0[0][Mc_AN][h_AN][i][j]
+ F_VNA_flag*HVNA[Mc_AN][h_AN][i][j]
+ F_NL_flag*HNL[spin][Mc_AN][h_AN][i][j];
}

/* Effective Hubbard Hamiltonain --- added by MJ */
if( (Hub_U_switch==1 || 1<=Constraint_NCS_switch) && F_U_flag==1 && 2<=SCF_iter ){
H[spin][Mc_AN][h_AN][i][j] += H_Hub[spin][Mc_AN][h_AN][i][j];
}
}
}
}
}
}

}

From the above, the spin dependent component is "HNL[spin][Mc_AN][h_AN][i][j]" except effective potential for +U.

And, "HNL[spin][Mc_AN][h_AN][i][j]" is set through a function "Nonlocal0" in "Set_Nonlocal.c" as follows, and it includes the spin dependent component of "NLH":
L1199:
for (p=0; p<List_YOUSO[5]; p++){
for (i1=0; i1<Spe_Total_NO[Cwan]; i1++){
for (j1=0; j1<Spe_Total_NO[Hwan]; j1++){

HNL[p][Mc_AN][j][i1][j1] = dmp*NLH[p][i1][j1].r*F_NL_flag;

if (SO_switch==1){
iHNL[p][Mc_AN][j][i1][j1] = dmp*NLH[p][i1][j1].i*F_NL_flag;
iHNL0[p][Mc_AN][j][i1][j1] = dmp*NLH[p][i1][j1].i*F_NL_flag;
}
}
}
}

And, "NLH[p][i1][j1]" is set through a function "Multiply_DS_NL" in "Set_Nonlocal.c" as follows:
L1268:
/****************************************************
l-dependent non-local part
****************************************************/

if (VPS_j_dependency[wakg]==0){

for (m=0; m<Spe_Total_NO[Cwan]; m++){
for (n=0; n<Spe_Total_NO[Hwan]; n++){

sum = 0.0;

L = 0;
for (L1=1; L1<=Spe_Num_RVPS[wakg]; L1++){

ene = Spe_VNLE[0][wakg][L1-1];
L2 = 2*Spe_VPS_List[wakg][L1];

for (L3=0; L3<=L2; L3++){
sum += ene*DS_NL[0][0][Mc_AN][k][m][L]*DS_NL[0][0][Mj_AN][kl][n][L];
L++;
}
}

NLH[0][m][n].r += sum; /* <up|VNL|up> */
NLH[1][m][n].r += sum; /* <dn|VNL|dn> */

}
}

} /* if */

Therefore, "NLH[0][m][n]" and "NLH[1][m][n]" is the same. In other words, "NLH" is spin-independent.
In summary, the Hamiltonian ("H") seems spin-independent in the case of "scf.SpinPolarization On" and "scf.SpinOrbit.Coupling Off".

Regards,
Naoya Yamaguchi
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.6 )
Date: 2019/03/28 02:03
Name: Naoya Yamaguchi

Dear Jacob,

Sorry, I missed contributions from grid data, it appears in a function "Set_Hamiltonian":
L435:
double AI_tmp_GVVG = GridVol * Vpot_Grid[0][MN];

, where "Vpot_Grid" is given through an array "Vpot_Grid_B" in a function "Set_Vpot" in "Set_Vpot.c" as follows, for example:
L194:
for (spin=0; spin<=SpinP_switch; spin++){
for (MN=0; MN<My_NumGridB_AB; MN++){
Vpot_Grid_B[spin][MN] = F_dVHart_flag*dVHart_Grid_B[MN]
+ F_Vxc_flag*Vxc_Grid_B[spin][MN];
}
}

"Vxc_Grid_B[spin][MN]" is spin-dependent and it is given in a function "Set_XC_Grid" in "Set_XC_Grid.c". And, "Set_Hamiltonian" calls "Vpot_Grid" with XC_P_switch=1, which calls "Set_XC_Grid" so that you can find active parts in this case by focusing on IF statements of "XC_P_switch==1". Although I omit them because it is slightly complicated, after all, "H" seems spin-dependent. I think that smaller system is better for a test at first. Is there such an example?

Regards,
Naoya Yamaguchi
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.7 )
Date: 2019/03/29 19:12
Name: J. Chapman  <jacob.chapman@ukaea.uk>

Hi Naoya,

Yes I have been working my way through the code and came to the same conclusion that there is spin dependence later. (At least I am becoming vastly more familiar with the inner working of the code!) It looks like the Hamiltonian is also updated during the density mixing routines (Mixing_H.c) and possibly when updating the VXC in the total energy calculation at the end of the SCF cycle (Total_Energy.c). At least they update H and as far as I have noticed it is the same *****H initialised in the openmx_common.h header (pushed through using the charge density matrix CDM).

For a smaller system, the Fe2.dat (Fe dimer in vacuum) given as an example input (Work directory in a clean install) also uses flags scf.spinpolarized = on and (by omission) scf.spinorbitcoupling = off. In this case, the Hamiltonian reported does indeed have different spin up and spin down components in the Hamiltonian. Again I print only the first line of the 1st block

[spin=0][ct_AN=1][h_AN=0][i=0][j:]
-0.1939633 -0.0054143 -0.0097910 -0.0042859 0.0000000 -0.0000000 0.0253844 -0.0000000 -0.0000000 0.0060615 -0.0104988 0.0000000 0.0000000 0.0000000 0.0118706 -0.0205604 -0.0000000 0.0000000 0.0000000

[spin=1][ct_AN=1][h_AN=0][i=0][j:]
-0.1644931 -0.0251076 -0.0142056 -0.0063393 0.0000000 -0.0000000 0.0345063 -0.0000000 -0.0000000 0.0105328 -0.0182433 0.0000000 0.0000000 0.0000000 0.0093307 -0.0161613 -0.0000000 0.0000000 -0.0000000

In this case I also tried using md.type = nomd but here it does seem to report correctly! So I am still lost as to why for the example I sent you the components remain the same.

There is definitely something peculiar. I did another test, one for bcc Fe with 128 atoms (relaxed with RFC5) and one with 250 atoms (Opt). The 128 atom case has the expected difference in the components whereas the 250 atom case did not. Otherwise their collinear moments per atom were comparable (2.25 mu_B vs 2.27 mu_B, respectively). The simulation flags were near enough the same albeit they used a different basis set. But the basis set of the 128 atom case where I get the expected Hamiltonian is the same as that in the input file I shared previously where I do not get the expected Hamiltonian. So I do not believe the choice of basis to be a factor.

I appreciate you helping me with this.

Kind regards,
Jacob Chapman
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.8 )
Date: 2019/03/30 02:40
Name: Naoya Yamaguchi

Dear Jacob,

I tested an input file (Nomd) extracted from your SCFOUT file, and the problem was reproduced. As you checked smaller systems, I tried an input file of NiO, and confirmed that H[spin=0] is different from H[1].

>It looks like the Hamiltonian is also updated during the density mixing routines (Mixing_H.c) and possibly when updating the VXC in the total energy calculation at the end of the SCF cycle (Total_Energy.c).

"Total_Energy.c" appears to update "H" when Energy_Decomposition_flag=1, that is, "Energy.Decomposition On" in an input file.
"Mixing_H.c" also appears to update it when Mixing_switch=5, that is, "scf.Mixing.Type RMM-DIISH".

And, I believe "H" is correct during a loop of SCF and as you pointed out, after the loop, "H" may become wrong by the update. I think the problem might have been induced by "Energy.Decomposition On", that is, Energy_Decomposition_flag=1 in "Total_Energy.c" because there is not "scf.Mixing.Type RMM-DIISH" but "scf.Mixing.Type RMM-DIISK" in your input file. So, I now try to calculate it again with "Energy.Decomposition Off". I will report the result after the calculation is finished. However, if so, now I don't find the reason of it because I always use OpenMX 3.7, and I am not familiar with OpenMX 3.8.

Regards,
Naoya Yamaguchi
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.9 )
Date: 2019/03/30 15:33
Name: Naoya Yamaguchi

Dear Jacob,

I leave the result below.

Kohn-Sham Hamiltonian spin=0
glbal index=1 local index=0 (grobal=1, Rn=0)
-0.4209214 -0.0635716 0.1061279 -0.0005037 -0.0011482 -0.0018096 -0.0050048 -0.0042123 -0.0038995 0.0037754 0.0045916 0.0057343 -0.0046881 0.0022427 -0.0024676 -0.0042845 -0.0057972 -0.0124321 0.0054752 -0.0010854 -0.0021984 -0.0000858 0.0235076 -0.0079237 0.0261963 0.0336664 0.0419280
...
Kohn-Sham Hamiltonian spin=1
glbal index=1 local index=0 (grobal=1, Rn=0)
-0.4128101 -0.0856586 0.1064601 -0.0003239 -0.0009568 -0.0014855 -0.0047907 -0.0034074 -0.0028700 0.0023692 0.0026303 0.0025992 -0.0057180 0.0026294 -0.0031916 -0.0049822 -0.0073071 -0.0122742 0.0055332 -0.0004132 -0.0016015 -0.0007869 0.0232295 -0.0080400 0.0255947 0.0326188 0.0401835
...

It seems appropriate and an instant solution is "Energy.Decomposition Off". At least, this function should have some bugs.

Regards,
Naoya Yamaguchi
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.10 )
Date: 2019/03/30 15:33
Name: Naoya Yamaguchi

Dear Jacob,

I leave a solution by a patch as follows. The added code is effective in avoiding the conflict.

In a function "Calc_EXC_EH1" included in "Total_Energy.c":
/****************************************************
if (Energy_Decomposition_flag==1)
EH1, EXC, and Ena are decomposed into
atomic orbital contributions.
****************************************************/

if (Energy_Decomposition_flag==1){

/********************************
allocation of arrays
*********************************/

mat = (double**)malloc(sizeof(double*)*List_YOUSO[7]);
for (i=0; i<List_YOUSO[7]; i++){
mat[i] = (double*)malloc(sizeof(double)*List_YOUSO[7]);
}

/* Added by N. Yamaguchi ***/
int tno0, tno1;
double *****H = (double*****)malloc(sizeof(double****)*(SpinP_switch+1));
for (k=0; k<=SpinP_switch; k++){
H[k] = (double****)malloc(sizeof(double***)*(Matomnum+MatomnumF+MatomnumS+1));
FNAN[0] = 0;
for (Mc_AN=0; Mc_AN<=(Matomnum+MatomnumF+MatomnumS); Mc_AN++){

if (Mc_AN==0){
Gc_AN = 0;
tno0 = 1;
}
else{
Gc_AN = S_M2G[Mc_AN];
Cwan = WhatSpecies[Gc_AN];
tno0 = Spe_Total_NO[Cwan];
}

H[k][Mc_AN] = (double***)malloc(sizeof(double**)*(FNAN[Gc_AN]+1));
for (h_AN=0; h_AN<=FNAN[Gc_AN]; h_AN++){

if (Mc_AN==0){
tno1 = 1;
}
else{
Gh_AN = natn[Gc_AN][h_AN];
Hwan = WhatSpecies[Gh_AN];
tno1 = Spe_Total_NO[Hwan];
}

H[k][Mc_AN][h_AN] = (double**)malloc(sizeof(double*)*tno0);
for (i=0; i<tno0; i++){
H[k][Mc_AN][h_AN][i] = (double*)malloc(sizeof(double)*tno1);
}
}
}
}
/* ***/

/*******************************************************
decomposition of EH1 related to dVH
*******************************************************/
(omission)
/********************************
freeing of arrays
*********************************/

for (i=0; i<List_YOUSO[7]; i++){
free(mat[i]);
}
free(mat);

/* Added by N. Yamaguchi ***/
for (k=0; k<=SpinP_switch; k++){
for (Mc_AN=0; Mc_AN<=(Matomnum+MatomnumF+MatomnumS); Mc_AN++){

if (Mc_AN==0){
Gc_AN = 0;
tno0 = 1;
}
else{
Gc_AN = S_M2G[Mc_AN];
Cwan = WhatSpecies[Gc_AN];
tno0 = Spe_Total_NO[Cwan];
}

for (h_AN=0; h_AN<=FNAN[Gc_AN]; h_AN++){

if (Mc_AN==0){
tno1 = 1;
}
else{
Gh_AN = natn[Gc_AN][h_AN];
Hwan = WhatSpecies[Gh_AN];
tno1 = Spe_Total_NO[Hwan];
}

for (i=0; i<tno0; i++){
free(H[k][Mc_AN][h_AN][i]);
}

free(H[k][Mc_AN][h_AN]);
}
free(H[k][Mc_AN]);
}
free(H[k]);
}
free(H);
/* ***/

} /* if (Energy_Decomposition_flag==1) */

And, I think that the Hamiltonian in your SCFOUT files made by OpenMX 3.8 without this patch may always be wrong when "Energy.Decomposition On".

Regards,
Naoya Yamaguchi
メンテ
Re: SCFOUT Error - Hamiltonian incorrectly saved for MD.Type Opt ( No.11 )
Date: 2019/04/04 01:29
Name: J. Chapman  <jacob.chapman@ukaea.uk>

Dear Naoya,

Yes turning off the energy decomposition flag seems to do the trick, thank you!
I will be recompiling using your patch tomorrow and do some testing. I will let you know if it kicks up any errors my end but I expect not.

Thank you for all your help resolving this.

Kind regards,

Jacob
メンテ

Page: [1]