-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathkkr_params.py
2005 lines (1878 loc) · 99.8 KB
/
kkr_params.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #
# All rights reserved. #
# This file is part of the Masci-tools package. #
# (Material science tools) #
# #
# The code is hosted on GitHub at https://github.com/judftteam/masci-tools. #
# For further information on the license, see the LICENSE.txt file. #
# For further information please visit http://judft.de/. #
# #
###############################################################################
"""
In this module you find the kkrparams class that helps defining the KKR input parameters
Also some defaults for the parameters are defined.
"""
from masci_tools.io.common_functions import open_general
__copyright__ = ('Copyright (c), 2017, Forschungszentrum Jülich GmbH,'
'IAS-1/PGI-1, Germany. All rights reserved.')
__license__ = 'MIT license, see LICENSE.txt file'
__version__ = '1.8.8'
__contributors__ = 'Philipp Rüßmann'
# This defines the default parameters for KKR used in the aiida plugin:
__kkr_default_params__ = {
'LMAX': 3, # lmax-cutoff
'INS': 1, # use shape corrections (full potential)
'KSHAPE': 2, # basically the same information as INS (KSHAPE=2*INS should always hold!)
'NSPIN': 2, # spin-polarized calculation (but by default not automatically initialized with external field)
'RMAX': 10., # Madelung sum real-space cutoff
'GMAX': 100., # Madelung sum reciprocal-space cutoff
'RCLUSTZ': 2.3 # size of screening cluster (in alat units)
}
# prevent kkrparams to add brackets around these keywords automatically
__forbid_brackets__ = ['use_input_alat']
class kkrparams:
"""
Class for creating and handling the parameter input for a KKR calculation
Optional keyword arguments are passed to init and stored in values dictionary.
Example usage: params = kkrparams(LMAX=3, BRAVAIS=array([[1,0,0], [0,1,0], [0,0,1]]))
Alternatively values can be set afterwards either individually with
params.set_value('LMAX', 3)
or multiple keys at once with
params.set_multiple_values(EMIN=-0.5, EMAX=1)
Other useful functions
- print the description of a keyword: params.get_description([key]) where [key] is a string for a keyword in params.values
- print a list of mandatory keywords: params.get_all_mandatory()
- print a list of keywords that are set including their value: params.get_set_values()
.. note:
KKR-units (e.g. atomic units with energy in Ry, length in a_Bohr) are assumed
except for the keys'<RBLEFT>', '<RBRIGHT>', 'ZPERIODL', and 'ZPERIODR' which should be given in Ang. units!
"""
def __init__(self, **kwargs):
"""
Initialize class instance with containing the attribute values that also have
a format, mandatory flags (defaults for KKRcode, changed for example via params_type='voronoi' keyword) and a description.
"""
# keywords for KKRhost and voronoi (all allowed keys for inputcard)
self._DEFAULT_KEYWORDS_KKR = dict([ # complete list of keywords, detault all that are not mandatory to None
# lattice
('ALATBASIS', [
None, '%f', True,
'Description of lattice: Length unit in Bohr radii usually conventional lattice parameter'
]),
('BRAVAIS', [
None, '%f %f %f\n%f %f %f\n%f %f %f', True,
'Description of lattice: Bravais vectors in units of [ALATBASIS]'
]),
('NAEZ', [None, '%i', True, 'Description of lattice: Number of sites in unit cell']),
('<RBASIS>', [None, '%f %f %f', True, 'Description of lattice: Positions of sites in unit cell']),
('CARTESIAN', [
None, '%l', False,
'Description of lattice: Interpret the basis vector coordinates as reduced (w. respect to bravais) or as cartesian (in lattice constant units)'
]),
('INTERFACE', [None, '%l', False, 'Description of lattice, 2D mode: needs to be TRUE for 2D calculation']),
('<NLBASIS>', [
None, '%i', False,
'Description of lattice, 2D mode: Number of basis sites forming the half-infinite lattice to the lower (=left) part of the slab.'
]),
('<RBLEFT>', [
None, '%f %f %f', False,
'Description of lattice, 2D mode: Positions of sites forming the basis sites of the half-infinite lattice to the lower (=left) part of the slab.'
]),
('ZPERIODL', [
None, '%f %f %f', False,
'Description of lattice, 2D mode: Lattice vector describing the periodicity perpendicular to the slab-plane for the half-infinite lattice to the lower (=left) part of the slab (plays the role of the 3rd Bravais vector for this half-infinite lattice). The <RBLEFT> vectors are periodically repeated by the ZPERIODL vector.'
]),
('<NRBASIS>', [
None, '%i', False,
'Description of lattice, 2D mode: Number of basis sites forming the half-infinite lattice to the upper (=right) part of the slab.'
]),
('<RBRIGHT>', [
None, '%f %f %f', False,
'Description of lattice, 2D mode: Positions of sites forming the basis sites of the half-infinite lattice to the upper (=right) part of the slab.'
]),
('ZPERIODR', [
None, '%f %f %f', False,
'Description of lattice, 2D mode: Lattice vector describing the periodicity perpendicular to the slab-plane for the half-infinite lattice to the upper (=right) part of the slab (plays the role of the 3rd Bravais vector for this half-infinite lattice). The <RBRIGHT> vectors are periodically repeated by the ZPERIODR vector.'
]),
('KSHAPE', [
None, '%i', False,
'Description of lattice, shape functions: 0 for ASA ([INS]=0), 2 for full potential ([INS]=1)'
]),
('<SHAPE>', [
None, '%i', False,
'Description of lattice, shape functions: Indexes which shape function from the shape-function file to use in which atom. Default is that each atom has its own shape function.'
]),
# chemistry
('<ZATOM>', [
None, '%f', True,
'Chemistry, Atom types: Nuclear charge per atom. Negative value signals to use value read in from the potential file.'
]),
('NSPIN',
[None, '%i', True, 'Chemistry, Atom types: Number of spin directions in potential. Values 1 or 2']),
('KVREL', [
None, '%i', False,
'Chemistry, Atom types: Relativistic treatment of valence electrons. Takes values 0 (Schroedinger), 1 (Scalar relativistic), 2 (Dirac ; works only in ASA mode)'
]),
('<SOCSCL>', [
None, '%f', False,
'Chemistry, Atom types: Spin-orbit coupling scaling per atom. Takes values between 0. (no spin-orbit) and 1. (full spin-orbit). Works only in combination with the Juelich spin orbit solver (runoption NEWSOSOL)'
]),
('KEXCOR', [
None, '%i', False,
'Chemistry, Exchange-correlation: Type of exchange correlation potential. Takes values 0 (LDA, Moruzzi-Janak-Williams), 1 (LDA, von Barth-Hedin), 2 (LDA, Vosko-Wilk-Nussair), 3 (GGA, Perdew-Wang 91), 4 (GGA, PBE), 5 (GGA, PBEsol)'
]),
('LAMBDA_XC', [
None, '%f', False,
'Chemistry, Exchange-correlation: Scale the magnetic part of the xc-potential and energy. Takes values between 0. (fully suppressed magnetisc potential) and 1. (normal magnetic potential).'
]),
('NAT_LDAU',
[None, '%i', False, 'Chemistry, Exchange-correlation: Number of atoms where LDA+U will be used']),
('LDAU_PARA', [
None, '%i %i %f %f %f', False,
'Chemistry, Exchange-correlation: For each atom where LDA+U should be used, the entries are: [atom type] [angular mom. to apply LDA+U] [Ueff] [Jeff] [Eref] where [atom type] is between 1...[NATYP].'
]),
('KREADLDAU', [
None, '%i', False,
"Chemistry, Exchange-correlation: Takes values 0 or 1; if [KREADLDAU]=1 then read previously calculated LDA+U matrix elements from file 'ldaupot'."
]),
('NATYP', [
None, '%i', False,
'Chemistry, CPA mode: Number of atom types; CPA is triggered by setting [NATYP]>[NAEZ].'
]),
('<SITE>', [
None, '%i', False,
'Chemistry, CPA mode: Takes values 1 < [<SITE>] < [NAEZ] Assigns the position (given by [<RBASIS>]) where the atom-dependent read-in potential is situated. E.g., if the 3rd-in-the-row potential should be positioned at the 2nd <RBASIS> vector, then the 3rd entry of the <SITE> list should have the value 2.'
]),
('<CPA-CONC>', [
None, '%f', False,
'Chemistry, CPA mode: Takes values 0. < [<CPA-CONC>] < 1. Assigns the alloy-concentration corresponding to the atom-dependent read-in potential. Together with the variable <SITE>, <CPA-CONC> assigns the number and concentration of the atom-dependent potentials residing at each site form 1 to [NAEZ]. The sum of concentrations at each site should equal 1.'
]),
('<KAOEZL>', [
None, '%i', False,
'Chemistry, 2D mode: Controls the type of t-matrix at the lower (=left) half-crystal sites in case of embedding as these are given in the left-decimation file (i.e., changes the order compared to the one in the left-decimation file).'
]),
('<KAOEZR>', [
None, '%i', False,
'Chemistry, 2D mode: Controls the type of t-matrix at the upper (=right) half-crystal sites in case of embedding as these are given in the right-decimation file (i.e., changes the order compared to the one in the right-decimation file).'
]),
# external fields
('LINIPOL', [
None, '%l', False,
'External fields: If TRUE, triggers an external magn. field per atom in the first iteration.'
]),
('HFIELD', [
None, '%f', False,
'External fields: Value of an external magnetic field in the first iteration. Works only with LINIPOL, XINIPOL'
]),
('XINIPOL', [None, '%i', False, 'External fields: Integer multiplying the HFIELD per atom']),
('VCONST', [None, '%f', False, 'External fields: Constant potential shift in the first iteration.']),
('IVSHIFT', [None, '%i', False, 'External fields: Apply VCONST only on selected atom.']),
# accuracy
('LMAX', [None, '%i', True, 'Accuracy: Angular momentum cutoff']),
('BZDIVIDE', [
None, '%i %i %i', False,
'Accuracy: Maximal Brillouin zone mesh. Should not violate symmetry (e.g cubic symmetry implies i1=i2=i3; terragonal symmetry in xy implies i1=i2; i1=i2=i3 is always safe.)'
]),
('EMIN',
[None, '%f', False, 'Accuracy, Valence energy contour: Lower value (in Ryd) for the energy contour']),
('EMAX', [
None, '%f', False,
'Accuracy, Valence energy contour: Maximum value (in Ryd) for the DOS calculation Controls also [NPT2] in some cases'
]),
('TEMPR', [None, '%f', False, 'Accuracy, Valence energy contour: Electronic temperature in K.']),
('NPT1', [
None, '%i', False,
'Accuracy, Valence energy contour: Number of energies in the 1st part of the rectangular contour ("going up").'
]),
('NPT2', [
None, '%i', False,
'Accuracy, Valence energy contour: Number of energies in the 2nd part of the rectangular contour ("going right").'
]),
('NPT3', [
None, '%i', False,
'Accuracy, Valence energy contour: Number of energies in the 3rd part of the rectangular contour (Fermi smearing part).'
]),
('NPOL', [
None, '%i', False,
'Accuracy, Valence energy contour: Number of Matsubara poles For DOS calculations, set [NPOL]=0'
]),
('EBOTSEMI', [None, '%f', False, 'Accuracy, Semicore energy contour: Bottom of semicore contour in Ryd.']),
('EMUSEMI', [None, '%f', False, 'Accuracy, Semicore energy contour: Top of semicore contour in Ryd.']),
('TKSEMI', [
None, '%f', False,
'Accuracy, Semicore energy contour: "Temperature" in K controlling height of semicore contour.'
]),
('NPOLSEMI', [
None, '%i', False,
'Accuracy, Semicore energy contour: Control of height of semicore contour: Im z = (2 * [NPOLSEMI] * pi * kB * [TKSEMI] ) with kB=0.6333659E-5'
]),
('N1SEMI', [
None, '%i', False,
'Accuracy, Semicore energy contour: Number of energies in first part of semicore contour ("going up").'
]),
('N2SEMI', [
None, '%i', False,
'Accuracy, Semicore energy contour: Number of energies in second part of semicore contour ("going right").'
]),
('N3SEMI', [
None, '%i', False,
'Accuracy, Semicore energy contour: Number of energies in third part of semicore contour ("going down").'
]),
('FSEMICORE', [
None, '%f', False,
'Accuracy, Semicore energy contour: Initial normalization factor for semicore states (approx. 1.).'
]),
('CPAINFO', [
None, '%f %i', False,
'Accuracy, CPA mode: CPA-error max. tolerance and max. number of CPA-cycle iterations.'
]),
('RCLUSTZ', [
None, '%f', False,
'Accuracy, Screening clusters: Radius of screening clusters in units of [ALATBASIS], default is 11 Bohr radii.'
]),
('RCLUSTXY', [
None, '%f', False,
'Accuracy, Screening clusters: If [RCLUSTXY] does not equal [RCLUSTZ] then cylindrical clusters are created with radius [RCLUSTXY] and height [RCLUSTZ].'
]),
('<RMTREF>', [
None, '%f', False,
'Accuracy, Screening clusters: Muffin tin radius in Bohr radii for each site forming screening clusters. Negative value signals automatic calculation by the code.'
]),
('NLEFTHOS', [
None, '%i', False,
'Accuracy, Screening clusters 2D mode: The vectors [<RBLEFT>] are repeated i=1,...,[NLEFTHOS] times, shifted by i*[ZPERIODL], for the later formation of screening clusters.'
]),
('<RMTREFL>', [
None, '%f', False,
'Accuracy, Screening clusters 2D mode: Muffin-tin radius in Bohr radii for each site forming screening clusters in the lower (=left) half-crystal. Negative value signals automatic calculation by the code.'
]),
('NRIGHTHO', [
None, '%i', False,
'Accuracy, Screening clusters 2D mode: The vectors [<RBRIGHT>] are repeated i=1,...,[NRIGHTHO] times, shifted by i*[ZPERIODR], for the later formation of screening clusters.'
]),
('<RMTREFR>', [
None, '%f', False,
'Accuracy, Screening clusters 2D mode: Muffin-tin radius in Bohr radii for each site forming screening clusters in the upper (=right) half-crystal. Negative value signals automatic calculation by the code.'
]),
('INS', [
None, '%i', False,
'Accuracy, Radial solver: Takes values 0 for ASA and 1 for full potential Must be 0 for Munich Dirac solver ([KREL]=2)'
]),
('ICST', [None, '%i', False, 'Accuracy, Radial solver: Number of iterations in the radial solver']),
('R_LOG', [
None, '%f', False,
'Accuracy, Radial solver: Radius up to which log-rule is used for interval width. Used in conjunction with runopt NEWSOSOL'
]),
('NPAN_LOG', [
None, '%i', False,
'Accuracy, Radial solver: Number of intervals from nucleus to [R_LOG] Used in conjunction with runopt NEWSOSOL'
]),
('NPAN_EQ', [
None, '%i', False,
'Accuracy, Radial solver: Number of intervals from [R_LOG] to muffin-tin radius Used in conjunction with runopt NEWSOSOL'
]),
('NCHEB', [
None, '%i', False,
'Accuracy, Radial solver: Number of Chebyshev polynomials per interval Used in conjunction with runopt NEWSOSOL'
]),
('<FPRADIUS>', [
None, '%f', False,
'Accuracy, Radial solver: Full potential limit per atom (in Bohr radii); at points closer to the nucleus, the potential is assumed spherical. Negative values indicate to use values from potential file. Values larger than the muffin tin indicate to use the muffin tin radius.'
]),
('RMAX', [
None, '%f', True,
'Accuracy, Ewald summation for Madelung potential: Max. radius in [ALATBASIS] for real space Ewald sum'
]),
('GMAX', [
None, '%f', True,
'Accuracy, Ewald summation for Madelung potential: Max. radius in 2*pi/[ALATBASIS] for reciprocal space Ewald sum'
]),
('<LLOYD>', [None, '%i', False, "Accuracy, LLoyd's formula: Set to 1 in order to use Lloyd's formula"]),
('<DELTAE>', [
None, '(%f, %f)', False,
"Accuracy, LLoyd's formula: Energy difference for derivative calculation in Lloyd's formula"
]),
('<TOLRDIF>', [
None, '%e', False,
'Accuracy, Virtual atoms: For distance between scattering-centers smaller than [<TOLRDIF>], free GF is set to zero. Units are Bohr radii.'
]),
('<RMTCORE>', [
None, '%f', False,
'Accuracy: Muffin tin radium in Bohr radii for each atom site. This sets the value of RMT used internally in the KKRcode. Needs to be smaller than the touching RMT of the cells. In particular for structure relaxations this should be kept constant.'
]),
('NMIN', [
None, '%i', False,
'Accuracy: Minimal number of point per shape function panel. Only used by voronoi code in shape function generation.'
]),
('POT_NS_CUTOFF', [
None, '%f', False,
'Accuracy: non-spherical cutoff for potential at the end of the iteration (defaults to 0.1*qbound if not set).'
]),
('<MTWAL>', [
None, '%f', False,
'Accuracy: Muffin tin weight in alat units for each site. Overwritten by the findsize run option!'
]),
('<LFMTWAL>', [
None, '%f', False,
'Accuracy: Muffin tin weight in alat units for each site in the left continuation region (INTERFACE=T).'
]),
('<RTMTWAL>', [
None, '%f', False,
'Accuracy: Muffin tin weight in alat units for each site in the right continuation region (INTERFACE=T).'
]),
('<MTWAU>', [
None, '%f', False,
'Accuracy: Muffin tin weight in atomic units for each site. Overwritten by the findsize run option!'
]),
('<LFMTWAU>', [
None, '%f', False,
'Accuracy: Muffin tin weight in alat units for each site in the left continuation region (INTERFACE=T).'
]),
('<RTMTWAU>', [
None, '%f', False,
'Accuracy: Muffin tin weight in alat units for each site in the right continuation region (INTERFACE=T).'
]),
# scf cycle
('NSTEPS', [
None, '%i', False,
'Self-consistency control: Max. number of self-consistency iterations. Is reset to 1 in several cases that require only 1 iteration (DOS, Jij, write out GF).'
]),
('IMIX', [
None, '%i', False,
"Self-consistency control: Mixing scheme for potential. 0 means straignt (linear) mixing, 3 means Broyden's 1st method, 4 means Broyden's 2nd method, 5 means Anderson's method"
]),
('STRMIX', [None, '%f', False, 'Self-consistency control: Linear mixing parameter Set to 0. if [NPOL]=0']),
('ITDBRY', [
None, '%i', False,
'Self-consistency control: how many iterations to keep in the Broyden/Anderson mixing scheme.'
]),
('FCM', [
None, '%f', False,
'Self-consistency control: Factor for increased linear mixing of magnetic part of potential compared to non-magnetic part.'
]),
('BRYMIX', [None, '%f', False, 'Self-consistency control: Parameter for Broyden mixing.']),
('QBOUND',
[None, '%e', False,
'Self-consistency control: Lower limit of rms-error in potential to stop iterations.']),
('NSIMPLEMIXFIRST', [
None, '%i', False,
'Self-consistency control: Number of simple mixing steps to do before starting more aggressive mixing scheme (only has effect for IMIX>3).'
]),
('DENEF_MIXSCALE', [
None, '%f', False,
'Self-consistency control: Inverse scaling factor for charge neutrality mixing, should nirmally be set to the value the denisty at EF (used only with semi-circle contour integration).'
]),
# mixing of noco angles
('SPINMIXQBOUND', [
None, '%e', False,
'Self-consistency control: threshold in degrees after which the rms of the nonco angles a assumed to not change anymore (i.e. activate fixing of all angles simultaneously)'
]),
('SPINMIXALPHA', [None, '%e', False, 'Self-consistency control: Broyden mixing factor for nonco angles']),
('SPINMIXNSIMPLE', [
None, '%i', False,
'Self-consistency control: number of simple mixing steps before Broyden spinmixing starts ( should be >=1).'
]),
('SPINMIXMEMLEN', [None, '%i', False,
'Self-consistency control: Memory length of the Broyden spin mixing']),
('<WRITE_ANGLES_ALLITER>',
[None, '%l', False, 'Self-consistency control: write out the nonco angles for all iterations']),
('<USE_BROYDEN_SPINMIX>',
[None, '%l', False, 'Self-consistency control: Use Broyden mixing for nonco angles']),
#code options
('RUNOPT', [
None, '%s%s%s%s%s%s%s%s', False,
'Running and test options: 8-character keywords in a row without spaces between them'
]),
('TESTOPT', [
None, '%s%s%s%s%s%s%s%s\n%s%s%s%s%s%s%s%s', False,
'Running and test options: optional 8-character keywords in a row without spaces between them plus a second row of the same.'
]),
('<MPI_SCHEME>', [
None, '%i', False,
'Parallelization scheme (defaults to 0 which means auto parallelization, 1=atom, 2=energy parallelization preferred).'
]),
#file names
('FILES', [
None, '%s', False,
'Filenames: Name of potential and shapefun file (list of two strings, empty string will set back to default of the one file that is supposed to be changed)'
]),
('DECIFILES', [
None, '%s', False,
'Filenames: Name of left and right decifiles (use "vacuum" name to inducate vacuum continuation)'
]),
# special options
('JIJRAD', [
None, '%f', False,
'Exchange coupling: Radius in alat which defines the cutoff for calcultion of Jij pairs'
]),
('JIJRADXY',
[None, '%f', False, 'Exchange coupling: use a cylindical cluster in which Jij pairs are searched for']),
('JIJSITEI', [
None, '%i', False,
'Exchange coupling: allow for the selection of specific sites in i in the unit cell, which should be considered in the calculation (default: all sites)'
]),
('JIJSITEJ', [
None, '%i', False,
'Exchange coupling: allow for the selection of specific sites in j in the unit cell, which should be considered in the calculation (default: all sites)'
]),
('EFSET',
[None, '%f', False, 'Set Fermi level (in voronoi of the jellium starting potential) to this value.']),
# Bogoliubov de Gennes mode:
('<USE_BDG>', [
None, '%l', False,
'Superconductivity: Activate Bogoliubov de Gennes (BdG) mode. Attention: needs Chebychev solver!'
]),
('<DELTA_BDG>',
[None, '%f', False,
'Superconductivity: Starting value of BdG coupling constant in Ry (defaults to 1e-4)']),
('<LAMBDA_BDG>',
[None, '%f', False, 'Superconductivity: Electron-phonon coupling parameter in Ry (defaults to 1.0)']),
('<LM_SCALE_BDG>', [
None, '%f', False,
'Superconductivity: Scaling factor for lambda_BdG on some L channels (e.g. used to get more structure into BdG matrix. Defaults to 1.0)'
]),
('<AT_SCALE_BDG>', [
None, '%f', False,
'Superconductivity: Scaling factor for lambda_BdG (e.g. used to deactivate BdG coupling in some layers by setting the value to 0)'
]),
('<PHASE_BDG>',
[None, '%f', False, 'Superconductivity: Atom dependent phase factor for superconducting coupling.']),
('<MIXFAC_BDG>', [
None, '%f', False,
'Superconductivity: Mixing factor used in the mixing of the BdG Delta (defaults to 0.1)'
]),
('<MIXFAC_BDG_BRY>', [
None, '%f', False,
'Superconductivity: Mixing factor used in the Broyden mixing of the BdG Delta (defaults to value of <MIXFAC_BDG>)'
]),
('<NINIT_BROYDEN_BDG>', [
None, '%i', False,
'Superconductivity: Number of simple mixing steps before Broyden for BdG Delta starts (defaults to 1).'
]),
('<MEMLEN_BROYDEN_BDG>',
[None, '%i', False, 'Superconductivity: Memory length of Broyden mixing (defaults to 20)']),
('<TEMP_BDG>', [
None, '%f', False,
'Superconductivity: Smearing temperature for the calculation of the anomalous density (used to calculate Tc, defaults to 0).'
]),
('<USE_E_SYMM_BDG>', [
None, '%l', False,
'Superconductivity: Use only the ee block in the contour integration and mirror the results for the hh block (works only for Temp_BdG=0, defaults to False)'
]),
('<WRITE_ALL_DENLM>', [
None, '%l', False,
'Superconductivity: Triggers writeout of all den_lm_ir files that contain the anomalous density (usually writeout is only done for atoms with lambda>0).'
]),
('<CUSTOM_TESTSTRING>',
[None, '%s', False, 'Superconductivity: String input for some test options with BdG']),
# misc
('IM_E_CIRC_MIN', [
None, '%f', False,
'Minimal imaginary part (for energy point closest to EF) in semi-circular contour (needs USE_SEMI_CIRCLE_CONTOUR to become active.'
]),
('MAX_NUM_KMESH', [
None, '%i', False,
'Maximal number of differet k-meshes used to coarsen the BZ integration at elevated imaginary parts of the energy.'
]),
('WFAC_RENORM', [
None, '%f', False,
'Renormalization factor for energy integration weights (can be used to shift the Fermi level around).'
]),
('NQDOSMAXPOINTS', [None, '%i', False, 'Max number of q-points per batch.']),
# array dimensions
('NSHELD', [None, '%i', False, 'Array dimension: number of shells (default: 300)']),
('IEMXD', [None, '%i', False, 'Array dimension: number of energy points (default: 101)']),
('IRID', [None, '%i', False, 'Array dimension: number of radial points']),
('IPAND', [None, '%i', False, 'Array dimension: number of shapefunction panels']),
('NPRINCD',
[None, '%i', False, 'Array dimension: number of layers in each principle layer (decimation technique).']),
('KPOIBZ', [None, '%i', False, 'Array dimension: Max number of k-points in IBZ']),
('NATOMIMPD', [None, '%i', False, 'Array dimension: needed for Jij']),
# new style run options
('<CALC_GF_EFERMI>',
[None, '%l', False, "Run option: calculation of cluster Green function at E Fermi (former: 'GF-EF')"]),
('<SET_CHEBY_NOSPEEDUP>', [
None, '%l', False,
"Run option: always calculate irregular solution in Chebychev solver (even if not needed) (former: 'norllsll')"
]),
('<SET_CHEBY_NOSOC>',
[None, '%l', False, "Run option: set SOC strength to 0 for all atoms (former: 'NOSOC')"]),
('<DECOUPLE_SPIN_CHEBY>', [
None, '%l', False,
'Run option: decouple spin matrices in Chebychev solver neglecting SOC and for collinear calculations only'
]),
('<CALC_COMPLEX_BANDSTRUCTURE>',
[None, '%l', False, "Run option: complex band structure (former: 'COMPLEX')"]),
('<CALC_EXCHANGE_COUPLINGS>',
[None, '%l', False, "Run option: calculate magnetic exchange coupling parameters (former: 'XCPL')"]),
('<CALC_EXCHANGE_COUPLINGS_ENERGY>',
[None, '%l', False, "Run option: write energy-resolved Jij-files also if npol/=0 (former: 'Jijenerg')"]),
('<CALC_GMAT_LM_FULL>', [
None, '%l', False,
"Run option: calculate all lm-lm components of systems greens function and store to file `gflle` (former: 'lmlm-dos')"
]),
('<DIRAC_SCALE_SPEEFOFLIGHT>',
[None, '%l', False, "Run option: scale the speed of light for Dirac solver (former: 'CSCALE')"]),
('<DISABLE_CHARGE_NEUTRALITY>', [
None, '%l', False,
"Run option: no charge neutrailty required: leaving Fermi level unaffected (former: 'no-neutr')"
]),
('<DISABLE_PRINT_SERIALNUMBER>', [
None, '%l', False,
"Run option: deactivate writing of serial number and version information to files (for backwards compatibility) (former: 'noserial')"
]),
('<DISABLE_REFERENCE_SYSTEM>',
[None, '%l', False, "Run option: deactivate the tight-binding reference system (former: 'lrefsysf')"]),
('<DISABLE_TMAT_SRATRICK>',
[None, '%l', False, "Run option: deactivate SRATRICK in solver for t-matirx (former: 'nosph')"]),
('<FIX_NONCO_ANGLES>', [
None, '%l', False,
"Run option: fix direction of non-collinear magnetic moments (Chebychev solver) (former: 'FIXMOM')"
]),
('<FORMATTED_FILE>', [
None, '%l', False,
"Run option: write files ascii-format. only effective with some other write-options (former: 'fileverb')"
]),
('<FORCE_BZ_SYMM>', [
None, '%l', False,
'Run option: force using symmetries of the Brillouin zone (effective only for the Chebychev solver, should not be used with SOC!)'
]),
('<IMPURITY_OPERATOR_ONLY>', [
None, '%l', False,
"Run option: only for `write_pkkr_operators`: disable costly recalculation of host operators (former: 'IMP_ONLY')"
]),
('<MODIFY_SOC_DIRAC>', [None, '%l', False, "Run option: modify SOC for Dirac solver (former: 'SOC')"]),
('<NO_MADELUNG>', [
None, '%l', False,
"Run option: do not add some energy terms (coulomb, XC, eff. pot.) to total energy (former: 'NoMadel')"
]),
('<NONCOBFIELD>', [None, '%l', False,
'Run option: use non-collinear exteranl fields read from bfield.dat']),
('<PRINT_GIJ>',
[None, '%l', False, "Run option: print cluster G_ij matrices to outfile (former: 'Gmatij')"]),
('<PRINT_GMAT>', [None, '%l', False, "Run option: print Gmat to outfile (former: 'Gmat')"]),
('<PRINT_ICKECK>',
[None, '%l', False, "Run option: enable test-output of ICHECK matrix from gfmask (former: 'ICHECK')"]),
('<PRINT_KMESH>', [None, '%l', False, "Run option: output of k-mesh (former: 'k-net')"]),
('<PRINT_KPOINTS>', [None, '%l', False, "Run option: print k-points to outfile (former: 'BZKP')"]),
('<PRINT_PROGRAM_FLOW>',
[None, '%l', False, "Run option: monitor the program flow in some parts of the code (former: 'flow')"]),
('<PRINT_RADIAL_MESH>',
[None, '%l', False, "Run option: write mesh information to output (former: 'RMESH')"]),
('<PRINT_REFPOT>', [None, '%l', False, "Run option: test output of refpot (former: 'REFPOT')"]),
('<PRINT_TAU_STRUCTURE>', [
None, '%l', False,
"Run option: write extensive information about k-mesh symmetrization and structure of site-diagonal tau matrices to output (former: 'TAUSTRUC')"
]),
('<PRINT_TMAT>', [None, '%l', False, "Run option: print t-matrix to outfile (former: 'tmat')"]),
('<RELAX_SPINANGLE_DIRAC>', [
None, '%l', False,
"Run option: relax the spin angle in a SCF calculation [only DIRAC mode] (former: 'ITERMDIR')"
]),
('<SEARCH_EFERMI>', [
None, '%l', False,
"Run option: modify convergence parameters to scan for fermi energy only (to reach charge neutrality). (former: 'SEARCHEF')"
]),
('<SET_GMAT_TO_ZERO>',
[None, '%l', False, "Run option: set GMAT=0 in evaluation of density (former: 'GMAT=0')"]),
('<SET_EMPTY_SYSTEM>',
[None, '%l', False, "Run option: set potential and nuclear charge to zero (former: 'zeropot')"]),
('<SET_KMESH_LARGE>',
[None, '%l', False, "Run option: set equal k-mesh (largest) for all energy points (former: 'fix mesh')"]),
('<SET_KMESH_SMALL>',
[None, '%l', False, "Run option: set equal k-mesh (smallest) for all energy points (former: 'fix4mesh')"]),
('<SET_TMAT_NOINVERSION>', [
None, '%l', False,
"Run option: do not perform inversion to get msst = Delta t^-1, but msst = Delta t. (former: 'testgmat')"
]),
('<SIMULATE_ASA>', [
None, '%l', False,
"Run option: set non-spherical potential to zero in full-potential calculation with Chebychev solver (former: 'simulasa')"
]),
('<SLOW_MIXING_EFERMI>', [
None, '%l', False,
"Run option: renormalize Fermi-energy shift by mixing factor during mixing (former: 'slow-neu')"
]),
('<STOP_1A>', [None, '%l', False, "Run option: stop after main1a (former: 'STOP1A')"]),
('<STOP_1B>', [None, '%l', False, "Run option: stop after main1b (former: 'STOP1B')"]),
('<STOP_1C>', [None, '%l', False, "Run option: stop after main1c (former: 'STOP1C')"]),
('<SYMMETRIZE_GMAT>',
[None, '%l', False,
"Run option: use symmetrization [G(k) + G(-k)]/2 in k-point loop (former: 'symG(k)')"]),
('<SYMMETRIZE_POTENTIAL_CUBIC>', [
None, '%l', False,
"Run option: keep only symmetric part of potential (L=1,11,21,25,43,47). (former: 'potcubic')"
]),
('<SYMMETRIZE_POTENTIAL_MADELUNG>', [
None, '%l', False,
"Run option: symmetrize potential in consistency to madelung potential (former: 'potsymm')"
]),
('<TORQUE_OPERATOR_ONLYMT>', [
None, '%l', False,
"Run option: for torque operator: include only the part within the muffin tin (former: 'ONLYMT')"
]),
('<TORQUE_OPERATOR_ONLYSPH>', [
None, '%l', False,
"Run option: for torque operator: include only the spherically symmetric part (former: 'ONLYSPH')"
]),
('<USE_CHEBYCHEV_SOLVER>', [None, '%l', False,
"Run option: use the Chebychev solver (former: 'NEWSOSOL')"]),
('<USE_COND_LB>', [
None, '%l', False,
"Run option: perform calculation of conductance in Landauer-Büttiker formalism (former: 'CONDUCT')"
]),
('<USE_CONT>',
[None, '%l', False, "Run option: no usage of embedding points. NEMB is set to 0. (former: 'CONT')"]),
('<USE_DECI_ONEBULK>', [
None, '%l', False,
"Run option: in case of decimation: use same bulk on right and left. Speeds up calculations. (former: 'ONEBULK')"
]),
('<USE_DECIMATION>',
[None, '%l', False,
"Run option: use Decimation technique for semi-infinite systems (former: 'DECIMATE')"]),
('<USE_EWALD_2D>', [
None, '%l', False,
"Run option: use 2D ewald sum instead of 3D sum (Attention: does not work always!) (former: 'ewald2d')"
]),
('<USE_FULL_BZ>', [
None, '%l', False,
"Run option: use full Brillouin zone, i.e. switch off symmetries for k-space integration (former: 'fullBZ')"
]),
('<USE_LDAU>',
[None, '%l', False, "Run option: use LDA+U as exchange-correlation potential (former: 'LDA+U')"]),
('<USE_LLOYD>', [
None, '%l', False,
"Run option: use Lloyds formula to correct finite angular momentum cutoff (former: 'LLOYD')"
]),
('<USE_QDOS>',
[None, '%l', False,
"Run option: writes out qdos files for band structure calculations. (former: 'qdos')"]),
('<USE_READCPA>', [None, '%l', False, "Run option: read cpa t-matrix from file (former: 'readcpa')"]),
('<USE_RIGID_EFERMI>', [
None, '%l', False,
"Run option: keep the Fermi energy fixed during self-consistency (former: 'rigid-ef')"
]),
('<USE_SEMICORE>', [None, '%l', False, "Run option: use semicore contour (former: 'SEMICORE')"]),
('<USE_SEMI_CIRCLE_CONTOUR>',
[None, '%l', False, 'Run option: use semi-circular energy contour (set number of points with NPT1)']),
('<USE_SPHERICAL_POTENTIAL_ONLY>',
[None, '%l', False, "Run option: keeping only spherical component of potential (former: 'Vspher')"]),
('<USE_VIRTUAL_ATOMS>', [None, '%l', False, "Run option: add virtual atoms (former: 'VIRATOMS')"]),
('<WRITE_BDG_TESTS>',
[None, '%l', False, "Run option: test options for Bogouliubov-deGennes (former: 'BdG_dev')"]),
('<WRITE_DOS>',
[None, '%l', False, "Run option: write out DOS files in any case (also if npol!=0) (former: 'DOS')"]),
('<WRITE_DOS_LM>', [
None, '%l', False,
"Run option: write out DOS files with decomposition into l and m components (former: 'lmdos')"
]),
('<WRITE_GMAT_PLAIN>',
[None, '%l', False, "Run option: write out Green function as plain text file (former: 'GPLAIN')"]),
('<WRITE_GREEN_HOST>', [
None, '%l', False,
"Run option: write green function of the host to file `green_host` (former: 'WRTGREEN')"
]),
('<WRITE_GREEN_IMP>',
[None, '%l', False, "Run option: write out impurity Green function to GMATLL_GES (former: 'GREENIMP')"]),
('<WRITE_COMPLEX_QDOS>', [None, '%l', False,
"Run option: write complex qdos to file (former: 'compqdos')"]),
('<WRITE_CPA_PROJECTION_FILE>',
[None, '%l', False, "Run option: write CPA projectors to file (former: 'projfile')"]),
('<WRITE_DECI_POT>',
[None, '%l', False, "Run option: write decimation-potential file (former: 'deci-pot')"]),
('<WRITE_DECI_TMAT>',
[None, '%l', False, "Run option: write t-matrix to file 'decifile' (former: 'deci-out')"]),
('<WRITE_DENSITY_ASCII>',
[None, '%l', False, "Run option: write density rho2ns to file densitydn.ascii (former: 'den-asci')"]),
('<WRITE_ENERGY_MESH>',
[None, '%l', False, "Run option: write out the energy mesh to file `emesh.scf` (former: 'EMESH')"]),
('<WRITE_GENERALIZED_POTENTIAL>', [
None, '%l', False,
"Run option: write potential in general format. Usually prepares for running the VORONOI program. (former: 'GENPOT')"
]),
('<WRITE_GMAT_FILE>', [None, '%l', False, "Run option: write GMAT to file (former: 'gmatfile')"]),
('<WRITE_GREF_FILE>', [None, '%l', False, "Run option: write GREF to file (former: 'greffile')"]),
('<WRITE_GMAT_ASCII>',
[None, '%l', False, "Run option: write GMAT to formatted file `gmat.ascii` (former: 'gmatasci')"]),
('<WRITE_KKRIMP_INPUT>',
[None, '%l', False, "Run option: write out files for KKRimp-code (former: 'KKRFLEX')"]),
('<WRITE_KKRSUSC_INPUT>',
[None, '%l', False, "Run option: write out files for KKRsusc-code (former: 'KKRSUSC')"]),
('<WRITE_KPTS_FILE>',
[None, '%l', False, "Run option: write and read k-mesh to/from file `kpoints` (former: 'kptsfile')"]),
('<WRITE_LLOYD_CDOS_FILE>',
[None, '%l', False, "Run option: write Lloyd array to file (former: 'wrtcdos')"]),
('<WRITE_LLOYD_DGREF_FILE>',
[None, '%l', False, "Run option: write Lloyd array to file (former: 'wrtdgref')"]),
('<WRITE_LLOYD_DTMAT_FILE>',
[None, '%l', False, "Run option: write Lloyd array to file (former: 'wrtdtmat')"]),
('<WRITE_LLOYD_FILE>',
[None, '%l', False, "Run option: write several Lloyd-arrays to files (former: 'llyfiles')"]),
('<WRITE_LLOYD_G0TR_FILE>',
[None, '%l', False, "Run option: write Lloyd array to file (former: 'wrtgotr')"]),
('<WRITE_LLOYD_TRALPHA_FILE>',
[None, '%l', False, "Run option: write Lloyd array to file (former: 'wrttral')"]),
('<WRITE_MADELUNG_FILE>', [
None, '%l', False,
"Run option: write madelung summation to file 'abvmad.unformatted' instead of keeping it in memory (former: 'madelfil')"
]),
('<WRITE_PKKR_INPUT>',
[None, '%l', False, "Run option: write out files for Pkkprime-code (former: 'FERMIOUT')"]),
('<WRITE_PKKR_OPERATORS>', [
None, '%l', False,
"Run option: for Fermi-surface output: calculate various operators in KKR basis. (former: 'OPERATOR')"
]),
('<WRITE_POTENTIAL_TESTS>', [
None, '%l', False,
"Run option: write potential at different steps in main2 to different files (former: 'vintrasp' and 'vpotout')"
]),
('<WRITE_RHO2NS>', [
None, '%l', False,
"Run option: write array rho2ns into file out_rhoval (from main1c) and out_rhotot (from main2) (former: 'RHOVALTW' and 'RHOVALW')"
]),
('<WRITE_RHOQ_INPUT>', [
None, '%l', False,
"Run option: write out files needed for rhoq module (Quasiparticle interference) (former: 'rhoqtest')"
]),
('<WRITE_TMAT_FILE>', [None, '%l', False, "Run option: write t-matix to file (former: 'tmatfile')"]),
('<WRITE_TB_COUPLING>', [
None, '%l', False,
"Run option: write couplings in tight-binging reference system to file `couplings.dat` (former: 'godfrin')"
]),
('<CALC_WRONSKIAN>', [
None, '%l', False,
'Run option: calculate the wronskian relations of first and second kind for the wavefunctions (see PhD Bauer pp 48)'
]),
('<CALC_CHI_NS>', [
None, '%l', False,
'Run option: calculate the radially averaged anomalous density matrix and write to `den_lm_ir_ns.npy` file. Only for BdG mode.'
]),
# end new style run options
])
# keywords for KKRimp (all allowed settings for config file)
self._DEFAULT_KEYS_KKRIMP = dict([ # complete list of keywords, detault all that are not mandatory to None
# chemistry
('NSPIN',
[None, '%i', False, 'Chemistry, Atom types: Number of spin directions in potential. Values 1 or 2']),
('KVREL', [
None, '%i', False,
'Chemistry, Atom types: Relativistic treatment of valence electrons. Takes values 0 (Schroedinger), 1 (Scalar relativistic), 2 (Dirac ; works only in ASA mode)'
]),
('XC', [
None, '%s', False,
'Chemistry, Exchange-correlation: Type of exchange correlation potential. Takes values 0 (LDA, Moruzzi-Janak-Williams), 1 (LDA, von Barth-Hedin), 2 (LDA, Vosko-Wilk-Nussair), 3 (GGA, Perdew-Wang 91), 4 (GGA, PBE), 5 (GGA, PBEsol)'
]),
# external fields
('HFIELD', [
None, '%f %i', False,
'External fields: Value of an external magnetic field in the first iteration. Works only with LINIPOL, XINIPOL'
]),
# accuracy
('INS', [
None, '%i', False,
'Accuracy, Radial solver: Takes values 0 for ASA and 1 for full potential Must be 0 for Munich Dirac solver ([KREL]=2)'
]),
('ICST', [None, '%i', False, 'Accuracy, Radial solver: Number of iterations in the radial solver']),
('RADIUS_LOGPANELS', [
None, '%f', False,
'Accuracy, Radial solver: Radius up to which log-rule is used for interval width. Used in conjunction with runopt NEWSOSOL'
]),
('NPAN_LOG', [
None, '%i', False,
'Accuracy, Radial solver: Number of intervals from nucleus to [R_LOG] Used in conjunction with runopt NEWSOSOL'
]),
('NPAN_EQ', [
None, '%i', False,
'Accuracy, Radial solver: Number of intervals from [R_LOG] to muffin-tin radius Used in conjunction with runopt NEWSOSOL'
]),
('NCHEB', [
None, '%i', False,
'Accuracy, Radial solver: Number of Chebyshev polynomials per interval Used in conjunction with runopt NEWSOSOL'
]),
('NPAN_LOGPANELFAC', [None, '%i', False, 'Accuracy, Radial solver: division factor logpanel']),
('RADIUS_MIN', [None, '%i', False, 'Accuracy, Radial solver: ']),
('NCOLL', [None, '%i', False, 'Accuracy, Radial solver: use nonco_angles solver (1/0)']),
('SPINORBIT', [None, '%i', False, 'Accuracy, Radial solver: use SOC solver (1/0)']),
# scf cycle
('SCFSTEPS', [
None, '%i', False,
'Self-consistency control: Max. number of self-consistency iterations. Is reset to 1 in several cases that require only 1 iteration (DOS, Jij, write out GF).'
]),
('IMIX', [
None, '%i', False,
"Self-consistency control: Mixing scheme for potential. 0 means straignt (linear) mixing, 3 means Broyden's 1st method, 4 means Broyden's 2nd method, 5 means Anderson's method"
]),
('IMIXSPIN', [
None, '%i', False,
'Self-consistency control: Mixing scheme for magnetic moments. 0 means straignt (linear) mixing, >1 means Broyden mixing for spin moment directions.'
]),
('MIXFAC', [None, '%f', False, 'Self-consistency control: Linear mixing parameter Set to 0. if [NPOL]=0']),
('ITDBRY', [
None, '%i', False,
'Self-consistency control: how many iterations to keep in the Broyden/Anderson mixing scheme.'
]),
('BRYMIX', [None, '%f', False, 'Self-consistency control: Parameter for Broyden mixing.']),
('QBOUND',
[None, '%e', False,
'Self-consistency control: Lower limit of rms-error in potential to stop iterations.']),
('QBOUND_LDAU',
[None, '%e', False, 'Self-consistency control: Lower limit of rms-error for LDA+U potential.']),
('NSIMPLEMIXFIRST', [
None, '%i', False,
'Self-consistency control: Number of simple mixing steps to do before starting more aggressive mixing scheme (only has effect for IMIX>3).'
]),
('TOL_ALAT_CHECK',
[None, '%e', False, 'Consistency check: tolerance for alat comparison (defaults to 1e-12 if not set).']),
#code options
('RUNFLAG', [None, '%s', False, 'Running and test options: e.g. lmdos, GBULKtomemory, LDA+U, SIMULASA']),
('TESTFLAG', [None, '%s', False, 'Running and test options: e.g. tmatnew, noscatteringmoment']),
('CALCFORCE', [None, '%i', False, 'Calculate forces']),
('CALCJIJMAT', [None, '%i', False, 'Calculate Jijmatrix']),
('CALCORBITALMOMENT', [None, '%i', False, 'Calculate orbital moment (SOC solver only, 0/1)']),
])
if 'params_type' in kwargs:
self.__params_type = kwargs.pop('params_type')
else:
#parameter are set for kkr or voronoi code? (changes mandatory flags)
self.__params_type = 'kkr' #default value, also possible: 'voronoi', 'kkrimp'
valid_types = ['kkr', 'voronoi', 'kkrimp']
if self.__params_type not in valid_types:
raise ValueError(f'params_type can only be one of {valid_types} but got {self.__params_type}')
# initialize keywords dict
if self.__params_type == 'kkrimp':
keyw = self._create_keywords_dict_kkrimp(**kwargs)
else:
keyw = self._create_keywords_dict(**kwargs)
#values of keywords:
self.values = {}
#formatting info
self.__format = {}
#mandatory flag
self._mandatory = {}
# description of each key
self.__description = {}
self.__listargs = None
self.__special_formatting = None
for key, val in keyw.items():
self.values[key] = val[0]
self.__format[key] = val[1]
self._mandatory[key] = val[2]
self.__description[key] = val[3]
# update mandatory set for voronoi, kkrimp cases
self._update_mandatory()
@classmethod
def get_KKRcalc_parameter_defaults(cls, silent=False):
"""
set defaults (defined in header of this file) and returns dict, kkrparams_version
"""
p = cls()
for key, val in __kkr_default_params__.items():
p.set_value(key, val, silent=silent)
return dict(p.get_set_values()), __version__
def get_dict(self, group=None, subgroup=None):
"""
Returns values dictionary.
Prints values belonging to a certain group only if the 'group' argument
is one of the following: 'lattice', 'chemistry', 'accuracy',
'external fields', 'scf cycle', 'other'
Additionally the subgroups argument allows to print only a subset of
all keys in a certain group. The following subgroups are available.
- in 'lattice' group '2D mode', 'shape functions'
- in 'chemistry' group 'Atom types', 'Exchange-correlation', 'CPA mode', '2D mode'
- in 'accuracy' group 'Valence energy contour', 'Semicore energy contour',
'CPA mode', 'Screening clusters', 'Radial solver',
'Ewald summation', 'LLoyd'
"""
out_dict = self.values
#check for grouping
group_searchstrings = {
'lattice': 'Description of lattice',
'chemistry': 'Chemistry',
'external fields': 'External fields:',
'accuracy': 'Accuracy',
'scf cycle': 'Self-consistency control:',
'other': ['Running and test options', 'Name of potential and shapefun file']
}
subgroups_all = {
'lattice': ['2D mode', 'shape functions'],
'chemistry': ['Atom types', 'Exchange-correlation', 'CPA mode', '2D mode'],
'accuracy': [
'Valence energy contour', 'Semicore energy contour', 'CPA mode', 'Screening clusters', 'Radial solver',
'Ewald summation', 'LLoyd'
]
}
if group in ['lattice', 'chemistry', 'accuracy', 'external fields', 'scf cycle', 'other']:
print(f'Returning only values belonging to group {group}')
tmp_dict = {}
for key in out_dict:
desc = self.__description[key]
key_in_group = False
if group_searchstrings[group] != 'other':
if group_searchstrings[group] in desc:
key_in_group = True
else:
if group_searchstrings[group][0] in desc or group_searchstrings[group][1] in desc:
key_in_group = True
if key_in_group:
tmp_dict[key] = self.values[key]
#check for subgrouping and overwrite tmp_dict accordingly
if group in ['lattice', 'chemistry', 'accuracy']:
if subgroup in subgroups_all[group]:
print(f'Restrict keys additionally to subgroup {subgroup}')
tmp_dict2 = {}
for key in tmp_dict:
desc = self.__description[key]
key_in_group = False
if subgroup in desc:
key_in_group = True
if key_in_group:
tmp_dict2[key] = self.values[key]
tmp_dict = tmp_dict2
# overwrite out_dict with tmp_dict
out_dict = tmp_dict
return out_dict
def _get_type_from_string(self, fmtstr):
"""Helper function of get_type"""
if 'f' in fmtstr or 'e' in fmtstr:
keytype = float
elif 'i' in fmtstr:
keytype = int
elif 'l' in fmtstr:
keytype = bool
elif 's' in fmtstr:
keytype = str
else:
print('Error: type of keyvalue not found:', fmtstr)
raise TypeError(f'Type not found for format string: {fmtstr}')
return keytype
def get_type(self, key):
"""Extract expected type of 'key' from format info"""
try:
fmtstr = self.__format[key]
except KeyError:
fmtstr = None
if fmtstr is not None:
# simple format or complex pattern
simplefmt = True
if fmtstr.count('%') > 1:
simplefmt = False
if simplefmt:
keytype = self._get_type_from_string(fmtstr)
else:
fmtlist = fmtstr.replace('\n', '').replace(' ', '').split('%')[1:]
keytype = []
for fmtstr in fmtlist:
keytype.append(self._get_type_from_string(fmtstr))
return keytype
return None
def _check_valuetype(self, key):