-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuser_manual.txt
1701 lines (1322 loc) · 75.3 KB
/
user_manual.txt
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
* * * User Manual for Amolqc * * *
This manual describes tersely most of the options
of the Amolqc program and its utilities. For the
appropriate usage check the examples and tests.
Contents:
1. Usage
2. Description of the infile (.in)
3. Description of the wave function file (.wf)
4. Utility programs
4.1 runConvertBasisFile.py (converts basis sets from emsl or gaussian format to Amolqc format)
5. Amolqc basis set library
Note: throughout this manual, [xxx] denotes an optional parameter xxx where
a default value is supplied if xxx is not given
Alternative values are indicated by '|', thus [a|b] means 'a' or 'b' can be given.
1. Usage
=========
Running Amolqc requires one environment variable pointing to the (installation) directory "Amolqc"
(containing the bib and cmds directories)
export AMOLQC=/path/to/Amolqc
usage:
/path/to/amolqc infile
or
/path/to/amolqc infile.in
where "infile.in" exists in the current directory and contains commands including a
line '$wf(read, file=name.wf)' requiring a wave function file
'name.wf' in the same directory. No output is generated. Instead, the output
is written into the file 'infile.out'. If this file exists output is written to 'infile.out-1'.
If this exists to 'infile.out-2' and so on (up to 99).
Many commands use the "basename", i.e. "infile", with different suffixes for structured data output.
Some commands require access to files of the Amolqc installation (the basis data in 'bib' and the macro
commands in 'cmds'). These files are
found relative to the contents of the environment variable $AMOLQC that has to
be set to the root of the installation (usually named 'Amolqc' as well).
The environment variable is set with
export AMOLQC=/path/to/Amolqc-directory
in bash shells. Put this line into your .profile or .bashrc and in your queue job script
prior to the amolqc command.
2. Description of infile (.in file)
===================================
Infile contains commands of the structure
$name(options)
or comment lines starting with "!"
The commands are executed in order (but see loop commands below).
$gen and $wf have to precede any qmc command.
In this manual optional values are given with "[optional]" and
alternative values with "|", e.g.
[[no]splineaos] means: either "nosplineaos" or "splineaos" may be given here,
but neither is necessary (because there is a default value)
[splineaos|nosplineaos] means: the same alternative, but one of the two has to
be given.
[[splineaos|nosplineaos]] means: the same as the first example.
Besides the commands listed below, a loop structure and a macro expansion
exists:
2.1 Loop structure:
$begin_loop(count=n)
...
[$exit_if(condition[,stop])]
[$stop_if(condition)]
...
$end_loop
The commands between $begin_loop and $end_loop are carried out n times.
Optionally, the $exit_if command allows exiting the loop and continuing after
$end_loop is 'condition' is fulfilled. If the keyword 'stop' is given, the
job is terminated. The same is achieved with $stop_if(condition).
conditions: [energy<ddd|energy>ddd|variance<ddd|variance>ddd]
ddd is a real number. More than one condition can be given. They are combined
with "or". Energy and variance values used in the comparison are the final result of
the last "$qmc" or "$optimize_parameters" command.
The $exit_if/$stop_if command is useful to terminate divergent parameter optimizations.
2.2 Macro expansion:
If a command "$command" is not implemented, it is checked if a macro command
file with the name "command.cmd" exists in directory cmds. If it does the
content of command.cmd replaces $command. IF arguments are given, the
corresponding arguments in command.cmd are replaced with the new values
(but: command replacement happens only in command lines beginning with "x")
The macro expansion (with replacements) is printed in the output file.
If no file command.cmd exists the program aborts with an error message.
Macro commands are intended to be written by the user. A few are provided:
$generate_sample(size=100) : generates an independent sample of size 100
$generate_walker() : generates an independent sample of size=1
$jas_varmin_fast() : jastrow variance minimization, see examples
$jas_varmin_safe() : if 'fast' fails
$jas_emin_lin() : linear energy minimization, see examples
$jas_emin_lm() : Levenber-Marquardt energy minimization
$jas_emin_nr() : Newton-Raphson energy minimization
$jas_emin_snr() : stabilized Newton-Raphson energy minimization
2.3 infile commands in alphabetical order:
Note the required order:
$gen()
$wf()
[$ecp()]
[further commands]
Options for commands are of the type "keyword" or "keyword=value". If a value is given
this denotes the default value (hopefully).
keyword=dd means: value is a double precision number
keyword=nn means: value is an integer
====================================================================================
$analyze_refs
-------------
analyzes the electron configurations from a ref file.
Prints out function value (-ln(psi**)), E_loc and V_pot
(both are NaN at singularities, E_loc is finite only if
singularity is removed exactly.)
Prints coordinates, gradients and electrons at nuclei
Prints eigenvalues
TODO: run optionally Nelder/Mead with all coordinates to check is true minimum
ref_file=name.ref : ref file name must be given
ref_n=0 : 0: analyze all i,1 refs with i=1,...; n: analyze all n,i refs
maxrefs=100 : do not analyze more than maxrefs refs.
verbose=2 : control output
nuc_thresh=0.002 : identify all electrons closer to a nucleus as being at the nuc
bond_thresh=0.4 : identify all electrons closer than bond_thresh as bond electron
core_thresh=2.0 : identify all electrons ... as core electron
h=0.001 : denominator for three-point numerical deriv (from grad) in Hessian
eigenvec : calculate eigenvectors in addition to eigenvalues of Hessian (store at basename.ev)
calc_diff : calculate differences to all previous references
excl_file=file : for calc_diff: exclusion file see $init_max_search
(This uses only the MASTER node)
====================================================================================
$begin_subroutine(name=sub_name)
[command lines]
$end_subroutine
---------------
defines a subroutine. Most commands are allowed in subroutines. Subroutines must be
defined prior to their usage. They are called by their name with the $call_subroutine()
command or from within another command (see $optimize_parameters).
Note that the subroutine mechanism is very simple. No subroutines are allowed in subroutines.
====================================================================================
$calculate_density
-------------------------------
calculates the single determinant Slater density at a given position.
x=dd (default 0.0) : x position
y=dd (default 0.0) : y position
z=dd (default 0.0) : z position
====================================================================================
$call_subroutine(name=sub_name)
-------------------------------
calls a subroutine with the name 'sub_name',
defined before the use with $begin_subroutine and $end_subroutine
====================================================================================
$change_jastrow
---------------
new_jastrow=jt where jt is the jastrow type (sm0,sm1,sm2,sm3,sm31,sm4,sm41,
icXYZ where X,Y,Z >= 0 <=9,
deXYZ where X,Y,Z >= 0 <=9)
[params=paramFile] reading Jastrow parameters from file containing a
$jastrow .. $end block
[keep_aniso_terms] anisotropic terms are kept when changing from generic to generic jastrow
diff_ee_cusp: keyword to enable usage of different ee cusp condition for spin
like and spin unlike electron electron terms in Jastrow factor
see Chapter 3 - "Input of Jastrow Parameters" for details
same_ee_cusp: default
keyword to disable usage of different ee cusp condition for spin
like and spin unlike electron electron terms in Jastrow factor
currently not implemented
add_aniso_terms : Adds anisotropic terms to Jastrow factor
Implementation require to define Jastrow first and then add anisotropic
terms in second "change_jastrow" call
format:
$change_jastrow(add_aniso_terms,
<keyword> [additional parameters; depend on keyword used]
)
line breaks are essential
<keyword>: <type> all , <type> nuc, <type> idx
where <type>:
ao :
adds two-body (en) anisotropic terms
eenao :
adds three-body (een) anisotropic terms
eennao :
adds four-body (eenn) anisotropic terms
and
<type> all:
adds and uses all basis functions of given l
format (e.g): ao all <functions>
choice of l = s, p, d, f
must be seperated by white space in case more than one function
shall be used (e.g. "p d" or "p d f")
<type> nuc:
adds and uses all basis functions for given l and nucleus
format: <number of lines>
<function> <center> [<center1_2> ... ]
<function2> <center2> [<center2_2> ... ]
...
seperated by line breaks, only one l added in each line
(i.e. two lines needed for adding p and d functions)
<type> idx:
adds and uses given basis function (given by indicies)
format: <number of basis functions>
<index of basis function1> <index of basis function2>
seperated by white space or line break
====================================================================================
$change_parameters
------------------
type=jastrow
mode=1
2nd line: contains idx parameter value pairs.
idx1 val1 idx2 val2 ...
with the new values for the parameter vector
This command must consist of three lines (last line is ')').
=====================================================================================
$compare_sample
---------------
compares with current sample with the sample in given by a position file (.pos). Comparison
by position only, within a given threshold. Comparison is done in order!
file='name.pos' : position file
max_sample_size=nn : compare the first nn positions from pos-file (required)
threshold=1.d-6 : sample points are considered identical when d = sqrt(delta*delta) / n < threshold
verbose=0 : with 2 all d are printed
=====================================================================================
$coulomb_density
----------------
Initializes the Monte Carlo integration of the coulomb term with the
separated_electrons/2 lowest orbitals. (eg. for pure pi wave functions)
mc_steps=nn : steps for Monte Carlo integration. If 0, the separated density does not appear
in the Hamiltonian
====================================================================================
$displace_walker
----------------
Displaces the initial walker that has to be previously initialized with init_walker.
displacement=dd : displaces all electron positions by dd
dimension=dd : displaces in dimension (x,y,z)
====================================================================================
$ecp
----
initializes and turns on use of ECPs. $ecp must follow directly the $wf block.
options:
det_only: ECP localization without Jastrow factor
full_localisation: ECP localization with Jastrow factor(default)
[no_]random_rotation: use [fixed] random axis system for grid integration
cutoff=x: if given, ECP cutoff is turned on. This calculates for each atom
a cutoff radius for the non-local part. The calculated radii are shown with
verbose>=2. They are calculated as the radii where all local components are
smaller than the given cutoff value.
[full|no|nonlocal]_cutoff: Cutoff for all channels (local and non-local)
no cutoff Cutoff only for non-local channels(default)
grid_points=n: Set same integration grid points for all atoms.
grid_point_list=m: Set integration grid points for different atoms.
a n
which sets the integration grid points for atom a to n.
====================================================================================
$eigenvect_analysis
----------------
no options. This command calculates the eigenvalues and -vectors of the Hessian for
a given sample (.pos file) and writes the results into an eigenvect_analysis.yml file.
$init_max_search() has to be called before to create the psiMax object.
=====================================================================================
$eloctest
---------
tests the local energy code by calculating contributions like Jastrow, Phi to Eloc
and additionally testing the derivatives with numerical derivatives.
options: h,rule,points,derivatives,updatetest
h=x where x is a small real number (default: 1.d-5) for difference quotients
rule=n 3-point, 5-point or 7-point rule for numerical differentiation
points=n use the first n points in sample for test
derivatives: calculate derivatives numerically
updatetest: check updating electrons
====================================================================================
$gen
----
options: seed (required), verbose
verbose=[0,1,2,3,4,5,6]: standard output is 2, walker based output with 5
seed=n: initialization of random number generator (uses the seeds n,n+1,...n+nproc-1, where
nproc is the # of MPI processes)
====================================================================================
$init_basin_analysis
--------------------
activates an analysis based on a previous maximum calculation that generated a .ref file.
In this analysis, a sample that is generated on-the-fly with the next $qmc command is analyzed
(on-the-fly) after assignment of each sample point to its maximum as identified from the ref file. This
command (and a subsequent $init_max_search command) triggers the next $qmc command to do the
actual analysis "step_stride" step.
For each k of the ref data structure a mean reference structure is constructed by (weighted)
averaging over all m ("centroid"). Make sure that mmax of the preceding maxima calculation is
sufficiently large. The mean structures or centroids for each k are stored as the ref file "basename.ref".
During the on-the-fly analysis, for each sample point generated from $qmc each "step_stride" step,
at first the maximum is determined and compared using tol_sim with the centroid averaged maxima.
If the maximum corresponds to one of the first "kmax" maxima, the permutation that brings the
new maximum in (very close) coincidence to the centroid maximum, is determined. In all analyses
of this command the permuted walker is used while the original walker is untouched for the
continuation of the qmc walk. Note that electron permutations do not change psi**2, but only if
the spin coordinate is permuted as well. Here, the spin is encoded in the electron index of the
original sample walker: the order in the qmc code is first alpha, then beta, i.e. all indices <= n_alpha
(n/2 in closed shell molecules) refer to alpha electrons, all others to beta electrons.
The assignment of each sample point to a maximum allows many different types of analyses:
(1) single electron densities (sed): collect all electrons from psi**2 assigned to a certain
maximum position.
(2) electron pair analysis: analyse pairs of electrons and their spin after assignment
(3) identify permutations necessary to match reference electron arrangement after maximization
options:
cubes : write cube files (Gaussian format) for each electron (and each reference maximum)
xyz : write sample after permutation according to reference maximum
energies : do energy partitioning (possibly not working)
psi2ratio : evaluates the psi**2 ratio of sample position to maximum position
elec_pair_analysis=n : electron pair analysis
lra : left-right analysis
ref_file='file.ref' : note: for each k a mean reference structure is constructed by averaging over all m
kmax=n : use only the first n reference maxima are used (sample points with different further
maxima are discarded)
tol_sim=0.1 : see $init_max_analysis
excl_file='file' : see $init_max_analysis
cubes:
nbin=80 : nbin x nbin x nbin 3d histogram
grid=4.d0 : defines a cube [-grid,-grid] in x,y,z direction, i.e. around the origin (no default)
ax=,bx=,ay=,by=,az=,bz= : give explicit coordinates of the cube (more precisely: cuboid)
sbin=0 : creates a subcube around the center of mass of the cube data of each maximum position
with the size of 2*sbin+1 in each direction. sbin>0 enables the creation of the
subcube
(elec_pair_analysis and lra usage is to be completed)
====================================================================================
$init_max_analysis
------------------
activates an analysis for (all important) local maxima of psi**2 (with the 3n dimensional
many-electron wave function psi).
For all but the smallest molecules, the number of local maxima of psi**2 is large.
Therefore, the global maximum is only of limited interest, and the goal is to analyze
all local maxima of importance. This requires collecting (and counting) maxima according
to certain criteria (see below).
Maxima are identified as minima of f = - ln(psi**2)
The collected maxima will be written to basename.ref
The .ref file contains reference structures (usually local maxima) identified by two
indices: k and m. This is to be understood as a main list (index k) where each entry
is a sublist (index m).
$init_max_analysis only sets the parameters for collecting and analyzing the maxima. The
minimization algorithm is selected with a subsequent $init_max_search command. The
actual collection of the maxima is done in a subsequent $qmc run, where the maximization is
called after the discarded steps every "step_stride" step. (Note: the qmc walk is not changed by
the maximization steps)
The very many local maxima are collected in various ways controlled by 'max_mode'.
max_mode=[val|vst|str|pos] default: "str"
parameters: (not all used in all modes)
kmax=30 restricts length of the main list to nmax. Further data are ignored
mmax=5 restricts length of sub lists to mmax.
tol_fctn=0.001 two function values (-ln(psi**2)) are identified as the same if the differ
by less than tol_fctn
tol_same=0.01 two electron arrangements are identified as the same if the maximal distance
between two corresponding positions is less than tol_same (new: in A)
tol_sim=0.1 two electron arrangements are identified as the similar if the maximal distance
between two corresponding positions is less than tol_sim (new: in A)
sort_freq if given, sort references w.r.t. frequency (instead of value) at output (out and ref)
val: "value" mode.
main list contains local maxima sorted w.r.t the function value, i.e. -ln(psi**2).
maxima with "same" function value are collected and only counted (not stored).
tolerance "tol_fctn" defines "same". ref file contains sorted list of maxima where
the last entry has the summed count of all remaining (discarded) maxima!
sub lists are not used, i.e. m=1 for all entries.
vst: "value/structure" mode. parameters:
same as val, but now for each function value a sublist (maximal length mmax) is created.
Entries are structures that differ by more than tol_same. More precisely: a new local
maximum with the same function value is compared with all structures in the sublist by finding
the best assignment (treating alpha and beta electrons as different) and then determining the
maximal distance for all assigned electrons. If max distance is smaller than tol_same, the
count for that structure is increased. If no structure matches the new local maximum, a new
entry is added to the sublist (more than mmax are ignored)
str: "structure" mode. addtnl parameters:
excl_file=filename
main list (max size nmax) contains different "structures". Two maxima are understood as
having the same structure if they are "similar" when the spin is ignored. "Similarity" is
determined by tol_sim (max distance of two corresponding positions in bohr)
The list of structures is sorted w.r.t the function value (1st index k in ref file). For
each structure in the list a (sub)list is maintained the collects identical (same)
maxima including identical spin. Maxima are identified as the same if the maximum distance
between to corresponding positions is less than tol_same.
The sublist for each structure contains thus the spin permutations of the structure.
The sublists are also sorted w.r.t the function value.
excl_file is an optional argument. If given a file containing "electrons to be excluded"
from the determination of maximum distance (for comparison with tol_sim and tol_same).
The file is a text file with the structure
n
code1
...
coden
where n is the number of excluded positions, and "code" is a simple integer code of the form:
abbcc with
a=1: at nucleus a=2: within core a=3: along a bond a=4: between two atoms (but not along bond)
a=5: all others (i.e. lone pair)
bb and cc are two digit form of the element number (01=H, 06=C, 18=Ar, ...). for a=1,2,5 bb=00
Ex.: 10001: position at any H nucleus
30601 and 30106: position along any CH bond.
Note: The codes must be numerically sorted in ascending order!
pos: "position" mode. Parameters:
tol_simmax=tol_sim
ref_file=file_name.ref
excl_file=filename
ignore_ref_elecs=n
like in "str" mode, identical structures irrespective of spin are identified (with tol_sim). In pos
mode, however, the entries in the main structure list are read from the ref_file. More precisely,
The structure list is initialized with the entries (n=1,m=1), (2,1), ... (nmax,1) from file_name.ref.
It is useful to use file_name.ref from an "str" run, use the same tol_sim as in that run, and
restrict nmax to the interesting structures of the previous run.
In the "pos" mode all electron positions are collected
and averaged. For this a list of electron positions is constructed for each "structure". For each
new maximum all electrons are compared with the positions of the list. If an electron is closer than
tol_simmax (defaults to tol_sim) to a position in the list,
this electron is added to this position (meaning doing statistics over electron positions).
If not, a new entry in the position list is added.
All positions for each structure are printed at the end of the $find_maxima run, with std dev and
std error. They are also saved as basename.max in a format similar to the .ref format.
The ref_file is used to create the initial electron position lists, and it is used to assign electrons
of a maximum (of one structure) to the ref_file electrons, now with spin preserved. This way the two
possible position of an electron due to spin permutations are found, and thus electron pairs are
identified (because of they occupy the same two positions in closed shell molecules) if they exist.
We average over the position of each electron in the reference structure after assignment, i.e. we average
over the two possible positions of each pair. The mean is calculated with a weight proportional to
the probability (psi**2) of the local maximum relative to the global maximum (from the reference file).
The averaged positions are saved as .ref file.
This is done by comparing each electron arrangement with that of the reference
(ref_file), after renumbering
excl_file for list of excluded positions, see "str"
ignore_ref_elecs=n
$find_maxima(blocks=20,steps=200,max_iter=150,max_mode=pos,nmax=3,max_full=20,
ref_file=ethene-max1p.ref,ignore_ref_elecs=8,tol_maxdist=0.1,tol_pos=0.1,H_dist=0.1
3
3 4 6 8 11 12 15 16
3 4 6 7 11 12 13 15
3 4 5 7 11 12 14 15
)
this means: 8 electrons are ignored when determining maxdist and meandist for 3 ref structures
(see nmax=3). Each line contains the number of the electron in the reference file (here: ethene-max1.ref).
After identifying the positions using e.g. matlab, the above list of electrons assigned to the given
electrons of the reference can be constructed.
====================================================================================
$init_max_search
----------------
sets the parameters for a maximum search, either with a subsequent $maximize_sample() or
on-the-fly with a $qmc() command where 'step_stride' is set.
Use steepest_descent as reference, in particular with small 'step' and 'max_distance_all', and
bfgs with switch_step as efficient approximative maximizer. Test convergence with $maximize_sample
(and $write_sample) and $compare_sample. $maximize_walker(index) maximizes only one walker.
method=[bfgs|fire|steepest_descent|bfgst|newton] default: bfgs
max_iter=1000 : maximal number of iterations (not function evaluations!)
max_distance=dd : if given total 3n-dim step is scaled to a max of dd for the largest step of one electron
max_distance_one=dd : if given each one-electron step is cut at dd (!just for testing atm)
convergence_gradient=1.0e-4 : convergence if max(abs(gradient)) < 0.0001
convergence_value=1.0e-3 : convergence if the value of the function to be minimized is below a certain threshold.
numerical_denominator=1.0e-5 : numeric_denominator for the numerical evaluation of the gradient using the
two-point formula.
save_opt_paths : triggers saving the maximization path in the .ref format. Data are stored at unit 300+taskid,
i.e. fort.300, fort.301, ... Entry (k, m) means: m-th iteration step of the k-th maximization
negative_eigenvalues=0 : if non-zero checks number of negative eigenvalues of the Hessian, with absolute value larger
than eigenvalue_threshold. Only critical points with given number of negative eigenvalues are
analyzed.
eigenvalue_threshold=1e-2 : only eigenvalues with absolute value larger than eigenvalue_threshold are considered for
counting the number of negative eigenvalues.
not_to_minimize : list of indices of coordinates, which should not be optimized (e.g. =3;6;9 in order to not
optimize the z coordinates of the 1st, 2nd, and 3rd electrons)
minimize_this : does the opposite of not_to_minimize
minimize_grad_norm : Instead of minimizing Phi, minimizes the magnitude of the gradient, in order to use the faster
steepest descent method to find saddle points. (Note: This option can be used with every
minimizer. However, it might not be sensible to use the Newton method.)
max_electron_distance : (Important: only implemented for the bfgs minimizer!) Accepts either one double or
three doubles (max_electron_distance=3.0 or max_electron_distance=1.0;2.0;3.0, for x, y, and z
respectively. If only one value is given the max_electron_distance for the other coordinates is
assumed to be the same). Checks if the coordinates of the electrons exceed the given value. If
so the minimization process will be aborted.
singularity correction parameters:
correction_mode=[cut|umr|cut_all|umr_all|none]:
cut: overshoot correction (3-dim step is restricted to the projection of the elec-nearest nuc vector
to the search vector, 3n-dim step is scaled accordingly) (default)
umr: additionally, the 3-dim step is bent towards the nearest nucleus.
(see Umrigar et al, JCP, 1993)
*_one: same as above, but only the electron step in concern is altered (!just for testing atm)
none: no correction
correction_threshold=0.1 : do a singularity correction only within this distance/Z (bohr) to nearest nucleus
(Z being the atomic number)
singularity_threshold=0.005 : if an electron is this/Z close (bohr) to the nearest nucleus, it is assumed to
have its maximum position at the nucleus and is put at the nucleus.
no_scaling: correction_threshold and singularity_threshold are not! scaled with Z^{-1} (Z being the atomic number)
bfgs parameters:
step_size=dd : to enforce local maximation initial steps are steepest_descent with step=dd
switch_step=50 : after nn steps switch to bfgs (smoothly within 5 steps)
latency=nn : after nn steps switch to bfgs, each identified nucleus switches back to steepest_descent
steepest_descent:
step_size=dd : actual step is: -dd * gradient (with distance restriction)
fire: FIRE algorithm, see paper, and minimizer_ws_factory_m.f90 for the options. Not generally competitive with
the BFGS/steepest_descent combination.
bfgst: Lennard Dahl's BFGS variant mit singularity correction see BSc thesis and minimizer_ws_factory_m.f90
for the options. Not competitive with the BFGS/steepest_descent combination.
newton (use newton only for saddle point searches):
step_size=1.0 : factor for the newton step
====================================================================================
$init_rawdata_generation
------------------
Raw data from the VMC run and maxima search is written in binary format
in the following order, dimensionality, and precision:
---------------Header----------------
number of atoms ( 1*i4)
atomic numbers vector ( N*i4)
atom positions vector (3N*r8)
number of electrons ( 1*i4)
number of alpha electrons ( 1*i4)
----------------Body-----------------
1. sample positions vector (3N*r8)
kinetic energies vector ( N*r8)
maximum positions vector (3N*r8)
-ln|Psi|^2 value ( 1*r8)
2. ...
parameters:
basename='string' (default basename of the input file) : sets the basename of the output binary files
max_records=nn (default 1000000) : sets the max number of body records per file
verbose=nn (default 0) : sets verbosity
====================================================================================
$init_rho_analysis
------------------
initializes parameters for the maximization of the single Slater determinant density
and the analysis of the results.
all parameters of '$init_max_search' are valid.
other parameters:
verbose=nn (default 0) : sets verbosity (high values can generate lots
of output)
assign_thresh=dd (default 0.1) : threshold to assign electrons to atoms AFTER max-
imization of rho
assign_pre_thresh=dd (default 0.01) : threshold to assign electrons to atoms BEFORE max-
imization of rho
print_thresh=dd (default 0.05) : threshold to print occupations (weight)
fragments=nn;nn;... (default 1;2;...;N) : assignment of atoms to fragments for partition output,
must be of length N (number of atoms)
use_log : use -ln(rho) instead of -rho as function to minimize
====================================================================================
$init_rho_grid
--------------
creates an electronic density grid and initializes parameters for the maximization.
bin_size=dd (default 0.1) : edge length of a cell
atoms=nn;nn;... (default all atoms) : array of indices of the atoms that must be inside the grid bounds
offset=dd (default 5.0) : additional offset for the grid bounds
search_radius=nn (default 3) : number of adjacent cell layers checked in a step during maximization
assign_thresh=dd (default bin_size) : threshold to assign electrons to atoms after maximization
compare : enable comparision of the created density grid with the density calculated using
the given wave function
====================================================================================
$init_walker
allows to set an initial walker. This command must precede $sample(create, size=1, single_point).
There are three formats. All coordinates are in bohr.
The free format is:
$init_walker(
free
between 1 2 3 ! electron is between the given atom positions (any number of atoms can be given)
scaled 1 2 0.2 ! electron is between the given two atom positions at 0.2 of the way
at 4 ! electron is at a given atom position
x y z ! simply x y and z coordinates of an electron
...)
The column format is:
$init_walker(
col
x1 y1 z1
x2 y2 z2
...
xn yn zn)
The old format is:
$init_walker(
x1 x2 ... xn
y1 y2 ... yn
z1 z2 ... zn)
=====================================================================================
$maximize_mos
-------------
finds maxima/minima of all MOs simultaneously, but without importance sampling. For MO maxima/minima
with frequencies as weights use $qmc with $init_max_search and one MO (and one electron) only.
Here all MO maxima/minima are identified either using a 3d grid or ellipsoid sampling for initial
points for maximization. In both cases -abs(mo) is minimized.
mode=[lmo_min|grid] default: lmo_min # use LMO sampling or a simple 3d grid
value_threshold=0.0001 # ignore maxima/minima with values below threshold
lmo_grid: (see LMO sampling in $init_sample)
grid_size=100 # in x,y,z direction for determining ellipsoid (i.e. 3d gaussian) for (L)MO
scale=1.0 # Gaussian scale factor
attempts_per_mo=5 # sample size
distance_threshold=0.001 # identify two maxima as identical
further options see: $init_max_search
grid: this variant calculates MO on a grid and identifies local maxima/minima by comparison with neighbors.
x_grid_size=100 # number of grid points in x direction (half each in negative / positive direction)
y_grid_size=100 # number of grid points in y direction
z_grid_size=100 # number of grid points in z direction
grid_step=0.02 # distance between grid points
=====================================================================================
$maximize_sample
----------------
no options. This command maximizes psi^2 for all sample elements and gives information about convergence
and function evaluations. Maximization is done according to a preceding $init_max_search command.
=====================================================================================
$maximize_sample_rho
----------------
no options. This command maximizes rho for all sample elements and gives information about convergence
and function evaluations. Maximization is done according to a preceding $init_rho_analysis command.
=====================================================================================
$maximize_walker
----------------
This command maximizes psi^2 for one sample element and gives information about convergence
and function evaluations. Maximization is done according to a preceding $init_max_search command.
index=nn : index of the walker to be maximized
update_walker=ll (default .true.) : update walker after maximization
=====================================================================================
$maximize_walker_rho
----------------
This command maximizes rho for one sample element and gives information about convergence
and function evaluations. Maximization is done according to a preceding $init_rho_analysis command.
index=nn : index of the walker to be maximized
=====================================================================================
$optimize_parameters
--------------------
options: energy_min|variance_min,params,method,optmode,eq_iter
params=[jastrow|ci|mo|jas+ci|jas+mo|mo+ci,jas+mo+ci]
The order is important.
energy_min: (minimization w.r.t. the sample energy)
method=[nr|scaled_nr|snr|lm|tr_newton|lin|popt] default is snr
nr: simple several Newton-Raphson energy minimization
scaled_nr: Newton step is scaled w.r.t a cost function
snr: stabilized Newton-Raphson
lm: Levenberg-Marquardt Newton step. Hessian is modified to ensure it is positive definite
tr_newton: trust-region Newton-Raphson energy using the DNMTR code (nr or lin is preferable)
lin: linear energy minimization as suggested by C. Umrigar with scaling step
popt: perturbative energy minimization Toulouse, Umrigar 2007
variance_min: (minimization w.r.t. the sample variance)
method=[varmin|lm] default is varmin
varmin: variance minimization using the NL2SOL code
lm: variance minimization using Levenberg-Marquardt algorithm (varmin is preferable)
optmode=[1|2|3|4|5]: which parameters to optimize (default: 1)
the meaning of the optmode depends on the parameter set being used:
jastrow:
ic|de: 1: linear parameters (analytical derivatives)
2: linear parameters (numerical derivatives)
3: nonlinear parameters (numerical derivatives)
4: all parameters (lin. analytical, nonlin. numerical)
5: all parameters (numerical)
sm: 1: linear parameters
2: linear + nonlinear parameters
dtn: 1: linear + nonlinear parameters
2: linear parameters
ci: ???
options for params=mo:
mo_param_mode=[1|2] default: 2
1: successive 2x2 rotations
2: rotation matrix = exp(kappa)
mo_update_mode=[1|2] default: 2
1: excited determinants directly
2: excited determinants with Sherman-Morrison
options for all methods:
eq_iter=n: equilibrate sample and iterate n times.
eq_call=subname: expects a $begin_subroutine(name=subname) ... $end_subroutine block
at the beginning of the in-script, containing the commands to equilibrate the sample
default: subname=equilibrate (allowing named subroutines in "cmds" is not yet implemented)
wf_write: write the wf file for the parameters of each iteration step
varmin (variance_min) options:
E_ref=dd: reference energy(Optional but recommended).In case of absence,
emean+emean*0.02 for first optimization cycle and emean for rest cycles will
be used as E_ref. Note that "emean" is Sample's mean, local energy.
E_ref_adp (optional): adapts reference energy using samples mean energy after
each opt cycle.
E_ref_fix (optional,default): use fixed reference energy
max_iter=3: iterations with fixed sample (default: 3)
max_iter=n: iterations with fixed sample (e.g. in varmin1 and varmin2)
it's not usualy needed for varmin2, you only need to specify max_iter=2 if you had difficulties(diverged parameters) in optimizing paramiters.
NL2SOL_D_mode=[0,1]: NL2SOL scale vector mode (varmin2).default is "0". Only needed when no changes in parameters.
mo_noise_coeff=0.0 : Add gaussian white noise fo starting orbital rotation params aroung
zero (startin params will be mo_noise_coef* g_rand ).
lm (variance_min) options:
E_ref=dd: reference energy(Optional but recommended). In case of absence,
emean+emean*0.02 for first optimization cycle and emean for rest cycles will
be used as E_ref. Note that "emean" is Sample's mean, local energy.
E_ref_adp (optional): adapts reference energy using samples mean energy after
each opt cycle.
E_ref_fix (optional,default): use fixed reference energy.
max_iter=3: iterations with fixed sample (default: 3)
lambda=0.001: value of lambda in varmin1. The diagonal elements are scaled with 1+lambda, lambda is
increased by a factor of 10 with each itaration that didn't succeed in decreasing the variance.
nr (energy_min) options:
max_var=1.d9: terminate optimization iterations if this variance is reached
nrmethod=1: Standard Newton-Raphson, no further options
nrmethod=2: Use scaled Newton-Raphson step, step length obtained from fixed sample
target_E, target_var: required to determine step length
dmax=1.d9: fixed trust radius (mean abs component of parameter vector delta_p). delta_p is forced below this
threshold
cffac=1.d0: scaling factor variance in cost function (abs(delta_E) + cffac*abs(delta_var))
nrmethod=3: Levenberg-Marquardt Newton stop with distance control
nu=0.001: Actual Hessian in Newton step is H' = H + nu*Imat (Imat=unit matrix). nu is initial value for nu.
nu is adapted to achieve a ratio of predicted/true energy change
of better than 0.25, and to achieve positive definite H'.
delta_f_min=0.d0: if set do not change nu if the change in the fixed sample energy is smaller than delta_f_min
(because of the unavoidable random noise in the fixed sample energy)
lin (energy_min) options :
E_lb=dd : lower bound for eigenvalue selection : currently disabled
max_Im=1.d-3 : max allowed value for imaginary part for eigenvalue selection : currently disabled
max_ev=5 : eigenvalue selection by choosing lowest fixed sample variance of the lowest max_ev eigenvalues
ev_sample_size= : use a subset of samples to evaluate correct eigenvalue and parameters vector length
target_E, target_var: required to determine step length
cffac=0.001d0 : scaling factor variance in cost function (abs(delta_E) + cffac*abs(delta_var))
root=N : specifies the chosen eigen vector manually
max_prj : use projection to current ci vector to choose the eigen vector (only available for ci optimization)
prt_prj : prints the projections to current ci vector (only available for ci optimization)
lambda=dd : specifies the step length manually
lambdamax=1.0d0 : changes the max step length
quad : use a quadratic model to determine the step length with minimum energy
popt (energy_min) options :
max_var=1.d9 : terminate optimization iterations if this variance is reached
write_de : writes delta E in file with .dat extension
delta_e= : sets a fixed delta E for all parameters
delta_e_[once|always] : calculates the delta E for one or all iterations(default)
delta_e_sample_size= : use a subset of samples to calculate delta E
delta_e_filename='filename' : reads delta E array from the file.
quad : use a quadratic model to determine the step length with the minimum energy
target_E, target_var : required to determine step length (only when quad is present)
MO opt input:
For CASSCF orbitals, non-redundant orbital rotations include: inactive to active, inactive to virtual, active to virtual.
For HF/KS orbitals: closed to open, closed to virtual, open to virtual.
An orbital rotation class is e.g. inactive to active. Only rotations between orbitals with the same irrep are sensible.
!!! Important note for the orbital_rotation_list block: if (number of orbitals > 30): the input for the given orbital type
has to be continued in the next line !!!
Input:
orbital_rotation_list=
<number of orbital rotation classes>
<number of orbitals (n) for irrep a and type b> <orbital 1> ... <orbital n>
<number of orbitals (m) for irrep a and type c> <orbital 1> ... <orbital m>
...
(! one blank line !)
mo_symmetrise_list=
<number of equivalent orbital rotations>
<number of degenerate orbitals (n) > <orbital 1> ... <orbital n>
...
====================================================================================
$optimize_refs
--------------
read a .ref file and optimize all references (using LBFGS only)
ref_file= ref file
new_file= ref file to save all optimized references
verbose=2
max_grad=1.d-5 : max gradient (component)
max_dist=1.d-4 : max distance (length of bfgs direction vector)
max_f =1.d-5 : max change of function value (from previous step)
H_dist = -1.d0 : if elec is closer to H (or He) nucleus than "H_dist (in bohr)",
elec is put at nucleus and removed from minimization
<0: do nothing
if too small, LBFGS tends to fail near H nuclei (due to
singularity). Sensible values are 0.1 .. 0.3 (smaller than
half a bond length: H-H has half bond length 0.6)
====================================================================================
$plot_mos
---------
(see also $maximize_mos)
x_grid_size=100 # number of grid points in x direction (half each in negative / positive direction)
y_grid_size=100 # number of grid points in y direction
z_grid_size=100 # number of grid points in z direction
grid_step=0.02 # distance between grid points
write cube file style formatted file (suffix .plt) containing MO function values on the grid:
structure of .plt file:
write(iu,'(i5,2g15.5)') xGridSize, xStart, xStep
write(iu,'(i5,2g15.5)') yGridSize, yStart, yStep
write(iu,'(i5,2g15.5)') zGridSize, zStart, zStep
write(iu,'(i5)') getNOrb()
loop over:
mo
do x
do y
do z
====================================================================================
$plot_mo_in_plane
-----------------
similar to $plot_mos, but 2d value in a given plane only. 2D coordinate system is
specified by origin and 2 points. 1st unit vector is point1 - origin (possibly normalized).
point2 - origin specifies the plane with 1st unit vector. 2nd unit vector is orthogonal
to 1st in plane. Extra points to be included in plot are added. Nuclei in this plane are
added to the output.
nuc_in_plane_thresh=0.01 # threshold for identifying nuclei and extra points in given plane
grid_step=0.02 # step size in unit vector directions
grid_data=
nExtraPoints, origin
xGridSize, point1 # x/yGridSize: number of grid points in x/y direction
yGridSize, point2
extrapoint1
...
extrapointn
origin, point1/2, extrapoint all require x,y,z coordinates.
structure of .plt file: