diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/H_ONCV_PBE-1.0.upf b/ABACUS.develop/examples/H2O-deepks-lcao/H_ONCV_PBE-1.0.upf new file mode 100644 index 0000000000..f8b1ebb63c --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/H_ONCV_PBE-1.0.upf @@ -0,0 +1,897 @@ + + + + This pseudopotential file has been produced using the code + ONCVPSP (Optimized Norm-Conservinng Vanderbilt PSeudopotential) + scalar-relativistic version 2.1.1, 03/26/2014 by D. R. Hamann + The code is available through a link at URL www.mat-simresearch.com. + Documentation with the package provides a full discription of the + input data below. + + + While it is not required under the terms of the GNU GPL, it is + suggested that you cite D. R. Hamann, Phys. Rev. B 88, 085117 (2013) + in any publication using these pseudopotentials. + + + Copyright 2015 The Regents of the University of California + + This work is licensed under the Creative Commons Attribution-ShareAlike + 4.0 International License. To view a copy of this license, visit + http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to + Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + + This pseudopotential is part of the Schlipf-Gygi norm-conserving + pseudopotential library. Its construction parameters were tuned to + reproduce materials of a training set with very high accuracy and + should be suitable as a general purpose pseudopotential to treat a + variety of different compounds. For details of the construction and + testing of the pseudopotential please refer to: + + [insert reference to paper here] + + We kindly ask that you include this reference in all publications + associated to this pseudopotential. + + + +# ATOM AND REFERENCE CONFIGURATION +# atsym z nc nv iexc psfile + H 1.00 0 1 4 upf +# +# n l f energy (Ha) + 1 0 1.00 +# +# PSEUDOPOTENTIAL AND OPTIMIZATION +# lmax + 0 +# +# l, rc, ep, ncon, nbas, qcut + 0 1.13748 -0.23860 5 8 9.72141 +# +# LOCAL POTENTIAL +# lloc, lpopt, rc(5), dvloc0 + 4 5 0.49352 0.00000 +# +# VANDERBILT-KLEINMAN-BYLANDER PROJECTORs +# l, nproj, debl + 0 2 1.27464 +# +# MODEL CORE CHARGE +# icmod, fcfact + 0 0.00000 +# +# LOG DERIVATIVE ANALYSIS +# epsh1, epsh2, depsh + -5.00 3.00 0.02 +# +# OUTPUT GRID +# rlmax, drl + 6.00 0.01 +# +# TEST CONFIGURATIONS +# ncnf + 0 +# nvcnf +# n l f + + + + + + + + + 0.0000 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 + 0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 + 0.1600 0.1700 0.1800 0.1900 0.2000 0.2100 0.2200 0.2300 + 0.2400 0.2500 0.2600 0.2700 0.2800 0.2900 0.3000 0.3100 + 0.3200 0.3300 0.3400 0.3500 0.3600 0.3700 0.3800 0.3900 + 0.4000 0.4100 0.4200 0.4300 0.4400 0.4500 0.4600 0.4700 + 0.4800 0.4900 0.5000 0.5100 0.5200 0.5300 0.5400 0.5500 + 0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200 0.6300 + 0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100 + 0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900 + 0.8000 0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700 + 0.8800 0.8900 0.9000 0.9100 0.9200 0.9300 0.9400 0.9500 + 0.9600 0.9700 0.9800 0.9900 1.0000 1.0100 1.0200 1.0300 + 1.0400 1.0500 1.0600 1.0700 1.0800 1.0900 1.1000 1.1100 + 1.1200 1.1300 1.1400 1.1500 1.1600 1.1700 1.1800 1.1900 + 1.2000 1.2100 1.2200 1.2300 1.2400 1.2500 1.2600 1.2700 + 1.2800 1.2900 1.3000 1.3100 1.3200 1.3300 1.3400 1.3500 + 1.3600 1.3700 1.3800 1.3900 1.4000 1.4100 1.4200 1.4300 + 1.4400 1.4500 1.4600 1.4700 1.4800 1.4900 1.5000 1.5100 + 1.5200 1.5300 1.5400 1.5500 1.5600 1.5700 1.5800 1.5900 + 1.6000 1.6100 1.6200 1.6300 1.6400 1.6500 1.6600 1.6700 + 1.6800 1.6900 1.7000 1.7100 1.7200 1.7300 1.7400 1.7500 + 1.7600 1.7700 1.7800 1.7900 1.8000 1.8100 1.8200 1.8300 + 1.8400 1.8500 1.8600 1.8700 1.8800 1.8900 1.9000 1.9100 + 1.9200 1.9300 1.9400 1.9500 1.9600 1.9700 1.9800 1.9900 + 2.0000 2.0100 2.0200 2.0300 2.0400 2.0500 2.0600 2.0700 + 2.0800 2.0900 2.1000 2.1100 2.1200 2.1300 2.1400 2.1500 + 2.1600 2.1700 2.1800 2.1900 2.2000 2.2100 2.2200 2.2300 + 2.2400 2.2500 2.2600 2.2700 2.2800 2.2900 2.3000 2.3100 + 2.3200 2.3300 2.3400 2.3500 2.3600 2.3700 2.3800 2.3900 + 2.4000 2.4100 2.4200 2.4300 2.4400 2.4500 2.4600 2.4700 + 2.4800 2.4900 2.5000 2.5100 2.5200 2.5300 2.5400 2.5500 + 2.5600 2.5700 2.5800 2.5900 2.6000 2.6100 2.6200 2.6300 + 2.6400 2.6500 2.6600 2.6700 2.6800 2.6900 2.7000 2.7100 + 2.7200 2.7300 2.7400 2.7500 2.7600 2.7700 2.7800 2.7900 + 2.8000 2.8100 2.8200 2.8300 2.8400 2.8500 2.8600 2.8700 + 2.8800 2.8900 2.9000 2.9100 2.9200 2.9300 2.9400 2.9500 + 2.9600 2.9700 2.9800 2.9900 3.0000 3.0100 3.0200 3.0300 + 3.0400 3.0500 3.0600 3.0700 3.0800 3.0900 3.1000 3.1100 + 3.1200 3.1300 3.1400 3.1500 3.1600 3.1700 3.1800 3.1900 + 3.2000 3.2100 3.2200 3.2300 3.2400 3.2500 3.2600 3.2700 + 3.2800 3.2900 3.3000 3.3100 3.3200 3.3300 3.3400 3.3500 + 3.3600 3.3700 3.3800 3.3900 3.4000 3.4100 3.4200 3.4300 + 3.4400 3.4500 3.4600 3.4700 3.4800 3.4900 3.5000 3.5100 + 3.5200 3.5300 3.5400 3.5500 3.5600 3.5700 3.5800 3.5900 + 3.6000 3.6100 3.6200 3.6300 3.6400 3.6500 3.6600 3.6700 + 3.6800 3.6900 3.7000 3.7100 3.7200 3.7300 3.7400 3.7500 + 3.7600 3.7700 3.7800 3.7900 3.8000 3.8100 3.8200 3.8300 + 3.8400 3.8500 3.8600 3.8700 3.8800 3.8900 3.9000 3.9100 + 3.9200 3.9300 3.9400 3.9500 3.9600 3.9700 3.9800 3.9900 + 4.0000 4.0100 4.0200 4.0300 4.0400 4.0500 4.0600 4.0700 + 4.0800 4.0900 4.1000 4.1100 4.1200 4.1300 4.1400 4.1500 + 4.1600 4.1700 4.1800 4.1900 4.2000 4.2100 4.2200 4.2300 + 4.2400 4.2500 4.2600 4.2700 4.2800 4.2900 4.3000 4.3100 + 4.3200 4.3300 4.3400 4.3500 4.3600 4.3700 4.3800 4.3900 + 4.4000 4.4100 4.4200 4.4300 4.4400 4.4500 4.4600 4.4700 + 4.4800 4.4900 4.5000 4.5100 4.5200 4.5300 4.5400 4.5500 + 4.5600 4.5700 4.5800 4.5900 4.6000 4.6100 4.6200 4.6300 + 4.6400 4.6500 4.6600 4.6700 4.6800 4.6900 4.7000 4.7100 + 4.7200 4.7300 4.7400 4.7500 4.7600 4.7700 4.7800 4.7900 + 4.8000 4.8100 4.8200 4.8300 4.8400 4.8500 4.8600 4.8700 + 4.8800 4.8900 4.9000 4.9100 4.9200 4.9300 4.9400 4.9500 + 4.9600 4.9700 4.9800 4.9900 5.0000 5.0100 5.0200 5.0300 + 5.0400 5.0500 5.0600 5.0700 5.0800 5.0900 5.1000 5.1100 + 5.1200 5.1300 5.1400 5.1500 5.1600 5.1700 5.1800 5.1900 + 5.2000 5.2100 5.2200 5.2300 5.2400 5.2500 5.2600 5.2700 + 5.2800 5.2900 5.3000 5.3100 5.3200 5.3300 5.3400 5.3500 + 5.3600 5.3700 5.3800 5.3900 5.4000 5.4100 5.4200 5.4300 + 5.4400 5.4500 5.4600 5.4700 5.4800 5.4900 5.5000 5.5100 + 5.5200 5.5300 5.5400 5.5500 5.5600 5.5700 5.5800 5.5900 + 5.6000 5.6100 5.6200 5.6300 5.6400 5.6500 5.6600 5.6700 + 5.6800 5.6900 5.7000 5.7100 5.7200 5.7300 5.7400 5.7500 + 5.7600 5.7700 5.7800 5.7900 5.8000 5.8100 5.8200 5.8300 + 5.8400 5.8500 5.8600 5.8700 5.8800 5.8900 5.9000 5.9100 + 5.9200 5.9300 5.9400 5.9500 5.9600 5.9700 5.9800 5.9900 + 6.0000 6.0100 + + + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 + + + + -9.0610437558E+00 -9.0568179440E+00 -9.0440368423E+00 -9.0228074240E+00 + -8.9932366622E+00 -8.9554713856E+00 -8.9096955089E+00 -8.8561267684E+00 + -8.7950131219E+00 -8.7266289853E+00 -8.6512714714E+00 -8.5692567717E+00 + -8.4809167973E+00 -8.3865961577E+00 -8.2866495257E+00 -8.1814394040E+00 + -8.0713342805E+00 -7.9567071423E+00 -7.8379342970E+00 -7.7153944473E+00 + -7.5894679553E+00 -7.4605362378E+00 -7.3289812341E+00 -7.1951848958E+00 + -7.0595286560E+00 -6.9223928378E+00 -6.7841559816E+00 -6.6451940571E+00 + -6.5058795596E+00 -6.3665804704E+00 -6.2276590796E+00 -6.0894706704E+00 + -5.9523620796E+00 -5.8166700798E+00 -5.6827196991E+00 -5.5508223633E+00 + -5.4212739530E+00 -5.2943527007E+00 -5.1703170897E+00 -5.0494035400E+00 + -4.9318240186E+00 -4.8177636487E+00 -4.7073781566E+00 -4.6007912591E+00 + -4.4980919767E+00 -4.3993318735E+00 -4.3045222275E+00 -4.2136312137E+00 + -4.1265808607E+00 -4.0432438377E+00 -3.9634411592E+00 -3.8869595066E+00 + -3.8135916025E+00 -3.7431452942E+00 -3.6754419749E+00 -3.6103158908E+00 + -3.5476125181E+00 -3.4871882092E+00 -3.4289088467E+00 -3.3726496295E+00 + -3.3182938607E+00 -3.2657329154E+00 -3.2148652694E+00 -3.1655961918E+00 + -3.1178374334E+00 -3.0715065944E+00 -3.0265268914E+00 -2.9828269546E+00 + -2.9403403441E+00 -2.8990053187E+00 -2.8587646530E+00 -2.8195654255E+00 + -2.7813586956E+00 -2.7440993328E+00 -2.7077458096E+00 -2.6722599695E+00 + -2.6376068987E+00 -2.6037546665E+00 -2.5706741108E+00 -2.5383386428E+00 + -2.5067240362E+00 -2.4758082142E+00 -2.4455710353E+00 -2.4159940785E+00 + -2.3870604303E+00 -2.3587544755E+00 -2.3310616932E+00 -2.3039684604E+00 + -2.2774618664E+00 -2.2515295388E+00 -2.2261594843E+00 -2.2013399461E+00 + -2.1770592791E+00 -2.1533058441E+00 -2.1300679226E+00 -2.1073336580E+00 + -2.0850909954E+00 -2.0633276674E+00 -2.0420311892E+00 -2.0211888715E+00 + -2.0007878496E+00 -1.9808151272E+00 -1.9612576275E+00 -1.9421022557E+00 + -1.9233359852E+00 -1.9049459279E+00 -1.8869194114E+00 -1.8692440280E+00 + -1.8519077546E+00 -1.8348990301E+00 -1.8182067760E+00 -1.8018204402E+00 + -1.7857300225E+00 -1.7699262307E+00 -1.7544003587E+00 -1.7391444068E+00 + -1.7241513910E+00 -1.7094149041E+00 -1.6949283914E+00 -1.6806851418E+00 + -1.6666793118E+00 -1.6529050288E+00 -1.6393565372E+00 -1.6260283354E+00 + -1.6129151224E+00 -1.6000117236E+00 -1.5873131231E+00 -1.5748145186E+00 + -1.5625112075E+00 -1.5503986290E+00 -1.5384724172E+00 -1.5267282808E+00 + -1.5151620774E+00 -1.5037698221E+00 -1.4925475838E+00 -1.4814916063E+00 + -1.4705982343E+00 -1.4598638619E+00 -1.4492850817E+00 -1.4388585096E+00 + -1.4285808834E+00 -1.4184490612E+00 -1.4084599113E+00 -1.3986104920E+00 + -1.3888978631E+00 -1.3793192008E+00 -1.3698717674E+00 -1.3605528496E+00 + -1.3513598874E+00 -1.3422902990E+00 -1.3333416549E+00 -1.3245115294E+00 + -1.3157975913E+00 -1.3071975681E+00 -1.2987092220E+00 -1.2903304217E+00 + -1.2820590200E+00 -1.2738930123E+00 -1.2658303454E+00 -1.2578691201E+00 + -1.2500073905E+00 -1.2422433402E+00 -1.2345751282E+00 -1.2270010179E+00 + -1.2195192646E+00 -1.2121282090E+00 -1.2048261947E+00 -1.1976116375E+00 + -1.1904829614E+00 -1.1834386556E+00 -1.1764772175E+00 -1.1695972076E+00 + -1.1627971899E+00 -1.1560757951E+00 -1.1494316470E+00 -1.1428634453E+00 + -1.1363698679E+00 -1.1299496816E+00 -1.1236016133E+00 -1.1173244954E+00 + -1.1111170992E+00 -1.1049783153E+00 -1.0989069715E+00 -1.0929019971E+00 + -1.0869622832E+00 -1.0810867896E+00 -1.0752744716E+00 -1.0695243151E+00 + -1.0638353388E+00 -1.0582065507E+00 -1.0526370315E+00 -1.0471258093E+00 + -1.0416720144E+00 -1.0362747227E+00 -1.0309330806E+00 -1.0256462248E+00 + -1.0204133106E+00 -1.0152335359E+00 -1.0101060634E+00 -1.0050301401E+00 + -1.0000049637E+00 -9.9502979509E-01 -9.9010388850E-01 -9.8522650356E-01 + -9.8039695184E-01 -9.7561449875E-01 -9.7087848953E-01 -9.6618823633E-01 + -9.6154307709E-01 -9.5694238357E-01 -9.5238548542E-01 -9.4787179443E-01 + -9.4340068216E-01 -9.3897154786E-01 -9.3458382085E-01 -9.3023689119E-01 + -9.2593022219E-01 -9.2166324612E-01 -9.1743540867E-01 -9.1324619440E-01 + -9.0909505086E-01 -9.0498147929E-01 -9.0090497409E-01 -8.9686501466E-01 + -8.9286113809E-01 -8.8889284780E-01 -8.8495967058E-01 -8.8106115837E-01 + -8.7719683072E-01 -8.7336625731E-01 -8.6956900186E-01 -8.6580460671E-01 + -8.6207267364E-01 -8.5837277569E-01 -8.5470449112E-01 -8.5106743638E-01 + -8.4746119942E-01 -8.4388539099E-01 -8.4033964140E-01 -8.3682355391E-01 + -8.3333676803E-01 -8.2987892766E-01 -8.2644965155E-01 -8.2304860442E-01 + -8.1967544372E-01 -8.1632980376E-01 -8.1301137110E-01 -8.0971981657E-01 + -8.0645479078E-01 -8.0321599828E-01 -8.0000312317E-01 -7.9681583368E-01 + -7.9365384812E-01 -7.9051686526E-01 -7.8740456836E-01 -7.8431668932E-01 + -7.8125294167E-01 -7.7821302127E-01 -7.7519667347E-01 -7.7220362543E-01 + -7.6923358691E-01 -7.6628631304E-01 -7.6336154485E-01 -7.6045900684E-01 + -7.5757846086E-01 -7.5471966218E-01 -7.5188235009E-01 -7.4906629106E-01 + -7.4627125457E-01 -7.4349699489E-01 -7.4074328111E-01 -7.3800989688E-01 + -7.3529661160E-01 -7.3260319525E-01 -7.2992944541E-01 -7.2727514676E-01 + -7.2464006883E-01 -7.2202402266E-01 -7.1942680330E-01 -7.1684819373E-01 + -7.1428800302E-01 -7.1174604062E-01 -7.0922210469E-01 -7.0671599945E-01 + -7.0422754882E-01 -7.0175656648E-01 -6.9930285090E-01 -6.9686623967E-01 + -6.9444655518E-01 -6.9204361057E-01 -6.8965723548E-01 -6.8728726731E-01 + -6.8493353479E-01 -6.8259585830E-01 -6.8027408946E-01 -6.7796806685E-01 + -6.7567761966E-01 -6.7340259451E-01 -6.7114284334E-01 -6.6889821110E-01 + -6.6666853234E-01 -6.6445367341E-01 -6.6225348756E-01 -6.6006782094E-01 + -6.5789652969E-01 -6.5573948134E-01 -6.5359653600E-01 -6.5146754198E-01 + -6.4935237457E-01 -6.4725090244E-01 -6.4516298961E-01 -6.4308849538E-01 + -6.4102730352E-01 -6.3897928686E-01 -6.3694431188E-01 -6.3492225321E-01 + -6.3291299679E-01 -6.3091642140E-01 -6.2893239660E-01 -6.2696081023E-01 + -6.2500155065E-01 -6.2305450228E-01 -6.2111953833E-01 -6.1919655775E-01 + -6.1728545168E-01 -6.1538610939E-01 -6.1349840980E-01 -6.1162225937E-01 + -6.0975755301E-01 -6.0790418385E-01 -6.0606203900E-01 -6.0423102850E-01 + -6.0241105218E-01 -6.0060200743E-01 -5.9880378789E-01 -5.9701630748E-01 + -5.9523947068E-01 -5.9347317955E-01 -5.9171733268E-01 -5.8997184815E-01 + -5.8823663490E-01 -5.8651159997E-01 -5.8479664543E-01 -5.8309169382E-01 + -5.8139665833E-01 -5.7971145131E-01 -5.7803597694E-01 -5.7637016247E-01 + -5.7471392514E-01 -5.7306718215E-01 -5.7142984084E-01 -5.6980183110E-01 + -5.6818307475E-01 -5.6657349289E-01 -5.6497299873E-01 -5.6338152110E-01 + -5.6179898754E-01 -5.6022532279E-01 -5.5866044633E-01 -5.5710428471E-01 + -5.5555677140E-01 -5.5401783464E-01 -5.5248740049E-01 -5.5096539222E-01 + -5.4945174929E-01 -5.4794640331E-01 -5.4644928588E-01 -5.4496032010E-01 + -5.4347944752E-01 -5.4200660421E-01 -5.4054172497E-01 -5.3908473990E-01 + -5.3763558480E-01 -5.3619420258E-01 -5.3476053107E-01 -5.3333450778E-01 + -5.3191606202E-01 -5.3050514339E-01 -5.2910169262E-01 -5.2770565043E-01 + -5.2631695259E-01 -5.2493554186E-01 -5.2356136607E-01 -5.2219436872E-01 + -5.2083449329E-01 -5.1948167463E-01 -5.1813586721E-01 -5.1679701734E-01 + -5.1546507114E-01 -5.1413997141E-01 -5.1282166293E-01 -5.1151009987E-01 + -5.1020523087E-01 -5.0890700456E-01 -5.0761536348E-01 -5.0633026144E-01 + -5.0505165203E-01 -5.0377948626E-01 -5.0251371517E-01 -5.0125428164E-01 + -5.0000114694E-01 -4.9875426449E-01 -4.9751358757E-01 -4.9627906774E-01 + -4.9505065408E-01 -4.9382830847E-01 -4.9261198641E-01 -4.9140164337E-01 + -4.9019723176E-01 -4.8899870589E-01 -4.8780602831E-01 -4.8661915658E-01 + -4.8543804824E-01 -4.8426265702E-01 -4.8309294118E-01 -4.8192886432E-01 + -4.8077038597E-01 -4.7961746566E-01 -4.7847005879E-01 -4.7732812642E-01 + -4.7619163356E-01 -4.7506054163E-01 -4.7393481203E-01 -4.7281440223E-01 + -4.7169927496E-01 -4.7058939701E-01 -4.6948473158E-01 -4.6838524190E-01 + -4.6729088781E-01 -4.6620163267E-01 -4.6511744539E-01 -4.6403829091E-01 + -4.6296413415E-01 -4.6189493768E-01 -4.6083066451E-01 -4.5977128600E-01 + -4.5871676870E-01 -4.5766707919E-01 -4.5662218308E-01 -4.5558204211E-01 + -4.5454663035E-01 -4.5351591594E-01 -4.5248986699E-01 -4.5146845163E-01 + -4.5045163204E-01 -4.4943938274E-01 -4.4843167416E-01 -4.4742847591E-01 + -4.4642975759E-01 -4.4543548505E-01 -4.4444562951E-01 -4.4346016491E-01 + -4.4247906228E-01 -4.4150229265E-01 -4.4052982584E-01 -4.3956162903E-01 + -4.3859767986E-01 -4.3763795070E-01 -4.3668241393E-01 -4.3573104192E-01 + -4.3478380238E-01 -4.3384067158E-01 -4.3290162488E-01 -4.3196663593E-01 + -4.3103567840E-01 -4.3010872454E-01 -4.2918574490E-01 -4.2826671914E-01 + -4.2735162215E-01 -4.2644042882E-01 -4.2553311405E-01 -4.2462964878E-01 + -4.2373001042E-01 -4.2283417718E-01 -4.2194212512E-01 -4.2105383031E-01 + -4.2016926876E-01 -4.1928841078E-01 -4.1841123932E-01 -4.1753773154E-01 + -4.1666786462E-01 -4.1580161574E-01 -4.1493896037E-01 -4.1407987359E-01 + -4.1322433773E-01 -4.1237233102E-01 -4.1152383170E-01 -4.1067881801E-01 + -4.0983726529E-01 -4.0899915239E-01 -4.0816446135E-01 -4.0733317141E-01 + -4.0650526184E-01 -4.0568071187E-01 -4.0485949712E-01 -4.0404159922E-01 + -4.0322700028E-01 -4.0241568050E-01 -4.0160762012E-01 -4.0080279935E-01 + -4.0000119443E-01 -3.9920278882E-01 -3.9840756506E-01 -3.9761550429E-01 + -3.9682658765E-01 -3.9604079630E-01 -3.9525810742E-01 -3.9447850542E-01 + -3.9370197363E-01 -3.9292849408E-01 -3.9215804879E-01 -3.9139061977E-01 + -3.9062618552E-01 -3.8986473052E-01 -3.8910623925E-01 -3.8835069457E-01 + -3.8759807933E-01 -3.8684837639E-01 -3.8610156584E-01 -3.8535763147E-01 + -3.8461655919E-01 -3.8387833266E-01 -3.8314293554E-01 -3.8241035148E-01 + -3.8168056246E-01 -3.8095355083E-01 -3.8022930425E-01 -3.7950780711E-01 + -3.7878904385E-01 -3.7807299889E-01 -3.7735965635E-01 -3.7664899651E-01 + -3.7594100897E-01 -3.7523567887E-01 -3.7453299135E-01 -3.7383293156E-01 + -3.7313548465E-01 -3.7244063248E-01 -3.7174836252E-01 -3.7105866202E-01 + -3.7037151682E-01 -3.6968691275E-01 -3.6900483566E-01 -3.6832527016E-01 + -3.6764820011E-01 -3.6697361536E-01 -3.6630150240E-01 -3.6563184773E-01 + -3.6496463784E-01 -3.6429985924E-01 -3.6363749507E-01 -3.6297753451E-01 + -3.6231996581E-01 -3.6166477608E-01 -3.6101195247E-01 -3.6036148208E-01 + -3.5971335135E-01 -3.5906754455E-01 -3.5842405304E-01 -3.5778286454E-01 + -3.5714396678E-01 -3.5650734748E-01 -3.5587299437E-01 -3.5524089309E-01 + -3.5461103153E-01 -3.5398340017E-01 -3.5335798731E-01 -3.5273478124E-01 + -3.5211377027E-01 -3.5149494269E-01 -3.5087828373E-01 -3.5026378405E-01 + -3.4965143359E-01 -3.4904122118E-01 -3.4843313568E-01 -3.4782716591E-01 + -3.4722330074E-01 -3.4662152533E-01 -3.4602183228E-01 -3.4542421132E-01 + -3.4482865181E-01 -3.4423514312E-01 -3.4364367460E-01 -3.4305423563E-01 + -3.4246681166E-01 -3.4188139641E-01 -3.4129797977E-01 -3.4071655158E-01 + -3.4013710172E-01 -3.3955962003E-01 -3.3898409638E-01 -3.3841051679E-01 + -3.3783887542E-01 -3.3726916258E-01 -3.3670136861E-01 -3.3613548384E-01 + -3.3557149861E-01 -3.3500940324E-01 -3.3444918462E-01 -3.3389083661E-01 + -3.3333435031E-01 -3.3277971650E-01 + + + + 0.0000000000E+00 -2.6088547982E-01 -5.1833275472E-01 -7.6895641941E-01 + -1.0094757748E+00 -1.2367649640E+00 -1.4479004921E+00 -1.6402053307E+00 + -1.8112888675E+00 -1.9590820386E+00 -2.0818670611E+00 -2.1783012866E+00 + -2.2474347945E+00 -2.2887214604E+00 -2.3020233440E+00 -2.2876083718E+00 + -2.2461413919E+00 -2.1786688108E+00 -2.0865971283E+00 -1.9716657861E+00 + -1.8359148921E+00 -1.6816483354E+00 -1.5113931252E+00 -1.3278555788E+00 + -1.1338753152E+00 -9.3237750193E-01 -7.2632508798E-01 -5.1867053707E-01 + -3.1230935470E-01 -1.1003518382E-01 8.5502335005E-02 2.7183628053E-01 + 4.4671684037E-01 6.0814212888E-01 7.5438240005E-01 8.8400019998E-01 + 9.9586420814E-01 1.0891579569E+00 1.1633817902E+00 1.2183503968E+00 + 1.2541845008E+00 1.2712971870E+00 1.2703761390E+00 1.2523616859E+00 + 1.2184214326E+00 1.1699221627E+00 1.1083997635E+00 1.0355281365E+00 + 9.5308744579E-01 8.6293235820E-01 7.6696227219E-01 6.6708583573E-01 + 5.6517138232E-01 4.6301269339E-01 3.6230358110E-01 2.6460354791E-01 + 1.7132725391E-01 8.3714876259E-02 2.8300950036E-03 -7.0461868736E-02 + -1.3548566127E-01 -1.9177104351E-01 -2.3903864371E-01 -2.7719764878E-01 + -3.0633813688E-01 -3.2671240755E-01 -3.3872209753E-01 -3.4290134301E-01 + -3.3989414704E-01 -3.3043492034E-01 -3.1532726713E-01 -2.9542143883E-01 + -2.7159339422E-01 -2.4472437166E-01 -2.1568159041E-01 -1.8530141020E-01 + -1.5437121547E-01 -1.2361699029E-01 -9.3692510618E-02 -6.5170103885E-02 + -3.8534327148E-02 -1.4178178357E-02 7.5982219585E-03 2.6586599843E-02 + 4.2667321458E-02 5.5804230200E-02 6.6037784474E-02 7.3476782950E-02 + 7.8288985480E-02 8.0690950459E-02 8.0937413388E-02 7.9310526716E-02 + 7.6109267813E-02 7.1639300505E-02 6.6203546315E-02 6.0094670030E-02 + 5.3585181276E-02 4.6922886516E-02 4.0325965406E-02 3.3979459512E-02 + 2.8033278554E-02 2.2601546887E-02 1.7764693923E-02 1.3566271071E-02 + 1.0019934924E-02 7.1127553803E-03 4.8089618584E-03 3.0547066732E-03 + 1.7812642827E-03 9.1198278094E-04 3.6682674818E-04 6.5692263071E-05 + -6.8632527182E-05 -1.1027997757E-04 -8.4781932173E-05 -7.5466225625E-06 + 5.5046813283E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 -6.6230384280E-02 -1.3227044522E-01 -1.9793408785E-01 + -2.6304354775E-01 -3.2743324392E-01 -3.9095326529E-01 -4.5347238282E-01 + -5.1488049086E-01 -5.7509039536E-01 -6.3403888294E-01 -6.9168702295E-01 + -7.4801967384E-01 -8.0304418574E-01 -8.5678831251E-01 -9.0929736637E-01 + -9.6063067143E-01 -1.0108573877E+00 -1.0600518025E+00 -1.1082881938E+00 + -1.1556354004E+00 -1.2021512134E+00 -1.2478767659E+00 -1.2928310462E+00 + -1.3370057140E+00 -1.3803603227E+00 -1.4228182118E+00 -1.4642630461E+00 + -1.5045363102E+00 -1.5434357567E+00 -1.5807149649E+00 -1.6160840886E+00 + -1.6492118605E+00 -1.6797288707E+00 -1.7072322005E+00 -1.7312913303E+00 + -1.7514553443E+00 -1.7672614056E+00 -1.7782442660E+00 -1.7839469588E+00 + -1.7839324513E+00 -1.7777959450E+00 -1.7651779669E+00 -1.7457779317E+00 + -1.7193680413E+00 -1.6858073499E+00 -1.6450558238E+00 -1.5971880652E+00 + -1.5424070527E+00 -1.4810575934E+00 -1.4136370872E+00 -1.3407629725E+00 + -1.2630862948E+00 -1.1812692944E+00 -1.0959852410E+00 -1.0079152517E+00 + -9.1774784801E-01 -8.2617381277E-01 -7.3388443997E-01 -6.4156480522E-01 + -5.4989159388E-01 -4.5952456379E-01 -3.7110347095E-01 -2.8524119151E-01 + -2.0251655480E-01 -1.2347058174E-01 -4.8599831493E-02 2.1650489647E-02 + 8.6889253952E-02 1.4678399897E-01 2.0106542651E-01 2.4953062217E-01 + 2.9204347185E-01 3.2853617819E-01 3.5900919836E-01 3.8352979134E-01 + 4.0223095680E-01 4.1530746441E-01 4.2301167574E-01 4.2564876217E-01 + 4.2357093422E-01 4.1717097424E-01 4.0687519421E-01 3.9313595295E-01 + 3.7642387716E-01 3.5721993688E-01 3.3600752955E-01 3.1326472631E-01 + 2.8945683082E-01 2.6502939400E-01 2.4040181789E-01 2.1596166863E-01 + 1.9205980225E-01 1.6900638782E-01 1.4706789081E-01 1.2646640479E-01 + 1.0737471459E-01 8.9919605583E-02 7.4182301027E-02 6.0200233461E-02 + 4.7969874788E-02 3.7450322138E-02 2.8568294126E-02 2.1219868525E-02 + 1.5278963151E-02 1.0602331228E-02 7.0348351713E-03 4.4142517848E-03 + 2.5774088544E-03 1.3667064349E-03 6.3345563442E-04 2.4137577893E-04 + 6.9281378302E-05 2.0772501814E-05 1.5017397331E-05 1.0881212294E-06 + -1.0503836267E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + -2.4016441487E+01 0.0000000000E+00 0.0000000000E+00 -1.0336462913E+00 + + + + + + 0.0000000000E+00 2.4794341471E-04 9.9091894057E-04 2.2263680628E-03 + 3.9500456984E-03 6.1560486329E-03 8.8368548808E-03 1.1983373531E-02 + 1.5585004525E-02 1.9629707710E-02 2.4104080427E-02 2.8993442803E-02 + 3.4281929867E-02 3.9952589544E-02 4.5987485557E-02 5.2367804247E-02 + 5.9073964300E-02 6.6085728409E-02 7.3382315882E-02 8.0942515274E-02 + 8.8744796138E-02 9.6767419086E-02 1.0498854333E-01 1.1338633103E-01 + 1.2193904783E-01 1.3062515893E-01 1.3942342031E-01 1.4831296458E-01 + 1.5727338117E-01 1.6628479066E-01 1.7532791282E-01 1.8438412840E-01 + 1.9343553473E-01 2.0246499428E-01 2.1145617765E-01 2.2039359948E-01 + 2.2926264851E-01 2.3804961085E-01 2.4674168841E-01 2.5532701021E-01 + 2.6379463827E-01 2.7213456885E-01 2.8033772768E-01 2.8839596035E-01 + 2.9630201805E-01 3.0404953869E-01 3.1163302393E-01 3.1904781286E-01 + 3.2629005077E-01 3.3335665407E-01 3.4024527527E-01 3.4695426557E-01 + 3.5348262690E-01 3.5982997159E-01 3.6599648316E-01 3.7198285339E-01 + 3.7779025613E-01 3.8342027746E-01 3.8887488964E-01 3.9415637933E-01 + 3.9926732777E-01 4.0421053528E-01 4.0898900016E-01 4.1360586662E-01 + 4.1806437563E-01 4.2236784139E-01 4.2651960765E-01 4.3052300623E-01 + 4.3438133902E-01 4.3809784793E-01 4.4167568640E-01 4.4511789734E-01 + 4.4842740211E-01 4.5160698378E-01 4.5465927654E-01 4.5758675943E-01 + 4.6039174939E-01 4.6307640307E-01 4.6564271888E-01 4.6809254111E-01 + 4.7042756695E-01 4.7264935579E-01 4.7475934017E-01 4.7675883847E-01 + 4.7864906862E-01 4.8043116285E-01 4.8210618286E-01 4.8367513530E-01 + 4.8513898716E-01 4.8649868075E-01 4.8775514807E-01 4.8890932424E-01 + 4.8996215983E-01 4.9091463191E-01 4.9176775358E-01 4.9252257613E-01 + 4.9318021185E-01 4.9374182540E-01 4.9420863911E-01 4.9458193531E-01 + 4.9486305613E-01 4.9505340201E-01 4.9515442062E-01 4.9516762730E-01 + 4.9509458085E-01 4.9493687901E-01 4.9469615451E-01 4.9437406196E-01 + 4.9397228868E-01 4.9349254046E-01 4.9293652709E-01 4.9230595866E-01 + 4.9160253929E-01 4.9082798382E-01 4.8998398626E-01 4.8907222166E-01 + 4.8809434735E-01 4.8705202061E-01 4.8594687199E-01 4.8478050140E-01 + 4.8355451132E-01 4.8227048421E-01 4.8092996944E-01 4.7953450212E-01 + 4.7808561574E-01 4.7658480457E-01 4.7503353906E-01 4.7343329913E-01 + 4.7178551873E-01 4.7009160857E-01 4.6835299066E-01 4.6657103314E-01 + 4.6474709403E-01 4.6288253276E-01 4.6097864623E-01 4.5903674889E-01 + 4.5705812988E-01 4.5504401645E-01 4.5299568348E-01 4.5091433129E-01 + 4.4880115759E-01 4.4665736345E-01 4.4448406520E-01 4.4228244437E-01 + 4.4005359528E-01 4.3779862199E-01 4.3551861800E-01 4.3321460984E-01 + 4.3088768122E-01 4.2853880795E-01 4.2616903012E-01 4.2377930732E-01 + 4.2137061147E-01 4.1894389471E-01 4.1650006236E-01 4.1404005773E-01 + 4.1156472312E-01 4.0907498816E-01 4.0657164288E-01 4.0405558773E-01 + 4.0152758537E-01 3.9898848719E-01 3.9643903481E-01 3.9388003353E-01 + 3.9131220208E-01 3.8873630343E-01 3.8615303095E-01 3.8356310956E-01 + 3.8096720441E-01 3.7836600704E-01 3.7576015114E-01 3.7315029989E-01 + 3.7053705201E-01 3.6792104757E-01 3.6530284664E-01 3.6268307155E-01 + 3.6006223998E-01 3.5744096187E-01 3.5481970890E-01 3.5219908368E-01 + 3.4957950873E-01 3.4696157326E-01 3.4434567985E-01 3.4173237209E-01 + 3.3912205408E-01 3.3651521191E-01 3.3391226115E-01 3.3131362397E-01 + 3.2871973492E-01 3.2613094713E-01 3.2354771963E-01 3.2097033407E-01 + 3.1839925340E-01 3.1583475732E-01 3.1327723928E-01 3.1072701520E-01 + 3.0818439374E-01 3.0564973754E-01 3.0312326636E-01 3.0060536753E-01 + 2.9809624731E-01 2.9559622996E-01 2.9310557269E-01 2.9062449750E-01 + 2.8815332279E-01 2.8569218837E-01 2.8324141465E-01 2.8080118028E-01 + 2.7837169267E-01 2.7595321500E-01 2.7354583751E-01 2.7114985674E-01 + 2.6876540189E-01 2.6639264465E-01 2.6403181011E-01 2.6168295407E-01 + 2.5934632864E-01 2.5702204381E-01 2.5471021239E-01 2.5241103884E-01 + 2.5012456127E-01 2.4785096372E-01 2.4559036883E-01 2.4334280687E-01 + 2.4110847696E-01 2.3888742000E-01 2.3667972467E-01 2.3448553732E-01 + 2.3230484695E-01 2.3013779622E-01 2.2798447164E-01 2.2584484162E-01 + 2.2371907224E-01 2.2160718423E-01 2.1950918491E-01 2.1742520274E-01 + 2.1535521910E-01 2.1329927590E-01 2.1125746569E-01 2.0922973692E-01 + 2.0721615973E-01 2.0521679417E-01 2.0323156191E-01 2.0126055392E-01 + 1.9930380230E-01 1.9736120736E-01 1.9543287344E-01 1.9351880846E-01 + 1.9161889992E-01 1.8973325450E-01 1.8786185993E-01 1.8600460254E-01 + 1.8416157699E-01 1.8233276208E-01 1.8051803620E-01 1.7871748583E-01 + 1.7693108606E-01 1.7515870043E-01 1.7340041110E-01 1.7165618863E-01 + 1.6992589269E-01 1.6820958701E-01 1.6650724345E-01 1.6481872662E-01 + 1.6314406985E-01 1.6148325248E-01 1.5983614921E-01 1.5820275480E-01 + 1.5658306061E-01 1.5497695691E-01 1.5338439180E-01 1.5180537259E-01 + 1.5023981072E-01 1.4868760030E-01 1.4714876754E-01 1.4562325032E-01 + 1.4411088316E-01 1.4261171261E-01 1.4112567980E-01 1.3965263949E-01 + 1.3819257554E-01 1.3674545831E-01 1.3531117665E-01 1.3388963650E-01 + 1.3248084168E-01 1.3108472136E-01 1.2970109889E-01 1.2833001076E-01 + 1.2697139008E-01 1.2562509939E-01 1.2429108335E-01 1.2296931894E-01 + 1.2165971717E-01 1.2036212317E-01 1.1907655698E-01 1.1780294648E-01 + 1.1654114810E-01 1.1529111045E-01 1.1405280258E-01 1.1282613765E-01 + 1.1161095024E-01 1.1040725990E-01 1.0921499300E-01 1.0803401854E-01 + 1.0686425527E-01 1.0570568262E-01 1.0455822148E-01 1.0342170539E-01 + 1.0229612790E-01 1.0118143008E-01 1.0007751189E-01 9.8984230691E-02 + 9.7901591614E-02 9.6829518883E-02 9.5767884597E-02 9.4716602554E-02 + 9.3675651345E-02 9.2644952595E-02 9.1624357062E-02 9.0613825474E-02 + 8.9613313452E-02 8.8622740963E-02 8.7641943554E-02 8.6670918562E-02 + 8.5709603256E-02 8.4757913158E-02 8.3815684928E-02 8.2882931486E-02 + 8.1959580376E-02 8.1045538566E-02 8.0140663081E-02 7.9244958367E-02 + 7.8358352085E-02 7.7480747512E-02 7.6612013484E-02 7.5752149816E-02 + 7.4901084880E-02 7.4058722878E-02 7.3224935982E-02 7.2399723308E-02 + 7.1583014448E-02 7.0774718909E-02 6.9974704043E-02 6.9182972050E-02 + 6.8399454182E-02 6.7624069401E-02 6.6856672591E-02 6.6097272493E-02 + 6.5345802386E-02 6.4602189287E-02 6.3866284591E-02 6.3138090627E-02 + 6.2417548303E-02 6.1704587356E-02 6.0999076474E-02 6.0300987164E-02 + 5.9610277067E-02 5.8926878874E-02 5.8250682553E-02 5.7581621736E-02 + 5.6919673704E-02 5.6264774278E-02 5.5616838504E-02 5.4975756187E-02 + 5.4341526243E-02 5.3714087760E-02 5.3093374958E-02 5.2479257060E-02 + 5.1871728058E-02 5.1270739451E-02 5.0676229134E-02 5.0088097362E-02 + 4.9506279485E-02 4.8930756928E-02 4.8361471290E-02 4.7798357672E-02 + 4.7241288817E-02 4.6690276084E-02 4.6145264773E-02 4.5606196203E-02 + 4.5072972721E-02 4.4545541444E-02 4.4023881815E-02 4.3507939101E-02 + 4.2997654834E-02 4.2492905991E-02 4.1993703269E-02 4.1499997132E-02 + 4.1011733250E-02 4.0528830544E-02 4.0051217904E-02 3.9578886841E-02 + 3.9111787057E-02 3.8649865000E-02 3.8193021326E-02 3.7741231625E-02 + 3.7294467263E-02 3.6852678829E-02 3.6415813870E-02 3.5983760247E-02 + 3.5556530198E-02 3.5134078994E-02 3.4716358396E-02 3.4303305080E-02 + 3.3894835682E-02 3.3490952616E-02 3.3091611670E-02 3.2696766006E-02 + 3.2306344980E-02 3.1920288091E-02 3.1538589081E-02 3.1161205154E-02 + 3.0788091067E-02 3.0419172782E-02 3.0054404780E-02 2.9693775584E-02 + 2.9337243976E-02 2.8984766463E-02 2.8636269166E-02 2.8291714111E-02 + 2.7951087999E-02 2.7614351317E-02 2.7281462438E-02 2.6952350866E-02 + 2.6626979290E-02 2.6305335782E-02 2.5987382630E-02 2.5673080163E-02 + 2.5362364216E-02 2.5055191839E-02 2.4751555386E-02 2.4451419017E-02 + 2.4154745071E-02 2.3861478444E-02 2.3571564847E-02 2.3285003479E-02 + 2.3001760410E-02 2.2721800031E-02 2.2445078789E-02 2.2171526061E-02 + 2.1901150013E-02 2.1633918647E-02 2.1369798413E-02 2.1108754197E-02 + 2.0850710883E-02 2.0595671221E-02 2.0343610458E-02 2.0094497098E-02 + 1.9848298202E-02 1.9604955310E-02 1.9364442566E-02 1.9126750436E-02 + 1.8891849457E-02 1.8659708833E-02 1.8430288872E-02 1.8203531688E-02 + 1.7979444001E-02 1.7757998342E-02 1.7539166017E-02 1.7322917097E-02 + 1.7109191383E-02 1.6897980399E-02 1.6689269114E-02 1.6483030879E-02 + 1.6279237912E-02 1.6077852629E-02 1.5878825755E-02 1.5682162720E-02 + 1.5487838857E-02 1.5295828455E-02 1.5106104755E-02 1.4918616206E-02 + 1.4733348857E-02 1.4550292886E-02 1.4369424576E-02 1.4190719249E-02 + 1.4014151128E-02 1.3839659221E-02 1.3667256683E-02 1.3496921706E-02 + 1.3328631601E-02 1.3162362793E-02 1.2998080875E-02 1.2835748138E-02 + 1.2675368275E-02 1.2516920489E-02 1.2360383178E-02 1.2205733920E-02 + 1.2052932833E-02 1.1901959252E-02 1.1752810004E-02 1.1605465350E-02 + 1.1459904808E-02 1.1316107146E-02 1.1174029833E-02 1.1033663349E-02 + 1.0895000275E-02 1.0758021954E-02 1.0622709048E-02 1.0489041530E-02 + 1.0356976695E-02 1.0226510813E-02 1.0097634680E-02 9.9703307378E-03 + 9.8445807986E-03 9.7203660474E-03 9.5976457522E-03 9.4764172062E-03 + 9.3566716576E-03 9.2383926415E-03 9.1215631207E-03 9.0061654822E-03 + 8.8921628626E-03 8.7795493594E-03 8.6683186485E-03 8.5584553503E-03 + 8.4499435627E-03 8.3427668572E-03 8.2368939208E-03 8.1323119604E-03 + 8.0290187790E-03 7.9270000634E-03 7.8262410234E-03 7.7267263895E-03 + 7.6284318873E-03 7.5313346684E-03 7.4354380585E-03 7.3407287840E-03 + 7.2471931373E-03 7.1548169739E-03 7.0635843287E-03 6.9734597403E-03 + 6.8844530956E-03 6.7965521281E-03 6.7097441767E-03 6.6240161831E-03 + 6.5393546899E-03 6.4557301699E-03 6.3731393266E-03 6.2915776433E-03 + 6.2110334645E-03 6.1314947748E-03 6.0529491959E-03 5.9753783320E-03 + 5.8987597471E-03 5.8230986296E-03 5.7483842858E-03 5.6746056953E-03 + 5.6017515092E-03 5.5298100485E-03 5.4587541386E-03 5.3885834526E-03 + 5.3192932870E-03 5.2508735670E-03 5.1833139204E-03 5.1166036764E-03 + 5.0507287806E-03 4.9856653379E-03 4.9214203547E-03 4.8579846503E-03 + 4.7953487751E-03 4.7335030098E-03 4.6724373639E-03 4.6121326368E-03 + 4.5525789599E-03 4.4937772672E-03 4.4357189771E-03 4.3783952646E-03 + 4.3217970601E-03 4.2659150477E-03 4.2107269600E-03 4.1562326781E-03 + 4.1024289394E-03 4.0493077557E-03 3.9968609188E-03 3.9450799988E-03 + 3.8939563432E-03 3.8434664007E-03 3.7936159723E-03 3.7443993547E-03 + 3.6958091420E-03 3.6478377293E-03 3.6004773117E-03 3.5537198828E-03 + 3.5075421006E-03 3.4619523711E-03 3.4169441116E-03 3.3725104825E-03 + 3.3286444647E-03 3.2853388583E-03 3.2425862821E-03 3.2003648485E-03 + 3.1586827452E-03 3.1175338565E-03 3.0769118893E-03 3.0368103888E-03 + 2.9972227375E-03 2.9581421546E-03 2.9195492532E-03 2.8814496160E-03 + 2.8438387299E-03 2.8067108257E-03 + + diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/H_gga_8au_60Ry_2s1p.orb b/ABACUS.develop/examples/H2O-deepks-lcao/H_gga_8au_60Ry_2s1p.orb new file mode 100644 index 0000000000..48eaf466a1 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/H_gga_8au_60Ry_2s1p.orb @@ -0,0 +1,621 @@ +--------------------------------------------------------------------------- +Element H +Energy Cutoff(Ry) 60 +Radius Cutoff(a.u.) 8 +Lmax 1 +Number of Sorbital--> 2 +Number of Porbital--> 1 +--------------------------------------------------------------------------- +SUMMARY END + +Mesh 801 +dr 0.01 + Type L N + 0 0 0 + 1.837183001954e+00 1.836944589913e+00 1.836229654458e+00 1.835039096904e+00 + 1.833374417163e+00 1.831237710329e+00 1.828631661910e+00 1.825559541724e+00 + 1.822025196478e+00 1.818033041051e+00 1.813588048498e+00 1.808695738828e+00 + 1.803362166562e+00 1.797593907128e+00 1.791398042128e+00 1.784782143515e+00 + 1.777754256735e+00 1.770322882882e+00 1.762496959911e+00 1.754285842983e+00 + 1.745699283975e+00 1.736747410234e+00 1.727440702633e+00 1.717789972985e+00 + 1.707806340887e+00 1.697501210064e+00 1.686886244272e+00 1.675973342834e+00 + 1.664774615881e+00 1.653302359357e+00 1.641569029875e+00 1.629587219474e+00 + 1.617369630367e+00 1.604929049734e+00 1.592278324633e+00 1.579430337099e+00 + 1.566397979495e+00 1.553194130183e+00 1.539831629571e+00 1.526323256609e+00 + 1.512681705776e+00 1.498919564642e+00 1.485049292031e+00 1.471083196857e+00 + 1.457033417677e+00 1.442911903007e+00 1.428730392444e+00 1.414500398644e+00 + 1.400233190182e+00 1.385939775333e+00 1.371630886810e+00 1.357316967481e+00 + 1.343008157094e+00 1.328714280028e+00 1.314444834085e+00 1.300208980342e+00 + 1.286015534077e+00 1.271872956757e+00 1.257789349118e+00 1.243772445314e+00 + 1.229829608141e+00 1.215967825332e+00 1.202193706904e+00 1.188513483548e+00 + 1.174933006049e+00 1.161457745704e+00 1.148092795727e+00 1.134842873614e+00 + 1.121712324429e+00 1.108705124991e+00 1.095824888929e+00 1.083074872558e+00 + 1.070457981553e+00 1.057976778365e+00 1.045633490360e+00 1.033430018609e+00 + 1.021367947317e+00 1.009448553813e+00 9.976728190860e-01 9.860414387908e-01 + 9.745548346979e-01 9.632131665266e-01 9.520163441167e-01 9.409640398896e-01 + 9.300557015494e-01 9.192905649774e-01 9.086676672686e-01 8.981858598668e-01 + 8.878438217485e-01 8.776400726115e-01 8.675729860234e-01 8.576408024859e-01 + 8.478416423739e-01 8.381735187085e-01 8.286343497244e-01 8.192219711958e-01 + 8.099341484846e-01 8.007685882774e-01 7.917229499810e-01 7.827948567466e-01 + 7.739819060948e-01 7.652816801187e-01 7.566917552403e-01 7.482097115016e-01 + 7.398331413718e-01 7.315596580552e-01 7.233869032872e-01 7.153125546063e-01 + 7.073343320959e-01 6.994500045870e-01 6.916573953213e-01 6.839543870698e-01 + 6.763389267106e-01 6.688090292670e-01 6.613627814111e-01 6.539983444408e-01 + 6.467139567383e-01 6.395079357207e-01 6.323786792970e-01 6.253246668428e-01 + 6.183444597120e-01 6.114367012998e-01 6.046001166779e-01 5.978335118199e-01 + 5.911357724396e-01 5.845058624632e-01 5.779428221587e-01 5.714457659458e-01 + 5.650138799114e-01 5.586464190548e-01 5.523427042877e-01 5.461021192154e-01 + 5.399241067240e-01 5.338081653994e-01 5.277538458047e-01 5.217607466390e-01 + 5.158285108059e-01 5.099568214136e-01 5.041453977325e-01 4.983939911326e-01 + 4.927023810249e-01 4.870703708276e-01 4.814977839793e-01 4.759844600184e-01 + 4.705302507489e-01 4.651350165105e-01 4.597986225695e-01 4.545209356471e-01 + 4.493018205989e-01 4.441411372598e-01 4.390387374660e-01 4.339944622642e-01 + 4.290081393187e-01 4.240795805231e-01 4.192085798248e-01 4.143949112659e-01 + 4.096383272463e-01 4.049385570104e-01 4.002953053599e-01 3.957082515919e-01 + 3.911770486621e-01 3.867013225703e-01 3.822806719649e-01 3.779146679621e-01 + 3.736028541744e-01 3.693447469412e-01 3.651398357547e-01 3.609875838725e-01 + 3.568874291078e-01 3.528387847874e-01 3.488410408668e-01 3.448935651913e-01 + 3.409957048920e-01 3.371467879035e-01 3.333461245923e-01 3.295930094816e-01 + 3.258867230612e-01 3.222265336680e-01 3.186116994248e-01 3.150414702237e-01 + 3.115150897416e-01 3.080317974748e-01 3.045908307790e-01 3.011914269039e-01 + 2.978328250089e-01 2.945142681489e-01 2.912350052191e-01 2.879942928469e-01 + 2.847913972227e-01 2.816255958578e-01 2.784961792617e-01 2.754024525310e-01 + 2.723437368403e-01 2.693193708300e-01 2.663287118847e-01 2.633711372954e-01 + 2.604460453030e-01 2.575528560170e-01 2.546910122087e-01 2.518599799744e-01 + 2.490592492694e-01 2.462883343097e-01 2.435467738441e-01 2.408341312951e-01 + 2.381499947722e-01 2.354939769580e-01 2.328657148724e-01 2.302648695155e-01 + 2.276911253967e-01 2.251441899519e-01 2.226237928562e-01 2.201296852370e-01 + 2.176616387940e-01 2.152194448327e-01 2.128029132189e-01 2.104118712608e-01 + 2.080461625279e-01 2.057056456128e-01 2.033901928451e-01 2.010996889656e-01 + 1.988340297689e-01 1.965931207221e-01 1.943768755699e-01 1.921852149312e-01 + 1.900180648992e-01 1.878753556493e-01 1.857570200652e-01 1.836629923900e-01 + 1.815932069086e-01 1.795475966703e-01 1.775260922564e-01 1.755286206005e-01 + 1.735551038664e-01 1.716054583896e-01 1.696795936868e-01 1.677774115389e-01 + 1.658988051503e-01 1.640436583889e-01 1.622118451094e-01 1.604032285625e-01 + 1.586176608917e-01 1.568549827195e-01 1.551150228235e-01 1.533975979026e-01 + 1.517025124337e-01 1.500295586177e-01 1.483785164136e-01 1.467491536591e-01 + 1.451412262756e-01 1.435544785550e-01 1.419886435250e-01 1.404434433895e-01 + 1.389185900406e-01 1.374137856375e-01 1.359287232483e-01 1.344630875494e-01 + 1.330165555780e-01 1.315887975315e-01 1.301794776097e-01 1.287882548928e-01 + 1.274147842501e-01 1.260587172734e-01 1.247197032295e-01 1.233973900255e-01 + 1.220914251803e-01 1.208014567985e-01 1.195271345385e-01 1.182681105707e-01 + 1.170240405197e-01 1.157945843848e-01 1.145794074346e-01 1.133781810696e-01 + 1.121905836491e-01 1.110163012772e-01 1.098550285439e-01 1.087064692189e-01 + 1.075703368914e-01 1.064463555568e-01 1.053342601443e-01 1.042337969845e-01 + 1.031447242151e-01 1.020668121220e-01 1.009998434160e-01 9.994361344292e-02 + 9.889793032764e-02 9.786261505153e-02 9.683750146373e-02 9.582243622695e-02 + 9.481727869892e-02 9.382190075086e-02 9.283618652485e-02 9.186003213200e-02 + 9.089334529416e-02 8.993604493153e-02 8.898806069949e-02 8.804933247767e-02 + 8.711980981492e-02 8.619945133369e-02 8.528822409791e-02 8.438610294830e-02 + 8.349306980927e-02 8.260911297183e-02 8.173422635677e-02 8.086840876262e-02 + 8.001166310290e-02 7.916399563701e-02 7.832541519936e-02 7.749593243119e-02 + 7.667555901919e-02 7.586430694553e-02 7.506218775311e-02 7.426921183030e-02 + 7.348538771882e-02 7.271072144857e-02 7.194521590274e-02 7.118887021660e-02 + 7.044167921281e-02 6.970363287618e-02 6.897471587029e-02 6.825490709826e-02 + 6.754417930953e-02 6.684249875447e-02 6.614982488807e-02 6.546611012376e-02 + 6.479129963827e-02 6.412533122782e-02 6.346813521597e-02 6.281963441282e-02 + 6.217974412524e-02 6.154837221742e-02 6.092541922062e-02 6.031077849093e-02 + 5.970433641353e-02 5.910597265146e-02 5.851556043717e-02 5.793296690431e-02 + 5.735805345748e-02 5.679067617719e-02 5.623068625723e-02 5.567793047149e-02 + 5.513225166709e-02 5.459348928055e-02 5.406147987367e-02 5.353605768584e-02 + 5.301705519908e-02 5.250430371249e-02 5.199763392254e-02 5.149687650562e-02 + 5.100186269951e-02 5.051242488017e-02 5.002839713058e-02 4.954961579826e-02 + 4.907592003841e-02 4.860715233943e-02 4.814315902803e-02 4.768379075103e-02 + 4.722890293136e-02 4.677835619574e-02 4.633201677174e-02 4.588975685239e-02 + 4.545145492624e-02 4.501699607151e-02 4.458627221269e-02 4.415918233874e-02 + 4.373563268174e-02 4.331553685543e-02 4.289881595315e-02 4.248539860513e-02 + 4.207522099501e-02 4.166822683595e-02 4.126436730696e-02 4.086360095004e-02 + 4.046589352919e-02 4.007121785247e-02 3.967955355852e-02 3.929088686906e-02 + 3.890521030927e-02 3.852252239779e-02 3.814282730864e-02 3.776613450720e-02 + 3.739245836261e-02 3.702181773910e-02 3.665423556888e-02 3.628973840914e-02 + 3.592835598602e-02 3.557012072822e-02 3.521506729315e-02 3.486323208842e-02 + 3.451465279144e-02 3.416936787005e-02 3.382741610685e-02 3.348883613005e-02 + 3.315366595347e-02 3.282194252816e-02 3.249370130839e-02 3.216897583409e-02 + 3.184779733221e-02 3.153019433907e-02 3.121619234560e-02 3.090581346740e-02 + 3.059907614130e-02 3.029599484973e-02 2.999657987449e-02 2.970083708075e-02 + 2.940876773251e-02 2.912036833994e-02 2.883563053951e-02 2.855454100693e-02 + 2.827708140322e-02 2.800322835388e-02 2.773295346082e-02 2.746622334670e-02 + 2.720299973098e-02 2.694323953697e-02 2.668689502885e-02 2.643391397746e-02 + 2.618423985369e-02 2.593781204788e-02 2.569456611367e-02 2.545443403465e-02 + 2.521734451180e-02 2.498322326994e-02 2.475199338102e-02 2.452357560217e-02 + 2.429788872629e-02 2.407484994296e-02 2.385437520730e-02 2.363637961462e-02 + 2.342077777828e-02 2.320748420868e-02 2.299641369091e-02 2.278748165879e-02 + 2.258060456315e-02 2.237570023195e-02 2.217268822047e-02 2.197149014906e-02 + 2.177203002695e-02 2.157423455996e-02 2.137803344052e-02 2.118335961832e-02 + 2.099014955016e-02 2.079834342757e-02 2.060788538111e-02 2.041872366018e-02 + 2.023081078753e-02 2.004410368768e-02 1.985856378874e-02 1.967415709710e-02 + 1.949085424496e-02 1.930863051036e-02 1.912746581003e-02 1.894734466521e-02 + 1.876825614084e-02 1.859019375878e-02 1.841315538567e-02 1.823714309642e-02 + 1.806216301427e-02 1.788822512858e-02 1.771534309170e-02 1.754353399617e-02 + 1.737281813387e-02 1.720321873867e-02 1.703476171432e-02 1.686747534922e-02 + 1.670139002005e-02 1.653653788602e-02 1.637295257579e-02 1.621066886889e-02 + 1.604972237371e-02 1.589014920400e-02 1.573198565588e-02 1.557526788735e-02 + 1.542003160212e-02 1.526631173980e-02 1.511414217422e-02 1.496355542166e-02 + 1.481458236068e-02 1.466725196525e-02 1.452159105263e-02 1.437762404751e-02 + 1.423537276365e-02 1.409485620432e-02 1.395609038260e-02 1.381908816243e-02 + 1.368385912139e-02 1.355040943570e-02 1.341874178822e-02 1.328885529967e-02 + 1.316074548341e-02 1.303440422391e-02 1.290981977884e-02 1.278697680470e-02 + 1.266585640551e-02 1.254643620432e-02 1.242869043674e-02 1.231259006595e-02 + 1.219810291820e-02 1.208519383795e-02 1.197382486147e-02 1.186395540780e-02 + 1.175554248568e-02 1.164854091516e-02 1.154290356241e-02 1.143858158612e-02 + 1.133552469406e-02 1.123368140788e-02 1.113299933481e-02 1.103342544417e-02 + 1.093490634723e-02 1.083738857850e-02 1.074081887670e-02 1.064514446379e-02 + 1.055031332017e-02 1.045627445440e-02 1.036297816589e-02 1.027037629880e-02 + 1.017842248571e-02 1.008707237956e-02 9.996283872439e-03 9.906017299963e-03 + 9.816235629990e-03 9.726904634575e-03 9.637993044158e-03 9.549472683095e-03 + 9.461318585756e-03 9.373509092547e-03 9.286025925316e-03 9.198854241766e-03 + 9.111982668594e-03 9.025403313231e-03 8.939111754182e-03 8.853107010083e-03 + 8.767391487758e-03 8.681970909646e-03 8.596854221113e-03 8.512053478299e-03 + 8.427583717241e-03 8.343462805139e-03 8.259711274747e-03 8.176352142955e-03 + 8.093410714732e-03 8.010914373688e-03 7.928892360586e-03 7.847375541208e-03 + 7.766396165037e-03 7.685987616284e-03 7.606184158811e-03 7.527020676537e-03 + 7.448532410976e-03 7.370754697499e-03 7.293722701988e-03 7.217471159497e-03 + 7.142034116536e-03 7.067444678566e-03 6.993734764268e-03 6.920934868072e-03 + 6.849073832427e-03 6.778178631184e-03 6.708274165423e-03 6.639383072963e-03 + 6.571525552710e-03 6.504719204914e-03 6.438978888287e-03 6.374316594849e-03 + 6.310741343251e-03 6.248259091204e-03 6.186872667539e-03 6.126581724281e-03 + 6.067382709022e-03 6.009268857733e-03 5.952230208041e-03 5.896253632856e-03 + 5.841322894139e-03 5.787418716443e-03 5.734518879765e-03 5.682598331103e-03 + 5.631629314041e-03 5.581581515517e-03 5.532422228878e-03 5.484116532183e-03 + 5.436627480669e-03 5.389916312153e-03 5.343942664112e-03 5.298664801096e-03 + 5.254039851043e-03 5.210024049057e-03 5.166572987118e-03 5.123641868188e-03 + 5.081185763139e-03 5.039159868908e-03 4.997519766284e-03 4.956221675723e-03 + 4.915222709618e-03 4.874481119449e-03 4.833956536282e-03 4.793610203124e-03 + 4.753405197691e-03 4.713306644192e-03 4.673281912822e-03 4.633300805703e-03 + 4.593335728114e-03 4.553361843925e-03 4.513357214267e-03 4.473302918541e-03 + 4.433183156995e-03 4.392985334212e-03 4.352700122958e-03 4.312321507951e-03 + 4.271846809254e-03 4.231276685107e-03 4.190615114131e-03 4.149869356970e-03 + 4.109049897570e-03 4.068170364395e-03 4.027247432032e-03 3.986300703725e-03 + 3.945352575525e-03 3.904428082829e-03 3.863554730213e-03 3.822762305549e-03 + 3.782082679500e-03 3.741549591582e-03 3.701198424061e-03 3.661065965028e-03 + 3.621190162068e-03 3.581609868005e-03 3.542364580233e-03 3.503494175223e-03 + 3.465038639791e-03 3.427037800768e-03 3.389531054702e-03 3.352557099248e-03 + 3.316153667881e-03 3.280357269556e-03 3.245202934926e-03 3.210723970676e-03 + 3.176951723504e-03 3.143915355211e-03 3.111641630320e-03 3.080154717561e-03 + 3.049476006479e-03 3.019623940341e-03 2.990613866433e-03 2.962457904719e-03 + 2.935164835746e-03 2.908740008560e-03 2.883185269274e-03 2.858498910829e-03 + 2.834675644347e-03 2.811706592354e-03 2.789579304014e-03 2.768277792419e-03 + 2.747782593786e-03 2.728070848352e-03 2.709116402574e-03 2.690889932146e-03 + 2.673359085199e-03 2.656488644942e-03 2.640240710873e-03 2.624574897586e-03 + 2.609448550081e-03 2.594816974380e-03 2.580633682179e-03 2.566850648134e-03 + 2.553418578345e-03 2.540287188493e-03 2.527405490042e-03 2.514722082840e-03 + 2.502185452434e-03 2.489744270362e-03 2.477347695641e-03 2.464945675695e-03 + 2.452489244921e-03 2.439930819104e-03 2.427224483935e-03 2.414326275849e-03 + 2.401194453506e-03 2.387789758222e-03 2.374075661746e-03 2.360018599826e-03 + 2.345588190083e-03 2.330757432809e-03 2.315502893351e-03 2.299804864899e-03 + 2.283647510554e-03 2.267018983675e-03 2.249911525653e-03 2.232321540320e-03 + 2.214249644396e-03 2.195700693471e-03 2.176683783150e-03 2.157212225161e-03 + 2.137303498335e-03 2.116979174517e-03 2.096264819617e-03 2.075189870149e-03 + 2.053787485737e-03 2.032094378211e-03 2.010150618060e-03 1.987999419131e-03 + 1.965686902588e-03 1.943261841281e-03 1.920775385784e-03 1.898280773460e-03 + 1.875833022051e-03 1.853488609337e-03 1.831305140546e-03 1.809341005235e-03 + 1.787655025459e-03 1.766306097099e-03 1.745352826260e-03 1.724853162710e-03 + 1.704864032341e-03 1.685440970664e-03 1.666637759365e-03 1.648506067923e-03 + 1.631095102303e-03 1.614451262697e-03 1.598617812261e-03 1.583634558740e-03 + 1.569537550816e-03 1.556358790976e-03 1.544125966566e-03 1.532862200671e-03 + 1.522585824315e-03 1.513310171416e-03 1.505043397778e-03 1.497788325320e-03 + 1.491542312579e-03 1.486297152434e-03 1.482038997816e-03 1.478748316066e-03 + 1.476399872422e-03 1.474962742997e-03 1.474400357424e-03 1.474670571219e-03 + 1.475725767736e-03 1.477512989424e-03 1.479974097954e-03 1.483045962591e-03 + 1.486660676018e-03 1.490745796644e-03 1.495224616191e-03 1.500016451141e-03 + 1.505036956309e-03 1.510198458459e-03 1.515410307388e-03 1.520579241276e-03 + 1.525609762264e-03 1.530404517056e-03 1.534864675863e-03 1.538890300991e-03 + 1.542380693864e-03 1.545234706066e-03 1.547350996145e-03 1.548628209460e-03 + 1.548965053456e-03 1.548260235761e-03 1.546412228103e-03 1.543318816091e-03 + 1.538876394723e-03 1.532978973774e-03 1.525516867851e-03 1.516375065197e-03 + 1.505431299339e-03 1.492553890171e-03 1.477599476967e-03 1.460410834509e-03 + 1.440815042342e-03 1.418622360790e-03 1.393626247355e-03 1.365605011751e-03 + 1.334325642654e-03 1.299550327874e-03 1.261046115558e-03 1.218598012950e-03 + 1.172025582071e-03 1.121202767714e-03 1.066080293069e-03 1.006709506381e-03 + 9.432660968839e-04 8.760716716887e-04 8.056108587196e-04 7.325414389434e-04 + 6.576950741039e-04 5.820665294703e-04 5.067899161052e-04 4.331013826033e-04 + 3.622888231049e-04 2.956304490814e-04 2.343253757956e-04 1.794205564900e-04 + 1.317393073308e-04 9.181716538704e-05 5.985080447147e-05 3.566514426544e-05 + 1.870263515509e-05 8.037061819656e-06 2.412224729222e-06 3.037233152557e-07 + 0.000000000000e+00 + Type L N + 0 0 1 + -2.482045090982e+00 -2.481575045574e+00 -2.480165470569e+00 -2.477818048460e+00 + -2.474535579529e+00 -2.470321976047e+00 -2.465182254178e+00 -2.459122523607e+00 + -2.452149974922e+00 -2.444272864788e+00 -2.435500498945e+00 -2.425843213088e+00 + -2.415312351675e+00 -2.403920244720e+00 -2.391680182642e+00 -2.378606389230e+00 + -2.364713992806e+00 -2.350018995660e+00 -2.334538241841e+00 -2.318289383390e+00 + -2.301290845115e+00 -2.283561787985e+00 -2.265122071263e+00 -2.245992213466e+00 + -2.226193352253e+00 -2.205747203365e+00 -2.184676018704e+00 -2.163002543674e+00 + -2.140749973900e+00 -2.117941911420e+00 -2.094602320479e+00 -2.070755483035e+00 + -2.046425954085e+00 -2.021638516931e+00 -1.996418138491e+00 -1.970789924772e+00 + -1.944779076620e+00 -1.918410845833e+00 -1.891710491771e+00 -1.864703238550e+00 + -1.837414232921e+00 -1.809868502935e+00 -1.782090917498e+00 -1.754106146882e+00 + -1.725938624312e+00 -1.697612508679e+00 -1.669151648489e+00 -1.640579547098e+00 + -1.611919329315e+00 -1.583193709441e+00 -1.554424960789e+00 -1.525634886761e+00 + -1.496844793516e+00 -1.468075464277e+00 -1.439347135320e+00 -1.410679473678e+00 + -1.382091556583e+00 -1.353601852675e+00 -1.325228204995e+00 -1.296987815763e+00 + -1.268897232963e+00 -1.240972338727e+00 -1.213228339514e+00 -1.185679758069e+00 + -1.158340427166e+00 -1.131223485087e+00 -1.104341372837e+00 -1.077705833050e+00 + -1.051327910559e+00 -1.025217954588e+00 -9.993856225250e-01 -9.738398852256e-01 + -9.485890338035e-01 -9.236406878455e-01 -8.990018049992e-01 -8.746786918694e-01 + -8.506770161618e-01 -8.270018200069e-01 -8.036575343959e-01 -7.806479946579e-01 + -7.579764569072e-01 -7.356456153854e-01 -7.136576206255e-01 -6.920140983600e-01 + -6.707161690980e-01 -6.497644682943e-01 -6.291591670323e-01 -6.088999931456e-01 + -5.889862526999e-01 -5.694168517617e-01 -5.501903183760e-01 -5.313048246828e-01 + -5.127582090964e-01 -4.945479984792e-01 -4.766714302409e-01 -4.591254742947e-01 + -4.419068548071e-01 -4.250120716796e-01 -4.084374217002e-01 -3.921790193109e-01 + -3.762328169342e-01 -3.605946248099e-01 -3.452601302927e-01 -3.302249165662e-01 + -3.154844807329e-01 -3.010342512403e-01 -2.868696046111e-01 -2.729858814433e-01 + -2.593784016562e-01 -2.460424789550e-01 -2.329734344963e-01 -2.201666097361e-01 + -2.076173784471e-01 -1.953211578962e-01 -1.832734191754e-01 -1.714696966828e-01 + -1.599055967545e-01 -1.485768054503e-01 -1.374790955011e-01 -1.266083324259e-01 + -1.159604798325e-01 -1.055316039164e-01 -9.531787717658e-02 -8.531558136803e-02 + -7.552110971417e-02 -6.593096840459e-02 -5.654177740486e-02 -4.735027060758e-02 + -3.835329535547e-02 -2.954781136879e-02 -2.093088911078e-02 -1.249970762590e-02 + -4.251551886934e-03 3.816190312426e-03 1.170603188209e-02 1.942039033924e-02 + 2.696159205295e-02 3.433187679143e-02 4.153340253348e-02 4.856825050611e-02 + 5.543843041030e-02 6.214588579785e-02 6.869249956235e-02 7.508009950864e-02 + 8.131046396552e-02 8.738532740806e-02 9.330638605648e-02 9.907530342034e-02 + 1.046937157578e-01 1.101632374215e-01 1.154854660636e-01 1.206619876754e-01 + 1.256943814368e-01 1.305842243549e-01 1.353330956700e-01 1.399425810130e-01 + 1.444142762956e-01 1.487497913206e-01 1.529507530990e-01 1.570188088635e-01 + 1.609556287699e-01 1.647629082796e-01 1.684423702188e-01 1.719957665107e-01 + 1.754248795804e-01 1.787315234329e-01 1.819175444064e-01 1.849848216051e-01 + 1.879352670179e-01 1.907708253286e-01 1.934934734280e-01 1.961052196373e-01 + 1.986081026534e-01 2.010041902302e-01 2.032955776076e-01 2.054843857050e-01 + 2.075727590925e-01 2.095628637587e-01 2.114568846895e-01 2.132570232773e-01 + 2.149654945789e-01 2.165845244386e-01 2.181163464977e-01 2.195631991075e-01 + 2.209273221665e-01 2.222109538984e-01 2.234163275928e-01 2.245456683249e-01 + 2.256011896732e-01 2.265850904541e-01 2.274995514892e-01 2.283467324239e-01 + 2.291287686120e-01 2.298477680839e-01 2.305058086103e-01 2.311049348788e-01 + 2.316471557937e-01 2.321344419128e-01 2.325687230312e-01 2.329518859239e-01 + 2.332857722547e-01 2.335721766603e-01 2.338128450165e-01 2.340094728926e-01 + 2.341637041983e-01 2.342771300269e-01 2.343512876976e-01 2.343876599986e-01 + 2.343876746309e-01 2.343527038517e-01 2.342840643176e-01 2.341830171224e-01 + 2.340507680278e-01 2.338884678816e-01 2.336972132177e-01 2.334780470324e-01 + 2.332319597286e-01 2.329598902218e-01 2.326627271977e-01 2.323413105132e-01 + 2.319964327307e-01 2.316288407763e-01 2.312392377093e-01 2.308282845948e-01 + 2.303966024653e-01 2.299447743617e-01 2.294733474413e-01 2.289828351401e-01 + 2.284737193796e-01 2.279464528036e-01 2.274014610356e-01 2.268391449436e-01 + 2.262598829013e-01 2.256640330350e-01 2.250519354446e-01 2.244239143880e-01 + 2.237802804204e-01 2.231213324770e-01 2.224473598904e-01 2.217586443352e-01 + 2.210554616904e-01 2.203380838132e-01 2.196067802164e-01 2.188618196441e-01 + 2.181034715407e-01 2.173320074064e-01 2.165477020379e-01 2.157508346485e-01 + 2.149416898674e-01 2.141205586134e-01 2.132877388452e-01 2.124435361850e-01 + 2.115882644171e-01 2.107222458626e-01 2.098458116306e-01 2.089593017498e-01 + 2.080630651817e-01 2.071574597201e-01 2.062428517807e-01 2.053196160848e-01 + 2.043881352429e-01 2.034487992432e-01 2.025020048514e-01 2.015481549280e-01 + 2.005876576690e-01 1.996209257790e-01 1.986483755813e-01 1.976704260747e-01 + 1.966874979431e-01 1.957000125268e-01 1.947083907623e-01 1.937130520990e-01 + 1.927144134003e-01 1.917128878376e-01 1.907088837837e-01 1.897028037141e-01 + 1.886950431228e-01 1.876859894608e-01 1.866760211028e-01 1.856655063495e-01 + 1.846548024717e-01 1.836442548021e-01 1.826341958799e-01 1.816249446540e-01 + 1.806168057486e-01 1.796100687966e-01 1.786050078436e-01 1.776018808259e-01 + 1.766009291261e-01 1.756023772073e-01 1.746064323292e-01 1.736132843462e-01 + 1.726231055887e-01 1.716360508281e-01 1.706522573248e-01 1.696718449590e-01 + 1.686949164427e-01 1.677215576113e-01 1.667518377934e-01 1.657858102547e-01 + 1.648235127145e-01 1.638649679309e-01 1.629101843510e-01 1.619591568219e-01 + 1.610118673583e-01 1.600682859619e-01 1.591283714880e-01 1.581920725539e-01 + 1.572593284833e-01 1.563300702825e-01 1.554042216414e-01 1.544816999540e-01 + 1.535624173536e-01 1.526462817550e-01 1.517331979001e-01 1.508230683987e-01 + 1.499157947616e-01 1.490112784176e-01 1.481094217111e-01 1.472101288739e-01 + 1.463133069667e-01 1.454188667842e-01 1.445267237216e-01 1.436367985950e-01 + 1.427490184141e-01 1.418633171028e-01 1.409796361628e-01 1.400979252795e-01 + 1.392181428654e-01 1.383402565401e-01 1.374642435433e-01 1.365900910811e-01 + 1.357177966027e-01 1.348473680075e-01 1.339788237822e-01 1.331121930672e-01 + 1.322475156536e-01 1.313848419106e-01 1.305242326454e-01 1.296657588954e-01 + 1.288095016572e-01 1.279555515515e-01 1.271040084291e-01 1.262549809187e-01 + 1.254085859213e-01 1.245649480536e-01 1.237241990439e-01 1.228864770852e-01 + 1.220519261490e-01 1.212206952640e-01 1.203929377643e-01 1.195688105119e-01 + 1.187484730975e-01 1.179320870251e-01 1.171198148840e-01 1.163118195149e-01 + 1.155082631729e-01 1.147093066933e-01 1.139151086648e-01 1.131258246146e-01 + 1.123416062101e-01 1.115626004808e-01 1.107889490663e-01 1.100207874929e-01 + 1.092582444838e-01 1.085014413050e-01 1.077504911533e-01 1.070054985858e-01 + 1.062665589972e-01 1.055337581451e-01 1.048071717277e-01 1.040868650141e-01 + 1.033728925300e-01 1.026652978003e-01 1.019641131492e-01 1.012693595590e-01 + 1.005810465875e-01 9.989917234468e-02 9.922372352869e-02 9.855467551939e-02 + 9.789199253004e-02 9.723562781511e-02 9.658552393304e-02 9.594161306219e-02 + 9.530381736785e-02 9.467204941827e-02 9.404621264680e-02 9.342620185774e-02 + 9.281190377258e-02 9.220319761372e-02 9.159995572199e-02 9.100204420476e-02 + 9.040932361060e-02 8.982164962702e-02 8.923887379717e-02 8.866084425155e-02 + 8.808740645081e-02 8.751840393541e-02 8.695367907826e-02 8.639307383603e-02 + 8.583643049534e-02 8.528359240971e-02 8.473440472345e-02 8.418871507860e-02 + 8.364637430141e-02 8.310723706459e-02 8.257116252218e-02 8.203801491369e-02 + 8.150766413444e-02 8.097998626949e-02 8.045486408832e-02 7.993218749807e-02 + 7.941185395312e-02 7.889376881917e-02 7.837784569021e-02 7.786400665701e-02 + 7.735218252609e-02 7.684231298837e-02 7.633434673698e-02 7.582824153397e-02 + 7.532396422600e-02 7.482149070938e-02 7.432080584492e-02 7.382190332363e-02 + 7.332478548422e-02 7.282946308400e-02 7.233595502458e-02 7.184428803444e-02 + 7.135449631029e-02 7.086662111972e-02 7.038071036735e-02 6.989681812752e-02 + 6.941500414608e-02 6.893533331433e-02 6.845787511844e-02 6.798270306730e-02 + 6.750989410234e-02 6.703952799271e-02 6.657168671922e-02 6.610645385066e-02 + 6.564391391592e-02 6.518415177562e-02 6.472725199654e-02 6.427329823257e-02 + 6.382237261541e-02 6.337455515854e-02 6.292992317754e-02 6.248855073011e-02 + 6.205050807862e-02 6.161586117822e-02 6.118467119321e-02 6.075699404408e-02 + 6.033287998787e-02 5.991237323373e-02 5.949551159588e-02 5.908232618562e-02 + 5.867284114390e-02 5.826707341583e-02 5.786503256816e-02 5.746672065053e-02 + 5.707213210109e-02 5.668125369684e-02 5.629406454872e-02 5.591053614136e-02 + 5.553063241703e-02 5.515430990315e-02 5.478151788253e-02 5.441219860513e-02 + 5.404628754010e-02 5.368371366652e-02 5.332439980101e-02 5.296826296042e-02 + 5.261521475725e-02 5.226516182572e-02 5.191800627587e-02 5.157364617311e-02 + 5.123197604056e-02 5.089288738120e-02 5.055626921703e-02 5.022200864208e-02 + 4.988999138625e-02 4.956010238683e-02 4.923222636445e-02 4.890624840040e-02 + 4.858205451206e-02 4.825953222321e-02 4.793857112627e-02 4.761906343324e-02 + 4.730090451237e-02 4.698399340773e-02 4.666823333877e-02 4.635353217719e-02 + 4.603980289863e-02 4.572696400663e-02 4.541493992673e-02 4.510366136851e-02 + 4.479306565364e-02 4.448309700838e-02 4.417370681875e-02 4.386485384718e-02 + 4.355650440959e-02 4.324863251176e-02 4.294121994458e-02 4.263425633753e-02 + 4.232773917023e-02 4.202167374203e-02 4.171607309986e-02 4.141095792483e-02 + 4.110635637812e-02 4.080230390710e-02 4.049884301289e-02 4.019602298032e-02 + 3.989389957220e-02 3.959253468915e-02 3.929199599723e-02 3.899235652507e-02 + 3.869369423287e-02 3.839609155556e-02 3.809963492252e-02 3.780441425648e-02 + 3.751052245430e-02 3.721805485232e-02 3.692710867928e-02 3.663778249950e-02 + 3.635017564953e-02 3.606438767102e-02 3.578051774298e-02 3.549866411634e-02 + 3.521892355383e-02 3.494139077806e-02 3.466615793079e-02 3.439331404622e-02 + 3.412294454091e-02 3.385513072317e-02 3.358994932446e-02 3.332747205505e-02 + 3.306776518651e-02 3.281088916299e-02 3.255689824337e-02 3.230584017620e-02 + 3.205775590890e-02 3.181267933294e-02 3.157063706606e-02 3.133164827289e-02 + 3.109572452458e-02 3.086286969840e-02 3.063307991758e-02 3.040634353182e-02 + 3.018264113840e-02 2.996194564386e-02 2.974422236575e-02 2.952942917404e-02 + 2.931751667125e-02 2.910842841043e-02 2.890210114979e-02 2.869846514259e-02 + 2.849744446083e-02 2.829895735084e-02 2.810291661916e-02 2.790923004642e-02 + 2.771780082720e-02 2.752852803350e-02 2.734130709943e-02 2.715603032450e-02 + 2.697258739298e-02 2.679086590661e-02 2.661075192784e-02 2.643213053071e-02 + 2.625488635676e-02 2.607890417275e-02 2.590406942761e-02 2.573026880550e-02 + 2.555739077224e-02 2.538532611231e-02 2.521396845357e-02 2.504321477699e-02 + 2.487296590891e-02 2.470312699312e-02 2.453360794040e-02 2.436432385330e-02 + 2.419519542382e-02 2.402614930213e-02 2.385711843425e-02 2.368804236721e-02 + 2.351886751988e-02 2.334954741825e-02 2.318004289399e-02 2.301032224513e-02 + 2.284036135821e-02 2.267014379120e-02 2.249966081685e-02 2.232891142617e-02 + 2.215790229212e-02 2.198664769369e-02 2.181516940079e-02 2.164349652049e-02 + 2.147166530554e-02 2.129971892603e-02 2.112770720548e-02 2.095568632269e-02 + 2.078371848085e-02 2.061187154572e-02 2.044021865465e-02 2.026883779851e-02 + 2.009781137868e-02 1.992722574135e-02 1.975717069155e-02 1.958773898944e-02 + 1.941902583141e-02 1.925112831861e-02 1.908414491583e-02 1.891817490323e-02 + 1.875331782404e-02 1.858967293085e-02 1.842733863338e-02 1.826641195074e-02 + 1.810698797073e-02 1.794915931917e-02 1.779301564194e-02 1.763864310237e-02 + 1.748612389659e-02 1.733553578942e-02 1.718695167304e-02 1.704043915097e-02 + 1.689606014922e-02 1.675387055697e-02 1.661391989838e-02 1.647625103740e-02 + 1.634089991718e-02 1.620789533523e-02 1.607725875590e-02 1.594900416081e-02 + 1.582313793839e-02 1.569965881293e-02 1.557855781368e-02 1.545981828421e-02 + 1.534341593208e-02 1.522931891857e-02 1.511748798818e-02 1.500787663728e-02 + 1.490043132113e-02 1.479509169826e-02 1.469179091120e-02 1.459045590195e-02 + 1.449100776098e-02 1.439336210776e-02 1.429742950121e-02 1.420311587785e-02 + 1.411032301568e-02 1.401894902135e-02 1.392888883825e-02 1.384003477310e-02 + 1.375227703819e-02 1.366550430676e-02 1.357960427870e-02 1.349446425360e-02 + 1.340997170838e-02 1.332601487660e-02 1.324248332634e-02 1.315926853392e-02 + 1.307626445035e-02 1.299336805771e-02 1.291047991254e-02 1.282750467341e-02 + 1.274435160999e-02 1.266093509083e-02 1.257717504747e-02 1.249299741209e-02 + 1.240833452676e-02 1.232312552166e-02 1.223731666053e-02 1.215086165114e-02 + 1.206372191923e-02 1.197586684417e-02 1.188727395503e-02 1.179792908573e-02 + 1.170782648826e-02 1.161696890320e-02 1.152536758675e-02 1.143304229394e-02 + 1.134002121778e-02 1.124634088427e-02 1.115204600356e-02 1.105718927751e-02 + 1.096183116447e-02 1.086603960190e-02 1.076988968798e-02 1.067346332336e-02 + 1.057684881457e-02 1.048014044056e-02 1.038343798427e-02 1.028684623118e-02 + 1.019047443688e-02 1.009443576615e-02 9.998846705724e-03 9.903826453530e-03 + 9.809496287006e-03 9.715978913303e-03 9.623397804321e-03 9.531876519539e-03 + 9.441538019746e-03 9.352503974778e-03 9.264894068459e-03 9.178825303950e-03 + 9.094411312729e-03 9.011761670447e-03 8.930981222860e-03 8.852169425054e-03 + 8.775419697083e-03 8.700818799153e-03 8.628446229346e-03 8.558373646848e-03 + 8.490664323513e-03 8.425372626521e-03 8.362543534709e-03 8.302212191092e-03 + 8.244403493880e-03 8.189131728173e-03 8.136400240352e-03 8.086201156981e-03 + 8.038515149877e-03 7.993311248794e-03 7.950546702980e-03 7.910166892631e-03 + 7.872105291106e-03 7.836283478488e-03 7.802611206900e-03 7.770986517756e-03 + 7.741295910874e-03 7.713414565203e-03 7.687206610635e-03 7.662525450201e-03 + 7.639214131691e-03 7.617105767535e-03 7.596024001566e-03 7.575783521055e-03 + 7.556190612210e-03 7.537043757089e-03 7.518134269667e-03 7.499246968516e-03 + 7.480160883308e-03 7.460649991956e-03 7.440483984796e-03 7.419429051600e-03 + 7.397248686374e-03 7.373704503755e-03 7.348557059180e-03 7.321566662708e-03 + 7.292494173217e-03 7.261101755343e-03 7.227153575754e-03 7.190416407734e-03 + 7.150660103394e-03 7.107657880901e-03 7.061186359963e-03 7.011025262750e-03 + 6.956956680516e-03 6.898763789795e-03 6.836228889030e-03 6.769130620249e-03 + 6.697240246048e-03 6.620316875679e-03 6.538101582408e-03 6.450310435006e-03 + 6.356626585950e-03 6.256691722479e-03 6.150097395357e-03 6.036376989510e-03 + 5.914999378528e-03 5.785365589660e-03 5.646810065247e-03 5.498608297878e-03 + 5.339992688839e-03 5.170178377035e-03 4.988400454703e-03 4.793963383463e-03 + 4.586302526504e-03 4.365056527676e-03 4.130147843723e-03 3.881867166025e-03 + 3.620955894071e-03 3.348679427361e-03 3.066883035448e-03 2.778021663412e-03 + 2.485155425306e-03 2.191903869409e-03 1.902354418680e-03 1.620923637512e-03 + 1.352173964869e-03 1.100592970927e-03 8.703466194766e-04 6.650219625807e-04 + 4.873776537196e-04 3.391221866623e-04 2.207395111312e-04 1.313794780193e-04 + 6.882647551390e-05 2.955391019338e-05 8.865353422468e-06 1.115867959482e-06 + 0.000000000000e+00 + Type L N + 0 1 0 + 0.000000000000e+00 -2.619148756396e-02 -5.236486301972e-02 -7.850203930165e-02 + -1.045849793771e-01 -1.305957211313e-01 -1.565164020954e-01 -1.823292839654e-01 + -2.080167768610e-01 -2.335614632739e-01 -2.589461216556e-01 -2.841537495958e-01 + -3.091675865449e-01 -3.339711360326e-01 -3.585481873377e-01 -3.828828365671e-01 + -4.069595070990e-01 -4.307629693521e-01 -4.542783598414e-01 -4.774911994832e-01 + -5.003874111144e-01 -5.229533361944e-01 -5.451757506572e-01 -5.670418798862e-01 + -5.885394127849e-01 -6.096565149199e-01 -6.303818407138e-01 -6.507045446704e-01 + -6.706142916133e-01 -6.901012659255e-01 -7.091561797781e-01 -7.277702803377e-01 + -7.459353559473e-01 -7.636437412768e-01 -7.808883214399e-01 -7.976625350814e-01 + -8.139603764356e-01 -8.297763963643e-01 -8.451057023818e-01 -8.599439576786e-01 + -8.742873791567e-01 -8.881327344938e-01 -9.014773382523e-01 -9.143190470556e-01 + -9.266562538533e-01 -9.384878812996e-01 -9.498133742720e-01 -9.606326915587e-01 + -9.709462967451e-01 -9.807551483301e-01 -9.900606891086e-01 -9.988648348517e-01 + -1.007169962324e+00 -1.014978896675e+00 -1.022294898241e+00 -1.029121648800e+00 + -1.035463237323e+00 -1.041324145256e+00 -1.046709231379e+00 -1.051623716287e+00 + -1.056073166534e+00 -1.060063478479e+00 -1.063600861885e+00 -1.066691823310e+00 + -1.069343149337e+00 -1.071561889677e+00 -1.073355340199e+00 -1.074731025928e+00 + -1.075696684036e+00 -1.076260246899e+00 -1.076429825220e+00 -1.076213691295e+00 + -1.075620262432e+00 -1.074658084579e+00 -1.073335816178e+00 -1.071662212300e+00 + -1.069646109077e+00 -1.067296408467e+00 -1.064622063390e+00 -1.061632063245e+00 + -1.058335419858e+00 -1.054741153859e+00 -1.050858281535e+00 -1.046695802159e+00 + -1.042262685832e+00 -1.037567861841e+00 -1.032620207550e+00 -1.027428537849e+00 + -1.022001595150e+00 -1.016348039963e+00 -1.010476442037e+00 -1.004395272089e+00 + -9.981128941084e-01 -9.916375582498e-01 -9.849773943052e-01 -9.781404057575e-01 + -9.711344644075e-01 -9.639673055695e-01 -9.566465238271e-01 -9.491795693387e-01 + -9.415737446814e-01 -9.338362022213e-01 -9.259739419936e-01 -9.179938100794e-01 + -9.099024974594e-01 -9.017065393285e-01 -8.934123148501e-01 -8.850260473314e-01 + -8.765538047966e-01 -8.680015009377e-01 -8.593748964187e-01 -8.506796005108e-01 + -8.419210730338e-01 -8.331046265803e-01 -8.242354289977e-01 -8.153185061029e-01 + -8.063587446057e-01 -7.973608952151e-01 -7.883295759049e-01 -7.792692753130e-01 + -7.701843562510e-01 -7.610790593002e-01 -7.519575064699e-01 -7.428237048973e-01 + -7.336815505648e-01 -7.245348320142e-01 -7.153872340388e-01 -7.062423413307e-01 + -6.971036420686e-01 -6.879745314249e-01 -6.788583149780e-01 -6.697582120136e-01 + -6.606773587007e-01 -6.516188111292e-01 -6.425855481983e-01 -6.335804743433e-01 + -6.246064220940e-01 -6.156661544547e-01 -6.067623670998e-01 -5.978976903813e-01 + -5.890746911408e-01 -5.802958743272e-01 -5.715636844155e-01 -5.628805066289e-01 + -5.542486679631e-01 -5.456704380175e-01 -5.371480296347e-01 -5.286835993539e-01 + -5.202792476838e-01 -5.119370192015e-01 -5.036589024851e-01 -4.954468298887e-01 + -4.873026771689e-01 -4.792282629741e-01 -4.712253482055e-01 -4.632956352638e-01 + -4.554407671916e-01 -4.476623267261e-01 -4.399618352735e-01 -4.323407518198e-01 + -4.248004717903e-01 -4.173423258741e-01 -4.099675788240e-01 -4.026774282498e-01 + -3.954730034156e-01 -3.883553640567e-01 -3.813254992302e-01 -3.743843262106e-01 + -3.675326894452e-01 -3.607713595818e-01 -3.541010325795e-01 -3.475223289158e-01 + -3.410357929000e-01 -3.346418921031e-01 -3.283410169145e-01 -3.221334802342e-01 + -3.160195173078e-01 -3.099992857124e-01 -3.040728654994e-01 -2.982402594992e-01 + -2.925013937933e-01 -2.868561183560e-01 -2.813042078699e-01 -2.758453627149e-01 + -2.704792101334e-01 -2.652053055693e-01 -2.600231341813e-01 -2.549321125271e-01 + -2.499315904153e-01 -2.450208529216e-01 -2.401991225640e-01 -2.354655616297e-01 + -2.308192746499e-01 -2.262593110115e-01 -2.217846677005e-01 -2.173942921658e-01 + -2.130870852947e-01 -2.088619044905e-01 -2.047175668396e-01 -2.006528523587e-01 + -1.966665073086e-01 -1.927572475643e-01 -1.889237620269e-01 -1.851647160666e-01 + -1.814787549827e-01 -1.778645074676e-01 -1.743205890629e-01 -1.708456055934e-01 + -1.674381565660e-01 -1.640968385230e-01 -1.608202483334e-01 -1.576069864139e-01 + -1.544556598647e-01 -1.513648855108e-01 -1.483332928356e-01 -1.453595267988e-01 + -1.424422505258e-01 -1.395801478620e-01 -1.367719257811e-01 -1.340163166408e-01 + -1.313120802780e-01 -1.286580059372e-01 -1.260529140265e-01 -1.234956576962e-01 + -1.209851242359e-01 -1.185202362876e-01 -1.160999528715e-01 -1.137232702242e-01 + -1.113892224481e-01 -1.090968819726e-01 -1.068453598284e-01 -1.046338057376e-01 + -1.024614080212e-01 -1.003273933296e-01 -9.823102619963e-02 -9.617160844355e-02 + -9.414847837716e-02 -9.216100989289e-02 -9.020861138608e-02 -8.829072454252e-02 + -8.640682299614e-02 -8.455641086620e-02 -8.273902118386e-02 -8.095421421852e-02 + -7.920157571451e-02 -7.748071504934e-02 -7.579126332469e-02 -7.413287140170e-02 + -7.250520789230e-02 -7.090795711826e-02 -6.934081704988e-02 -6.780349723588e-02 + -6.629571673653e-02 -6.481720207113e-02 -6.336768519157e-02 -6.194690149273e-02 + -6.055458787067e-02 -5.919048083885e-02 -5.785431471242e-02 -5.654581987003e-02 + -5.526472110210e-02 -5.401073605396e-02 -5.278357377167e-02 -5.158293335769e-02 + -5.040850274282e-02 -4.925995758026e-02 -4.813696026688e-02 -4.703915909588e-02 + -4.596618754460e-02 -4.491766369995e-02 -4.389318982382e-02 -4.289235205930e-02 + -4.191472027834e-02 -4.095984807036e-02 -4.002727287065e-02 -3.911651622664e-02 + -3.822708419924e-02 -3.735846789596e-02 -3.651014413154e-02 -3.568157621131e-02 + -3.487221483170e-02 -3.408149909199e-02 -3.330885761033e-02 -3.255370973701e-02 + -3.181546685714e-02 -3.109353377455e-02 -3.038731016832e-02 -2.969619211295e-02 + -2.901957365295e-02 -2.835684842224e-02 -2.770741129870e-02 -2.707066008394e-02 + -2.644599719833e-02 -2.583283138132e-02 -2.523057938696e-02 -2.463866766481e-02 + -2.405653401635e-02 -2.348362921731e-02 -2.291941859653e-02 -2.236338356226e-02 + -2.181502306709e-02 -2.127385500310e-02 -2.073941751929e-02 -2.021127025380e-02 + -1.968899547377e-02 -1.917219911649e-02 -1.866051172597e-02 -1.815358927943e-02 + -1.765111389923e-02 -1.715279444616e-02 -1.665836699064e-02 -1.616759515933e-02 + -1.568027035507e-02 -1.519621184885e-02 -1.471526674340e-02 -1.423730980846e-02 + -1.376224318856e-02 -1.328999598499e-02 -1.282052371411e-02 -1.235380764503e-02 + -1.188985402008e-02 -1.142869316246e-02 -1.097037847581e-02 -1.051498534107e-02 + -1.006260991666e-02 -9.613367848339e-03 -9.167392895743e-03 -8.724835483000e-03 + -8.285861181084e-03 -7.850649130099e-03 -7.419390409886e-03 -6.992286367608e-03 + -6.569546911217e-03 -6.151388777816e-03 -5.738033786074e-03 -5.329707081897e-03 + -4.926635386553e-03 -4.529045256425e-03 -4.137161363471e-03 -3.751204805299e-03 + -3.371391453621e-03 -2.997930349555e-03 -2.631022154026e-03 -2.270857661113e-03 + -1.917616381888e-03 -1.571465205837e-03 -1.232557146521e-03 -9.010301776598e-04 + -5.770061652889e-04 -2.605899011067e-04 4.813175843625e-05 3.490906433619e-04 + 6.422379083571e-04 9.275445552270e-04 1.205001837536e-03 1.474621546020e-03 + 1.736436173996e-03 1.990498962683e-03 2.236883826949e-03 2.475685162717e-03 + 2.707017537841e-03 2.931015268937e-03 3.147831887239e-03 3.357639497146e-03 + 3.560628031719e-03 3.757004409902e-03 3.946991600762e-03 4.130827600566e-03 + 4.308764328889e-03 4.481066450456e-03 4.648010129698e-03 4.809881725434e-03 + 4.966976433299e-03 5.119596883860e-03 5.268051704510e-03 5.412654053433e-03 + 5.553720134020e-03 5.691567698189e-03 5.826514547092e-03 5.958877037639e-03 + 6.088968603225e-03 6.217098296899e-03 6.343569365063e-03 6.468677859564e-03 + 6.592711295807e-03 6.715947364200e-03 6.838652701932e-03 6.961081731675e-03 + 7.083475573440e-03 7.206061035334e-03 7.329049688515e-03 7.452637031143e-03 + 7.577001745578e-03 7.702305052573e-03 7.828690165593e-03 7.956281847848e-03 + 8.085186074022e-03 8.215489798083e-03 8.347260827936e-03 8.480547807099e-03 + 8.615380302952e-03 8.751769000514e-03 8.889706000109e-03 9.029165216702e-03 + 9.170102878110e-03 9.312458118742e-03 9.456153665011e-03 9.601096608027e-03 + 9.747179258719e-03 9.894280080088e-03 1.004226469085e-02 1.019098693440e-02 + 1.034029000656e-02 1.049000763547e-02 1.063996530646e-02 1.078998152469e-02 + 1.093986910817e-02 1.108943650339e-02 1.123848911607e-02 1.138683064909e-02 + 1.153426443998e-02 1.168059479010e-02 1.182562827797e-02 1.196917504910e-02 + 1.211105007508e-02 1.225107437457e-02 1.238907618943e-02 1.252489210927e-02 + 1.265836813807e-02 1.278936069695e-02 1.291773755751e-02 1.304337870048e-02 + 1.316617709511e-02 1.328603939499e-02 1.340288654648e-02 1.351665430671e-02 + 1.362729366825e-02 1.373477118843e-02 1.383906922175e-02 1.394018605422e-02 + 1.403813593933e-02 1.413294903569e-02 1.422467124705e-02 1.431336396600e-02 + 1.439910372306e-02 1.448198174369e-02 1.456210341591e-02 1.463958767211e-02 + 1.471456628879e-02 1.478718310873e-02 1.485759319026e-02 1.492596188893e-02 + 1.499246387717e-02 1.505728210784e-02 1.512060672793e-02 1.518263394902e-02 + 1.524356488117e-02 1.530360433731e-02 1.536295961518e-02 1.542183926410e-02 + 1.548045184398e-02 1.553900468373e-02 1.559770264664e-02 1.565674690985e-02 + 1.571633376528e-02 1.577665344884e-02 1.583788900517e-02 1.590021519414e-02 + 1.596379744599e-02 1.602879087085e-02 1.609533932872e-02 1.616357456515e-02 + 1.623361541785e-02 1.630556709873e-02 1.637952055562e-02 1.645555191742e-02 + 1.653372202582e-02 1.661407605643e-02 1.669664323138e-02 1.678143662521e-02 + 1.686845306507e-02 1.695767312578e-02 1.704906121987e-02 1.714256578196e-02 + 1.723811954648e-02 1.733563991699e-02 1.743502942507e-02 1.753617627600e-02 + 1.763895497808e-02 1.774322705193e-02 1.784884181561e-02 1.795563724100e-02 + 1.806344087646e-02 1.817207083037e-02 1.828133680986e-02 1.839104120867e-02 + 1.850098023783e-02 1.861094509253e-02 1.872072314848e-02 1.883009918077e-02 + 1.893885659806e-02 1.904677868516e-02 1.915364984645e-02 1.925925684325e-02 + 1.936339001770e-02 1.946584449621e-02 1.956642136531e-02 1.966492881331e-02 + 1.976118323090e-02 1.985501026443e-02 1.994624581574e-02 2.003473698266e-02 + 2.012034293477e-02 2.020293571936e-02 2.028240099279e-02 2.035863867308e-02 + 2.043156350995e-02 2.050110556888e-02 2.056721062645e-02 2.062984047468e-02 + 2.068897313245e-02 2.074460296295e-02 2.079674069621e-02 2.084541335683e-02 + 2.089066409712e-02 2.093255193665e-02 2.097115140973e-02 2.100655212284e-02 + 2.103885822446e-02 2.106818779056e-02 2.109467212911e-02 2.111845500767e-02 + 2.113969180865e-02 2.115854861693e-02 2.117520124532e-02 2.118983420338e-02 + 2.120263961558e-02 2.121381609520e-02 2.122356758033e-02 2.123210213890e-02 + 2.123963074957e-02 2.124636606559e-02 2.125252116890e-02 2.125830832160e-02 + 2.126393772218e-02 2.126961627368e-02 2.127554637107e-02 2.128192471477e-02 + 2.128894115740e-02 2.129677759051e-02 2.130560687763e-02 2.131559184016e-02 + 2.132688430185e-02 2.133962419759e-02 2.135393875177e-02 2.136994173102e-02 + 2.138773277581e-02 2.140739681481e-02 2.142900356564e-02 2.145260712483e-02 + 2.147824564965e-02 2.150594113364e-02 2.153569927730e-02 2.156750945480e-02 + 2.160134477700e-02 2.163716225049e-02 2.167490303187e-02 2.171449277595e-02 + 2.175584207575e-02 2.179884699208e-02 2.184338966957e-02 2.188933903561e-02 + 2.193655157843e-02 2.198487219960e-02 2.203413513628e-02 2.208416494774e-02 + 2.213477756065e-02 2.218578136687e-02 2.223697836761e-02 2.228816535713e-02 + 2.233913513923e-02 2.238967776935e-02 2.243958181514e-02 2.248863562797e-02 + 2.253662861809e-02 2.258335252583e-02 2.262860268145e-02 2.267217924618e-02 + 2.271388842704e-02 2.275354365840e-02 2.279096674309e-02 2.282598894641e-02 + 2.285845203635e-02 2.288820926393e-02 2.291512627762e-02 2.293908196640e-02 + 2.295996922622e-02 2.297769564529e-02 2.299218410388e-02 2.300337328484e-02 + 2.301121809170e-02 2.301568997160e-02 2.301677714081e-02 2.301448471143e-02 + 2.300883471803e-02 2.299986604390e-02 2.298763424715e-02 2.297221128710e-02 + 2.295368515261e-02 2.293215939400e-02 2.290775256113e-02 2.288059755062e-02 + 2.285084086581e-02 2.281864179350e-02 2.278417150202e-02 2.274761206582e-02 + 2.270915542192e-02 2.266900226427e-02 2.262736088227e-02 2.258444595016e-02 + 2.254047727415e-02 2.249567850465e-02 2.245027582107e-02 2.240449659678e-02 + 2.235856805212e-02 2.231271590338e-02 2.226716301569e-02 2.222212806786e-02 + 2.217782423709e-02 2.213445791144e-02 2.209222743784e-02 2.205132191314e-02 + 2.201192002567e-02 2.197418895432e-02 2.193828333201e-02 2.190434427997e-02 + 2.187249851887e-02 2.184285756262e-02 2.181551699982e-02 2.179055586779e-02 + 2.176803612321e-02 2.174800221325e-02 2.173048074999e-02 2.171548029103e-02 + 2.170299122778e-02 2.169298578312e-02 2.168541811879e-02 2.168022455268e-02 + 2.167732388541e-02 2.167661783493e-02 2.167799157718e-02 2.168131439039e-02 + 2.168644039986e-02 2.169320941939e-02 2.170144788518e-02 2.171096987713e-02 + 2.172157822222e-02 2.173306567395e-02 2.174521616147e-02 2.175780610142e-02 + 2.177060576518e-02 2.178338069396e-02 2.179589315354e-02 2.180790362049e-02 + 2.181917229125e-02 2.182946060530e-02 2.183853277351e-02 2.184615730267e-02 + 2.185210850718e-02 2.185616799866e-02 2.185812614465e-02 2.185778348735e-02 + 2.185495211363e-02 2.184945696779e-02 2.184113709866e-02 2.182984683306e-02 + 2.181545686793e-02 2.179785527376e-02 2.177694840253e-02 2.175266169377e-02 + 2.172494037273e-02 2.169375003548e-02 2.165907711615e-02 2.162092923210e-02 + 2.157933540362e-02 2.153434614529e-02 2.148603342686e-02 2.143449050224e-02 + 2.137983160587e-02 2.132219151644e-02 2.126172498881e-02 2.119860605552e-02 + 2.113302720010e-02 2.106519840518e-02 2.099534607909e-02 2.092371186512e-02 + 2.085055133881e-02 2.077613259864e-02 2.070073475676e-02 2.062464633657e-02 + 2.054816358470e-02 2.047158870559e-02 2.039522802713e-02 2.031939010651e-02 + 2.024438378571e-02 2.017051620651e-02 2.009809079520e-02 2.002740522733e-02 + 1.995874938339e-02 1.989240330600e-02 1.982863516971e-02 1.976769927438e-02 + 1.970983407307e-02 1.965526024551e-02 1.960417882772e-02 1.955676940876e-02 + 1.951318840466e-02 1.947356741995e-02 1.943801170636e-02 1.940659872817e-02 + 1.937937684318e-02 1.935636410766e-02 1.933754721316e-02 1.932288056267e-02 + 1.931228549258e-02 1.930564964660e-02 1.930282650696e-02 1.930363508734e-02 + 1.930785979149e-02 1.931525044047e-02 1.932552247072e-02 1.933835730439e-02 + 1.935340289245e-02 1.937027443016e-02 1.938855524387e-02 1.940779784701e-02 + 1.942752516217e-02 1.944723190571e-02 1.946638612966e-02 1.948443091549e-02 + 1.950078621243e-02 1.951485081234e-02 1.952600445117e-02 1.953361002533e-02 + 1.953701590851e-02 1.953555835114e-02 1.952856393958e-02 1.951535208590e-02 + 1.949523750933e-02 1.946753265869e-02 1.943155000790e-02 1.938660413540e-02 + 1.933201347007e-02 1.926710155243e-02 1.919119761851e-02 1.910363626729e-02 + 1.900375592273e-02 1.889089575277e-02 1.876439066726e-02 1.862356399556e-02 + 1.846771745619e-02 1.829611809251e-02 1.810798198195e-02 1.790245475170e-02 + 1.767858927235e-02 1.743532136835e-02 1.717144498381e-02 1.688558896444e-02 + 1.657619842677e-02 1.624152452384e-02 1.587962718961e-02 1.548839602965e-02 + 1.506559477392e-02 1.460893445471e-02 1.411617955952e-02 1.358528970263e-02 + 1.301459678658e-02 1.240301420140e-02 1.175027046629e-02 1.105715512477e-02 + 1.032576006732e-02 9.559695308356e-03 8.764255204101e-03 7.946509802481e-03 + 7.115297042524e-03 6.281095287844e-03 5.455762355303e-03 4.652136625604e-03 + 3.883507462241e-03 3.162975109536e-03 2.502733260001e-03 1.913319137545e-03 + 1.402884747950e-03 9.765475531969e-04 6.358782201147e-04 3.785767743619e-04 + 1.983765869872e-04 8.519893699498e-05 2.556086363756e-05 3.217573100688e-06 + 0.000000000000e+00 \ No newline at end of file diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/INPUT b/ABACUS.develop/examples/H2O-deepks-lcao/INPUT new file mode 100644 index 0000000000..e9253e2028 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/INPUT @@ -0,0 +1,29 @@ +INPUT_PARAMETERS +#Parameters (1.General) +suffix abacus +calculation scf +ntype 2 +nbands 6 +symmetry 0 + +#Parameters (2.Iteration) +ecutwfc 50 +dr2 1e-8 +niter 50 + +#Parameters (3.Basis) +basis_type lcao +gamma_only 1 + +#Parameters (4.Smearing) +smearing gaussian +sigma 0.02 + +#Parameters (5.Mixing) +mixing_type pulay +mixing_beta 0.4 + +#Parameters (6.File) +out_band 0 +out_descriptor 1 +lmax_descriptor 2 diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/KPT b/ABACUS.develop/examples/H2O-deepks-lcao/KPT new file mode 100644 index 0000000000..c289c0158a --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/O_ONCV_PBE-1.0.upf b/ABACUS.develop/examples/H2O-deepks-lcao/O_ONCV_PBE-1.0.upf new file mode 100644 index 0000000000..7e7db6d66f --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/O_ONCV_PBE-1.0.upf @@ -0,0 +1,1224 @@ + + + + This pseudopotential file has been produced using the code + ONCVPSP (Optimized Norm-Conservinng Vanderbilt PSeudopotential) + scalar-relativistic version 2.1.1, 03/26/2014 by D. R. Hamann + The code is available through a link at URL www.mat-simresearch.com. + Documentation with the package provides a full discription of the + input data below. + + + While it is not required under the terms of the GNU GPL, it is + suggested that you cite D. R. Hamann, Phys. Rev. B 88, 085117 (2013) + in any publication using these pseudopotentials. + + + Copyright 2015 The Regents of the University of California + + This work is licensed under the Creative Commons Attribution-ShareAlike + 4.0 International License. To view a copy of this license, visit + http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to + Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + + This pseudopotential is part of the Schlipf-Gygi norm-conserving + pseudopotential library. Its construction parameters were tuned to + reproduce materials of a training set with very high accuracy and + should be suitable as a general purpose pseudopotential to treat a + variety of different compounds. For details of the construction and + testing of the pseudopotential please refer to: + + [insert reference to paper here] + + We kindly ask that you include this reference in all publications + associated to this pseudopotential. + + + +# ATOM AND REFERENCE CONFIGURATION +# atsym z nc nv iexc psfile + O 8.00 1 2 4 upf +# +# n l f energy (Ha) + 1 0 2.00 + 2 0 2.00 + 2 1 4.00 +# +# PSEUDOPOTENTIAL AND OPTIMIZATION +# lmax + 1 +# +# l, rc, ep, ncon, nbas, qcut + 0 1.29195 -0.88057 5 8 8.98916 + 1 1.47310 -0.33187 5 8 9.14990 +# +# LOCAL POTENTIAL +# lloc, lpopt, rc(5), dvloc0 + 4 5 0.90330 0.00000 +# +# VANDERBILT-KLEINMAN-BYLANDER PROJECTORs +# l, nproj, debl + 0 2 1.51851 + 1 2 1.53631 +# +# MODEL CORE CHARGE +# icmod, fcfact + 0 0.00000 +# +# LOG DERIVATIVE ANALYSIS +# epsh1, epsh2, depsh + -5.00 3.00 0.02 +# +# OUTPUT GRID +# rlmax, drl + 6.00 0.01 +# +# TEST CONFIGURATIONS +# ncnf + 0 +# nvcnf +# n l f + + + + + + + + + 0.0000 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 + 0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 + 0.1600 0.1700 0.1800 0.1900 0.2000 0.2100 0.2200 0.2300 + 0.2400 0.2500 0.2600 0.2700 0.2800 0.2900 0.3000 0.3100 + 0.3200 0.3300 0.3400 0.3500 0.3600 0.3700 0.3800 0.3900 + 0.4000 0.4100 0.4200 0.4300 0.4400 0.4500 0.4600 0.4700 + 0.4800 0.4900 0.5000 0.5100 0.5200 0.5300 0.5400 0.5500 + 0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200 0.6300 + 0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100 + 0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900 + 0.8000 0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700 + 0.8800 0.8900 0.9000 0.9100 0.9200 0.9300 0.9400 0.9500 + 0.9600 0.9700 0.9800 0.9900 1.0000 1.0100 1.0200 1.0300 + 1.0400 1.0500 1.0600 1.0700 1.0800 1.0900 1.1000 1.1100 + 1.1200 1.1300 1.1400 1.1500 1.1600 1.1700 1.1800 1.1900 + 1.2000 1.2100 1.2200 1.2300 1.2400 1.2500 1.2600 1.2700 + 1.2800 1.2900 1.3000 1.3100 1.3200 1.3300 1.3400 1.3500 + 1.3600 1.3700 1.3800 1.3900 1.4000 1.4100 1.4200 1.4300 + 1.4400 1.4500 1.4600 1.4700 1.4800 1.4900 1.5000 1.5100 + 1.5200 1.5300 1.5400 1.5500 1.5600 1.5700 1.5800 1.5900 + 1.6000 1.6100 1.6200 1.6300 1.6400 1.6500 1.6600 1.6700 + 1.6800 1.6900 1.7000 1.7100 1.7200 1.7300 1.7400 1.7500 + 1.7600 1.7700 1.7800 1.7900 1.8000 1.8100 1.8200 1.8300 + 1.8400 1.8500 1.8600 1.8700 1.8800 1.8900 1.9000 1.9100 + 1.9200 1.9300 1.9400 1.9500 1.9600 1.9700 1.9800 1.9900 + 2.0000 2.0100 2.0200 2.0300 2.0400 2.0500 2.0600 2.0700 + 2.0800 2.0900 2.1000 2.1100 2.1200 2.1300 2.1400 2.1500 + 2.1600 2.1700 2.1800 2.1900 2.2000 2.2100 2.2200 2.2300 + 2.2400 2.2500 2.2600 2.2700 2.2800 2.2900 2.3000 2.3100 + 2.3200 2.3300 2.3400 2.3500 2.3600 2.3700 2.3800 2.3900 + 2.4000 2.4100 2.4200 2.4300 2.4400 2.4500 2.4600 2.4700 + 2.4800 2.4900 2.5000 2.5100 2.5200 2.5300 2.5400 2.5500 + 2.5600 2.5700 2.5800 2.5900 2.6000 2.6100 2.6200 2.6300 + 2.6400 2.6500 2.6600 2.6700 2.6800 2.6900 2.7000 2.7100 + 2.7200 2.7300 2.7400 2.7500 2.7600 2.7700 2.7800 2.7900 + 2.8000 2.8100 2.8200 2.8300 2.8400 2.8500 2.8600 2.8700 + 2.8800 2.8900 2.9000 2.9100 2.9200 2.9300 2.9400 2.9500 + 2.9600 2.9700 2.9800 2.9900 3.0000 3.0100 3.0200 3.0300 + 3.0400 3.0500 3.0600 3.0700 3.0800 3.0900 3.1000 3.1100 + 3.1200 3.1300 3.1400 3.1500 3.1600 3.1700 3.1800 3.1900 + 3.2000 3.2100 3.2200 3.2300 3.2400 3.2500 3.2600 3.2700 + 3.2800 3.2900 3.3000 3.3100 3.3200 3.3300 3.3400 3.3500 + 3.3600 3.3700 3.3800 3.3900 3.4000 3.4100 3.4200 3.4300 + 3.4400 3.4500 3.4600 3.4700 3.4800 3.4900 3.5000 3.5100 + 3.5200 3.5300 3.5400 3.5500 3.5600 3.5700 3.5800 3.5900 + 3.6000 3.6100 3.6200 3.6300 3.6400 3.6500 3.6600 3.6700 + 3.6800 3.6900 3.7000 3.7100 3.7200 3.7300 3.7400 3.7500 + 3.7600 3.7700 3.7800 3.7900 3.8000 3.8100 3.8200 3.8300 + 3.8400 3.8500 3.8600 3.8700 3.8800 3.8900 3.9000 3.9100 + 3.9200 3.9300 3.9400 3.9500 3.9600 3.9700 3.9800 3.9900 + 4.0000 4.0100 4.0200 4.0300 4.0400 4.0500 4.0600 4.0700 + 4.0800 4.0900 4.1000 4.1100 4.1200 4.1300 4.1400 4.1500 + 4.1600 4.1700 4.1800 4.1900 4.2000 4.2100 4.2200 4.2300 + 4.2400 4.2500 4.2600 4.2700 4.2800 4.2900 4.3000 4.3100 + 4.3200 4.3300 4.3400 4.3500 4.3600 4.3700 4.3800 4.3900 + 4.4000 4.4100 4.4200 4.4300 4.4400 4.4500 4.4600 4.4700 + 4.4800 4.4900 4.5000 4.5100 4.5200 4.5300 4.5400 4.5500 + 4.5600 4.5700 4.5800 4.5900 4.6000 4.6100 4.6200 4.6300 + 4.6400 4.6500 4.6600 4.6700 4.6800 4.6900 4.7000 4.7100 + 4.7200 4.7300 4.7400 4.7500 4.7600 4.7700 4.7800 4.7900 + 4.8000 4.8100 4.8200 4.8300 4.8400 4.8500 4.8600 4.8700 + 4.8800 4.8900 4.9000 4.9100 4.9200 4.9300 4.9400 4.9500 + 4.9600 4.9700 4.9800 4.9900 5.0000 5.0100 5.0200 5.0300 + 5.0400 5.0500 5.0600 5.0700 5.0800 5.0900 5.1000 5.1100 + 5.1200 5.1300 5.1400 5.1500 5.1600 5.1700 5.1800 5.1900 + 5.2000 5.2100 5.2200 5.2300 5.2400 5.2500 5.2600 5.2700 + 5.2800 5.2900 5.3000 5.3100 5.3200 5.3300 5.3400 5.3500 + 5.3600 5.3700 5.3800 5.3900 5.4000 5.4100 5.4200 5.4300 + 5.4400 5.4500 5.4600 5.4700 5.4800 5.4900 5.5000 5.5100 + 5.5200 5.5300 5.5400 5.5500 5.5600 5.5700 5.5800 5.5900 + 5.6000 5.6100 5.6200 5.6300 5.6400 5.6500 5.6600 5.6700 + 5.6800 5.6900 5.7000 5.7100 5.7200 5.7300 5.7400 5.7500 + 5.7600 5.7700 5.7800 5.7900 5.8000 5.8100 5.8200 5.8300 + 5.8400 5.8500 5.8600 5.8700 5.8800 5.8900 5.9000 5.9100 + 5.9200 5.9300 5.9400 5.9500 5.9600 5.9700 5.9800 5.9900 + 6.0000 6.0100 + + + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 + + + + -2.7605700345E+01 -3.0784865229E+01 -3.2349253618E+01 -3.2751366129E+01 + -3.2443703381E+01 -3.1938024293E+01 -3.1464309182E+01 -3.1081089156E+01 + -3.0780110534E+01 -3.0537539935E+01 -3.0331510013E+01 -3.0145737072E+01 + -2.9968950315E+01 -2.9793612997E+01 -2.9614858119E+01 -2.9429745358E+01 + -2.9236754295E+01 -2.9035419392E+01 -2.8826044018E+01 -2.8609460457E+01 + -2.8386823980E+01 -2.8159440471E+01 -2.7928630453E+01 -2.7695631454E+01 + -2.7461537210E+01 -2.7227268680E+01 -2.6993569183E+01 -2.6761015821E+01 + -2.6530039202E+01 -2.6300945472E+01 -2.6073936437E+01 -2.5849125236E+01 + -2.5626546546E+01 -2.5406161554E+01 -2.5187858066E+01 -2.4971448643E+01 + -2.4756666888E+01 -2.4543166280E+01 -2.4330521781E+01 -2.4118237688E+01 + -2.3905762462E+01 -2.3692510781E+01 -2.3477892157E+01 -2.3261343931E+01 + -2.3042365424E+01 -2.2820549497E+01 -2.2595607833E+01 -2.2367387034E+01 + -2.2135873927E+01 -2.1901189722E+01 -2.1663577130E+01 -2.1423377048E+01 + -2.1181003715E+01 -2.0936919717E+01 -2.0691610496E+01 -2.0445564221E+01 + -2.0199254652E+01 -1.9953130261E+01 -1.9707605286E+01 -1.9463057569E+01 + -1.9219826157E+01 -1.8978213343E+01 -1.8738487400E+01 -1.8500884660E+01 + -1.8265614596E+01 -1.8032862583E+01 -1.7802792920E+01 -1.7575552408E+01 + -1.7351272692E+01 -1.7130071760E+01 -1.6912056036E+01 -1.6697321537E+01 + -1.6485954716E+01 -1.6278033179E+01 -1.6073625719E+01 -1.5872792819E+01 + -1.5675586595E+01 -1.5482050684E+01 -1.5292220051E+01 -1.5106120725E+01 + -1.4923769479E+01 -1.4745173477E+01 -1.4570329881E+01 -1.4399225454E+01 + -1.4231836134E+01 -1.4068126609E+01 -1.3908049886E+01 -1.3751546850E+01 + -1.3598545829E+01 -1.3448962145E+01 -1.3302697611E+01 -1.3159640031E+01 + -1.3019669910E+01 -1.2882669787E+01 -1.2748527869E+01 -1.2617137724E+01 + -1.2488398068E+01 -1.2362212574E+01 -1.2238489692E+01 -1.2117142884E+01 + -1.1998090066E+01 -1.1881253628E+01 -1.1766560302E+01 -1.1653941032E+01 + -1.1543330569E+01 -1.1434668196E+01 -1.1327896756E+01 -1.1222962743E+01 + -1.1119816109E+01 -1.1018409929E+01 -1.0918701041E+01 -1.0820648952E+01 + -1.0724215912E+01 -1.0629366457E+01 -1.0536068056E+01 -1.0444290028E+01 + -1.0354003461E+01 -1.0265180964E+01 -1.0177796938E+01 -1.0091826632E+01 + -1.0007246112E+01 -9.9240322892E+00 -9.8421624187E+00 -9.7616139299E+00 + -9.6823643703E+00 -9.6043910435E+00 -9.5276710191E+00 -9.4521810563E+00 + -9.3778971539E+00 -9.3047950086E+00 -9.2328496504E+00 -9.1620363695E+00 + -9.0923305110E+00 -9.0237077361E+00 -8.9561431451E+00 -8.8896116158E+00 + -8.8240890211E+00 -8.7595512275E+00 -8.6959740871E+00 -8.6333343002E+00 + -8.5716086751E+00 -8.5107748378E+00 -8.4508110921E+00 -8.3916960209E+00 + -8.3334097570E+00 -8.2759323779E+00 -8.2192454990E+00 -8.1633312824E+00 + -8.1081727717E+00 -8.0537547331E+00 -8.0000623436E+00 -7.9470813275E+00 + -7.8947972321E+00 -7.8431966714E+00 -7.7922661900E+00 -7.7419928953E+00 + -7.6923641381E+00 -7.6433675558E+00 -7.5949912477E+00 -7.5472233618E+00 + -7.5000526824E+00 -7.4534678545E+00 -7.4074582876E+00 -7.3620131113E+00 + -7.3171223055E+00 -7.2727754717E+00 -7.2289631023E+00 -7.1856752817E+00 + -7.1429029518E+00 -7.1006366576E+00 -7.0588677730E+00 -7.0175872653E+00 + -6.9767869231E+00 -6.9364581153E+00 -6.8965930059E+00 -6.8571833718E+00 + -6.8182217002E+00 -6.7797001743E+00 -6.7416115702E+00 -6.7039484718E+00 + -6.6667039108E+00 -6.6298708673E+00 -6.5934425974E+00 -6.5574124728E+00 + -6.5217739457E+00 -6.4865207734E+00 -6.4516465808E+00 -6.4171455001E+00 + -6.3830113137E+00 -6.3492384567E+00 -6.3158210267E+00 -6.2827535725E+00 + -6.2500305645E+00 -6.2176466374E+00 -6.1855966333E+00 -6.1538752555E+00 + -6.1224776754E+00 -6.0913987519E+00 -6.0606338291E+00 -6.0301780858E+00 + -6.0000268845E+00 -5.9701757684E+00 -5.9406201055E+00 -5.9113557302E+00 + -5.8823781953E+00 -5.8536833983E+00 -5.8252672254E+00 -5.7971255362E+00 + -5.7692545325E+00 -5.7416501530E+00 -5.7143087187E+00 -5.6872264675E+00 + -5.6603996483E+00 -5.6338248102E+00 -5.6074982583E+00 -5.5814166408E+00 + -5.5555765569E+00 -5.5299745536E+00 -5.5046075112E+00 -5.4794720848E+00 + -5.4545651655E+00 -5.4298837212E+00 -5.4054245210E+00 -5.3811847580E+00 + -5.3571614267E+00 -5.3333515869E+00 -5.3097525260E+00 -5.2863613325E+00 + -5.2631753334E+00 -5.2401918998E+00 -5.2174082208E+00 -5.1948218607E+00 + -5.1724302389E+00 -5.1502307471E+00 -5.1282210592E+00 -5.1063986772E+00 + -5.0847611945E+00 -5.0633063698E+00 -5.0420317959E+00 -5.0209352464E+00 + -5.0000145619E+00 -4.9792674276E+00 -4.9586917756E+00 -4.9382855278E+00 + -4.9180464624E+00 -4.8979726494E+00 -4.8780620924E+00 -4.8583126624E+00 + -4.8387225484E+00 -4.8192898345E+00 -4.8000124892E+00 -4.7808887980E+00 + -4.7619169283E+00 -4.7430949440E+00 -4.7244212124E+00 -4.7058939893E+00 + -4.6875114188E+00 -4.6692719493E+00 -4.6511739183E+00 -4.6332155580E+00 + -4.6153953755E+00 -4.5977117925E+00 -4.5801631296E+00 -4.5627479386E+00 + -4.5454647266E+00 -4.5283119032E+00 -4.5112880519E+00 -4.4943917650E+00 + -4.4776215414E+00 -4.4609759844E+00 -4.4444537713E+00 -4.4280534916E+00 + -4.4117737574E+00 -4.3956133298E+00 -4.3795708900E+00 -4.3636450498E+00 + -4.3478346519E+00 -4.3321384475E+00 -4.3165551080E+00 -4.3010834883E+00 + -4.2857224193E+00 -4.2704706626E+00 -4.2553270471E+00 -4.2402904912E+00 + -4.2253598492E+00 -4.2105339172E+00 -4.1958116967E+00 -4.1811921057E+00 + -4.1666739956E+00 -4.1522563551E+00 -4.1379381819E+00 -4.1237184204E+00 + -4.1095960051E+00 -4.0955700209E+00 -4.0816394841E+00 -4.0678033425E+00 + -4.0540606926E+00 -4.0404106187E+00 -4.0268521620E+00 -4.0133843475E+00 + -4.0000063484E+00 -3.9867172703E+00 -3.9735161622E+00 -3.9604021828E+00 + -3.9473745101E+00 -3.9344322882E+00 -3.9215745909E+00 -3.9088006833E+00 + -3.8961097526E+00 -3.8835009538E+00 -3.8709734686E+00 -3.8585265734E+00 + -3.8461594934E+00 -3.8338713986E+00 -3.8216615661E+00 -3.8095292837E+00 + -3.7974738126E+00 -3.7854943426E+00 -3.7735902317E+00 -3.7617607813E+00 + -3.7500052762E+00 -3.7383229617E+00 -3.7267132311E+00 -3.7151754129E+00 + -3.7037088125E+00 -3.6923127373E+00 -3.6809865997E+00 -3.6697297595E+00 + -3.6585415452E+00 -3.6474213158E+00 -3.6363685045E+00 -3.6253825007E+00 + -3.6144626587E+00 -3.6036083788E+00 -3.5928191167E+00 -3.5820942902E+00 + -3.5714332815E+00 -3.5608355222E+00 -3.5503004929E+00 -3.5398276385E+00 + -3.5294163709E+00 -3.5190661440E+00 -3.5087764652E+00 -3.4985468053E+00 + -3.4883766076E+00 -3.4782653400E+00 -3.4682125383E+00 -3.4582176981E+00 + -3.4482802961E+00 -3.4383998061E+00 -3.4285757940E+00 -3.4188077789E+00 + -3.4090952728E+00 -3.3994377480E+00 -3.3898348019E+00 -3.3802859760E+00 + -3.3707908119E+00 -3.3613487964E+00 -3.3519595367E+00 -3.3426226031E+00 + -3.3333375585E+00 -3.3241039280E+00 -3.3149213002E+00 -3.3057892823E+00 + -3.2967074576E+00 -3.2876753919E+00 -3.2786926486E+00 -3.2697588729E+00 + -3.2608736674E+00 -3.2520366348E+00 -3.2432473253E+00 -3.2345054052E+00 + -3.2258105008E+00 -3.2171622335E+00 -3.2085601965E+00 -3.2000040171E+00 + -3.1914933640E+00 -3.1830278760E+00 -3.1746071920E+00 -3.1662308963E+00 + -3.1578986987E+00 -3.1496102547E+00 -3.1413652201E+00 -3.1331632249E+00 + -3.1250039281E+00 -3.1168870307E+00 -3.1088122044E+00 -3.1007791210E+00 + -3.0927874062E+00 -3.0848367838E+00 -3.0769269476E+00 -3.0690575847E+00 + -3.0612283700E+00 -3.0534389657E+00 -3.0456891132E+00 -3.0379785141E+00 + -3.0303068700E+00 -3.0226738555E+00 -3.0150791818E+00 -3.0075225888E+00 + -3.0000037918E+00 -2.9925225065E+00 -2.9850784103E+00 -2.9776712548E+00 + -2.9703007806E+00 -2.9629667163E+00 -2.9556687906E+00 -2.9484066870E+00 + -2.9411801890E+00 -2.9339890404E+00 -2.9268329824E+00 -2.9197117526E+00 + -2.9126250543E+00 -2.9055726836E+00 -2.8985543940E+00 -2.8915699388E+00 + -2.8846190644E+00 -2.8777014940E+00 -2.8708170314E+00 -2.8639654413E+00 + -2.8571464888E+00 -2.8503599315E+00 -2.8436055055E+00 -2.8368830243E+00 + -2.8301922637E+00 -2.8235329996E+00 -2.8169050030E+00 -2.8103080169E+00 + -2.8037418662E+00 -2.7972063374E+00 -2.7907012166E+00 -2.7842262903E+00 + -2.7777813024E+00 -2.7713660913E+00 -2.7649804532E+00 -2.7586241845E+00 + -2.7522970813E+00 -2.7459989054E+00 -2.7397294879E+00 -2.7334886419E+00 + -2.7272761732E+00 -2.7210918876E+00 -2.7149355663E+00 -2.7088070278E+00 + -2.7027061039E+00 -2.6966326094E+00 -2.6905863591E+00 -2.6845671557E+00 + -2.6785748003E+00 -2.6726091446E+00 -2.6666700119E+00 -2.6607572257E+00 + -2.6548706095E+00 -2.6490099504E+00 -2.6431751131E+00 -2.6373659318E+00 + -2.6315822382E+00 -2.6258238639E+00 -2.6200906210E+00 -2.6143823457E+00 + -2.6086988964E+00 -2.6030401127E+00 -2.5974058340E+00 -2.5917958991E+00 + -2.5862101123E+00 -2.5806483565E+00 -2.5751104788E+00 -2.5695963262E+00 + -2.5641057455E+00 -2.5586385667E+00 -2.5531946375E+00 -2.5477738314E+00 + -2.5423760028E+00 -2.5370010057E+00 -2.5316486943E+00 -2.5263188926E+00 + -2.5210114847E+00 -2.5157263372E+00 -2.5104633109E+00 -2.5052222669E+00 + -2.5000030605E+00 -2.4948055297E+00 -2.4896295712E+00 -2.4844750523E+00 + -2.4793418405E+00 -2.4742298031E+00 -2.4691387940E+00 -2.4640686757E+00 + -2.4590193426E+00 -2.4539906681E+00 -2.4489825259E+00 -2.4439947896E+00 + -2.4390273136E+00 -2.4340799794E+00 -2.4291526807E+00 -2.4242452972E+00 + -2.4193577083E+00 -2.4144897934E+00 -2.4096414103E+00 -2.4048124528E+00 + -2.4000028171E+00 -2.3952123882E+00 -2.3904410511E+00 -2.3856886909E+00 + -2.3809551705E+00 -2.3762403912E+00 -2.3715442531E+00 -2.3668666465E+00 + -2.3622074621E+00 -2.3575665900E+00 -2.3529439004E+00 -2.3483392967E+00 + -2.3437526852E+00 -2.3391839614E+00 -2.3346330208E+00 -2.3300997590E+00 + -2.3255840547E+00 -2.3210858091E+00 -2.3166049363E+00 -2.3121413368E+00 + -2.3076949109E+00 -2.3032655590E+00 -2.2988531707E+00 -2.2944576400E+00 + -2.2900788908E+00 -2.2857168282E+00 -2.2813713571E+00 -2.2770423826E+00 + -2.2727298068E+00 -2.2684335124E+00 -2.2641534347E+00 -2.2598894829E+00 + -2.2556415666E+00 -2.2514095953E+00 -2.2471934785E+00 -2.2429931038E+00 + -2.2388083992E+00 -2.2346392847E+00 -2.2304856742E+00 -2.2263474813E+00 + -2.2222246197E+00 -2.2181169931E+00 -2.2140245088E+00 -2.2099471023E+00 + -2.2058846913E+00 -2.2018371933E+00 -2.1978045263E+00 -2.1937866078E+00 + -2.1897833323E+00 -2.1857946406E+00 -2.1818204576E+00 -2.1778607050E+00 + -2.1739153043E+00 -2.1699841770E+00 -2.1660672366E+00 -2.1621643955E+00 + -2.1582755972E+00 -2.1544007668E+00 -2.1505398296E+00 -2.1466927107E+00 + -2.1428593354E+00 -2.1390396118E+00 -2.1352334757E+00 -2.1314408644E+00 + -2.1276617067E+00 -2.1238959313E+00 -2.1201434667E+00 -2.1164042418E+00 + -2.1126781618E+00 -2.1089651802E+00 -2.1052652307E+00 -2.1015782452E+00 + -2.0979041558E+00 -2.0942428944E+00 -2.0905943898E+00 -2.0869585565E+00 + -2.0833353508E+00 -2.0797247079E+00 -2.0761265629E+00 -2.0725408510E+00 + -2.0689675074E+00 -2.0654064613E+00 -2.0618576366E+00 -2.0583209894E+00 + -2.0547964579E+00 -2.0512839803E+00 -2.0477834948E+00 -2.0442949396E+00 + -2.0408182464E+00 -2.0373533437E+00 -2.0339001895E+00 -2.0304587249E+00 + -2.0270288910E+00 -2.0236106288E+00 -2.0202038794E+00 -2.0168085786E+00 + -2.0134246558E+00 -2.0100520723E+00 -2.0066907719E+00 -2.0033406985E+00 + -2.0000017959E+00 -1.9966740079E+00 + + + + 0.0000000000E+00 -8.2277987587E-02 -1.6449650094E-01 -2.4659331589E-01 + -3.2850076507E-01 -4.1014315697E-01 -4.9143436126E-01 -5.7227561145E-01 + -6.5255357242E-01 -7.3213871601E-01 -8.1088404273E-01 -8.8862418182E-01 + -9.6517489579E-01 -1.0403330086E+00 -1.1138767696E+00 -1.1855666583E+00 + -1.2551466268E+00 -1.3223457701E+00 -1.3868804065E+00 -1.4484565448E+00 + -1.5067727038E+00 -1.5615230499E+00 -1.6124008059E+00 -1.6591018874E+00 + -1.7013287065E+00 -1.7387940878E+00 -1.7712252542E+00 -1.7983677872E+00 + -1.8199895278E+00 -1.8358843512E+00 -1.8458757490E+00 -1.8498201626E+00 + -1.8476100093E+00 -1.8391763180E+00 -1.8244910913E+00 -1.8035689946E+00 + -1.7764688338E+00 -1.7432942635E+00 -1.7041941790E+00 -1.6593624450E+00 + -1.6090370910E+00 -1.5534989864E+00 -1.4930699667E+00 -1.4281104400E+00 + -1.3590165014E+00 -1.2862165869E+00 -1.2101677086E+00 -1.1313513155E+00 + -1.0502688403E+00 -9.6743710159E-01 -8.8338307362E-01 -7.9863905513E-01 + -7.1373774907E-01 -6.2920651981E-01 -5.4556280508E-01 -4.6330924845E-01 + -3.8292814427E-01 -3.0487830138E-01 -2.2958906110E-01 -1.5745833560E-01 + -8.8847539142E-02 -2.4079508545E-02 3.6563691834E-02 9.2844371601E-02 + 1.4456869600E-01 1.9158861786E-01 2.3380285278E-01 2.7115554880E-01 + 3.0363571638E-01 3.3127718718E-01 3.5415591151E-01 3.7238794759E-01 + 3.8612701355E-01 3.9556147997E-01 4.0091144918E-01 4.0242475349E-01 + 4.0037331823E-01 3.9504921005E-01 3.8676054393E-01 3.7582731451E-01 + 3.6257720433E-01 3.4734141910E-01 3.3045059692E-01 3.1223083453E-01 + 2.9299986887E-01 2.7306344758E-01 2.5271191615E-01 2.3221704416E-01 + 2.1182910699E-01 1.9177423337E-01 1.7225200095E-01 1.5343329037E-01 + 1.3546088278E-01 1.1845195585E-01 1.0249965400E-01 8.7673842851E-02 + 7.4022153762E-02 6.1571422473E-02 5.0329214779E-02 4.0284462837E-02 + 3.1410783526E-02 2.3667878040E-02 1.7003522416E-02 1.1355567187E-02 + 6.6538808501E-03 2.8220678737E-03 -2.2001240793E-04 -2.5547866842E-03 + -4.2654366871E-03 -5.4349451843E-03 -6.1429431867E-03 -6.4660691080E-03 + -6.4767064284E-03 -6.2432624449E-03 -5.8262992394E-03 -5.2807905609E-03 + -4.6556441299E-03 -3.9940297562E-03 -3.3299352117E-03 -2.6921631841E-03 + -2.1041805481E-03 -1.5819270303E-03 -1.1356467997E-03 -7.7141771203E-04 + -4.9002008278E-04 -2.8685599057E-04 -1.5440700844E-04 -8.1295680504E-05 + -5.2958831332E-05 -4.9024979272E-05 -2.2654023957E-05 2.0802206378E-06 + 1.6220072646E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 -1.1723087215E-02 -2.2970588285E-02 -3.3277762775E-02 + -4.2201369170E-02 -4.9329936250E-02 -5.4293469599E-02 -5.6772419538E-02 + -5.6505748973E-02 -5.3297954463E-02 -4.7024911330E-02 -3.7638432778E-02 + -2.5169454710E-02 -9.7297804400E-03 8.4876559486E-03 2.9210025055E-02 + 5.2087327705E-02 7.6696576823E-02 1.0254737811E-01 1.2908882978E-01 + 1.5571763119E-01 1.8178728239E-01 2.0661822255E-01 2.2950875795E-01 + 2.4974659019E-01 2.6662075364E-01 2.7943382524E-01 2.8751410085E-01 + 2.9022762150E-01 2.8698983512E-01 2.7727667838E-01 2.6063490065E-01 + 2.3669144662E-01 2.0516162976E-01 1.6585646477E-01 1.1868792319E-01 + 6.3673539750E-02 9.3865644130E-04 -6.9282296205E-02 -1.4664653237E-01 + -2.3070525508E-01 -3.2090755014E-01 -4.1660590836E-01 -5.1706326588E-01 + -6.2146146368E-01 -7.2891100660E-01 -8.3846198150E-01 -9.4911597183E-01 + -1.0598387764E+00 -1.1695734189E+00 -1.2772547958E+00 -1.3818230208E+00 + -1.4822368409E+00 -1.5774891053E+00 -1.6666187728E+00 -1.7487234696E+00 + -1.8229735575E+00 -1.8886194365E+00 -1.9450060422E+00 -1.9915764523E+00 + -2.0278831780E+00 -2.0535914046E+00 -2.0684822557E+00 -2.0724589319E+00 + -2.0655426479E+00 -2.0478740211E+00 -2.0197115502E+00 -1.9814248238E+00 + -1.9334892505E+00 -1.8764808008E+00 -1.8110656211E+00 -1.7379906968E+00 + -1.6580733899E+00 -1.5721902388E+00 -1.4812642140E+00 -1.3862522622E+00 + -1.2881324457E+00 -1.1878908963E+00 -1.0865088556E+00 -9.8494996663E-01 + -8.8414798922E-01 -7.8499509134E-01 -6.8833085835E-01 -5.9493213952E-01 + -5.0550383294E-01 -4.2067068746E-01 -3.4097017799E-01 -2.6684648767E-01 + -1.9864560686E-01 -1.3661153627E-01 -8.0883449121E-02 -3.1493861467E-02 + 1.1620322833E-02 4.8599589644E-02 7.9650226738E-02 1.0503788587E-01 + 1.2508039801E-01 1.4013995079E-01 1.5061541504E-01 1.5693366067E-01 + 1.5954043230E-01 1.5889246200E-01 1.5544945597E-01 1.4966651822E-01 + 1.4199014613E-01 1.3284299597E-01 1.2262519169E-01 1.1170778401E-01 + 1.0042928223E-01 8.9095504256E-02 7.7963775928E-02 6.7255547029E-02 + 5.7152141457E-02 4.7799764163E-02 3.9294804857E-02 3.1701123437E-02 + 2.5050278343E-02 1.9344675342E-02 1.4551822257E-02 1.0621676019E-02 + 7.4866418173E-03 5.0616443312E-03 3.2542385947E-03 1.9673338834E-03 + 1.1012904675E-03 5.6303386455E-04 2.6418408232E-04 1.2416036016E-04 + 8.3638494781E-05 8.3445532246E-05 3.9712888830E-05 -3.5905440177E-06 + -2.7996494097E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 3.5860269827E-03 1.4317078272E-02 3.2112256128E-02 + 5.6837367274E-02 8.8305873299E-02 1.2628021312E-01 1.7047348950E-01 + 2.2055150919E-01 2.7613516420E-01 3.3680313934E-01 4.0209492899E-01 + 4.7151414403E-01 5.4453208758E-01 6.2059157645E-01 6.9911098297E-01 + 7.7948847033E-01 8.6110639245E-01 9.4333582837E-01 1.0255412195E+00 + 1.1070850756E+00 1.1873327175E+00 1.2656570189E+00 1.3414431144E+00 + 1.4140930355E+00 1.4830302391E+00 1.5477039940E+00 1.6075935868E+00 + 1.6622123152E+00 1.7111112337E+00 1.7538826190E+00 1.7901631245E+00 + 1.8196365952E+00 1.8420365276E+00 1.8571481070E+00 1.8648098949E+00 + 1.8649150077E+00 1.8574119504E+00 1.8423049075E+00 1.8196536236E+00 + 1.7895728317E+00 1.7522312003E+00 1.7078498355E+00 1.6567003418E+00 + 1.5991024567E+00 1.5354212770E+00 1.4660641009E+00 1.3914769134E+00 + 1.3121405542E+00 1.2285667331E+00 1.1412932403E+00 1.0508797039E+00 + 9.5790298913E-01 8.6295169350E-01 7.6662172078E-01 6.6951129918E-01 + 5.7221537424E-01 4.7532181715E-01 3.7940524579E-01 2.8502383408E-01 + 1.9271369849E-01 1.0298539150E-01 1.6320224853E-02 -6.6834318537E-02 + -1.4606648327E-01 -2.2100368547E-01 -2.9131520005E-01 -3.5671342275E-01 + -4.1695549560E-01 -4.7184486654E-01 -5.2123135255E-01 -5.6501133337E-01 + -6.0312746230E-01 -6.3556796384E-01 -6.6236527842E-01 -6.8359449970E-01 + -6.9937142322E-01 -7.0985023488E-01 -7.1522090252E-01 -7.1570630926E-01 + -7.1155917402E-01 -7.0305880711E-01 -6.9050775058E-01 -6.7422835456E-01 + -6.5455934146E-01 -6.3185241011E-01 -6.0646893131E-01 -5.7877678564E-01 + -5.4914739239E-01 -5.1795297687E-01 -4.8556415192E-01 -4.5234782509E-01 + -4.1866194064E-01 -3.8484854594E-01 -3.5122924483E-01 -3.1810273720E-01 + -2.8574272301E-01 -2.5439648427E-01 -2.2428377777E-01 -1.9559309794E-01 + -1.6848457254E-01 -1.4308867914E-01 -1.1950650654E-01 -9.7810361217E-02 + -7.8045864567E-02 -6.0228944123E-02 -4.4352023434E-02 -3.0384350338E-02 + -1.8273960617E-02 -7.9495883994E-03 6.7759973479E-04 7.7099198058E-03 + 1.3261526160E-02 1.7457218324E-02 2.0427124578E-02 2.2305646179E-02 + 2.3229681315E-02 2.3338002873E-02 2.2762351834E-02 2.1631893993E-02 + 2.0072411241E-02 1.8198596607E-02 1.6115058374E-02 1.3919754929E-02 + 1.1698898123E-02 9.5228516845E-03 7.4546618226E-03 5.5452981103E-03 + 3.8288793415E-03 2.3331720374E-03 1.0736899984E-03 5.2926998136E-05 + -7.3149996906E-04 -1.2929678601E-03 -1.6511600028E-03 -1.8297965622E-03 + -1.8585360541E-03 -1.7678438403E-03 -1.5911002682E-03 -1.3586955246E-03 + -1.1019690505E-03 -8.4702839256E-04 -6.1497715279E-04 -4.2541468309E-04 + -2.8402093044E-04 -1.9725198792E-04 -1.6029137555E-04 -1.5177315345E-04 + -8.9838576118E-05 -5.4771430827E-06 9.6147639048E-06 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 9.2893242255E-04 3.7019764676E-03 8.2779769445E-03 + 1.4588689808E-02 2.2539302945E-02 3.2009163013E-02 4.2852705981E-02 + 5.4900588274E-02 6.7961014587E-02 8.1821257513E-02 9.6249363136E-02 + 1.1099603565E-01 1.2579669284E-01 1.4037368313E-01 1.5443865322E-01 + 1.6769505435E-01 1.7984077312E-01 1.9057087191E-01 1.9958042202E-01 + 2.0656741042E-01 2.1123570101E-01 2.1329802783E-01 2.1247899806E-01 + 2.0851807950E-01 2.0117254726E-01 1.9022036400E-01 1.7546296384E-01 + 1.5672791414E-01 1.3387142592E-01 1.0678068413E-01 7.5375969726E-02 + 3.9612545899E-02 -5.1771162367E-04 -4.4984990254E-02 -9.3720492346E-02 + -1.4661576728E-01 -2.0352233418E-01 -2.6425172921E-01 -3.2857590175E-01 + -3.9622799242E-01 -4.6690352048E-01 -5.4026196118E-01 -6.1592871460E-01 + -6.9349745874E-01 -7.7253287529E-01 -8.5257373131E-01 -9.3313629426E-01 + -1.0137180499E+00 -1.0938015836E+00 -1.1728591565E+00 -1.2503568716E+00 + -1.3257591460E+00 -1.3985339592E+00 -1.4681572088E+00 -1.5341175221E+00 + -1.5959215886E+00 -1.6530979289E+00 -1.7052026499E+00 -1.7518226198E+00 + -1.7925806287E+00 -1.8271386946E+00 -1.8552014319E+00 -1.8765200508E+00 + -1.8908940379E+00 -1.8981739659E+00 -1.8982634918E+00 -1.8911201167E+00 + -1.8767560905E+00 -1.8552388890E+00 -1.8266905450E+00 -1.7912868237E+00 + -1.7492558153E+00 -1.7008761570E+00 -1.6464740899E+00 -1.5864208426E+00 + -1.5211291980E+00 -1.4510496961E+00 -1.3766664971E+00 -1.2984929459E+00 + -1.2170668968E+00 -1.1329458601E+00 -1.0467020356E+00 -9.5891730044E-01 + -8.7017821889E-01 -7.8107114433E-01 -6.9217748077E-01 -6.0406917196E-01 + -5.1730448344E-01 -4.3242413992E-01 -3.4994793756E-01 -2.7037179974E-01 + -1.9415879235E-01 -1.2172780433E-01 -5.3447524144E-02 1.0365478214E-02 + 6.9448141778E-02 1.2359143475E-01 1.7264050244E-01 2.1649715017E-01 + 2.5511519340E-01 2.8850025641E-01 3.1670773256E-01 3.3984027408E-01 + 3.5804463559E-01 3.7150996533E-01 3.8046133188E-01 3.8515667437E-01 + 3.8588276317E-01 3.8295243350E-01 3.7669486668E-01 3.6745451357E-01 + 3.5558583975E-01 3.4145309072E-01 3.2541361978E-01 3.0782259726E-01 + 2.8902885306E-01 2.6937446596E-01 2.4917322584E-01 2.2872577817E-01 + 2.0831749242E-01 1.8820101658E-01 1.6860103788E-01 1.4972254242E-01 + 1.3173967350E-01 1.1478834281E-01 9.8985070983E-02 8.4416837992E-02 + 7.1132442003E-02 5.9164183104E-02 4.8515945607E-02 3.9162908641E-02 + 3.1067102133E-02 2.4166226359E-02 1.8383581049E-02 1.3631066681E-02 + 9.8082692597E-03 6.8108066814E-03 4.5261412594E-03 2.8479629339E-03 + 1.6647468801E-03 8.7544647586E-04 3.8748703362E-04 1.0892680591E-04 + -2.3425222903E-05 -7.7922079727E-05 -9.4002294959E-05 -9.5906384375E-05 + -5.6988379155E-05 -3.5463910332E-06 5.9608986436E-06 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 1.9514303897E+01 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 2.7522534413E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 -9.6137176497E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 -3.2324794045E+00 + + + + + + 0.0000000000E+00 2.4555322044E-04 9.9435596078E-04 2.2826802809E-03 + 4.1704577663E-03 6.7405039734E-03 1.0097446971E-02 1.4366374033E-02 + 1.9691214178E-02 2.6232877622E-02 3.4167176269E-02 4.3682552029E-02 + 5.4977642082E-02 6.8258712011E-02 8.3736989112E-02 1.0162592925E-01 + 1.2213845080E-01 1.4548416964E-01 1.7186666804E-01 2.0148082992E-01 + 2.3451027351E-01 2.7112491013E-01 3.1147865648E-01 3.5570732483E-01 + 4.0392671304E-01 4.5623091264E-01 5.1269085328E-01 5.7335309214E-01 + 6.3823886033E-01 7.0734337238E-01 7.8063540062E-01 8.5805711439E-01 + 9.3952417996E-01 1.0249261017E+00 1.1141268534E+00 1.2069656628E+00 + 1.3032581166E+00 1.4027973581E+00 1.5053555697E+00 1.6106855669E+00 + 1.7185225365E+00 1.8285859201E+00 1.9405813920E+00 2.0542029191E+00 + 2.1691348784E+00 2.2850542133E+00 2.4016326049E+00 2.5185386399E+00 + 2.6354399503E+00 2.7520052604E+00 2.8679065939E+00 2.9828210875E+00 + 3.0964328328E+00 3.2084348565E+00 3.3185305939E+00 3.4264354515E+00 + 3.5318783577E+00 3.6346027795E+00 3.7343681356E+00 3.8309505035E+00 + 3.9241436467E+00 4.0137595888E+00 4.0996291450E+00 4.1816023622E+00 + 4.2595486912E+00 4.3333571276E+00 4.4029361120E+00 4.4682134089E+00 + 4.5291358858E+00 4.5856689029E+00 4.6377959244E+00 4.6855179084E+00 + 4.7288525836E+00 4.7678337886E+00 4.8025102209E+00 4.8329448489E+00 + 4.8592138549E+00 4.8814055976E+00 4.8996195505E+00 4.9139652152E+00 + 4.9245610181E+00 4.9315332006E+00 4.9350147101E+00 4.9351441007E+00 + 4.9320644514E+00 4.9259223085E+00 4.9168666605E+00 4.9050479496E+00 + 4.8906171284E+00 4.8737247647E+00 4.8545202011E+00 4.8331507724E+00 + 4.8097610853E+00 4.7844923629E+00 4.7574818564E+00 4.7288623255E+00 + 4.6987615887E+00 4.6673022280E+00 4.6346013382E+00 4.6007695137E+00 + 4.5659116073E+00 4.5301262966E+00 4.4935060361E+00 4.4561370652E+00 + 4.4180998488E+00 4.3794678786E+00 4.3403092049E+00 4.3006862196E+00 + 4.2606559084E+00 4.2202701844E+00 4.1795755629E+00 4.1386143513E+00 + 4.0974246608E+00 4.0560406954E+00 4.0144930190E+00 3.9728092235E+00 + 3.9310140868E+00 3.8891296584E+00 3.8471763585E+00 3.8051727118E+00 + 3.7631353587E+00 3.7210801524E+00 3.6790222306E+00 3.6369754752E+00 + 3.5949532922E+00 3.5529695496E+00 3.5110371051E+00 3.4691686011E+00 + 3.4273777892E+00 3.3856773650E+00 3.3440802075E+00 3.3026002179E+00 + 3.2612500462E+00 3.2200431162E+00 3.1789931977E+00 3.1381126416E+00 + 3.0974153228E+00 3.0569141416E+00 3.0166213097E+00 2.9765501384E+00 + 2.9367121016E+00 2.8971193603E+00 2.8577833885E+00 2.8187144722E+00 + 2.7799237680E+00 2.7414203117E+00 2.7032138975E+00 2.6653129770E+00 + 2.6277254184E+00 2.5904592077E+00 2.5535203424E+00 2.5169161760E+00 + 2.4806515332E+00 2.4447325241E+00 2.4091633992E+00 2.3739487914E+00 + 2.3390925610E+00 2.3045979624E+00 2.2704685078E+00 2.2367061977E+00 + 2.2033142099E+00 2.1702934279E+00 2.1376466921E+00 2.1053739087E+00 + 2.0734775689E+00 2.0419567389E+00 2.0108135020E+00 1.9800463428E+00 + 1.9496568192E+00 1.9196429197E+00 1.8900057747E+00 1.8607428608E+00 + 1.8318549701E+00 1.8033391361E+00 1.7751957603E+00 1.7474216534E+00 + 1.7200166764E+00 1.6929775891E+00 1.6663036438E+00 1.6399916950E+00 + 1.6140403080E+00 1.5884465799E+00 1.5632083065E+00 1.5383229695E+00 + 1.5137875184E+00 1.4895999441E+00 1.4657562937E+00 1.4422551560E+00 + 1.4190916630E+00 1.3962646344E+00 1.3737695287E+00 1.3516041505E+00 + 1.3297648393E+00 1.3082482527E+00 1.2870517468E+00 1.2661707761E+00 + 1.2456035241E+00 1.2253449792E+00 1.2053930652E+00 1.1857436665E+00 + 1.1663933299E+00 1.1473392986E+00 1.1285766929E+00 1.1101036434E+00 + 1.0919153412E+00 1.0740090637E+00 1.0563813566E+00 1.0390278824E+00 + 1.0219464881E+00 1.0051322370E+00 9.8858273586E-01 9.7229433753E-01 + 9.5626288454E-01 9.4048618717E-01 9.2495945205E-01 9.0968023104E-01 + 8.9464515722E-01 8.7984988668E-01 8.6529242529E-01 8.5096836827E-01 + 8.3687483992E-01 8.2300917666E-01 8.0936653060E-01 7.9594527075E-01 + 7.8274162686E-01 7.6975194584E-01 7.5697415488E-01 7.4440404132E-01 + 7.3203906033E-01 7.1987668706E-01 7.0791241321E-01 6.9614463944E-01 + 6.8457015681E-01 6.7318513862E-01 6.6198789975E-01 6.5097491802E-01 + 6.4014312669E-01 6.2949060514E-01 6.1901366286E-01 6.0870987684E-01 + 5.9857713213E-01 5.8861165082E-01 5.7881152804E-01 5.6917450923E-01 + 5.5969679766E-01 5.5037688431E-01 5.4121243428E-01 5.3219968832E-01 + 5.2333742019E-01 5.1462325731E-01 5.0605357159E-01 4.9762726943E-01 + 4.8934201433E-01 4.8119433956E-01 4.7318319951E-01 4.6530638099E-01 + 4.5756049431E-01 4.4994457445E-01 4.4245651371E-01 4.3509310405E-01 + 4.2785330791E-01 4.2073518522E-01 4.1373575057E-01 4.0685380826E-01 + 4.0008762412E-01 3.9343446965E-01 3.8689291717E-01 3.8046146824E-01 + 3.7413768570E-01 3.6791984300E-01 3.6180669955E-01 3.5579614205E-01 + 3.4988609008E-01 3.4407557281E-01 3.3836282768E-01 3.3274538488E-01 + 3.2722254123E-01 3.2179272713E-01 3.1645359987E-01 3.1120418021E-01 + 3.0604318897E-01 3.0096867591E-01 2.9597910956E-01 2.9107357482E-01 + 2.8625054370E-01 2.8150791508E-01 2.7684511501E-01 2.7226081425E-01 + 2.6775306980E-01 2.6332090390E-01 2.5896332932E-01 2.5467885571E-01 + 2.5046582167E-01 2.4632363995E-01 2.4225111660E-01 2.3824645700E-01 + 2.3430890125E-01 2.3043753190E-01 2.2663103075E-01 2.2288787866E-01 + 2.1920758650E-01 2.1558909889E-01 2.1203087347E-01 2.0853209698E-01 + 2.0509203703E-01 2.0170965015E-01 1.9838332245E-01 1.9511274762E-01 + 1.9189700637E-01 1.8873489405E-01 1.8562532983E-01 1.8256784638E-01 + 1.7956156317E-01 1.7660516721E-01 1.7369802148E-01 1.7083951993E-01 + 1.6802882312E-01 1.6526455844E-01 1.6254643724E-01 1.5987374760E-01 + 1.5724562162E-01 1.5466088112E-01 1.5211928277E-01 1.4962011532E-01 + 1.4716247731E-01 1.4474543496E-01 1.4236869347E-01 1.4003158209E-01 + 1.3773319599E-01 1.3547277982E-01 1.3325001085E-01 1.3106425897E-01 + 1.2891464189E-01 1.2680052175E-01 1.2472157135E-01 1.2267720085E-01 + 1.2066657246E-01 1.1868911133E-01 1.1674450739E-01 1.1483221045E-01 + 1.1295144579E-01 1.1110165375E-01 1.0928256040E-01 1.0749365423E-01 + 1.0573423961E-01 1.0400373057E-01 1.0230190533E-01 1.0062828986E-01 + 9.8982281391E-02 9.7363232570E-02 9.5770986299E-02 9.4205104640E-02 + 9.2665089253E-02 9.1150203181E-02 8.9660362635E-02 8.8195164240E-02 + 8.6754184314E-02 8.5336692055E-02 8.3942565008E-02 8.2571471377E-02 + 8.1223022254E-02 7.9896618189E-02 7.8591960933E-02 7.7308833712E-02 + 7.6046880544E-02 7.4805642086E-02 7.3584629176E-02 7.2383740506E-02 + 7.1202651131E-02 7.0041020775E-02 6.8898242541E-02 6.7774247481E-02 + 6.6668765461E-02 6.5581486791E-02 6.4511958509E-02 6.3459869402E-02 + 6.2425088961E-02 6.1407336085E-02 6.0406316994E-02 5.9421479885E-02 + 5.8452822608E-02 5.7500090972E-02 5.6563019041E-02 5.5641218020E-02 + 5.4734411156E-02 5.3842496378E-02 5.2965233586E-02 5.2102372240E-02 + 5.1253457601E-02 5.0418435755E-02 4.9597119611E-02 4.8789283548E-02 + 4.7994643509E-02 4.7212852717E-02 4.6443878327E-02 4.5687517686E-02 + 4.4943559586E-02 4.4211678082E-02 4.3491681375E-02 4.2783483184E-02 + 4.2086894267E-02 4.1401717619E-02 4.0727603994E-02 4.0064476856E-02 + 3.9412211446E-02 3.8770631668E-02 3.8139554396E-02 3.7518622579E-02 + 3.6907839114E-02 3.6307055480E-02 3.5716108368E-02 3.5134814385E-02 + 3.4562862225E-02 3.4000262270E-02 3.3446869273E-02 3.2902532276E-02 + 3.2367070616E-02 3.1840217984E-02 3.1321976903E-02 3.0812213425E-02 + 3.0310788441E-02 2.9817533657E-02 2.9332204905E-02 2.8854805910E-02 + 2.8385213523E-02 2.7923299942E-02 2.7468917225E-02 2.7021823958E-02 + 2.6582032748E-02 2.6149430718E-02 2.5723900801E-02 2.5305321709E-02 + 2.4893439431E-02 2.4488280997E-02 2.4089743440E-02 2.3697719832E-02 + 2.3312099450E-02 2.2932666819E-02 2.2559404233E-02 2.2192239239E-02 + 2.1831074449E-02 2.1475809062E-02 2.1126270265E-02 2.0782385275E-02 + 2.0444115841E-02 2.0111373508E-02 1.9784066758E-02 1.9462068697E-02 + 1.9145243997E-02 1.8833590598E-02 1.8527028380E-02 1.8225474479E-02 + 1.7928843269E-02 1.7636952905E-02 1.7349817563E-02 1.7067371509E-02 + 1.6789539913E-02 1.6516245476E-02 1.6247359808E-02 1.5982811518E-02 + 1.5722581767E-02 1.5466603166E-02 1.5214806114E-02 1.4967116953E-02 + 1.4723378333E-02 1.4483616032E-02 1.4247769523E-02 1.4015776305E-02 + 1.3787571887E-02 1.3563051106E-02 1.3342146415E-02 1.3124847757E-02 + 1.2911099151E-02 1.2700842848E-02 1.2494019314E-02 1.2290502671E-02 + 1.2090293497E-02 1.1893354059E-02 1.1699632778E-02 1.1509076483E-02 + 1.1321619331E-02 1.1137157247E-02 1.0955705606E-02 1.0777218459E-02 + 1.0601648447E-02 1.0428946789E-02 1.0259036651E-02 1.0091856576E-02 + 9.9274061406E-03 9.7656432701E-03 9.6065246281E-03 9.4500056081E-03 + 9.2960048318E-03 9.1444890831E-03 8.9954481332E-03 8.8488435842E-03 + 8.7046359123E-03 8.5627844608E-03 8.4232085626E-03 8.2858909371E-03 + 8.1508168888E-03 8.0179514903E-03 7.8872588105E-03 7.7587019092E-03 + 7.6322050317E-03 7.5077566051E-03 7.3853419925E-03 7.2649295244E-03 + 7.1464866384E-03 7.0299798746E-03 6.9153417240E-03 6.8025579795E-03 + 6.6916177587E-03 6.5824924357E-03 6.4751525918E-03 6.3695680107E-03 + 6.2656820661E-03 6.1634712357E-03 6.0629312937E-03 5.9640364449E-03 + 5.8667601907E-03 5.7710753252E-03 5.6769381537E-03 5.5843106621E-03 + 5.4931974191E-03 5.4035752507E-03 5.3154203599E-03 5.2287083230E-03 + 5.1434098717E-03 5.0594687788E-03 4.9768997803E-03 4.8956821190E-03 + 4.8157944869E-03 4.7372150220E-03 4.6599213051E-03 4.5838621307E-03 + 4.5090375337E-03 4.4354374536E-03 4.3630428668E-03 4.2918342606E-03 + 4.2217916304E-03 4.1528822007E-03 4.0850770685E-03 4.0183813155E-03 + 3.9527780072E-03 3.8882497776E-03 3.8247788275E-03 3.7623469216E-03 + 3.7009082742E-03 3.6404704082E-03 3.5810223207E-03 3.5225486012E-03 + 3.4650334570E-03 3.4084607124E-03 3.3528049178E-03 3.2980391006E-03 + 3.2441697846E-03 3.1911833332E-03 3.1390657742E-03 3.0878027987E-03 + 3.0373797587E-03 2.9877641034E-03 2.9389511875E-03 2.8909379581E-03 + 2.8437120887E-03 2.7972609573E-03 2.7515716446E-03 2.7066309326E-03 + 2.6624026263E-03 2.6188968441E-03 2.5761042605E-03 2.5340137731E-03 + 2.4926140192E-03 2.4518933742E-03 2.4118369488E-03 2.3724166399E-03 + 2.3336420418E-03 2.2955034166E-03 2.2579907985E-03 2.2210939931E-03 + 2.1848025759E-03 2.1491007974E-03 2.1139679998E-03 2.0794109580E-03 + 2.0454209566E-03 2.0119890803E-03 1.9791062132E-03 1.9467630375E-03 + 1.9149447857E-03 1.8836339902E-03 1.8528364927E-03 1.8225445192E-03 + 1.7927501202E-03 1.7634451708E-03 1.7346213692E-03 1.7062663468E-03 + 1.6783624620E-03 1.6509161204E-03 1.6239204100E-03 1.5973682657E-03 + 1.5712524689E-03 1.5455656462E-03 + + diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/O_gga_7au_60Ry_2s2p1d.orb b/ABACUS.develop/examples/H2O-deepks-lcao/O_gga_7au_60Ry_2s2p1d.orb new file mode 100644 index 0000000000..d36d9dc128 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/O_gga_7au_60Ry_2s2p1d.orb @@ -0,0 +1,903 @@ +--------------------------------------------------------------------------- +Element O +Energy Cutoff(Ry) 60 +Radius Cutoff(a.u.) 7 +Lmax 2 +Number of Sorbital--> 2 +Number of Porbital--> 2 +Number of Dorbital--> 1 +--------------------------------------------------------------------------- +SUMMARY END + +Mesh 701 +dr 0.01 + Type L N + 0 0 0 + 1.208504975904e+00 1.208605373194e+00 1.208906194767e+00 1.209406330839e+00 + 1.210103935461e+00 1.210996432051e+00 1.212080521101e+00 1.213352190052e+00 + 1.214806725286e+00 1.216438726214e+00 1.218242121389e+00 1.220210186617e+00 + 1.222335564979e+00 1.224610288719e+00 1.227025802911e+00 1.229572990826e+00 + 1.232242200930e+00 1.235023275402e+00 1.237905580090e+00 1.240878035806e+00 + 1.243929150853e+00 1.247047054671e+00 1.250219532508e+00 1.253434060986e+00 + 1.256677844454e+00 1.259937852003e+00 1.263200855037e+00 1.266453465260e+00 + 1.269682172967e+00 1.272873385522e+00 1.276013465884e+00 1.279088771074e+00 + 1.282085690452e+00 1.284990683687e+00 1.287790318310e+00 1.290471306712e+00 + 1.293020542503e+00 1.295425136090e+00 1.297672449397e+00 1.299750129595e+00 + 1.301646141768e+00 1.303348800401e+00 1.304846799603e+00 1.306129241995e+00 + 1.307185666154e+00 1.308006072568e+00 1.308580948012e+00 1.308901288291e+00 + 1.308958619289e+00 1.308745016279e+00 1.308253121443e+00 1.307476159565e+00 + 1.306407951870e+00 1.305042927985e+00 1.303376135990e+00 1.301403250569e+00 + 1.299120579241e+00 1.296525066675e+00 1.293614297106e+00 1.290386494856e+00 + 1.286840522984e+00 1.282975880102e+00 1.278792695375e+00 1.274291721751e+00 + 1.269474327479e+00 1.264342485932e+00 1.258898763833e+00 1.253146307905e+00 + 1.247088830035e+00 1.240730591016e+00 1.234076382930e+00 1.227131510258e+00 + 1.219901769801e+00 1.212393429485e+00 1.204613206140e+00 1.196568242341e+00 + 1.188266082409e+00 1.179714647648e+00 1.170922210923e+00 1.161897370672e+00 + 1.152649024441e+00 1.143186342040e+00 1.133518738417e+00 1.123655846335e+00 + 1.113607488958e+00 1.103383652425e+00 1.092994458510e+00 1.082450137452e+00 + 1.071761001046e+00 1.060937416076e+00 1.049989778166e+00 1.038928486134e+00 + 1.027763916923e+00 1.016506401179e+00 1.005166199535e+00 9.937534796822e-01 + 9.822782942738e-01 9.707505597186e-01 9.591800359220e-01 9.475763070136e-01 + 9.359487631082e-01 9.243065831335e-01 9.126587187607e-01 9.010138794629e-01 + 8.893805187255e-01 8.777668214270e-01 8.661806924029e-01 8.546297462024e-01 + 8.431212980407e-01 8.316623559477e-01 8.202596141073e-01 8.089194473785e-01 + 7.976479069842e-01 7.864507173504e-01 7.753332740738e-01 7.643006429933e-01 + 7.533575603347e-01 7.425084338983e-01 7.317573452518e-01 7.211080528917e-01 + 7.105639963300e-01 7.001283010647e-01 6.898037843852e-01 6.795929619667e-01 + 6.694980552026e-01 6.595209992230e-01 6.496634515475e-01 6.399268013169e-01 + 6.303121790507e-01 6.208204668741e-01 6.114523091586e-01 6.022081235218e-01 + 5.930881121293e-01 5.840922732453e-01 5.752204129759e-01 5.664721571522e-01 + 5.578469633004e-01 5.493441326481e-01 5.409628221155e-01 5.327020562452e-01 + 5.245607390221e-01 5.165376655400e-01 5.086315334724e-01 5.008409543065e-01 + 4.931644643036e-01 4.856005351488e-01 4.781475842592e-01 4.708039847180e-01 + 4.635680748085e-01 4.564381671224e-01 4.494125572203e-01 4.424895318251e-01 + 4.356673765315e-01 4.289443830186e-01 4.223188557530e-01 4.157891181767e-01 + 4.093535183714e-01 4.030104341987e-01 3.967582779147e-01 3.905955002616e-01 + 3.845205940408e-01 3.785320971754e-01 3.726285952702e-01 3.668087236816e-01 + 3.610711691103e-01 3.554146707323e-01 3.498380208855e-01 3.443400653306e-01 + 3.389197031063e-01 3.335758859998e-01 3.283076176573e-01 3.231139523559e-01 + 3.179939934625e-01 3.129468916064e-01 3.079718425888e-01 3.030680850586e-01 + 2.982348979789e-01 2.934715979121e-01 2.887775361507e-01 2.841520957194e-01 + 2.795946882761e-01 2.751047509369e-01 2.706817430510e-01 2.663251429500e-01 + 2.620344446963e-01 2.578091548528e-01 2.536487892964e-01 2.495528700973e-01 + 2.455209224821e-01 2.415524719021e-01 2.376470412212e-01 2.338041480425e-01 + 2.300233021857e-01 2.263040033303e-01 2.226457388361e-01 2.190479817496e-01 + 2.155101890086e-01 2.120317998477e-01 2.086122344148e-01 2.052508925998e-01 + 2.019471530796e-01 1.987003725803e-01 1.955098853571e-01 1.923750028889e-01 + 1.892950137867e-01 1.862691839096e-01 1.832967566851e-01 1.803769536250e-01 + 1.775089750316e-01 1.746920008827e-01 1.719251918891e-01 1.692076907110e-01 + 1.665386233243e-01 1.639171005238e-01 1.613422195507e-01 1.588130658323e-01 + 1.563287148189e-01 1.538882339058e-01 1.514906844251e-01 1.491351236934e-01 + 1.468206071016e-01 1.445461902321e-01 1.423109309892e-01 1.401138917296e-01 + 1.379541413781e-01 1.358307575162e-01 1.337428284304e-01 1.316894551079e-01 + 1.296697531672e-01 1.276828547140e-01 1.257279101100e-01 1.238040896459e-01 + 1.219105851096e-01 1.200466112407e-01 1.182114070645e-01 1.164042370988e-01 + 1.146243924273e-01 1.128711916364e-01 1.111439816100e-01 1.094421381794e-01 + 1.077650666286e-01 1.061122020509e-01 1.044830095586e-01 1.028769843465e-01 + 1.012936516098e-01 9.973256632027e-02 9.819331286249e-02 9.667550453586e-02 + 9.517878292592e-02 9.370281715131e-02 9.224730299217e-02 9.081196190712e-02 + 8.939653994588e-02 8.800080656572e-02 8.662455335980e-02 8.526759270643e-02 + 8.392975634798e-02 8.261089390905e-02 8.131087136337e-02 8.002956945904e-02 + 7.876688211206e-02 7.752271477787e-02 7.629698281079e-02 7.508960982105e-02 + 7.390052603893e-02 7.272966669554e-02 7.157697042927e-02 7.044237772677e-02 + 6.932582940704e-02 6.822726515656e-02 6.714662212340e-02 6.608383357718e-02 + 6.503882764188e-02 6.401152610749e-02 6.300184332609e-02 6.200968519741e-02 + 6.103494824820e-02 6.007751880923e-02 5.913727229295e-02 5.821407257435e-02 + 5.730777147672e-02 5.641820836358e-02 5.554520983723e-02 5.468858954372e-02 + 5.384814808351e-02 5.302367302641e-02 5.221493902883e-02 5.142170805062e-02 + 5.064372966853e-02 4.988074148247e-02 4.913246961043e-02 4.839862926751e-02 + 4.767892542381e-02 4.697305353581e-02 4.628070034542e-02 4.560154474050e-02 + 4.493525867035e-02 4.428150810968e-02 4.363995406407e-02 4.301025360991e-02 + 4.239206096181e-02 4.178502856019e-02 4.118880817199e-02 4.060305199725e-02 + 4.002741377451e-02 3.946154987805e-02 3.890512040018e-02 3.835779021189e-02 + 3.781922999550e-02 3.728911724314e-02 3.676713721524e-02 3.625298385349e-02 + 3.574636064312e-02 3.524698141971e-02 3.475457111613e-02 3.426886644573e-02 + 3.378961651814e-02 3.331658338482e-02 3.284954251156e-02 3.238828317602e-02 + 3.193260878856e-02 3.148233713535e-02 3.103730054297e-02 3.059734596456e-02 + 3.016233498765e-02 2.973214376455e-02 2.930666286665e-02 2.888579706416e-02 + 2.846946503363e-02 2.805759899565e-02 2.765014428579e-02 2.724705886194e-02 + 2.684831275201e-02 2.645388744558e-02 2.606377523410e-02 2.567797850399e-02 + 2.529650898744e-02 2.491938697590e-02 2.454664050137e-02 2.417830449066e-02 + 2.381441989815e-02 2.345503282229e-02 2.310019361138e-02 2.274995596414e-02 + 2.240437603029e-02 2.206351151675e-02 2.172742080447e-02 2.139616208118e-02 + 2.106979249494e-02 2.074836733334e-02 2.043193923274e-02 2.012055742218e-02 + 1.981426700573e-02 1.951310828723e-02 1.921711614086e-02 1.892631943068e-02 + 1.864074048204e-02 1.836039460721e-02 1.808528968752e-02 1.781542581363e-02 + 1.755079498530e-02 1.729138087183e-02 1.703715863360e-02 1.678809480501e-02 + 1.654414723879e-02 1.630526511103e-02 1.607138898614e-02 1.584245094054e-02 + 1.561837474341e-02 1.539907609281e-02 1.518446290469e-02 1.497443565255e-02 + 1.476888775479e-02 1.456770600680e-02 1.437077105450e-02 1.417795790576e-02 + 1.398913647618e-02 1.380417216524e-02 1.362292645883e-02 1.344525755419e-02 + 1.327102100294e-02 1.310007036795e-02 1.293225788984e-02 1.276743515871e-02 + 1.260545378691e-02 1.244616607850e-02 1.228942569134e-02 1.213508828758e-02 + 1.198301216878e-02 1.183305889161e-02 1.168509386064e-02 1.153898689466e-02 + 1.139461276322e-02 1.125185169038e-02 1.111058982280e-02 1.097071965960e-02 + 1.083214044170e-02 1.069475849851e-02 1.055848755032e-02 1.042324896481e-02 + 1.028897196663e-02 1.015559379908e-02 1.002305983731e-02 9.891323652895e-03 + 9.760347029730e-03 9.630099931587e-03 9.500560422003e-03 9.371714537409e-03 + 9.243556114682e-03 9.116086574612e-03 8.989314662992e-03 8.863256151309e-03 + 8.737933499234e-03 8.613375481320e-03 8.489616780520e-03 8.366697551320e-03 + 8.244662955423e-03 8.123562673085e-03 8.003450393317e-03 7.884383286246e-03 + 7.766421461045e-03 7.649627412869e-03 7.534065462274e-03 7.419801190628e-03 + 7.306900874994e-03 7.195430925942e-03 7.085457331716e-03 6.977045112075e-03 + 6.870257785082e-03 6.765156849958e-03 6.661801289045e-03 6.560247091721e-03 + 6.460546803002e-03 6.362749099347e-03 6.266898394024e-03 6.173034474181e-03 + 6.081192171547e-03 5.991401068471e-03 5.903685240785e-03 5.818063038717e-03 + 5.734546906854e-03 5.653143243903e-03 5.573852302742e-03 5.496668131005e-03 + 5.421578552205e-03 5.348565187130e-03 5.277603515021e-03 5.208662973798e-03 + 5.141707098353e-03 5.076693695733e-03 5.013575055786e-03 4.952298195673e-03 + 4.892805136420e-03 4.835033209538e-03 4.778915391542e-03 4.724380664074e-03 + 4.671354397171e-03 4.619758753123e-03 4.569513108242e-03 4.520534489798e-03 + 4.472738025270e-03 4.426037401063e-03 4.380345327754e-03 4.335574008947e-03 + 4.291635610817e-03 4.248442729424e-03 4.205908852936e-03 4.163948815945e-03 + 4.122479243134e-03 4.081418979636e-03 4.040689505537e-03 4.000215332093e-03 + 3.959924377344e-03 3.919748318979e-03 3.879622922454e-03 3.839488342509e-03 + 3.799289396459e-03 3.758975807751e-03 3.718502418544e-03 3.677829370213e-03 + 3.636922250914e-03 3.595752209542e-03 3.554296035627e-03 3.512536204937e-03 + 3.470460890733e-03 3.428063940894e-03 3.385344821255e-03 3.342308525792e-03 + 3.298965454405e-03 3.255331259306e-03 3.211426661165e-03 3.167277236356e-03 + 3.122913176816e-03 3.078369024163e-03 3.033683379905e-03 2.988898593658e-03 + 2.944060431442e-03 2.899217726215e-03 2.854422012908e-03 2.809727150291e-03 + 2.765188932058e-03 2.720864689603e-03 2.676812888925e-03 2.633092724193e-03 + 2.589763710440e-03 2.546885277886e-03 2.504516370328e-03 2.462715050026e-03 + 2.421538111419e-03 2.381040705966e-03 2.341275980300e-03 2.302294729807e-03 + 2.264145069601e-03 2.226872124780e-03 2.190517741691e-03 2.155120221810e-03 + 2.120714079669e-03 2.087329826143e-03 2.054993778194e-03 2.023727896059e-03 + 1.993549648638e-03 1.964471907708e-03 1.936502871376e-03 1.909646017015e-03 + 1.883900083759e-03 1.859259084424e-03 1.835712346564e-03 1.813244582206e-03 + 1.791835985597e-03 1.771462358179e-03 1.752095259818e-03 1.733702185159e-03 + 1.716246763861e-03 1.699688983301e-03 1.683985432221e-03 1.669089563689e-03 + 1.654951975612e-03 1.641520706971e-03 1.628741547856e-03 1.616558361306e-03 + 1.604913414903e-03 1.593747720042e-03 1.583001376732e-03 1.572613921806e-03 + 1.562524678386e-03 1.552673104465e-03 1.542999138498e-03 1.533443539901e-03 + 1.523948222454e-03 1.514456578601e-03 1.504913792757e-03 1.495267141793e-03 + 1.485466280966e-03 1.475463513657e-03 1.465214043408e-03 1.454676206835e-03 + 1.443811686166e-03 1.432585700244e-03 1.420967172999e-03 1.408928878533e-03 + 1.396447562101e-03 1.383504036449e-03 1.370083253078e-03 1.356174348211e-03 + 1.341770663359e-03 1.326869740553e-03 1.311473292454e-03 1.295587147713e-03 + 1.279221172095e-03 1.262389166021e-03 1.245108739338e-03 1.227401164224e-03 + 1.209291207305e-03 1.190806942140e-03 1.171979543369e-03 1.152843063897e-03 + 1.133434196599e-03 1.113792022102e-03 1.093957744276e-03 1.073974415121e-03 + 1.053886650808e-03 1.033740340637e-03 1.013582350744e-03 9.934602243832e-04 + 9.734218806000e-04 9.535153131592e-04 9.337882915143e-04 9.142880656187e-04 + 8.950610763245e-04 8.761526730687e-04 8.576068404897e-04 8.394659355465e-04 + 8.217704366397e-04 8.045587061422e-04 7.878667676593e-04 7.717280992330e-04 + 7.561734436003e-04 7.412306364994e-04 7.269244539011e-04 7.132764789180e-04 + 7.003049890184e-04 6.880248640422e-04 6.764475153823e-04 6.655808365672e-04 + 6.554291753423e-04 6.459933272172e-04 6.372705503164e-04 6.292546012396e-04 + 6.219357915110e-04 6.153010640793e-04 6.093340892045e-04 6.040153789622e-04 + 5.993224194821e-04 5.952298199426e-04 5.917094772441e-04 5.887307552009e-04 + 5.862606770110e-04 5.842641296934e-04 5.827040791224e-04 5.815417942331e-04 + 5.807370789334e-04 5.802485102196e-04 5.800336809728e-04 5.800494458981e-04 + 5.802521690611e-04 5.805979714881e-04 5.810429773026e-04 5.815435569042e-04 + 5.820565657210e-04 5.825395771157e-04 5.829511080708e-04 5.832508363431e-04 + 5.833998078379e-04 5.833606330338e-04 5.830976713629e-04 5.825772025437e-04 + 5.817675839497e-04 5.806393931961e-04 5.791655552238e-04 5.773214532596e-04 + 5.750850231309e-04 5.724368305124e-04 5.693601307693e-04 5.658409111446e-04 + 5.618679151054e-04 5.574326486993e-04 5.525293687938e-04 5.471550530319e-04 + 5.413093512624e-04 5.349945180493e-04 5.282153256417e-04 5.209789564670e-04 + 5.132948738062e-04 5.051746688210e-04 4.966318815478e-04 4.876817929151e-04 + 4.783411843418e-04 4.686280611573e-04 4.585613361105e-04 4.481604698002e-04 + 4.374450661976e-04 4.264344238016e-04 4.151470466072e-04 4.036001241663e-04 + 3.918089966647e-04 3.797866290408e-04 3.675431274054e-04 3.550853407791e-04 + 3.424166004890e-04 3.295366571895e-04 3.164418798350e-04 3.031257803019e-04 + 2.895799200289e-04 2.757952395507e-04 2.617638272220e-04 2.474811096748e-04 + 2.329484046492e-04 2.181757290843e-04 2.031847053963e-04 1.880113615581e-04 + 1.727085816573e-04 1.573479391175e-04 1.420206404514e-04 1.268373278303e-04 + 1.119265365508e-04 9.743167866898e-05 8.350652361154e-05 7.030926427376e-05 + 5.799538389723e-05 4.670966361885e-05 3.657778061112e-05 2.769802994764e-05 + 2.013374906341e-05 1.390702415828e-05 8.994209321926e-06 5.323692408431e-06 + 2.776202480590e-06 1.187782192828e-06 3.553586242532e-07 4.465396560257e-08 + 0.000000000000e+00 + Type L N + 0 0 1 + 7.254873428942e-01 7.256666701836e-01 7.262040651787e-01 7.270977689660e-01 + 7.283448557011e-01 7.299412411073e-01 7.318816943340e-01 7.341598531361e-01 + 7.367682423256e-01 7.396982954341e-01 7.429403795151e-01 7.464838230058e-01 + 7.503169465575e-01 7.544270967320e-01 7.588006824578e-01 7.634232141234e-01 + 7.682793451844e-01 7.733529161466e-01 7.786270007853e-01 7.840839544493e-01 + 7.897054642959e-01 7.954726012944e-01 8.013658738321e-01 8.073652827510e-01 + 8.134503776412e-01 8.196003142102e-01 8.257939125497e-01 8.320097161138e-01 + 8.382260512257e-01 8.444210869251e-01 8.505728949734e-01 8.566595098284e-01 + 8.626589884062e-01 8.685494694476e-01 8.743092323085e-01 8.799167549976e-01 + 8.853507712889e-01 8.905903267386e-01 8.956148334429e-01 9.004041233778e-01 + 9.049385001677e-01 9.091987891354e-01 9.131663854946e-01 9.168233005512e-01 + 9.201522057895e-01 9.231364747249e-01 9.257602224156e-01 9.280083425331e-01 + 9.298665419008e-01 9.313213724179e-01 9.323602602985e-01 9.329715325607e-01 + 9.331444407159e-01 9.328691816115e-01 9.321369153974e-01 9.309397805906e-01 + 9.292709062264e-01 9.271244210907e-01 9.244954600412e-01 9.213801674334e-01 + 9.177756976756e-01 9.136802129486e-01 9.090928781328e-01 9.040138529968e-01 + 8.984442817063e-01 8.923862797242e-01 8.858429181782e-01 8.788182057798e-01 + 8.713170683877e-01 8.633453263117e-01 8.549096694633e-01 8.460176304626e-01 + 8.366775558156e-01 8.268985752843e-01 8.166905695723e-01 8.060641364551e-01 + 7.950305554857e-01 7.836017514115e-01 7.717902564368e-01 7.596091714706e-01 + 7.470721264985e-01 7.341932402185e-01 7.209870790813e-01 7.074686158739e-01 + 6.936531879864e-01 6.795564554976e-01 6.651943592171e-01 6.505830788149e-01 + 6.357389911700e-01 6.206786290648e-01 6.054186403485e-01 5.899757476891e-01 + 5.743667090281e-01 5.586082788498e-01 5.427171703685e-01 5.267100187338e-01 + 5.106033453488e-01 4.944135233878e-01 4.781567445972e-01 4.618489874536e-01 + 4.455059867492e-01 4.291432046671e-01 4.127758034017e-01 3.964186193738e-01 + 3.800861390819e-01 3.637924766262e-01 3.475513529322e-01 3.313760766971e-01 + 3.152795270720e-01 2.992741380906e-01 2.833718848433e-01 2.675842713943e-01 + 2.519223204291e-01 2.363965646160e-01 2.210170396586e-01 2.057932790105e-01 + 1.907343102184e-01 1.758486528546e-01 1.611443179941e-01 1.466288091897e-01 + 1.323091248895e-01 1.181917622427e-01 1.042827222321e-01 9.058751606940e-02 + 7.711117278740e-02 6.385824796008e-02 5.083283347819e-02 3.803856830806e-02 + 2.547865015811e-02 1.315584797747e-02 1.072515209469e-03 -1.076939627721e-02 + -2.236832165731e-02 -3.372306809514e-02 -4.483279924503e-02 -5.569701938217e-02 + -6.631555723891e-02 -7.668854962018e-02 -8.681642487002e-02 -9.669988625927e-02 + -1.063398953624e-01 -1.157376554889e-01 -1.248945952324e-01 -1.338123521969e-01 + -1.424927569584e-01 -1.509378173145e-01 -1.591497028740e-01 -1.671307300327e-01 + -1.748833473792e-01 -1.824101215717e-01 -1.897137237212e-01 -1.967969163142e-01 + -2.036625407039e-01 -2.103135051948e-01 -2.167527737423e-01 -2.229833552850e-01 + -2.290082937227e-01 -2.348306585525e-01 -2.404535361667e-01 -2.458800218186e-01 + -2.511132122536e-01 -2.561561990045e-01 -2.610120623413e-01 -2.656838658696e-01 + -2.701746517613e-01 -2.744874366059e-01 -2.786252078613e-01 -2.825909208870e-01 + -2.863874965356e-01 -2.900178192788e-01 -2.934847358419e-01 -2.967910543192e-01 + -2.999395437417e-01 -3.029329340652e-01 -3.057739165503e-01 -3.084651444993e-01 + -3.110092343197e-01 -3.134087668802e-01 -3.156662891257e-01 -3.177843159192e-01 + -3.197653320763e-01 -3.216117945603e-01 -3.233261348050e-01 -3.249107611349e-01 + -3.263680612502e-01 -3.277004047483e-01 -3.289101456532e-01 -3.299996249235e-01 + -3.309711729154e-01 -3.318271117747e-01 -3.325697577341e-01 -3.332014232962e-01 + -3.337244192811e-01 -3.341410567201e-01 -3.344536485814e-01 -3.346645113114e-01 + -3.347759661800e-01 -3.347903404196e-01 -3.347099681484e-01 -3.345371910720e-01 + -3.342743589580e-01 -3.339238298800e-01 -3.334879702312e-01 -3.329691545064e-01 + -3.323697648556e-01 -3.316921904132e-01 -3.309388264076e-01 -3.301120730579e-01 + -3.292143342673e-01 -3.282480161213e-01 -3.272155252025e-01 -3.261192667336e-01 + -3.249616425617e-01 -3.237450489978e-01 -3.224718745253e-01 -3.211444973951e-01 + -3.197652831201e-01 -3.183365818881e-01 -3.168607259083e-01 -3.153400267090e-01 + -3.137767724032e-01 -3.121732249392e-01 -3.105316173529e-01 -3.088541510394e-01 + -3.071429930586e-01 -3.054002734930e-01 -3.036280828708e-01 -3.018284696709e-01 + -3.000034379238e-01 -2.981549449206e-01 -2.962848990445e-01 -2.943951577350e-01 + -2.924875255971e-01 -2.905637526640e-01 -2.886255328226e-01 -2.866745024101e-01 + -2.847122389875e-01 -2.827402602961e-01 -2.807600234008e-01 -2.787729240243e-01 + -2.767802960736e-01 -2.747834113602e-01 -2.727834795133e-01 -2.707816480860e-01 + -2.687790028506e-01 -2.667765682807e-01 -2.647753082159e-01 -2.627761267031e-01 + -2.607798690080e-01 -2.587873227913e-01 -2.567992194399e-01 -2.548162355453e-01 + -2.528389945197e-01 -2.508680683408e-01 -2.489039794130e-01 -2.469472025355e-01 + -2.449981669661e-01 -2.430572585677e-01 -2.411248220269e-01 -2.392011631321e-01 + -2.372865510986e-01 -2.353812209292e-01 -2.334853757975e-01 -2.315991894418e-01 + -2.297228085585e-01 -2.278563551823e-01 -2.259999290424e-01 -2.241536098838e-01 + -2.223174597432e-01 -2.204915251685e-01 -2.186758393743e-01 -2.168704243221e-01 + -2.150752927189e-01 -2.132904499255e-01 -2.115158957672e-01 -2.097516262416e-01 + -2.079976351174e-01 -2.062539154195e-01 -2.045204607963e-01 -2.027972667658e-01 + -2.010843318391e-01 -1.993816585181e-01 -1.976892541676e-01 -1.960071317613e-01 + -1.943353105025e-01 -1.926738163205e-01 -1.910226822449e-01 -1.893819486610e-01 + -1.877516634493e-01 -1.861318820128e-01 -1.845226671970e-01 -1.829240891082e-01 + -1.813362248350e-01 -1.797591580790e-01 -1.781929787019e-01 -1.766377821957e-01 + -1.750936690819e-01 -1.735607442486e-01 -1.720391162332e-01 -1.705288964560e-01 + -1.690301984164e-01 -1.675431368557e-01 -1.660678268972e-01 -1.646043831701e-01 + -1.631529189255e-01 -1.617135451510e-01 -1.602863696932e-01 -1.588714963937e-01 + -1.574690242455e-01 -1.560790465776e-01 -1.547016502729e-01 -1.533369150254e-01 + -1.519849126425e-01 -1.506457063969e-01 -1.493193504333e-01 -1.480058892333e-01 + -1.467053571418e-01 -1.454177779589e-01 -1.441431645988e-01 -1.428815188187e-01 + -1.416328310171e-01 -1.403970801058e-01 -1.391742334519e-01 -1.379642468930e-01 + -1.367670648229e-01 -1.355826203479e-01 -1.344108355108e-01 -1.332516215814e-01 + -1.321048794113e-01 -1.309704998483e-01 -1.298483642091e-01 -1.287383448054e-01 + -1.276403055193e-01 -1.265541024246e-01 -1.254795844485e-01 -1.244165940690e-01 + -1.233649680437e-01 -1.223245381637e-01 -1.212951320287e-01 -1.202765738365e-01 + -1.192686851828e-01 -1.182712858649e-01 -1.172841946847e-01 -1.163072302453e-01 + -1.153402117357e-01 -1.143829596997e-01 -1.134352967825e-01 -1.124970484522e-01 + -1.115680436898e-01 -1.106481156450e-01 -1.097371022529e-01 -1.088348468094e-01 + -1.079411984998e-01 -1.070560128798e-01 -1.061791523053e-01 -1.053104863089e-01 + -1.044498919210e-01 -1.035972539354e-01 -1.027524651161e-01 -1.019154263471e-01 + -1.010860467232e-01 -1.002642435825e-01 -9.944994248185e-02 -9.864307711501e-02 + -9.784358917552e-02 -9.705142816589e-02 -9.626655115497e-02 -9.548892248592e-02 + -9.471851343733e-02 -9.395530184054e-02 -9.319927165621e-02 -9.245041251371e-02 + -9.170871921683e-02 -9.097419121975e-02 -9.024683207723e-02 -8.952664887308e-02 + -8.881365163121e-02 -8.810785271354e-02 -8.740926620906e-02 -8.671790731849e-02 + -8.603379173875e-02 -8.535693505166e-02 -8.468735212103e-02 -8.402505650228e-02 + -8.337005986852e-02 -8.272237145706e-02 -8.208199753993e-02 -8.144894092187e-02 + -8.082320046907e-02 -8.020477067166e-02 -7.959364124268e-02 -7.898979675599e-02 + -7.839321632536e-02 -7.780387332648e-02 -7.722173516368e-02 -7.664676308235e-02 + -7.607891202816e-02 -7.551813055364e-02 -7.496436077230e-02 -7.441753836036e-02 + -7.387759260550e-02 -7.334444650219e-02 -7.281801689227e-02 -7.229821464967e-02 + -7.178494490761e-02 -7.127810732620e-02 -7.077759639858e-02 -7.028330179286e-02 + -6.979510872749e-02 -6.931289837697e-02 -6.883654830505e-02 -6.836593292207e-02 + -6.790092396314e-02 -6.744139098370e-02 -6.698720186881e-02 -6.653822335263e-02 + -6.609432154426e-02 -6.565536245638e-02 -6.522121253286e-02 -6.479173917170e-02 + -6.436681123969e-02 -6.394629957521e-02 -6.353007747576e-02 -6.311802116687e-02 + -6.271001024920e-02 -6.230592812088e-02 -6.190566237223e-02 -6.150910515026e-02 + -6.111615349049e-02 -6.072670961410e-02 -6.034068118830e-02 -5.995798154845e-02 + -5.957852988044e-02 -5.920225136233e-02 -5.882907726438e-02 -5.845894500696e-02 + -5.809179817626e-02 -5.772758649759e-02 -5.736626576701e-02 -5.700779774157e-02 + -5.665214998938e-02 -5.629929570062e-02 -5.594921346095e-02 -5.560188698908e-02 + -5.525730484048e-02 -5.491546007952e-02 -5.457634992227e-02 -5.423997535275e-02 + -5.390634071546e-02 -5.357545328686e-02 -5.324732282934e-02 -5.292196113045e-02 + -5.259938153099e-02 -5.227959844527e-02 -5.196262687686e-02 -5.164848193346e-02 + -5.133717834423e-02 -5.102872998301e-02 -5.072314940095e-02 -5.042044737174e-02 + -5.012063245275e-02 -4.982371056520e-02 -4.952968459635e-02 -4.923855402661e-02 + -4.895031458408e-02 -4.866495792929e-02 -4.838247137211e-02 -4.810283762315e-02 + -4.782603458131e-02 -4.755203515910e-02 -4.728080714718e-02 -4.701231311894e-02 + -4.674651037613e-02 -4.648335093590e-02 -4.622278155957e-02 -4.596474382297e-02 + -4.570917422813e-02 -4.545600435556e-02 -4.520516105632e-02 -4.495656668270e-02 + -4.471013935597e-02 -4.446579326960e-02 -4.422343902605e-02 -4.398298400479e-02 + -4.374433275935e-02 -4.350738744073e-02 -4.327204824428e-02 -4.303821387741e-02 + -4.280578204466e-02 -4.257464994722e-02 -4.234471479342e-02 -4.211587431678e-02 + -4.188802729821e-02 -4.166107408881e-02 -4.143491712971e-02 -4.120946146551e-02 + -4.098461524766e-02 -4.076029022453e-02 -4.053640221469e-02 -4.031287156008e-02 + -4.008962355603e-02 -3.986658885506e-02 -3.964370384156e-02 -3.942091097474e-02 + -3.919815909734e-02 -3.897540370783e-02 -3.875260719405e-02 -3.852973902653e-02 + -3.830677590993e-02 -3.808370189129e-02 -3.786050842416e-02 -3.763719438785e-02 + -3.741376606137e-02 -3.719023705192e-02 -3.696662817818e-02 -3.674296730868e-02 + -3.651928915615e-02 -3.629563502882e-02 -3.607205254002e-02 -3.584859527756e-02 + -3.562532243500e-02 -3.540229840658e-02 -3.517959234853e-02 -3.495727770905e-02 + -3.473543172998e-02 -3.451413492302e-02 -3.429347052373e-02 -3.407352392670e-02 + -3.385438210523e-02 -3.363613301929e-02 -3.341886501524e-02 -3.320266622131e-02 + -3.298762394241e-02 -3.277382405822e-02 -3.256135042847e-02 -3.235028430897e-02 + -3.214070378242e-02 -3.193268320750e-02 -3.172629268990e-02 -3.152159757872e-02 + -3.131865799163e-02 -3.111752837185e-02 -3.091825708000e-02 -3.072088602362e-02 + -3.052545032675e-02 -3.033197804211e-02 -3.014048990770e-02 -2.995099914979e-02 + -2.976351133363e-02 -2.957802426325e-02 -2.939452793110e-02 -2.921300451825e-02 + -2.903342844527e-02 -2.885576647395e-02 -2.867997785924e-02 -2.850601455098e-02 + -2.833382144417e-02 -2.816333667671e-02 -2.799449197269e-02 -2.782721302956e-02 + -2.766141994684e-02 -2.749702769383e-02 -2.733394661371e-02 -2.717208296080e-02 + -2.701133946797e-02 -2.685161594061e-02 -2.669280987347e-02 -2.653481708672e-02 + -2.637753237709e-02 -2.622085018006e-02 -2.606466523893e-02 -2.590887327648e-02 + -2.575337166480e-02 -2.559806008909e-02 -2.544284120097e-02 -2.528762125705e-02 + -2.513231073838e-02 -2.497682494674e-02 -2.482108457356e-02 -2.466501623762e-02 + -2.450855298765e-02 -2.435163476629e-02 -2.419420883202e-02 -2.403623013573e-02 + -2.387766164928e-02 -2.371847464307e-02 -2.355864891050e-02 -2.339817293711e-02 + -2.323704401269e-02 -2.307526828495e-02 -2.291286075357e-02 -2.274984520407e-02 + -2.258625408096e-02 -2.242212830027e-02 -2.225751700172e-02 -2.209247724135e-02 + -2.192707362565e-02 -2.176137788862e-02 -2.159546841364e-02 -2.142942970219e-02 + -2.126335179210e-02 -2.109732962799e-02 -2.093146238710e-02 -2.076585276399e-02 + -2.060060621782e-02 -2.043583018613e-02 -2.027163326949e-02 -2.010812439128e-02 + -1.994541193741e-02 -1.978360288077e-02 -1.962280189525e-02 -1.946311046452e-02 + -1.930462599078e-02 -1.914744090855e-02 -1.899164180891e-02 -1.883730857935e-02 + -1.868451356458e-02 -1.853332075332e-02 -1.838378499630e-02 -1.823595126041e-02 + -1.808985392377e-02 -1.794551611644e-02 -1.780294911118e-02 -1.766215176856e-02 + -1.752311004029e-02 -1.738579653452e-02 -1.725017014658e-02 -1.711617575804e-02 + -1.698374400709e-02 -1.685279113236e-02 -1.672321889232e-02 -1.659491456194e-02 + -1.646775100755e-02 -1.634158684107e-02 -1.621626665358e-02 -1.609162132846e-02 + -1.596746843346e-02 -1.584361269051e-02 -1.571984652213e-02 -1.559595067190e-02 + -1.547169489659e-02 -1.534683872624e-02 -1.522113228779e-02 -1.509431718645e-02 + -1.496612743749e-02 -1.483629043856e-02 -1.470452796987e-02 -1.457055720485e-02 + -1.443409170812e-02 -1.429484238992e-02 -1.415251837503e-02 -1.400682773128e-02 + -1.385747798508e-02 -1.370417633100e-02 -1.354662941759e-02 -1.338454256474e-02 + -1.321761823931e-02 -1.304555358959e-02 -1.286803681889e-02 -1.268474217206e-02 + -1.249532332271e-02 -1.229940499551e-02 -1.209657274723e-02 -1.188636097593e-02 + -1.166823943872e-02 -1.144159884417e-02 -1.120573644391e-02 -1.095984297292e-02 + -1.070299275375e-02 -1.043413925187e-02 -1.015211878805e-02 -9.855665409747e-03 + -9.543440008834e-03 -9.214076556271e-03 -8.866247718325e-03 -8.498751054188e-03 + -8.110615439050e-03 -7.701225329127e-03 -7.270458073131e-03 -6.818826842202e-03 + -6.347619139072e-03 -5.859018565355e-03 -5.356195924376e-03 -4.843355172226e-03 + -4.325720516624e-03 -3.809453321228e-03 -3.301491475836e-03 -2.809309425588e-03 + -2.340603789462e-03 -1.902916906830e-03 -1.503218023709e-03 -1.147468351328e-03 + -8.402010638750e-04 -5.841497027245e-04 -3.799578710602e-04 -2.259992769873e-04 + -1.183302128984e-04 -5.078691996859e-05 -1.522880477927e-05 -1.916246212603e-06 + 0.000000000000e+00 + Type L N + 0 1 0 + 0.000000000000e+00 4.626669306440e-02 9.247677643884e-02 1.385737661495e-01 + 1.845014292772e-01 2.302039085422e-01 2.756258457606e-01 3.207125038039e-01 + 3.654098866971e-01 4.096648574975e-01 4.534252536048e-01 4.966399991622e-01 + 5.392592142182e-01 5.812343203311e-01 6.225181423090e-01 6.630650057955e-01 + 7.028308304215e-01 7.417732182629e-01 7.798515373591e-01 8.170270000629e-01 + 8.532627360156e-01 8.885238595536e-01 9.227775313771e-01 9.559930143289e-01 + 9.881417231541e-01 1.019197268128e+00 1.049135492469e+00 1.077934503457e+00 + 1.105574697231e+00 1.132038777224e+00 1.157311766233e+00 1.181381012159e+00 + 1.204236187438e+00 1.225869282229e+00 1.246274591448e+00 1.265448695731e+00 + 1.283390436474e+00 1.300100885050e+00 1.315583306407e+00 1.329843117176e+00 + 1.342887838522e+00 1.354727043913e+00 1.365372302051e+00 1.374837115191e+00 + 1.383136853106e+00 1.390288682952e+00 1.396311495311e+00 1.401225826696e+00 + 1.405053778803e+00 1.407818934819e+00 1.409546273083e+00 1.410262078416e+00 + 1.409993851433e+00 1.408770216150e+00 1.406620826218e+00 1.403576270089e+00 + 1.399667975436e+00 1.394928113157e+00 1.389389501250e+00 1.383085508897e+00 + 1.376049961044e+00 1.368317043767e+00 1.359921210742e+00 1.350897091066e+00 + 1.341279398726e+00 1.331102843968e+00 1.320402046811e+00 1.309211452959e+00 + 1.297565252319e+00 1.285497300354e+00 1.273041042453e+00 1.260229441521e+00 + 1.247094908937e+00 1.233669239051e+00 1.219983547349e+00 1.206068212405e+00 + 1.191952821741e+00 1.177666121662e+00 1.163235971158e+00 1.148689299921e+00 + 1.134052070515e+00 1.119349244734e+00 1.104604754140e+00 1.089841474788e+00 + 1.075081206110e+00 1.060344653911e+00 1.045651417444e+00 1.031019980477e+00 + 1.016467706281e+00 1.002010836454e+00 9.876644934525e-01 9.734426867397e-01 + 9.593583224036e-01 9.454232161144e-01 9.316481092715e-01 9.180426881845e-01 + 9.046156061222e-01 8.913745080609e-01 8.783260579512e-01 8.654759683243e-01 + 8.528290320477e-01 8.403891560415e-01 8.281593967612e-01 8.161419972524e-01 + 8.043384255816e-01 7.927494144461e-01 7.813750017691e-01 7.702145720852e-01 + 7.592668985250e-01 7.485301852117e-01 7.380021098828e-01 7.276798665597e-01 + 7.175602080880e-01 7.076394883814e-01 6.979137042049e-01 6.883785363434e-01 + 6.790293900054e-01 6.698614343236e-01 6.608696408190e-01 6.520488207049e-01 + 6.433936609179e-01 6.348987587694e-01 6.265586551227e-01 6.183678660090e-01 + 6.103209126074e-01 6.024123495215e-01 5.946367912964e-01 5.869889371295e-01 + 5.794635937392e-01 5.720556963634e-01 5.647603278708e-01 5.575727359769e-01 + 5.504883485661e-01 5.435027871291e-01 5.366118783351e-01 5.298116637647e-01 + 5.230984078384e-01 5.164686039829e-01 5.099189790850e-01 5.034464962871e-01 + 4.970483561883e-01 4.907219965172e-01 4.844650903499e-01 4.782755429504e-01 + 4.721514873143e-01 4.660912785021e-01 4.600934868494e-01 4.541568901450e-01 + 4.482804648686e-01 4.424633765848e-01 4.367049695852e-01 4.310047558766e-01 + 4.253624036096e-01 4.197777250424e-01 4.142506641348e-01 4.087812838625e-01 + 4.033697533448e-01 3.980163348711e-01 3.927213709139e-01 3.874852712079e-01 + 3.823084999769e-01 3.771915633804e-01 3.721349972533e-01 3.671393552038e-01 + 3.622051971318e-01 3.573330782258e-01 3.525235384903e-01 3.477770928499e-01 + 3.430942218749e-01 3.384753631632e-01 3.339209034105e-01 3.294311711968e-01 + 3.250064305082e-01 3.206468750123e-01 3.163526230955e-01 3.121237136700e-01 + 3.079601027506e-01 3.038616607970e-01 2.998281708131e-01 2.958593271912e-01 + 2.919547352822e-01 2.881139116717e-01 2.843362851372e-01 2.806211982569e-01 + 2.769679096388e-01 2.733755967358e-01 2.698433592092e-01 2.663702228010e-01 + 2.629551436727e-01 2.595970131682e-01 2.562946629558e-01 2.530468705019e-01 + 2.498523648317e-01 2.467098325280e-01 2.436179239222e-01 2.405752594280e-01 + 2.375804359731e-01 2.346320334812e-01 2.317286213597e-01 2.288687649482e-01 + 2.260510318856e-01 2.232739983553e-01 2.205362551671e-01 2.178364136421e-01 + 2.151731112625e-01 2.125450170553e-01 2.099508366804e-01 2.073893171946e-01 + 2.048592514678e-01 2.023594822299e-01 1.998889057289e-01 1.974464749851e-01 + 1.950312026290e-01 1.926421633118e-01 1.902784956831e-01 1.879394039318e-01 + 1.856241588886e-01 1.833320986932e-01 1.810626290297e-01 1.788152229396e-01 + 1.765894202199e-01 1.743848264217e-01 1.722011114618e-01 1.700380078656e-01 + 1.678953086602e-01 1.657728649384e-01 1.636705831165e-01 1.615884219095e-01 + 1.595263890502e-01 1.574845377777e-01 1.554629631231e-01 1.534617980220e-01 + 1.514812092796e-01 1.495213934218e-01 1.475825724573e-01 1.456649895836e-01 + 1.437689048635e-01 1.418945909028e-01 1.400423285557e-01 1.382124026860e-01 + 1.364050980113e-01 1.346206950549e-01 1.328594662287e-01 1.311216720732e-01 + 1.294075576724e-01 1.277173492659e-01 1.260512510763e-01 1.244094423676e-01 + 1.227920747499e-01 1.211992697433e-01 1.196311166126e-01 1.180876704799e-01 + 1.165689507245e-01 1.150749396739e-01 1.136055815889e-01 1.121607819445e-01 + 1.107404070054e-01 1.093442836937e-01 1.079721997437e-01 1.066239041386e-01 + 1.052991078190e-01 1.039974846564e-01 1.027186726775e-01 1.014622755288e-01 + 1.002278641668e-01 9.901497875795e-02 9.782313077323e-02 9.665180525899e-02 + 9.550046326660e-02 9.436854442164e-02 9.325546961334e-02 9.216064378426e-02 + 9.108345880003e-02 9.002329637868e-02 8.897953105904e-02 8.795153318799e-02 + 8.693867190608e-02 8.594031811199e-02 8.495584738619e-02 8.398464285514e-02 + 8.302609797786e-02 8.207961923751e-02 8.114462872159e-02 8.022056657532e-02 + 7.930689331374e-02 7.840309197944e-02 7.750867013367e-02 7.662316167031e-02 + 7.574612844318e-02 7.487716169847e-02 7.401588330588e-02 7.316194678300e-02 + 7.231503810912e-02 7.147487632614e-02 7.064121392554e-02 6.981383702175e-02 + 6.899256531393e-02 6.817725183911e-02 6.736778252125e-02 6.656407552203e-02 + 6.576608040015e-02 6.497377708742e-02 6.418717469067e-02 6.340631012970e-02 + 6.263124662243e-02 6.186207202910e-02 6.109889706828e-02 6.034185341798e-02 + 5.959109171580e-02 5.884677947253e-02 5.810909891384e-02 5.737824476519e-02 + 5.665442199500e-02 5.593784353143e-02 5.522872796790e-02 5.452729727241e-02 + 5.383377451555e-02 5.314838163169e-02 5.247133722744e-02 5.180285445101e-02 + 5.114313893551e-02 5.049238682857e-02 4.985078291990e-02 4.921849887774e-02 + 4.859569160412e-02 4.798250171810e-02 4.737905217510e-02 4.678544702965e-02 + 4.620177034738e-02 4.562808527175e-02 4.506443324922e-02 4.451083341594e-02 + 4.396728214785e-02 4.343375277482e-02 4.291019545869e-02 4.239653723369e-02 + 4.189268220694e-02 4.139851191555e-02 4.091388583593e-02 4.043864204001e-02 + 3.997259799209e-02 3.951555147938e-02 3.906728166825e-02 3.862755027772e-02 + 3.819610286095e-02 3.777267018490e-02 3.735696969794e-02 3.694870707447e-02 + 3.654757782553e-02 3.615326896400e-02 3.576546071256e-02 3.538382824290e-02 + 3.500804343402e-02 3.463777663802e-02 3.427269844162e-02 3.391248141169e-02 + 3.355680181363e-02 3.320534129149e-02 3.285778849928e-02 3.251384067318e-02 + 3.217320513500e-02 3.183560071786e-02 3.150075910546e-02 3.116842607708e-02 + 3.083836265137e-02 3.051034612224e-02 3.018417098153e-02 2.985964972338e-02 + 2.953661352651e-02 2.921491281118e-02 2.889441766852e-02 2.857501816086e-02 + 2.825662449243e-02 2.793916705072e-02 2.762259631970e-02 2.730688266665e-02 + 2.699201600563e-02 2.667800534077e-02 2.636487819401e-02 2.605267992196e-02 + 2.574147292769e-02 2.543133577365e-02 2.512236220262e-02 2.481466007401e-02 + 2.450835022332e-02 2.420356525313e-02 2.390044826409e-02 2.359915153494e-02 + 2.329983516064e-02 2.300266565796e-02 2.270781454790e-02 2.241545692458e-02 + 2.212577001985e-02 2.183893177319e-02 2.155511941611e-02 2.127450808001e-02 + 2.099726943654e-02 2.072357037869e-02 2.045357175104e-02 2.018742713666e-02 + 1.992528170814e-02 1.966727114943e-02 1.941352065482e-02 1.916414401067e-02 + 1.891924276507e-02 1.867890548977e-02 1.844320713834e-02 1.821220850348e-02 + 1.798595577619e-02 1.776448020835e-02 1.754779787984e-02 1.733590957064e-02 + 1.712880073748e-02 1.692644159407e-02 1.672878729330e-02 1.653577820895e-02 + 1.634734031411e-02 1.616338565257e-02 1.598381289929e-02 1.580850800495e-02 + 1.563734491978e-02 1.547018639065e-02 1.530688482563e-02 1.514728321942e-02 + 1.499121613292e-02 1.483851071980e-02 1.468898779289e-02 1.454246292273e-02 + 1.439874756077e-02 1.425765017942e-02 1.411897742129e-02 1.398253524971e-02 + 1.384813009314e-02 1.371556997561e-02 1.358466562605e-02 1.345523155923e-02 + 1.332708712145e-02 1.320005749427e-02 1.307397465026e-02 1.294867825452e-02 + 1.282401650690e-02 1.269984691961e-02 1.257603702582e-02 1.245246501512e-02 + 1.232902029249e-02 1.220560395758e-02 1.208212920209e-02 1.195852162325e-02 + 1.183471945225e-02 1.171067369687e-02 1.158634819813e-02 1.146171960159e-02 + 1.133677724410e-02 1.121152295783e-02 1.108597079338e-02 1.096014666495e-02 + 1.083408792038e-02 1.070784283988e-02 1.058147006741e-02 1.045503797910e-02 + 1.032862399368e-02 1.020231383001e-02 1.007620071720e-02 9.950384563086e-03 + 9.824971087055e-03 9.700070923359e-03 9.575798701242e-03 9.452272108278e-03 + 9.329610943381e-03 9.207936165980e-03 9.087368947783e-03 8.968029733511e-03 + 8.850037316863e-03 8.733507937802e-03 8.618554407078e-03 8.505285263657e-03 + 8.393803970449e-03 8.284208153457e-03 8.176588889091e-03 8.071030044062e-03 + 7.967607671864e-03 7.866389469441e-03 7.767434297208e-03 7.670791765129e-03 + 7.576501887099e-03 7.484594805397e-03 7.395090586489e-03 7.307999088963e-03 + 7.223319903894e-03 7.141042367445e-03 7.061145645014e-03 6.983598885766e-03 + 6.908361445924e-03 6.835383178746e-03 6.764604788651e-03 6.695958246585e-03 + 6.629367263288e-03 6.564747816781e-03 6.502008730030e-03 6.441052294461e-03 + 6.381774934689e-03 6.324067909605e-03 6.267818044733e-03 6.212908490608e-03 + 6.159219501783e-03 6.106629230949e-03 6.055014532629e-03 6.004251770844e-03 + 5.954217625165e-03 5.904789889639e-03 5.855848259131e-03 5.807275097749e-03 + 5.758956184216e-03 5.710781429171e-03 5.662645559677e-03 5.614448766417e-03 + 5.566097309364e-03 5.517504078010e-03 5.468589102591e-03 5.419280013061e-03 + 5.369512443000e-03 5.319230375965e-03 5.268386432279e-03 5.216942094584e-03 + 5.164867870992e-03 5.112143395040e-03 5.058757462124e-03 5.004708002508e-03 + 4.950001991440e-03 4.894655297341e-03 4.838692469426e-03 4.782146466559e-03 + 4.725058329501e-03 4.667476799104e-03 4.609457883366e-03 4.551064376569e-03 + 4.492365334071e-03 4.433435506574e-03 4.374354737978e-03 4.315207331132e-03 + 4.256081386021e-03 4.197068115070e-03 4.138261140407e-03 4.079755777996e-03 + 4.021648313667e-03 3.964035276043e-03 3.907012711426e-03 3.850675465625e-03 + 3.795116477667e-03 3.740426090216e-03 3.686691381401e-03 3.633995522588e-03 + 3.582417166444e-03 3.532029869390e-03 3.482901552337e-03 3.435094003277e-03 + 3.388662425042e-03 3.343655031184e-03 3.300112692642e-03 3.258068637445e-03 + 3.217548205397e-03 3.178568659244e-03 3.141139053489e-03 3.105260161581e-03 + 3.070924461834e-03 3.038116182008e-03 3.006811402101e-03 2.976978214492e-03 + 2.948576940192e-03 2.921560399576e-03 2.895874235616e-03 2.871457287251e-03 + 2.848242010226e-03 2.826154942389e-03 2.805117210156e-03 2.785045072566e-03 + 2.765850499104e-03 2.747441777247e-03 2.729724145494e-03 2.712600447460e-03 + 2.695971802504e-03 2.679738288218e-03 2.663799630071e-03 2.648055893421e-03 + 2.632408173111e-03 2.616759275908e-03 2.601014391046e-03 2.585081744281e-03 + 2.568873230918e-03 2.552305023468e-03 2.535298149731e-03 2.517779037327e-03 + 2.499680020904e-03 2.480939808524e-03 2.461503903985e-03 2.441324982167e-03 + 2.420363214753e-03 2.398586544076e-03 2.375970903129e-03 2.352500380192e-03 + 2.328167326847e-03 2.302972408589e-03 2.276924597575e-03 2.250041107472e-03 + 2.222347270745e-03 2.193876359100e-03 2.164669348201e-03 2.134774628125e-03 + 2.104247661406e-03 2.073150590858e-03 2.041551799704e-03 2.009525426863e-03 + 1.977150840543e-03 1.944512073575e-03 1.911697224169e-03 1.878797826026e-03 + 1.845908191926e-03 1.813124735106e-03 1.780545272907e-03 1.748268317253e-03 + 1.716392356669e-03 1.685015134571e-03 1.654232928608e-03 1.624139835837e-03 + 1.594827068485e-03 1.566382264978e-03 1.538888820844e-03 1.512425243959e-03 + 1.487064538469e-03 1.462873621539e-03 1.439912776851e-03 1.418235148603e-03 + 1.397886279419e-03 1.378903695388e-03 1.361316541089e-03 1.345145267177e-03 + 1.330401372742e-03 1.317087204330e-03 1.305195813119e-03 1.294710871381e-03 + 1.285606648941e-03 1.277848049954e-03 1.271390709857e-03 1.266181151892e-03 + 1.262157002094e-03 1.259247261038e-03 1.257372629988e-03 1.256445888300e-03 + 1.256372317939e-03 1.257050169762e-03 1.258371164675e-03 1.260221020806e-03 + 1.262479995372e-03 1.265023426865e-03 1.267722259454e-03 1.270443527154e-03 + 1.273050770446e-03 1.275404352865e-03 1.277361640234e-03 1.278777001383e-03 + 1.279501587554e-03 1.279382849847e-03 1.278263761804e-03 1.275981729809e-03 + 1.272367199681e-03 1.267242005586e-03 1.260417558647e-03 1.251693037373e-03 + 1.240853818454e-03 1.227670470115e-03 1.211898713617e-03 1.193280830673e-03 + 1.171549041425e-03 1.146431382802e-03 1.117660563243e-03 1.084986141051e-03 + 1.048190158810e-03 1.007106061638e-03 9.616403401761e-04 9.117958912844e-04 + 8.576956167753e-04 7.996043336342e-04 7.379467099683e-04 6.733187363399e-04 + 6.064902563311e-04 5.383963642217e-04 4.701160591847e-04 4.028374193811e-04 + 3.378096816747e-04 2.762838987458e-04 2.194451740707e-04 1.683406996263e-04 + 1.238087845849e-04 8.641461945317e-05 5.639855469582e-05 3.364212299270e-05 + 1.765590279501e-05 7.591682743524e-06 2.279385157959e-06 2.870401658966e-07 + 0.000000000000e+00 + Type L N + 0 1 1 + 0.000000000000e+00 3.375340101333e-02 6.746796349822e-02 1.011049138555e-01 + 1.346256082234e-01 1.679915970424e-01 2.011646892560e-01 2.341070160275e-01 + 2.667810938520e-01 2.991498869451e-01 3.311768687900e-01 3.628260827265e-01 + 3.940622014666e-01 4.248505854211e-01 4.551573397281e-01 4.849493698694e-01 + 5.141944357697e-01 5.428612042712e-01 5.709192998796e-01 5.983393536821e-01 + 6.250930503389e-01 6.511531730530e-01 6.764936464275e-01 7.010895771214e-01 + 7.249172922209e-01 7.479543752446e-01 7.701796997065e-01 7.915734601660e-01 + 8.121172006957e-01 8.317938407052e-01 8.505876980641e-01 8.684845094698e-01 + 8.854714480139e-01 9.015371379059e-01 9.166716663176e-01 9.308665923177e-01 + 9.441149528744e-01 9.564112659059e-01 9.677515303693e-01 9.781332233824e-01 + 9.875552943794e-01 9.960181563106e-01 1.003523673900e+00 1.010075148982e+00 + 1.015677302955e+00 1.020336256368e+00 1.024059505710e+00 1.026855897434e+00 + 1.028735599272e+00 1.029710068925e+00 1.029792020169e+00 1.028995386487e+00 + 1.027335282286e+00 1.024827961803e+00 1.021490775799e+00 1.017342126138e+00 + 1.012401418364e+00 1.006689012392e+00 1.000226171440e+00 9.930350093166e-01 + 9.851384362041e-01 9.765601030744e-01 9.673243448728e-01 9.574561226182e-01 + 9.469809645661e-01 9.359249065863e-01 9.243144319084e-01 9.121764103924e-01 + 8.995380374803e-01 8.864267729912e-01 8.728702799165e-01 8.588963633783e-01 + 8.445329099101e-01 8.298078272199e-01 8.147489845939e-01 7.993841540983e-01 + 7.837409527334e-01 7.678467856909e-01 7.517287908658e-01 7.354137847644e-01 + 7.189282099516e-01 7.022980841725e-01 6.855489512787e-01 6.687058340848e-01 + 6.517931892735e-01 6.348348644627e-01 6.178540575378e-01 6.008732783497e-01 + 5.839143128664e-01 5.669981898627e-01 5.501451502191e-01 5.333746188975e-01 + 5.167051796490e-01 5.001545525002e-01 4.837395740569e-01 4.674761806538e-01 + 4.513793943678e-01 4.354633119048e-01 4.197410963605e-01 4.042249718435e-01 + 3.889262209421e-01 3.738551850050e-01 3.590212671974e-01 3.444329382852e-01 + 3.300977450887e-01 3.160223215414e-01 3.022124022789e-01 2.886728386745e-01 + 2.754076172314e-01 2.624198802337e-01 2.497119485487e-01 2.372853464705e-01 + 2.251408284840e-01 2.132784078267e-01 2.016973867172e-01 1.903963881162e-01 + 1.793733888809e-01 1.686257541706e-01 1.581502729567e-01 1.479431944907e-01 + 1.380002655774e-01 1.283167685047e-01 1.188875594752e-01 1.097071073890e-01 + 1.007695328252e-01 9.206864707152e-02 8.359799105358e-02 7.535087401652e-02 + 6.732041181622e-02 5.949956467938e-02 5.188117429660e-02 4.445800011708e-02 + 3.722275471825e-02 3.016813812988e-02 2.328687099752e-02 1.657172647727e-02 + 1.001556076019e-02 3.611342132348e-03 -2.647821516258e-03 -8.768656812552e-03 + -1.475770072170e-02 -2.062127813107e-02 -2.636548125059e-02 -3.199615087445e-02 + -3.751885954038e-02 -4.293889661385e-02 -4.826125531553e-02 -5.349062170172e-02 + -5.863136559834e-02 -6.368753348054e-02 -6.866284328140e-02 -7.356068110460e-02 + -7.838409980795e-02 -8.313581941656e-02 -8.781822931687e-02 -9.243339217524e-02 + -9.698304951803e-02 -1.014686289032e-01 -1.058912526074e-01 -1.102517477471e-01 + -1.145506577458e-01 -1.187882550557e-01 -1.229645550382e-01 -1.270793309018e-01 + -1.311321295940e-01 -1.351222885425e-01 -1.390489531347e-01 -1.429110948275e-01 + -1.467075297752e-01 -1.504369378627e-01 -1.540978820347e-01 -1.576888278065e-01 + -1.612081628491e-01 -1.646542165373e-01 -1.680252793568e-01 -1.713196220647e-01 + -1.745355145039e-01 -1.776712439735e-01 -1.807251330624e-01 -1.836955568580e-01 + -1.865809594450e-01 -1.893798696175e-01 -1.920909157293e-01 -1.947128396172e-01 + -1.972445095340e-01 -1.996849320388e-01 -2.020332627945e-01 -2.042888162310e-01 + -2.064510740412e-01 -2.085196924792e-01 -2.104945084419e-01 -2.123755443193e-01 + -2.141630116067e-01 -2.158573132777e-01 -2.174590449274e-01 -2.189689946957e-01 + -2.203881419935e-01 -2.217176550569e-01 -2.229588873615e-01 -2.241133729361e-01 + -2.251828206181e-01 -2.261691073020e-01 -2.270742702318e-01 -2.279004983992e-01 + -2.286501231081e-01 -2.293256077729e-01 -2.299295370205e-01 -2.304646051689e-01 + -2.309336041573e-01 -2.313394110069e-01 -2.316849748892e-01 -2.319733038842e-01 + -2.322074515083e-01 -2.323905030937e-01 -2.325255621004e-01 -2.326157364412e-01 + -2.326641248984e-01 -2.326738037117e-01 -2.326478134108e-01 -2.325891459689e-01 + -2.325007323449e-01 -2.323854304855e-01 -2.322460138479e-01 -2.320851605065e-01 + -2.319054428983e-01 -2.317093182599e-01 -2.314991198032e-01 -2.312770486727e-01 + -2.310451667226e-01 -2.308053901448e-01 -2.305594839771e-01 -2.303090575121e-01 + -2.300555606232e-01 -2.298002810200e-01 -2.295443424368e-01 -2.292887037559e-01 + -2.290341590589e-01 -2.287813385964e-01 -2.285307106594e-01 -2.282825843322e-01 + -2.280371130998e-01 -2.277942992806e-01 -2.275539992486e-01 -2.273159294059e-01 + -2.270796728624e-01 -2.268446867758e-01 -2.266103103025e-01 -2.263757731044e-01 + -2.261402043576e-01 -2.259026422030e-01 -2.256620435804e-01 -2.254172943820e-01 + -2.251672198643e-01 -2.249105952529e-01 -2.246461564765e-01 -2.243726109647e-01 + -2.240886484469e-01 -2.237929516866e-01 -2.234842070895e-01 -2.231611151244e-01 + -2.228224004966e-01 -2.224668220165e-01 -2.220931821080e-01 -2.217003359051e-01 + -2.212871998854e-01 -2.208527599957e-01 -2.203960792263e-01 -2.199163045941e-01 + -2.194126735000e-01 -2.188845194288e-01 -2.183312769643e-01 -2.177524860977e-01 + -2.171477958094e-01 -2.165169669117e-01 -2.158598741418e-01 -2.151765075019e-01 + -2.144669728436e-01 -2.137314917035e-01 -2.129704003968e-01 -2.121841483821e-01 + -2.113732959162e-01 -2.105385110171e-01 -2.096805657643e-01 -2.088003319618e-01 + -2.078987761994e-01 -2.069769543454e-01 -2.060360055126e-01 -2.050771455367e-01 + -2.041016600137e-01 -2.031108969411e-01 -2.021062590137e-01 -2.010891956219e-01 + -2.000611946063e-01 -1.990237738205e-01 -1.979784725550e-01 -1.969268428776e-01 + -1.958704409425e-01 -1.948108183233e-01 -1.937495134222e-01 -1.926880430083e-01 + -1.916278939346e-01 -1.905705150858e-01 -1.895173096023e-01 -1.884696274276e-01 + -1.874287582222e-01 -1.863959246844e-01 -1.853722763173e-01 -1.843588836761e-01 + -1.833567331280e-01 -1.823667221539e-01 -1.813896552157e-01 -1.804262402126e-01 + -1.794770855423e-01 -1.785426977825e-01 -1.776234800020e-01 -1.767197307079e-01 + -1.758316434314e-01 -1.749593069500e-01 -1.741027061414e-01 -1.732617234589e-01 + -1.724361410166e-01 -1.716256432660e-01 -1.708298202458e-01 -1.700481713799e-01 + -1.692801097974e-01 -1.685249671453e-01 -1.677819988611e-01 -1.670503898697e-01 + -1.663292606680e-01 -1.656176737570e-01 -1.649146403799e-01 -1.642191275233e-01 + -1.635300651373e-01 -1.628463535283e-01 -1.621668708785e-01 -1.614904808458e-01 + -1.608160401959e-01 -1.601424064214e-01 -1.594684452990e-01 -1.587930383416e-01 + -1.581150900972e-01 -1.574335352539e-01 -1.567473455058e-01 -1.560555361414e-01 + -1.553571723131e-01 -1.546513749544e-01 -1.539373263077e-01 -1.532142750324e-01 + -1.524815408637e-01 -1.517385187968e-01 -1.509846827728e-01 -1.502195888465e-01 + -1.494428778197e-01 -1.486542773268e-01 -1.478536033625e-01 -1.470407612462e-01 + -1.462157460186e-01 -1.453786422729e-01 -1.445296234235e-01 -1.436689504200e-01 + -1.427969699176e-01 -1.419141119176e-01 -1.410208868957e-01 -1.401178824382e-01 + -1.392057594094e-01 -1.382852476765e-01 -1.373571414199e-01 -1.364222940610e-01 + -1.354816128392e-01 -1.345360530754e-01 -1.335866121565e-01 -1.326343232816e-01 + -1.316802490079e-01 -1.307254746382e-01 -1.297711014920e-01 -1.288182401004e-01 + -1.278680033690e-01 -1.269214997512e-01 -1.259798264725e-01 -1.250440628491e-01 + -1.241152637407e-01 -1.231944531781e-01 -1.222826182036e-01 -1.213807029615e-01 + -1.204896030750e-01 -1.196101603416e-01 -1.187431577798e-01 -1.178893150558e-01 + -1.170492843167e-01 -1.162236464545e-01 -1.154129078230e-01 -1.146174974243e-01 + -1.138377645830e-01 -1.130739771182e-01 -1.123263200242e-01 -1.115948946659e-01 + -1.108797184913e-01 -1.101807252617e-01 -1.094977657963e-01 -1.088306092237e-01 + -1.081789447325e-01 -1.075423838067e-01 -1.069204629317e-01 -1.063126467520e-01 + -1.057183316588e-01 -1.051368497861e-01 -1.045674733867e-01 -1.040094195616e-01 + -1.034618553116e-01 -1.029239028794e-01 -1.023946453480e-01 -1.018731324599e-01 + -1.013583866214e-01 -1.008494090529e-01 -1.003451860488e-01 -9.984469530635e-02 + -9.934691228511e-02 -9.885081655779e-02 -9.835539811317e-02 -9.785966357267e-02 + -9.736264228232e-02 -9.686339224335e-02 -9.636100584524e-02 -9.585461536651e-02 + -9.534339821039e-02 -9.482658184372e-02 -9.430344840978e-02 -9.377333898760e-02 + -9.323565747272e-02 -9.268987405661e-02 -9.213552828457e-02 -9.157223167475e-02 + -9.099966988322e-02 -9.041760440345e-02 -8.982587379098e-02 -8.922439440716e-02 + -8.861316067895e-02 -8.799224487455e-02 -8.736179639766e-02 -8.672204060623e-02 + -8.607327716429e-02 -8.541587793847e-02 -8.475028445345e-02 -8.407700492325e-02 + -8.339661087801e-02 -8.270973340809e-02 -8.201705904985e-02 -8.131932533933e-02 + -8.061731606233e-02 -7.991185623101e-02 -7.920380681863e-02 -7.849405928578e-02 + -7.778352993221e-02 -7.707315410983e-02 -7.636388033277e-02 -7.565666432118e-02 + -7.495246301588e-02 -7.425222860060e-02 -7.355690256896e-02 -7.286740987259e-02 + -7.218465318639e-02 -7.150950732601e-02 -7.084281385174e-02 -7.018537589158e-02 + -6.953795321511e-02 -6.890125758787e-02 -6.827594843441e-02 -6.766262883596e-02 + -6.706184188687e-02 -6.647406743135e-02 -6.589971920003e-02 -6.533914236294e-02 + -6.479261151330e-02 -6.426032909359e-02 -6.374242427268e-02 -6.323895228008e-02 + -6.274989420036e-02 -6.227515722821e-02 -6.181457538156e-02 -6.136791066736e-02 + -6.093485469211e-02 -6.051503070615e-02 -6.010799606826e-02 -5.971324511462e-02 + -5.933021241354e-02 -5.895827638510e-02 -5.859676326279e-02 -5.824495137181e-02 + -5.790207569719e-02 -5.756733271290e-02 -5.723988544151e-02 -5.691886871294e-02 + -5.660339458914e-02 -5.629255792112e-02 -5.598544200347e-02 -5.568112429147e-02 + -5.537868214503e-02 -5.507719856411e-02 -5.477576787990e-02 -5.447350136674e-02 + -5.416953274002e-02 -5.386302350631e-02 -5.355316813253e-02 -5.323919900273e-02 + -5.292039113168e-02 -5.259606660662e-02 -5.226559872992e-02 -5.192841583729e-02 + -5.158400476822e-02 -5.123191396769e-02 -5.087175620014e-02 -5.050321085940e-02 + -5.012602586062e-02 -4.974001910291e-02 -4.934507949390e-02 -4.894116753052e-02 + -4.852831543246e-02 -4.810662682810e-02 -4.767627599506e-02 -4.723750666042e-02 + -4.679063036846e-02 -4.633602442617e-02 -4.587412943961e-02 -4.540544645667e-02 + -4.493053373399e-02 -4.445000314847e-02 -4.396451627563e-02 -4.347478015932e-02 + -4.298154279907e-02 -4.248558838326e-02 -4.198773229754e-02 -4.148881593965e-02 + -4.098970137276e-02 -4.049126585042e-02 -3.999439624720e-02 -3.949998342938e-02 + -3.900891660067e-02 -3.852207765799e-02 -3.804033559219e-02 -3.756454096847e-02 + -3.709552052070e-02 -3.663407189310e-02 -3.618095856188e-02 -3.573690496837e-02 + -3.530259189383e-02 -3.487865210461e-02 -3.446566629484e-02 -3.406415935180e-02 + -3.367459696729e-02 -3.329738261618e-02 -3.293285492101e-02 -3.258128541928e-02 + -3.224287674747e-02 -3.191776125334e-02 -3.160600004545e-02 -3.130758248621e-02 + -3.102242613197e-02 -3.075037712086e-02 -3.049121100666e-02 -3.024463403384e-02 + -3.001028484654e-02 -2.978773662133e-02 -2.957649961123e-02 -2.937602408583e-02 + -2.918570364980e-02 -2.900487891999e-02 -2.883284153897e-02 -2.866883850065e-02 + -2.851207676207e-02 -2.836172811322e-02 -2.821693427547e-02 -2.807681219758e-02 + -2.794045951709e-02 -2.780696015387e-02 -2.767539000166e-02 -2.754482268274e-02 + -2.741433533076e-02 -2.728301436604e-02 -2.714996122805e-02 -2.701429802975e-02 + -2.687517309904e-02 -2.673176637293e-02 -2.658329461132e-02 -2.642901639774e-02 + -2.626823689621e-02 -2.610031233427e-02 -2.592465418425e-02 -2.574073301636e-02 + -2.554808199911e-02 -2.534630002494e-02 -2.513505444066e-02 -2.491408336509e-02 + -2.468319757853e-02 -2.444228197111e-02 -2.419129654013e-02 -2.393027692850e-02 + -2.365933449986e-02 -2.337865594821e-02 -2.308850244281e-02 -2.278920831204e-02 + -2.248117927242e-02 -2.216489021197e-02 -2.184088253950e-02 -2.150976111438e-02 + -2.117219077357e-02 -2.082889247518e-02 -2.048063908047e-02 -2.012825079787e-02 + -1.977259031513e-02 -1.941455764743e-02 -1.905508473103e-02 -1.869512979362e-02 + -1.833567153412e-02 -1.797770314545e-02 -1.762222621544e-02 -1.727024454121e-02 + -1.692275789348e-02 -1.658075576729e-02 -1.624521115604e-02 -1.591707438558e-02 + -1.559726704482e-02 -1.528667604908e-02 -1.498614787135e-02 -1.469648297606e-02 + -1.441843048879e-02 -1.415268313393e-02 -1.389987247105e-02 -1.366056445881e-02 + -1.343525537381e-02 -1.322436810926e-02 -1.302824887671e-02 -1.284716433160e-02 + -1.268129914080e-02 -1.253075400823e-02 -1.239554417166e-02 -1.227559838124e-02 + -1.217075836756e-02 -1.208077880421e-02 -1.200532776672e-02 -1.194398768716e-02 + -1.189625680016e-02 -1.186155107347e-02 -1.183920661233e-02 -1.182848252393e-02 + -1.182856422366e-02 -1.183856716099e-02 -1.185754093687e-02 -1.188447377830e-02 + -1.191829732706e-02 -1.195789168909e-02 -1.200209067673e-02 -1.204968715833e-02 + -1.209943840630e-02 -1.215007130625e-02 -1.220028725426e-02 -1.224876652818e-02 + -1.229417187213e-02 -1.233515098480e-02 -1.237033755583e-02 -1.239835045939e-02 + -1.241779070038e-02 -1.242723573197e-02 -1.242523084214e-02 -1.241027746188e-02 + -1.238081850111e-02 -1.233522118866e-02 -1.227175839268e-02 -1.218859002675e-02 + -1.208374688581e-02 -1.195512006101e-02 -1.180045987933e-02 -1.161738899598e-02 + -1.140343469983e-02 -1.115608551522e-02 -1.087287663337e-02 -1.055150743420e-02 + -1.018999225887e-02 -9.786842636481e-03 -9.341275432695e-03 -8.853437083322e-03 + -8.324629554625e-03 -7.757519422508e-03 -7.156308076494e-03 -6.526839170932e-03 + -5.876619671647e-03 -5.214733660413e-03 -4.551633714403e-03 -3.898803112012e-03 + -3.268292897218e-03 -2.672150143947e-03 -2.121766438798e-03 -1.627187242489e-03 + -1.196431908000e-03 -8.348793414504e-04 -5.447745126481e-04 -3.249056704027e-04 + -1.704912337315e-04 -7.329963822255e-05 -2.200628869199e-05 -2.771091616120e-06 + 0.000000000000e+00 + Type L N + 0 2 0 + 0.000000000000e+00 -3.343626342662e-04 -1.336837154607e-03 -3.005584903671e-03 + -5.337546547975e-03 -8.328449682246e-03 -1.197281945274e-02 -1.626399216017e-02 + -2.119413180214e-02 -2.675424950468e-02 -3.293422578324e-02 -3.972283556741e-02 + -4.710777591292e-02 -5.507569631817e-02 -6.361223155362e-02 -7.270203690572e-02 + -8.232882572951e-02 -9.247540919759e-02 -1.031237381265e-01 -1.142549467555e-01 + -1.258493983485e-01 -1.378867324813e-01 -1.503459138772e-01 -1.632052826437e-01 + -1.764426057637e-01 -1.900351296900e-01 -2.039596338880e-01 -2.181924851715e-01 + -2.327096926724e-01 -2.474869632865e-01 -2.624997574346e-01 -2.777233449784e-01 + -2.931328611333e-01 -3.087033622181e-01 -3.244098810844e-01 -3.402274820706e-01 + -3.561313153280e-01 -3.720966703679e-01 -3.880990286845e-01 -4.041141153094e-01 + -4.201179491604e-01 -4.360868920511e-01 -4.519976962312e-01 -4.678275503368e-01 + -4.835541236322e-01 -4.991556084334e-01 -5.146107606085e-01 -5.298989380595e-01 + -5.450001370934e-01 -5.598950266029e-01 -5.745649799796e-01 -5.889921046952e-01 + -6.031592694904e-01 -6.170501291222e-01 -6.306491466272e-01 -6.439416130674e-01 + -6.569136647327e-01 -6.695522977849e-01 -6.818453803336e-01 -6.937816619452e-01 + -7.053507805935e-01 -7.165432670680e-01 -7.273505468671e-01 -7.377649396064e-01 + -7.477796559861e-01 -7.573887923636e-01 -7.665873229882e-01 -7.753710899610e-01 + -7.837367909893e-01 -7.916819650125e-01 -7.992049757811e-01 -8.063049934769e-01 + -8.129819744702e-01 -8.192366393094e-01 -8.250704490495e-01 -8.304855800252e-01 + -8.354848971804e-01 -8.400719260699e-01 -8.442508236491e-01 -8.480263479737e-01 + -8.514038269297e-01 -8.543891261192e-01 -8.569886160244e-01 -8.592091385765e-01 + -8.610579732544e-01 -8.625428028381e-01 -8.636716789393e-01 -8.644529874351e-01 + -8.648954139221e-01 -8.650079093126e-01 -8.647996556872e-01 -8.642800325178e-01 + -8.634585833709e-01 -8.623449831963e-01 -8.609490063045e-01 -8.592804951284e-01 + -8.573493298636e-01 -8.551653990737e-01 -8.527385713425e-01 -8.500786680519e-01 + -8.471954373523e-01 -8.440985293945e-01 -8.407974728780e-01 -8.373016529705e-01 + -8.336202906425e-01 -8.297624234571e-01 -8.257368878476e-01 -8.215523029081e-01 + -8.172170557172e-01 -8.127392882070e-01 -8.081268855835e-01 -8.033874662982e-01 + -7.985283735640e-01 -7.935566684020e-01 -7.884791242011e-01 -7.833022227637e-01 + -7.780321518080e-01 -7.726748038897e-01 -7.672357767027e-01 -7.617203747098e-01 + -7.561336120554e-01 -7.504802167010e-01 -7.447646357266e-01 -7.389910417321e-01 + -7.331633402733e-01 -7.272851782609e-01 -7.213599532512e-01 -7.153908235516e-01 + -7.093807190655e-01 -7.033323527959e-01 -6.972482329292e-01 -6.911306754180e-01 + -6.849818169812e-01 -6.788036284404e-01 -6.725979283113e-01 -6.663663965707e-01 + -6.601105885181e-01 -6.538319486556e-01 -6.475318245087e-01 -6.412114803151e-01 + -6.348721105083e-01 -6.285148529281e-01 -6.221408016911e-01 -6.157510196589e-01 + -6.093465504440e-01 -6.029284298983e-01 -5.964976970317e-01 -5.900554043133e-01 + -5.836026273123e-01 -5.771404736385e-01 -5.706700911490e-01 -5.641926753898e-01 + -5.577094762487e-01 -5.512218037973e-01 -5.447310333076e-01 -5.382386094324e-01 + -5.317460495410e-01 -5.252549462125e-01 -5.187669688857e-01 -5.122838646765e-01 + -5.058074583733e-01 -4.993396516261e-01 -4.928824213526e-01 -4.864378173819e-01 + -4.800079593679e-01 -4.735950330014e-01 -4.672012855581e-01 -4.608290208195e-01 + -4.544805934091e-01 -4.481584025867e-01 -4.418648855484e-01 -4.356025102794e-01 + -4.293737680101e-01 -4.231811653276e-01 -4.170272159956e-01 -4.109144325344e-01 + -4.048453176194e-01 -3.988223553477e-01 -3.928480024327e-01 -3.869246793767e-01 + -3.810547616785e-01 -3.752405711272e-01 -3.694843672348e-01 -3.637883388583e-01 + -3.581545960596e-01 -3.525851622505e-01 -3.470819666678e-01 -3.416468372203e-01 + -3.362814937487e-01 -3.309875417352e-01 -3.257664664965e-01 -3.206196278925e-01 + -3.155482555784e-01 -3.105534448246e-01 -3.056361529269e-01 -3.007971962230e-01 + -2.960372477322e-01 -2.913568354266e-01 -2.867563411432e-01 -2.822360001380e-01 + -2.777959012850e-01 -2.734359879143e-01 -2.691560592826e-01 -2.649557726669e-01 + -2.608346460667e-01 -2.567920614966e-01 -2.528272688523e-01 -2.489393903234e-01 + -2.451274253294e-01 -2.413902559506e-01 -2.377266528210e-01 -2.341352814527e-01 + -2.306147089543e-01 -2.271634111079e-01 -2.237797797652e-01 -2.204621305236e-01 + -2.172087106397e-01 -2.140177071397e-01 -2.108872550835e-01 -2.078154459384e-01 + -2.048003360207e-01 -2.018399549607e-01 -1.989323141484e-01 -1.960754151182e-01 + -1.932672578291e-01 -1.905058488019e-01 -1.877892090725e-01 -1.851153819227e-01 + -1.824824403534e-01 -1.798884942646e-01 -1.773316973091e-01 -1.748102533895e-01 + -1.723224227703e-01 -1.698665277787e-01 -1.674409580705e-01 -1.650441754402e-01 + -1.626747181578e-01 -1.603312048155e-01 -1.580123376728e-01 -1.557169054900e-01 + -1.534437858432e-01 -1.511919469166e-01 -1.489604487725e-01 -1.467484440982e-01 + -1.445551784381e-01 -1.423799899146e-01 -1.402223084519e-01 -1.380816545125e-01 + -1.359576373628e-01 -1.338499528870e-01 -1.317583809666e-01 -1.296827824501e-01 + -1.276230957362e-01 -1.255793329962e-01 -1.235515760637e-01 -1.215399720218e-01 + -1.195447285159e-01 -1.175661088266e-01 -1.156044267334e-01 -1.136600412031e-01 + -1.117333509371e-01 -1.098247888115e-01 -1.079348162442e-01 -1.060639175244e-01 + -1.042125941364e-01 -1.023813591143e-01 -1.005707314578e-01 -9.878123064275e-02 + -9.701337125784e-02 -9.526765779625e-02 -9.354457963214e-02 -9.184460620859e-02 + -9.016818246269e-02 -8.851572451171e-02 -8.688761562231e-02 -8.528420248277e-02 + -8.370579179616e-02 -8.215264721034e-02 -8.062498659825e-02 -7.912297969974e-02 + -7.764674613412e-02 -7.619635378974e-02 -7.477181759514e-02 -7.337309867347e-02 + -7.200010387990e-02 -7.065268571912e-02 -6.933064263796e-02 -6.803371968591e-02 + -6.676160953406e-02 -6.551395384105e-02 -6.429034495247e-02 -6.309032791849e-02 + -6.191340281251e-02 -6.075902733211e-02 -5.962661966204e-02 -5.851556157749e-02 + -5.742520176494e-02 -5.635485933641e-02 -5.530382751238e-02 -5.427137744758e-02 + -5.325676217347e-02 -5.225922063068e-02 -5.127798176446e-02 -5.031226865597e-02 + -4.936130266255e-02 -4.842430754004e-02 -4.750051352083e-02 -4.658916132185e-02 + -4.568950605718e-02 -4.480082103116e-02 -4.392240138864e-02 -4.305356760016e-02 + -4.219366876109e-02 -4.134208568535e-02 -4.049823377542e-02 -3.966156565219e-02 + -3.883157352997e-02 -3.800779132324e-02 -3.718979647415e-02 -3.637721149118e-02 + -3.556970519142e-02 -3.476699364092e-02 -3.396884078953e-02 -3.317505879834e-02 + -3.238550806028e-02 -3.160009691578e-02 -3.081878106792e-02 -3.004156270276e-02 + -2.926848932289e-02 -2.849965230358e-02 -2.773518518292e-02 -2.697526169857e-02 + -2.622009358570e-02 -2.546992815167e-02 -2.472504564458e-02 -2.398575643389e-02 + -2.325239802234e-02 -2.252533190942e-02 -2.180494032745e-02 -2.109162287172e-02 + -2.038579304718e-02 -1.968787475392e-02 -1.899829873448e-02 -1.831749900579e-02 + -1.764590929849e-02 -1.698395952636e-02 -1.633207230820e-02 -1.569065956384e-02 + -1.506011920558e-02 -1.444083194557e-02 -1.383315823866e-02 -1.323743537947e-02 + -1.265397477111e-02 -1.208305938198e-02 -1.152494140576e-02 -1.097984013816e-02 + -1.044794008281e-02 -9.929389296949e-03 -9.424297986017e-03 -8.932737354798e-03 + -8.454738720835e-03 -7.990292894352e-03 -7.539349827129e-03 -7.101818531054e-03 + -6.677567265404e-03 -6.266423990178e-03 -5.868177081158e-03 -5.482576300744e-03 + -5.109334017007e-03 -4.748126661889e-03 -4.398596418013e-03 -4.060353122176e-03 + -3.732976372278e-03 -3.416017823244e-03 -3.109003656357e-03 -2.811437205408e-03 + -2.522801722167e-03 -2.242563262875e-03 -1.970173676792e-03 -1.705073677284e-03 + -1.446695975487e-03 -1.194468456330e-03 -9.478173764667e-04 -7.061705636916e-04 + -4.689605974468e-04 -2.356279502815e-04 -5.624070443108e-06 2.215856137444e-04 + 4.465187864809e-04 6.696734521357e-04 8.915252751909e-04 1.112525068831e-03 + 1.333096447502e-03 1.553633657665e-03 1.774499599783e-03 1.996024053307e-03 + 2.218502115094e-03 2.442192860297e-03 2.667318233328e-03 2.894062174991e-03 + 3.122569990378e-03 3.352947960583e-03 3.585263199706e-03 3.819543757117e-03 + 4.055778963323e-03 4.293920016333e-03 4.533880803833e-03 4.775538955066e-03 + 5.018737114848e-03 5.263284430803e-03 5.508958243561e-03 5.755505968455e-03 + 6.002647156047e-03 6.250075717768e-03 6.497462301937e-03 6.744456804555e-03 + 6.990690998455e-03 7.235781263722e-03 7.479331401700e-03 7.720935514475e-03 + 7.960180931322e-03 8.196651163443e-03 8.429928868145e-03 8.659598803677e-03 + 8.885250756012e-03 9.106482419171e-03 9.322902210975e-03 9.534132006645e-03 + 9.739809773209e-03 9.939592088387e-03 1.013315652839e-02 1.032020390999e-02 + 1.050046037311e-02 1.067367929138e-02 1.083964299904e-02 1.099816432397e-02 + 1.114908791773e-02 1.129229137491e-02 1.142768613538e-02 1.155521816451e-02 + 1.167486840766e-02 1.178665301699e-02 1.189062334975e-02 1.198686573886e-02 + 1.207550103810e-02 1.215668394523e-02 1.223060210846e-02 1.229747502216e-02 + 1.235755271998e-02 1.241111427384e-02 1.245846610930e-02 1.249994014833e-02 + 1.253589179188e-02 1.256669775556e-02 1.259275377257e-02 1.261447217886e-02 + 1.263227939621e-02 1.264661332954e-02 1.265792069506e-02 1.266665429669e-02 + 1.267327026786e-02 1.267822529655e-02 1.268197385112e-02 1.268496542450e-02 + 1.268764181424e-02 1.269043445550e-02 1.269376182389e-02 1.269802692425e-02 + 1.270361488126e-02 1.271089064677e-02 1.272019683810e-02 1.273185172070e-02 + 1.274614734761e-02 1.276334786702e-02 1.278368800834e-02 1.280737175581e-02 + 1.283457121768e-02 1.286542569759e-02 1.290004097353e-02 1.293848878846e-02 + 1.298080655521e-02 1.302699727721e-02 1.307702968475e-02 1.313083858562e-02 + 1.318832542729e-02 1.324935906660e-02 1.331377674153e-02 1.338138523858e-02 + 1.345196224768e-02 1.352525789593e-02 1.360099644967e-02 1.367887817415e-02 + 1.375858133831e-02 1.383976435191e-02 1.392206802105e-02 1.400511790768e-02 + 1.408852677781e-02 1.417189712294e-02 1.425482373845e-02 1.433689634259e-02 + 1.441770221955e-02 1.449682886970e-02 1.457386665042e-02 1.464841139079e-02 + 1.472006696371e-02 1.478844779938e-02 1.485318132444e-02 1.491391031148e-02 + 1.497029512441e-02 1.502201584577e-02 1.506877427283e-02 1.511029577033e-02 + 1.514633096835e-02 1.517665729523e-02 1.520108033617e-02 1.521943500936e-02 + 1.523158655287e-02 1.523743131645e-02 1.523689735383e-02 1.522994481228e-02 + 1.521656611768e-02 1.519678595426e-02 1.517066104006e-02 1.513827969981e-02 + 1.509976123868e-02 1.505525512150e-02 1.500493996308e-02 1.494902233675e-02 + 1.488773540916e-02 1.482133741048e-02 1.475010995040e-02 1.467435619093e-02 + 1.459439888821e-02 1.451057831614e-02 1.442325008548e-02 1.433278287269e-02 + 1.423955607319e-02 1.414395739449e-02 1.404638040462e-02 1.394722205179e-02 + 1.384688017131e-02 1.374575099580e-02 1.364422668469e-02 1.354269288897e-02 + 1.344152636660e-02 1.334109266410e-02 1.324174387886e-02 1.314381651665e-02 + 1.304762945779e-02 1.295348204502e-02 1.286165230509e-02 1.277239531539e-02 + 1.268594172582e-02 1.260249644524e-02 1.252223750064e-02 1.244531507624e-02 + 1.237185073831e-02 1.230193685046e-02 1.223563618299e-02 1.217298171836e-02 + 1.211397665396e-02 1.205859460168e-02 1.200677998284e-02 1.195844861567e-02 + 1.191348849118e-02 1.187176073223e-02 1.183310072929e-02 1.179731944541e-02 + 1.176420488159e-02 1.173352369290e-02 1.170502294478e-02 1.167843199771e-02 + 1.165346450811e-02 1.162982053213e-02 1.160718871857e-02 1.158524857654e-02 + 1.156367280306e-02 1.154212965511e-02 1.152028535082e-02 1.149780648386e-02 + 1.147436243525e-02 1.144962776679e-02 1.142328458018e-02 1.139502482655e-02 + 1.136455255094e-02 1.133158605705e-02 1.129585997790e-02 1.125712723852e-02 + 1.121516089784e-02 1.116975585722e-02 1.112073042436e-02 1.106792772183e-02 + 1.101121693077e-02 1.095049436119e-02 1.088568434131e-02 1.081673991978e-02 + 1.074364337555e-02 1.066640653153e-02 1.058507086931e-02 1.049970744365e-02 + 1.041041659643e-02 1.031732747148e-02 1.022059733232e-02 1.012041068691e-02 + 1.001697822396e-02 9.910535567088e-03 9.801341854133e-03 9.689678149904e-03 + 9.575845701974e-03 9.460164049946e-03 9.342968999703e-03 9.224610474943e-03 + 9.105450259188e-03 8.985859642125e-03 8.866216984828e-03 8.746905218928e-03 + 8.628309295287e-03 8.510813598082e-03 8.394799340493e-03 8.280641958326e-03 + 8.168708518025e-03 8.059355155419e-03 7.952924561508e-03 7.849743531260e-03 + 7.750120591151e-03 7.654343720673e-03 7.562678182560e-03 7.475364475847e-03 + 7.392616425167e-03 7.314619418914e-03 7.241528808031e-03 7.173468476237e-03 + 7.110529591491e-03 7.052769547440e-03 7.000211102441e-03 6.952841722580e-03 + 6.910613133880e-03 6.873441087605e-03 6.841205341262e-03 6.813749856528e-03 + 6.790883213907e-03 6.772379242453e-03 6.757977861265e-03 6.747386127750e-03 + 6.740279485677e-03 6.736303203743e-03 6.735073992636e-03 6.736181785112e-03 + 6.739191659263e-03 6.743645879500e-03 6.749066022504e-03 6.754955146012e-03 + 6.760799946435e-03 6.766072836490e-03 6.770233856141e-03 6.772732309341e-03 + 6.773007995942e-03 6.770491884438e-03 6.764606049322e-03 6.754762681147e-03 + 6.740361973409e-03 6.720788705873e-03 6.695407387943e-03 6.663555908574e-03 + 6.624537771248e-03 6.577613182754e-03 6.521989517875e-03 6.456811997516e-03 + 6.381155784392e-03 6.294021095072e-03 6.194333312052e-03 6.080950401236e-03 + 5.952680131222e-03 5.808309573621e-03 5.646649058578e-03 5.466592095872e-03 + 5.267191701375e-03 5.047752081595e-03 4.807932768711e-03 4.547860173024e-03 + 4.268239306083e-03 3.970456368326e-03 3.656661280562e-03 3.329818380641e-03 + 2.993713697702e-03 2.652908684317e-03 2.312633146252e-03 1.978614320966e-03 + 1.656844398248e-03 1.353294841584e-03 1.073592084013e-03 8.226748497738e-04 + 6.044577664810e-04 4.215284098635e-04 2.749049451014e-04 1.638788182719e-04 + 8.596153714402e-05 3.694682421181e-05 1.109000226043e-05 1.396308876444e-06 + 0.000000000000e+00 \ No newline at end of file diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/STRU b/ABACUS.develop/examples/H2O-deepks-lcao/STRU new file mode 100644 index 0000000000..8dc2ac2824 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/STRU @@ -0,0 +1,28 @@ +ATOMIC_SPECIES +H 1.008 H_ONCV_PBE-1.0.upf +O 15.9994 O_ONCV_PBE-1.0.upf + +NUMERICAL_ORBITAL +H_gga_8au_60Ry_2s1p.orb +O_gga_7au_60Ry_2s2p1d.orb + +LATTICE_CONSTANT +10 + +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 + +ATOMIC_POSITIONS +Cartesian + +H +0 +2 +0.2336137046291667 0.8630016418166666 0.7271997623458333 1 1 1 +0.23417266949166665 0.9245341895916668 0.7207232227333333 1 1 1 +O +0 +1 +0.20910677665833333 0.894927691625 0.7301984601833333 1 1 1 diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/jle.orb b/ABACUS.develop/examples/H2O-deepks-lcao/jle.orb new file mode 100644 index 0000000000..d9fd439ce4 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/jle.orb @@ -0,0 +1,6018 @@ +--------------------------------------------------------------------------- +Energy Cutoff(Ry) 50 +Radius Cutoff(a.u.) 6 +Lmax 2 +Number of Sorbitals--> 13 +Number of Porbitals--> 13 +Number of Dorbitals--> 13 +--------------------------------------------------------------------------- +SUMMARY END + +Mesh 605 +dr 0.01 + L N + 0 0 +1.000000000000e+00 9.999954307450e-01 9.999817230550e-01 9.999588771557e-01 +9.999268934227e-01 9.998857723822e-01 9.998355147105e-01 9.997761212345e-01 +9.997075929310e-01 9.996299309272e-01 9.995431365007e-01 9.994472110789e-01 +9.993421562398e-01 9.992279737114e-01 9.991046653715e-01 9.989722332485e-01 +9.988306795205e-01 9.986800065157e-01 9.985202167122e-01 9.983513127379e-01 +9.981732973708e-01 9.979861735385e-01 9.977899443184e-01 9.975846129375e-01 +9.973701827725e-01 9.971466573496e-01 9.969140403446e-01 9.966723355824e-01 +9.964215470375e-01 9.961616788336e-01 9.958927352436e-01 9.956147206892e-01 +9.953276397415e-01 9.950314971204e-01 9.947262976943e-01 9.944120464808e-01 +9.940887486459e-01 9.937564095039e-01 9.934150345180e-01 9.930646292992e-01 +9.927051996072e-01 9.923367513494e-01 9.919592905814e-01 9.915728235065e-01 +9.911773564758e-01 9.907728959881e-01 9.903594486895e-01 9.899370213737e-01 +9.895056209813e-01 9.890652546003e-01 9.886159294654e-01 9.881576529582e-01 +9.876904326070e-01 9.872142760867e-01 9.867291912182e-01 9.862351859690e-01 +9.857322684524e-01 9.852204469278e-01 9.846997298001e-01 9.841701256200e-01 +9.836316430835e-01 9.830842910317e-01 9.825280784509e-01 9.819630144724e-01 +9.813891083719e-01 9.808063695699e-01 9.802148076310e-01 9.796144322642e-01 +9.790052533223e-01 9.783872808018e-01 9.777605248430e-01 9.771249957294e-01 +9.764807038877e-01 9.758276598875e-01 9.751658744415e-01 9.744953584044e-01 +9.738161227738e-01 9.731281786890e-01 9.724315374315e-01 9.717262104242e-01 +9.710122092318e-01 9.702895455599e-01 9.695582312554e-01 9.688182783058e-01 +9.680696988392e-01 9.673125051241e-01 9.665467095687e-01 9.657723247216e-01 +9.649893632704e-01 9.641978380425e-01 9.633977620041e-01 9.625891482603e-01 +9.617720100548e-01 9.609463607696e-01 9.601122139247e-01 9.592695831779e-01 +9.584184823246e-01 9.575589252974e-01 9.566909261659e-01 9.558144991363e-01 +9.549296585514e-01 9.540364188899e-01 9.531347947667e-01 9.522248009319e-01 +9.513064522713e-01 9.503797638053e-01 9.494447506893e-01 9.485014282129e-01 +9.475498117999e-01 9.465899170081e-01 9.456217595285e-01 9.446453551853e-01 +9.436607199360e-01 9.426678698702e-01 9.416668212101e-01 9.406575903096e-01 +9.396401936544e-01 9.386146478614e-01 9.375809696787e-01 9.365391759848e-01 +9.354892837886e-01 9.344313102292e-01 9.333652725750e-01 9.322911882240e-01 +9.312090747032e-01 9.301189496681e-01 9.290208309025e-01 9.279147363183e-01 +9.268006839549e-01 9.256786919789e-01 9.245487786841e-01 9.234109624904e-01 +9.222652619442e-01 9.211116957177e-01 9.199502826083e-01 9.187810415390e-01 +9.176039915569e-01 9.164191518340e-01 9.152265416659e-01 9.140261804721e-01 +9.128180877951e-01 9.116022833003e-01 9.103787867756e-01 9.091476181311e-01 +9.079087973984e-01 9.066623447304e-01 9.054082804010e-01 9.041466248047e-01 +9.028773984559e-01 9.016006219888e-01 9.003163161571e-01 8.990245018332e-01 +8.977252000079e-01 8.964184317905e-01 8.951042184077e-01 8.937825812035e-01 +8.924535416387e-01 8.911171212908e-01 8.897733418530e-01 8.884222251345e-01 +8.870637930592e-01 8.856980676661e-01 8.843250711084e-01 8.829448256533e-01 +8.815573536812e-01 8.801626776859e-01 8.787608202735e-01 8.773518041623e-01 +8.759356521824e-01 8.745123872751e-01 8.730820324926e-01 8.716446109973e-01 +8.702001460618e-01 8.687486610678e-01 8.672901795064e-01 8.658247249770e-01 +8.643523211873e-01 8.628729919524e-01 8.613867611947e-01 8.598936529435e-01 +8.583936913341e-01 8.568869006077e-01 8.553733051108e-01 8.538529292946e-01 +8.523257977150e-01 8.507919350314e-01 8.492513660070e-01 8.477041155076e-01 +8.461502085016e-01 8.445896700594e-01 8.430225253529e-01 8.414487996548e-01 +8.398685183386e-01 8.382817068775e-01 8.366883908446e-01 8.350885959116e-01 +8.334823478491e-01 8.318696725255e-01 8.302505959068e-01 8.286251440560e-01 +8.269933431327e-01 8.253552193925e-01 8.237107991864e-01 8.220601089605e-01 +8.204031752555e-01 8.187400247058e-01 8.170706840394e-01 8.153951800773e-01 +8.137135397330e-01 8.120257900115e-01 8.103319580098e-01 8.086320709151e-01 +8.069261560055e-01 8.052142406486e-01 8.034963523014e-01 8.017725185095e-01 +8.000427669069e-01 7.983071252151e-01 7.965656212430e-01 7.948182828859e-01 +7.930651381253e-01 7.913062150281e-01 7.895415417463e-01 7.877711465163e-01 +7.859950576585e-01 7.842133035765e-01 7.824259127570e-01 7.806329137685e-01 +7.788343352617e-01 7.770302059682e-01 7.752205547002e-01 7.734054103500e-01 +7.715848018895e-01 7.697587583694e-01 7.679273089188e-01 7.660904827447e-01 +7.642483091312e-01 7.624008174394e-01 7.605480371061e-01 7.586899976440e-01 +7.568267286407e-01 7.549582597581e-01 7.530846207322e-01 7.512058413721e-01 +7.493219515597e-01 7.474329812490e-01 7.455389604655e-01 7.436399193057e-01 +7.417358879367e-01 7.398268965953e-01 7.379129755873e-01 7.359941552877e-01 +7.340704661390e-01 7.321419386517e-01 7.302086034029e-01 7.282704910361e-01 +7.263276322605e-01 7.243800578507e-01 7.224277986455e-01 7.204708855480e-01 +7.185093495243e-01 7.165432216036e-01 7.145725328773e-01 7.125973144982e-01 +7.106175976801e-01 7.086334136974e-01 7.066447938841e-01 7.046517696335e-01 +7.026543723976e-01 7.006526336861e-01 6.986465850664e-01 6.966362581626e-01 +6.946216846549e-01 6.926028962792e-01 6.905799248262e-01 6.885528021412e-01 +6.865215601232e-01 6.844862307242e-01 6.824468459489e-01 6.804034378539e-01 +6.783560385471e-01 6.763046801870e-01 6.742493949824e-01 6.721902151914e-01 +6.701271731211e-01 6.680603011268e-01 6.659896316114e-01 6.639151970248e-01 +6.618370298633e-01 6.597551626691e-01 6.576696280293e-01 6.555804585759e-01 +6.534876869844e-01 6.513913459739e-01 6.492914683061e-01 6.471880867846e-01 +6.450812342547e-01 6.429709436022e-01 6.408572477532e-01 6.387401796735e-01 +6.366197723676e-01 6.344960588783e-01 6.323690722863e-01 6.302388457091e-01 +6.281054123006e-01 6.259688052507e-01 6.238290577843e-01 6.216862031607e-01 +6.195402746735e-01 6.173913056491e-01 6.152393294468e-01 6.130843794577e-01 +6.109264891046e-01 6.087656918406e-01 6.066020211492e-01 6.044355105433e-01 +6.022661935646e-01 6.000941037829e-01 5.979192747957e-01 5.957417402274e-01 +5.935615337287e-01 5.913786889758e-01 5.891932396702e-01 5.870052195375e-01 +5.848146623272e-01 5.826216018118e-01 5.804260717865e-01 5.782281060679e-01 +5.760277384943e-01 5.738250029242e-01 5.716199332362e-01 5.694125633280e-01 +5.672029271161e-01 5.649910585350e-01 5.627769915364e-01 5.605607600890e-01 +5.583423981772e-01 5.561219398012e-01 5.538994189759e-01 5.516748697302e-01 +5.494483261068e-01 5.472198221611e-01 5.449893919607e-01 5.427570695849e-01 +5.405228891241e-01 5.382868846788e-01 5.360490903593e-01 5.338095402850e-01 +5.315682685834e-01 5.293253093903e-01 5.270806968481e-01 5.248344651060e-01 +5.225866483191e-01 5.203372806474e-01 5.180863962557e-01 5.158340293127e-01 +5.135802139904e-01 5.113249844634e-01 5.090683749084e-01 5.068104195034e-01 +5.045511524271e-01 5.022906078585e-01 5.000288199758e-01 4.977658229563e-01 +4.955016509752e-01 4.932363382055e-01 4.909699188170e-01 4.887024269757e-01 +4.864338968434e-01 4.841643625769e-01 4.818938583272e-01 4.796224182391e-01 +4.773500764507e-01 4.750768670924e-01 4.728028242863e-01 4.705279821459e-01 +4.682523747753e-01 4.659760362683e-01 4.636990007081e-01 4.614213021668e-01 +4.591429747041e-01 4.568640523675e-01 4.545845691911e-01 4.523045591950e-01 +4.500240563851e-01 4.477430947521e-01 4.454617082707e-01 4.431799308996e-01 +4.408977965804e-01 4.386153392368e-01 4.363325927745e-01 4.340495910803e-01 +4.317663680216e-01 4.294829574453e-01 4.271993931780e-01 4.249157090245e-01 +4.226319387680e-01 4.203481161687e-01 4.180642749639e-01 4.157804488669e-01 +4.134966715664e-01 4.112129767260e-01 4.089293979839e-01 4.066459689517e-01 +4.043627232139e-01 4.020796943278e-01 3.997969158223e-01 3.975144211975e-01 +3.952322439240e-01 3.929504174427e-01 3.906689751635e-01 3.883879504653e-01 +3.861073766949e-01 3.838272871669e-01 3.815477151626e-01 3.792686939297e-01 +3.769902566816e-01 3.747124365969e-01 3.724352668186e-01 3.701587804535e-01 +3.678830105718e-01 3.656079902064e-01 3.633337523523e-01 3.610603299659e-01 +3.587877559645e-01 3.565160632258e-01 3.542452845871e-01 3.519754528448e-01 +3.497066007538e-01 3.474387610269e-01 3.451719663343e-01 3.429062493028e-01 +3.406416425154e-01 3.383781785106e-01 3.361158897820e-01 3.338548087774e-01 +3.315949678985e-01 3.293363995000e-01 3.270791358894e-01 3.248232093263e-01 +3.225686520215e-01 3.203154961369e-01 3.180637737846e-01 3.158135170263e-01 +3.135647578731e-01 3.113175282844e-01 3.090718601677e-01 3.068277853780e-01 +3.045853357170e-01 3.023445429328e-01 3.001054387190e-01 2.978680547147e-01 +2.956324225033e-01 2.933985736121e-01 2.911665395122e-01 2.889363516174e-01 +2.867080412837e-01 2.844816398091e-01 2.822571784326e-01 2.800346883341e-01 +2.778142006333e-01 2.755957463896e-01 2.733793566015e-01 2.711650622057e-01 +2.689528940770e-01 2.667428830274e-01 2.645350598058e-01 2.623294550973e-01 +2.601260995227e-01 2.579250236380e-01 2.557262579339e-01 2.535298328350e-01 +2.513357786996e-01 2.491441258191e-01 2.469549044171e-01 2.447681446495e-01 +2.425838766034e-01 2.404021302968e-01 2.382229356781e-01 2.360463226257e-01 +2.338723209472e-01 2.317009603788e-01 2.295322705852e-01 2.273662811590e-01 +2.252030216196e-01 2.230425214136e-01 2.208848099135e-01 2.187299164175e-01 +2.165778701493e-01 2.144287002568e-01 2.122824358125e-01 2.101391058124e-01 +2.079987391756e-01 2.058613647440e-01 2.037270112815e-01 2.015957074739e-01 +1.994674819279e-01 1.973423631710e-01 1.952203796510e-01 1.931015597352e-01 +1.909859317103e-01 1.888735237814e-01 1.867643640722e-01 1.846584806240e-01 +1.825559013952e-01 1.804566542612e-01 1.783607670137e-01 1.762682673601e-01 +1.741791829233e-01 1.720935412410e-01 1.700113697654e-01 1.679326958626e-01 +1.658575468121e-01 1.637859498066e-01 1.617179319512e-01 1.596535202632e-01 +1.575927416715e-01 1.555356230162e-01 1.534821910482e-01 1.514324724284e-01 +1.493864937280e-01 1.473442814271e-01 1.453058619151e-01 1.432712614896e-01 +1.412405063565e-01 1.392136226292e-01 1.371906363283e-01 1.351715733810e-01 +1.331564596211e-01 1.311453207879e-01 1.291381825264e-01 1.271350703867e-01 +1.251360098232e-01 1.231410261946e-01 1.211501447634e-01 1.191633906954e-01 +1.171807890593e-01 1.152023648264e-01 1.132281428698e-01 1.112581479646e-01 +1.092924047871e-01 1.073309379142e-01 1.053737718236e-01 1.034209308930e-01 +1.014724393995e-01 9.952832151981e-02 9.758860132928e-02 9.565330280182e-02 +9.372244980944e-02 9.179606612181e-02 8.987417540595e-02 8.795680122580e-02 +8.604396704186e-02 8.413569621079e-02 8.223201198506e-02 8.033293751256e-02 +7.843849583622e-02 7.654870989369e-02 7.466360251689e-02 7.278319643172e-02 +7.090751425767e-02 6.903657850744e-02 6.717041158663e-02 6.530903579334e-02 +6.345247331783e-02 6.160074624218e-02 5.975387653995e-02 5.791188607580e-02 +5.607479660517e-02 5.424262977394e-02 5.241540711809e-02 5.059315006336e-02 +4.877587992492e-02 4.696361790703e-02 4.515638510272e-02 4.335420249347e-02 +4.155709094886e-02 3.976507122629e-02 3.797816397060e-02 3.619638971384e-02 +3.441976887486e-02 3.264832175908e-02 3.088206855812e-02 2.912102934952e-02 +2.736522409646e-02 2.561467264741e-02 2.386939473585e-02 2.212940997999e-02 +2.039473788245e-02 1.866539783001e-02 1.694140909324e-02 1.522279082631e-02 +1.350956206664e-02 1.180174173465e-02 1.009934863345e-02 8.402401448598e-03 +6.710918747811e-03 5.024918980690e-03 3.344420478453e-03 1.669441453672e-03 +7.672312953838e-15 -1.663885908054e-03 -3.322198415458e-03 -4.974919786836e-03 +-6.622032406765e-03 + L N + 0 1 +1.000000000000e+00 9.999817230550e-01 9.999268934227e-01 9.998355147105e-01 +9.997075929310e-01 9.995431365007e-01 9.993421562398e-01 9.991046653715e-01 +9.988306795205e-01 9.985202167122e-01 9.981732973708e-01 9.977899443184e-01 +9.973701827725e-01 9.969140403446e-01 9.964215470375e-01 9.958927352436e-01 +9.953276397415e-01 9.947262976943e-01 9.940887486459e-01 9.934150345180e-01 +9.927051996072e-01 9.919592905814e-01 9.911773564758e-01 9.903594486895e-01 +9.895056209813e-01 9.886159294654e-01 9.876904326070e-01 9.867291912182e-01 +9.857322684524e-01 9.846997298001e-01 9.836316430835e-01 9.825280784509e-01 +9.813891083719e-01 9.802148076310e-01 9.790052533223e-01 9.777605248430e-01 +9.764807038877e-01 9.751658744415e-01 9.738161227738e-01 9.724315374315e-01 +9.710122092318e-01 9.695582312554e-01 9.680696988392e-01 9.665467095687e-01 +9.649893632704e-01 9.633977620041e-01 9.617720100548e-01 9.601122139247e-01 +9.584184823246e-01 9.566909261659e-01 9.549296585514e-01 9.531347947667e-01 +9.513064522713e-01 9.494447506893e-01 9.475498117999e-01 9.456217595284e-01 +9.436607199360e-01 9.416668212101e-01 9.396401936544e-01 9.375809696787e-01 +9.354892837886e-01 9.333652725750e-01 9.312090747032e-01 9.290208309025e-01 +9.268006839549e-01 9.245487786841e-01 9.222652619442e-01 9.199502826083e-01 +9.176039915569e-01 9.152265416659e-01 9.128180877950e-01 9.103787867756e-01 +9.079087973983e-01 9.054082804010e-01 9.028773984559e-01 9.003163161571e-01 +8.977252000079e-01 8.951042184077e-01 8.924535416387e-01 8.897733418530e-01 +8.870637930592e-01 8.843250711084e-01 8.815573536812e-01 8.787608202735e-01 +8.759356521824e-01 8.730820324926e-01 8.702001460617e-01 8.672901795064e-01 +8.643523211873e-01 8.613867611947e-01 8.583936913341e-01 8.553733051108e-01 +8.523257977150e-01 8.492513660070e-01 8.461502085016e-01 8.430225253528e-01 +8.398685183386e-01 8.366883908446e-01 8.334823478491e-01 8.302505959068e-01 +8.269933431327e-01 8.237107991864e-01 8.204031752555e-01 8.170706840394e-01 +8.137135397329e-01 8.103319580097e-01 8.069261560055e-01 8.034963523014e-01 +8.000427669069e-01 7.965656212430e-01 7.930651381253e-01 7.895415417462e-01 +7.859950576585e-01 7.824259127570e-01 7.788343352617e-01 7.752205547002e-01 +7.715848018895e-01 7.679273089188e-01 7.642483091312e-01 7.605480371061e-01 +7.568267286406e-01 7.530846207322e-01 7.493219515597e-01 7.455389604655e-01 +7.417358879367e-01 7.379129755873e-01 7.340704661390e-01 7.302086034029e-01 +7.263276322605e-01 7.224277986455e-01 7.185093495243e-01 7.145725328773e-01 +7.106175976801e-01 7.066447938841e-01 7.026543723976e-01 6.986465850664e-01 +6.946216846549e-01 6.905799248262e-01 6.865215601232e-01 6.824468459489e-01 +6.783560385470e-01 6.742493949824e-01 6.701271731211e-01 6.659896316114e-01 +6.618370298633e-01 6.576696280293e-01 6.534876869844e-01 6.492914683060e-01 +6.450812342546e-01 6.408572477532e-01 6.366197723676e-01 6.323690722863e-01 +6.281054123006e-01 6.238290577842e-01 6.195402746735e-01 6.152393294468e-01 +6.109264891046e-01 6.066020211492e-01 6.022661935645e-01 5.979192747957e-01 +5.935615337287e-01 5.891932396702e-01 5.848146623272e-01 5.804260717864e-01 +5.760277384943e-01 5.716199332362e-01 5.672029271161e-01 5.627769915364e-01 +5.583423981772e-01 5.538994189759e-01 5.494483261068e-01 5.449893919606e-01 +5.405228891241e-01 5.360490903593e-01 5.315682685834e-01 5.270806968481e-01 +5.225866483190e-01 5.180863962556e-01 5.135802139904e-01 5.090683749084e-01 +5.045511524271e-01 5.000288199758e-01 4.955016509752e-01 4.909699188169e-01 +4.864338968434e-01 4.818938583271e-01 4.773500764507e-01 4.728028242863e-01 +4.682523747752e-01 4.636990007081e-01 4.591429747041e-01 4.545845691910e-01 +4.500240563851e-01 4.454617082707e-01 4.408977965803e-01 4.363325927745e-01 +4.317663680215e-01 4.271993931779e-01 4.226319387679e-01 4.180642749639e-01 +4.134966715663e-01 4.089293979839e-01 4.043627232139e-01 3.997969158223e-01 +3.952322439240e-01 3.906689751635e-01 3.861073766949e-01 3.815477151625e-01 +3.769902566816e-01 3.724352668185e-01 3.678830105718e-01 3.633337523523e-01 +3.587877559645e-01 3.542452845871e-01 3.497066007538e-01 3.451719663342e-01 +3.406416425153e-01 3.361158897820e-01 3.315949678984e-01 3.270791358894e-01 +3.225686520215e-01 3.180637737845e-01 3.135647578730e-01 3.090718601677e-01 +3.045853357170e-01 3.001054387190e-01 2.956324225032e-01 2.911665395122e-01 +2.867080412837e-01 2.822571784326e-01 2.778142006333e-01 2.733793566015e-01 +2.689528940770e-01 2.645350598058e-01 2.601260995227e-01 2.557262579339e-01 +2.513357786996e-01 2.469549044171e-01 2.425838766033e-01 2.382229356781e-01 +2.338723209471e-01 2.295322705852e-01 2.252030216196e-01 2.208848099134e-01 +2.165778701492e-01 2.122824358125e-01 2.079987391756e-01 2.037270112815e-01 +1.994674819278e-01 1.952203796510e-01 1.909859317102e-01 1.867643640722e-01 +1.825559013951e-01 1.783607670136e-01 1.741791829233e-01 1.700113697654e-01 +1.658575468121e-01 1.617179319512e-01 1.575927416715e-01 1.534821910481e-01 +1.493864937279e-01 1.453058619150e-01 1.412405063565e-01 1.371906363282e-01 +1.331564596210e-01 1.291381825264e-01 1.251360098231e-01 1.211501447634e-01 +1.171807890593e-01 1.132281428698e-01 1.092924047870e-01 1.053737718236e-01 +1.014724393995e-01 9.758860132924e-02 9.372244980940e-02 8.987417540592e-02 +8.604396704183e-02 8.223201198502e-02 7.843849583619e-02 7.466360251685e-02 +7.090751425763e-02 6.717041158660e-02 6.345247331779e-02 5.975387653992e-02 +5.607479660513e-02 5.241540711806e-02 4.877587992489e-02 4.515638510269e-02 +4.155709094883e-02 3.797816397057e-02 3.441976887483e-02 3.088206855808e-02 +2.736522409643e-02 2.386939473581e-02 2.039473788242e-02 1.694140909321e-02 +1.350956206661e-02 1.009934863341e-02 6.710918747778e-03 3.344420478420e-03 +-2.512273976170e-14 -3.322198415490e-03 -6.622032406798e-03 -9.899361531813e-03 +-1.315404727543e-02 -1.638595305741e-02 -1.959494424002e-02 -2.278088813553e-02 +-2.594365401354e-02 -2.908311310815e-02 -3.219913862489e-02 -3.529160574762e-02 +-3.836039164512e-02 -4.140537547759e-02 -4.442643840297e-02 -4.742346358305e-02 +-5.039633618947e-02 -5.334494340950e-02 -5.626917445168e-02 -5.916892055125e-02 +-6.204407497547e-02 -6.489453302871e-02 -6.772019205738e-02 -7.052095145470e-02 +-7.329671266530e-02 -7.604737918967e-02 -7.877285658831e-02 -8.147305248593e-02 +-8.414787657523e-02 -8.679724062070e-02 -8.942105846215e-02 -9.201924601808e-02 +-9.459172128888e-02 -9.713840435985e-02 -9.965921740409e-02 -1.021540846851e-01 +-1.046229325594e-01 -1.070656894788e-01 -1.094822859923e-01 -1.118726547488e-01 +-1.142367304979e-01 -1.165744500923e-01 -1.188857524890e-01 -1.211705787506e-01 +-1.234288720462e-01 -1.256605776527e-01 -1.278656429553e-01 -1.300440174480e-01 +-1.321956527344e-01 -1.343205025276e-01 -1.364185226502e-01 -1.384896710345e-01 +-1.405339077219e-01 -1.425511948627e-01 -1.445414967153e-01 -1.465047796453e-01 +-1.484410121248e-01 -1.503501647310e-01 -1.522322101451e-01 -1.540871231506e-01 +-1.559148806315e-01 -1.577154615709e-01 -1.594888470486e-01 -1.612350202393e-01 +-1.629539664097e-01 -1.646456729164e-01 -1.663101292031e-01 -1.679473267977e-01 +-1.695572593094e-01 -1.711399224253e-01 -1.726953139072e-01 -1.742234335878e-01 +-1.757242833674e-01 -1.771978672099e-01 -1.786441911383e-01 -1.800632632314e-01 +-1.814550936186e-01 -1.828196944759e-01 -1.841570800207e-01 -1.854672665076e-01 +-1.867502722230e-01 -1.880061174798e-01 -1.892348246122e-01 -1.904364179705e-01 +-1.916109239149e-01 -1.927583708101e-01 -1.938787890190e-01 -1.949722108968e-01 +-1.960386707848e-01 -1.970782050034e-01 -1.980908518463e-01 -1.990766515731e-01 +-2.000356464025e-01 -2.009678805055e-01 -2.018733999978e-01 -2.027522529330e-01 +-2.036044892942e-01 -2.044301609872e-01 -2.052293218322e-01 -2.060020275558e-01 +-2.067483357832e-01 -2.074683060295e-01 -2.081619996917e-01 -2.088294800398e-01 +-2.094708122085e-01 -2.100860631877e-01 -2.106753018143e-01 -2.112385987623e-01 +-2.117760265342e-01 -2.122876594511e-01 -2.127735736434e-01 -2.132338470410e-01 +-2.136685593635e-01 -2.140777921103e-01 -2.144616285503e-01 -2.148201537121e-01 +-2.151534543730e-01 -2.154616190492e-01 -2.157447379844e-01 -2.160029031399e-01 +-2.162362081830e-01 -2.164447484765e-01 -2.166286210670e-01 -2.167879246744e-01 +-2.169227596796e-01 -2.170332281139e-01 -2.171194336468e-01 -2.171814815742e-01 +-2.172194788069e-01 -2.172335338584e-01 -2.172237568329e-01 -2.171902594128e-01 +-2.171331548467e-01 -2.170525579367e-01 -2.169485850260e-01 -2.168213539861e-01 +-2.166709842043e-01 -2.164975965702e-01 -2.163013134635e-01 -2.160822587401e-01 +-2.158405577195e-01 -2.155763371712e-01 -2.152897253014e-01 -2.149808517391e-01 +-2.146498475232e-01 -2.142968450882e-01 -2.139219782505e-01 -2.135253821946e-01 +-2.131071934591e-01 -2.126675499226e-01 -2.122065907892e-01 -2.117244565748e-01 +-2.112212890922e-01 -2.106972314371e-01 -2.101524279729e-01 -2.095870243170e-01 +-2.090011673252e-01 -2.083950050775e-01 -2.077686868629e-01 -2.071223631645e-01 +-2.064561856448e-01 -2.057703071299e-01 -2.050648815952e-01 -2.043400641494e-01 +-2.035960110195e-01 -2.028328795354e-01 -2.020508281143e-01 -2.012500162453e-01 +-2.004306044739e-01 -1.995927543858e-01 -1.987366285918e-01 -1.978623907118e-01 +-1.969702053588e-01 -1.960602381230e-01 -1.951326555559e-01 -1.941876251546e-01 +-1.932253153449e-01 -1.922458954659e-01 -1.912495357537e-01 -1.902364073248e-01 +-1.892066821602e-01 -1.881605330886e-01 -1.870981337707e-01 -1.860196586822e-01 +-1.849252830975e-01 -1.838151830732e-01 -1.826895354317e-01 -1.815485177444e-01 +-1.803923083150e-01 -1.792210861632e-01 -1.780350310077e-01 -1.768343232495e-01 +-1.756191439552e-01 -1.743896748402e-01 -1.731460982522e-01 -1.718885971536e-01 +-1.706173551053e-01 -1.693325562496e-01 -1.680343852933e-01 -1.667230274906e-01 +-1.653986686265e-01 -1.640614949995e-01 -1.627116934048e-01 -1.613494511171e-01 +-1.599749558740e-01 -1.585883958584e-01 -1.571899596821e-01 -1.557798363681e-01 +-1.543582153342e-01 -1.529252863754e-01 -1.514812396472e-01 -1.500262656484e-01 +-1.485605552040e-01 -1.470842994484e-01 -1.455976898080e-01 -1.441009179842e-01 +-1.425941759366e-01 -1.410776558659e-01 -1.395515501966e-01 -1.380160515603e-01 +-1.364713527783e-01 -1.349176468453e-01 -1.333551269115e-01 -1.317839862665e-01 +-1.302044183217e-01 -1.286166165939e-01 -1.270207746877e-01 -1.254170862794e-01 +-1.238057450998e-01 -1.221869449169e-01 -1.205608795201e-01 -1.189277427023e-01 +-1.172877282441e-01 -1.156410298963e-01 -1.139878413639e-01 -1.123283562887e-01 +-1.106627682334e-01 -1.089912706645e-01 -1.073140569360e-01 -1.056313202728e-01 +-1.039432537543e-01 -1.022500502977e-01 -1.005519026420e-01 -9.884900333142e-02 +-9.714154469927e-02 -9.542971885147e-02 -9.371371765052e-02 -9.199373269930e-02 +-9.026995532499e-02 -8.854257656300e-02 -8.681178714101e-02 -8.507777746301e-02 +-8.334073759342e-02 -8.160085724131e-02 -7.985832574460e-02 -7.811333205436e-02 +-7.636606471922e-02 -7.461671186973e-02 -7.286546120293e-02 -7.111249996683e-02 +-6.935801494510e-02 -6.760219244173e-02 -6.584521826582e-02 -6.408727771638e-02 +-6.232855556727e-02 -6.056923605220e-02 -5.880950284972e-02 -5.704953906845e-02 +-5.528952723219e-02 -5.352964926532e-02 -5.177008647805e-02 -5.001101955200e-02 +-4.825262852562e-02 -4.649509277989e-02 -4.473859102399e-02 -4.298330128108e-02 +-4.122940087420e-02 -3.947706641221e-02 -3.772647377587e-02 -3.597779810396e-02 +-3.423121377953e-02 -3.248689441622e-02 -3.074501284469e-02 -2.900574109912e-02 +-2.726925040385e-02 -2.553571116007e-02 -2.380529293261e-02 -2.207816443691e-02 +-2.035449352594e-02 -1.863444717740e-02 -1.691819148084e-02 -1.520589162503e-02 +-1.349771188539e-02 -1.179381561144e-02 -1.009436521452e-02 -8.399522155443e-03 +-6.709446932398e-03 -5.024299068872e-03 -3.344237101723e-03 -1.669418569349e-03 +2.512273976170e-14 1.663863099950e-03 3.322016257243e-03 4.974306043361e-03 +6.620580085661e-03 + L N + 0 2 +1.000000000000e+00 9.999588771557e-01 9.998355147105e-01 9.996299309272e-01 +9.993421562398e-01 9.989722332485e-01 9.985202167122e-01 9.979861735385e-01 +9.973701827725e-01 9.966723355824e-01 9.958927352436e-01 9.950314971204e-01 +9.940887486459e-01 9.930646292992e-01 9.919592905814e-01 9.907728959881e-01 +9.895056209813e-01 9.881576529582e-01 9.867291912182e-01 9.852204469278e-01 +9.836316430835e-01 9.819630144724e-01 9.802148076310e-01 9.783872808018e-01 +9.764807038877e-01 9.744953584044e-01 9.724315374315e-01 9.702895455599e-01 +9.680696988392e-01 9.657723247216e-01 9.633977620041e-01 9.609463607696e-01 +9.584184823246e-01 9.558144991363e-01 9.531347947667e-01 9.503797638053e-01 +9.475498117999e-01 9.446453551853e-01 9.416668212101e-01 9.386146478614e-01 +9.354892837886e-01 9.322911882240e-01 9.290208309025e-01 9.256786919789e-01 +9.222652619442e-01 9.187810415390e-01 9.152265416659e-01 9.116022833003e-01 +9.079087973984e-01 9.041466248047e-01 9.003163161571e-01 8.964184317905e-01 +8.924535416387e-01 8.884222251345e-01 8.843250711084e-01 8.801626776859e-01 +8.759356521824e-01 8.716446109973e-01 8.672901795064e-01 8.628729919524e-01 +8.583936913341e-01 8.538529292946e-01 8.492513660070e-01 8.445896700594e-01 +8.398685183386e-01 8.350885959116e-01 8.302505959068e-01 8.253552193925e-01 +8.204031752555e-01 8.153951800773e-01 8.103319580098e-01 8.052142406486e-01 +8.000427669069e-01 7.948182828859e-01 7.895415417463e-01 7.842133035765e-01 +7.788343352617e-01 7.734054103500e-01 7.679273089188e-01 7.624008174394e-01 +7.568267286407e-01 7.512058413721e-01 7.455389604655e-01 7.398268965953e-01 +7.340704661390e-01 7.282704910361e-01 7.224277986455e-01 7.165432216036e-01 +7.106175976801e-01 7.046517696335e-01 6.986465850664e-01 6.926028962792e-01 +6.865215601232e-01 6.804034378539e-01 6.742493949824e-01 6.680603011268e-01 +6.618370298633e-01 6.555804585759e-01 6.492914683061e-01 6.429709436022e-01 +6.366197723676e-01 6.302388457091e-01 6.238290577843e-01 6.173913056491e-01 +6.109264891046e-01 6.044355105433e-01 5.979192747957e-01 5.913786889758e-01 +5.848146623272e-01 5.782281060679e-01 5.716199332362e-01 5.649910585350e-01 +5.583423981772e-01 5.516748697302e-01 5.449893919607e-01 5.382868846788e-01 +5.315682685834e-01 5.248344651060e-01 5.180863962557e-01 5.113249844634e-01 +5.045511524271e-01 4.977658229563e-01 4.909699188170e-01 4.841643625769e-01 +4.773500764507e-01 4.705279821459e-01 4.636990007081e-01 4.568640523675e-01 +4.500240563851e-01 4.431799308996e-01 4.363325927745e-01 4.294829574453e-01 +4.226319387680e-01 4.157804488669e-01 4.089293979839e-01 4.020796943278e-01 +3.952322439240e-01 3.883879504653e-01 3.815477151626e-01 3.747124365969e-01 +3.678830105718e-01 3.610603299659e-01 3.542452845871e-01 3.474387610269e-01 +3.406416425154e-01 3.338548087774e-01 3.270791358894e-01 3.203154961369e-01 +3.135647578731e-01 3.068277853780e-01 3.001054387190e-01 2.933985736121e-01 +2.867080412837e-01 2.800346883341e-01 2.733793566015e-01 2.667428830274e-01 +2.601260995227e-01 2.535298328350e-01 2.469549044171e-01 2.404021302968e-01 +2.338723209472e-01 2.273662811590e-01 2.208848099135e-01 2.144287002568e-01 +2.079987391756e-01 2.015957074739e-01 1.952203796510e-01 1.888735237814e-01 +1.825559013952e-01 1.762682673601e-01 1.700113697654e-01 1.637859498066e-01 +1.575927416715e-01 1.514324724284e-01 1.453058619151e-01 1.392136226292e-01 +1.331564596211e-01 1.271350703867e-01 1.211501447634e-01 1.152023648264e-01 +1.092924047871e-01 1.034209308930e-01 9.758860132928e-02 9.179606612181e-02 +8.604396704186e-02 8.033293751256e-02 7.466360251689e-02 6.903657850744e-02 +6.345247331783e-02 5.791188607580e-02 5.241540711809e-02 4.696361790703e-02 +4.155709094886e-02 3.619638971384e-02 3.088206855812e-02 2.561467264741e-02 +2.039473788245e-02 1.522279082631e-02 1.009934863345e-02 5.024918980689e-03 +7.389596982152e-15 -4.974919786837e-03 -9.899361531780e-03 -1.477285612207e-02 +-1.959494423999e-02 -2.436517642069e-02 -2.908311310811e-02 -3.374832470902e-02 +-3.836039164509e-02 -4.291890440306e-02 -4.742346358302e-02 -5.187367994466e-02 +-5.626917445165e-02 -6.060957831403e-02 -6.489453302868e-02 -6.912369041777e-02 +-7.329671266528e-02 -7.741327235156e-02 -8.147305248590e-02 -8.547574653711e-02 +-8.942105846213e-02 -9.330870273266e-02 -9.713840435983e-02 -1.009098989168e-01 +-1.046229325594e-01 -1.082772620449e-01 -1.118726547487e-01 -1.154088886789e-01 +-1.188857524890e-01 -1.223030454888e-01 -1.256605776527e-01 -1.289581696271e-01 +-1.321956527344e-01 -1.353728689764e-01 -1.384896710345e-01 -1.415459222689e-01 +-1.445414967152e-01 -1.474762790796e-01 -1.503501647310e-01 -1.531630596929e-01 +-1.559148806314e-01 -1.586055548431e-01 -1.612350202393e-01 -1.638032253296e-01 +-1.663101292030e-01 -1.687557015072e-01 -1.711399224253e-01 -1.734627826523e-01 +-1.757242833674e-01 -1.779244362065e-01 -1.800632632314e-01 -1.821407968977e-01 +-1.841570800207e-01 -1.861121657396e-01 -1.880061174797e-01 -1.898390089126e-01 +-1.916109239149e-01 -1.933219565247e-01 -1.949722108968e-01 -1.965618012556e-01 +-1.980908518463e-01 -1.995594968849e-01 -2.009678805055e-01 -2.023161567062e-01 +-2.036044892942e-01 -2.048330518274e-01 -2.060020275558e-01 -2.071116093607e-01 +-2.081619996917e-01 -2.091534105031e-01 -2.100860631877e-01 -2.109601885094e-01 +-2.117760265342e-01 -2.125338265592e-01 -2.132338470410e-01 -2.138763555209e-01 +-2.144616285503e-01 -2.149899516135e-01 -2.154616190492e-01 -2.158769339703e-01 +-2.162362081830e-01 -2.165397621037e-01 -2.167879246744e-01 -2.169810332771e-01 +-2.171194336468e-01 -2.172034797827e-01 -2.172335338584e-01 -2.172099661307e-01 +-2.171331548467e-01 -2.170034861501e-01 -2.168213539861e-01 -2.165871600048e-01 +-2.163013134635e-01 -2.159642311277e-01 -2.155763371712e-01 -2.151380630747e-01 +-2.146498475232e-01 -2.141121363026e-01 -2.135253821946e-01 -2.128900448716e-01 +-2.122065907892e-01 -2.114754930785e-01 -2.106972314371e-01 -2.098722920193e-01 +-2.090011673253e-01 -2.080843560887e-01 -2.071223631645e-01 -2.061156994150e-01 +-2.050648815952e-01 -2.039704322376e-01 -2.028328795354e-01 -2.016527572263e-01 +-2.004306044739e-01 -1.991669657493e-01 -1.978623907118e-01 -1.965174340891e-01 +-1.951326555559e-01 -1.937086196133e-01 -1.922458954659e-01 -1.907450569001e-01 +-1.892066821602e-01 -1.876313538246e-01 -1.860196586822e-01 -1.843721876067e-01 +-1.826895354318e-01 -1.809723008254e-01 -1.792210861633e-01 -1.774364974027e-01 +-1.756191439552e-01 -1.737696385594e-01 -1.718885971536e-01 -1.699766387472e-01 +-1.680343852933e-01 -1.660624615594e-01 -1.640614949995e-01 -1.620321156246e-01 +-1.599749558740e-01 -1.578906504859e-01 -1.557798363681e-01 -1.536431524689e-01 +-1.514812396472e-01 -1.492947405431e-01 -1.470842994485e-01 -1.448505621774e-01 +-1.425941759367e-01 -1.403157891963e-01 -1.380160515603e-01 -1.356956136373e-01 +-1.333551269115e-01 -1.309952436141e-01 -1.286166165939e-01 -1.262198991893e-01 +-1.238057450998e-01 -1.213748082581e-01 -1.189277427024e-01 -1.164652024486e-01 +-1.139878413639e-01 -1.114963130395e-01 -1.089912706645e-01 -1.064733669002e-01 +-1.039432537543e-01 -1.014015824560e-01 -9.884900333145e-02 -9.628616568006e-02 +-9.371371765055e-02 -9.113230611832e-02 -8.854257656303e-02 -8.594517294687e-02 +-8.334073759345e-02 -8.072991106737e-02 -7.811333205439e-02 -7.549163724239e-02 +-7.286546120296e-02 -7.023543627378e-02 -6.760219244177e-02 -6.496635722697e-02 +-6.232855556730e-02 -5.968940970410e-02 -5.704953906848e-02 -5.440956016866e-02 +-5.177008647808e-02 -4.913172832449e-02 -4.649509277992e-02 -4.386078355168e-02 +-4.122940087423e-02 -3.860154140214e-02 -3.597779810400e-02 -3.335876015735e-02 +-3.074501284472e-02 -2.813713745071e-02 -2.553571116010e-02 -2.294130695715e-02 +-2.035449352598e-02 -1.777583515209e-02 -1.520589162507e-02 -1.264521814239e-02 +-1.009436521455e-02 -7.553878571246e-03 -5.024299068905e-03 -2.506162599395e-03 +-7.389596982152e-15 2.493663035294e-03 4.974306043329e-03 7.441413877863e-03 +9.894476794447e-03 1.233299053393e-02 1.475645640461e-02 1.716438136306e-02 +1.955627809357e-02 2.193166508616e-02 2.429006671325e-02 2.663101330492e-02 +2.895404122269e-02 3.125869293193e-02 3.354451707279e-02 3.581106852968e-02 +3.805790849927e-02 4.028460455704e-02 4.249073072231e-02 4.467586752178e-02 +4.683960205159e-02 4.898152803781e-02 5.110124589545e-02 5.319836278591e-02 +5.527249267288e-02 5.732325637672e-02 5.935028162727e-02 6.135320311502e-02 +6.333166254088e-02 6.528530866416e-02 6.721379734912e-02 6.911679160987e-02 +7.099396165367e-02 7.284498492262e-02 7.466954613379e-02 7.646733731766e-02 +7.823805785504e-02 7.998141451225e-02 8.169712147484e-02 8.338490037948e-02 +8.504448034442e-02 8.667559799815e-02 8.827799750657e-02 8.985143059840e-02 +9.139565658906e-02 9.291044240281e-02 9.439556259334e-02 9.585079936266e-02 +9.727594257839e-02 9.867078978937e-02 1.000351462397e-01 1.013688248810e-01 +1.026716463832e-01 1.039434391438e-01 1.051840392948e-01 1.063932907093e-01 +1.075710450048e-01 1.087171615467e-01 1.098315074484e-01 1.109139575712e-01 +1.119643945218e-01 1.129827086485e-01 1.139687980356e-01 1.149225684962e-01 +1.158439335639e-01 1.167328144823e-01 1.175891401928e-01 1.184128473218e-01 +1.192038801653e-01 1.199621906724e-01 1.206877384270e-01 1.213804906286e-01 +1.220404220705e-01 1.226675151177e-01 1.232617596819e-01 1.238231531963e-01 +1.243517005880e-01 1.248474142494e-01 1.253103140077e-01 1.257404270933e-01 +1.261377881068e-01 1.265024389837e-01 1.268344289589e-01 1.271338145288e-01 +1.274006594126e-01 1.276350345115e-01 1.278370178673e-01 1.280066946191e-01 +1.281441569587e-01 1.282495040846e-01 1.283228421551e-01 1.283642842391e-01 +1.283739502669e-01 1.283519669785e-01 1.282984678711e-01 1.282135931456e-01 +1.280974896510e-01 1.279503108287e-01 1.277722166546e-01 1.275633735804e-01 +1.273239544735e-01 1.270541385561e-01 1.267541113426e-01 1.264240645763e-01 +1.260641961644e-01 1.256747101130e-01 1.252558164592e-01 1.248077312040e-01 +1.243306762428e-01 1.238248792955e-01 1.232905738353e-01 1.227279990164e-01 +1.221373996013e-01 1.215190258860e-01 1.208731336255e-01 1.201999839574e-01 +1.194998433250e-01 1.187729833992e-01 1.180196810003e-01 1.172402180176e-01 +1.164348813293e-01 1.156039627211e-01 1.147477588040e-01 1.138665709311e-01 +1.129607051143e-01 1.120304719395e-01 1.110761864814e-01 1.100981682176e-01 +1.090967409418e-01 1.080722326769e-01 1.070249755862e-01 1.059553058858e-01 +1.048635637545e-01 1.037500932445e-01 1.026152421907e-01 1.014593621201e-01 +1.002828081598e-01 9.908593894552e-02 9.786911652869e-02 9.663270628381e-02 +9.537707681491e-02 9.410259986172e-02 9.280965020549e-02 9.149860557431e-02 +9.016984654819e-02 8.882375646372e-02 8.746072131842e-02 8.608112967483e-02 +8.468537256426e-02 8.327384339038e-02 8.184693783247e-02 8.040505374852e-02 +7.894859107812e-02 7.747795174524e-02 7.599353956071e-02 7.449576012479e-02 +7.298502072940e-02 7.146173026050e-02 6.992629910019e-02 6.837913902896e-02 +6.682066312777e-02 6.525128568021e-02 6.367142207471e-02 6.208148870668e-02 +6.048190288085e-02 5.887308271361e-02 5.725544703546e-02 5.562941529365e-02 +5.399540745492e-02 5.235384390837e-02 5.070514536864e-02 4.904973277921e-02 +4.738802721591e-02 4.572044979079e-02 4.404742155614e-02 4.236936340890e-02 +4.068669599533e-02 3.899983961602e-02 3.730921413129e-02 3.561523886688e-02 +3.391833252013e-02 3.221891306649e-02 3.051739766655e-02 2.881420257340e-02 +2.710974304059e-02 2.540443323047e-02 2.369868612311e-02 2.199291342571e-02 +2.028752548258e-02 1.858293118562e-02 1.687953788549e-02 1.517775130329e-02 +1.347797544288e-02 1.178061250383e-02 1.008606279508e-02 8.394724649155e-03 +6.706994337188e-03 5.023265984567e-03 3.343931487334e-03 1.669380429316e-03 +7.389596982152e-15 -1.663825086774e-03 -3.321712673450e-03 -4.973283238437e-03 +-6.618159975091e-03 + L N + 0 3 +1.000000000000e+00 9.999268934227e-01 9.997075929310e-01 9.993421562398e-01 +9.988306795205e-01 9.981732973708e-01 9.973701827725e-01 9.964215470375e-01 +9.953276397415e-01 9.940887486459e-01 9.927051996072e-01 9.911773564758e-01 +9.895056209813e-01 9.876904326070e-01 9.857322684524e-01 9.836316430835e-01 +9.813891083719e-01 9.790052533223e-01 9.764807038877e-01 9.738161227738e-01 +9.710122092318e-01 9.680696988392e-01 9.649893632704e-01 9.617720100548e-01 +9.584184823246e-01 9.549296585514e-01 9.513064522713e-01 9.475498117999e-01 +9.436607199360e-01 9.396401936544e-01 9.354892837886e-01 9.312090747032e-01 +9.268006839549e-01 9.222652619442e-01 9.176039915569e-01 9.128180877951e-01 +9.079087973983e-01 9.028773984559e-01 8.977252000079e-01 8.924535416387e-01 +8.870637930592e-01 8.815573536812e-01 8.759356521824e-01 8.702001460618e-01 +8.643523211873e-01 8.583936913341e-01 8.523257977150e-01 8.461502085016e-01 +8.398685183386e-01 8.334823478491e-01 8.269933431327e-01 8.204031752555e-01 +8.137135397329e-01 8.069261560055e-01 8.000427669069e-01 7.930651381253e-01 +7.859950576585e-01 7.788343352617e-01 7.715848018895e-01 7.642483091312e-01 +7.568267286407e-01 7.493219515597e-01 7.417358879367e-01 7.340704661390e-01 +7.263276322605e-01 7.185093495243e-01 7.106175976801e-01 7.026543723976e-01 +6.946216846549e-01 6.865215601232e-01 6.783560385471e-01 6.701271731211e-01 +6.618370298633e-01 6.534876869844e-01 6.450812342547e-01 6.366197723676e-01 +6.281054123006e-01 6.195402746735e-01 6.109264891046e-01 6.022661935646e-01 +5.935615337287e-01 5.848146623272e-01 5.760277384943e-01 5.672029271161e-01 +5.583423981772e-01 5.494483261068e-01 5.405228891241e-01 5.315682685834e-01 +5.225866483191e-01 5.135802139904e-01 5.045511524271e-01 4.955016509752e-01 +4.864338968434e-01 4.773500764507e-01 4.682523747753e-01 4.591429747041e-01 +4.500240563851e-01 4.408977965803e-01 4.317663680216e-01 4.226319387680e-01 +4.134966715663e-01 4.043627232139e-01 3.952322439240e-01 3.861073766949e-01 +3.769902566816e-01 3.678830105718e-01 3.587877559645e-01 3.497066007538e-01 +3.406416425154e-01 3.315949678984e-01 3.225686520215e-01 3.135647578731e-01 +3.045853357170e-01 2.956324225032e-01 2.867080412837e-01 2.778142006333e-01 +2.689528940770e-01 2.601260995227e-01 2.513357786996e-01 2.425838766033e-01 +2.338723209472e-01 2.252030216196e-01 2.165778701492e-01 2.079987391756e-01 +1.994674819278e-01 1.909859317103e-01 1.825559013952e-01 1.741791829233e-01 +1.658575468121e-01 1.575927416715e-01 1.493864937280e-01 1.412405063565e-01 +1.331564596210e-01 1.251360098231e-01 1.171807890593e-01 1.092924047870e-01 +1.014724393995e-01 9.372244980942e-02 8.604396704184e-02 7.843849583621e-02 +7.090751425765e-02 6.345247331781e-02 5.607479660515e-02 4.877587992491e-02 +4.155709094885e-02 3.441976887485e-02 2.736522409644e-02 2.039473788244e-02 +1.350956206663e-02 6.710918747795e-03 -8.583855418087e-15 -6.622032406781e-03 +-1.315404727542e-02 -1.959494424001e-02 -2.594365401353e-02 -3.219913862487e-02 +-3.836039164510e-02 -4.442643840296e-02 -5.039633618945e-02 -5.626917445166e-02 +-6.204407497546e-02 -6.772019205736e-02 -7.329671266529e-02 -7.877285658830e-02 +-8.414787657521e-02 -8.942105846214e-02 -9.459172128887e-02 -9.965921740407e-02 +-1.046229325594e-01 -1.094822859923e-01 -1.142367304979e-01 -1.188857524890e-01 +-1.234288720462e-01 -1.278656429553e-01 -1.321956527344e-01 -1.364185226502e-01 +-1.405339077219e-01 -1.445414967153e-01 -1.484410121248e-01 -1.522322101451e-01 +-1.559148806314e-01 -1.594888470486e-01 -1.629539664097e-01 -1.663101292031e-01 +-1.695572593094e-01 -1.726953139072e-01 -1.757242833674e-01 -1.786441911383e-01 +-1.814550936186e-01 -1.841570800207e-01 -1.867502722230e-01 -1.892348246122e-01 +-1.916109239149e-01 -1.938787890189e-01 -1.960386707847e-01 -1.980908518463e-01 +-2.000356464025e-01 -2.018733999978e-01 -2.036044892942e-01 -2.052293218322e-01 +-2.067483357832e-01 -2.081619996917e-01 -2.094708122085e-01 -2.106753018143e-01 +-2.117760265342e-01 -2.127735736434e-01 -2.136685593635e-01 -2.144616285503e-01 +-2.151534543730e-01 -2.157447379844e-01 -2.162362081830e-01 -2.166286210670e-01 +-2.169227596796e-01 -2.171194336468e-01 -2.172194788069e-01 -2.172237568329e-01 +-2.171331548467e-01 -2.169485850260e-01 -2.166709842043e-01 -2.163013134635e-01 +-2.158405577195e-01 -2.152897253014e-01 -2.146498475232e-01 -2.139219782505e-01 +-2.131071934591e-01 -2.122065907892e-01 -2.112212890922e-01 -2.101524279729e-01 +-2.090011673253e-01 -2.077686868629e-01 -2.064561856448e-01 -2.050648815952e-01 +-2.035960110195e-01 -2.020508281143e-01 -2.004306044739e-01 -1.987366285918e-01 +-1.969702053588e-01 -1.951326555559e-01 -1.932253153449e-01 -1.912495357537e-01 +-1.892066821602e-01 -1.870981337707e-01 -1.849252830975e-01 -1.826895354318e-01 +-1.803923083151e-01 -1.780350310077e-01 -1.756191439552e-01 -1.731460982522e-01 +-1.706173551053e-01 -1.680343852933e-01 -1.653986686265e-01 -1.627116934048e-01 +-1.599749558740e-01 -1.571899596821e-01 -1.543582153342e-01 -1.514812396472e-01 +-1.485605552041e-01 -1.455976898080e-01 -1.425941759367e-01 -1.395515501966e-01 +-1.364713527783e-01 -1.333551269115e-01 -1.302044183218e-01 -1.270207746877e-01 +-1.238057450998e-01 -1.205608795201e-01 -1.172877282441e-01 -1.139878413639e-01 +-1.106627682334e-01 -1.073140569360e-01 -1.039432537543e-01 -1.005519026420e-01 +-9.714154469929e-02 -9.371371765054e-02 -9.026995532500e-02 -8.681178714103e-02 +-8.334073759344e-02 -7.985832574462e-02 -7.636606471923e-02 -7.286546120294e-02 +-6.935801494512e-02 -6.584521826584e-02 -6.232855556729e-02 -5.880950284974e-02 +-5.528952723221e-02 -5.177008647807e-02 -4.825262852563e-02 -4.473859102400e-02 +-4.122940087421e-02 -3.772647377589e-02 -3.423121377955e-02 -3.074501284471e-02 +-2.726925040387e-02 -2.380529293263e-02 -2.035449352596e-02 -1.691819148085e-02 +-1.349771188540e-02 -1.009436521454e-02 -6.709446932414e-03 -3.344237101739e-03 +8.583855418087e-15 3.322016257227e-03 6.620580085644e-03 9.894476794462e-03 +1.314250894107e-02 1.636349667822e-02 1.955627809359e-02 2.271970954158e-02 +2.585266596732e-02 2.895404122270e-02 3.202274837443e-02 3.505772000398e-02 +3.805790849929e-02 4.102228633832e-02 4.394984636413e-02 4.683960205160e-02 +4.969058776567e-02 5.250185901098e-02 5.527249267289e-02 5.800158724986e-02 +6.068826307699e-02 6.333166254089e-02 6.593095028556e-02 6.848531340948e-02 +7.099396165368e-02 7.345612758088e-02 7.587106674557e-02 7.823805785505e-02 +8.055640292137e-02 8.282542740419e-02 8.504448034443e-02 8.721293448883e-02 +8.933018640529e-02 9.139565658907e-02 9.340878955969e-02 9.536905394874e-02 +9.727594257840e-02 9.912897253077e-02 1.009276852080e-01 1.026716463832e-01 +1.043604462423e-01 1.059936994162e-01 1.075710450049e-01 1.090921465908e-01 +1.105566922449e-01 1.119643945218e-01 1.133149904477e-01 1.146082414973e-01 +1.158439335639e-01 1.170218769186e-01 1.181419061618e-01 1.192038801653e-01 +1.202076820060e-01 1.211532188904e-01 1.220404220705e-01 1.228692467518e-01 +1.236396719912e-01 1.243517005880e-01 1.250053589653e-01 1.256006970439e-01 +1.261377881068e-01 1.266167286569e-01 1.270376382654e-01 1.274006594126e-01 +1.277059573205e-01 1.279537197783e-01 1.281441569587e-01 1.282775012279e-01 +1.283540069471e-01 1.283739502669e-01 1.283376289143e-01 1.282453619720e-01 +1.280974896510e-01 1.278943730559e-01 1.276363939434e-01 1.273239544735e-01 +1.269574769544e-01 1.265374035805e-01 1.260641961644e-01 1.255383358617e-01 +1.249603228902e-01 1.243306762428e-01 1.236499333941e-01 1.229186500017e-01 +1.221373996013e-01 1.213067732963e-01 1.204273794422e-01 1.194998433250e-01 +1.185248068352e-01 1.175029281366e-01 1.164348813293e-01 1.153213561093e-01 +1.141630574224e-01 1.129607051143e-01 1.117150335758e-01 1.104267913845e-01 +1.090967409418e-01 1.077256581065e-01 1.063143318244e-01 1.048635637545e-01 +1.033741678916e-01 1.018469701860e-01 1.002828081598e-01 9.868253052003e-02 +9.704699676952e-02 9.537707681490e-02 9.367365057201e-02 9.193760756917e-02 +9.016984654818e-02 8.837127506339e-02 8.654280907894e-02 8.468537256425e-02 +8.279989708810e-02 8.088732141129e-02 7.894859107811e-02 7.698465800680e-02 +7.499648007916e-02 7.298502072939e-02 7.095124853242e-02 6.889613679188e-02 +6.682066312775e-02 6.472580906407e-02 6.261255961660e-02 6.048190288084e-02 +5.833482962040e-02 5.617233285596e-02 5.399540745490e-02 5.180504972191e-02 +4.960225699053e-02 4.738802721590e-02 4.516335856891e-02 4.292924903178e-02 +4.068669599531e-02 3.843669585791e-02 3.618024362661e-02 3.391833252011e-02 +3.165195357415e-02 2.938209524917e-02 2.710974304058e-02 2.483587909164e-02 +2.256148180925e-02 2.028752548256e-02 1.801497990482e-02 1.574480999833e-02 +1.347797544286e-02 1.121543030753e-02 8.958122686274e-03 6.706994337172e-03 +4.462980325576e-03 2.227008671311e-03 -8.630974746701e-15 -2.217132801389e-03 +-4.423484924482e-03 -6.618159975107e-03 -8.800270304154e-03 -1.096893733375e-02 +-1.312329187859e-02 -1.526247446229e-02 -1.738563562868e-02 -1.949193624797e-02 +-2.158054781756e-02 -2.365065275757e-02 -2.570144470082e-02 -2.773212877731e-02 +-2.974192189297e-02 -3.173005300270e-02 -3.369576337758e-02 -3.563830686613e-02 +-3.755695014953e-02 -3.945097299084e-02 -4.131966847795e-02 -4.316234326036e-02 +-4.497831777956e-02 -4.676692649316e-02 -4.852751809239e-02 -5.025945571324e-02 +-5.196211714088e-02 -5.363489500755e-02 -5.527719698371e-02 -5.688844596238e-02 +-5.846808023680e-02 -6.001555367111e-02 -6.153033586423e-02 -6.301191230675e-02 +-6.445978453086e-02 -6.587347025326e-02 -6.725250351099e-02 -6.859643479029e-02 +-6.990483114816e-02 -7.117727632702e-02 -7.241337086198e-02 -7.361273218113e-02 +-7.477499469850e-02 -7.589980989991e-02 -7.698684642154e-02 -7.803579012129e-02 +-7.904634414293e-02 -8.001822897299e-02 -8.095118249047e-02 -8.184496000923e-02 +-8.269933431327e-02 -8.351409568469e-02 -8.428905192453e-02 -8.502402836639e-02 +-8.571886788288e-02 -8.637343088493e-02 -8.698759531398e-02 -8.756125662706e-02 +-8.809432777479e-02 -8.858673917239e-02 -8.903843866361e-02 -8.944939147778e-02 +-8.981958017984e-02 -9.014900461357e-02 -9.043768183789e-02 -9.068564605646e-02 +-9.089294854048e-02 -9.105965754475e-02 -9.118585821725e-02 -9.127165250193e-02 +-9.131715903518e-02 -9.132251303570e-02 -9.128786618804e-02 -9.121338651981e-02 +-9.109925827260e-02 -9.094568176680e-02 -9.075287326016e-02 -9.052106480049e-02 +-9.025050407227e-02 -8.994145423743e-02 -8.959419377037e-02 -8.920901628720e-02 +-8.878623036942e-02 -8.832615938206e-02 -8.782914128630e-02 -8.729552844687e-02 +-8.672568743409e-02 -8.611999882078e-02 -8.547885697412e-02 -8.480266984256e-02 +-8.409185873785e-02 -8.334685811228e-02 -8.256811533135e-02 -8.175609044183e-02 +-8.091125593543e-02 -8.003409650805e-02 -7.912510881496e-02 -7.818480122174e-02 +-7.721369355130e-02 -7.621231682701e-02 -7.518121301206e-02 -7.412093474520e-02 +-7.303204507291e-02 -7.191511717825e-02 -7.077073410629e-02 -6.959948848655e-02 +-6.840198225222e-02 -6.717882635665e-02 -6.593064048684e-02 -6.465805277447e-02 +-6.336169950422e-02 -6.204222481980e-02 -6.070028042758e-02 -5.933652529816e-02 +-5.795162536585e-02 -5.654625322624e-02 -5.512108783203e-02 -5.367681418722e-02 +-5.221412303970e-02 -5.073371057258e-02 -4.923627809413e-02 -4.772253172675e-02 +-4.619318209476e-02 -4.464894401151e-02 -4.309053616559e-02 -4.151868080657e-02 +-3.993410343018e-02 -3.833753246318e-02 -3.672969894800e-02 -3.511133622732e-02 +-3.348317962867e-02 -3.184596614922e-02 -3.020043414085e-02 -2.854732299567e-02 +-2.688737283210e-02 -2.522132418162e-02 -2.354991767633e-02 -2.187389373746e-02 +-2.019399226492e-02 -1.851095232806e-02 -1.682551185774e-02 -1.513840733978e-02 +-1.345037351001e-02 -1.176214305102e-02 -1.007444629062e-02 -8.388010902267e-03 +-6.703561607512e-03 -5.021819880594e-03 -3.343503655279e-03 -1.669327034086e-03 +8.583855418087e-15 1.663771869264e-03 3.321287684165e-03 4.971851523590e-03 +6.614772712065e-03 + L N + 0 4 +1.000000000000e+00 9.998857723822e-01 9.995431365007e-01 9.989722332485e-01 +9.981732973708e-01 9.971466573496e-01 9.958927352436e-01 9.944120464808e-01 +9.927051996072e-01 9.907728959881e-01 9.886159294654e-01 9.862351859690e-01 +9.836316430835e-01 9.808063695699e-01 9.777605248430e-01 9.744953584044e-01 +9.710122092318e-01 9.673125051241e-01 9.633977620041e-01 9.592695831779e-01 +9.549296585514e-01 9.503797638053e-01 9.456217595285e-01 9.406575903096e-01 +9.354892837886e-01 9.301189496681e-01 9.245487786841e-01 9.187810415390e-01 +9.128180877951e-01 9.066623447304e-01 9.003163161571e-01 8.937825812035e-01 +8.870637930592e-01 8.801626776859e-01 8.730820324926e-01 8.658247249770e-01 +8.583936913341e-01 8.507919350314e-01 8.430225253529e-01 8.350885959116e-01 +8.269933431327e-01 8.187400247058e-01 8.103319580098e-01 8.017725185095e-01 +7.930651381253e-01 7.842133035765e-01 7.752205547002e-01 7.660904827447e-01 +7.568267286407e-01 7.474329812490e-01 7.379129755873e-01 7.282704910361e-01 +7.185093495243e-01 7.086334136974e-01 6.986465850664e-01 6.885528021412e-01 +6.783560385471e-01 6.680603011268e-01 6.576696280293e-01 6.471880867846e-01 +6.366197723676e-01 6.259688052507e-01 6.152393294468e-01 6.044355105433e-01 +5.935615337287e-01 5.826216018118e-01 5.716199332362e-01 5.605607600890e-01 +5.494483261068e-01 5.382868846788e-01 5.270806968481e-01 5.158340293127e-01 +5.045511524271e-01 4.932363382055e-01 4.818938583272e-01 4.705279821459e-01 +4.591429747041e-01 4.477430947521e-01 4.363325927745e-01 4.249157090245e-01 +4.134966715664e-01 4.020796943278e-01 3.906689751635e-01 3.792686939297e-01 +3.678830105718e-01 3.565160632258e-01 3.451719663343e-01 3.338548087774e-01 +3.225686520215e-01 3.113175282844e-01 3.001054387190e-01 2.889363516174e-01 +2.778142006333e-01 2.667428830274e-01 2.557262579339e-01 2.447681446495e-01 +2.338723209472e-01 2.230425214136e-01 2.122824358125e-01 2.015957074739e-01 +1.909859317103e-01 1.804566542612e-01 1.700113697654e-01 1.596535202632e-01 +1.493864937280e-01 1.392136226292e-01 1.291381825264e-01 1.191633906954e-01 +1.092924047871e-01 9.952832151981e-02 8.987417540595e-02 8.033293751256e-02 +7.090751425767e-02 6.160074624218e-02 5.241540711809e-02 4.335420249347e-02 +3.441976887486e-02 2.561467264741e-02 1.694140909324e-02 8.402401448597e-03 +7.672312953838e-15 -8.263518780010e-03 -1.638595305738e-02 -2.436517642069e-02 +-3.219913862486e-02 -3.988586629398e-02 -4.742346358302e-02 -5.481011279815e-02 +-6.204407497544e-02 -6.912369041777e-02 -7.604737918964e-02 -8.281364156991e-02 +-8.942105846213e-02 -9.586829176246e-02 -1.021540846851e-01 -1.082772620449e-01 +-1.142367304978e-01 -1.200314787380e-01 -1.256605776527e-01 -1.311231804344e-01 +-1.364185226502e-01 -1.415459222689e-01 -1.465047796452e-01 -1.512945774624e-01 +-1.559148806314e-01 -1.603653361497e-01 -1.646456729163e-01 -1.687557015072e-01 +-1.726953139072e-01 -1.764644832025e-01 -1.800632632314e-01 -1.834917881941e-01 +-1.867502722230e-01 -1.898390089126e-01 -1.927583708100e-01 -1.955088088658e-01 +-1.980908518463e-01 -2.005051057080e-01 -2.027522529330e-01 -2.048330518274e-01 +-2.067483357832e-01 -2.084990125027e-01 -2.100860631877e-01 -2.115105416927e-01 +-2.127735736434e-01 -2.138763555209e-01 -2.148201537121e-01 -2.156063035269e-01 +-2.162362081830e-01 -2.167113377586e-01 -2.170332281139e-01 -2.172034797827e-01 +-2.172237568329e-01 -2.170957856992e-01 -2.168213539861e-01 -2.164023092444e-01 +-2.158405577195e-01 -2.151380630747e-01 -2.142968450882e-01 -2.133189783257e-01 +-2.122065907892e-01 -2.109618625430e-01 -2.095870243170e-01 -2.080843560887e-01 +-2.064561856448e-01 -2.047048871231e-01 -2.028328795354e-01 -2.008426252725e-01 +-1.987366285918e-01 -1.965174340891e-01 -1.941876251546e-01 -1.917498224147e-01 +-1.892066821602e-01 -1.865608947617e-01 -1.838151830732e-01 -1.809723008254e-01 +-1.780350310077e-01 -1.750061842432e-01 -1.718885971536e-01 -1.686851307183e-01 +-1.653986686265e-01 -1.620321156246e-01 -1.585883958585e-01 -1.550704512126e-01 +-1.514812396472e-01 -1.478237335327e-01 -1.441009179842e-01 -1.403157891963e-01 +-1.364713527783e-01 -1.325706220924e-01 -1.286166165939e-01 -1.246123601762e-01 +-1.205608795201e-01 -1.164652024486e-01 -1.123283562887e-01 -1.081533662405e-01 +-1.039432537543e-01 -9.970103491761e-02 -9.542971885150e-02 -9.113230611832e-02 +-8.681178714104e-02 -8.247114063521e-02 -7.811333205440e-02 -7.374131204982e-02 +-6.935801494513e-02 -6.496635722697e-02 -6.056923605223e-02 -5.616952777273e-02 +-5.177008647808e-02 -4.737374255747e-02 -4.298330128111e-02 -3.860154140214e-02 +-3.423121377957e-02 -2.987504002304e-02 -2.553571116010e-02 -2.121588632660e-02 +-1.691819148087e-02 -1.264521814239e-02 -8.399522155476e-03 -4.183622478594e-03 +-7.672312953838e-15 4.148903619835e-03 8.260687078510e-03 1.233299053393e-02 +1.636349667820e-02 2.034993178264e-02 2.429006671325e-02 2.818171791645e-02 +3.202274837442e-02 3.581106852968e-02 3.954463717861e-02 4.322146233329e-02 +4.683960205159e-02 5.039716523481e-02 5.389231239291e-02 5.732325637672e-02 +6.068826307698e-02 6.398565208991e-02 6.721379734912e-02 7.037112772347e-02 +7.345612758087e-02 7.646733731766e-02 7.940335385353e-02 8.226283109171e-02 +8.504448034442e-02 8.774707072340e-02 9.036942949543e-02 9.291044240281e-02 +9.536905394873e-02 9.774426764751e-02 1.000351462397e-01 1.022408118720e-01 +1.043604462423e-01 1.063932907093e-01 1.083386463677e-01 1.101958740880e-01 +1.119643945218e-01 1.136436880728e-01 1.152332948324e-01 1.167328144823e-01 +1.181419061618e-01 1.194602883023e-01 1.206877384270e-01 1.218240929184e-01 +1.228692467518e-01 1.238231531963e-01 1.246858234832e-01 1.254573264425e-01 +1.261377881068e-01 1.267273912844e-01 1.272263751013e-01 1.276350345115e-01 +1.279537197783e-01 1.281828359248e-01 1.283228421551e-01 1.283742512467e-01 +1.283376289143e-01 1.282135931456e-01 1.280028135091e-01 1.277060104358e-01 +1.273239544735e-01 1.268574655159e-01 1.263074120056e-01 1.256747101130e-01 +1.249603228903e-01 1.241652594025e-01 1.232905738353e-01 1.223373645797e-01 +1.213067732963e-01 1.201999839574e-01 1.190182218689e-01 1.177627526727e-01 +1.164348813293e-01 1.150359510831e-01 1.135673424083e-01 1.120304719395e-01 +1.104267913845e-01 1.087577864224e-01 1.070249755862e-01 1.052299091315e-01 +1.033741678916e-01 1.014593621201e-01 9.948713032115e-02 9.745913806862e-02 +9.537707681491e-02 9.324266268984e-02 9.105763529064e-02 8.882375646372e-02 +8.654280907895e-02 8.421659579729e-02 8.184693783247e-02 7.943567370750e-02 +7.698465800682e-02 7.449576012479e-02 7.197086301134e-02 6.941186191553e-02 +6.682066312777e-02 6.419918272143e-02 6.154934529476e-02 5.887308271361e-02 +5.617233285597e-02 5.344903835889e-02 5.070514536864e-02 4.794260229479e-02 +4.516335856893e-02 4.236936340890e-02 3.956256458903e-02 3.674490721732e-02 +3.391833252013e-02 3.108477663513e-02 2.824616941330e-02 2.540443323047e-02 +2.256148180926e-02 1.971921905204e-02 1.687953788549e-02 1.404431911761e-02 +1.121543030754e-02 8.394724649155e-03 5.584039868727e-03 2.785197137562e-03 +7.578074296609e-15 -2.769766682491e-03 -5.522337770715e-03 -8.255968869815e-03 +-1.096893733374e-02 -1.365954325136e-02 -1.632611041382e-02 -1.896698726257e-02 +-2.158054781754e-02 -2.416519258507e-02 -2.671934944500e-02 -2.924147451659e-02 +-3.173005300269e-02 -3.418360001181e-02 -3.660066135775e-02 -3.897981433617e-02 +-4.131966847794e-02 -4.361886627880e-02 -4.587608390495e-02 -4.809003187435e-02 +-5.025945571322e-02 -5.238313658769e-02 -5.445989191001e-02 -5.648857591937e-02 +-5.846808023678e-02 -6.039733439402e-02 -6.227530633623e-02 -6.410100289806e-02 +-6.587347025325e-02 -6.759179433722e-02 -6.925510124285e-02 -7.086255758902e-02 +-7.241337086197e-02 -7.390678972935e-02 -7.534210432677e-02 -7.671864651695e-02 +-7.803579012128e-02 -7.929295112383e-02 -8.048958784776e-02 -8.162520110414e-02 +-8.269933431327e-02 -8.371157359834e-02 -8.466154785176e-02 -8.554892877396e-02 +-8.637343088493e-02 -8.713481150850e-02 -8.783287072958e-02 -8.846745132432e-02 +-8.903843866361e-02 -8.954576058973e-02 -8.998938726675e-02 -9.036933100447e-02 +-9.068564605646e-02 -9.093842839216e-02 -9.112781544345e-02 -9.125398582595e-02 +-9.131715903518e-02 -9.131759511805e-02 -9.125559431986e-02 -9.113149670714e-02 +-9.094568176680e-02 -9.069856798169e-02 -9.039061238318e-02 -9.002231008092e-02 +-8.959419377037e-02 -8.910683321828e-02 -8.856083472673e-02 -8.795684057602e-02 +-8.729552844688e-02 -8.657761082247e-02 -8.580383437062e-02 -8.497497930673e-02 +-8.409185873785e-02 -8.315531798846e-02 -8.216623390832e-02 -8.112551416309e-02 +-8.003409650806e-02 -7.889294804556e-02 -7.770306446669e-02 -7.646546927776e-02 +-7.518121301207e-02 -7.385137242756e-02 -7.247704969097e-02 -7.105937154890e-02 +-6.959948848656e-02 -6.809857387460e-02 -6.655782310482e-02 -6.497845271507e-02 +-6.336169950423e-02 -6.170881963766e-02 -6.002108774381e-02 -5.829979600262e-02 +-5.654625322625e-02 -5.476178393279e-02 -5.294772741363e-02 -5.110543679496e-02 +-4.923627809415e-02 -4.734162927160e-02 -4.542287927867e-02 -4.348142710221e-02 +-4.151868080659e-02 -3.953605657350e-02 -3.753497774043e-02 -3.551687383826e-02 +-3.348317962869e-02 -3.143533414209e-02 -2.937477971632e-02 -2.730296103728e-02 +-2.522132418163e-02 -2.313131566239e-02 -2.103438147799e-02 -1.893196616539e-02 +-1.682551185776e-02 -1.471645734750e-02 -1.260623715499e-02 -1.049628060369e-02 +-8.388010902283e-03 -6.282844234275e-03 -4.182188855659e-03 -2.087444201223e-03 +-7.672312953838e-15 2.078764599540e-03 4.147481894186e-03 6.204796479797e-03 +8.249366093966e-03 1.027986244690e-02 1.229497204004e-02 1.429339697200e-02 +1.627385573126e-02 1.823508397523e-02 2.017583529520e-02 2.209488196671e-02 +2.399101568496e-02 2.586304828480e-02 2.770981244494e-02 2.953016237589e-02 +3.132297449134e-02 3.308714806259e-02 3.482160585556e-02 3.652529475025e-02 +3.819718634205e-02 3.983627752477e-02 4.144159105503e-02 4.301217609765e-02 +4.454710875183e-02 4.604549255782e-02 4.750645898376e-02 4.892916789260e-02 +5.031280798870e-02 5.165659724396e-02 5.295978330335e-02 5.422164386948e-02 +5.544148706619e-02 5.661865178096e-02 5.775250798589e-02 5.884245703727e-02 +5.988793195354e-02 6.088839767149e-02 6.184335128071e-02 6.275232223613e-02 +6.361487254867e-02 6.443059695381e-02 6.519912305825e-02 6.592011146445e-02 +6.659325587311e-02 6.721828316370e-02 6.779495345287e-02 6.832306013093e-02 +6.880242987642e-02 6.923292264877e-02 6.961443165918e-02 6.994688331985e-02 +7.023023717155e-02 7.046448578979e-02 7.064965466964e-02 7.078580208929e-02 +7.087301895268e-02 7.091142861123e-02 7.090118666487e-02 7.084248074266e-02 +7.073553026307e-02 7.058058617429e-02 7.037793067472e-02 7.012787691387e-02 +6.983076867396e-02 6.948698003260e-02 6.909691500657e-02 6.866100717726e-02 +6.817971929793e-02 6.765354288313e-02 6.708299778067e-02 6.646863172632e-02 +6.581101988180e-02 6.511076435624e-02 6.436849371157e-02 6.358486245216e-02 +6.276055049913e-02 6.189626264975e-02 6.099272802224e-02 6.005069948647e-02 +5.907095308091e-02 5.805428741632e-02 5.700152306657e-02 5.591350194701e-02 +5.479108668091e-02 5.363515995433e-02 5.244662385998e-02 5.122639923040e-02 +4.997542496109e-02 4.869465732392e-02 4.738506927143e-02 4.604764973237e-02 +4.468340289906e-02 4.329334750708e-02 4.187851610765e-02 4.043995433340e-02 +3.897872015787e-02 3.749588314926e-02 3.599252371908e-02 3.446973236600e-02 +3.292860891557e-02 3.137026175626e-02 2.979580707230e-02 2.820636807395e-02 +2.660307422553e-02 2.498706047192e-02 2.335946646383e-02 2.172143578265e-02 +2.007411516498e-02 1.841865372778e-02 1.675620219434e-02 1.508791212165e-02 +1.341493512983e-02 1.173842213385e-02 1.005952257823e-02 8.379383675215e-03 +6.699149646791e-03 5.019960971106e-03 3.342953633789e-03 1.669258384619e-03 +7.615769759501e-15 -1.663703448216e-03 -3.320741317270e-03 -4.970011110682e-03 +-6.610419187879e-03 + L N + 0 5 +1.000000000000e+00 9.998355147105e-01 9.993421562398e-01 9.985202167122e-01 +9.973701827725e-01 9.958927352436e-01 9.940887486459e-01 9.919592905814e-01 +9.895056209813e-01 9.867291912182e-01 9.836316430835e-01 9.802148076310e-01 +9.764807038877e-01 9.724315374315e-01 9.680696988392e-01 9.633977620041e-01 +9.584184823246e-01 9.531347947667e-01 9.475498117999e-01 9.416668212101e-01 +9.354892837886e-01 9.290208309025e-01 9.222652619442e-01 9.152265416659e-01 +9.079087973984e-01 9.003163161571e-01 8.924535416387e-01 8.843250711084e-01 +8.759356521824e-01 8.672901795064e-01 8.583936913341e-01 8.492513660070e-01 +8.398685183386e-01 8.302505959068e-01 8.204031752555e-01 8.103319580098e-01 +8.000427669069e-01 7.895415417463e-01 7.788343352617e-01 7.679273089188e-01 +7.568267286407e-01 7.455389604655e-01 7.340704661390e-01 7.224277986455e-01 +7.106175976801e-01 6.986465850664e-01 6.865215601232e-01 6.742493949824e-01 +6.618370298633e-01 6.492914683061e-01 6.366197723676e-01 6.238290577842e-01 +6.109264891046e-01 5.979192747957e-01 5.848146623272e-01 5.716199332362e-01 +5.583423981772e-01 5.449893919607e-01 5.315682685834e-01 5.180863962557e-01 +5.045511524271e-01 4.909699188169e-01 4.773500764507e-01 4.636990007081e-01 +4.500240563851e-01 4.363325927745e-01 4.226319387680e-01 4.089293979839e-01 +3.952322439240e-01 3.815477151625e-01 3.678830105718e-01 3.542452845871e-01 +3.406416425154e-01 3.270791358894e-01 3.135647578731e-01 3.001054387190e-01 +2.867080412837e-01 2.733793566015e-01 2.601260995227e-01 2.469549044171e-01 +2.338723209472e-01 2.208848099135e-01 2.079987391756e-01 1.952203796510e-01 +1.825559013952e-01 1.700113697654e-01 1.575927416715e-01 1.453058619150e-01 +1.331564596210e-01 1.211501447634e-01 1.092924047870e-01 9.758860132927e-02 +8.604396704185e-02 7.466360251687e-02 6.345247331782e-02 5.241540711808e-02 +4.155709094885e-02 3.088206855810e-02 2.039473788244e-02 1.009934863344e-02 +-3.353609941903e-15 -9.899361531791e-03 -1.959494424000e-02 -2.908311310812e-02 +-3.836039164510e-02 -4.742346358303e-02 -5.626917445166e-02 -6.489453302869e-02 +-7.329671266529e-02 -8.147305248591e-02 -8.942105846214e-02 -9.713840435983e-02 +-1.046229325594e-01 -1.118726547488e-01 -1.188857524890e-01 -1.256605776527e-01 +-1.321956527344e-01 -1.384896710345e-01 -1.445414967152e-01 -1.503501647310e-01 +-1.559148806314e-01 -1.612350202393e-01 -1.663101292031e-01 -1.711399224253e-01 +-1.757242833674e-01 -1.800632632314e-01 -1.841570800207e-01 -1.880061174797e-01 +-1.916109239149e-01 -1.949722108968e-01 -1.980908518463e-01 -2.009678805055e-01 +-2.036044892942e-01 -2.060020275558e-01 -2.081619996917e-01 -2.100860631877e-01 +-2.117760265342e-01 -2.132338470410e-01 -2.144616285503e-01 -2.154616190492e-01 +-2.162362081830e-01 -2.167879246744e-01 -2.171194336468e-01 -2.172335338584e-01 +-2.171331548467e-01 -2.168213539861e-01 -2.163013134635e-01 -2.155763371712e-01 +-2.146498475232e-01 -2.135253821946e-01 -2.122065907892e-01 -2.106972314371e-01 +-2.090011673253e-01 -2.071223631645e-01 -2.050648815952e-01 -2.028328795354e-01 +-2.004306044739e-01 -1.978623907118e-01 -1.951326555559e-01 -1.922458954659e-01 +-1.892066821602e-01 -1.860196586822e-01 -1.826895354318e-01 -1.792210861633e-01 +-1.756191439552e-01 -1.718885971536e-01 -1.680343852933e-01 -1.640614949995e-01 +-1.599749558740e-01 -1.557798363681e-01 -1.514812396472e-01 -1.470842994485e-01 +-1.425941759367e-01 -1.380160515603e-01 -1.333551269115e-01 -1.286166165939e-01 +-1.238057450998e-01 -1.189277427023e-01 -1.139878413639e-01 -1.089912706645e-01 +-1.039432537543e-01 -9.884900333144e-02 -9.371371765054e-02 -8.854257656302e-02 +-8.334073759344e-02 -7.811333205438e-02 -7.286546120295e-02 -6.760219244176e-02 +-6.232855556729e-02 -5.704953906847e-02 -5.177008647807e-02 -4.649509277991e-02 +-4.122940087422e-02 -3.597779810398e-02 -3.074501284471e-02 -2.553571116009e-02 +-2.035449352597e-02 -1.520589162505e-02 -1.009436521454e-02 -5.024299068894e-03 +3.353609941903e-15 4.974306043339e-03 9.894476794457e-03 1.475645640462e-02 +1.955627809358e-02 2.429006671326e-02 2.895404122270e-02 3.354451707280e-02 +3.805790849928e-02 4.249073072232e-02 4.683960205160e-02 5.110124589546e-02 +5.527249267289e-02 5.935028162727e-02 6.333166254089e-02 6.721379734913e-02 +7.099396165368e-02 7.466954613380e-02 7.823805785504e-02 8.169712147485e-02 +8.504448034442e-02 8.827799750657e-02 9.139565658907e-02 9.439556259335e-02 +9.727594257840e-02 1.000351462397e-01 1.026716463832e-01 1.051840392948e-01 +1.075710450049e-01 1.098315074484e-01 1.119643945218e-01 1.139687980356e-01 +1.158439335639e-01 1.175891401928e-01 1.192038801653e-01 1.206877384270e-01 +1.220404220705e-01 1.232617596819e-01 1.243517005880e-01 1.253103140077e-01 +1.261377881068e-01 1.268344289589e-01 1.274006594126e-01 1.278370178673e-01 +1.281441569587e-01 1.283228421551e-01 1.283739502669e-01 1.282984678711e-01 +1.280974896510e-01 1.277722166546e-01 1.273239544735e-01 1.267541113426e-01 +1.260641961644e-01 1.252558164592e-01 1.243306762428e-01 1.232905738353e-01 +1.221373996013e-01 1.208731336255e-01 1.194998433250e-01 1.180196810003e-01 +1.164348813293e-01 1.147477588040e-01 1.129607051143e-01 1.110761864814e-01 +1.090967409418e-01 1.070249755862e-01 1.048635637545e-01 1.026152421907e-01 +1.002828081598e-01 9.786911652868e-02 9.537707681490e-02 9.280965020548e-02 +9.016984654818e-02 8.746072131841e-02 8.468537256425e-02 8.184693783246e-02 +7.894859107811e-02 7.599353956071e-02 7.298502072939e-02 6.992629910018e-02 +6.682066312776e-02 6.367142207470e-02 6.048190288084e-02 5.725544703545e-02 +5.399540745491e-02 5.070514536863e-02 4.738802721590e-02 4.404742155613e-02 +4.068669599532e-02 3.730921413128e-02 3.391833252012e-02 3.051739766654e-02 +2.710974304058e-02 2.369868612310e-02 2.028752548257e-02 1.687953788548e-02 +1.347797544287e-02 1.008606279507e-02 6.706994337177e-03 3.343931487323e-03 +-3.353609941903e-15 -3.321712673460e-03 -6.618159975102e-03 -9.886338779332e-03 +-1.312329187859e-02 -1.632611041383e-02 -1.949193624796e-02 -2.261796428036e-02 +-2.570144470082e-02 -2.873968518112e-02 -3.173005300270e-02 -3.466997711879e-02 +-3.755695014953e-02 -4.038853030866e-02 -4.316234326035e-02 -4.587608390496e-02 +-4.852751809239e-02 -5.111448426194e-02 -5.363489500755e-02 -5.608673856737e-02 +-5.846808023679e-02 -6.077706370390e-02 -6.301191230675e-02 -6.517093021151e-02 +-6.725250351099e-02 -6.925510124286e-02 -7.117727632702e-02 -7.301766642180e-02 +-7.477499469850e-02 -7.644807053400e-02 -7.803579012129e-02 -7.953713699763e-02 +-8.095118249047e-02 -8.227708608085e-02 -8.351409568469e-02 -8.466154785177e-02 +-8.571886788288e-02 -8.668556986532e-02 -8.756125662706e-02 -8.834561961013e-02 +-8.903843866361e-02 -8.963958175685e-02 -9.014900461357e-02 -9.056675026752e-02 +-9.089294854048e-02 -9.112781544345e-02 -9.127165250193e-02 -9.132484600626e-02 +-9.128786618804e-02 -9.116126632377e-02 -9.094568176680e-02 -9.064182890882e-02 +-9.025050407227e-02 -8.977258233476e-02 -8.920901628720e-02 -8.856083472673e-02 +-8.782914128630e-02 -8.701511300212e-02 -8.611999882078e-02 -8.514511804759e-02 +-8.409185873785e-02 -8.296167603278e-02 -8.175609044184e-02 -8.047668607331e-02 +-7.912510881496e-02 -7.770306446669e-02 -7.621231682701e-02 -7.465468573548e-02 +-7.303204507292e-02 -7.134632072145e-02 -6.959948848655e-02 -6.779357198298e-02 +-6.593064048684e-02 -6.401280675583e-02 -6.204222481980e-02 -6.002108774380e-02 +-5.795162536585e-02 -5.583610201145e-02 -5.367681418723e-02 -5.147608825581e-02 +-4.923627809414e-02 -4.695976273751e-02 -4.464894401151e-02 -4.230624415413e-02 +-3.993410343019e-02 -3.753497774042e-02 -3.511133622733e-02 -3.266565888012e-02 +-3.020043414085e-02 -2.771815651398e-02 -2.522132418162e-02 -2.271243662650e-02 +-2.019399226492e-02 -1.766848609178e-02 -1.513840733978e-02 -1.260623715498e-02 +-1.007444629063e-02 -7.545492821499e-03 -5.021819880599e-03 -2.505853420324e-03 +3.353609941903e-15 2.493355398284e-03 4.971851523585e-03 7.433152978010e-03 +9.874952304682e-03 1.229497204005e-02 1.469096672876e-02 1.706072489944e-02 +1.940207099964e-02 2.171286728842e-02 2.399101568497e-02 2.623445957164e-02 +2.844118555013e-02 3.060922514918e-02 3.273665648249e-02 3.482160585557e-02 +3.686224932018e-02 3.885681417514e-02 4.080358041244e-02 4.270088210738e-02 +4.454710875184e-02 4.634070652958e-02 4.808017953264e-02 4.976409091801e-02 +5.139106400368e-02 5.295978330336e-02 5.446899549908e-02 5.591751035112e-02 +5.730420154464e-02 5.862800747246e-02 5.988793195355e-02 6.108304488681e-02 +6.221248283990e-02 6.327544957257e-02 6.427121649467e-02 6.519912305826e-02 +6.605857708405e-02 6.684905502200e-02 6.757010214600e-02 6.822133268299e-02 +6.880242987642e-02 6.931314598432e-02 6.975330221231e-02 7.012278858185e-02 +7.042156373406e-02 7.064965466964e-02 7.080715642526e-02 7.089423168719e-02 +7.091111034250e-02 7.085808896881e-02 7.073553026306e-02 7.054386241019e-02 +7.028357839256e-02 6.995523524100e-02 6.955945322834e-02 6.909691500657e-02 +6.856836468843e-02 6.797460687474e-02 6.731650562847e-02 6.659498339670e-02 +6.581101988179e-02 6.496565086298e-02 6.405996696958e-02 6.309511240737e-02 +6.207228363932e-02 6.099272802224e-02 5.985774240061e-02 5.866867165936e-02 +5.742690723682e-02 5.613388559961e-02 5.479108668090e-02 5.340003228383e-02 +5.196228445149e-02 5.047944380534e-02 4.895314785360e-02 4.738506927142e-02 +4.577691415454e-02 4.413042024804e-02 4.244735515224e-02 4.072951450720e-02 +3.897872015786e-02 3.719681830143e-02 3.538567761908e-02 3.354718739344e-02 +3.168325561403e-02 2.979580707229e-02 2.788678144804e-02 2.595813138934e-02 +2.401182058740e-02 2.204982184855e-02 2.007411516497e-02 1.808668578607e-02 +1.608952229238e-02 1.408461467357e-02 1.207395241270e-02 1.005952257821e-02 +8.043307925581e-03 6.027285010332e-03 4.013422314213e-03 2.003678386190e-03 +-3.353609941903e-15 -1.995679670084e-03 -3.981442853549e-03 -5.955388966477e-03 +-7.915636371214e-03 -9.860324111326e-03 -1.178761362031e-02 -1.369569040251e-02 +-1.558276568475e-02 -1.744707803726e-02 -1.928689496242e-02 -2.110051444999e-02 +-2.288626649737e-02 -2.464251459378e-02 -2.636765716683e-02 -2.806012899041e-02 +-2.971840255270e-02 -3.134098938305e-02 -3.292644133668e-02 -3.447335183621e-02 +-3.598035706880e-02 -3.744613713811e-02 -3.886941717006e-02 -4.024896837154e-02 +-4.158360904115e-02 -4.287220553129e-02 -4.411367316085e-02 -4.530697707766e-02 +-4.645113307028e-02 -4.754520832833e-02 -4.858832215099e-02 -4.957964660305e-02 +-5.051840711811e-02 -5.140388304864e-02 -5.223540816233e-02 -5.301237108475e-02 +-5.373421568778e-02 -5.440044142386e-02 -5.501060360585e-02 -5.556431363235e-02 +-5.606123915857e-02 -5.650110421273e-02 -5.688368925801e-02 -5.720883120029e-02 +-5.747642334177e-02 -5.768641528072e-02 -5.783881275763e-02 -5.793367744821e-02 +-5.797112670335e-02 -5.795133323679e-02 -5.787452476069e-02 -5.774098356987e-02 +-5.755104607507e-02 -5.730510228602e-02 -5.700359524489e-02 -5.664702041079e-02 +-5.623592499626e-02 -5.577090725630e-02 -5.525261573089e-02 -5.468174844201e-02 +-5.405905204576e-02 -5.338532094088e-02 -5.266139633442e-02 -5.188816526574e-02 +-5.106655958980e-02 -5.019755492096e-02 -4.928216953831e-02 -4.832146325383e-02 +-4.731653624442e-02 -4.626852784924e-02 -4.517861533337e-02 -4.404801261941e-02 +-4.287796898795e-02 -4.166976774856e-02 -4.042472488259e-02 -3.914418765900e-02 +-3.782953322493e-02 -3.648216717212e-02 -3.510352208092e-02 -3.369505604309e-02 +-3.225825116512e-02 -3.079461205334e-02 -2.930566428247e-02 -2.779295284911e-02 +-2.625804061163e-02 -2.470250671805e-02 -2.312794502346e-02 -2.153596249848e-02 +-1.992817763036e-02 -1.830621881823e-02 -1.667172276412e-02 -1.502633286119e-02 +-1.337169758083e-02 -1.170946886015e-02 -1.004130049137e-02 -8.368846514648e-03 +-6.693759615919e-03 -5.017689531214e-03 -3.342281458993e-03 -1.669174481984e-03 +3.353609941903e-15 1.663619824813e-03 3.320073608774e-03 4.967762272203e-03 +6.605100548166e-03 + L N + 0 6 +1.000000000000e+00 9.997761212345e-01 9.991046653715e-01 9.979861735385e-01 +9.964215470375e-01 9.944120464808e-01 9.919592905814e-01 9.890652546003e-01 +9.857322684524e-01 9.819630144724e-01 9.777605248430e-01 9.731281786890e-01 +9.680696988392e-01 9.625891482603e-01 9.566909261659e-01 9.503797638053e-01 +9.436607199360e-01 9.365391759848e-01 9.290208309025e-01 9.211116957177e-01 +9.128180877951e-01 9.041466248047e-01 8.951042184077e-01 8.856980676661e-01 +8.759356521824e-01 8.658247249770e-01 8.553733051108e-01 8.445896700594e-01 +8.334823478491e-01 8.220601089605e-01 8.103319580098e-01 7.983071252151e-01 +7.859950576585e-01 7.734054103500e-01 7.605480371061e-01 7.474329812490e-01 +7.340704661390e-01 7.204708855480e-01 7.066447938841e-01 6.926028962792e-01 +6.783560385471e-01 6.639151970248e-01 6.492914683061e-01 6.344960588783e-01 +6.195402746735e-01 6.044355105433e-01 5.891932396702e-01 5.738250029242e-01 +5.583423981772e-01 5.427570695849e-01 5.270806968481e-01 5.113249844634e-01 +4.955016509752e-01 4.796224182391e-01 4.636990007081e-01 4.477430947521e-01 +4.317663680216e-01 4.157804488669e-01 3.997969158223e-01 3.838272871669e-01 +3.678830105718e-01 3.519754528448e-01 3.361158897820e-01 3.203154961369e-01 +3.045853357170e-01 2.889363516174e-01 2.733793566015e-01 2.579250236380e-01 +2.425838766034e-01 2.273662811590e-01 2.122824358125e-01 1.973423631710e-01 +1.825559013952e-01 1.679326958626e-01 1.534821910482e-01 1.392136226292e-01 +1.251360098232e-01 1.112581479646e-01 9.758860132928e-02 8.413569621079e-02 +7.090751425767e-02 5.791188607580e-02 4.515638510272e-02 3.264832175908e-02 +2.039473788245e-02 8.402401448597e-03 -3.322198415458e-03 -1.477285612207e-02 +-2.594365401351e-02 -3.682896644873e-02 -4.742346358302e-02 -5.772211483774e-02 +-6.772019205735e-02 -7.741327235156e-02 -8.679724062067e-02 -9.586829176246e-02 +-1.046229325594e-01 -1.130579832452e-01 -1.211705787506e-01 -1.289581696271e-01 +-1.364185226502e-01 -1.435497211015e-01 -1.503501647310e-01 -1.568185694005e-01 +-1.629539664096e-01 -1.687557015072e-01 -1.742234335878e-01 -1.793571330792e-01 +-1.841570800207e-01 -1.886238618368e-01 -1.927583708100e-01 -1.965618012556e-01 +-2.000356464025e-01 -2.031816949862e-01 -2.060020275558e-01 -2.084990125027e-01 +-2.106753018143e-01 -2.125338265592e-01 -2.140777921103e-01 -2.153106731093e-01 +-2.162362081830e-01 -2.168583944138e-01 -2.171814815742e-01 -2.172099661307e-01 +-2.169485850260e-01 -2.164023092444e-01 -2.155763371712e-01 -2.144760877518e-01 +-2.131071934591e-01 -2.114754930785e-01 -2.095870243170e-01 -2.074480162477e-01 +-2.050648815952e-01 -2.024442088739e-01 -1.995927543858e-01 -1.965174340891e-01 +-1.932253153449e-01 -1.897236085524e-01 -1.860196586822e-01 -1.821209367168e-01 +-1.780350310077e-01 -1.737696385594e-01 -1.693325562496e-01 -1.647316719951e-01 +-1.599749558740e-01 -1.550704512126e-01 -1.500262656484e-01 -1.448505621774e-01 +-1.395515501966e-01 -1.341374765510e-01 -1.286166165939e-01 -1.229972652722e-01 +-1.172877282441e-01 -1.114963130395e-01 -1.056313202729e-01 -9.970103491761e-02 +-9.371371765055e-02 -8.767759627652e-02 -8.160085724134e-02 -7.549163724239e-02 +-6.935801494513e-02 -6.320800281437e-02 -5.704953906848e-02 -5.089047976476e-02 +-4.473859102402e-02 -3.860154140214e-02 -3.248689441626e-02 -2.640210123300e-02 +-2.035449352598e-02 -1.435127650953e-02 -8.399522155475e-03 -2.506162599395e-03 +3.322016257211e-03 9.078380942906e-03 1.475645640461e-02 2.034993178264e-02 +2.585266596731e-02 3.125869293193e-02 3.656222683765e-02 4.175766690549e-02 +4.683960205159e-02 5.180281528153e-02 5.664228784039e-02 6.135320311502e-02 +6.593095028555e-02 7.037112772347e-02 7.466954613379e-02 7.882223143917e-02 +8.282542740418e-02 8.667559799815e-02 9.036942949543e-02 9.390383231208e-02 +9.727594257839e-02 1.004831234469e-01 1.035229661361e-01 1.063932907093e-01 +1.090921465908e-01 1.116178128186e-01 1.139687980356e-01 1.161438402206e-01 +1.181419061618e-01 1.199621906724e-01 1.216041155534e-01 1.230673283049e-01 +1.243517005880e-01 1.254573264425e-01 1.263845202616e-01 1.271338145288e-01 +1.277059573205e-01 1.281019095783e-01 1.283228421551e-01 1.283701326409e-01 +1.282453619720e-01 1.279503108287e-01 1.274869558281e-01 1.268574655159e-01 +1.260641961644e-01 1.251096873815e-01 1.239966575376e-01 1.227279990164e-01 +1.213067732963e-01 1.197362058687e-01 1.180196810003e-01 1.161607363465e-01 +1.141630574224e-01 1.120304719395e-01 1.097669440145e-01 1.073765682587e-01 +1.048635637545e-01 1.022322679273e-01 9.948713032115e-02 9.663270628381e-02 +9.367365057202e-02 9.061471088259e-02 8.746072131842e-02 8.421659579729e-02 +8.088732141131e-02 7.747795174524e-02 7.399360016178e-02 7.043943306182e-02 +6.682066312777e-02 6.314254255800e-02 5.941035630052e-02 5.562941529365e-02 +5.180504972193e-02 4.794260229479e-02 4.404742155614e-02 4.012485523239e-02 +3.618024362662e-02 3.221891306649e-02 2.824616941330e-02 2.426729163961e-02 +2.028752548258e-02 1.631207718023e-02 1.234610729754e-02 8.394724649155e-03 +4.462980325592e-03 5.558618292154e-04 -3.321712673450e-03 -7.164899976963e-03 +-1.096893733374e-02 -1.472914781648e-02 -1.844094554067e-02 -2.209984074161e-02 +-2.570144470081e-02 -2.924147451659e-02 -3.271575771426e-02 -3.612023669091e-02 +-3.945097299083e-02 -4.270415140699e-02 -4.587608390495e-02 -4.896321336523e-02 +-5.196211714086e-02 -5.486951042677e-02 -5.768224943800e-02 -6.039733439402e-02 +-6.301191230674e-02 -6.552327956968e-02 -6.792888434663e-02 -7.022632875778e-02 +-7.241337086197e-02 -7.448792643370e-02 -7.644807053400e-02 -7.829203887430e-02 +-8.001822897298e-02 -8.162520110414e-02 -8.311167903878e-02 -8.447655057860e-02 +-8.571886788288e-02 -8.683784758929e-02 -8.783287072958e-02 -8.870348244140e-02 +-8.944939147777e-02 -9.007046951594e-02 -9.056675026751e-02 -9.093842839216e-02 +-9.118585821725e-02 -9.130955226611e-02 -9.131017959773e-02 -9.118856396099e-02 +-9.094568176680e-02 -9.058265988151e-02 -9.010077324544e-02 -8.950144232025e-02 +-8.878623036943e-02 -8.795684057602e-02 -8.701511300212e-02 -8.596302139470e-02 +-8.480266984257e-02 -8.353628928948e-02 -8.216623390832e-02 -8.069497734182e-02 +-7.912510881497e-02 -7.745932912479e-02 -7.570044651304e-02 -7.385137242756e-02 +-7.191511717826e-02 -6.989478549347e-02 -6.779357198299e-02 -6.561475651371e-02 +-6.336169950423e-02 -6.103783714462e-02 -5.864667654772e-02 -5.619179083840e-02 +-5.367681418723e-02 -5.110543679496e-02 -4.848139983440e-02 -4.580849035631e-02 +-4.309053616561e-02 -4.033140067471e-02 -3.753497774043e-02 -3.470518649089e-02 +-3.184596614924e-02 -2.896127086029e-02 -2.605506452694e-02 -2.313131566239e-02 +-2.019399226493e-02 -1.724705672121e-02 -1.429446074456e-02 -1.134014035430e-02 +-8.388010902283e-03 -5.441962152604e-03 -2.505853420335e-03 4.164912247927e-04 +3.321287684149e-03 6.204796479797e-03 9.063327322455e-03 1.189324359249e-02 +1.469096672875e-02 1.745298052016e-02 2.017583529520e-02 2.285615200442e-02 +2.549062619147e-02 2.807603184815e-02 3.060922514917e-02 3.308714806259e-02 +3.550683183187e-02 3.786540032592e-02 4.016007325341e-02 4.238816923809e-02 +4.454710875183e-02 4.663441690242e-02 4.864772607321e-02 5.058477841217e-02 +5.244342816776e-02 5.422164386948e-02 5.591751035111e-02 5.752923061482e-02 +5.905512753453e-02 6.049364539718e-02 6.184335128071e-02 6.310293626781e-02 +6.427121649466e-02 6.534713403412e-02 6.632975761305e-02 6.721828316370e-02 +6.801203420910e-02 6.871046208295e-02 6.931314598432e-02 6.981979286803e-02 +7.023023717155e-02 7.054444037951e-02 7.076249042722e-02 7.088460094463e-02 +7.091111034250e-02 7.084248074266e-02 7.067929675443e-02 7.042226409951e-02 +7.007220808778e-02 6.963007194661e-02 6.909691500657e-02 6.847391074645e-02 +6.776234470069e-02 6.696361223272e-02 6.607921617738e-02 6.511076435624e-02 +6.405996696958e-02 6.292863386873e-02 6.171867171303e-02 6.043208101540e-02 +5.907095308091e-02 5.763746684267e-02 5.613388559961e-02 5.456255366073e-02 +5.292589290051e-02 5.122639923040e-02 4.946663899113e-02 4.764924527091e-02 +4.577691415454e-02 4.385240090858e-02 4.187851610765e-02 3.985812170719e-02 +3.779412706793e-02 3.568948493736e-02 3.354718739345e-02 3.137026175625e-02 +2.916176647247e-02 2.692478697855e-02 2.466243154774e-02 2.237782712640e-02 +2.007411516498e-02 1.775444744914e-02 1.542198193627e-02 1.307987860273e-02 +1.073129530719e-02 8.379383675215e-03 6.027285010342e-03 3.678126236832e-03 +1.335015879076e-03 -9.989599172310e-04 -3.320741317271e-03 -5.627298677741e-03 +-7.915636371203e-03 -1.018279654944e-02 -1.242586284123e-02 -1.464196398011e-02 +-1.682827735765e-02 -1.898203249806e-02 -2.110051444998e-02 -2.318106709137e-02 +-2.522109634368e-02 -2.721807329147e-02 -2.916953720391e-02 -3.107309845465e-02 +-3.292644133667e-02 -3.472732676905e-02 -3.647359489242e-02 -3.816316755042e-02 +-3.979405065425e-02 -4.136433642785e-02 -4.287220553129e-02 -4.431592906007e-02 +-4.569387041837e-02 -4.700448706418e-02 -4.824633212481e-02 -4.941805588094e-02 +-5.051840711811e-02 -5.154623434421e-02 -5.250048687215e-02 -5.338021576662e-02 +-5.418457465452e-02 -5.491282039834e-02 -5.556431363234e-02 -5.613851916128e-02 +-5.663500622177e-02 -5.705344860651e-02 -5.739362465170e-02 -5.765541708827e-02 +-5.783881275763e-02 -5.794390219286e-02 -5.797087906641e-02 -5.792003950556e-02 +-5.779178127705e-02 -5.758660284245e-02 -5.730510228603e-02 -5.694797611695e-02 +-5.651601794795e-02 -5.601011705258e-02 -5.543125680345e-02 -5.478051299389e-02 +-5.405905204576e-02 -5.326812910605e-02 -5.240908603529e-02 -5.148334929075e-02 +-5.049242770755e-02 -4.943791018106e-02 -4.832146325384e-02 -4.714482861076e-02 +-4.590982048582e-02 -4.461832298440e-02 -4.327228732471e-02 -4.187372900247e-02 +-4.042472488259e-02 -3.892741022207e-02 -3.738397562815e-02 -3.579666395607e-02 +-3.416776715042e-02 -3.249962303471e-02 -3.079461205335e-02 -2.905515397046e-02 +-2.728370453005e-02 -2.548275208201e-02 -2.365481417841e-02 -2.180243414471e-02 +-1.992817763037e-02 -1.803462914344e-02 -1.612438857381e-02 -1.420006770947e-02 +-1.226428675055e-02 -1.031967082562e-02 -8.368846514659e-03 -6.414438383447e-03 +-4.459065533581e-03 -2.505338172758e-03 -5.558542095990e-04 1.386804122575e-03 +3.320073608763e-03 5.241413357832e-03 7.148308066446e-03 9.038271237255e-03 +1.090884834732e-02 1.275761996286e-02 1.458220479632e-02 1.638026270224e-02 +1.814949760793e-02 1.988766037559e-02 2.159255159232e-02 2.326202428457e-02 +2.489398655388e-02 2.648640413070e-02 2.803730284316e-02 2.954477099805e-02 +3.100696167110e-02 3.242209490384e-02 3.378845980468e-02 3.510441655164e-02 +3.636839829456e-02 3.757891295461e-02 3.873454491911e-02 3.983395662993e-02 +4.087589006353e-02 4.185916810137e-02 4.278269578910e-02 4.364546148326e-02 +4.444653788457e-02 4.518508295663e-02 4.586034072937e-02 4.647164198660e-02 +4.701840483706e-02 4.750013516873e-02 4.791642698619e-02 4.826696263096e-02 +4.855151288497e-02 4.876993695739e-02 4.892218235529e-02 4.900828463865e-02 +4.902836706049e-02 4.898264009294e-02 4.887140084024e-02 4.869503233992e-02 +4.845400275336e-02 4.814886444722e-02 4.778025296725e-02 4.734888590635e-02 +4.685556166845e-02 4.630115813047e-02 4.568663120425e-02 4.501301330080e-02 +4.428141169907e-02 4.349300682192e-02 4.264905042157e-02 4.175086367751e-02 +4.079983520940e-02 3.979741900804e-02 3.874513228725e-02 3.764455325988e-02 +3.649731884094e-02 3.530512228132e-02 3.406971073525e-02 3.279288276494e-02 +3.147648578604e-02 3.012241345721e-02 2.873260301761e-02 2.730903257589e-02 +2.585371835442e-02 2.436871189245e-02 2.285609721216e-02 2.131798795126e-02 +1.975652446611e-02 1.817387090931e-02 1.657221228548e-02 1.495375148943e-02 +1.332070633045e-02 1.167530654672e-02 1.001979081396e-02 8.356403751947e-03 +6.687392933145e-03 5.015005897186e-03 3.341487175163e-03 1.669075327611e-03 +7.470372974062e-15 -1.663521000383e-03 -3.319284602556e-03 -4.965105340980e-03 +-6.598818192294e-03 + L N + 0 7 +1.000000000000e+00 9.997075929310e-01 9.988306795205e-01 9.973701827725e-01 +9.953276397415e-01 9.927051996072e-01 9.895056209813e-01 9.857322684524e-01 +9.813891083719e-01 9.764807038877e-01 9.710122092318e-01 9.649893632704e-01 +9.584184823246e-01 9.513064522713e-01 9.436607199360e-01 9.354892837886e-01 +9.268006839549e-01 9.176039915569e-01 9.079087973984e-01 8.977252000079e-01 +8.870637930592e-01 8.759356521824e-01 8.643523211873e-01 8.523257977150e-01 +8.398685183386e-01 8.269933431327e-01 8.137135397329e-01 8.000427669069e-01 +7.859950576585e-01 7.715848018895e-01 7.568267286407e-01 7.417358879367e-01 +7.263276322605e-01 7.106175976801e-01 6.946216846549e-01 6.783560385471e-01 +6.618370298633e-01 6.450812342547e-01 6.281054123006e-01 6.109264891046e-01 +5.935615337287e-01 5.760277384943e-01 5.583423981772e-01 5.405228891241e-01 +5.225866483191e-01 5.045511524271e-01 4.864338968434e-01 4.682523747753e-01 +4.500240563851e-01 4.317663680216e-01 4.134966715663e-01 3.952322439240e-01 +3.769902566816e-01 3.587877559645e-01 3.406416425154e-01 3.225686520215e-01 +3.045853357170e-01 2.867080412837e-01 2.689528940770e-01 2.513357786996e-01 +2.338723209472e-01 2.165778701492e-01 1.994674819279e-01 1.825559013952e-01 +1.658575468121e-01 1.493864937280e-01 1.331564596210e-01 1.171807890593e-01 +1.014724393995e-01 8.604396704185e-02 7.090751425766e-02 5.607479660516e-02 +4.155709094885e-02 2.736522409645e-02 1.350956206663e-02 -8.091661967317e-16 +-1.315404727541e-02 -2.594365401352e-02 -3.836039164510e-02 -5.039633618945e-02 +-6.204407497545e-02 -7.329671266528e-02 -8.414787657521e-02 -9.459172128886e-02 +-1.046229325594e-01 -1.142367304979e-01 -1.234288720462e-01 -1.321956527344e-01 +-1.405339077219e-01 -1.484410121248e-01 -1.559148806314e-01 -1.629539664096e-01 +-1.695572593094e-01 -1.757242833674e-01 -1.814550936186e-01 -1.867502722230e-01 +-1.916109239149e-01 -1.960386707847e-01 -2.000356464025e-01 -2.036044892942e-01 +-2.067483357832e-01 -2.094708122085e-01 -2.117760265342e-01 -2.136685593635e-01 +-2.151534543730e-01 -2.162362081830e-01 -2.169227596796e-01 -2.172194788069e-01 +-2.171331548467e-01 -2.166709842043e-01 -2.158405577195e-01 -2.146498475232e-01 +-2.131071934591e-01 -2.112212890922e-01 -2.090011673253e-01 -2.064561856448e-01 +-2.035960110195e-01 -2.004306044739e-01 -1.969702053588e-01 -1.932253153449e-01 +-1.892066821602e-01 -1.849252830975e-01 -1.803923083151e-01 -1.756191439552e-01 +-1.706173551053e-01 -1.653986686265e-01 -1.599749558740e-01 -1.543582153342e-01 +-1.485605552041e-01 -1.425941759367e-01 -1.364713527783e-01 -1.302044183218e-01 +-1.238057450998e-01 -1.172877282441e-01 -1.106627682334e-01 -1.039432537543e-01 +-9.714154469929e-02 -9.026995532501e-02 -8.334073759344e-02 -7.636606471924e-02 +-6.935801494513e-02 -6.232855556730e-02 -5.528952723222e-02 -4.825262852564e-02 +-4.122940087422e-02 -3.423121377956e-02 -2.726925040388e-02 -2.035449352597e-02 +-1.349771188541e-02 -6.709446932422e-03 8.091661967317e-16 6.620580085637e-03 +1.314250894106e-02 1.955627809358e-02 2.585266596731e-02 3.202274837443e-02 +3.805790849928e-02 4.394984636412e-02 4.969058776567e-02 5.527249267289e-02 +6.068826307699e-02 6.593095028556e-02 7.099396165368e-02 7.587106674556e-02 +8.055640292137e-02 8.504448034442e-02 8.933018640529e-02 9.340878955969e-02 +9.727594257840e-02 1.009276852080e-01 1.043604462423e-01 1.075710450049e-01 +1.105566922449e-01 1.133149904477e-01 1.158439335639e-01 1.181419061618e-01 +1.202076820060e-01 1.220404220705e-01 1.236396719912e-01 1.250053589653e-01 +1.261377881068e-01 1.270376382654e-01 1.277059573205e-01 1.281441569587e-01 +1.283540069471e-01 1.283376289143e-01 1.280974896510e-01 1.276363939434e-01 +1.269574769544e-01 1.260641961644e-01 1.249603228902e-01 1.236499333941e-01 +1.221373996013e-01 1.204273794422e-01 1.185248068353e-01 1.164348813293e-01 +1.141630574224e-01 1.117150335758e-01 1.090967409418e-01 1.063143318244e-01 +1.033741678916e-01 1.002828081598e-01 9.704699676953e-02 9.367365057202e-02 +9.016984654819e-02 8.654280907894e-02 8.279989708811e-02 7.894859107812e-02 +7.499648007917e-02 7.095124853243e-02 6.682066312776e-02 6.261255961661e-02 +5.833482962041e-02 5.399540745491e-02 4.960225699054e-02 4.516335856892e-02 +4.068669599532e-02 3.618024362661e-02 3.165195357416e-02 2.710974304058e-02 +2.256148180925e-02 1.801497990482e-02 1.347797544287e-02 8.958122686282e-03 +4.462980325584e-03 -7.149275395032e-16 -4.423484924474e-03 -8.800270304146e-03 +-1.312329187859e-02 -1.738563562867e-02 -2.158054781755e-02 -2.570144470081e-02 +-2.974192189296e-02 -3.369576337758e-02 -3.755695014953e-02 -4.131966847795e-02 +-4.497831777955e-02 -4.852751809239e-02 -5.196211714087e-02 -5.527719698370e-02 +-5.846808023679e-02 -6.153033586422e-02 -6.445978453086e-02 -6.725250351099e-02 +-6.990483114816e-02 -7.241337086197e-02 -7.477499469850e-02 -7.698684642154e-02 +-7.904634414292e-02 -8.095118249046e-02 -8.269933431327e-02 -8.428905192453e-02 +-8.571886788288e-02 -8.698759531398e-02 -8.809432777479e-02 -8.903843866361e-02 +-8.981958017984e-02 -9.043768183789e-02 -9.089294854048e-02 -9.118585821725e-02 +-9.131715903518e-02 -9.128786618804e-02 -9.109925827260e-02 -9.075287326016e-02 +-9.025050407227e-02 -8.959419377037e-02 -8.878623036942e-02 -8.782914128630e-02 +-8.672568743409e-02 -8.547885697412e-02 -8.409185873785e-02 -8.256811533135e-02 +-8.091125593543e-02 -7.912510881496e-02 -7.721369355130e-02 -7.518121301206e-02 +-7.303204507292e-02 -7.077073410630e-02 -6.840198225223e-02 -6.593064048684e-02 +-6.336169950423e-02 -6.070028042758e-02 -5.795162536585e-02 -5.512108783204e-02 +-5.221412303971e-02 -4.923627809414e-02 -4.619318209477e-02 -4.309053616560e-02 +-3.993410343019e-02 -3.672969894801e-02 -3.348317962868e-02 -3.020043414085e-02 +-2.688737283211e-02 -2.354991767634e-02 -2.019399226492e-02 -1.682551185775e-02 +-1.345037351002e-02 -1.007444629063e-02 -6.703561607520e-03 -3.343503655287e-03 +8.091661967317e-16 3.321287684157e-03 6.614772712057e-03 9.874952304679e-03 +1.309641631239e-02 1.627385573127e-02 1.940207099963e-02 2.247598006243e-02 +2.549062619148e-02 2.844118555013e-02 3.132297449135e-02 3.413145657870e-02 +3.686224932018e-02 3.951113060552e-02 4.207404483791e-02 4.454710875184e-02 +4.692661690911e-02 4.920904686583e-02 5.139106400368e-02 5.346952601928e-02 +5.544148706620e-02 5.730420154464e-02 5.905512753453e-02 6.069192986825e-02 +6.221248283989e-02 6.361487254867e-02 6.489739887441e-02 6.605857708405e-02 +6.709713906841e-02 6.801203420911e-02 6.880242987642e-02 6.946771155903e-02 +7.000748262752e-02 7.042156373406e-02 7.070999185110e-02 7.087301895268e-02 +7.091111034250e-02 7.082494263330e-02 7.061540138291e-02 7.028357839256e-02 +6.983076867396e-02 6.925846709169e-02 6.856836468843e-02 6.776234470069e-02 +6.684247827337e-02 6.581101988180e-02 6.467040247051e-02 6.342323231826e-02 +6.207228363933e-02 6.062049293139e-02 5.907095308091e-02 5.742690723682e-02 +5.569174246433e-02 5.386898319014e-02 5.196228445150e-02 4.997542496108e-02 +4.791230000042e-02 4.577691415454e-02 4.357337390075e-02 4.130588006484e-02 +3.897872015786e-02 3.659626060694e-02 3.416293889372e-02 3.168325561404e-02 +2.916176647246e-02 2.660307422553e-02 2.401182058740e-02 2.139267811165e-02 +1.875034206295e-02 1.608952229238e-02 1.341493512983e-02 1.073129530719e-02 +8.043307925584e-03 5.355660480002e-03 2.673014954360e-03 -7.526230023946e-16 +-2.658796789711e-03 -5.298836496131e-03 -7.915636371211e-03 -1.050477720044e-02 +-1.306191052115e-02 -1.558276568475e-02 -1.806315675175e-02 -2.049898920881e-02 +-2.288626649737e-02 -2.522109634368e-02 -2.749969688076e-02 -2.971840255270e-02 +-3.187366979260e-02 -3.396208246556e-02 -3.598035706879e-02 -3.792534768102e-02 +-3.979405065425e-02 -4.158360904115e-02 -4.329131675165e-02 -4.491462243338e-02 +-4.645113307028e-02 -4.789861729501e-02 -4.925500841066e-02 -5.051840711811e-02 +-5.168708394579e-02 -5.275948137919e-02 -5.373421568778e-02 -5.461007844774e-02 +-5.538603775940e-02 -5.606123915857e-02 -5.663500622177e-02 -5.710684086569e-02 +-5.747642334177e-02 -5.774361192730e-02 -5.790844231499e-02 -5.797112670335e-02 +-5.793205259083e-02 -5.779178127705e-02 -5.755104607507e-02 -5.721075023891e-02 +-5.677196461122e-02 -5.623592499627e-02 -5.560402926396e-02 -5.487783419102e-02 +-5.405905204576e-02 -5.314954692351e-02 -5.215133083990e-02 -5.106655958980e-02 +-4.989752837985e-02 -4.864666724310e-02 -4.731653624443e-02 -4.590982048582e-02 +-4.442932492084e-02 -4.287796898795e-02 -4.125878107252e-02 -3.957489280777e-02 +-3.782953322493e-02 -3.602602276320e-02 -3.416776715041e-02 -3.225825116512e-02 +-3.030103229152e-02 -2.829973427809e-02 -2.625804061163e-02 -2.417968791794e-02 +-2.206845930072e-02 -1.992817763036e-02 -1.776269879406e-02 -1.557590491911e-02 +-1.337169758083e-02 -1.115399100682e-02 -8.926705289161e-03 -6.693759615922e-03 +-4.459065533573e-03 -2.226520251516e-03 7.149275395032e-16 2.216646547520e-03 +4.419604776640e-03 6.605100548163e-03 8.769406517547e-03 1.090884834733e-02 +1.301981080239e-02 1.509874371809e-02 1.714216783182e-02 1.914668046839e-02 +2.110896107026e-02 2.302577656394e-02 2.489398655389e-02 2.671054833591e-02 +2.847252172221e-02 3.017707367060e-02 3.182148271090e-02 3.340314316160e-02 +3.491956913071e-02 3.636839829457e-02 3.774739544933e-02 3.905445582979e-02 +4.028760819093e-02 4.144501764787e-02 4.252498827031e-02 4.352596542804e-02 +4.444653788457e-02 4.528543963624e-02 4.604155149464e-02 4.671390241085e-02 +4.730167054004e-02 4.780418404582e-02 4.822092164385e-02 4.855151288497e-02 +4.879573817824e-02 4.895352855494e-02 4.902496517506e-02 4.901027857787e-02 +4.890984767914e-02 4.872419851754e-02 4.845400275336e-02 4.810007592315e-02 +4.766337545415e-02 4.714499844287e-02 4.654617920251e-02 4.586828658428e-02 +4.511282107822e-02 4.428141169907e-02 4.337581266363e-02 4.239789986584e-02 +4.134966715663e-02 4.023322243538e-02 3.905078356065e-02 3.780467408771e-02 +3.649731884093e-02 3.513123932908e-02 3.370904901216e-02 3.223344842834e-02 +3.070722018990e-02 2.913322385713e-02 2.751439069967e-02 2.585371835441e-02 +2.415426538970e-02 2.241914578537e-02 2.065152333847e-02 1.885460600450e-02 +1.703164018409e-02 1.518590496514e-02 1.332070633044e-02 1.143937134082e-02 +9.545242303915e-03 7.641670938514e-03 5.732012544669e-03 3.819620189370e-03 +1.907838917807e-03 -7.687782007767e-16 -1.900584777436e-03 -3.790628764785e-03 +-5.666876038481e-03 -7.526106916761e-03 -9.365143392521e-03 -1.118085447437e-02 +-1.297016142701e-02 -1.473004290239e-02 -1.645753995316e-02 -1.814976092022e-02 +-1.980388618652e-02 -2.141717278938e-02 -2.298695888388e-02 -2.451066805029e-02 +-2.598581343857e-02 -2.741000174358e-02 -2.878093700455e-02 -3.009642422315e-02 +-3.135437279440e-02 -3.255279974529e-02 -3.368983277625e-02 -3.476371310077e-02 +-3.577279807928e-02 -3.671556364322e-02 -3.759060650603e-02 -3.839664615800e-02 +-3.913252664218e-02 -3.979721810929e-02 -4.038981814945e-02 -4.090955289950e-02 +-4.135577792453e-02 -4.172797887314e-02 -4.202577190581e-02 -4.224890389672e-02 +-4.239725240919e-02 -4.247082544577e-02 -4.246976097406e-02 -4.239432622988e-02 +-4.224491679979e-02 -4.202205548522e-02 -4.172639095100e-02 -4.135869616127e-02 +-4.091986660623e-02 -4.041091832344e-02 -3.983298571793e-02 -3.918731918528e-02 +-3.847528254272e-02 -3.769835027310e-02 -3.685810458721e-02 -3.595623231012e-02 +-3.499452159744e-02 -3.397485848777e-02 -3.289922329778e-02 -3.176968686672e-02 +-3.058840665721e-02 -2.935762271971e-02 -2.807965352778e-02 -2.675689169205e-02 +-2.539179956041e-02 -2.398690471253e-02 -2.254479535683e-02 -2.106811563803e-02 +-1.955956086377e-02 -1.802187265870e-02 -1.645783405477e-02 -1.487026452621e-02 +-1.326201497800e-02 -1.163596269674e-02 -9.995006272538e-03 -8.342060500900e-03 +-6.680051273433e-03 -5.011910466193e-03 -3.340570834516e-03 -1.668960923089e-03 +8.091661967317e-16 1.663406976591e-03 3.318374350567e-03 4.962040710312e-03 +6.591573773124e-03 + L N + 0 8 +1.000000000000e+00 9.996299309272e-01 9.985202167122e-01 9.966723355824e-01 +9.940887486459e-01 9.907728959881e-01 9.867291912182e-01 9.819630144724e-01 +9.764807038877e-01 9.702895455599e-01 9.633977620041e-01 9.558144991363e-01 +9.475498117999e-01 9.386146478614e-01 9.290208309025e-01 9.187810415390e-01 +9.079087973983e-01 8.964184317905e-01 8.843250711084e-01 8.716446109973e-01 +8.583936913341e-01 8.445896700594e-01 8.302505959068e-01 8.153951800773e-01 +8.000427669069e-01 7.842133035765e-01 7.679273089188e-01 7.512058413721e-01 +7.340704661390e-01 7.165432216036e-01 6.986465850664e-01 6.804034378539e-01 +6.618370298633e-01 6.429709436022e-01 6.238290577842e-01 6.044355105433e-01 +5.848146623272e-01 5.649910585350e-01 5.449893919607e-01 5.248344651060e-01 +5.045511524271e-01 4.841643625768e-01 4.636990007081e-01 4.431799308996e-01 +4.226319387680e-01 4.020796943278e-01 3.815477151625e-01 3.610603299659e-01 +3.406416425154e-01 3.203154961369e-01 3.001054387190e-01 2.800346883341e-01 +2.601260995227e-01 2.404021302968e-01 2.208848099135e-01 2.015957074738e-01 +1.825559013952e-01 1.637859498066e-01 1.453058619150e-01 1.271350703867e-01 +1.092924047870e-01 9.179606612179e-02 7.466360251687e-02 5.791188607578e-02 +4.155709094885e-02 2.561467264739e-02 1.009934863343e-02 -4.974919786851e-03 +-1.959494424000e-02 -3.374832470904e-02 -4.742346358303e-02 -6.060957831404e-02 +-7.329671266529e-02 -8.547574653712e-02 -9.713840435984e-02 -1.082772620449e-01 +-1.188857524890e-01 -1.289581696271e-01 -1.384896710345e-01 -1.474762790796e-01 +-1.559148806314e-01 -1.638032253296e-01 -1.711399224253e-01 -1.779244362065e-01 +-1.841570800207e-01 -1.898390089126e-01 -1.949722108968e-01 -1.995594968850e-01 +-2.036044892942e-01 -2.071116093607e-01 -2.100860631877e-01 -2.125338265592e-01 +-2.144616285503e-01 -2.158769339703e-01 -2.167879246744e-01 -2.172034797827e-01 +-2.171331548467e-01 -2.165871600048e-01 -2.155763371712e-01 -2.141121363025e-01 +-2.122065907892e-01 -2.098722920193e-01 -2.071223631645e-01 -2.039704322375e-01 +-2.004306044739e-01 -1.965174340891e-01 -1.922458954659e-01 -1.876313538246e-01 +-1.826895354318e-01 -1.774364974027e-01 -1.718885971536e-01 -1.660624615594e-01 +-1.599749558740e-01 -1.536431524689e-01 -1.470842994484e-01 -1.403157891963e-01 +-1.333551269115e-01 -1.262198991892e-01 -1.189277427023e-01 -1.114963130395e-01 +-1.039432537543e-01 -9.628616568004e-02 -8.854257656302e-02 -8.072991106736e-02 +-7.286546120295e-02 -6.496635722696e-02 -5.704953906847e-02 -4.913172832448e-02 +-4.122940087421e-02 -3.335876015733e-02 -2.553571116008e-02 -1.777583515208e-02 +-1.009436521454e-02 -2.506162599381e-03 4.974306043343e-03 1.233299053394e-02 +1.955627809359e-02 2.663101330493e-02 3.354451707281e-02 4.028460455706e-02 +4.683960205160e-02 5.319836278592e-02 5.935028162728e-02 6.528530866417e-02 +7.099396165368e-02 7.646733731767e-02 8.169712147485e-02 8.667559799816e-02 +9.139565658907e-02 9.585079936267e-02 1.000351462397e-01 1.039434391438e-01 +1.075710450049e-01 1.109139575712e-01 1.139687980356e-01 1.167328144823e-01 +1.192038801653e-01 1.213804906286e-01 1.232617596819e-01 1.248474142494e-01 +1.261377881068e-01 1.271338145288e-01 1.278370178673e-01 1.282495040846e-01 +1.283739502669e-01 1.282135931456e-01 1.277722166546e-01 1.270541385561e-01 +1.260641961644e-01 1.248077312040e-01 1.232905738353e-01 1.215190258860e-01 +1.194998433250e-01 1.172402180176e-01 1.147477588040e-01 1.120304719395e-01 +1.090967409418e-01 1.059553058858e-01 1.026152421907e-01 9.908593894551e-02 +9.537707681490e-02 9.149860557430e-02 8.746072131841e-02 8.327384339037e-02 +7.894859107811e-02 7.449576012477e-02 6.992629910018e-02 6.525128568020e-02 +6.048190288084e-02 5.562941529364e-02 5.070514536863e-02 4.572044979077e-02 +4.068669599531e-02 3.561523886687e-02 3.051739766654e-02 2.540443323046e-02 +2.028752548256e-02 1.517775130328e-02 1.008606279507e-02 5.023265984552e-03 +-6.934678916587e-15 -4.973283238451e-03 -9.886338779335e-03 -1.472914781650e-02 +-1.949193624796e-02 -2.416519258508e-02 -2.873968518112e-02 -3.320647875028e-02 +-3.755695014953e-02 -4.178280339732e-02 -4.587608390496e-02 -4.982919189811e-02 +-5.363489500755e-02 -5.728634001033e-02 -6.077706370391e-02 -6.410100289807e-02 +-6.725250351099e-02 -7.022632875779e-02 -7.301766642180e-02 -7.562213520068e-02 +-7.803579012129e-02 -8.025512701922e-02 -8.227708608085e-02 -8.409905444744e-02 +-8.571886788288e-02 -8.713481150851e-02 -8.834561961013e-02 -8.935047452444e-02 +-9.014900461357e-02 -9.074128133845e-02 -9.112781544345e-02 -9.130955226611e-02 +-9.128786618804e-02 -9.106455424408e-02 -9.064182890882e-02 -9.002231008092e-02 +-8.920901628720e-02 -8.820535512993e-02 -8.701511300212e-02 -8.564244409680e-02 +-8.409185873785e-02 -8.236821106079e-02 -8.047668607331e-02 -7.842278612627e-02 +-7.621231682701e-02 -7.385137242755e-02 -7.134632072145e-02 -6.870378748338e-02 +-6.593064048684e-02 -6.303397313537e-02 -6.002108774380e-02 -5.689947850612e-02 +-5.367681418722e-02 -5.036092057600e-02 -4.695976273750e-02 -4.348142710220e-02 +-3.993410343019e-02 -3.632606668861e-02 -3.266565888012e-02 -2.896127086028e-02 +-2.522132418162e-02 -2.145425300164e-02 -1.766848609177e-02 -1.387242898393e-02 +-1.007444629062e-02 -6.282844234261e-03 -2.505853420320e-03 1.248388111312e-03 +4.971851523588e-03 8.656633475558e-03 1.229497204005e-02 1.587926221512e-02 +1.940207099964e-02 2.285615200444e-02 2.623445957164e-02 2.953016237590e-02 +3.273665648249e-02 3.584757783858e-02 3.885681417515e-02 4.175851629852e-02 +4.454710875185e-02 4.721729982811e-02 4.976409091801e-02 5.218278517719e-02 +5.446899549908e-02 5.661865178097e-02 5.862800747246e-02 6.049364539718e-02 +6.221248283990e-02 6.378177589308e-02 6.519912305826e-02 6.646246809928e-02 +6.757010214600e-02 6.852066504859e-02 6.931314598432e-02 6.994688331985e-02 +7.042156373406e-02 7.073722060764e-02 7.089423168719e-02 7.089331603329e-02 +7.073553026306e-02 7.042226409951e-02 6.995523524100e-02 6.933648356590e-02 +6.856836468843e-02 6.765354288313e-02 6.659498339669e-02 6.539594416689e-02 +6.405996696958e-02 6.259086801582e-02 6.099272802224e-02 5.926988177845e-02 +5.742690723682e-02 5.546861415013e-02 5.340003228383e-02 5.122639923039e-02 +4.895314785359e-02 4.658589339161e-02 4.413042024804e-02 4.159266850061e-02 +3.897872015785e-02 3.629478519403e-02 3.354718739344e-02 3.074235003493e-02 +2.788678144804e-02 2.498706047190e-02 2.204982184854e-02 1.908174158167e-02 +1.608952229237e-02 1.307987860272e-02 1.005952257821e-02 7.035149259580e-03 +4.013422314209e-03 1.000959836986e-03 -1.995679670088e-03 -4.970011110696e-03 +-7.915636371217e-03 -1.082625763435e-02 -1.369569040251e-02 -1.651787620481e-02 +-1.928689496243e-02 -2.199697698773e-02 -2.464251459379e-02 -2.721807329148e-02 +-2.971840255271e-02 -3.213844611903e-02 -3.447335183621e-02 -3.671848099634e-02 +-3.886941717007e-02 -4.092197451301e-02 -4.287220553130e-02 -4.471640829262e-02 +-4.645113307028e-02 -4.807318840906e-02 -4.957964660305e-02 -5.096784857677e-02 +-5.223540816234e-02 -5.338021576663e-02 -5.440044142386e-02 -5.529453723023e-02 +-5.606123915857e-02 -5.669956825245e-02 -5.720883120029e-02 -5.758862029145e-02 +-5.783881275763e-02 -5.795956950415e-02 -5.795133323679e-02 -5.781482599147e-02 +-5.755104607507e-02 -5.716126442675e-02 -5.664702041079e-02 -5.601011705257e-02 +-5.525261573089e-02 -5.437683034061e-02 -5.338532094088e-02 -5.228088690510e-02 +-5.106655958980e-02 -4.974559454052e-02 -4.832146325383e-02 -4.679784451516e-02 +-4.517861533337e-02 -4.346784149330e-02 -4.166976774856e-02 -3.978880767738e-02 +-3.782953322493e-02 -3.579666395606e-02 -3.369505604309e-02 -3.152969101343e-02 +-2.930566428247e-02 -2.702817349742e-02 -2.470250671805e-02 -2.233403046045e-02 +-1.992817763035e-02 -1.749043537227e-02 -1.502633286118e-02 -1.254142906313e-02 +-1.004130049137e-02 -7.531528984243e-03 -5.017689531210e-03 -2.505338172743e-03 +6.934678916587e-15 2.492842720524e-03 4.967762272207e-03 7.419397039082e-03 +9.842462857887e-03 1.223176414801e-02 1.458220479633e-02 1.688879877472e-02 +1.914668046839e-02 2.135111469448e-02 2.349750639035e-02 2.558140995256e-02 +2.759853820777e-02 2.954477099806e-02 3.141616336386e-02 3.320895330864e-02 +3.491956913071e-02 3.654463630801e-02 3.808098392333e-02 3.952565061802e-02 +4.087589006353e-02 4.212917594121e-02 4.328320642168e-02 4.433590813660e-02 +4.528543963624e-02 4.613019432803e-02 4.686880289176e-02 4.750013516873e-02 +4.802330152312e-02 4.843765367484e-02 4.874278500464e-02 4.893853033288e-02 +4.902496517506e-02 4.900240447776e-02 4.887140084024e-02 4.863274222762e-02 +4.828744918298e-02 4.783677154644e-02 4.728218469065e-02 4.662538528277e-02 +4.586828658428e-02 4.501301330079e-02 4.406189599489e-02 4.301746507603e-02 +4.188244438241e-02 4.065974437023e-02 3.935245492708e-02 3.796383782639e-02 +3.649731884093e-02 3.495647953387e-02 3.334504874655e-02 3.166689380274e-02 +2.992601144951e-02 2.812651855569e-02 2.627264258882e-02 2.436871189244e-02 +2.241914578537e-02 2.042844450541e-02 1.840117901980e-02 1.634198072508e-02 +1.425553105917e-02 1.214655104865e-02 1.001979081395e-02 7.880019055662e-03 +5.732012544663e-03 3.580545638877e-03 1.430379849364e-03 -7.137465218882e-04 +-2.847128650263e-03 -4.965105340994e-03 -7.063069044287e-03 -9.136475711889e-03 +-1.118085447437e-02 -1.319181711884e-02 -1.516506734732e-02 -1.709640979658e-02 +-1.898175880078e-02 -2.081714687901e-02 -2.259873293032e-02 -2.432281011960e-02 +-2.598581343858e-02 -2.758432692661e-02 -2.911509053710e-02 -3.057500663591e-02 +-3.196114611930e-02 -3.327075413933e-02 -3.450125542618e-02 -3.565025919711e-02 +-3.671556364322e-02 -3.769515998589e-02 -3.858723609571e-02 -3.939017966780e-02 +-4.010258094844e-02 -4.072323500860e-02 -4.125114356152e-02 -4.168551632193e-02 +-4.202577190581e-02 -4.227153827056e-02 -4.242265269635e-02 -4.247916131053e-02 +-4.244131815784e-02 -4.230958382026e-02 -4.208462359120e-02 -4.176730520968e-02 +-4.135869616127e-02 -4.086006055318e-02 -4.027285557191e-02 -3.959872753301e-02 +-3.883950753273e-02 -3.799720671295e-02 -3.707401115077e-02 -3.607227638571e-02 +-3.499452159744e-02 -3.384342344832e-02 -3.262180960529e-02 -3.133265195645e-02 +-2.997905953825e-02 -2.856427118983e-02 -2.709164795150e-02 -2.556466522485e-02 +-2.398690471252e-02 -2.236204615601e-02 -2.069385889020e-02 -1.898619323381e-02 +-1.724297173504e-02 -1.546818029213e-02 -1.366585916849e-02 -1.184009392259e-02 +-9.995006272532e-03 -8.134744915488e-03 -6.263476322280e-03 -4.385375527155e-03 +-2.504616932925e-03 -6.253651514349e-04 1.248234100769e-03 3.112063031934e-03 +4.962040710318e-03 6.794131885993e-03 8.604355680390e-03 1.038879412511e-02 +1.214360053190e-02 1.386500767619e-02 1.554933577689e-02 1.719300025595e-02 +1.879251926127e-02 2.034452093773e-02 2.184575043101e-02 2.329307661011e-02 +2.468349849486e-02 2.601415137530e-02 2.728231261083e-02 2.848540709748e-02 +2.962101239264e-02 3.068686348716e-02 3.168085721567e-02 3.260105629685e-02 +3.344569299603e-02 3.421317240339e-02 3.490207532212e-02 3.551116076145e-02 +3.603936803051e-02 3.648581842983e-02 3.684981653827e-02 3.713085109377e-02 +3.732859546769e-02 3.744290773277e-02 3.747383032626e-02 3.742158931018e-02 +3.728659323173e-02 3.706943158782e-02 3.677087289823e-02 3.639186239318e-02 +3.593351932149e-02 3.539713388664e-02 3.478416381862e-02 3.409623059028e-02 +3.333511528778e-02 3.250275414519e-02 3.160123375423e-02 3.063278596070e-02 +2.959978245979e-02 2.850472910318e-02 2.735025993118e-02 2.613913094414e-02 +2.487421362735e-02 2.355848824458e-02 2.219503691575e-02 2.078703649437e-02 +1.933775126122e-02 1.785052545076e-02 1.632877562718e-02 1.477598292730e-02 +1.319568518766e-02 1.159146897353e-02 9.966961527450e-03 8.325822655355e-03 +6.671736568086e-03 5.008403696387e-03 3.339532497358e-03 1.668831270322e-03 +-6.871853145102e-15 -1.663277755294e-03 -3.317342912672e-03 -4.958568833750e-03 +-6.583369196337e-03 + L N + 0 9 +1.000000000000e+00 9.995431365007e-01 9.981732973708e-01 9.958927352436e-01 +9.927051996072e-01 9.886159294654e-01 9.836316430835e-01 9.777605248430e-01 +9.710122092318e-01 9.633977620041e-01 9.549296585514e-01 9.456217595285e-01 +9.354892837886e-01 9.245487786841e-01 9.128180877951e-01 9.003163161571e-01 +8.870637930592e-01 8.730820324926e-01 8.583936913341e-01 8.430225253529e-01 +8.269933431327e-01 8.103319580098e-01 7.930651381253e-01 7.752205547002e-01 +7.568267286407e-01 7.379129755873e-01 7.185093495243e-01 6.986465850664e-01 +6.783560385471e-01 6.576696280293e-01 6.366197723676e-01 6.152393294468e-01 +5.935615337287e-01 5.716199332362e-01 5.494483261068e-01 5.270806968481e-01 +5.045511524271e-01 4.818938583271e-01 4.591429747041e-01 4.363325927745e-01 +4.134966715663e-01 3.906689751635e-01 3.678830105718e-01 3.451719663343e-01 +3.225686520215e-01 3.001054387190e-01 2.778142006333e-01 2.557262579339e-01 +2.338723209472e-01 2.122824358125e-01 1.909859317103e-01 1.700113697654e-01 +1.493864937280e-01 1.291381825264e-01 1.092924047871e-01 8.987417540594e-02 +7.090751425766e-02 5.241540711808e-02 3.441976887486e-02 1.694140909323e-02 +1.028487619225e-15 -1.638595305739e-02 -3.219913862486e-02 -4.742346358303e-02 +-6.204407497545e-02 -7.604737918964e-02 -8.942105846213e-02 -1.021540846851e-01 +-1.142367304979e-01 -1.256605776527e-01 -1.364185226502e-01 -1.465047796453e-01 +-1.559148806314e-01 -1.646456729163e-01 -1.726953139072e-01 -1.800632632314e-01 +-1.867502722230e-01 -1.927583708100e-01 -1.980908518463e-01 -2.027522529330e-01 +-2.067483357832e-01 -2.100860631877e-01 -2.127735736434e-01 -2.148201537121e-01 +-2.162362081830e-01 -2.170332281139e-01 -2.172237568329e-01 -2.168213539861e-01 +-2.158405577195e-01 -2.142968450882e-01 -2.122065907892e-01 -2.095870243170e-01 +-2.064561856448e-01 -2.028328795354e-01 -1.987366285918e-01 -1.941876251546e-01 +-1.892066821602e-01 -1.838151830732e-01 -1.780350310077e-01 -1.718885971536e-01 +-1.653986686265e-01 -1.585883958585e-01 -1.514812396472e-01 -1.441009179842e-01 +-1.364713527783e-01 -1.286166165939e-01 -1.205608795201e-01 -1.123283562887e-01 +-1.039432537543e-01 -9.542971885150e-02 -8.681178714103e-02 -7.811333205439e-02 +-6.935801494513e-02 -6.056923605222e-02 -5.177008647808e-02 -4.298330128110e-02 +-3.423121377956e-02 -2.553571116009e-02 -1.691819148086e-02 -8.399522155469e-03 +-1.028487619225e-15 8.260687078517e-03 1.636349667821e-02 2.429006671326e-02 +3.202274837443e-02 3.954463717861e-02 4.683960205159e-02 5.389231239292e-02 +6.068826307698e-02 6.721379734912e-02 7.345612758087e-02 7.940335385353e-02 +8.504448034442e-02 9.036942949543e-02 9.536905394874e-02 1.000351462397e-01 +1.043604462423e-01 1.083386463677e-01 1.119643945218e-01 1.152332948324e-01 +1.181419061618e-01 1.206877384270e-01 1.228692467518e-01 1.246858234832e-01 +1.261377881068e-01 1.272263751013e-01 1.279537197783e-01 1.283228421551e-01 +1.283376289143e-01 1.280028135091e-01 1.273239544735e-01 1.263074120056e-01 +1.249603228902e-01 1.232905738353e-01 1.213067732963e-01 1.190182218689e-01 +1.164348813293e-01 1.135673424083e-01 1.104267913845e-01 1.070249755862e-01 +1.033741678916e-01 9.948713032114e-02 9.537707681491e-02 9.105763529064e-02 +8.654280907895e-02 8.184693783246e-02 7.698465800681e-02 7.197086301133e-02 +6.682066312776e-02 6.154934529475e-02 5.617233285596e-02 5.070514536864e-02 +4.516335856892e-02 3.956256458902e-02 3.391833252012e-02 2.824616941330e-02 +2.256148180926e-02 1.687953788548e-02 1.121543030754e-02 5.584039868720e-03 +9.813682906107e-16 -5.522337770721e-03 -1.096893733374e-02 -1.632611041383e-02 +-2.158054781755e-02 -2.671934944501e-02 -3.173005300269e-02 -3.660066135776e-02 +-4.131966847795e-02 -4.587608390496e-02 -5.025945571323e-02 -5.445989191001e-02 +-5.846808023679e-02 -6.227530633623e-02 -6.587347025325e-02 -6.925510124285e-02 +-7.241337086197e-02 -7.534210432677e-02 -7.803579012128e-02 -8.048958784776e-02 +-8.269933431327e-02 -8.466154785177e-02 -8.637343088493e-02 -8.783287072958e-02 +-8.903843866361e-02 -8.998938726675e-02 -9.068564605646e-02 -9.112781544345e-02 +-9.131715903518e-02 -9.125559431986e-02 -9.094568176680e-02 -9.039061238318e-02 +-8.959419377037e-02 -8.856083472673e-02 -8.729552844688e-02 -8.580383437062e-02 +-8.409185873785e-02 -8.216623390832e-02 -8.003409650806e-02 -7.770306446669e-02 +-7.518121301206e-02 -7.247704969097e-02 -6.959948848655e-02 -6.655782310482e-02 +-6.336169950423e-02 -6.002108774381e-02 -5.654625322624e-02 -5.294772741363e-02 +-4.923627809414e-02 -4.542287927866e-02 -4.151868080658e-02 -3.753497774042e-02 +-3.348317962868e-02 -2.937477971631e-02 -2.522132418163e-02 -2.103438147799e-02 +-1.682551185775e-02 -1.260623715498e-02 -8.388010902277e-03 -4.182188855652e-03 +-1.028487619225e-15 4.147481894193e-03 8.249366093973e-03 1.229497204004e-02 +1.627385573126e-02 2.017583529521e-02 2.399101568496e-02 2.770981244494e-02 +3.132297449135e-02 3.482160585557e-02 3.819718634205e-02 4.144159105503e-02 +4.454710875184e-02 4.750645898377e-02 5.031280798870e-02 5.295978330336e-02 +5.544148706620e-02 5.775250798589e-02 5.988793195354e-02 6.184335128071e-02 +6.361487254867e-02 6.519912305826e-02 6.659325587311e-02 6.779495345287e-02 +6.880242987642e-02 6.961443165918e-02 7.023023717155e-02 7.064965466964e-02 +7.087301895268e-02 7.090118666487e-02 7.073553026306e-02 7.037793067472e-02 +6.983076867396e-02 6.909691500657e-02 6.817971929793e-02 6.708299778067e-02 +6.581101988180e-02 6.436849371157e-02 6.276055049912e-02 6.099272802224e-02 +5.907095308091e-02 5.700152306656e-02 5.479108668090e-02 5.244662385998e-02 +4.997542496108e-02 4.738506927143e-02 4.468340289906e-02 4.187851610764e-02 +3.897872015786e-02 3.599252371908e-02 3.292860891557e-02 2.979580707229e-02 +2.660307422553e-02 2.335946646383e-02 2.007411516497e-02 1.675620219433e-02 +1.341493512983e-02 1.005952257822e-02 6.699149646785e-03 3.342953633782e-03 +9.436728277193e-16 -3.320741317277e-03 -6.610419187885e-03 -9.860324111322e-03 +-1.306191052115e-02 -1.620681851582e-02 -1.928689496242e-02 -2.229421392150e-02 +-2.522109634368e-02 -2.806012899041e-02 -3.080418253391e-02 -3.344642879361e-02 +-3.598035706879e-02 -3.839978953001e-02 -4.069889563417e-02 -4.287220553129e-02 +-4.491462243338e-02 -4.682143391916e-02 -4.858832215099e-02 -5.021137298340e-02 +-5.168708394579e-02 -5.301237108475e-02 -5.418457465452e-02 -5.520146364738e-02 +-5.606123915857e-02 -5.676253658364e-02 -5.730442664918e-02 -5.768641528071e-02 +-5.790844231499e-02 -5.797087906641e-02 -5.787452476069e-02 -5.762060185151e-02 +-5.721075023891e-02 -5.664702041079e-02 -5.593186553183e-02 -5.506813250652e-02 +-5.405905204576e-02 -5.290822776886e-02 -5.161962437502e-02 -5.019755492096e-02 +-4.864666724310e-02 -4.697192956512e-02 -4.517861533338e-02 -4.327228732471e-02 +-4.125878107252e-02 -3.914418765901e-02 -3.693483592234e-02 -3.463727412937e-02 +-3.225825116513e-02 -2.980469729173e-02 -2.728370453004e-02 -2.470250671806e-02 +-2.206845930072e-02 -1.938901890624e-02 -1.667172276413e-02 -1.392416802064e-02 +-1.115399100682e-02 -8.368846514653e-03 -5.576387136151e-03 -2.784242720059e-03 +-9.813682906107e-16 2.768817552632e-03 5.514769598733e-03 8.230518473086e-03 +1.090884834733e-02 1.354268396528e-02 1.612510890301e-02 1.864938330763e-02 +2.110896107025e-02 2.349750639034e-02 2.580890969058e-02 2.803730284316e-02 +3.017707367060e-02 3.222287968604e-02 3.416966104046e-02 3.601265264628e-02 +3.774739544933e-02 3.936974682327e-02 4.087589006353e-02 4.226234295964e-02 +4.352596542804e-02 4.466396618951e-02 4.567390847842e-02 4.655371477312e-02 +4.730167054004e-02 4.791642698619e-02 4.839700281770e-02 4.874278500463e-02 +4.895352855494e-02 4.902935530296e-02 4.897075172058e-02 4.877856576176e-02 +4.845400275336e-02 4.799862034808e-02 4.741432255744e-02 4.670335288527e-02 +4.586828658428e-02 4.491202206072e-02 4.383777145416e-02 4.264905042157e-02 +4.134966715663e-02 3.994371067757e-02 3.843553841795e-02 3.682976315726e-02 +3.513123932908e-02 3.334504874656e-02 3.147648578604e-02 2.953104207099e-02 +2.751439069967e-02 2.543237006067e-02 2.329096728174e-02 2.109630135776e-02 +1.885460600450e-02 1.657221228548e-02 1.425553105918e-02 1.191103529476e-02 +9.545242303916e-03 7.164695937005e-03 4.775948791249e-03 2.385544478523e-03 +1.008293621247e-15 -2.374211725654e-03 -4.730679134458e-03 -7.063069044280e-03 +-9.365143392520e-03 -1.163077564077e-02 -1.385396680399e-02 -1.602886106300e-02 +-1.814976092022e-02 -2.021114186023e-02 -2.220766647794e-02 -2.413419803901e-02 +-2.598581343857e-02 -2.775781552631e-02 -2.944574476758e-02 -3.104539021231e-02 +-3.255279974529e-02 -3.396428959353e-02 -3.527645306853e-02 -3.648616852324e-02 +-3.759060650603e-02 -3.858723609570e-02 -3.947383040443e-02 -4.024847123726e-02 +-4.090955289949e-02 -4.145578514536e-02 -4.188619526375e-02 -4.220012929931e-02 +-4.239725240919e-02 -4.247754835824e-02 -4.244131815784e-02 -4.228917785554e-02 +-4.202205548522e-02 -4.164118718939e-02 -4.114811252782e-02 -4.054466898832e-02 +-3.983298571793e-02 -3.901547649476e-02 -3.809483196235e-02 -3.707401115077e-02 +-3.595623231012e-02 -3.474496308396e-02 -3.344391005198e-02 -3.205700767251e-02 +-3.058840665721e-02 -2.904246181152e-02 -2.742371937582e-02 -2.573690390341e-02 +-2.398690471253e-02 -2.217876195056e-02 -2.031765230960e-02 -1.840887443320e-02 +-1.645783405478e-02 -1.447002890888e-02 -1.245103345675e-02 -1.040648346806e-02 +-8.342060500902e-03 -6.263476322287e-03 -4.176457311176e-03 -2.086728886224e-03 +-1.028487619225e-15 2.078052258836e-03 4.141797914401e-03 6.185669163003e-03 +8.204175203364e-03 1.019191679861e-02 1.214360053189e-02 1.405405271848e-02 +1.591823293822e-02 1.773124715345e-02 1.948836037860e-02 2.118500886927e-02 +2.281681179972e-02 2.437958239938e-02 2.586933852051e-02 2.728231261082e-02 +2.861496106642e-02 2.986397294240e-02 3.102627800003e-02 3.209905407155e-02 +3.307973372531e-02 3.396601021598e-02 3.475584270669e-02 3.544746075170e-02 +3.603936803051e-02 3.653034532611e-02 3.691945274235e-02 3.720603115738e-02 +3.738970291204e-02 3.747037173448e-02 3.744822190398e-02 3.732371665920e-02 +3.709759585804e-02 3.677087289823e-02 3.634483090979e-02 3.582101823240e-02 +3.520124319259e-02 3.448756819749e-02 3.368230316362e-02 3.278799830097e-02 +3.180743627433e-02 3.074362376527e-02 2.959978245980e-02 2.837933948829e-02 +2.708591734532e-02 2.572332331878e-02 2.429553845842e-02 2.280670611555e-02 +2.126112008611e-02 1.966321239095e-02 1.801754072739e-02 1.632877562719e-02 +1.460168735687e-02 1.284113259644e-02 1.105204093352e-02 9.239401209958e-03 +7.408247758264e-03 5.563646565607e-03 3.710681402866e-03 1.854439956403e-03 +9.185425191250e-16 -1.847584355823e-03 -3.683296300260e-03 -5.502169807974e-03 +-7.299302938287e-03 -9.069870912525e-03 -1.080913893498e-02 -1.251247472377e-02 +-1.417536071871e-02 -1.579340593449e-02 -1.736235742821e-02 -1.887811135175e-02 +-2.033672356062e-02 -2.173441975207e-02 -2.306760510673e-02 -2.433287340965e-02 +-2.552701562760e-02 -2.664702792168e-02 -2.769011907529e-02 -2.865371731968e-02 +-2.953547654045e-02 -3.033328185063e-02 -3.104525451736e-02 -3.166975623109e-02 +-3.220539270811e-02 -3.265101661891e-02 -3.300572983680e-02 -3.326888500316e-02 +-3.344008640725e-02 -3.351919018076e-02 -3.350630380882e-02 -3.340178496121e-02 +-3.320623964916e-02 -3.292051971517e-02 -3.254571966486e-02 -3.208317285162e-02 +-3.153444702669e-02 -3.090133926881e-02 -3.018587030927e-02 -2.939027826978e-02 +-2.851701183216e-02 -2.756872286008e-02 -2.654825849487e-02 -2.545865274850e-02 +-2.430311761806e-02 -2.308503374762e-02 -2.180794066405e-02 -2.047552661481e-02 +-1.909161803650e-02 -1.766016868389e-02 -1.618524845002e-02 -1.467103190869e-02 +-1.312178661124e-02 -1.154186117015e-02 -9.935673162460e-03 -8.307696886265e-03 +-6.662451004076e-03 -5.004486106753e-03 -3.338372232010e-03 -1.668686371455e-03 +-9.436728277193e-16 1.663133338602e-03 3.316190356713e-03 4.954690225091e-03 +6.574206619914e-03 + L N + 0 10 +1.000000000000e+00 9.994472110789e-01 9.977899443184e-01 9.950314971204e-01 +9.911773564758e-01 9.862351859690e-01 9.802148076310e-01 9.731281786890e-01 +9.649893632704e-01 9.558144991363e-01 9.456217595285e-01 9.344313102292e-01 +9.222652619442e-01 9.091476181311e-01 8.951042184077e-01 8.801626776859e-01 +8.643523211873e-01 8.477041155076e-01 8.302505959068e-01 8.120257900115e-01 +7.930651381253e-01 7.734054103500e-01 7.530846207322e-01 7.321419386517e-01 +7.106175976801e-01 6.885528021412e-01 6.659896316114e-01 6.429709436022e-01 +6.195402746735e-01 5.957417402274e-01 5.716199332362e-01 5.472198221610e-01 +5.225866483191e-01 4.977658229563e-01 4.728028242863e-01 4.477430947521e-01 +4.226319387680e-01 3.975144211975e-01 3.724352668186e-01 3.474387610269e-01 +3.225686520215e-01 2.978680547147e-01 2.733793566015e-01 2.491441258191e-01 +2.252030216196e-01 2.015957074738e-01 1.783607670137e-01 1.555356230162e-01 +1.331564596210e-01 1.112581479646e-01 8.987417540594e-02 6.903657850743e-02 +4.877587992491e-02 2.912102934951e-02 1.009934863344e-02 -8.263518780022e-03 +-2.594365401352e-02 -4.291890440307e-02 -5.916892055123e-02 -7.467518871405e-02 +-8.942105846214e-02 -1.033917655690e-01 -1.165744500923e-01 -1.289581696271e-01 +-1.405339077219e-01 -1.512945774624e-01 -1.612350202393e-01 -1.703519997303e-01 +-1.786441911383e-01 -1.861121657396e-01 -1.927583708100e-01 -1.985871050064e-01 +-2.036044892942e-01 -2.078184335230e-01 -2.112385987623e-01 -2.138763555209e-01 +-2.157447379844e-01 -2.168583944138e-01 -2.172335338584e-01 -2.168878693459e-01 +-2.158405577195e-01 -2.141121363025e-01 -2.117244565748e-01 -2.087006150560e-01 +-2.050648815952e-01 -2.008426252725e-01 -1.960602381230e-01 -1.907450569001e-01 +-1.849252830975e-01 -1.786299014517e-01 -1.718885971536e-01 -1.647316719951e-01 +-1.571899596821e-01 -1.492947405431e-01 -1.410776558659e-01 -1.325706220924e-01 +-1.238057450998e-01 -1.148152347989e-01 -1.056313202729e-01 -9.628616568005e-02 +-8.681178714103e-02 -7.723997082428e-02 -6.760219244175e-02 -5.792953835984e-02 +-4.825262852564e-02 -3.860154140213e-02 -2.900574109914e-02 -1.949400687983e-02 +-1.009436521454e-02 -8.340245460715e-04 8.260687078522e-03 1.716438136307e-02 +2.585266596732e-02 3.430219743426e-02 4.249073072232e-02 5.039716523482e-02 +5.800158724985e-02 6.528530866417e-02 7.223090197555e-02 7.882223143918e-02 +8.504448034442e-02 9.088417436983e-02 9.632920098520e-02 1.013688248810e-01 +1.059936994162e-01 1.101958740880e-01 1.139687980356e-01 1.173073196045e-01 +1.202076820060e-01 1.226675151177e-01 1.246858234832e-01 1.262629705772e-01 +1.274006594126e-01 1.281019095783e-01 1.283710308022e-01 1.282135931456e-01 +1.276363939434e-01 1.266474216127e-01 1.252558164592e-01 1.234718286214e-01 +1.213067732963e-01 1.187729833992e-01 1.158837598151e-01 1.126533194059e-01 +1.090967409418e-01 1.052299091315e-01 1.010694569264e-01 9.663270628380e-02 +9.193760756917e-02 8.700267778782e-02 8.184693783246e-02 7.648984893776e-02 +7.095124853243e-02 6.525128568020e-02 5.941035630050e-02 5.344903835888e-02 +4.738802721590e-02 4.124807132124e-02 3.504990843726e-02 2.881420257339e-02 +2.256148180925e-02 1.631207718022e-02 1.008606279507e-02 3.903197350047e-03 +-2.217132801385e-03 -8.255968869827e-03 -1.419483299505e-02 -2.001577961440e-02 +-2.570144470082e-02 -3.123509274427e-02 -3.660066135776e-02 -4.178280339732e-02 +-4.676692649316e-02 -5.153922989805e-02 -5.608673856737e-02 -6.039733439403e-02 +-6.445978453086e-02 -6.826376674180e-02 -7.179989173278e-02 -7.505972242229e-02 +-7.803579012129e-02 -8.072160760124e-02 -8.311167903879e-02 -8.520150683466e-02 +-8.698759531398e-02 -8.846745132433e-02 -8.963958175685e-02 -9.050348802510e-02 +-9.105965754475e-02 -9.130955226611e-02 -9.125559431986e-02 -9.090114884454e-02 +-9.025050407227e-02 -8.930884875676e-02 -8.808224703522e-02 -8.657761082247e-02 +-8.480266984256e-02 -8.276593940935e-02 -8.047668607331e-02 -7.794489125769e-02 +-7.518121301206e-02 -7.219694601593e-02 -6.900397996969e-02 -6.561475651370e-02 +-6.204222481980e-02 -5.829979600261e-02 -5.440129650023e-02 -5.036092057600e-02 +-4.619318209477e-02 -4.191286572765e-02 -3.753497774042e-02 -3.307469652025e-02 +-2.854732299567e-02 -2.396823110323e-02 -1.935281845357e-02 -1.471645734749e-02 +-1.007444629063e-02 -5.441962152592e-03 -8.340131134693e-04 3.734607462995e-03 +8.249366093978e-03 1.269603304869e-02 1.706072489944e-02 2.132994563090e-02 +2.549062619148e-02 2.953016237590e-02 3.343645093440e-02 3.719792381012e-02 +4.080358041244e-02 4.424301784129e-02 4.750645898377e-02 5.058477841218e-02 +5.346952601928e-02 5.615294833457e-02 5.862800747246e-02 6.088839767150e-02 +6.292855939077e-02 6.474369093825e-02 6.632975761306e-02 6.768349835174e-02 +6.880242987642e-02 6.968484835051e-02 7.032982855517e-02 7.073722060764e-02 +7.090764424978e-02 7.084248074266e-02 7.054386241019e-02 7.001465988192e-02 +6.925846709169e-02 6.827958409586e-02 6.708299778067e-02 6.567436053492e-02 +6.405996696958e-02 6.224672877171e-02 6.024214778529e-02 5.805428741631e-02 +5.569174246433e-02 5.316360748664e-02 5.047944380534e-02 4.764924527090e-02 +4.468340289906e-02 4.159266850062e-02 3.838811742612e-02 3.508111054918e-02 +3.168325561403e-02 2.820636807394e-02 2.466243154773e-02 2.106355802239e-02 +1.742194792929e-02 1.374985022146e-02 1.005952257821e-02 6.363191862465e-03 +2.673014954357e-03 -9.989599172428e-04 -4.640831226017e-03 -8.240881465704e-03 +-1.178761362031e-02 -1.526978667692e-02 -1.867645007470e-02 -2.199697698773e-02 +-2.522109634369e-02 -2.833892348486e-02 -3.134098938305e-02 -3.421826832488e-02 +-3.696220398950e-02 -3.956473384618e-02 -4.201831180501e-02 -4.431592906008e-02 +-4.645113307028e-02 -4.841804462941e-02 -5.021137298340e-02 -5.182642895904e-02 +-5.325913607509e-02 -5.450603961314e-02 -5.556431363235e-02 -5.643176591865e-02 +-5.710684086569e-02 -5.758862029145e-02 -5.787682220067e-02 -5.797179751029e-02 +-5.787452476069e-02 -5.758660284245e-02 -5.711024177417e-02 -5.644825157280e-02 +-5.560402926396e-02 -5.458154408524e-02 -5.338532094088e-02 -5.202042217149e-02 +-5.049242770755e-02 -4.880741367987e-02 -4.697192956511e-02 -4.499297394823e-02 +-4.287796898795e-02 -4.063473367489e-02 -3.827145597526e-02 -3.579666395606e-02 +-3.321919599056e-02 -3.054817014492e-02 -2.779295284911e-02 -2.496312695688e-02 +-2.206845930072e-02 -1.911886784914e-02 -1.612438857380e-02 -1.309514213469e-02 +-1.004130049137e-02 -6.973053547895e-03 -3.900575938423e-03 -8.339940593414e-04 +2.216646547523e-03 5.241413357844e-03 8.230518473092e-03 1.117434957576e-02 +1.406350013570e-02 1.688879877471e-02 1.964133769970e-02 2.231250011820e-02 +2.489398655389e-02 2.737783998349e-02 2.975646972084e-02 3.202267397836e-02 +3.416966104046e-02 3.619106898875e-02 3.808098392333e-02 3.983395662993e-02 +4.144501764788e-02 4.290969069902e-02 4.422400444354e-02 4.538450253385e-02 +4.638825194349e-02 4.723284955377e-02 4.791642698619e-02 4.843765367484e-02 +4.879573817824e-02 4.899042773607e-02 4.902200608166e-02 4.889128952662e-02 +4.859962133973e-02 4.814886444721e-02 4.754139248701e-02 4.678007925480e-02 +4.586828658428e-02 4.480985070932e-02 4.360906715996e-02 4.227067424894e-02 +4.079983520939e-02 3.920211904877e-02 3.748348018731e-02 3.565023695355e-02 +3.370904901215e-02 3.166689380274e-02 2.953104207099e-02 2.730903257588e-02 +2.500864605923e-02 2.263787856540e-02 2.020491420100e-02 1.771809742553e-02 +1.518590496513e-02 1.261691744214e-02 1.001979081395e-02 7.403227714403e-03 +4.775948791243e-03 2.146664132266e-03 -4.759551275889e-04 -3.083304927193e-03 +-5.666876038484e-03 -8.218281375879e-03 -1.072928276960e-02 -1.319181711884e-02 +-1.559802184300e-02 -1.794025955212e-02 -2.021114186023e-02 -2.240355226875e-02 +-2.451066805029e-02 -2.652598106675e-02 -2.844331745951e-02 -3.025685615326e-02 +-3.196114611930e-02 -3.355112234832e-02 -3.502212048713e-02 -3.636989009825e-02 +-3.759060650603e-02 -3.868088119771e-02 -3.963777075253e-02 -4.045878427703e-02 +-4.114188932956e-02 -4.168551632193e-02 -4.208856139122e-02 -4.235038773969e-02 +-4.247082544577e-02 -4.245016975381e-02 -4.228917785554e-02 -4.198906418077e-02 +-4.155149421945e-02 -4.097857690240e-02 -4.027285557191e-02 -3.943729757831e-02 +-3.847528254272e-02 -3.739058933031e-02 -3.618738178244e-02 -3.487019325972e-02 +-3.344391005198e-02 -3.191375371399e-02 -3.028526238965e-02 -2.856427118983e-02 +-2.675689169205e-02 -2.486949063283e-02 -2.290866786554e-02 -2.088123365893e-02 +-1.879418541313e-02 -1.665468387165e-02 -1.447002890888e-02 -1.224763497396e-02 +-9.995006272534e-03 -7.719711768134e-03 -5.429360085660e-03 -3.131574398894e-03 +-8.339673840012e-04 1.455883679772e-03 3.730461581743e-03 5.982333544460e-03 +8.204175203370e-03 1.038879412511e-02 1.252915278979e-02 1.461839096487e-02 +1.664984740019e-02 1.861708077669e-02 2.051388984368e-02 2.233433268249e-02 +2.407274503779e-02 2.572375766059e-02 2.728231261082e-02 2.874367847092e-02 +3.010346442531e-02 3.135763316495e-02 3.250251257987e-02 3.353480620673e-02 +3.445160240269e-02 3.525038222110e-02 3.592902596889e-02 3.648581842983e-02 +3.691945274236e-02 3.722903292488e-02 3.741407504625e-02 3.747450704307e-02 +3.741066719032e-02 3.722330123580e-02 3.691355821350e-02 3.648298495484e-02 +3.593351932149e-02 3.526748218680e-02 3.448756819749e-02 3.359683535071e-02 +3.259869342535e-02 3.149689131030e-02 3.029550327527e-02 2.899891423368e-02 +2.761180404960e-02 2.613913094415e-02 2.458611405898e-02 2.295821523747e-02 +2.126112008610e-02 1.950071838100e-02 1.768308388613e-02 1.581445365156e-02 +1.390120686153e-02 1.194984330310e-02 9.966961527452e-03 7.959236776322e-03 +5.933398746592e-03 3.896209266459e-03 1.854439956398e-03 -1.851500519846e-04 +-2.215836266612e-03 -4.230950783254e-03 -6.223903960550e-03 -8.188205751972e-03 +-1.011748662635e-02 -1.200551801019e-02 -1.384623218687e-02 -1.563374158969e-02 +-1.736235742821e-02 -1.902660758947e-02 -2.062125375845e-02 -2.214130770477e-02 +-2.358204668567e-02 -2.493902791837e-02 -2.620810207787e-02 -2.738542578009e-02 +-2.846747301330e-02 -2.945104548440e-02 -3.033328185063e-02 -3.111166581057e-02 +-3.178403303238e-02 -3.234857690119e-02 -3.280385307116e-02 -3.314878281197e-02 +-3.338265514341e-02 -3.350512775560e-02 -3.351622671647e-02 -3.341634497207e-02 +-3.320623964916e-02 -3.288702817337e-02 -3.246018322023e-02 -3.192752651982e-02 +-3.129122153972e-02 -3.055376507441e-02 -2.971797777264e-02 -2.878699363791e-02 +-2.776424854012e-02 -2.665346777968e-02 -2.545865274849e-02 -2.418406673453e-02 +-2.283421991993e-02 -2.141385362464e-02 -1.992792384979e-02 -1.838158417767e-02 +-1.678016808619e-02 -1.512917073837e-02 -1.343423030803e-02 -1.170110890483e-02 +-9.935673162455e-03 -8.143874554762e-03 -6.331729505477e-03 -4.505299357224e-03 +-2.670670266093e-03 -8.339330878873e-04 9.988366780369e-04 2.821598821804e-03 +4.628368168062e-03 6.413234069001e-03 8.170379582363e-03 9.894100272720e-03 +1.157882257575e-02 1.321912166684e-02 1.480973877731e-02 1.634559790329e-02 +1.782182185480e-02 1.923374759465e-02 2.057694081947e-02 2.184720973758e-02 +2.304061800154e-02 2.415349675588e-02 2.518245576354e-02 2.612439357781e-02 +2.697650672987e-02 2.773629790500e-02 2.840158308434e-02 2.897049763238e-02 +2.944150131375e-02 2.981338222670e-02 3.008525964401e-02 3.025658575586e-02 +3.032714631269e-02 3.029706016974e-02 3.016677773849e-02 2.993707835397e-02 +2.960906657000e-02 2.918416739859e-02 2.866412051230e-02 2.805097343238e-02 +2.734707372846e-02 2.655506025855e-02 2.567785348165e-02 2.471864487758e-02 +2.368088551198e-02 2.256827378681e-02 2.138474241929e-02 2.013444469455e-02 +1.882174003967e-02 1.745117896862e-02 1.602748744963e-02 1.455555074826e-02 +1.304039680095e-02 1.148717917508e-02 9.901159673036e-03 8.287690638390e-03 +6.652197023323e-03 5.000158276982e-03 3.337090114773e-03 1.668526228842e-03 +-4.381668020759e-15 -1.662973728921e-03 -3.314916758537e-03 -4.950405458315e-03 +-6.564088453486e-03 + L N + 0 11 +1.000000000000e+00 9.993421562398e-01 9.973701827725e-01 9.940887486459e-01 +9.895056209813e-01 9.836316430835e-01 9.764807038877e-01 9.680696988392e-01 +9.584184823246e-01 9.475498117999e-01 9.354892837886e-01 9.222652619442e-01 +9.079087973984e-01 8.924535416387e-01 8.759356521824e-01 8.583936913341e-01 +8.398685183386e-01 8.204031752555e-01 8.000427669069e-01 7.788343352617e-01 +7.568267286407e-01 7.340704661390e-01 7.106175976801e-01 6.865215601232e-01 +6.618370298633e-01 6.366197723676e-01 6.109264891046e-01 5.848146623272e-01 +5.583423981772e-01 5.315682685834e-01 5.045511524271e-01 4.773500764507e-01 +4.500240563851e-01 4.226319387680e-01 3.952322439240e-01 3.678830105718e-01 +3.406416425154e-01 3.135647578731e-01 2.867080412837e-01 2.601260995227e-01 +2.338723209472e-01 2.079987391756e-01 1.825559013952e-01 1.575927416715e-01 +1.331564596210e-01 1.092924047871e-01 8.604396704186e-02 6.345247331782e-02 +4.155709094886e-02 2.039473788245e-02 2.017993520125e-15 -1.959494423999e-02 +-3.836039164509e-02 -5.626917445165e-02 -7.329671266528e-02 -8.942105846213e-02 +-1.046229325594e-01 -1.188857524890e-01 -1.321956527344e-01 -1.445414967152e-01 +-1.559148806314e-01 -1.663101292031e-01 -1.757242833674e-01 -1.841570800207e-01 +-1.916109239149e-01 -1.980908518463e-01 -2.036044892942e-01 -2.081619996917e-01 +-2.117760265342e-01 -2.144616285503e-01 -2.162362081830e-01 -2.171194336468e-01 +-2.171331548467e-01 -2.163013134635e-01 -2.146498475232e-01 -2.122065907892e-01 +-2.090011673253e-01 -2.050648815952e-01 -2.004306044739e-01 -1.951326555559e-01 +-1.892066821602e-01 -1.826895354318e-01 -1.756191439552e-01 -1.680343852933e-01 +-1.599749558740e-01 -1.514812396472e-01 -1.425941759367e-01 -1.333551269115e-01 +-1.238057450998e-01 -1.139878413639e-01 -1.039432537543e-01 -9.371371765055e-02 +-8.334073759345e-02 -7.286546120296e-02 -6.232855556730e-02 -5.177008647808e-02 +-4.122940087422e-02 -3.074501284472e-02 -2.035449352597e-02 -1.009436521455e-02 +-2.017993520125e-15 9.894476794452e-03 1.955627809358e-02 2.895404122269e-02 +3.805790849928e-02 4.683960205159e-02 5.527249267288e-02 6.333166254088e-02 +7.099396165367e-02 7.823805785504e-02 8.504448034442e-02 9.139565658906e-02 +9.727594257839e-02 1.026716463832e-01 1.075710450049e-01 1.119643945218e-01 +1.158439335639e-01 1.192038801653e-01 1.220404220705e-01 1.243517005880e-01 +1.261377881068e-01 1.274006594126e-01 1.281441569587e-01 1.283739502669e-01 +1.280974896510e-01 1.273239544735e-01 1.260641961644e-01 1.243306762428e-01 +1.221373996013e-01 1.194998433250e-01 1.164348813293e-01 1.129607051143e-01 +1.090967409418e-01 1.048635637545e-01 1.002828081598e-01 9.537707681491e-02 +9.016984654819e-02 8.468537256426e-02 7.894859107812e-02 7.298502072940e-02 +6.682066312776e-02 6.048190288085e-02 5.399540745491e-02 4.738802721591e-02 +4.068669599532e-02 3.391833252012e-02 2.710974304059e-02 2.028752548257e-02 +1.347797544287e-02 6.706994337182e-03 1.923754862896e-15 -6.618159975096e-03 +-1.312329187858e-02 -1.949193624796e-02 -2.570144470081e-02 -3.173005300269e-02 +-3.755695014952e-02 -4.316234326035e-02 -4.852751809238e-02 -5.363489500754e-02 +-5.846808023679e-02 -6.301191230674e-02 -6.725250351099e-02 -7.117727632701e-02 +-7.477499469849e-02 -7.803579012128e-02 -8.095118249046e-02 -8.351409568469e-02 +-8.571886788288e-02 -8.756125662706e-02 -8.903843866361e-02 -9.014900461356e-02 +-9.089294854048e-02 -9.127165250193e-02 -9.128786618804e-02 -9.094568176680e-02 +-9.025050407227e-02 -8.920901628720e-02 -8.782914128630e-02 -8.611999882078e-02 +-8.409185873785e-02 -8.175609044184e-02 -7.912510881497e-02 -7.621231682701e-02 +-7.303204507292e-02 -6.959948848655e-02 -6.593064048685e-02 -6.204222481980e-02 +-5.795162536585e-02 -5.367681418723e-02 -4.923627809414e-02 -4.464894401152e-02 +-3.993410343019e-02 -3.511133622733e-02 -3.020043414086e-02 -2.522132418163e-02 +-2.019399226493e-02 -1.513840733979e-02 -1.007444629063e-02 -5.021819880604e-03 +-2.017993520125e-15 4.971851523579e-03 9.874952304676e-03 1.469096672875e-02 +1.940207099963e-02 2.399101568496e-02 2.844118555012e-02 3.273665648248e-02 +3.686224932018e-02 4.080358041244e-02 4.454710875184e-02 4.808017953263e-02 +5.139106400368e-02 5.446899549907e-02 5.730420154464e-02 5.988793195354e-02 +6.221248283989e-02 6.427121649467e-02 6.605857708405e-02 6.757010214599e-02 +6.880242987642e-02 6.975330221231e-02 7.042156373406e-02 7.080715642526e-02 +7.091111034250e-02 7.073553026306e-02 7.028357839256e-02 6.955945322834e-02 +6.856836468843e-02 6.731650562847e-02 6.581101988180e-02 6.405996696958e-02 +6.207228363933e-02 5.985774240061e-02 5.742690723683e-02 5.479108668090e-02 +5.196228445150e-02 4.895314785360e-02 4.577691415454e-02 4.244735515224e-02 +3.897872015786e-02 3.538567761909e-02 3.168325561404e-02 2.788678144805e-02 +2.401182058740e-02 2.007411516497e-02 1.608952229238e-02 1.207395241270e-02 +8.043307925587e-03 4.013422314218e-03 2.074536714462e-15 -3.981442853543e-03 +-7.915636371208e-03 -1.178761362030e-02 -1.558276568474e-02 -1.928689496242e-02 +-2.288626649737e-02 -2.636765716683e-02 -2.971840255270e-02 -3.292644133668e-02 +-3.598035706879e-02 -3.886941717006e-02 -4.158360904114e-02 -4.411367316085e-02 +-4.645113307028e-02 -4.858832215099e-02 -5.051840711811e-02 -5.223540816233e-02 +-5.373421568777e-02 -5.501060360585e-02 -5.606123915857e-02 -5.688368925801e-02 +-5.747642334177e-02 -5.783881275763e-02 -5.797112670335e-02 -5.787452476069e-02 +-5.755104607507e-02 -5.700359524489e-02 -5.623592499627e-02 -5.525261573090e-02 +-5.405905204576e-02 -5.266139633442e-02 -5.106655958980e-02 -4.928216953832e-02 +-4.731653624443e-02 -4.517861533338e-02 -4.287796898795e-02 -4.042472488259e-02 +-3.782953322493e-02 -3.510352208092e-02 -3.225825116513e-02 -2.930566428247e-02 +-2.625804061164e-02 -2.312794502346e-02 -1.992817763036e-02 -1.667172276413e-02 +-1.337169758083e-02 -1.004130049137e-02 -6.693759615925e-03 -3.342281458998e-03 +-1.923754862896e-15 3.320073608768e-03 6.605100548160e-03 9.842462857878e-03 +1.301981080238e-02 1.612510890301e-02 1.914668046838e-02 2.207325046213e-02 +2.489398655388e-02 2.759853820776e-02 3.017707367060e-02 3.262031473114e-02 +3.491956913070e-02 3.706676051534e-02 3.905445582979e-02 4.087589006353e-02 +4.252498827031e-02 4.399638479288e-02 4.528543963624e-02 4.638825194349e-02 +4.730167054004e-02 4.802330152311e-02 4.855151288497e-02 4.888543616976e-02 +4.902496517506e-02 4.897075172058e-02 4.872419851754e-02 4.828744918298e-02 +4.766337545415e-02 4.685556166845e-02 4.586828658428e-02 4.470650262832e-02 +4.337581266363e-02 4.188244438241e-02 4.023322243538e-02 3.843553841795e-02 +3.649731884093e-02 3.442699122049e-02 3.223344842835e-02 2.992601144952e-02 +2.751439069967e-02 2.500864605924e-02 2.241914578537e-02 1.975652446611e-02 +1.703164018409e-02 1.425553105918e-02 1.143937134083e-02 8.594427221724e-03 +5.732012544672e-03 2.863444573755e-03 1.977605524170e-15 -2.847128650254e-03 +-5.666876038478e-03 -8.448346305770e-03 -1.118085447436e-02 -1.385396680399e-02 +-1.645753995316e-02 -1.898175880077e-02 -2.141717278938e-02 -2.375473065794e-02 +-2.598581343857e-02 -2.810226559941e-02 -3.009642422315e-02 -3.196114611929e-02 +-3.368983277624e-02 -3.527645306853e-02 -3.671556364322e-02 -3.800232691919e-02 +-3.913252664218e-02 -4.010258094843e-02 -4.090955289949e-02 -4.155115846070e-02 +-4.202577190581e-02 -4.233242864031e-02 -4.247082544577e-02 -4.244131815784e-02 +-4.224491679979e-02 -4.188327820380e-02 -4.135869616128e-02 -4.067408915282e-02 +-3.983298571793e-02 -3.883950753274e-02 -3.769835027310e-02 -3.641476234815e-02 +-3.499452159744e-02 -3.344391005198e-02 -3.176968686672e-02 -2.997905953825e-02 +-2.807965352779e-02 -2.607948041488e-02 -2.398690471253e-02 -2.181060947877e-02 +-1.955956086377e-02 -1.724297173505e-02 -1.487026452621e-02 -1.245103345675e-02 +-9.995006272540e-03 -7.512005657275e-03 -5.011910466195e-03 -2.504616932934e-03 +-2.017993520125e-15 2.492125077903e-03 4.962040710309e-03 7.400164381977e-03 +9.797085356249e-03 1.214360053189e-02 1.443074931854e-02 1.664984740018e-02 +1.879251926127e-02 2.085072935501e-02 2.281681179972e-02 2.468349849486e-02 +2.644394555529e-02 2.809175796926e-02 2.962101239264e-02 3.102627800003e-02 +3.230263532071e-02 3.344569299603e-02 3.445160240269e-02 3.531707009540e-02 +3.603936803051e-02 3.661634154138e-02 3.704641504493e-02 3.732859546769e-02 +3.746247338849e-02 3.744822190398e-02 3.728659323174e-02 3.697891307455e-02 +3.652707277795e-02 3.593351932149e-02 3.520124319259e-02 3.433376419947e-02 +3.333511528779e-02 3.220982443266e-02 3.096289468529e-02 2.959978245980e-02 +2.812637415265e-02 2.654896119291e-02 2.487421362735e-02 2.310915234940e-02 +2.126112008611e-02 1.933775126123e-02 1.734694085656e-02 1.529681239701e-02 +1.319568518767e-02 1.105204093352e-02 8.874489874274e-03 6.671736568095e-03 +4.452545458808e-03 2.225706361338e-03 2.049406405868e-15 -2.215836266605e-03 +-4.413142401646e-03 -6.583369196328e-03 -8.718111198071e-03 -1.080913893498e-02 +-1.284843031431e-02 -1.482820107631e-02 -1.674093418907e-02 -1.857940807451e-02 +-2.033672356062e-02 -2.200632946071e-02 -2.358204668567e-02 -2.505809080195e-02 +-2.642909295378e-02 -2.769011907529e-02 -2.883668732493e-02 -2.986478368168e-02 +-3.077087565026e-02 -3.155192402979e-02 -3.220539270811e-02 -3.272925645206e-02 +-3.312200667153e-02 -3.338265514341e-02 -3.351073568928e-02 -3.350630380882e-02 +-3.336993427882e-02 -3.310271673550e-02 -3.270624926561e-02 -3.218263003950e-02 +-3.153444702669e-02 -3.076476584194e-02 -2.987711577661e-02 -2.887547407732e-02 +-2.776424854012e-02 -2.654825849487e-02 -2.523271426040e-02 -2.382319515668e-02 +-2.232562616553e-02 -2.074625333617e-02 -1.909161803650e-02 -1.736853015519e-02 +-1.558404036300e-02 -1.374541154539e-02 -1.186008952090e-02 -9.935673162461e-03 +-7.979884040174e-03 -6.000535706114e-03 -4.005502742060e-03 -2.002689691865e-03 +-2.074536714462e-15 1.994694922632e-03 3.973586385546e-03 5.928958739437e-03 +7.853219214135e-03 9.738927159240e-03 1.157882257574e-02 1.336585383013e-02 +1.509320444606e-02 1.675431887269e-02 1.834292713311e-02 1.985306826103e-02 +2.127911243902e-02 2.261578175692e-02 2.385816951469e-02 2.500175800002e-02 +2.604243467716e-02 2.697650672987e-02 2.780071390796e-02 2.851223963386e-02 +2.910872033233e-02 2.958825295378e-02 2.994940066851e-02 3.019119671670e-02 +3.031314640595e-02 3.031522725560e-02 3.019788729414e-02 2.996204152340e-02 +2.960906657000e-02 2.914079355183e-02 2.855949919399e-02 2.786789523535e-02 +2.706911617354e-02 2.616670540215e-02 2.516459980041e-02 2.406711284115e-02 +2.287891628835e-02 2.160502056109e-02 2.025075384532e-02 1.882174003968e-02 +1.732387562572e-02 1.576330555675e-02 1.414639826310e-02 1.247971987454e-02 +1.077000776347e-02 9.024143514529e-03 7.249125428436e-03 5.452040668992e-03 +3.640037163405e-03 1.820295366559e-03 1.992292068153e-15 -1.813688123845e-03 +-3.613660082507e-03 -5.392886520681e-03 -7.144444916831e-03 -8.861546334083e-03 +-1.053756155274e-02 -1.216604648451e-02 -1.374076677168e-02 -1.525572147799e-02 +-1.670516578194e-02 -1.808363258714e-02 -1.938595296936e-02 -2.060727538420e-02 +-2.174308356481e-02 -2.278921304427e-02 -2.374186624279e-02 -2.459762606586e-02 +-2.535346796536e-02 -2.600677042174e-02 -2.655532381195e-02 -2.699733763383e-02 +-2.733144606462e-02 -2.755671183741e-02 -2.767262842634e-02 -2.767912053772e-02 +-2.757654291097e-02 -2.736567743992e-02 -2.704772863142e-02 -2.662431742473e-02 +-2.609747340140e-02 -2.546962542164e-02 -2.474359072908e-02 -2.392256257177e-02 +-2.301009639284e-02 -2.201009464959e-02 -2.092679032518e-02 -1.976472920154e-02 +-1.852875096731e-02 -1.722396923835e-02 -1.585575057269e-02 -1.442969256548e-02 +-1.295160111250e-02 -1.142746693402e-02 -9.863441453412e-03 -8.265812126754e-03 +-6.640977322024e-03 -4.995420847469e-03 -3.335686230010e-03 -1.668350845144e-03 +-1.923754862896e-15 1.662798928850e-03 3.313522201900e-03 4.945715167390e-03 +6.553017357490e-03 + L N + 0 12 +1.000000000000e+00 9.992279737113e-01 9.969140403446e-01 9.930646292992e-01 +9.876904326070e-01 9.808063695699e-01 9.724315374314e-01 9.625891482603e-01 +9.513064522713e-01 9.386146478614e-01 9.245487786840e-01 9.091476181311e-01 +8.924535416387e-01 8.745123872751e-01 8.553733051107e-01 8.350885959116e-01 +8.137135397329e-01 7.913062150280e-01 7.679273089187e-01 7.436399193057e-01 +7.185093495242e-01 6.926028962791e-01 6.659896316113e-01 6.387401796734e-01 +6.109264891045e-01 5.826216018117e-01 5.538994189758e-01 5.248344651059e-01 +4.955016509751e-01 4.659760362681e-01 4.363325927743e-01 4.066459689515e-01 +3.769902566815e-01 3.474387610267e-01 3.180637737844e-01 2.889363516172e-01 +2.601260995226e-01 2.317009603786e-01 2.037270112813e-01 1.762682673599e-01 +1.493864937278e-01 1.231410261944e-01 9.758860132910e-02 7.278319643154e-02 +4.877587992474e-02 2.561467264723e-02 3.344420478281e-03 -1.799332131255e-02 +-3.836039164525e-02 -5.772211483790e-02 -7.604737918979e-02 -9.330870273281e-02 +-1.094822859925e-01 -1.245480516486e-01 -1.384896710346e-01 -1.512945774625e-01 +-1.629539664097e-01 -1.734627826524e-01 -1.828196944759e-01 -1.910270551436e-01 +-1.980908518464e-01 -2.040206424053e-01 -2.088294800399e-01 -2.125338265593e-01 +-2.151534543731e-01 -2.167113377586e-01 -2.172335338584e-01 -2.167490539174e-01 +-2.152897253013e-01 -2.128900448716e-01 -2.095870243170e-01 -2.054200280721e-01 +-2.004306044738e-01 -1.946623108294e-01 -1.881605330885e-01 -1.809723008253e-01 +-1.731460982521e-01 -1.647316719950e-01 -1.557798363680e-01 -1.463422768886e-01 +-1.364713527782e-01 -1.262198991891e-01 -1.156410298962e-01 -1.047879411840e-01 +-9.371371765039e-02 -8.247114063505e-02 -7.111249996669e-02 -5.968940970393e-02 +-4.825262852548e-02 -3.685188540241e-02 -2.553571115993e-02 -1.435127650936e-02 +-3.344237101584e-03 7.441413878032e-03 1.796348508609e-02 2.818171791662e-02 +3.805790849943e-02 4.755602042277e-02 5.664228784054e-02 6.528530866430e-02 +7.345612758100e-02 8.112830867898e-02 8.827799750669e-02 9.488397243149e-02 +1.009276852081e-01 1.063932907094e-01 1.112676658148e-01 1.155404174940e-01 +1.192038801654e-01 1.222531024501e-01 1.246858234833e-01 1.265024389837e-01 +1.277059573206e-01 1.283019458554e-01 1.282984678711e-01 1.277060104357e-01 +1.265374035805e-01 1.248077312039e-01 1.225342341415e-01 1.197362058686e-01 +1.164348813293e-01 1.126533194058e-01 1.084162795664e-01 1.037500932444e-01 +9.868253051993e-02 9.324266268972e-02 8.746072131829e-02 8.136795437682e-02 +7.499648007903e-02 6.837913902881e-02 6.154934529460e-02 5.454093702501e-02 +4.738802721575e-02 4.012485523222e-02 3.278563968320e-02 2.540443323030e-02 +1.801497990466e-02 1.065057548665e-02 3.343931487162e-03 -3.872956750933e-03 +-1.096893733391e-02 -1.791382400724e-02 -2.467851280607e-02 -3.123509274441e-02 +-3.755695014967e-02 -4.361886627894e-02 -4.939710788436e-02 -5.486951042691e-02 +-6.001555367122e-02 -6.481642942771e-02 -6.925510124296e-02 -7.331635587451e-02 +-7.698684642162e-02 -8.025512701929e-02 -8.311167903885e-02 -8.554892877402e-02 +-8.756125662710e-02 -8.914499784507e-02 -9.029843489015e-02 -9.102178156370e-02 +-9.131715903518e-02 -9.118856396098e-02 -9.064182890880e-02 -8.968457533387e-02 +-8.832615938202e-02 -8.657761082242e-02 -8.445156543886e-02 -8.196219123287e-02 +-7.912510881488e-02 -7.595730638088e-02 -7.247704969087e-02 -6.870378748328e-02 +-6.465805277436e-02 -6.036136050535e-02 -5.583610201132e-02 -5.110543679481e-02 +-4.619318209463e-02 -4.112370074496e-02 -3.592178782306e-02 -3.061255658420e-02 +-2.522132418147e-02 -1.977349766434e-02 -1.429446074439e-02 -8.809461809129e-03 +-3.343503655124e-03 2.078764599710e-03 7.433152978168e-03 1.269603304885e-02 +1.784443685979e-02 2.285615200458e-02 2.770981244509e-02 3.238498473610e-02 +3.686224932032e-02 4.112327658597e-02 4.515089740462e-02 4.892916789272e-02 +5.244342816787e-02 5.568035489828e-02 5.862800747255e-02 6.127586764597e-02 +6.361487254874e-02 6.563744097142e-02 6.733749287251e-02 6.871046208299e-02 +6.975330221233e-02 7.046448578981e-02 7.084399670419e-02 7.089331603328e-02 +7.061540138289e-02 7.001465988189e-02 6.909691500653e-02 6.786936743256e-02 +6.634055013803e-02 6.452027800313e-02 6.241959217497e-02 6.005069948638e-02 +5.742690723673e-02 5.456255366062e-02 5.147293442663e-02 4.817422552287e-02 +4.468340289893e-02 4.101815924540e-02 3.719681830130e-02 3.323824708777e-02 +2.916176647231e-02 2.498706047175e-02 2.073408470507e-02 1.642297440696e-02 +1.207395241254e-02 7.707237520012e-03 3.342953633618e-03 -9.989599174016e-04 +-5.298836496292e-03 -9.537368334982e-03 -1.369569040266e-02 -1.775546161334e-02 +-2.169894303337e-02 -2.550907276560e-02 -2.916953720406e-02 -3.266483837116e-02 +-3.598035706892e-02 -3.910241159618e-02 -4.201831180512e-02 -4.471640829272e-02 +-4.718613654569e-02 -4.941805588103e-02 -5.140388304871e-02 -5.313652038720e-02 +-5.461007844779e-02 -5.581989302850e-02 -5.676253658367e-02 -5.743582400033e-02 +-5.783881275764e-02 -5.797179751029e-02 -5.783629916124e-02 -5.743504851314e-02 +-5.677196461118e-02 -5.585212791283e-02 -5.468174844196e-02 -5.326812910599e-02 +-5.161962437494e-02 -4.974559454044e-02 -4.765635579082e-02 -4.536312635556e-02 +-4.287796898784e-02 -4.021373006854e-02 -3.738397562802e-02 -3.440292459373e-02 +-3.128537958192e-02 -2.804665556062e-02 -2.470250671790e-02 -2.126905187582e-02 +-1.776269879390e-02 -1.420006770930e-02 -1.059791446129e-02 -6.973053547736e-03 +-3.342281458833e-03 2.776993699898e-04 3.870355649084e-03 7.419397039236e-03 +1.090884834749e-02 1.432311980103e-02 1.764707509662e-02 2.086609693505e-02 +2.396614976315e-02 2.693383946020e-02 2.975646972097e-02 3.242209490396e-02 +3.491956913082e-02 3.723859144079e-02 3.936974682337e-02 4.130454297152e-02 +4.303544261821e-02 4.455589133963e-02 4.586034072943e-02 4.694426686967e-02 +4.780418404585e-02 4.843765367486e-02 4.884328843635e-02 4.902075161979e-02 +4.897075172058e-02 4.869503233990e-02 4.819635746364e-02 4.747849221589e-02 +4.654617920246e-02 4.540511057875e-02 4.406189599482e-02 4.252402658784e-02 +4.079983520931e-02 3.889845308950e-02 3.682976315715e-02 3.460435024541e-02 +3.223344842822e-02 2.972888574237e-02 2.710302656088e-02 2.436871189230e-02 +2.153919788813e-02 1.862809284710e-02 1.564929300992e-02 1.261691744199e-02 +9.545242303754e-03 6.448634809500e-03 3.341487174992e-03 2.381508525979e-04 +-2.847128650419e-03 -5.900276079153e-03 -8.907449578187e-03 -1.185510239980e-02 +-1.473004290254e-02 -1.751949257884e-02 -2.021114186037e-02 -2.279320346191e-02 +-2.525446303625e-02 -2.758432692673e-02 -2.977286681774e-02 -3.181086109920e-02 +-3.368983277634e-02 -3.540208377320e-02 -3.694072549481e-02 -3.829970553127e-02 +-3.947383040449e-02 -4.045878427708e-02 -4.125114356156e-02 -4.184838738664e-02 +-4.224890389674e-02 -4.245199237930e-02 -4.245786123398e-02 -4.226762181585e-02 +-4.188327820378e-02 -4.130771296294e-02 -4.054466898827e-02 -3.959872753295e-02 +-3.847528254265e-02 -3.718051143228e-02 -3.572134245744e-02 -3.410541884732e-02 +-3.234105987946e-02 -3.043721908982e-02 -2.840343982337e-02 -2.624980834151e-02 +-2.398690471239e-02 -2.162575171918e-02 -1.917776202895e-02 -1.665468387151e-02 +-1.406854548292e-02 -1.143159857272e-02 -8.756261076850e-03 -6.055059460365e-03 +-3.340570834353e-03 -6.253651512786e-04 2.078052259000e-03 4.757297553046e-03 +7.400164382138e-03 9.994678794838e-03 1.252915278994e-02 1.499223628329e-02 +1.737296726033e-02 1.966081989565e-02 2.184575043113e-02 2.391824061559e-02 +2.586933852062e-02 2.769069656057e-02 2.937460655777e-02 3.091403170865e-02 +3.230263532080e-02 3.353480620680e-02 3.460568063597e-02 3.551116076150e-02 +3.624792945694e-02 3.681346151232e-02 3.720603115740e-02 3.742471589597e-02 +3.746939665215e-02 3.734075424653e-02 3.704026223617e-02 3.657017616935e-02 +3.593351932144e-02 3.513406499450e-02 3.417631547791e-02 3.306547778249e-02 +3.180743627425e-02 3.040872234786e-02 2.887648129230e-02 2.721843651339e-02 +2.544285128919e-02 2.355848824446e-02 2.157456673995e-02 1.950071838086e-02 +1.734694085641e-02 1.512355032887e-02 1.284113259628e-02 1.051049325735e-02 +8.142607110544e-03 5.748567021884e-03 3.339532497202e-03 9.266781948153e-04 +-1.478857386156e-03 -3.866022808557e-03 -6.223903960706e-03 -8.541773454272e-03 +-1.080913893514e-02 -1.301579009183e-02 -1.515184415306e-02 -1.720778967362e-02 +-1.917452841683e-02 -2.104341515099e-02 -2.280629518789e-02 -2.445553950233e-02 +-2.598407728330e-02 -2.738542578018e-02 -2.865371731977e-02 -2.978372338380e-02 +-3.077087565033e-02 -3.161128391669e-02 -3.230175083613e-02 -3.283978341545e-02 +-3.322360123548e-02 -3.345214137170e-02 -3.352506000737e-02 -3.344273074650e-02 +-3.320623964913e-02 -3.281737702633e-02 -3.227862604665e-02 -3.159314822042e-02 +-3.076476584187e-02 -2.979794148299e-02 -2.869775464559e-02 -2.746987569105e-02 +-2.612053717863e-02 -2.465650275498e-02 -2.308503374750e-02 -2.141385362451e-02 +-1.965111049394e-02 -1.780533782047e-02 -1.588541354853e-02 -1.390051782496e-02 +-1.186008952075e-02 -9.773781755706e-03 -7.651416633988e-03 -5.502939400705e-03 +-3.338372231846e-03 -1.167767870459e-03 9.988366781956e-04 3.151466180926e-03 +5.280252730885e-03 7.375480615454e-03 9.427630295369e-03 1.142742129759e-02 +1.336585383027e-02 1.523424893467e-02 1.702428699655e-02 1.872804444755e-02 +2.033802849617e-02 2.184720973769e-02 2.324905250247e-02 2.453754281321e-02 +2.570721383304e-02 2.675316869833e-02 2.767110064257e-02 2.845731033014e-02 +2.910872033238e-02 2.962288669104e-02 2.999800752846e-02 3.023292867675e-02 +3.032714631269e-02 3.028080659816e-02 3.009470234012e-02 2.977026669742e-02 +2.930956397516e-02 2.871527756066e-02 2.799069506760e-02 2.713969076785e-02 +2.616670540206e-02 2.507672347222e-02 2.387524813018e-02 2.256827378671e-02 +2.116225657575e-02 1.966408281765e-02 1.808103563374e-02 1.642075987274e-02 +1.469122551603e-02 1.290068973588e-02 1.105765778542e-02 9.170842904406e-03 +7.249125428275e-03 5.301511291054e-03 3.337090114614e-03 1.364993078026e-03 +-6.056492390625e-04 -2.565748845676e-03 -4.506301969589e-03 -6.418430138767e-03 +-8.293420528000e-03 -1.012276538856e-02 -1.189820038371e-02 -1.361174165838e-02 +-1.525572147813e-02 -1.682282227921e-02 -1.830610897985e-02 -1.969905941115e-02 +-2.099559273523e-02 -2.219009572795e-02 -2.327744681372e-02 -2.425303775080e-02 +-2.511279287634e-02 -2.585318583225e-02 -2.647125370453e-02 -2.696460852101e-02 +-2.733144606464e-02 -2.757055197189e-02 -2.768130509848e-02 -2.766367814715e-02 +-2.751823556482e-02 -2.724612872880e-02 -2.684908845437e-02 -2.632941486781e-02 +-2.568996470120e-02 -2.493413607671e-02 -2.406585085953e-02 -2.308953466915e-02 +-2.201009464949e-02 -2.083289510797e-02 -1.956373114306e-02 -1.820880038879e-02 +-1.677467301263e-02 -1.526826011074e-02 -1.369678065162e-02 -1.206772712484e-02 +-1.038883005751e-02 -8.668021565174e-03 -6.913398107991e-03 -5.133182626063e-03 +-3.335686229846e-03 -1.529269623132e-03 2.776955633555e-04 2.076865349952e-03 +3.859961720838e-03 5.618810496682e-03 7.345378594832e-03 9.031810508161e-03 +1.067046383786e-02 1.225394372036e-02 1.377513599426e-02 1.522723895930e-02 +1.660379358668e-02 1.789871204721e-02 1.910630443240e-02 2.022130355193e-02 +2.123888770046e-02 2.215470129622e-02 2.296487330399e-02 2.366603336570e-02 +2.425532557226e-02 2.473041982179e-02 2.508952072019e-02 2.533137399184e-02 +2.545527037936e-02 2.546104702338e-02 2.534908632429e-02 2.512031230025e-02 +2.477618446632e-02 2.431868927157e-02 2.375032914176e-02 2.307410918600e-02 +2.229352163644e-02 2.141252810021e-02 2.043553971245e-02 1.936739528878e-02 +1.821333758435e-02 1.697898777482e-02 1.567031828265e-02 1.429362407897e-02 +1.285549259812e-02 1.136277240765e-02 9.822540781984e-03 8.242070332365e-03 +6.628794849553e-03 4.990274518931e-03 3.334160669886e-03 1.668160223061e-03 +-1.634143446808e-13 -1.662608941446e-03 -3.312006778715e-03 -4.940620046424e-03 +-6.540996242587e-03 + L N + 1 0 +0.000000000000e+00 2.496324586958e-03 4.992565169918e-03 7.488637748286e-03 +9.984458328163e-03 1.247994292576e-02 1.497500757074e-02 1.746956830960e-02 +1.996354120901e-02 2.245684235919e-02 2.494938787730e-02 2.744109391072e-02 +2.993187664049e-02 3.242165228464e-02 3.491033710152e-02 3.739784739318e-02 +3.988409950874e-02 4.236900984768e-02 4.485249486326e-02 4.733447106581e-02 +4.981485502609e-02 5.229356337864e-02 5.477051282511e-02 5.724562013760e-02 +5.971880216197e-02 6.218997582121e-02 6.465905811871e-02 6.712596614162e-02 +6.959061706418e-02 7.205292815098e-02 7.451281676033e-02 7.697020034751e-02 +7.942499646812e-02 8.187712278134e-02 8.432649705327e-02 8.677303716016e-02 +8.921666109173e-02 9.165728695442e-02 9.409483297472e-02 9.652921750237e-02 +9.896035901367e-02 1.013881761147e-01 1.038125875446e-01 1.062335121789e-01 +1.086508690324e-01 1.110645772630e-01 1.134745561744e-01 1.158807252196e-01 +1.182830040039e-01 1.206813122884e-01 1.230755699930e-01 1.254656971997e-01 +1.278516141554e-01 1.302332412759e-01 1.326104991482e-01 1.349833085341e-01 +1.373515903735e-01 1.397152657871e-01 1.420742560800e-01 1.444284827445e-01 +1.467778674634e-01 1.491223321129e-01 1.514617987661e-01 1.537961896959e-01 +1.561254273778e-01 1.584494344935e-01 1.607681339337e-01 1.630814488010e-01 +1.653893024133e-01 1.676916183067e-01 1.699883202385e-01 1.722793321902e-01 +1.745645783707e-01 1.768439832190e-01 1.791174714076e-01 1.813849678450e-01 +1.836463976791e-01 1.859016863001e-01 1.881507593431e-01 1.903935426916e-01 +1.926299624799e-01 1.948599450964e-01 1.970834171864e-01 1.993003056549e-01 +2.015105376695e-01 2.037140406635e-01 2.059107423387e-01 2.081005706678e-01 +2.102834538980e-01 2.124593205533e-01 2.146280994374e-01 2.167897196366e-01 +2.189441105226e-01 2.210912017554e-01 2.232309232857e-01 2.253632053578e-01 +2.274879785128e-01 2.296051735906e-01 2.317147217331e-01 2.338165543869e-01 +2.359106033056e-01 2.379968005530e-01 2.400750785054e-01 2.421453698545e-01 +2.442076076096e-01 2.462617251009e-01 2.483076559815e-01 2.503453342304e-01 +2.523746941547e-01 2.543956703927e-01 2.564081979159e-01 2.584122120318e-01 +2.604076483865e-01 2.623944429672e-01 2.643725321044e-01 2.663418524746e-01 +2.683023411031e-01 2.702539353656e-01 2.721965729916e-01 2.741301920661e-01 +2.760547310324e-01 2.779701286942e-01 2.798763242183e-01 2.817732571367e-01 +2.836608673490e-01 2.855390951249e-01 2.874078811063e-01 2.892671663095e-01 +2.911168921278e-01 2.929570003335e-01 2.947874330805e-01 2.966081329058e-01 +2.984190427327e-01 3.002201058720e-01 3.020112660250e-01 3.037924672851e-01 +3.055636541404e-01 3.073247714752e-01 3.090757645729e-01 3.108165791173e-01 +3.125471611955e-01 3.142674572991e-01 3.159774143269e-01 3.176769795865e-01 +3.193661007968e-01 3.210447260893e-01 3.227128040107e-01 3.243702835244e-01 +3.260171140128e-01 3.276532452789e-01 3.292786275485e-01 3.308932114717e-01 +3.324969481252e-01 3.340897890136e-01 3.356716860720e-01 3.372425916669e-01 +3.388024585987e-01 3.403512401031e-01 3.418888898529e-01 3.434153619598e-01 +3.449306109763e-01 3.464345918968e-01 3.479272601600e-01 3.494085716499e-01 +3.508784826980e-01 3.523369500845e-01 3.537839310400e-01 3.552193832474e-01 +3.566432648428e-01 3.580555344177e-01 3.594561510200e-01 3.608450741561e-01 +3.622222637916e-01 3.635876803534e-01 3.649412847309e-01 3.662830382773e-01 +3.676129028112e-01 3.689308406180e-01 3.702368144509e-01 3.715307875328e-01 +3.728127235570e-01 3.740825866892e-01 3.753403415680e-01 3.765859533068e-01 +3.778193874947e-01 3.790406101978e-01 3.802495879603e-01 3.814462878060e-01 +3.826306772390e-01 3.838027242452e-01 3.849623972932e-01 3.861096653354e-01 +3.872444978093e-01 3.883668646384e-01 3.894767362329e-01 3.905740834913e-01 +3.916588778011e-01 3.927310910397e-01 3.937906955755e-01 3.948376642687e-01 +3.958719704721e-01 3.968935880325e-01 3.979024912908e-01 3.988986550836e-01 +3.998820547434e-01 4.008526660997e-01 4.018104654798e-01 4.027554297095e-01 +4.036875361137e-01 4.046067625174e-01 4.055130872460e-01 4.064064891265e-01 +4.072869474875e-01 4.081544421604e-01 4.090089534797e-01 4.098504622838e-01 +4.106789499151e-01 4.114943982211e-01 4.122967895547e-01 4.130861067746e-01 +4.138623332458e-01 4.146254528402e-01 4.153754499369e-01 4.161123094227e-01 +4.168360166924e-01 4.175465576492e-01 4.182439187051e-01 4.189280867811e-01 +4.195990493076e-01 4.202567942248e-01 4.209013099827e-01 4.215325855415e-01 +4.221506103717e-01 4.227553744544e-01 4.233468682816e-01 4.239250828559e-01 +4.244900096913e-01 4.250416408126e-01 4.255799687559e-01 4.261049865687e-01 +4.266166878097e-01 4.271150665490e-01 4.276001173681e-01 4.280718353596e-01 +4.285302161276e-01 4.289752557874e-01 4.294069509652e-01 4.298252987985e-01 +4.302302969354e-01 4.306219435350e-01 4.310002372667e-01 4.313651773105e-01 +4.317167633563e-01 4.320549956041e-01 4.323798747633e-01 4.326914020530e-01 +4.329895792010e-01 4.332744084441e-01 4.335458925272e-01 4.338040347035e-01 +4.340488387337e-01 4.342803088856e-01 4.344984499339e-01 4.347032671597e-01 +4.348947663497e-01 4.350729537962e-01 4.352378362962e-01 4.353894211511e-01 +4.355277161658e-01 4.356527296486e-01 4.357644704103e-01 4.358629477635e-01 +4.359481715222e-01 4.360201520010e-01 4.360789000144e-01 4.361244268761e-01 +4.361567443983e-01 4.361758648910e-01 4.361818011611e-01 4.361745665118e-01 +4.361541747414e-01 4.361206401430e-01 4.360739775033e-01 4.360142021017e-01 +4.359413297098e-01 4.358553765897e-01 4.357563594941e-01 4.356442956644e-01 +4.355192028303e-01 4.353810992087e-01 4.352300035024e-01 4.350659348994e-01 +4.348889130718e-01 4.346989581745e-01 4.344960908441e-01 4.342803321983e-01 +4.340517038341e-01 4.338102278270e-01 4.335559267297e-01 4.332888235711e-01 +4.330089418547e-01 4.327163055577e-01 4.324109391297e-01 4.320928674913e-01 +4.317621160329e-01 4.314187106131e-01 4.310626775581e-01 4.306940436593e-01 +4.303128361730e-01 4.299190828181e-01 4.295128117753e-01 4.290940516853e-01 +4.286628316476e-01 4.282191812190e-01 4.277631304118e-01 4.272947096928e-01 +4.268139499814e-01 4.263208826481e-01 4.258155395130e-01 4.252979528444e-01 +4.247681553570e-01 4.242261802101e-01 4.236720610063e-01 4.231058317898e-01 +4.225275270446e-01 4.219371816928e-01 4.213348310930e-01 4.207205110384e-01 +4.200942577555e-01 4.194561079017e-01 4.188060985641e-01 4.181442672572e-01 +4.174706519215e-01 4.167852909214e-01 4.160882230437e-01 4.153794874951e-01 +4.146591239012e-01 4.139271723036e-01 4.131836731590e-01 4.124286673363e-01 +4.116621961154e-01 4.108843011849e-01 4.100950246402e-01 4.092944089813e-01 +4.084824971113e-01 4.076593323337e-01 4.068249583507e-01 4.059794192614e-01 +4.051227595591e-01 4.042550241297e-01 4.033762582496e-01 4.024865075830e-01 +4.015858181805e-01 4.006742364766e-01 3.997518092872e-01 3.988185838083e-01 +3.978746076127e-01 3.969199286486e-01 3.959545952372e-01 3.949786560700e-01 +3.939921602073e-01 3.929951570751e-01 3.919876964636e-01 3.909698285243e-01 +3.899416037679e-01 3.889030730620e-01 3.878542876287e-01 3.867952990423e-01 +3.857261592268e-01 3.846469204536e-01 3.835576353392e-01 3.824583568425e-01 +3.813491382626e-01 3.802300332363e-01 3.791010957357e-01 3.779623800657e-01 +3.768139408612e-01 3.756558330852e-01 3.744881120258e-01 3.733108332941e-01 +3.721240528212e-01 3.709278268560e-01 3.697222119625e-01 3.685072650172e-01 +3.672830432068e-01 3.660496040250e-01 3.648070052707e-01 3.635553050448e-01 +3.622945617476e-01 3.610248340765e-01 3.597461810231e-01 3.584586618706e-01 +3.571623361910e-01 3.558572638427e-01 3.545435049675e-01 3.532211199882e-01 +3.518901696055e-01 3.505507147957e-01 3.492028168076e-01 3.478465371600e-01 +3.464819376389e-01 3.451090802946e-01 3.437280274390e-01 3.423388416430e-01 +3.409415857334e-01 3.395363227901e-01 3.381231161437e-01 3.367020293723e-01 +3.352731262987e-01 3.338364709875e-01 3.323921277428e-01 3.309401611045e-01 +3.294806358460e-01 3.280136169713e-01 3.265391697118e-01 3.250573595237e-01 +3.235682520850e-01 3.220719132927e-01 3.205684092596e-01 3.190578063117e-01 +3.175401709851e-01 3.160155700232e-01 3.144840703734e-01 3.129457391847e-01 +3.114006438044e-01 3.098488517749e-01 3.082904308315e-01 3.067254488986e-01 +3.051539740871e-01 3.035760746915e-01 3.019918191867e-01 3.004012762251e-01 +2.988045146334e-01 2.972016034102e-01 2.955926117220e-01 2.939776089011e-01 +2.923566644421e-01 2.907298479988e-01 2.890972293815e-01 2.874588785536e-01 +2.858148656290e-01 2.841652608686e-01 2.825101346773e-01 2.808495576012e-01 +2.791836003245e-01 2.775123336661e-01 2.758358285769e-01 2.741541561364e-01 +2.724673875501e-01 2.707755941458e-01 2.690788473709e-01 2.673772187894e-01 +2.656707800785e-01 2.639596030256e-01 2.622437595254e-01 2.605233215765e-01 +2.587983612785e-01 2.570689508288e-01 2.553351625196e-01 2.535970687347e-01 +2.518547419463e-01 2.501082547122e-01 2.483576796723e-01 2.466030895457e-01 +2.448445571275e-01 2.430821552859e-01 2.413159569588e-01 2.395460351506e-01 +2.377724629296e-01 2.359953134243e-01 2.342146598205e-01 2.324305753585e-01 +2.306431333292e-01 2.288524070719e-01 2.270584699703e-01 2.252613954502e-01 +2.234612569758e-01 2.216581280465e-01 2.198520821945e-01 2.180431929810e-01 +2.162315339931e-01 2.144171788412e-01 2.126002011553e-01 2.107806745823e-01 +2.089586727827e-01 2.071342694274e-01 2.053075381948e-01 2.034785527677e-01 +2.016473868297e-01 1.998141140628e-01 1.979788081440e-01 1.961415427420e-01 +1.943023915143e-01 1.924614281042e-01 1.906187261374e-01 1.887743592193e-01 +1.869284009315e-01 1.850809248291e-01 1.832320044374e-01 1.813817132488e-01 +1.795301247198e-01 1.776773122681e-01 1.758233492692e-01 1.739683090534e-01 +1.721122649032e-01 1.702552900495e-01 1.683974576692e-01 1.665388408819e-01 +1.646795127467e-01 1.628195462594e-01 1.609590143495e-01 1.590979898770e-01 +1.572365456294e-01 1.553747543189e-01 1.535126885791e-01 1.516504209621e-01 +1.497880239359e-01 1.479255698805e-01 1.460631310860e-01 1.442007797486e-01 +1.423385879686e-01 1.404766277466e-01 1.386149709811e-01 1.367536894653e-01 +1.348928548840e-01 1.330325388113e-01 1.311728127067e-01 1.293137479132e-01 +1.274554156536e-01 1.255978870280e-01 1.237412330106e-01 1.218855244474e-01 +1.200308320525e-01 1.181772264058e-01 1.163247779499e-01 1.144735569874e-01 +1.126236336779e-01 1.107750780352e-01 1.089279599244e-01 1.070823490592e-01 +1.052383149991e-01 1.033959271463e-01 1.015552547434e-01 9.971636687003e-02 +9.787933244060e-02 9.604422020116e-02 9.421109872679e-02 9.238003641883e-02 +9.055110150215e-02 8.872436202235e-02 8.689988584314e-02 8.507774064353e-02 +8.325799391520e-02 8.144071295975e-02 7.962596488607e-02 7.781381660763e-02 +7.600433483984e-02 7.419758609738e-02 7.239363669160e-02 7.059255272786e-02 +6.879440010292e-02 6.699924450232e-02 6.520715139783e-02 6.341818604483e-02 +6.163241347976e-02 5.984989851753e-02 5.807070574900e-02 5.629489953847e-02 +5.452254402109e-02 5.275370310039e-02 5.098844044580e-02 4.922681949013e-02 +4.746890342708e-02 4.571475520885e-02 4.396443754362e-02 4.221801289314e-02 +4.047554347031e-02 3.873709123678e-02 3.700271790054e-02 3.527248491351e-02 +3.354645346923e-02 3.182468450046e-02 3.010723867682e-02 2.839417640254e-02 +2.668555781403e-02 2.498144277768e-02 2.328189088750e-02 2.158696146289e-02 +1.989671354636e-02 1.821120590129e-02 1.653049700966e-02 1.485464506992e-02 +1.318370799468e-02 1.151774340860e-02 9.856808646176e-03 8.200960749600e-03 +6.550256466598e-03 4.904752248310e-03 3.264504247171e-03 1.629568314813e-03 +-2.450759505326e-14 -1.624145453560e-03 -3.242813109028e-03 -4.855948338718e-03 +-6.463496825996e-03 + L N + 1 1 +0.000000000000e+00 4.291735428457e-03 8.583043981323e-03 1.287349883355e-02 +1.716267326116e-02 2.145014069182e-02 2.573547475530e-02 3.001824933398e-02 +3.429803861326e-02 3.857441713205e-02 4.284695983304e-02 4.711524211308e-02 +5.137883987341e-02 5.563732956983e-02 5.989028826285e-02 6.413729366771e-02 +6.837792420433e-02 7.261175904720e-02 7.683837817512e-02 8.105736242085e-02 +8.526829352072e-02 8.947075416401e-02 9.366432804228e-02 9.784859989857e-02 +1.020231555764e-01 1.061875820688e-01 1.103414675669e-01 1.144844015086e-01 +1.186159746272e-01 1.227357789992e-01 1.268434080930e-01 1.309384568164e-01 +1.350205215646e-01 1.390892002673e-01 1.431440924368e-01 1.471847992144e-01 +1.512109234179e-01 1.552220695878e-01 1.592178440342e-01 1.631978548831e-01 +1.671617121221e-01 1.711090276463e-01 1.750394153042e-01 1.789524909425e-01 +1.828478724515e-01 1.867251798097e-01 1.905840351284e-01 1.944240626958e-01 +1.982448890213e-01 2.020461428785e-01 2.058274553496e-01 2.095884598674e-01 +2.133287922588e-01 2.170480907870e-01 2.207459961937e-01 2.244221517411e-01 +2.280762032530e-01 2.317077991564e-01 2.353165905224e-01 2.389022311061e-01 +2.424643773877e-01 2.460026886113e-01 2.495168268254e-01 2.530064569210e-01 +2.564712466711e-01 2.599108667689e-01 2.633249908654e-01 2.667132956074e-01 +2.700754606748e-01 2.734111688171e-01 2.767201058901e-01 2.800019608919e-01 +2.832564259984e-01 2.864831965988e-01 2.896819713302e-01 2.928524521123e-01 +2.959943441808e-01 2.991073561218e-01 3.021911999042e-01 3.052455909129e-01 +3.082702479806e-01 3.112648934202e-01 3.142292530557e-01 3.171630562533e-01 +3.200660359520e-01 3.229379286933e-01 3.257784746512e-01 3.285874176609e-01 +3.313645052477e-01 3.341094886548e-01 3.368221228716e-01 3.395021666601e-01 +3.421493825825e-01 3.447635370265e-01 3.473444002319e-01 3.498917463154e-01 +3.524053532954e-01 3.548850031162e-01 3.573304816720e-01 3.597415788301e-01 +3.621180884535e-01 3.644598084232e-01 3.667665406600e-01 3.690380911457e-01 +3.712742699437e-01 3.734748912194e-01 3.756397732596e-01 3.777687384918e-01 +3.798616135028e-01 3.819182290567e-01 3.839384201126e-01 3.859220258413e-01 +3.878688896422e-01 3.897788591589e-01 3.916517862950e-01 3.934875272284e-01 +3.952859424260e-01 3.970468966577e-01 3.987702590090e-01 4.004559028942e-01 +4.021037060685e-01 4.037135506392e-01 4.052853230772e-01 4.068189142273e-01 +4.083142193180e-01 4.097711379712e-01 4.111895742108e-01 4.125694364708e-01 +4.139106376034e-01 4.152130948861e-01 4.164767300279e-01 4.177014691759e-01 +4.188872429201e-01 4.200339862992e-01 4.211416388040e-01 4.222101443820e-01 +4.232394514402e-01 4.242295128478e-01 4.251802859385e-01 4.260917325119e-01 +4.269638188346e-01 4.277965156404e-01 4.285897981307e-01 4.293436459731e-01 +4.300580433007e-01 4.307329787101e-01 4.313684452590e-01 4.319644404634e-01 +4.325209662940e-01 4.330380291721e-01 4.335156399653e-01 4.339538139820e-01 +4.343525709659e-01 4.347119350899e-01 4.350319349487e-01 4.353126035522e-01 +4.355539783170e-01 4.357561010584e-01 4.359190179809e-01 4.360427796690e-01 +4.361274410772e-01 4.361730615190e-01 4.361797046561e-01 4.361474384862e-01 +4.360763353314e-01 4.359664718249e-01 4.358179288979e-01 4.356307917656e-01 +4.354051499131e-01 4.351410970802e-01 4.348387312462e-01 4.344981546136e-01 +4.341194735922e-01 4.337027987817e-01 4.332482449540e-01 4.327559310359e-01 +4.322259800898e-01 4.316585192952e-01 4.310536799291e-01 4.304115973455e-01 +4.297324109555e-01 4.290162642058e-01 4.282633045577e-01 4.274736834644e-01 +4.266475563490e-01 4.257850825814e-01 4.248864254548e-01 4.239517521619e-01 +4.229812337704e-01 4.219750451979e-01 4.209333651871e-01 4.198563762794e-01 +4.187442647892e-01 4.175972207766e-01 4.164154380210e-01 4.151991139927e-01 +4.139484498252e-01 4.126636502869e-01 4.113449237518e-01 4.099924821705e-01 +4.086065410402e-01 4.071873193743e-01 4.057350396724e-01 4.042499278886e-01 +4.027322134004e-01 4.011821289769e-01 3.995999107463e-01 3.979857981635e-01 +3.963400339769e-01 3.946628641949e-01 3.929545380524e-01 3.912153079764e-01 +3.894454295514e-01 3.876451614846e-01 3.858147655706e-01 3.839545066556e-01 +3.820646526015e-01 3.801454742498e-01 3.781972453845e-01 3.762202426951e-01 +3.742147457397e-01 3.721810369068e-01 3.701194013774e-01 3.680301270870e-01 +3.659135046864e-01 3.637698275033e-01 3.615993915026e-01 3.594024952472e-01 +3.571794398579e-01 3.549305289735e-01 3.526560687102e-01 3.503563676209e-01 +3.480317366546e-01 3.456824891148e-01 3.433089406181e-01 3.409114090526e-01 +3.384902145361e-01 3.360456793733e-01 3.335781280141e-01 3.310878870103e-01 +3.285752849731e-01 3.260406525299e-01 3.234843222808e-01 3.209066287553e-01 +3.183079083684e-01 3.156884993770e-01 3.130487418352e-01 3.103889775505e-01 +3.077095500393e-01 3.050108044820e-01 3.022930876783e-01 2.995567480026e-01 +2.968021353580e-01 2.940296011322e-01 2.912394981512e-01 2.884321806341e-01 +2.856080041475e-01 2.827673255595e-01 2.799105029940e-01 2.770378957849e-01 +2.741498644292e-01 2.712467705418e-01 2.683289768085e-01 2.653968469399e-01 +2.624507456248e-01 2.594910384838e-01 2.565180920228e-01 2.535322735859e-01 +2.505339513094e-01 2.475234940741e-01 2.445012714596e-01 2.414676536964e-01 +2.384230116199e-01 2.353677166230e-01 2.323021406092e-01 2.292266559462e-01 +2.261416354184e-01 2.230474521800e-01 2.199444797088e-01 2.168330917584e-01 +2.137136623119e-01 2.105865655350e-01 2.074521757289e-01 2.043108672839e-01 +2.011630146325e-01 1.980089922025e-01 1.948491743708e-01 1.916839354168e-01 +1.885136494756e-01 1.853386904919e-01 1.821594321733e-01 1.789762479447e-01 +1.757895109016e-01 1.725995937643e-01 1.694068688318e-01 1.662117079363e-01 +1.630144823971e-01 1.598155629754e-01 1.566153198285e-01 1.534141224648e-01 +1.502123396984e-01 1.470103396041e-01 1.438084894728e-01 1.406071557664e-01 +1.374067040734e-01 1.342074990649e-01 1.310099044496e-01 1.278142829305e-01 +1.246209961609e-01 1.214304047005e-01 1.182428679721e-01 1.150587442188e-01 +1.118783904600e-01 1.087021624498e-01 1.055304146333e-01 1.023635001051e-01 +9.920177056660e-02 9.604557628443e-02 9.289526604868e-02 8.975118713151e-02 +8.661368524602e-02 8.348310450536e-02 8.035978738211e-02 7.724407466788e-02 +7.413630543332e-02 7.103681698821e-02 6.794594484201e-02 6.486402266461e-02 +6.179138224739e-02 5.872835346455e-02 5.567526423485e-02 5.263244048348e-02 +4.960020610444e-02 4.657888292306e-02 4.356879065899e-02 4.057024688941e-02 +3.758356701260e-02 3.460906421190e-02 3.164704941992e-02 2.869783128320e-02 +2.576171612706e-02 2.283900792103e-02 1.993000824438e-02 1.703501625226e-02 +1.415432864198e-02 1.128823961984e-02 8.437040868243e-03 5.601021513172e-03 +2.780468092113e-03 -2.433547768918e-05 -2.813107930559e-03 -5.585570683340e-03 +-8.341447865940e-03 -1.108046635148e-02 -1.380235578603e-02 -1.650684861797e-02 +-1.919368012687e-02 -2.186258845205e-02 -2.451331462065e-02 -2.714560257530e-02 +-2.975919920139e-02 -3.235385435387e-02 -3.492932088364e-02 -3.748535466355e-02 +-4.002171461387e-02 -4.253816272741e-02 -4.503446409415e-02 -4.751038692542e-02 +-4.996570257771e-02 -5.240018557588e-02 -5.481361363611e-02 -5.720576768820e-02 +-5.957643189756e-02 -6.192539368668e-02 -6.425244375612e-02 -6.655737610509e-02 +-6.883998805151e-02 -7.110008025161e-02 -7.333745671913e-02 -7.555192484393e-02 +-7.774329541020e-02 -7.991138261421e-02 -8.205600408150e-02 -8.417698088369e-02 +-8.627413755471e-02 -8.834730210664e-02 -9.039630604499e-02 -9.242098438353e-02 +-9.442117565863e-02 -9.639672194312e-02 -9.834746885961e-02 -1.002732655934e-01 +-1.021739649048e-01 -1.040494231411e-01 -1.058995002478e-01 -1.077240597797e-01 +-1.095229689111e-01 -1.112960984458e-01 -1.130433228266e-01 -1.147645201439e-01 +-1.164595721444e-01 -1.181283642388e-01 -1.197707855094e-01 -1.213867287168e-01 +-1.229760903064e-01 -1.245387704143e-01 -1.260746728727e-01 -1.275837052148e-01 +-1.290657786791e-01 -1.305208082135e-01 -1.319487124786e-01 -1.333494138503e-01 +-1.347228384229e-01 -1.360689160103e-01 -1.373875801476e-01 -1.386787680924e-01 +-1.399424208244e-01 -1.411784830461e-01 -1.423869031819e-01 -1.435676333767e-01 +-1.447206294949e-01 -1.458458511177e-01 -1.469432615411e-01 -1.480128277725e-01 +-1.490545205271e-01 -1.500683142241e-01 -1.510541869820e-01 -1.520121206133e-01 +-1.529421006198e-01 -1.538441161856e-01 -1.547181601715e-01 -1.555642291072e-01 +-1.563823231847e-01 -1.571724462497e-01 -1.579346057935e-01 -1.586688129443e-01 +-1.593750824573e-01 -1.600534327055e-01 -1.607038856690e-01 -1.613264669243e-01 +-1.619212056333e-01 -1.624881345314e-01 -1.630272899154e-01 -1.635387116309e-01 +-1.640224430593e-01 -1.644785311042e-01 -1.649070261774e-01 -1.653079821847e-01 +-1.656814565107e-01 -1.660275100038e-01 -1.663462069604e-01 -1.666376151086e-01 +-1.669018055916e-01 -1.671388529506e-01 -1.673488351076e-01 -1.675318333473e-01 +-1.676879322986e-01 -1.678172199161e-01 -1.679197874610e-01 -1.679957294811e-01 +-1.680451437914e-01 -1.680681314531e-01 -1.680647967533e-01 -1.680352471835e-01 +-1.679795934182e-01 -1.678979492927e-01 -1.677904317807e-01 -1.676571609720e-01 +-1.674982600487e-01 -1.673138552622e-01 -1.671040759088e-01 -1.668690543061e-01 +-1.666089257676e-01 -1.663238285784e-01 -1.660139039692e-01 -1.656792960911e-01 +-1.653201519892e-01 -1.649366215765e-01 -1.645288576067e-01 -1.640970156475e-01 +-1.636412540531e-01 -1.631617339362e-01 -1.626586191402e-01 -1.621320762106e-01 +-1.615822743666e-01 -1.610093854714e-01 -1.604135840036e-01 -1.597950470272e-01 +-1.591539541615e-01 -1.584904875512e-01 -1.578048318357e-01 -1.570971741183e-01 +-1.563677039349e-01 -1.556166132232e-01 -1.548440962904e-01 -1.540503497817e-01 +-1.532355726479e-01 -1.523999661133e-01 -1.515437336425e-01 -1.506670809080e-01 +-1.497702157568e-01 -1.488533481770e-01 -1.479166902640e-01 -1.469604561871e-01 +-1.459848621550e-01 -1.449901263815e-01 -1.439764690515e-01 -1.429441122854e-01 +-1.418932801051e-01 -1.408241983982e-01 -1.397370948832e-01 -1.386321990736e-01 +-1.375097422424e-01 -1.363699573865e-01 -1.352130791900e-01 -1.340393439887e-01 +-1.328489897337e-01 -1.316422559544e-01 -1.304193837223e-01 -1.291806156141e-01 +-1.279261956746e-01 -1.266563693800e-01 -1.253713836005e-01 -1.240714865628e-01 +-1.227569278130e-01 -1.214279581791e-01 -1.200848297328e-01 -1.187277957525e-01 +-1.173571106849e-01 -1.159730301075e-01 -1.145758106902e-01 -1.131657101573e-01 +-1.117429872497e-01 -1.103079016861e-01 -1.088607141251e-01 -1.074016861269e-01 +-1.059310801145e-01 -1.044491593355e-01 -1.029561878238e-01 -1.014524303607e-01 +-9.993815243652e-02 -9.841362021212e-02 -9.687910048013e-02 -9.533486062644e-02 +-9.378116859156e-02 -9.221829283197e-02 -9.064650228155e-02 -8.906606631294e-02 +-8.747725469894e-02 -8.588033757396e-02 -8.427558539545e-02 -8.266326890537e-02 +-8.104365909172e-02 -7.941702715008e-02 -7.778364444522e-02 -7.614378247275e-02 +-7.449771282081e-02 -7.284570713186e-02 -7.118803706451e-02 -6.952497425542e-02 +-6.785679028131e-02 -6.618375662098e-02 -6.450614461754e-02 -6.282422544058e-02 +-6.113827004858e-02 -5.944854915133e-02 -5.775533317251e-02 -5.605889221235e-02 +-5.435949601043e-02 -5.265741390859e-02 -5.095291481399e-02 -4.924626716229e-02 +-4.753773888093e-02 -4.582759735266e-02 -4.411610937911e-02 -4.240354114454e-02 +-4.069015817980e-02 -3.897622532641e-02 -3.726200670080e-02 -3.554776565875e-02 +-3.383376475999e-02 -3.212026573298e-02 -3.040752943992e-02 -2.869581584189e-02 +-2.698538396420e-02 -2.527649186198e-02 -2.356939658596e-02 -2.186435414842e-02 +-2.016161948939e-02 -1.846144644308e-02 -1.676408770452e-02 -1.506979479638e-02 +-1.337881803613e-02 -1.169140650333e-02 -1.000780800722e-02 -8.328269054515e-03 +-6.653034817514e-03 -4.982349102382e-03 -3.316454317742e-03 -1.655591443512e-03 +-9.285027025030e-15 1.650081982682e-03 3.294417995062e-03 4.932773078292e-03 +6.564913853998e-03 + L N + 1 2 +0.000000000000e+00 6.057645291763e-03 1.211409019262e-02 1.816813459484e-02 +2.421857895701e-02 3.026422458692e-02 3.630387392438e-02 4.233633082363e-02 +4.836040083545e-02 5.437489148881e-02 6.037861257200e-02 6.637037641321e-02 +7.234899816045e-02 7.831329606071e-02 8.426209173838e-02 9.019421047277e-02 +9.610848147468e-02 1.020037381620e-01 1.078788184342e-01 1.137325649457e-01 +1.195638253778e-01 1.253714527100e-01 1.311543054889e-01 1.369112480966e-01 +1.426411510172e-01 1.483428911016e-01 1.540153518312e-01 1.596574235791e-01 +1.652680038705e-01 1.708459976401e-01 1.763903174891e-01 1.818998839385e-01 +1.873736256817e-01 1.928104798348e-01 1.982093921838e-01 2.035693174309e-01 +2.088892194377e-01 2.141680714660e-01 2.194048564169e-01 2.245985670666e-01 +2.297482063000e-01 2.348527873422e-01 2.399113339863e-01 2.449228808196e-01 +2.498864734462e-01 2.548011687073e-01 2.596660348986e-01 2.644801519840e-01 +2.692426118077e-01 2.739525183019e-01 2.786089876924e-01 2.832111487005e-01 +2.877581427417e-01 2.922491241217e-01 2.966832602285e-01 3.010597317214e-01 +3.053777327167e-01 3.096364709698e-01 3.138351680540e-01 3.179730595357e-01 +3.220493951456e-01 3.260634389475e-01 3.300144695019e-01 3.339017800270e-01 +3.377246785558e-01 3.414824880886e-01 3.451745467432e-01 3.488002078998e-01 +3.523588403430e-01 3.558498283991e-01 3.592725720702e-01 3.626264871641e-01 +3.659110054194e-01 3.691255746281e-01 3.722696587527e-01 3.753427380397e-01 +3.783443091295e-01 3.812738851612e-01 3.841309958739e-01 3.869151877036e-01 +3.896260238760e-01 3.922630844945e-01 3.948259666247e-01 3.973142843742e-01 +3.997276689683e-01 4.020657688210e-01 4.043282496018e-01 4.065147942988e-01 +4.086251032763e-01 4.106588943291e-01 4.126159027315e-01 4.144958812827e-01 +4.162986003470e-01 4.180238478906e-01 4.196714295127e-01 4.212411684736e-01 +4.227329057167e-01 4.241464998881e-01 4.254818273497e-01 4.267387821894e-01 +4.279172762261e-01 4.290172390104e-01 4.300386178210e-01 4.309813776567e-01 +4.318455012237e-01 4.326309889187e-01 4.333378588077e-01 4.339661466002e-01 +4.345159056188e-01 4.349872067653e-01 4.353801384813e-01 4.356948067050e-01 +4.359313348240e-01 4.360898636233e-01 4.361705512287e-01 4.361735730472e-01 +4.360991217012e-01 4.359474069605e-01 4.357186556685e-01 4.354131116650e-01 +4.350310357045e-01 4.345727053707e-01 4.340384149863e-01 4.334284755195e-01 +4.327432144854e-01 4.319829758443e-01 4.311481198955e-01 4.302390231672e-01 +4.292560783023e-01 4.281996939408e-01 4.270702945978e-01 4.258683205377e-01 +4.245942276447e-01 4.232484872898e-01 4.218315861934e-01 4.203440262848e-01 +4.187863245581e-01 4.171590129235e-01 4.154626380564e-01 4.136977612420e-01 +4.118649582169e-01 4.099648190067e-01 4.079979477610e-01 4.059649625843e-01 +4.038664953643e-01 4.017031915961e-01 3.994757102038e-01 3.971847233590e-01 +3.948309162959e-01 3.924149871231e-01 3.899376466332e-01 3.873996181087e-01 +3.848016371254e-01 3.821444513525e-01 3.794288203509e-01 3.766555153674e-01 +3.738253191273e-01 3.709390256240e-01 3.679974399062e-01 3.650013778619e-01 +3.619516660012e-01 3.588491412354e-01 3.556946506550e-01 3.524890513043e-01 +3.492332099545e-01 3.459280028748e-01 3.425743156007e-01 3.391730427008e-01 +3.357250875417e-01 3.322313620507e-01 3.286927864770e-01 3.251102891507e-01 +3.214848062405e-01 3.178172815100e-01 3.141086660715e-01 3.103599181392e-01 +3.065720027808e-01 3.027458916671e-01 2.988825628215e-01 2.949830003670e-01 +2.910481942728e-01 2.870791400995e-01 2.830768387438e-01 2.790422961814e-01 +2.749765232094e-01 2.708805351884e-01 2.667553517828e-01 2.626019967016e-01 +2.584214974372e-01 2.542148850054e-01 2.499831936829e-01 2.457274607465e-01 +2.414487262099e-01 2.371480325622e-01 2.328264245044e-01 2.284849486875e-01 +2.241246534486e-01 2.197465885493e-01 2.153518049117e-01 2.109413543570e-01 +2.065162893421e-01 2.020776626981e-01 1.976265273686e-01 1.931639361477e-01 +1.886909414203e-01 1.842085949006e-01 1.797179473734e-01 1.752200484348e-01 +1.707159462339e-01 1.662066872156e-01 1.616933158642e-01 1.571768744477e-01 +1.526584027636e-01 1.481389378853e-01 1.436195139099e-01 1.391011617074e-01 +1.345849086707e-01 1.300717784677e-01 1.255627907937e-01 1.210589611267e-01 +1.165613004829e-01 1.120708151746e-01 1.075885065698e-01 1.031153708529e-01 +9.865239878758e-02 9.420057548197e-02 8.976088015483e-02 8.533428590431e-02 +8.092175947859e-02 7.652426104855e-02 7.214274398262e-02 6.777815462382e-02 +6.343143206906e-02 5.910350795073e-02 5.479530622064e-02 5.050774293645e-02 +4.624172605044e-02 4.199815520094e-02 3.777792150620e-02 3.358190736100e-02 +2.941098623583e-02 2.526602247890e-02 2.114787112076e-02 1.705737768195e-02 +1.299537798329e-02 8.962697959276e-03 4.960153474277e-03 9.885501418266e-04 +-2.951316853084e-03 -6.858662928623e-03 -1.073271427760e-02 -1.457270803581e-02 +-1.837789244712e-02 -2.214752702537e-02 -2.588088271296e-02 -2.957724203610e-02 +-3.323589925677e-02 -3.685616052122e-02 -4.043734400507e-02 -4.397878005499e-02 +-4.747981132682e-02 -5.093979292026e-02 -5.435809250992e-02 -5.773409047285e-02 +-6.106718001243e-02 -6.435676727870e-02 -6.760227148491e-02 -7.080312502047e-02 +-7.395877356020e-02 -7.706867616980e-02 -8.013230540758e-02 -8.314914742247e-02 +-8.611870204815e-02 -8.904048289344e-02 -9.191401742883e-02 -9.473884706918e-02 +-9.751452725254e-02 -1.002406275151e-01 -1.029167315623e-01 -1.055424373360e-01 +-1.081173570775e-01 -1.106411173875e-01 -1.131133592807e-01 -1.155337382378e-01 +-1.179019242531e-01 -1.202176018776e-01 -1.224804702591e-01 -1.246902431776e-01 +-1.268466490771e-01 -1.289494310933e-01 -1.309983470776e-01 -1.329931696165e-01 +-1.349336860480e-01 -1.368196984730e-01 -1.386510237637e-01 -1.404274935675e-01 +-1.421489543068e-01 -1.438152671755e-01 -1.454263081311e-01 -1.469819678830e-01 +-1.484821518772e-01 -1.499267802761e-01 -1.513157879361e-01 -1.526491243796e-01 +-1.539267537644e-01 -1.551486548486e-01 -1.563148209519e-01 -1.574252599131e-01 +-1.584799940440e-01 -1.594790600789e-01 -1.604225091215e-01 -1.613104065866e-01 +-1.621428321394e-01 -1.629198796306e-01 -1.636416570279e-01 -1.643082863435e-01 +-1.649199035588e-01 -1.654766585451e-01 -1.659787149804e-01 -1.664262502634e-01 +-1.668194554238e-01 -1.671585350286e-01 -1.674437070858e-01 -1.676752029444e-01 +-1.678532671906e-01 -1.679781575418e-01 -1.680501447358e-01 -1.680695124184e-01 +-1.680365570265e-01 -1.679515876685e-01 -1.678149260022e-01 -1.676269061082e-01 +-1.673878743619e-01 -1.670981893012e-01 -1.667582214918e-01 -1.663683533897e-01 +-1.659289792006e-01 -1.654405047364e-01 -1.649033472693e-01 -1.643179353826e-01 +-1.636847088194e-01 -1.630041183284e-01 -1.622766255068e-01 -1.615027026413e-01 +-1.606828325460e-01 -1.598175083983e-01 -1.589072335721e-01 -1.579525214688e-01 +-1.569538953461e-01 -1.559118881443e-01 -1.548270423105e-01 -1.536999096209e-01 +-1.525310510007e-01 -1.513210363424e-01 -1.500704443212e-01 -1.487798622099e-01 +-1.474498856905e-01 -1.460811186652e-01 -1.446741730647e-01 -1.432296686553e-01 +-1.417482328444e-01 -1.402305004843e-01 -1.386771136742e-01 -1.370887215615e-01 +-1.354659801405e-01 -1.338095520513e-01 -1.321201063757e-01 -1.303983184336e-01 +-1.286448695767e-01 -1.268604469820e-01 -1.250457434442e-01 -1.232014571667e-01 +-1.213282915519e-01 -1.194269549906e-01 -1.174981606509e-01 -1.155426262657e-01 +-1.135610739201e-01 -1.115542298380e-01 -1.095228241678e-01 -1.074675907683e-01 +-1.053892669932e-01 -1.032885934764e-01 -1.011663139158e-01 -9.902317485756e-02 +-9.685992548010e-02 -9.467731737761e-02 -9.247610434384e-02 -9.025704215565e-02 +-8.802088835674e-02 -8.576840204139e-02 -8.350034363841e-02 -8.121747469527e-02 +-7.892055766257e-02 -7.661035567879e-02 -7.428763235551e-02 -7.195315156299e-02 +-6.960767721639e-02 -6.725197306245e-02 -6.488680246692e-02 -6.251292820257e-02 +-6.013111223805e-02 -5.774211552749e-02 -5.534669780101e-02 -5.294561735614e-02 +-5.053963085020e-02 -4.812949309377e-02 -4.571595684517e-02 -4.329977260615e-02 +-4.088168841881e-02 -3.846244966364e-02 -3.604279885905e-02 -3.362347546212e-02 +-3.120521567084e-02 -2.878875222779e-02 -2.637481422536e-02 -2.396412691254e-02 +-2.155741150330e-02 -1.915538498668e-02 -1.675875993862e-02 -1.436824433548e-02 +-1.198454136947e-02 -9.608349265921e-03 -7.240361102419e-03 -4.881264629992e-03 +-2.531742096235e-03 -1.924700705176e-04 2.135880728715e-03 4.452645604499e-03 +6.757166049726e-03 9.048789913281e-03 1.132687156392e-02 1.359077205184e-02 +1.583985926787e-02 1.807350810032e-02 2.029110058933e-02 2.249202607883e-02 +2.467568136597e-02 2.684147084793e-02 2.898880666628e-02 3.111710884866e-02 +3.322580544777e-02 3.531433267779e-02 3.738213504801e-02 3.942866549371e-02 +4.145338550431e-02 4.345576524869e-02 4.543528369771e-02 4.739142874380e-02 +4.932369731770e-02 5.123159550235e-02 5.311463864369e-02 5.497235145865e-02 +5.680426814004e-02 5.860993245852e-02 6.038889786141e-02 6.214072756859e-02 +6.386499466524e-02 6.556128219149e-02 6.722918322899e-02 6.886830098432e-02 +7.047824886926e-02 7.205865057793e-02 7.360914016073e-02 7.512936209506e-02 +7.661897135291e-02 7.807763346516e-02 7.950502458272e-02 8.090083153442e-02 +8.226475188160e-02 8.359649396955e-02 8.489577697561e-02 8.616233095403e-02 +8.739589687760e-02 8.859622667597e-02 8.976308327066e-02 9.089624060691e-02 +9.199548368210e-02 9.306060857102e-02 9.409142244780e-02 9.508774360455e-02 +9.604940146679e-02 9.697623660553e-02 9.786810074617e-02 9.872485677404e-02 +9.954637873680e-02 1.003325518435e-01 1.010832724605e-01 1.017984481038e-01 +1.024779974292e-01 1.031218502174e-01 1.037299473580e-01 1.043022408287e-01 +1.048386936725e-01 1.053392799704e-01 1.058039848127e-01 1.062328042653e-01 +1.066257453348e-01 1.069828259286e-01 1.073040748135e-01 1.075895315703e-01 +1.078392465461e-01 1.080532808026e-01 1.082317060623e-01 1.083746046517e-01 +1.084820694408e-01 1.085542037805e-01 1.085911214368e-01 1.085929465218e-01 +1.085598134227e-01 1.084918667272e-01 1.083892611464e-01 1.082521614352e-01 +1.080807423093e-01 1.078751883606e-01 1.076356939687e-01 1.073624632107e-01 +1.070557097679e-01 1.067156568306e-01 1.063425369993e-01 1.059365921843e-01 +1.054980735025e-01 1.050272411721e-01 1.045243644044e-01 1.039897212934e-01 +1.034235987037e-01 1.028262921553e-01 1.021981057065e-01 1.015393518350e-01 +1.008503513160e-01 1.001314330992e-01 9.938293418293e-02 9.860519948654e-02 +9.779858172102e-02 9.696344125737e-02 9.610014599323e-02 9.520907121766e-02 +9.429059947404e-02 9.334512042133e-02 9.237303069346e-02 9.137473375723e-02 +9.035063976843e-02 8.930116542647e-02 8.822673382747e-02 8.712777431584e-02 +8.600472233443e-02 8.485801927336e-02 8.368811231739e-02 8.249545429210e-02 +8.128050350877e-02 8.004372360812e-02 7.878558340283e-02 7.750655671905e-02 +7.620712223680e-02 7.488776332941e-02 7.354896790198e-02 7.219122822898e-02 +7.081504079101e-02 6.942090611072e-02 6.800932858799e-02 6.658081633451e-02 +6.513588100758e-02 6.367503764340e-02 6.219880448981e-02 6.070770283852e-02 +5.920225685694e-02 5.768299341955e-02 5.615044193901e-02 5.460513419693e-02 +5.304760417444e-02 5.147838788255e-02 4.989802319239e-02 4.830704966538e-02 +4.670600838332e-02 4.509544177855e-02 4.347589346415e-02 4.184790806431e-02 +4.021203104476e-02 3.856880854353e-02 3.691878720195e-02 3.526251399594e-02 +3.360053606767e-02 3.193340055767e-02 3.026165443743e-02 2.858584434239e-02 +2.690651640569e-02 2.522421609232e-02 2.353948803412e-02 2.185287586535e-02 +2.016492205910e-02 1.847616776446e-02 1.678715264456e-02 1.509841471550e-02 +1.341049018621e-02 1.172391329930e-02 1.003921617299e-02 8.356928644037e-03 +6.677578111852e-03 5.001689383741e-03 3.329784521373e-03 1.662382688506e-03 +-1.014291382965e-14 -1.656850627876e-03 -3.307659625620e-03 -4.951920917442e-03 +-6.589132066614e-03 + L N + 1 3 +0.000000000000e+00 7.814122690509e-03 1.562566868360e-02 2.343206229337e-02 +3.123072985647e-02 3.901910074235e-02 4.679460836213e-02 5.455469117579e-02 +6.229679369723e-02 7.001836749665e-02 7.771687220001e-02 8.538977648500e-02 +9.303455907313e-02 1.006487097176e-01 1.082297301863e-01 1.157751352398e-01 +1.232824536041e-01 1.307492289365e-01 1.381730207862e-01 1.455514055471e-01 +1.528819774045e-01 1.601623492731e-01 1.673901537278e-01 1.745630439255e-01 +1.816786945189e-01 1.887348025602e-01 1.957290883961e-01 2.026592965522e-01 +2.095231966074e-01 2.163185840577e-01 2.230432811687e-01 2.296951378169e-01 +2.362720323192e-01 2.427718722500e-01 2.491925952466e-01 2.555321698005e-01 +2.617885960372e-01 2.679599064811e-01 2.740441668073e-01 2.800394765795e-01 +2.859439699728e-01 2.917558164826e-01 2.974732216175e-01 3.030944275781e-01 +3.086177139192e-01 3.140413981968e-01 3.193638365984e-01 3.245834245575e-01 +3.296985973511e-01 3.347078306804e-01 3.396096412342e-01 3.444025872356e-01 +3.490852689701e-01 3.536563292967e-01 3.581144541406e-01 3.624583729681e-01 +3.666868592425e-01 3.707987308618e-01 3.747928505779e-01 3.786681263961e-01 +3.824235119562e-01 3.860580068944e-01 3.895706571850e-01 3.929605554638e-01 +3.962268413307e-01 3.993687016333e-01 4.023853707308e-01 4.052761307368e-01 +4.080403117436e-01 4.106772920251e-01 4.131864982204e-01 4.155674054966e-01 +4.178195376915e-01 4.199424674358e-01 4.219358162554e-01 4.237992546526e-01 +4.255325021671e-01 4.271353274170e-01 4.286075481190e-01 4.299490310879e-01 +4.311596922160e-01 4.322394964326e-01 4.331884576420e-01 4.340066386425e-01 +4.346941510237e-01 4.352511550455e-01 4.356778594951e-01 4.359745215251e-01 +4.361414464714e-01 4.361789876513e-01 4.360875461417e-01 4.358675705376e-01 +4.355195566920e-01 4.350440474349e-01 4.344416322746e-01 4.337129470789e-01 +4.328586737381e-01 4.318795398086e-01 4.307763181386e-01 4.295498264749e-01 +4.282009270517e-01 4.267305261617e-01 4.251395737088e-01 4.234290627438e-01 +4.216000289823e-01 4.196535503061e-01 4.175907462470e-01 4.154127774542e-01 +4.131208451458e-01 4.107161905434e-01 4.082000942915e-01 4.055738758607e-01 +4.028388929362e-01 3.999965407908e-01 3.970482516432e-01 3.939954940025e-01 +3.908397719974e-01 3.875826246927e-01 3.842256253917e-01 3.807703809252e-01 +3.772185309284e-01 3.735717471047e-01 3.698317324772e-01 3.660002206286e-01 +3.620789749300e-01 3.580697877574e-01 3.539744796986e-01 3.497948987490e-01 +3.455329194973e-01 3.411904423020e-01 3.367693924580e-01 3.322717193544e-01 +3.276993956239e-01 3.230544162842e-01 3.183387978704e-01 3.135545775621e-01 +3.087038123009e-01 3.037885779036e-01 2.988109681678e-01 2.937730939718e-01 +2.886770823698e-01 2.835250756809e-01 2.783192305746e-01 2.730617171515e-01 +2.677547180202e-01 2.624004273707e-01 2.570010500456e-01 2.515588006072e-01 +2.460759024041e-01 2.405545866350e-01 2.349970914112e-01 2.294056608186e-01 +2.237825439790e-01 2.181299941111e-01 2.124502675921e-01 2.067456230196e-01 +2.010183202750e-01 1.952706195884e-01 1.895047806052e-01 1.837230614551e-01 +1.779277178241e-01 1.721210020292e-01 1.663051620971e-01 1.604824408467e-01 +1.546550749755e-01 1.488252941514e-01 1.429953201094e-01 1.371673657534e-01 +1.313436342646e-01 1.255263182154e-01 1.197175986908e-01 1.139196444159e-01 +1.081346108919e-01 1.023646395384e-01 9.661185684528e-02 9.087837353237e-02 +8.516628371778e-02 7.947766409582e-02 7.381457312425e-02 6.817905022147e-02 +6.257311497382e-02 5.699876635353e-02 5.145798194744e-02 4.595271719691e-02 +4.048490464928e-02 3.505645322102e-02 2.966924747309e-02 2.432514689860e-02 +1.902598522323e-02 1.377356971852e-02 8.569680528524e-03 3.416070009878e-03 +-1.685537914316e-03 -6.733448386569e-03 -1.172599623281e-02 -1.666154656564e-02 +-2.153849537289e-02 -2.635527009107e-02 -3.111033016370e-02 -3.580216758418e-02 +-4.042930742302e-02 -4.499030833920e-02 -4.948376307554e-02 -5.390829893788e-02 +-5.826257825777e-02 -6.254529883867e-02 -6.675519438543e-02 -7.089103491686e-02 +-7.495162716128e-02 -7.893581493492e-02 -8.284247950303e-02 -8.667053992355e-02 +-9.041895337328e-02 -9.408671545643e-02 -9.767286049539e-02 -1.011764618037e-01 +-1.045966319412e-01 -1.079325229511e-01 -1.111833265790e-01 -1.143482744738e-01 +-1.174266383711e-01 -1.204177302569e-01 -1.233209025149e-01 -1.261355480545e-01 +-1.288611004204e-01 -1.314970338849e-01 -1.340428635211e-01 -1.364981452580e-01 +-1.388624759179e-01 -1.411354932352e-01 -1.433168758566e-01 -1.454063433243e-01 +-1.474036560402e-01 -1.493086152126e-01 -1.511210627846e-01 -1.528408813451e-01 +-1.544679940216e-01 -1.560023643555e-01 -1.574439961601e-01 -1.587929333606e-01 +-1.600492598173e-01 -1.612130991309e-01 -1.622846144317e-01 -1.632640081506e-01 +-1.641515217746e-01 -1.649474355844e-01 -1.656520683768e-01 -1.662657771693e-01 +-1.667889568901e-01 -1.672220400507e-01 -1.675654964039e-01 -1.678198325857e-01 +-1.679855917413e-01 -1.680633531372e-01 -1.680537317574e-01 -1.679573778846e-01 +-1.677749766682e-01 -1.675072476768e-01 -1.671549444372e-01 -1.667188539595e-01 +-1.661997962490e-01 -1.655986238042e-01 -1.649162211023e-01 -1.641535040722e-01 +-1.633114195542e-01 -1.623909447482e-01 -1.613930866501e-01 -1.603188814758e-01 +-1.591693940749e-01 -1.579457173330e-01 -1.566489715627e-01 -1.552803038852e-01 +-1.538408876014e-01 -1.523319215527e-01 -1.507546294736e-01 -1.491102593337e-01 +-1.474000826723e-01 -1.456253939232e-01 -1.437875097328e-01 -1.418877682690e-01 +-1.399275285239e-01 -1.379081696080e-01 -1.358310900394e-01 -1.336977070249e-01 +-1.315094557360e-01 -1.292677885787e-01 -1.269741744584e-01 -1.246300980397e-01 +-1.222370590006e-01 -1.197965712841e-01 -1.173101623444e-01 -1.147793723900e-01 +-1.122057536239e-01 -1.095908694807e-01 -1.069362938606e-01 -1.042436103626e-01 +-1.015144115146e-01 -9.875029800281e-02 -9.595287790002e-02 -9.312376589286e-02 +-9.026458250914e-02 -8.737695334494e-02 -8.446250829219e-02 -8.152288076701e-02 +-7.855970693909e-02 -7.557462496255e-02 -7.256927420864e-02 -6.954529450057e-02 +-6.650432535085e-02 -6.344800520151e-02 -6.037797066753e-02 -5.729585578377e-02 +-5.420329125584e-02 -5.110190371520e-02 -4.799331497879e-02 -4.487914131359e-02 +-4.176099270636e-02 -3.864047213898e-02 -3.551917486967e-02 -3.239868772032e-02 +-2.928058837044e-02 -2.616644465787e-02 -2.305781388658e-02 -1.995624214201e-02 +-1.686326361402e-02 -1.378039992797e-02 -1.070915948401e-02 -7.651036805057e-03 +-4.607511893629e-03 -1.580049597793e-03 1.429901013411e-03 4.420907264870e-03 +7.391553480355e-03 1.034044157725e-02 1.326619165087e-02 1.616744254798e-02 +1.904285242952e-02 2.189109932205e-02 2.471088165778e-02 2.750091880313e-02 +3.025995157528e-02 3.298674274679e-02 3.568007753797e-02 3.833876409675e-02 +4.096163396600e-02 4.354754253802e-02 4.609536949598e-02 4.860401924232e-02 +5.107242131375e-02 5.349953078282e-02 5.588432864579e-02 5.822582219690e-02 +6.052304538854e-02 6.277505917758e-02 6.498095185738e-02 6.713983937571e-02 +6.925086563815e-02 7.131320279710e-02 7.332605152623e-02 7.528864128027e-02 +7.720023054004e-02 7.906010704276e-02 8.086758799741e-02 8.262202028525e-02 +8.432278064535e-02 8.596927584507e-02 8.756094283558e-02 8.909724889224e-02 +9.057769173993e-02 9.200179966323e-02 9.336913160161e-02 9.467927722934e-02 +9.593185702046e-02 9.712652229861e-02 9.826295527175e-02 9.934086905198e-02 +1.003600076603e-01 1.013201460162e-01 1.022210899131e-01 1.030626759780e-01 +1.038447716168e-01 1.045672749454e-01 1.052301147051e-01 1.058332501648e-01 +1.063766710073e-01 1.068603972029e-01 1.072844788672e-01 1.076489961059e-01 +1.079540588450e-01 1.081998066476e-01 1.083864085166e-01 1.085140626839e-01 +1.085829963862e-01 1.085934656274e-01 1.085457549284e-01 1.084401770627e-01 +1.082770727808e-01 1.080568105204e-01 1.077797861056e-01 1.074464224324e-01 +1.070571691435e-01 1.066125022902e-01 1.061129239830e-01 1.055589620309e-01 +1.049511695693e-01 1.042901246767e-01 1.035764299807e-01 1.028107122536e-01 +1.019936219975e-01 1.011258330189e-01 1.002080419942e-01 9.924096802516e-02 +9.822535218442e-02 9.716195705293e-02 9.605156624776e-02 9.489498394150e-02 +9.369303437333e-02 9.244656135192e-02 9.115642775059e-02 8.982351499480e-02 +8.844872254249e-02 8.703296735729e-02 8.557718337514e-02 8.408232096433e-02 +8.254934637952e-02 8.097924120983e-02 7.937300182131e-02 7.773163879423e-02 +7.605617635534e-02 7.434765180535e-02 7.260711494217e-02 7.083562747990e-02 +6.903426246414e-02 6.720410368368e-02 6.534624507912e-02 6.346179014847e-02 +6.155185135024e-02 5.961754950420e-02 5.766001319015e-02 5.568037814500e-02 +5.367978665851e-02 5.165938696787e-02 4.962033265158e-02 4.756378202279e-02 +4.549089752252e-02 4.340284511298e-02 4.130079367130e-02 3.918591438401e-02 +3.705938014256e-02 3.492236494010e-02 3.277604326993e-02 3.062158952582e-02 +2.846017740458e-02 2.629297931104e-02 2.412116576589e-02 2.194590481650e-02 +1.976836145117e-02 1.758969701691e-02 1.541106864123e-02 1.323362865800e-02 +1.105852403783e-02 8.886895823170e-03 6.719878568353e-03 4.558599784920e-03 +2.404179392452e-03 2.577291751564e-04 -1.879647755516e-03 -4.006857491995e-03 +-6.122815855197e-03 -8.226448912379e-03 -1.031669348800e-02 -1.239249766736e-02 +-1.445282129278e-02 -1.649663645210e-02 -1.852292795931e-02 -2.053069382701e-02 +-2.251894573059e-02 -2.448670946386e-02 -2.643302538598e-02 -2.835694885939e-02 +-3.025755067870e-02 -3.213391749020e-02 -3.398515220194e-02 -3.581037438412e-02 +-3.760872065965e-02 -3.937934508470e-02 -4.112141951907e-02 -4.283413398634e-02 +-4.451669702342e-02 -4.616833601959e-02 -4.778829754478e-02 -4.937584766694e-02 +-5.093027225844e-02 -5.245087729134e-02 -5.393698912143e-02 -5.538795476092e-02 +-5.680314213965e-02 -5.818194035487e-02 -5.952375990923e-02 -6.082803293718e-02 +-6.209421341953e-02 -6.332177738611e-02 -6.451022310658e-02 -6.565907126920e-02 +-6.676786514750e-02 -6.783617075500e-02 -6.886357698766e-02 -6.984969575424e-02 +-7.079416209445e-02 -7.169663428484e-02 -7.255679393255e-02 -7.337434605673e-02 +-7.414901915772e-02 -7.488056527406e-02 -7.556876002718e-02 -7.621340265389e-02 +-7.681431602672e-02 -7.737134666202e-02 -7.788436471594e-02 -7.835326396837e-02 +-7.877796179470e-02 -7.915839912568e-02 -7.949454039533e-02 -7.978637347687e-02 +-8.003390960693e-02 -8.023718329801e-02 -8.039625223919e-02 -8.051119718538e-02 +-8.058212183500e-02 -8.060915269633e-02 -8.059243894251e-02 -8.053215225545e-02 +-8.042848665856e-02 -8.028165833868e-02 -8.009190545703e-02 -7.985948794959e-02 +-7.958468731689e-02 -7.926780640330e-02 -7.890916916617e-02 -7.850912043475e-02 +-7.806802565919e-02 -7.758627064966e-02 -7.706426130588e-02 -7.650242333713e-02 +-7.590120197298e-02 -7.526106166478e-02 -7.458248577834e-02 -7.386597627771e-02 +-7.311205340040e-02 -7.232125532426e-02 -7.149413782610e-02 -7.063127393228e-02 +-6.973325356161e-02 -6.880068316052e-02 -6.783418533096e-02 -6.683439845105e-02 +-6.580197628881e-02 -6.473758760914e-02 -6.364191577426e-02 -6.251565833792e-02 +-6.135952663348e-02 -6.017424535615e-02 -5.896055213969e-02 -5.771919712767e-02 +-5.645094253960e-02 -5.515656223220e-02 -5.383684125599e-02 -5.249257540744e-02 +-5.112457077695e-02 -4.973364329296e-02 -4.832061826225e-02 -4.688632990695e-02 +-4.543162089824e-02 -4.395734188717e-02 -4.246435103276e-02 -4.095351352768e-02 +-3.942570112175e-02 -3.788179164343e-02 -3.632266851973e-02 -3.474922029462e-02 +-3.316234014624e-02 -3.156292540326e-02 -2.995187706046e-02 -2.833009929399e-02 +-2.669849897633e-02 -2.505798519148e-02 -2.340946875033e-02 -2.175386170669e-02 +-2.009207687410e-02 -1.842502734374e-02 -1.675362600365e-02 -1.507878505949e-02 +-1.340141555709e-02 -1.172242690711e-02 -1.004272641190e-02 -8.363218794972e-03 +-6.684805733115e-03 -5.008385391616e-03 -3.334851962633e-03 -1.665095207049e-03 +5.494622864293e-15 1.659554119718e-03 3.312693396035e-03 4.958550297758e-03 +6.596263956071e-03 + L N + 1 4 +0.000000000000e+00 9.566298184911e-03 1.912786846262e-02 2.867998570765e-02 +3.821793035619e-02 4.773699118245e-02 5.723246806975e-02 6.669967477440e-02 +7.613394168073e-02 8.553061854550e-02 9.488507722985e-02 1.041927144171e-01 +1.134489543148e-01 1.226492513388e-01 1.317890927784e-01 1.408640014402e-01 +1.498695382692e-01 1.588013049459e-01 1.676549464565e-01 1.764261536362e-01 +1.851106656831e-01 1.937042726403e-01 2.022028178469e-01 2.106022003537e-01 +2.188983773037e-01 2.270873662761e-01 2.351652475906e-01 2.431281665722e-01 +2.509723357752e-01 2.586940371625e-01 2.662896242426e-01 2.737555241599e-01 +2.810882397377e-01 2.882843514741e-01 2.953405194877e-01 3.022534854126e-01 +3.090200742414e-01 3.156371961159e-01 3.221018480627e-01 3.284111156742e-01 +3.345621747332e-01 3.405522927796e-01 3.463788306200e-01 3.520392437773e-01 +3.575310838804e-01 3.628519999927e-01 3.679997398800e-01 3.729721512143e-01 +3.777671827158e-01 3.823828852303e-01 3.868174127419e-01 3.910690233214e-01 +3.951360800081e-01 3.990170516260e-01 4.027105135334e-01 4.062151483048e-01 +4.095297463462e-01 4.126532064420e-01 4.155845362341e-01 4.183228526327e-01 +4.208673821585e-01 4.232174612166e-01 4.253725363010e-01 4.273321641310e-01 +4.290960117185e-01 4.306638563663e-01 4.320355855979e-01 4.332111970191e-01 +4.341907981105e-01 4.349746059520e-01 4.355629468798e-01 4.359562560755e-01 +4.361550770876e-01 4.361600612865e-01 4.359719672530e-01 4.355916601007e-01 +4.350201107332e-01 4.342583950360e-01 4.333076930044e-01 4.321692878079e-01 +4.308445647915e-01 4.293350104145e-01 4.276422111287e-01 4.257678521951e-01 +4.237137164414e-01 4.214816829602e-01 4.190737257501e-01 4.164919122987e-01 +4.137384021101e-01 4.108154451784e-01 4.077253804055e-01 4.044706339677e-01 +4.010537176303e-01 3.974772270111e-01 3.937438397957e-01 3.898563139041e-01 +3.858174856110e-01 3.816302676203e-01 3.772976470959e-01 3.728226836497e-01 +3.682085072877e-01 3.634583163171e-01 3.585753752142e-01 3.535630124553e-01 +3.484246183124e-01 3.431636426144e-01 3.377835924758e-01 3.322880299949e-01 +3.266805699217e-01 3.209648772982e-01 3.151446650732e-01 3.092236916908e-01 +3.032057586576e-01 2.970947080870e-01 2.908944202243e-01 2.846088109542e-01 +2.782418292907e-01 2.717974548527e-01 2.652796953271e-01 2.586925839194e-01 +2.520401767950e-01 2.453265505129e-01 2.385557994521e-01 2.317320332342e-01 +2.248593741423e-01 2.179419545395e-01 2.109839142871e-01 2.039893981648e-01 +1.969625532959e-01 1.899075265763e-01 1.828284621119e-01 1.757294986646e-01 +1.686147671085e-01 1.614883878982e-01 1.543544685513e-01 1.472171011461e-01 +1.400803598361e-01 1.329482983835e-01 1.258249477125e-01 1.187143134847e-01 +1.116203736975e-01 1.045470763076e-01 9.749833688091e-02 9.047803626969e-02 +8.349001831981e-02 7.653808760819e-02 6.962600721258e-02 6.275749651498e-02 +5.593622903979e-02 4.916583032846e-02 4.244987585155e-02 3.579188895980e-02 +2.919533887523e-02 2.266363872368e-02 1.620014360995e-02 9.808148736539e-03 +3.490887567426e-03 -2.748469962288e-03 -8.906819189644e-03 -1.498112241901e-02 +-2.096841056821e-02 -2.686578476455e-02 -3.267041788992e-02 -3.837955607400e-02 +-4.399052013474e-02 -4.950070696528e-02 -5.490759086660e-02 -6.020872482503e-02 +-6.540174173404e-02 -7.048435555960e-02 -7.545436244846e-02 -8.030964177882e-02 +-8.504815715278e-02 -8.966795733019e-02 -9.416717710327e-02 -9.854403811174e-02 +-1.027968495980e-01 -1.069240091019e-01 -1.109240030955e-01 -1.147954075558e-01 +-1.185368884781e-01 -1.221472023268e-01 -1.256251964254e-01 -1.289698092854e-01 +-1.321800708730e-01 -1.352551028153e-01 -1.381941185442e-01 -1.409964233795e-01 +-1.436614145509e-01 -1.461885811587e-01 -1.485775040737e-01 -1.508278557766e-01 +-1.529394001376e-01 -1.549119921350e-01 -1.567455775156e-01 -1.584401923947e-01 +-1.599959627980e-01 -1.614131041459e-01 -1.626919206784e-01 -1.638328048251e-01 +-1.648362365168e-01 -1.657027824425e-01 -1.664330952505e-01 -1.670279126954e-01 +-1.674880567315e-01 -1.678144325526e-01 -1.680080275809e-01 -1.680699104034e-01 +-1.680012296587e-01 -1.678032128742e-01 -1.674771652549e-01 -1.670244684244e-01 +-1.664465791196e-01 -1.657450278406e-01 -1.649214174546e-01 -1.639774217584e-01 +-1.629147839977e-01 -1.617353153453e-01 -1.604408933404e-01 -1.590334602880e-01 +-1.575150216224e-01 -1.558876442330e-01 -1.541534547566e-01 -1.523146378354e-01 +-1.503734343426e-01 -1.483321395777e-01 -1.461931014316e-01 -1.439587185236e-01 +-1.416314383123e-01 -1.392137551793e-01 -1.367082084909e-01 -1.341173806359e-01 +-1.314438950423e-01 -1.286904141746e-01 -1.258596375129e-01 -1.229542995144e-01 +-1.199771675604e-01 -1.169310398889e-01 -1.138187435147e-01 -1.106431321393e-01 +-1.074070840500e-01 -1.041135000127e-01 -1.007653011565e-01 -9.736542685513e-02 +-9.391683260303e-02 -9.042248789093e-02 -8.688537408014e-02 -8.330848227797e-02 +-7.969481121567e-02 -7.604736513015e-02 -7.236915165120e-02 -6.866317969545e-02 +-6.493245736860e-02 -6.117998987743e-02 -5.740877745286e-02 -5.362181328560e-02 +-4.982208147572e-02 -4.601255499754e-02 -4.219619368123e-02 -3.837594221246e-02 +-3.455472815141e-02 -3.073545997251e-02 -2.692102512614e-02 -2.311428812369e-02 +-1.931808864708e-02 -1.553523968410e-02 -1.176852569077e-02 -8.020700781853e-03 +-4.294486950730e-03 -5.925723198338e-04 3.082390577347e-03 6.727786481505e-03 +1.034103905898e-02 1.391961251838e-02 1.746101319137e-02 2.096279107660e-02 +2.442254134593e-02 2.783790581184e-02 3.120657435532e-02 3.452628631329e-02 +3.779483182466e-02 4.101005313436e-02 4.416984585451e-02 4.727216018190e-02 +5.031500207134e-02 5.329643436387e-02 5.621457786948e-02 5.906761240362e-02 +6.185377777692e-02 6.457137473767e-02 6.721876586647e-02 6.979437642272e-02 +7.229669514237e-02 7.472427498670e-02 7.707573384170e-02 7.934975516771e-02 +8.154508859916e-02 8.366055049403e-02 8.569502443295e-02 8.764746166772e-02 +8.951688151909e-02 9.130237172376e-02 9.300308873062e-02 9.461825794594e-02 +9.614717392794e-02 9.758920053040e-02 9.894377099563e-02 1.002103879969e-01 +1.013886236305e-01 1.024781193575e-01 1.034785858955e-01 1.043898030609e-01 +1.052116195617e-01 1.059439527411e-01 1.065867882727e-01 1.071401798072e-01 +1.076042485711e-01 1.079791829190e-01 1.082652378377e-01 1.084627344050e-01 +1.085720592028e-01 1.085936636840e-01 1.085280634965e-01 1.083758377621e-01 +1.081376283127e-01 1.078141388845e-01 1.074061342699e-01 1.069144394291e-01 +1.063399385610e-01 1.056835741356e-01 1.049463458876e-01 1.041293097723e-01 +1.032335768856e-01 1.022603123479e-01 1.012107341531e-01 1.000861119842e-01 +9.888776599662e-02 9.761706556868e-02 9.627542802251e-02 9.486431731473e-02 +9.338524269884e-02 9.183975736014e-02 9.022945702425e-02 8.855597854051e-02 +8.682099844128e-02 8.502623147829e-02 8.317342913729e-02 8.126437813212e-02 +7.930089887935e-02 7.728484395482e-02 7.521809653307e-02 7.310256881118e-02 +7.094020041790e-02 6.873295680958e-02 6.648282765399e-02 6.419182520331e-02 +6.186198265754e-02 5.949535251952e-02 5.709400494294e-02 5.466002607442e-02 +5.219551639106e-02 4.970258903460e-02 4.718336814347e-02 4.463998718407e-02 +4.207458728231e-02 3.948931555689e-02 3.688632345530e-02 3.426776509407e-02 +3.163579560413e-02 2.899256948279e-02 2.634023895338e-02 2.368095233377e-02 +2.101685241502e-02 1.835007485117e-02 1.568274656153e-02 1.301698414641e-02 +1.035489231759e-02 7.698562344555e-03 5.050070517548e-03 2.411476628665e-03 +-2.151775280819e-04 -2.827869636607e-03 -5.424598317503e-03 -8.003384564679e-03 +-1.056227315890e-02 -1.309933405728e-02 -1.561266375770e-02 -1.810038663739e-02 +-2.056065626453e-02 -2.299165668228e-02 -2.539160366410e-02 -2.775874593974e-02 +-3.009136639095e-02 -3.238778321625e-02 -3.464635106392e-02 -3.686546213246e-02 +-3.904354723792e-02 -4.117907684734e-02 -4.327056207765e-02 -4.531655565950e-02 +-4.731565286529e-02 -4.926649240097e-02 -5.116775726097e-02 -5.301817554583e-02 +-5.481652124205e-02 -5.656161496362e-02 -5.825232465496e-02 -5.988756625480e-02 +-6.146630432063e-02 -6.298755261344e-02 -6.445037464250e-02 -6.585388416976e-02 +-6.719724567388e-02 -6.847967477340e-02 -6.970043860922e-02 -7.085885618590e-02 +-7.195429867199e-02 -7.298618965913e-02 -7.395400537984e-02 -7.485727488428e-02 +-7.569558017556e-02 -7.646855630406e-02 -7.717589142062e-02 -7.781732678871e-02 +-7.839265675589e-02 -7.890172868448e-02 -7.934444284195e-02 -7.972075225095e-02 +-8.003066249945e-02 -8.027423151132e-02 -8.045156927739e-02 -8.056283754771e-02 +-8.060824948509e-02 -8.058806928051e-02 -8.050261173076e-02 -8.035224177872e-02 +-8.013737401696e-02 -7.985847215488e-02 -7.951604845026e-02 -7.911066310550e-02 +-7.864292362930e-02 -7.811348416438e-02 -7.752304478185e-02 -7.687235074284e-02 +-7.616219172820e-02 -7.539340103691e-02 -7.456685475382e-02 -7.368347088773e-02 +-7.274420848031e-02 -7.175006668678e-02 -7.070208382918e-02 -6.960133642298e-02 +-6.844893817790e-02 -6.724603897383e-02 -6.599382381271e-02 -6.469351174720e-02 +-6.334635478716e-02 -6.195363678477e-02 -6.051667229927e-02 -5.903680544223e-02 +-5.751540870432e-02 -5.595388176459e-02 -5.435365028318e-02 -5.271616467847e-02 +-5.104289888967e-02 -4.933534912586e-02 -4.759503260246e-02 -4.582348626622e-02 +-4.402226550965e-02 -4.219294287602e-02 -4.033710675585e-02 -3.845636007610e-02 +-3.655231898285e-02 -3.462661151875e-02 -3.268087629616e-02 -3.071676116695e-02 +-2.873592189021e-02 -2.674002079869e-02 -2.473072546512e-02 -2.270970736940e-02 +-2.067864056774e-02 -1.863920036469e-02 -1.659306198916e-02 -1.454189927534e-02 +-1.248738334968e-02 -1.043118132471e-02 -8.374955000901e-03 -6.320359577409e-03 +-4.269042372712e-03 -2.222641556095e-03 -1.827848909305e-04 1.848911509319e-03 +3.870844411453e-03 5.881424678326e-03 7.879078469210e-03 9.862248423814e-03 +1.182939482914e-02 1.377899676827e-02 1.570955325036e-02 1.761958432087e-02 +1.950763215140e-02 2.137226210821e-02 2.321206379883e-02 2.502565209581e-02 +2.681166813713e-02 2.856878030232e-02 3.029568516389e-02 3.199110841311e-02 +3.365380575983e-02 3.528256380540e-02 3.687620088838e-02 3.843356790231e-02 +3.995354908502e-02 4.143506277906e-02 4.287706216257e-02 4.427853595036e-02 +4.563850906446e-02 4.695604327404e-02 4.823023780406e-02 4.946022991235e-02 +5.064519543483e-02 5.178434929852e-02 5.287694600197e-02 5.392228006297e-02 +5.491968643324e-02 5.586854087979e-02 5.676826033303e-02 5.761830320108e-02 +5.841816965056e-02 5.916740185339e-02 5.986558419979e-02 6.051234347725e-02 +6.110734901553e-02 6.165031279764e-02 6.214098953688e-02 6.257917671994e-02 +6.296471461614e-02 6.329748625293e-02 6.357741735781e-02 6.380447626677e-02 +6.397867379938e-02 6.410006310095e-02 6.416873945173e-02 6.418484004354e-02 +6.414854372412e-02 6.406007070949e-02 6.391968226458e-02 6.372768035254e-02 +6.348440725319e-02 6.319024515079e-02 6.284561569178e-02 6.245097951280e-02 +6.200683573945e-02 6.151372145639e-02 6.097221114917e-02 6.038291611833e-02 +5.974648386642e-02 5.906359745837e-02 5.833497485590e-02 5.756136822652e-02 +5.674356322773e-02 5.588237826720e-02 5.497866373929e-02 5.403330123899e-02 +5.304720275355e-02 5.202130983283e-02 5.095659273893e-02 4.985404957584e-02 +4.871470539995e-02 4.753961131201e-02 4.632984353155e-02 4.508650245428e-02 +4.381071169345e-02 4.250361710595e-02 4.116638580389e-02 3.980020515251e-02 +3.840628175531e-02 3.698584042714e-02 3.554012315624e-02 3.407038805589e-02 +3.257790830667e-02 3.106397109021e-02 2.952987651514e-02 2.797693653625e-02 +2.640647386774e-02 2.481982089132e-02 2.321831856014e-02 2.160331529936e-02 +1.997616590430e-02 1.833823043703e-02 1.669087312218e-02 1.503546124304e-02 +1.337336403858e-02 1.170595160250e-02 1.003459378496e-02 8.360659098012e-03 +6.685513625474e-03 5.010519938161e-03 3.337036015286e-03 1.666414172876e-03 +1.228805779297e-14 -1.660868696267e-03 -3.314862936615e-03 -4.960663604753e-03 +-6.596962471817e-03 + L N + 1 5 +0.000000000000e+00 1.131608597450e-02 2.262434588731e-02 3.391696012004e-02 +4.518612193520e-02 5.642404390216e-02 6.762296430584e-02 7.877515353239e-02 +8.987292042600e-02 1.009086186114e-01 1.118746527759e-01 1.227634849063e-01 +1.335676404736e-01 1.442797145617e-01 1.548923779332e-01 1.653983830274e-01 +1.757905698857e-01 1.860618719981e-01 1.962053220662e-01 2.062140576774e-01 +2.160813268855e-01 2.258004936922e-01 2.353650434252e-01 2.447685880078e-01 +2.540048711153e-01 2.630677732140e-01 2.719513164776e-01 2.806496695782e-01 +2.891571523448e-01 2.974682402893e-01 3.055775689917e-01 3.134799383442e-01 +3.211703166482e-01 3.286438445616e-01 3.358958388932e-01 3.429217962401e-01 +3.497173964652e-01 3.562785060130e-01 3.626011810586e-01 3.686816704895e-01 +3.745164187161e-01 3.801020683092e-01 3.854354624625e-01 3.905136472772e-01 +3.953338738681e-01 3.998936002880e-01 4.041904932705e-01 4.082224297880e-01 +4.119874984258e-01 4.154840005689e-01 4.187104514033e-01 4.216655807285e-01 +4.243483335826e-01 4.267578706790e-01 4.288935686542e-01 4.307550201275e-01 +4.323420335719e-01 4.336546329976e-01 4.346930574476e-01 4.354577603067e-01 +4.359494084250e-01 4.361688810566e-01 4.361172686140e-01 4.357958712415e-01 +4.352061972076e-01 4.343499611183e-01 4.332290819538e-01 4.318456809303e-01 +4.302020791890e-01 4.283007953151e-01 4.261445426886e-01 4.237362266710e-01 +4.210789416280e-01 4.181759677951e-01 4.150307679855e-01 4.116469841455e-01 +4.080284337610e-01 4.041791061172e-01 4.001031584169e-01 3.958049117592e-01 +3.912888469852e-01 3.865596003913e-01 3.816219593178e-01 3.764808576141e-01 +3.711413709872e-01 3.656087122358e-01 3.598882263766e-01 3.539853856660e-01 +3.479057845226e-01 3.416551343555e-01 3.352392583024e-01 3.286640858835e-01 +3.219356475761e-01 3.150600693145e-01 3.080435669202e-01 3.008924404692e-01 +2.936130685997e-01 2.862119027669e-01 2.786954614494e-01 2.710703243135e-01 +2.633431263400e-01 2.555205519196e-01 2.476093289215e-01 2.396162227424e-01 +2.315480303388e-01 2.234115742511e-01 2.152136966224e-01 2.069612532192e-01 +1.986611074585e-01 1.903201244474e-01 1.819451650406e-01 1.735430799202e-01 +1.651207037049e-01 1.566848490926e-01 1.482423010418e-01 1.397998109982e-01 +1.313640911704e-01 1.229418088597e-01 1.145395808512e-01 1.061639678681e-01 +9.782146909677e-02 8.951851678618e-02 8.126147092635e-02 7.305661401127e-02 +6.491014589029e-02 5.682817871276e-02 4.881673197012e-02 4.088172764003e-02 +3.302898543646e-02 2.526421816997e-02 1.759302722215e-02 1.002089813804e-02 +2.553196340239e-03 -4.804837031551e-03 -1.204808915229e-02 -1.917157941109e-02 +-2.617046317543e-02 -3.304003541677e-02 -3.977573419486e-02 -4.637314399786e-02 +-5.282799893548e-02 -5.913618578289e-02 -6.529374687281e-02 -7.129688283372e-02 +-7.714195517203e-02 -8.282548869637e-02 -8.834417378226e-02 -9.369486847552e-02 +-9.887460043301e-02 -1.038805686994e-01 -1.087101453191e-01 -1.133608767817e-01 +-1.178304853011e-01 -1.221168699272e-01 -1.262181074889e-01 -1.301324533702e-01 +-1.338583421169e-01 -1.373943878753e-01 -1.407393846628e-01 -1.438923064706e-01 +-1.468523071991e-01 -1.496187204267e-01 -1.521910590124e-01 -1.545690145341e-01 +-1.567524565627e-01 -1.587414317735e-01 -1.605361628975e-01 -1.621370475121e-01 +-1.635446566748e-01 -1.647597334006e-01 -1.657831909859e-01 -1.666161111807e-01 +-1.672597422110e-01 -1.677154966549e-01 -1.679849491738e-01 -1.680698341019e-01 +-1.679720428978e-01 -1.676936214587e-01 -1.672367673035e-01 -1.666038266246e-01 +-1.657972912149e-01 -1.648197952712e-01 -1.636741120781e-01 -1.623631505767e-01 +-1.608899518213e-01 -1.592576853276e-01 -1.574696453170e-01 -1.555292468607e-01 +-1.534400219275e-01 -1.512056153403e-01 -1.488297806440e-01 -1.463163758909e-01 +-1.436693593467e-01 -1.408927851222e-01 -1.379907987350e-01 -1.349676326058e-01 +-1.318276014938e-01 -1.285750978758e-01 -1.252145872745e-01 -1.217506035393e-01 +-1.181877440854e-01 -1.145306650961e-01 -1.107840766920e-01 -1.069527380732e-01 +-1.030414526384e-01 -9.905506308635e-02 -9.499844650423e-02 -9.087650944734e-02 +-8.669418301591e-02 -8.245641793294e-02 -7.816817962834e-02 -7.383444333396e-02 +-6.946018919425e-02 -6.505039739737e-02 -6.061004333125e-02 -5.614409276937e-02 +-5.165749709074e-02 -4.715518853873e-02 -4.264207552300e-02 -3.812303796931e-02 +-3.360292272113e-02 -2.908653899773e-02 -2.457865391267e-02 -2.008398805706e-02 +-1.560721115144e-02 -1.115293777044e-02 -6.725723143991e-03 -2.330059038968e-03 +2.029630275113e-03 6.348991972642e-03 1.062374852726e-02 1.484970147256e-02 +1.902273506488e-02 2.313881984495e-02 2.719401609537e-02 3.118447719087e-02 +3.510645283865e-02 3.895629220596e-02 4.273044693225e-02 4.642547402371e-02 +5.003803862743e-02 5.356491668336e-02 5.700299745172e-02 6.034928591393e-02 +6.360090504540e-02 6.675509795830e-02 6.980922991283e-02 7.276079019564e-02 +7.560739386397e-02 7.834678335454e-02 8.097682995608e-02 8.349553514470e-02 +8.590103178130e-02 8.819158517063e-02 9.036559398130e-02 9.242159102671e-02 +9.435824390655e-02 9.617435550900e-02 9.786886437367e-02 9.944084491560e-02 +1.008895075107e-01 1.022141984430e-01 1.034143997153e-01 1.044897287222e-01 +1.054399377883e-01 1.062649135721e-01 1.069646763363e-01 1.075393790860e-01 +1.079893065771e-01 1.083148741956e-01 1.085166267094e-01 1.085952368958e-01 +1.085515040450e-01 1.083863523425e-01 1.081008291330e-01 1.076961030668e-01 +1.071734621332e-01 1.065343115810e-01 1.057801717303e-01 1.049126756787e-01 +1.039335669027e-01 1.028446967595e-01 1.016480218911e-01 1.003456015333e-01 +9.893959473422e-02 9.743225748455e-02 9.582593976280e-02 9.412308249972e-02 +9.232621446479e-02 9.043794907856e-02 8.846098115432e-02 8.639808357289e-02 +8.425210389427e-02 8.202596090977e-02 7.972264113862e-02 7.734519527280e-02 +7.489673457404e-02 7.238042722697e-02 6.979949465221e-02 6.715720778367e-02 +6.445688331376e-02 6.170187991076e-02 5.889559441230e-02 5.604145799901e-02 +5.314293235233e-02 5.020350580069e-02 4.722668945790e-02 4.421601335796e-02 +4.117502259017e-02 3.810727343873e-02 3.501632953060e-02 3.190575799576e-02 +2.877912564368e-02 2.563999516003e-02 2.249192132735e-02 1.933844727360e-02 +1.618310075232e-02 1.302939045825e-02 9.880802381798e-03 6.740796206401e-03 +3.612801751939e-03 5.002154679700e-04 -2.593603019889e-03 -5.665334307046e-03 +-8.711702547183e-03 -1.172947872647e-02 -1.471548387155e-02 -1.766659218835e-02 +-2.057973412858e-02 -2.345189938120e-02 -2.628013978594e-02 -2.906157216621e-02 +-3.179338107882e-02 -3.447282147796e-02 -3.709722129101e-02 -3.966398390395e-02 +-4.217059055408e-02 -4.461460262801e-02 -4.699366386284e-02 -4.930550244881e-02 +-5.154793303149e-02 -5.371885861187e-02 -5.581627234292e-02 -5.783825922111e-02 +-5.978299767146e-02 -6.164876102525e-02 -6.343391888884e-02 -6.513693840318e-02 +-6.675638539263e-02 -6.829092540280e-02 -6.973932462656e-02 -7.110045071781e-02 +-7.237327349267e-02 -7.355686551778e-02 -7.465040258570e-02 -7.565316407726e-02 +-7.656453321111e-02 -7.738399718063e-02 -7.811114717855e-02 -7.874567830983e-02 +-7.928738939323e-02 -7.973618265249e-02 -8.009206329770e-02 -8.035513899797e-02 +-8.052561924636e-02 -8.060381461822e-02 -8.059013592418e-02 -8.048509325925e-02 +-8.028929494936e-02 -8.000344639707e-02 -7.962834882789e-02 -7.916489793929e-02 +-7.861408245400e-02 -7.797698257970e-02 -7.725476837709e-02 -7.644869803855e-02 +-7.556011607957e-02 -7.459045144523e-02 -7.354121553423e-02 -7.241400014284e-02 +-7.121047533135e-02 -6.993238721568e-02 -6.858155568678e-02 -6.715987206059e-02 +-6.566929666148e-02 -6.411185634180e-02 -6.248964194082e-02 -6.080480568572e-02 +-5.905955853789e-02 -5.725616748755e-02 -5.539695279976e-02 -5.348428521517e-02 +-5.152058310843e-02 -4.950830960781e-02 -4.744996967904e-02 -4.534810717687e-02 +-4.320530186742e-02 -4.102416642497e-02 -3.880734340620e-02 -3.655750220549e-02 +-3.427733599455e-02 -3.196955864970e-02 -2.963690167025e-02 -2.728211109136e-02 +-2.490794439461e-02 -2.251716741974e-02 -2.011255128093e-02 -1.769686929077e-02 +-1.527289389540e-02 -1.284339362394e-02 -1.041113005559e-02 -7.978854807452e-03 +-5.549306546438e-03 -3.125208028220e-03 -7.092631664470e-04 1.695845864775e-03 +4.087461492122e-03 6.462953565054e-03 8.819722135684e-03 1.115520019365e-02 +1.346685635326e-02 1.575219749006e-02 1.800877132436e-02 2.023416894894e-02 +2.242602729853e-02 2.458203155853e-02 2.669991751071e-02 2.877747381347e-02 +3.081254421454e-02 3.280302969388e-02 3.474689053486e-02 3.664214832161e-02 +3.848688786081e-02 4.027925902594e-02 4.201747852249e-02 4.369983157235e-02 +4.532467351604e-02 4.689043133112e-02 4.839560506571e-02 4.983876918571e-02 +5.121857383468e-02 5.253374600533e-02 5.378309062162e-02 5.496549153077e-02 +5.607991240437e-02 5.712539754790e-02 5.810107261830e-02 5.900614524896e-02 +5.983990558203e-02 6.060172670756e-02 6.129106500969e-02 6.190746041949e-02 +6.245053657483e-02 6.292000088737e-02 6.331564451689e-02 6.363734225340e-02 +6.388505230756e-02 6.405881600989e-02 6.415875741952e-02 6.418508284324e-02 +6.413808026568e-02 6.401811869168e-02 6.382564740175e-02 6.356119512194e-02 +6.322536910921e-02 6.281885415376e-02 6.234241149954e-02 6.179687768463e-02 +6.118316330299e-02 6.050225168916e-02 5.975519752777e-02 5.894312538955e-02 +5.806722819583e-02 5.712876561344e-02 5.612906238197e-02 5.506950657560e-02 +5.395154780156e-02 5.277669533750e-02 5.154651620996e-02 5.026263321638e-02 +4.892672289299e-02 4.754051343091e-02 4.610578254317e-02 4.462435528498e-02 +4.309810182984e-02 4.152893520430e-02 3.991880898370e-02 3.826971495185e-02 +3.658368072722e-02 3.486276735836e-02 3.310906689145e-02 3.132469991255e-02 +2.951181306762e-02 2.767257656281e-02 2.580918164815e-02 2.392383808727e-02 +2.201877161610e-02 2.009622139330e-02 1.815843744539e-02 1.620767810928e-02 +1.424620747515e-02 1.227629283244e-02 1.030020212175e-02 8.320201395472e-03 +6.338552289945e-03 4.357509511830e-03 2.379318341479e-03 4.062121559663e-04 +-1.559590025523e-03 -3.515885971338e-03 -5.460492639420e-03 -7.391248549237e-03 +-9.306016121056e-03 -1.120268398010e-02 -1.307916922313e-02 -1.493341964515e-02 +-1.676341592381e-02 -1.856717375928e-02 -2.034274596747e-02 -2.208822452426e-02 +-2.380174255882e-02 -2.548147629387e-02 -2.712564693097e-02 -2.873252247900e-02 +-3.030041952378e-02 -3.182770493742e-02 -3.331279752537e-02 -3.475416960976e-02 +-3.615034854749e-02 -3.749991818145e-02 -3.880152022372e-02 -4.005385556928e-02 +-4.125568553904e-02 -4.240583305113e-02 -4.350318371930e-02 -4.454668687749e-02 +-4.553535652978e-02 -4.646827222467e-02 -4.734457985331e-02 -4.816349237079e-02 +-4.892429044002e-02 -4.962632299781e-02 -5.026900774276e-02 -5.085183154457e-02 +-5.137435077474e-02 -5.183619155846e-02 -5.223704994773e-02 -5.257669201567e-02 +-5.285495387236e-02 -5.307174160227e-02 -5.322703112373e-02 -5.332086797082e-02 +-5.335336699815e-02 -5.332471200918e-02 -5.323515530871e-02 -5.308501718019e-02 +-5.287468528896e-02 -5.260461401196e-02 -5.227532369517e-02 -5.188739983982e-02 +-5.144149221829e-02 -5.093831392121e-02 -5.037864033685e-02 -4.976330806421e-02 +-4.909321376127e-02 -4.836931292985e-02 -4.759261863866e-02 -4.676420018617e-02 +-4.588518170495e-02 -4.495674070927e-02 -4.398010658775e-02 -4.295655904291e-02 +-4.188742647948e-02 -4.077408434358e-02 -3.961795341459e-02 -3.842049805192e-02 +-3.718322439869e-02 -3.590767854449e-02 -3.459544464945e-02 -3.324814303171e-02 +-3.186742822067e-02 -3.045498697827e-02 -2.901253629051e-02 -2.754182133175e-02 +-2.604461340386e-02 -2.452270785294e-02 -2.297792196573e-02 -2.141209284821e-02 +-1.982707528892e-02 -1.822473960925e-02 -1.660696950330e-02 -1.497565986970e-02 +-1.333271463772e-02 -1.168004459040e-02 -1.001956518685e-02 -8.353194386261e-03 +-6.682850476172e-03 -5.010449907207e-03 -3.337905136822e-03 -1.667122484388e-03 +4.806874228875e-15 1.661574650702e-03 3.315726283262e-03 4.960594270583e-03 +6.594334596110e-03 + L N + 1 6 +0.000000000000e+00 1.306435487340e-02 2.611666663547e-02 3.914490539118e-02 +5.213706766219e-02 6.508118955583e-02 7.796535988669e-02 9.077773323521e-02 +1.035065429278e-01 1.161401139228e-01 1.286668755872e-01 1.410753743480e-01 +1.533542862052e-01 1.654924290884e-01 1.774787750453e-01 1.893024622457e-01 +2.009528067876e-01 2.124193142911e-01 2.236916912658e-01 2.347598562401e-01 +2.456139506364e-01 2.562443493818e-01 2.666416712409e-01 2.767967888577e-01 +2.867008384964e-01 2.963452294685e-01 3.057216532352e-01 3.148220921754e-01 +3.236388280080e-01 3.321644498590e-01 3.403918619651e-01 3.483142910027e-01 +3.559252930366e-01 3.632187600783e-01 3.701889262472e-01 3.768303735283e-01 +3.831380371192e-01 3.891072103604e-01 3.947335492439e-01 4.000130764958e-01 +4.049421852264e-01 4.095176421468e-01 4.137365903460e-01 4.175965516284e-01 +4.210954284066e-01 4.242315051508e-01 4.270034493913e-01 4.294103122749e-01 +4.314515286748e-01 4.331269168547e-01 4.344366776877e-01 4.353813934324e-01 +4.359620260680e-01 4.361799151907e-01 4.360367754759e-01 4.355346937086e-01 +4.346761253872e-01 4.334638909055e-01 4.319011713177e-01 4.299915036930e-01 +4.277387760660e-01 4.251472219890e-01 4.222214146949e-01 4.189662608771e-01 +4.153869940960e-01 4.114891678200e-01 4.072786481099e-01 4.027616059573e-01 +3.979445092866e-01 3.928341146300e-01 3.874374584882e-01 3.817618483862e-01 +3.758148536366e-01 3.696042958225e-01 3.631382390110e-01 3.564249797115e-01 +3.494730365898e-01 3.422911399527e-01 3.348882210151e-01 3.272734009641e-01 +3.194559798333e-01 3.114454252015e-01 3.032513607307e-01 2.948835545560e-01 +2.863519075439e-01 2.776664414321e-01 2.688372868672e-01 2.598746713530e-01 +2.507889071261e-01 2.415903789735e-01 2.322895320066e-01 2.228968594066e-01 +2.134228901575e-01 2.038781767810e-01 1.942732830871e-01 1.846187719580e-01 +1.749251931779e-01 1.652030713240e-01 1.554628937345e-01 1.457150985660e-01 +1.359700629568e-01 1.262380913092e-01 1.165294037047e-01 1.068541244662e-01 +9.722227088119e-02 8.764374209841e-02 7.812830821191e-02 6.868559954470e-02 +5.932509614494e-02 5.005611750674e-02 4.088781252752e-02 3.182914971350e-02 +2.288890764466e-02 1.407566570989e-02 5.397795123031e-03 -3.136549770186e-03 +-1.151943988454e-02 -1.974317947772e-02 -2.780031391377e-02 -3.568363709926e-02 +-4.338619858388e-02 -5.090131031818e-02 -5.822255306105e-02 -6.534378243043e-02 +-7.225913459098e-02 -7.896303157307e-02 -8.545018621773e-02 -9.171560674295e-02 +-9.775460092705e-02 -1.035627799053e-01 -1.091360615764e-01 -1.144706736171e-01 +-1.195631561007e-01 -1.244103637196e-01 -1.290094676103e-01 -1.333579567794e-01 +-1.374536391308e-01 -1.412946420949e-01 -1.448794128598e-01 -1.482067182070e-01 +-1.512756439514e-01 -1.540855939907e-01 -1.566362889646e-01 -1.589277645282e-01 +-1.609603692434e-01 -1.627347620927e-01 -1.642519096191e-01 -1.655130826990e-01 +-1.665198529519e-01 -1.672740887948e-01 -1.677779511462e-01 -1.680338887880e-01 +-1.680446333916e-01 -1.678131942169e-01 -1.673428524918e-01 -1.666371554806e-01 +-1.656999102510e-01 -1.645351771481e-01 -1.631472629858e-01 -1.615407139648e-01 +-1.597203083281e-01 -1.576910487641e-01 -1.554581545684e-01 -1.530270535758e-01 +-1.504033738726e-01 -1.475929353025e-01 -1.446017407767e-01 -1.414359674007e-01 +-1.381019574301e-01 -1.346062090676e-01 -1.309553671141e-01 -1.271562134863e-01 +-1.232156576135e-01 -1.191407267273e-01 -1.149385560561e-01 -1.106163789389e-01 +-1.061815168697e-01 -1.016413694882e-01 -9.700340452687e-02 -9.227514773097e-02 +-8.746417276188e-02 -8.257809109863e-02 -7.762454195008e-02 -7.261118219088e-02 +-6.754567633421e-02 -6.243568655420e-02 -5.728886277065e-02 -5.211283280875e-02 +-4.691519264627e-02 -4.170349676043e-02 -3.648524858659e-02 -3.126789110070e-02 +-2.605879753717e-02 -2.086526225366e-02 -1.569449175394e-02 -1.055359587991e-02 +-5.449579183397e-03 -3.893324881042e-04 4.620375347998e-03 9.572905460209e-03 +1.446175678497e-02 1.928057363890e-02 2.402315306027e-02 2.868345190432e-02 +3.325559368438e-02 3.773387515110e-02 4.211277260239e-02 4.638694791703e-02 +5.055125430561e-02 5.460074177240e-02 5.853066228250e-02 6.233647462903e-02 +6.601384899525e-02 6.955867120733e-02 7.296704667358e-02 7.623530400663e-02 +7.935999832536e-02 8.233791423370e-02 8.516606847438e-02 8.784171225530e-02 +9.036233324761e-02 9.272565725416e-02 9.492964954811e-02 9.697251588137e-02 +9.885270316357e-02 1.005688998121e-01 1.021200357744e-01 1.035052822252e-01 +1.047240509388e-01 1.057759933412e-01 1.066609992436e-01 1.073791952611e-01 +1.079309429206e-01 1.083168364614e-01 1.085377003347e-01 1.085945864040e-01 +1.084887708560e-01 1.082217508230e-01 1.077952407272e-01 1.072111683502e-01 +1.064716706363e-01 1.055790892357e-01 1.045359657956e-01 1.033450370074e-01 +1.020092294159e-01 1.005316540022e-01 9.891560054563e-02 9.716453177567e-02 +9.528207732202e-02 9.327202747256e-02 9.113832674840e-02 8.888506730612e-02 +8.651648217692e-02 8.403693835288e-02 8.145092973060e-02 7.876306992271e-02 +7.597808494766e-02 7.310080580865e-02 7.013616097242e-02 6.708916875864e-02 +6.396492965110e-02 6.076861854143e-02 5.750547691656e-02 5.418080500093e-02 +5.079995386454e-02 4.736831750786e-02 4.389132493471e-02 4.037443222410e-02 +3.682311461199e-02 3.324285859387e-02 2.963915405900e-02 2.601748646701e-02 +2.238332907745e-02 1.874213524294e-02 1.509933077596e-02 1.146030639992e-02 +7.830410294093e-03 4.214940742671e-03 6.191388973499e-04 -2.951818336941e-03 +-6.492825283966e-03 -9.998854336717e-03 -1.346496264776e-02 -1.688629866088e-02 +-2.025810847566e-02 -2.357574203711e-02 -2.683465914250e-02 -3.003043525802e-02 +-3.315876713809e-02 -3.621547824051e-02 -3.919652393092e-02 -4.209799647040e-02 +-4.491612978031e-02 -4.764730397885e-02 -5.028804968423e-02 -5.283505207952e-02 +-5.528515473476e-02 -5.763536318224e-02 -5.988284824107e-02 -6.202494908794e-02 +-6.405917607067e-02 -6.598321326225e-02 -6.779492075297e-02 -6.949233667869e-02 +-7.107367898390e-02 -7.253734691836e-02 -7.388192226651e-02 -7.510617030942e-02 +-7.620904051922e-02 -7.718966698639e-02 -7.804736858064e-02 -7.878164884658e-02 +-7.939219563573e-02 -7.987888047645e-02 -8.024175768446e-02 -8.048106321611e-02 +-8.059721326755e-02 -8.059080262311e-02 -8.046260275631e-02 -8.021355968764e-02 +-7.984479160329e-02 -7.935758623941e-02 -7.875339803686e-02 -7.803384507161e-02 +-7.720070576629e-02 -7.625591538864e-02 -7.520156234308e-02 -7.403988426140e-02 +-7.277326389956e-02 -7.140422484702e-02 -6.993542705594e-02 -6.836966219748e-02 +-6.670984885249e-02 -6.495902754461e-02 -6.312035562343e-02 -6.119710200580e-02 +-5.919264178361e-02 -5.711045070636e-02 -5.495409954702e-02 -5.272724835986e-02 +-5.043364063898e-02 -4.807709738652e-02 -4.566151109925e-02 -4.319083968290e-02 +-4.066910030299e-02 -3.810036318162e-02 -3.548874534910e-02 -3.283840435983e-02 +-3.015353198161e-02 -2.743834786743e-02 -2.469709321918e-02 -2.193402445223e-02 +-1.915340687012e-02 -1.635950835841e-02 -1.355659310658e-02 -1.074891536714e-02 +-7.940713260454e-03 -5.136202634309e-03 -2.339570986595e-03 4.450285402837e-04 +3.213483084986e-03 5.961725904616e-03 8.685742115878e-03 1.138157433216e-02 +1.404532818887e-02 1.667317774958e-02 1.926137078571e-02 2.180623392263e-02 +2.430417764549e-02 2.675170115799e-02 2.914539708798e-02 3.148195603348e-02 +3.375817094353e-02 3.597094132816e-02 3.811727729214e-02 4.019430338751e-02 +4.219926228014e-02 4.412951822582e-02 4.598256035168e-02 4.775600573917e-02 +4.944760230483e-02 5.105523147584e-02 5.257691065711e-02 5.401079548751e-02 +5.535518188276e-02 5.660850786304e-02 5.776935516357e-02 5.883645062692e-02 +5.980866737579e-02 6.068502576575e-02 6.146469411743e-02 6.214698922805e-02 +6.273137666260e-02 6.321747082525e-02 6.360503481166e-02 6.389398004370e-02 +6.408436568777e-02 6.417639785874e-02 6.417042861146e-02 6.406695472236e-02 +6.386661626384e-02 6.357019497431e-02 6.317861242733e-02 6.269292800329e-02 +6.211433666749e-02 6.144416655872e-02 6.068387639269e-02 5.983505268488e-02 +5.889940679768e-02 5.787877181697e-02 5.677509926326e-02 5.559045564315e-02 +5.432701884668e-02 5.298707439657e-02 5.157301155549e-02 5.008731929761e-02 +4.853258215106e-02 4.691147591774e-02 4.522676327743e-02 4.348128928314e-02 +4.167797675461e-02 3.981982157740e-02 3.790988791463e-02 3.595130333891e-02 +3.394725389190e-02 3.190097907909e-02 2.981576680733e-02 2.769494827291e-02 +2.554189280784e-02 2.336000269210e-02 2.115270793956e-02 1.892346106549e-02 +1.667573184329e-02 1.441300205826e-02 1.213876026616e-02 9.856496564166e-03 +7.569697382000e-03 5.281840300680e-03 2.996388906500e-03 7.167876876316e-04 +-1.553543019300e-03 -3.811212025433e-03 -6.052862221539e-03 -8.275175438559e-03 +-1.047487722991e-02 -1.264874156886e-02 -1.479359545432e-02 -1.690632341879e-02 +-1.898387193196e-02 -2.102325369414e-02 -2.302155181347e-02 -2.497592386127e-02 +-2.688360580001e-02 -2.874191577864e-02 -3.054825779020e-02 -3.230012518684e-02 +-3.399510404762e-02 -3.563087639474e-02 -3.720522325405e-02 -3.871602755584e-02 +-4.016127687243e-02 -4.153906598894e-02 -4.284759930434e-02 -4.408519305964e-02 +-4.525027739085e-02 -4.634139820416e-02 -4.735721887142e-02 -4.829652174398e-02 +-4.915820948344e-02 -4.994130620809e-02 -5.064495845388e-02 -5.126843594949e-02 +-5.181113220482e-02 -5.227256491288e-02 -5.265237616522e-02 -5.295033248118e-02 +-5.316632465183e-02 -5.330036739927e-02 -5.335259885286e-02 -5.332327984343e-02 +-5.321279301767e-02 -5.302164177426e-02 -5.275044902438e-02 -5.239995577879e-02 +-5.197101956449e-02 -5.146461267378e-02 -5.088182024900e-02 -5.022383820648e-02 +-4.949197100331e-02 -4.868762925081e-02 -4.781232717897e-02 -4.686767995599e-02 +-4.585540086759e-02 -4.477729836070e-02 -4.363527295655e-02 -4.243131403809e-02 +-4.116749651707e-02 -3.984597738615e-02 -3.846899216165e-02 -3.703885122248e-02 +-3.555793605128e-02 -3.402869538353e-02 -3.245364127086e-02 -3.083534506452e-02 +-2.917643332557e-02 -2.747958366783e-02 -2.574752054024e-02 -2.398301095503e-02 +-2.218886016829e-02 -2.036790731948e-02 -1.852302103661e-02 -1.665709501370e-02 +-1.477304356717e-02 -1.287379717797e-02 -1.096229802598e-02 -9.041495523515e-03 +-7.114341854431e-03 -5.183787525630e-03 -3.252776937392e-03 -1.324243979154e-03 +5.988923428224e-04 2.513732239494e-03 4.417399428451e-03 6.307045372497e-03 +8.179853461227e-03 1.003304312959e-02 1.186387390754e-02 1.366964939490e-02 +1.544772115590e-02 1.719549252772e-02 1.891042233785e-02 2.059002852479e-02 +2.223189165726e-02 2.383365834693e-02 2.539304454988e-02 2.690783875242e-02 +2.837590503673e-02 2.979518602233e-02 3.116370567930e-02 3.247957200954e-02 +3.374097959257e-02 3.494621199242e-02 3.609364402262e-02 3.718174386634e-02 +3.820907504899e-02 3.917429826088e-02 4.007617302772e-02 4.091355922698e-02 +4.168541844837e-02 4.239081519695e-02 4.302891793761e-02 4.359899997989e-02 +4.410044020231e-02 4.453272361585e-02 4.489544176600e-02 4.518829297361e-02 +4.541108241454e-02 4.556372203857e-02 4.564623032835e-02 4.565873189906e-02 +4.560145694016e-02 4.547474050043e-02 4.527902161794e-02 4.501484229685e-02 +4.468284633287e-02 4.428377798994e-02 4.381848053034e-02 4.328789460109e-02 +4.269305647939e-02 4.203509618038e-02 4.131523543030e-02 4.053478550869e-02 +3.969514496323e-02 3.879779720101e-02 3.784430796039e-02 3.683632266746e-02 +3.577556368157e-02 3.466382743431e-02 3.350298146672e-02 3.229496136929e-02 +3.104176762993e-02 2.974546239462e-02 2.840816614615e-02 2.703205430605e-02 +2.561935376507e-02 2.417233934768e-02 2.269333021603e-02 2.118468621912e-02 +1.964880419257e-02 1.808811421498e-02 1.650507582642e-02 1.490217421497e-02 +1.328191637703e-02 1.164682725739e-02 9.999445874710e-03 8.342321438527e-03 +6.678009463363e-03 5.009067886003e-03 3.338053191631e-03 1.667516554664e-03 +3.951549015960e-15 -1.661967409577e-03 -3.315873354289e-03 -4.959226000835e-03 +-6.589557703069e-03 + L N + 1 7 +0.000000000000e+00 1.481154861308e-02 2.960554632853e-02 4.436446700681e-02 +5.907083398651e-02 7.370724472844e-02 8.825639534585e-02 1.027011049831e-01 +1.170243400055e-01 1.312092379632e-01 1.452391312917e-01 1.590975707145e-01 +1.727683483093e-01 1.862355202054e-01 1.994834288749e-01 2.124967249857e-01 +2.252603887824e-01 2.377597509611e-01 2.499805130092e-01 2.619087669759e-01 +2.735310146468e-01 2.848341860909e-01 2.958056575531e-01 3.064332686659e-01 +3.167053389525e-01 3.266106835996e-01 3.361386284722e-01 3.452790243530e-01 +3.540222603804e-01 3.623592766693e-01 3.702815760941e-01 3.777812352165e-01 +3.848509143445e-01 3.914838667054e-01 3.976739467219e-01 4.034156173794e-01 +4.087039566734e-01 4.135346631295e-01 4.179040603889e-01 4.218091008526e-01 +4.252473683813e-01 4.282170800487e-01 4.307170869449e-01 4.327468740333e-01 +4.343065590604e-01 4.353968905231e-01 4.360192446984e-01 4.361756217411e-01 +4.358686408580e-01 4.351015345677e-01 4.338781420568e-01 4.322029016443e-01 +4.300808423681e-01 4.275175747081e-01 4.245192804629e-01 4.210927017968e-01 +4.172451294761e-01 4.129843903160e-01 4.083188338570e-01 4.032573182966e-01 +3.978091956961e-01 3.919842964912e-01 3.857929133291e-01 3.792457842606e-01 +3.723540753147e-01 3.651293624839e-01 3.575836131510e-01 3.497291669865e-01 +3.415787163485e-01 3.331452862170e-01 3.244422136959e-01 3.154831271140e-01 +3.062819247611e-01 2.968527532918e-01 2.872099858331e-01 2.773681998293e-01 +2.673421546616e-01 2.571467690765e-01 2.467970984597e-01 2.363083119919e-01 +2.256956697224e-01 2.149744995959e-01 2.041601744705e-01 1.932680891616e-01 +1.823136375483e-01 1.713121897780e-01 1.602790696047e-01 1.492295318961e-01 +1.381787403451e-01 1.271417454186e-01 1.161334625794e-01 1.051686508134e-01 +9.426189149487e-02 8.342756762269e-02 7.267984345857e-02 6.203264459791e-02 +5.149963850351e-02 4.109421553098e-02 3.082947047420e-02 2.071818465801e-02 +1.077280860452e-02 1.005445298223e-03 -8.572165925815e-03 -1.794866484750e-02 +-2.711308515908e-02 -3.605486857337e-02 -4.476387822326e-02 -5.323041133405e-02 +-6.144521115129e-02 -6.939947810838e-02 -7.708488021916e-02 -8.449356268224e-02 +-9.161815668497e-02 -9.845178739657e-02 -1.049880811410e-01 -1.112211717417e-01 +-1.171457060316e-01 -1.227568485239e-01 -1.280502852381e-01 -1.330222266814e-01 +-1.376694099826e-01 -1.419891001798e-01 -1.459790906629e-01 -1.496377027758e-01 +-1.529637845807e-01 -1.559567087919e-01 -1.586163698860e-01 -1.609431803967e-01 +-1.629380664048e-01 -1.646024622337e-01 -1.659383043636e-01 -1.669480245779e-01 +-1.676345423563e-01 -1.680012565312e-01 -1.680520362242e-01 -1.677912110810e-01 +-1.672235608253e-01 -1.663543041499e-01 -1.651890869686e-01 -1.637339700507e-01 +-1.619954160607e-01 -1.599802760282e-01 -1.576957752738e-01 -1.551494988150e-01 +-1.523493762806e-01 -1.493036663599e-01 -1.460209408153e-01 -1.425100680861e-01 +-1.387801965141e-01 -1.348407372190e-01 -1.307013466549e-01 -1.263719088780e-01 +-1.218625175567e-01 -1.171834577541e-01 -1.123451875168e-01 -1.073583192982e-01 +-1.022336012511e-01 -9.698189841972e-02 -9.161417386305e-02 -8.614146974220e-02 +-8.057488840244e-02 -7.492557348213e-02 -6.920469107972e-02 -6.342341100985e-02 +-5.759288817968e-02 -5.172424411555e-02 -4.582854867040e-02 -3.991680194140e-02 +-3.399991642702e-02 -2.808869945211e-02 -2.219383588904e-02 -1.632587120224e-02 +-1.049519484285e-02 -4.712024019576e-03 1.013612129261e-03 6.671887937845e-03 +1.225319616570e-02 1.774816247850e-02 2.314765943508e-02 2.844281995988e-02 +3.362505028075e-02 3.868604231359e-02 4.361778547572e-02 4.841257791140e-02 +5.306303711374e-02 5.756210992854e-02 6.190308192655e-02 6.607958613189e-02 +7.008561109556e-02 7.391550830408e-02 7.756399891442e-02 8.102617980788e-02 +8.429752895636e-02 8.737391009604e-02 9.025157670448e-02 9.292717527846e-02 +9.539774791121e-02 9.766073416849e-02 9.971397226479e-02 1.015556995416e-01 +1.031845522510e-01 1.045995646497e-01 1.058001674081e-01 1.067861853425e-01 +1.075578344776e-01 1.081157184486e-01 1.084608242530e-01 1.085945173642e-01 +1.085185362177e-01 1.082349860847e-01 1.077463323465e-01 1.070553931859e-01 +1.061653317105e-01 1.050796475268e-01 1.038021677819e-01 1.023370376914e-01 +1.006887105745e-01 9.886193741598e-02 9.686175597539e-02 9.469347946678e-02 +9.236268483039e-02 8.987520061967e-02 8.723709452720e-02 8.445466057366e-02 +8.153440598436e-02 7.848303777837e-02 7.530744909554e-02 7.201470528725e-02 +6.861202979670e-02 6.510678985503e-02 6.150648201971e-02 5.781871758156e-02 +5.405120786723e-02 5.021174946362e-02 4.630820939109e-02 4.234851025184e-02 +3.834061538020e-02 3.429251402104e-02 3.021220656258e-02 2.610768984944e-02 +2.198694260169e-02 1.785791096528e-02 1.372849421856e-02 9.606530659848e-03 +5.499783699821e-03 1.415928182509e-03 -2.637463042043e-03 -6.652932270945e-03 +-1.062314980556e-02 -1.454092649123e-02 -1.839922591912e-02 -2.219117627019e-02 +-2.591008178228e-02 -2.954943382188e-02 -3.310292154309e-02 -3.656444211695e-02 +-3.992811051546e-02 -4.318826883505e-02 -4.633949514569e-02 -4.937661185231e-02 +-5.229469355638e-02 -5.508907440640e-02 -5.775535492709e-02 -6.028940831780e-02 +-6.268738621221e-02 -6.494572389166e-02 -6.706114494618e-02 -6.903066537788e-02 +-7.085159714244e-02 -7.252155112578e-02 -7.403843955353e-02 -7.540047783238e-02 +-7.660618582331e-02 -7.765438854746e-02 -7.854421632691e-02 -7.927510436319e-02 +-7.984679175757e-02 -8.025931997822e-02 -8.051303078009e-02 -8.060856358457e-02 +-8.054685232665e-02 -8.032912177862e-02 -7.995688335978e-02 -7.943193044286e-02 +-7.875633316865e-02 -7.793243278106e-02 -7.696283549561e-02 -7.585040591548e-02 +-7.459826000950e-02 -7.320975766749e-02 -7.168849484910e-02 -7.003829534268e-02 +-6.826320215163e-02 -6.636746852607e-02 -6.435554865831e-02 -6.223208806108e-02 +-6.000191364812e-02 -5.767002353679e-02 -5.524157659327e-02 -5.272188174089e-02 +-5.011638705261e-02 -4.743066864903e-02 -4.467041942335e-02 -4.184143761519e-02 +-3.894961525502e-02 -3.600092650139e-02 -3.300141589301e-02 -2.995718653790e-02 +-2.687438826170e-02 -2.375920573747e-02 -2.061784661876e-02 -1.745652969824e-02 +-1.428147311335e-02 -1.109888262079e-02 -7.914939961089e-03 -4.735791334448e-03 +-1.567536008483e-03 1.583784921576e-03 4.712199600231e-03 7.811816286993e-03 +1.087683402039e-02 1.390155305203e-02 1.688038503253e-02 1.980786293170e-02 +2.267865067598e-02 2.548755248651e-02 2.822952190233e-02 3.089967047326e-02 +3.349327610817e-02 3.600579106488e-02 3.843284956862e-02 4.077027504678e-02 +4.301408696848e-02 4.516050727831e-02 4.720596641413e-02 4.914710890013e-02 +5.098079850668e-02 5.270412296957e-02 5.431439826230e-02 5.580917241542e-02 +5.718622887831e-02 5.844358941941e-02 5.957951656174e-02 6.059251555162e-02 +6.148133585922e-02 6.224497221049e-02 6.288266515097e-02 6.339390114264e-02 +6.377841219622e-02 6.403617504168e-02 6.416740984102e-02 6.417257844790e-02 +6.405238221978e-02 6.380775938872e-02 6.343988199820e-02 6.295015241363e-02 +6.234019941541e-02 6.161187388381e-02 6.076724408590e-02 5.980859057519e-02 +5.873840071572e-02 5.755936284243e-02 5.627436007089e-02 5.488646376947e-02 +5.339892670812e-02 5.181517589800e-02 5.013880513719e-02 4.837356727771e-02 +4.652336622993e-02 4.459224872063e-02 4.258439582145e-02 4.050411426480e-02 +3.835582756459e-02 3.614406695959e-02 3.387346219716e-02 3.154873217566e-02 +2.917467546383e-02 2.675616071553e-02 2.429811699864e-02 2.180552405659e-02 +1.928340252129e-02 1.673680409631e-02 1.417080172878e-02 1.159047978888e-02 +9.000924275244e-03 6.407213064825e-03 3.814406225389e-03 1.227536408694e-03 +-1.348400657838e-03 -3.908455563428e-03 -6.447734472963e-03 -8.961408235834e-03 +-1.144472132802e-02 -1.389300061125e-02 -1.630166389347e-02 -1.866622827537e-02 +-2.098231826799e-02 -2.324567366721e-02 -2.545215717123e-02 -2.759776172772e-02 +-2.967861759805e-02 -3.169099912633e-02 -3.363133120187e-02 -3.549619540409e-02 +-3.728233581974e-02 -3.898666452275e-02 -4.060626670788e-02 -4.213840546996e-02 +-4.358052622122e-02 -4.493026073991e-02 -4.618543084423e-02 -4.734405168610e-02 +-4.840433466040e-02 -4.936468992564e-02 -5.022372853315e-02 -5.098026416238e-02 +-5.163331446070e-02 -5.218210198706e-02 -5.262605475920e-02 -5.296480640535e-02 +-5.319819592169e-02 -5.332626703778e-02 -5.334926719295e-02 -5.326764612724e-02 +-5.308205409115e-02 -5.279333967946e-02 -5.240254729470e-02 -5.191091424675e-02 +-5.131986749570e-02 -5.063102004568e-02 -4.984616699800e-02 -4.896728127267e-02 +-4.799650900776e-02 -4.693616464688e-02 -4.578872572534e-02 -4.455682736635e-02 +-4.324325649890e-02 -4.185094580953e-02 -4.038296744078e-02 -3.884252644926e-02 +-3.723295403692e-02 -3.555770056945e-02 -3.382032839593e-02 -3.202450448434e-02 +-3.017399288780e-02 -2.827264705655e-02 -2.632440201112e-02 -2.433326639210e-02 +-2.230331440239e-02 -2.023867765756e-02 -1.814353696050e-02 -1.602211401627e-02 +-1.387866310330e-02 -1.171746271703e-02 -9.542807202106e-03 -7.358998389176e-03 +-5.170337252312e-03 -2.981115602897e-03 -7.956078357486e-04 1.381937256911e-03 +3.547304588269e-03 5.696320781307e-03 7.824862059854e-03 9.928862011615e-03 +1.200431920884e-02 1.404730467260e-02 1.605396916697e-02 1.802055030983e-02 +1.994337948744e-02 2.181888856018e-02 2.364361634762e-02 2.541421488114e-02 +2.712745541321e-02 2.878023417271e-02 3.036957785620e-02 3.189264884572e-02 +3.334675014412e-02 3.472933001962e-02 3.603798635178e-02 3.727047067176e-02 +3.842469189020e-02 3.949871970692e-02 4.049078769703e-02 4.139929606883e-02 +4.222281408948e-02 4.296008217497e-02 4.361001364187e-02 4.417169611858e-02 +4.464439261484e-02 4.502754224867e-02 4.532076063070e-02 4.552383990645e-02 +4.563674845779e-02 4.565963026541e-02 4.559280393494e-02 4.543676138971e-02 +4.519216623405e-02 4.485985179149e-02 4.444081882282e-02 4.393623292971e-02 +4.334742164992e-02 4.267587125104e-02 4.192322322985e-02 4.109127052535e-02 +4.018195345362e-02 3.919735537355e-02 3.813969809266e-02 3.701133702292e-02 +3.581475609667e-02 3.455256245357e-02 3.322748090938e-02 3.184234821828e-02 +3.040010714028e-02 2.890380032617e-02 2.735656403218e-02 2.576162167727e-02 +2.412227725593e-02 2.244190861979e-02 2.072396064140e-02 1.897193827388e-02 +1.718939952000e-02 1.537994832488e-02 1.354722740593e-02 1.169491103440e-02 +9.826697782416e-03 7.946303249718e-03 6.057452784145e-03 4.163874209975e-03 +2.269290578085e-03 3.774129518360e-04 -1.508066757507e-03 -3.383482892204e-03 +-5.245203072812e-03 -7.089635133053e-03 -8.913233951680e-03 -1.071250816855e-02 +-1.248402677235e-02 -1.422442554769e-02 -1.593041336966e-02 -1.759877833418e-02 +-1.922639371294e-02 -2.081022372206e-02 -2.234732909387e-02 -2.383487244188e-02 +-2.527012340929e-02 -2.665046359171e-02 -2.797339122553e-02 -2.923652563365e-02 +-3.043761142078e-02 -3.157452241114e-02 -3.264526532177e-02 -3.364798316538e-02 +-3.458095837696e-02 -3.544261565918e-02 -3.623152454196e-02 -3.694640165233e-02 +-3.758611269111e-02 -3.814967411361e-02 -3.863625451219e-02 -3.904517569888e-02 +-3.937591348717e-02 -3.962809817230e-02 -3.980151471027e-02 -3.989610259622e-02 +-3.991195544338e-02 -3.984932026455e-02 -3.970859645826e-02 -3.949033450291e-02 +-3.919523436204e-02 -3.882414360509e-02 -3.837805524800e-02 -3.785810531897e-02 +-3.726557015485e-02 -3.660186343440e-02 -3.586853295496e-02 -3.506725715967e-02 +-3.419984142286e-02 -3.326821410135e-02 -3.227442236048e-02 -3.122062778326e-02 +-3.010910177222e-02 -2.894222075334e-02 -2.772246119204e-02 -2.645239443157e-02 +-2.513468136424e-02 -2.377206694657e-02 -2.236737456924e-02 -2.092350029343e-02 +-1.944340696505e-02 -1.793011821868e-02 -1.638671238317e-02 -1.481631630111e-02 +-1.322209907433e-02 -1.160726574782e-02 -9.975050944547e-03 -8.328712463620e-03 +-6.671524854327e-03 -5.006772978614e-03 -3.337745574486e-03 -1.667728832823e-03 +-5.395336532682e-15 1.662178981316e-03 3.315567781108e-03 4.956953928423e-03 +6.583158983546e-03 + L N + 1 8 +0.000000000000e+00 1.655791103063e-02 3.309130092512e-02 4.957569177820e-02 +6.598669206340e-02 8.230003961507e-02 9.849164436217e-02 1.145376307318e-01 +1.304143796409e-01 1.460985699965e-01 1.615672196230e-01 1.767977255416e-01 +1.917679035205e-01 2.064560268243e-01 2.208408640859e-01 2.349017162306e-01 +2.486184523800e-01 2.619715446705e-01 2.749421019171e-01 2.875119020609e-01 +2.996634233391e-01 3.113798741173e-01 3.226452213293e-01 3.334442174714e-01 +3.437624261002e-01 3.535862457864e-01 3.629029324815e-01 3.717006202560e-01 +3.799683403704e-01 3.876960386461e-01 3.948745911041e-01 4.014958178447e-01 +4.075524951436e-01 4.130383657444e-01 4.179481473306e-01 4.222775391635e-01 +4.260232268770e-01 4.291828854229e-01 4.317551801646e-01 4.337397661211e-01 +4.351372853661e-01 4.359493625901e-01 4.361785988394e-01 4.358285634475e-01 +4.349037841774e-01 4.334097355995e-01 4.313528257302e-01 4.287403809622e-01 +4.255806293188e-01 4.218826820699e-01 4.176565137483e-01 4.129129406093e-01 +4.076635975805e-01 4.019209137486e-01 3.956980864370e-01 3.890090539261e-01 +3.818684668752e-01 3.742916585036e-01 3.662946135934e-01 3.578939363780e-01 +3.491068173809e-01 3.399509992743e-01 3.304447418252e-01 3.206067860027e-01 +3.104563173158e-01 3.000129284597e-01 2.892965813420e-01 2.783275685685e-01 +2.671264744631e-01 2.557141357010e-01 2.441116016337e-01 2.323400943838e-01 +2.204209687893e-01 2.083756722763e-01 1.962257047393e-01 1.839925785072e-01 +1.716977784745e-01 1.593627224744e-01 1.470087219714e-01 1.346569431490e-01 +1.223283684690e-01 1.100437587743e-01 9.782361600920e-02 8.568814662840e-02 +7.365722576277e-02 6.175036221118e-02 4.998666432326e-02 3.838480683706e-02 +2.696299873338e-02 1.573895216584e-02 4.729852523970e-03 -6.047670316608e-03 +-1.657756950472e-02 -2.684440743599e-02 -3.683338064054e-02 -4.653034329268e-02 +-5.592182930193e-02 -6.499507294809e-02 -7.373802802593e-02 -8.213938546823e-02 +-9.018858941940e-02 -9.787585173473e-02 -1.051921648841e-01 -1.121293132420e-01 +-1.186798827491e-01 -1.248372689340e-01 -1.305956832882e-01 -1.359501579873e-01 +-1.408965489612e-01 -1.454315373114e-01 -1.495526290843e-01 -1.532581534076e-01 +-1.565472590033e-01 -1.594199090916e-01 -1.618768747062e-01 -1.639197264415e-01 +-1.655508246575e-01 -1.667733081709e-01 -1.675910814631e-01 -1.680088004392e-01 +-1.680318567754e-01 -1.676663608940e-01 -1.669191236090e-01 -1.657976364858e-01 +-1.643100509646e-01 -1.624651562948e-01 -1.602723563338e-01 -1.577416452637e-01 +-1.548835822823e-01 -1.517092653254e-01 -1.482303038812e-01 -1.444587909565e-01 +-1.404072742592e-01 -1.360887266589e-01 -1.315165159935e-01 -1.267043742846e-01 +-1.216663664322e-01 -1.164168584543e-01 -1.109704853407e-01 -1.053421185900e-01 +-9.954683349864e-02 -9.359987627215e-02 -8.751663102686e-02 -8.131258675264e-02 +-7.500330430489e-02 -6.860438349469e-02 -6.213143034506e-02 -5.560002458081e-02 +-4.902568741833e-02 -4.242384972091e-02 -3.580982058406e-02 -2.919875641380e-02 +-2.260563055994e-02 -1.604520356440e-02 -9.531994083388e-03 -3.080250540227e-03 +3.296076436016e-03 9.583360733074e-03 1.576832658815e-02 2.183807348183e-02 +2.778010004672e-02 3.358232694644e-02 3.923311868330e-02 4.472130429523e-02 +5.003619690538e-02 5.516761209014e-02 6.010588503451e-02 6.484188644590e-02 +6.936703720085e-02 7.367332170163e-02 7.775329992268e-02 8.160011812990e-02 +8.520751825843e-02 8.856984593796e-02 9.168205715707e-02 9.453972356161e-02 +9.713903638452e-02 9.947680900809e-02 1.015504781620e-01 1.033581037636e-01 +1.048983674105e-01 1.061705695366e-01 1.071746252480e-01 1.079110588552e-01 +1.083809971237e-01 1.085861612649e-01 1.085288576940e-01 1.082119675829e-01 +1.076389352390e-01 1.068137553428e-01 1.057409590805e-01 1.044255992085e-01 +1.028732340897e-01 1.010899107443e-01 9.908214695680e-02 9.685691248719e-02 +9.442160943152e-02 9.178405178158e-02 8.895244423362e-02 8.593536029779e-02 +8.274171976109e-02 7.938076555768e-02 7.586204010149e-02 7.219536113690e-02 +6.839079716390e-02 6.445864249493e-02 6.040939200082e-02 5.625371560381e-02 +5.200243257576e-02 4.766648569971e-02 4.325691535298e-02 3.878483356985e-02 +3.426139814131e-02 2.969778680940e-02 2.510517161269e-02 2.049469343892e-02 +1.587743684027e-02 1.126440516526e-02 6.666496060902e-03 2.094477397162e-03 +-2.441036335399e-03 -6.929607105114e-03 -1.136099584778e-02 -1.572518435772e-02 +-2.001239651645e-02 -2.421311881573e-02 -2.831812013375e-02 -3.231847072490e-02 +-3.620556038587e-02 -3.997111576244e-02 -4.360721676405e-02 -4.710631205476e-02 +-5.046123359210e-02 -5.366521018711e-02 -5.671188006150e-02 -5.959530238024e-02 +-6.230996774016e-02 -6.485080759772e-02 -6.721320262165e-02 -6.939298995846e-02 +-7.138646940160e-02 -7.319040845732e-02 -7.480204630292e-02 -7.621909663577e-02 +-7.743974941355e-02 -7.846267148922e-02 -7.928700614622e-02 -7.991237154210e-02 +-8.033885807125e-02 -8.056702465956e-02 -8.059789400636e-02 -8.043294679127e-02 +-8.007411486574e-02 -7.952377345131e-02 -7.878473236882e-02 -7.786022632466e-02 +-7.675390428232e-02 -7.546981794938e-02 -7.401240941182e-02 -7.238649794943e-02 +-7.059726606763e-02 -6.865024478271e-02 -6.655129819886e-02 -6.430660741689e-02 +-6.192265381581e-02 -5.940620174943e-02 -5.676428070158e-02 -5.400416694426e-02 +-5.113336474404e-02 -4.815958716276e-02 -4.509073649924e-02 -4.193488441934e-02 +-3.870025182206e-02 -3.539518848972e-02 -3.202815257059e-02 -2.860768994224e-02 +-2.514241350411e-02 -2.164098244758e-02 -1.811208155151e-02 -1.456440055113e-02 +-1.100661362739e-02 -7.447359063791e-03 -3.895219116495e-03 -3.587001433476e-04 +3.153786963840e-03 6.633946000119e-03 1.007361427884e-02 1.346478103227e-02 +1.679960534131e-02 2.007043355533e-02 2.326981616478e-02 2.639052409048e-02 +2.942556435520e-02 3.236819510471e-02 3.521193994704e-02 3.795060158074e-02 +4.057827468431e-02 4.308935804128e-02 4.547856587701e-02 4.774093838528e-02 +4.987185142497e-02 5.186702536882e-02 5.372253308861e-02 5.543480706295e-02 +5.700064559627e-02 5.841721813936e-02 5.968206970430e-02 6.079312436851e-02 +6.174868786500e-02 6.254744925770e-02 6.318848170351e-02 6.367124230392e-02 +6.399557105220e-02 6.416168888325e-02 6.417019483595e-02 6.402206233961e-02 +6.371863463793e-02 6.326161936624e-02 6.265308229920e-02 6.189544028845e-02 +6.099145341102e-02 5.994421635153e-02 5.875714904241e-02 5.743398658838e-02 +5.597876850265e-02 5.439582728400e-02 5.268977636510e-02 5.086549746396e-02 +4.892812737133e-02 4.688304420838e-02 4.473585318977e-02 4.249237192826e-02 +4.015861531808e-02 3.774078003476e-02 3.524522869016e-02 3.267847368179e-02 +3.004716077609e-02 2.735805246603e-02 2.461801114311e-02 2.183398212490e-02 +1.901297657847e-02 1.616205438104e-02 1.328830695820e-02 1.039884014080e-02 +7.500757080491e-03 4.601141264318e-03 1.707039667804e-03 -1.174553914293e-03 +-4.036715321065e-03 -6.872606224583e-03 -9.675490038058e-03 -1.243874749688e-02 +-1.515589187733e-02 -1.782058381887e-02 -2.042664571674e-02 -2.296807565325e-02 +-2.543906083690e-02 -2.783399052001e-02 -3.014746836701e-02 -3.237432424670e-02 +-3.450962542356e-02 -3.654868712452e-02 -3.848708245922e-02 -4.032065167364e-02 +-4.204551071828e-02 -4.365805911411e-02 -4.515498710107e-02 -4.653328205570e-02 +-4.779023416631e-02 -4.892344135592e-02 -4.993081344491e-02 -5.081057554727e-02 +-5.156127069620e-02 -5.218176169658e-02 -5.267123220359e-02 -5.302918702888e-02 +-5.325545167719e-02 -5.335017111832e-02 -5.331380780109e-02 -5.314713891769e-02 +-5.285125292855e-02 -5.242754535957e-02 -5.187771388525e-02 -5.120375271283e-02 +-5.040794628419e-02 -4.949286231375e-02 -4.846134418223e-02 -4.731650270732e-02 +-4.606170731395e-02 -4.470057662806e-02 -4.323696851891e-02 -4.167496961652e-02 +-4.001888433139e-02 -3.827322340542e-02 -3.644269202321e-02 -3.453217751437e-02 +-3.254673667809e-02 -3.049158276193e-02 -2.837207212753e-02 -2.619369063662e-02 +-2.396203979110e-02 -2.168282266139e-02 -1.936182963770e-02 -1.700492403911e-02 +-1.461802761544e-02 -1.220710597707e-02 -9.778153987978e-03 -7.337181156879e-03 +-4.890197061645e-03 -2.443196841538e-03 -2.146791744090e-06 2.427029905829e-03 +4.838467281943e-03 7.226370476656e-03 9.585029400815e-03 1.190883213079e-02 +1.419227800556e-02 1.642999039615e-02 1.861672911823e-02 2.074740245990e-02 +2.281707879732e-02 2.482099777245e-02 2.675458100782e-02 2.861344233493e-02 +3.039339751367e-02 3.209047342193e-02 3.370091669553e-02 3.522120180033e-02 +3.664803851944e-02 3.797837884032e-02 3.920942322779e-02 4.033862627058e-02 +4.136370169057e-02 4.228262670554e-02 4.309364573766e-02 4.379527346174e-02 +4.438629718867e-02 4.486577858132e-02 4.523305470151e-02 4.548773838844e-02 +4.562971797067e-02 4.565915631493e-02 4.557648921710e-02 4.538242314188e-02 +4.507793231948e-02 4.466425520881e-02 4.414289033863e-02 4.351559153905e-02 +4.278436257749e-02 4.195145121455e-02 4.101934269644e-02 3.999075270200e-02 +3.886861976354e-02 3.765609718199e-02 3.635654445778e-02 3.497351826022e-02 +3.351076295890e-02 3.197220074180e-02 3.036192134554e-02 2.868417142405e-02 +2.694334358287e-02 2.514396510671e-02 2.329068640869e-02 2.138826923032e-02 +1.944157462145e-02 1.745555073027e-02 1.543522043333e-02 1.338566883613e-02 +1.131203067490e-02 9.219477650305e-03 7.113205723915e-03 4.998422408071e-03 +2.880334079970e-03 7.641333503272e-04 -1.345013483117e-03 -3.441978867347e-03 +-5.521686281563e-03 -7.579122351377e-03 -9.609348761184e-03 -1.160751393678e-02 +-1.356886447099e-02 -1.548875626571e-02 -1.736266536469e-02 -1.918619845208e-02 +-2.095510299273e-02 -2.266527699123e-02 -2.431277834758e-02 -2.589383378856e-02 +-2.740484735483e-02 -2.884240842504e-02 -3.020329925943e-02 -3.148450204645e-02 +-3.268320543748e-02 -3.379681055569e-02 -3.482293646675e-02 -3.575942509999e-02 +-3.660434561055e-02 -3.735599817388e-02 -3.801291720575e-02 -3.857387400208e-02 +-3.903787879458e-02 -3.940418221928e-02 -3.967227619680e-02 -3.984189422432e-02 +-3.991301108094e-02 -3.988584194924e-02 -3.976084095732e-02 -3.953869914728e-02 +-3.922034187691e-02 -3.880692566323e-02 -3.829983447740e-02 -3.770067550228e-02 +-3.701127436464e-02 -3.623366985568e-02 -3.537010815444e-02 -3.442303657002e-02 +-3.339509681946e-02 -3.228911785923e-02 -3.110810828940e-02 -2.985524835046e-02 +-2.853388153354e-02 -2.714750582588e-02 -2.569976461398e-02 -2.419443726774e-02 +-2.263542942962e-02 -2.102676303320e-02 -1.937256607656e-02 -1.767706217584e-02 +-1.594455992534e-02 -1.417944209042e-02 -1.238615466005e-02 -1.056919578607e-02 +-8.733104636253e-03 -6.882450188568e-03 -5.021819993921e-03 -3.155808934758e-03 +-1.289008006752e-03 5.740068493430e-04 2.428685838783e-03 4.270516300273e-03 +6.095033563517e-03 7.897831651018e-03 9.674573798760e-03 1.142100277091e-02 +1.313295094430e-02 1.480635013898e-02 1.643724117206e-02 1.802178311248e-02 +1.955626221549e-02 2.103710051615e-02 2.246086406235e-02 2.382427076859e-02 +2.512419787273e-02 2.635768897918e-02 2.752196067273e-02 2.861440868857e-02 +2.963261362498e-02 3.057434618660e-02 3.143757194694e-02 3.222045562041e-02 +3.292136483523e-02 3.353887339954e-02 3.407176405486e-02 3.451903071165e-02 +3.487988016366e-02 3.515373327833e-02 3.534022566241e-02 3.543920780289e-02 +3.545074468464e-02 3.537511488750e-02 3.521280916677e-02 3.496452852234e-02 +3.463118176278e-02 3.421388257209e-02 3.371394608787e-02 3.313288500087e-02 +3.247240518699e-02 3.173440088389e-02 3.092094942553e-02 3.003430554875e-02 +2.907689528729e-02 2.805130946938e-02 2.696029683603e-02 2.580675679798e-02 +2.459373185012e-02 2.332439966292e-02 2.200206487120e-02 2.063015058108e-02 +1.921218961681e-02 1.775181552949e-02 1.625275339036e-02 1.471881039172e-02 +1.315386627900e-02 1.156186363765e-02 9.946798059158e-03 8.312708210192e-03 +6.663665829604e-03 5.003765677650e-03 3.337115462101e-03 1.667825765779e-03 +3.234821327062e-15 -1.662275591703e-03 -3.314941855525e-03 -4.953976550982e-03 +-6.575404052716e-03 + L N + 1 9 +0.000000000000e+00 1.830358174210e-02 3.657403808489e-02 5.477831499715e-02 +7.288350101641e-02 9.085689811520e-02 1.086660920666e-01 1.262790221443e-01 +1.436640499936e-01 1.607900275125e-01 1.776263635835e-01 1.941430895004e-01 +2.103109229381e-01 2.261013303140e-01 2.414865873988e-01 2.564398380332e-01 +2.709351508156e-01 2.849475736296e-01 2.984531858842e-01 3.114291483481e-01 +3.238537504622e-01 3.357064550233e-01 3.469679401358e-01 3.576201383384e-01 +3.676462728158e-01 3.770308906151e-01 3.857598927944e-01 3.938205614351e-01 +4.012015834617e-01 4.078930712177e-01 4.138865797541e-01 4.191751207972e-01 +4.237531733675e-01 4.276166910331e-01 4.307631057854e-01 4.331913285360e-01 +4.349017462416e-01 4.358962156689e-01 4.361780538247e-01 4.357520250791e-01 +4.346243250218e-01 4.328025610972e-01 4.302957300717e-01 4.271141923958e-01 +4.232696435290e-01 4.187750823041e-01 4.136447764136e-01 4.078942251090e-01 +4.015401192086e-01 3.946002985174e-01 3.870937067674e-01 3.790403441931e-01 +3.704612178630e-01 3.613782898909e-01 3.518144236589e-01 3.417933281848e-01 +3.313395007746e-01 3.204781681009e-01 3.092352258544e-01 2.976371771166e-01 +2.857110696066e-01 2.734844319544e-01 2.609852091583e-01 2.482416973830e-01 +2.352824782561e-01 2.221363528245e-01 2.088322753284e-01 1.953992869526e-01 +1.818664497150e-01 1.682627806506e-01 1.546171864455e-01 1.409583986801e-01 +1.273149098309e-01 1.137149101839e-01 1.001862258071e-01 8.675625772682e-02 +7.345192244858e-02 6.029959396153e-02 4.732504735816e-02 3.455340419908e-02 +2.200907974642e-02 9.715732184933e-03 -2.303786055728e-03 -1.402747476984e-02 +-2.543423013342e-02 -3.650388645536e-02 -4.721725543241e-02 -5.755616282508e-02 +-6.750348247854e-02 -7.704316761906e-02 -8.616027936410e-02 -9.484101239104e-02 +-1.030727177169e-01 -1.108439225488e-01 -1.181443471731e-01 -1.249649188563e-01 +-1.312977827426e-01 -1.371363097361e-01 -1.424751013654e-01 -1.473099916373e-01 +-1.516380458899e-01 -1.554575566670e-01 -1.587680366408e-01 -1.615702086167e-01 +-1.638659926636e-01 -1.656584904169e-01 -1.669519666121e-01 -1.677518279090e-01 +-1.680645990773e-01 -1.678978966182e-01 -1.672603999032e-01 -1.661618199179e-01 +-1.646128657023e-01 -1.626252085877e-01 -1.602114443317e-01 -1.573850532599e-01 +-1.541603585270e-01 -1.505524826134e-01 -1.465773021787e-01 -1.422514013949e-01 +-1.375920238872e-01 -1.326170234127e-01 -1.273448134092e-01 -1.217943155488e-01 +-1.159849074327e-01 -1.099363695658e-01 -1.036688317492e-01 -9.720271903118e-02 +-9.055869735635e-02 -8.375761905255e-02 -7.682046829625e-02 -6.976830669444e-02 +-6.262221912132e-02 -5.540325994599e-02 -4.813239978587e-02 -4.083047291815e-02 +-3.351812547938e-02 -2.621576458043e-02 -1.894350846070e-02 -1.172113780254e-02 +-4.568048322596e-03 2.496795246826e-03 9.454903677738e-03 1.628830616362e-02 +2.297959153439e-02 2.951194767482e-02 3.586919905734e-02 4.203584230544e-02 +4.799707970983e-02 5.373885062489e-02 5.924786067938e-02 6.451160874110e-02 +6.951841158171e-02 7.425742619399e-02 7.871866972059e-02 8.289303695950e-02 +8.677231541825e-02 9.034919789536e-02 9.361729257421e-02 9.657113062115e-02 +9.920617128620e-02 1.015188045114e-01 1.035063510584e-01 1.051670601729e-01 +1.065001048107e-01 1.075055744564e-01 1.081844655702e-01 1.085386697071e-01 +1.085709593568e-01 1.082849715578e-01 1.076851893481e-01 1.067769211146e-01 +1.055662779148e-01 1.040601488446e-01 1.022661745321e-01 1.001927188440e-01 +9.784883889096e-02 9.524425342656e-02 9.238930973593e-02 8.929494911340e-02 +8.597267103297e-02 8.243449611708e-02 7.869292801214e-02 7.476091428152e-02 +7.065180642847e-02 6.637931916320e-02 6.195748902942e-02 5.740063250685e-02 +5.272330370674e-02 4.794025177762e-02 4.306637813898e-02 3.811669365958e-02 +3.310627589716e-02 2.805022651502e-02 2.296362898958e-02 1.786150672202e-02 +1.275878166461e-02 7.670233570794e-03 2.610459975239e-03 -2.406162992260e-03 +-7.365518858348e-03 -1.225378802552e-02 -1.705748386522e-02 -2.176348759424e-02 +-2.635908184775e-02 -3.083198286669e-02 -3.517037122126e-02 -3.936292099701e-02 +-4.339882737451e-02 -4.726783253870e-02 -5.096024985851e-02 -5.446698628319e-02 +-5.777956290620e-02 -6.089013365359e-02 -6.379150205870e-02 -6.647713609080e-02 +-6.894118101077e-02 -7.117847023244e-02 -7.318453417395e-02 -7.495560708904e-02 +-7.648863187394e-02 -7.778126285084e-02 -7.883186653490e-02 -7.963952039699e-02 +-8.020400963978e-02 -8.052582201049e-02 -8.060614067853e-02 -8.044683521154e-02 +-8.005045068863e-02 -7.942019499406e-02 -7.855992433988e-02 -7.747412707017e-02 +-7.616790580441e-02 -7.464695798128e-02 -7.291755486873e-02 -7.098651910953e-02 +-6.886120087552e-02 -6.654945270702e-02 -6.405960311692e-02 -6.140042904224e-02 +-5.858112722820e-02 -5.561128463271e-02 -5.250084794108e-02 -4.926009228271e-02 +-4.589958924332e-02 -4.243017426745e-02 -3.886291354731e-02 -3.520907049454e-02 +-3.148007189251e-02 -2.768747382652e-02 -2.384292748968e-02 -1.995814496188e-02 +-1.604486505853e-02 -1.211481934533e-02 -8.179698413918e-03 -4.251118512063e-03 +-3.405886206150e-04 3.540521932676e-03 7.381015234165e-03 1.116989583429e-02 +1.489640100313e-02 1.855003011098e-02 2.212057305618e-02 2.559813766586e-02 +2.897317599822e-02 3.223650947904e-02 3.537935280821e-02 3.839333657641e-02 +4.127052853591e-02 4.400345347347e-02 4.658511163778e-02 4.900899567831e-02 +5.126910605653e-02 5.335996489552e-02 5.527662823829e-02 5.701469668990e-02 +5.857032442323e-02 5.994022653299e-02 6.112168472734e-02 6.211255135130e-02 +6.291125174084e-02 6.351678491138e-02 6.392872258900e-02 6.414720659753e-02 +6.417294461913e-02 6.400720435046e-02 6.365180608122e-02 6.310911372586e-02 +6.238202434376e-02 6.147395618708e-02 6.038883531963e-02 5.913108085371e-02 +5.770558885585e-02 5.611771497557e-02 5.437325585476e-02 5.247842937856e-02 +5.043985383133e-02 4.826452602414e-02 4.595979846304e-02 4.353335562925e-02 +4.099318944490e-02 3.834757399986e-02 3.560503961655e-02 3.277434633158e-02 +2.986445687386e-02 2.688450922004e-02 2.384378880891e-02 2.075170049681e-02 +1.761774033636e-02 1.445146726111e-02 1.126247475819e-02 8.060362610876e-03 +4.854708792171e-03 1.655041589786e-03 -1.529187958409e-03 -4.688633240530e-03 +-7.814078782147e-03 -1.089646641850e-02 -1.392692085488e-02 -1.689677454470e-02 +-1.979759181718e-02 -2.262119218908e-02 -2.535967279759e-02 -2.800542989440e-02 +-3.055117934399e-02 -3.298997607227e-02 -3.531523241523e-02 -3.752073532041e-02 +-3.960066235785e-02 -4.154959650055e-02 -4.336253963851e-02 -4.503492479416e-02 +-4.656262701073e-02 -4.794197288940e-02 -4.916974875494e-02 -5.024320743357e-02 +-5.116007363092e-02 -5.191854790218e-02 -5.251730921045e-02 -5.295551607350e-02 +-5.323280630334e-02 -5.334929534672e-02 -5.330557323923e-02 -5.310270018885e-02 +-5.274220080962e-02 -5.222605702894e-02 -5.155669969654e-02 -5.073699892625e-02 +-4.977025320544e-02 -4.866017731036e-02 -4.741088906890e-02 -4.602689501520e-02 +-4.451307498402e-02 -4.287466569502e-02 -4.111724338018e-02 -3.924670550999e-02 +-3.726925167637e-02 -3.519136369229e-02 -3.301978497043e-02 -3.076149924450e-02 +-2.842370869875e-02 -2.601381157268e-02 -2.353937930868e-02 -2.100813331197e-02 +-1.842792139238e-02 -1.580669395853e-02 -1.315248003518e-02 -1.047336317458e-02 +-7.777457332796e-03 -5.072882781731e-03 -2.367742126867e-03 3.299034995427e-04 +3.012058001219e-03 5.670813568846e-03 8.298373552893e-03 1.088707489325e-02 +1.342941004226e-02 1.591804831964e-02 1.834585663938e-02 2.070591955138e-02 +2.299155854231e-02 2.519635054291e-02 2.731414559150e-02 2.933908360597e-02 +3.126561021970e-02 3.308849163934e-02 3.480282848584e-02 3.640406858313e-02 +3.788801866191e-02 3.925085494970e-02 4.048913262121e-02 4.159979408713e-02 +4.258017610231e-02 4.342801567831e-02 4.414145478860e-02 4.471904385849e-02 +4.515974403509e-02 4.546292823669e-02 4.562838098410e-02 4.565629702020e-02 +4.554727872752e-02 4.530233235705e-02 4.492286308491e-02 4.441066891690e-02 +4.376793346419e-02 4.299721761665e-02 4.210145014337e-02 4.108391725303e-02 +3.994825114943e-02 3.869841762072e-02 3.733870270295e-02 3.587369846167e-02 +3.430828793717e-02 3.264762930170e-02 3.089713927853e-02 2.906247587534e-02 +2.714952048553e-02 2.516435941306e-02 2.311326487786e-02 2.100267555991e-02 +1.883917674134e-02 1.662948010682e-02 1.438040326324e-02 1.209884904005e-02 +9.791784632412e-03 7.466220649033e-03 5.129190126911e-03 2.787727574883e-03 +4.488481075623e-04 -1.880473269300e-03 -4.193322161681e-03 -6.482865018936e-03 +-8.742369035817e-03 -1.096522166770e-02 -1.314494970317e-02 -1.527523783979e-02 +-1.734994671037e-02 -1.936313030911e-02 -2.130905276877e-02 -2.318220444232e-02 +-2.497731724460e-02 -2.668937921196e-02 -2.831364824041e-02 -2.984566496514e-02 +-3.128126474734e-02 -3.261658873654e-02 -3.384809397998e-02 -3.497256255322e-02 +-3.598710968913e-02 -3.688919088565e-02 -3.767660797564e-02 -3.834751414526e-02 +-3.890041789059e-02 -3.933418590523e-02 -3.964804489491e-02 -3.984158231818e-02 +-3.991474605563e-02 -3.986784301293e-02 -3.970153666648e-02 -3.941684356308e-02 +-3.901512878856e-02 -3.849810042285e-02 -3.786780300217e-02 -3.712661001169e-02 +-3.627721543499e-02 -3.532262438894e-02 -3.426614287566e-02 -3.311136668538e-02 +-3.186216948641e-02 -3.052269014089e-02 -2.909731928684e-02 -2.759068522925e-02 +-2.600763918471e-02 -2.435323992584e-02 -2.263273787325e-02 -2.085155868453e-02 +-1.901528639060e-02 -1.712964613127e-02 -1.520048654261e-02 -1.323376184967e-02 +-1.123551371869e-02 -9.211852923402e-03 -7.168940880532e-03 -5.112971109536e-03 +-3.050150671791e-03 -9.866816442555e-04 1.071257317729e-03 3.117529274252e-03 +5.146057097701e-03 7.150841319863e-03 9.125977677427e-03 1.106567430511e-02 +1.296426852686e-02 1.481624319706e-02 1.661624254499e-02 1.835908747760e-02 +2.003979029747e-02 2.165356879447e-02 2.319585967185e-02 2.466233126973e-02 +2.604889555069e-02 2.735171931510e-02 2.856723461572e-02 2.969214834385e-02 +3.072345096179e-02 3.165842435904e-02 3.249464881219e-02 3.323000903138e-02 +3.386269927885e-02 3.439122754791e-02 3.481441879354e-02 3.513141720857e-02 +3.534168754237e-02 3.544501546162e-02 3.544150695593e-02 3.533158679331e-02 +3.511599603395e-02 3.479578861309e-02 3.437232700647e-02 3.384727699485e-02 +3.322260154632e-02 3.250055383794e-02 3.168366944046e-02 3.077475769253e-02 +2.977689229300e-02 2.869340114195e-02 2.752785546354e-02 2.628405824548e-02 +2.496603203204e-02 2.357800610901e-02 2.212440312114e-02 2.060982516361e-02 +1.903903939084e-02 1.741696318714e-02 1.574864894472e-02 1.403926849582e-02 +1.229409724626e-02 1.051849805872e-02 8.717904934536e-03 6.897806543011e-03 +5.063729647956e-03 3.221222480840e-03 1.375838110240e-03 -4.668821430431e-04 +-2.301425196093e-03 -4.122322550559e-03 -5.924166447871e-03 -7.701625785658e-03 +-9.449461748942e-03 -1.116254311066e-02 -1.283586115725e-02 -1.446454419619e-02 +-1.604387160401e-02 -1.756928737443e-02 -1.903641312830e-02 -2.044106054845e-02 +-2.177924320460e-02 -2.304718773514e-02 -2.424134435498e-02 -2.535839666045e-02 +-2.639527070462e-02 -2.734914331846e-02 -2.821744965592e-02 -2.899788994295e-02 +-2.968843541330e-02 -3.028733341619e-02 -3.079311168353e-02 -3.120458174679e-02 +-3.152084149646e-02 -3.174127687922e-02 -3.186556273085e-02 -3.189366274530e-02 +-3.182582858295e-02 -3.166259812364e-02 -3.140479287259e-02 -3.105351452977e-02 +-3.061014073575e-02 -3.007632000953e-02 -2.945396589599e-02 -2.874525034323e-02 +-2.795259633192e-02 -2.707866978123e-02 -2.612637075772e-02 -2.509882401582e-02 +-2.399936890015e-02 -2.283154864200e-02 -2.159909908372e-02 -2.030593686649e-02 +-1.895614711856e-02 -1.755397068200e-02 -1.610379091781e-02 -1.461012012981e-02 +-1.307758564908e-02 -1.151091562159e-02 -9.914924542104e-03 -8.294498578460e-03 +-6.654580730483e-03 -5.000155868316e-03 -3.336235695113e-03 -1.667843679102e-03 +-1.539764785014e-15 1.662293445418e-03 3.314067934178e-03 4.950402660314e-03 +6.566439287048e-03 + L N + 1 10 +0.000000000000e+00 2.004864164329e-02 4.005374818685e-02 5.997189707219e-02 +7.975989050636e-02 9.937486705384e-02 1.187744122816e-01 1.379166681467e-01 +1.567604408180e-01 1.752653066309e-01 1.933917158755e-01 2.111010941297e-01 +2.283559408516e-01 2.451199249570e-01 2.613579771150e-01 2.770363785041e-01 +2.921228457845e-01 3.065866120476e-01 3.203985035237e-01 3.335310118337e-01 +3.459583615878e-01 3.576565731488e-01 3.686035203875e-01 3.787789832775e-01 +3.881646951877e-01 3.967443847496e-01 4.045038121897e-01 4.114308000356e-01 +4.175152581199e-01 4.227492028224e-01 4.271267705091e-01 4.306442251418e-01 +4.332999600511e-01 4.350944938804e-01 4.360304607265e-01 4.361125945205e-01 +4.353477077066e-01 4.337446642945e-01 4.313143473783e-01 4.280696212279e-01 +4.240252880779e-01 4.191980397498e-01 4.136064042641e-01 4.072706876057e-01 +4.002129108269e-01 3.924567426797e-01 3.840274279856e-01 3.749517119611e-01 +3.652577607274e-01 3.549750782466e-01 3.441344199325e-01 3.327677031962e-01 +3.209079151926e-01 3.085890180434e-01 2.958458518164e-01 2.827140355489e-01 +2.692298666055e-01 2.554302186671e-01 2.413524386478e-01 2.270342428415e-01 +2.125136125998e-01 1.978286898425e-01 1.830176727020e-01 1.681187116030e-01 +1.531698060731e-01 1.382087025797e-01 1.232727936826e-01 1.083990187879e-01 +9.362376678147e-02 7.898278081579e-02 6.451106551345e-02 5.024279684566e-02 +3.621123493252e-02 2.244864000347e-02 8.986191745619e-03 -4.146087743652e-03 +-1.691940719460e-02 -2.930627540092e-02 -4.128056627346e-02 -5.281757954507e-02 +-6.389409697353e-02 -7.448843390387e-02 -8.458048606534e-02 -9.415177149377e-02 +-1.031854674845e-01 -1.116664424970e-01 -1.195812829467e-01 -1.269183148374e-01 +-1.336676201993e-01 -1.398210483195e-01 -1.453722217596e-01 -1.503165371794e-01 +-1.546511609934e-01 -1.583750199077e-01 -1.614887863972e-01 -1.639948591984e-01 +-1.658973389091e-01 -1.672019987983e-01 -1.679162509452e-01 -1.680491078393e-01 +-1.676111395862e-01 -1.666144268762e-01 -1.650725098854e-01 -1.630003332896e-01 +-1.604141875824e-01 -1.573316468998e-01 -1.537715035604e-01 -1.497536995435e-01 +-1.452992551303e-01 -1.404301949456e-01 -1.351694716394e-01 -1.295408874580e-01 +-1.235690139552e-01 -1.172791101008e-01 -1.106970390463e-01 -1.038491838104e-01 +-9.676236214780e-02 -8.946374086651e-02 -8.198074985927e-02 -7.434099611248e-02 +-6.657217795589e-02 -5.870199981310e-02 -5.075808771010e-02 -4.276790579488e-02 +-3.475867411658e-02 -2.675728790703e-02 -1.879023860142e-02 -1.088353682792e-02 +-3.062637588332e-03 4.647632156173e-03 1.222314328917e-02 1.964053153738e-02 +2.687726147770e-02 3.391168737783e-02 4.072311070645e-02 4.729183416044e-02 +5.359921206845e-02 5.962769704250e-02 6.536088276179e-02 7.078354278585e-02 +7.588166530734e-02 8.064248376806e-02 8.505450327531e-02 8.910752276941e-02 +9.279265290674e-02 9.610232963664e-02 9.903032346394e-02 1.015717444029e-01 +1.037230426415e-01 1.054820049488e-01 1.068477468715e-01 1.078207007777e-01 +1.084025998205e-01 1.085964579047e-01 1.084065457533e-01 1.078383631812e-01 +1.068986076957e-01 1.055951395535e-01 1.039369434151e-01 1.019340867459e-01 +9.959767512544e-02 9.693980463058e-02 9.397351147173e-02 9.071271906439e-02 +8.717218272780e-02 8.336743220780e-02 7.931471222655e-02 7.503092126704e-02 +7.053354880411e-02 6.584061119752e-02 6.097058646507e-02 5.594234815611e-02 +5.077509854694e-02 4.548830138022e-02 4.010161437038e-02 3.463482169635e-02 +2.910776670111e-02 2.354028501549e-02 1.795213832078e-02 1.236294896080e-02 +6.792135610295e-03 1.258850200934e-03 -4.218083698605e-03 -9.620230858748e-03 +-1.492960253797e-02 -2.012871262865e-02 -2.520063163165e-02 -3.012903829971e-02 +-3.489826879872e-02 -3.949336324477e-02 -4.390010948483e-02 -4.810508399883e-02 +-5.209568981097e-02 -5.586019130913e-02 -5.938774588175e-02 -6.266843229296e-02 +-6.569327572773e-02 -6.845426945066e-02 -7.094439303319e-02 -7.315762711593e-02 +-7.508896468429e-02 -7.673441884752e-02 -7.809102712250e-02 -7.915685223563e-02 +-7.993097946722e-02 -8.041351057425e-02 -8.060555433844e-02 -8.050921379745e-02 +-8.012757022741e-02 -7.946466395572e-02 -7.852547209259e-02 -7.731588327969e-02 +-7.584266956346e-02 -7.411345550934e-02 -7.213668468178e-02 -6.992158362252e-02 +-6.747812346731e-02 -6.481697934799e-02 -6.194948773330e-02 -5.888760186748e-02 +-5.564384547130e-02 -5.223126487436e-02 -4.866337975202e-02 -4.495413264360e-02 +-4.111783743128e-02 -3.716912696158e-02 -3.312289999281e-02 -2.899426765287e-02 +-2.479849959220e-02 -2.055097001649e-02 -1.626710378278e-02 -1.196232274131e-02 +-7.651992503055e-03 -3.351369810803e-03 9.244493122807e-04 5.160580465896e-03 +9.342400661638e-03 1.345559683653e-02 1.748621293522e-02 2.142069541087e-02 +2.524593700109e-02 2.894931864218e-02 3.251874939191e-02 3.594270423906e-02 +3.921025968548e-02 4.231112699506e-02 4.523568301251e-02 4.797499846364e-02 +5.052086365817e-02 5.286581152518e-02 5.500313792111e-02 5.692691915965e-02 +5.863202672279e-02 6.011413912208e-02 6.136975088909e-02 6.239617868396e-02 +6.319156452082e-02 6.375487611866e-02 6.408590439613e-02 6.418525813809e-02 +6.405435587152e-02 6.369541499742e-02 6.311143823471e-02 6.230619744047e-02 +6.128421488011e-02 6.005074202860e-02 5.861173599241e-02 5.697383364896e-02 +5.514432360789e-02 5.313111610504e-02 5.094271094654e-02 4.858816362643e-02 +4.607704974642e-02 4.341942787185e-02 4.062580096206e-02 3.770707651766e-02 +3.467452559057e-02 3.153974080592e-02 2.831459354694e-02 2.501119045654e-02 +2.164182941010e-02 1.821895511529e-02 1.475511449471e-02 1.126291200738e-02 +7.754965063920e-03 4.243859689298e-03 7.421065851342e-04 -2.737902258719e-03 +-6.183936256412e-03 -9.583968078509e-03 -1.292621452469e-02 -1.619917628107e-02 +-1.939167643117e-02 -2.249289759449e-02 -2.549241757245e-02 -2.838024338689e-02 +-3.114684360294e-02 -3.378317883446e-02 -3.628073033708e-02 -3.863152660118e-02 +-4.082816786452e-02 -4.286384847181e-02 -4.473237701661e-02 -4.642819420862e-02 +-4.794638841819e-02 -4.928270885753e-02 -5.043357636716e-02 -5.139609178411e-02 +-5.216804187731e-02 -5.274790284372e-02 -5.313484136769e-02 -5.332871325409e-02 +-5.333005965434e-02 -5.314010091262e-02 -5.276072806770e-02 -5.219449205378e-02 +-5.144459065131e-02 -5.051485324662e-02 -4.940972346612e-02 -4.813423975813e-02 +-4.669401400190e-02 -4.509520822999e-02 -4.334450955621e-02 -4.144910340686e-02 +-3.941664515877e-02 -3.725523029218e-02 -3.497336317145e-02 -3.257992457041e-02 +-3.008413806323e-02 -2.749553540467e-02 -2.482392102666e-02 -2.207933578043e-02 +-1.927202005531e-02 -1.641237640686e-02 -1.351093182804e-02 -1.057829979737e-02 +-7.625142238595e-03 -4.662131525298e-03 -1.699912663701e-03 1.250934214945e-03 +4.179930922482e-03 7.076737714922e-03 9.931189101533e-03 1.273332884009e-02 +1.547344399990e-02 1.814209797818e-02 2.073016235946e-02 2.322884751252e-02 +2.562973182413e-02 2.792478947434e-02 3.010641666348e-02 3.216745620708e-02 +3.410122042100e-02 3.590151222541e-02 3.756264440283e-02 3.907945695250e-02 +4.044733248991e-02 4.166220964770e-02 4.272059444137e-02 4.361956957043e-02 +4.435680163298e-02 4.493054623945e-02 4.533965101810e-02 4.558355651299e-02 +4.566229498192e-02 4.557648710952e-02 4.532733665778e-02 4.491662308349e-02 +4.434669215893e-02 4.362044463923e-02 4.274132302606e-02 4.171329648416e-02 +4.054084397319e-02 3.922893566336e-02 3.778301270904e-02 3.620896545993e-02 +3.451311019452e-02 3.270216446519e-02 3.078322114897e-02 2.876372130186e-02 +2.665142591846e-02 2.445438670201e-02 2.218091595286e-02 1.983955568594e-02 +1.743904609016e-02 1.498829344416e-02 1.249633760444e-02 9.972319182722e-03 +7.425446529940e-03 4.864962644432e-03 2.300112121540e-03 -2.598917388347e-04 +-2.805899551278e-03 -5.328858076613e-03 -7.819841954325e-03 -1.027008482593e-02 +-1.267100974223e-02 -1.501425875040e-02 -1.729172156025e-02 -1.949556319270e-02 +-2.161825051761e-02 -2.365257759228e-02 -2.559168971691e-02 -2.742910612772e-02 +-2.915874125420e-02 -3.077492447184e-02 -3.227241828756e-02 -3.364643490095e-02 +-3.489265109020e-02 -3.600722137795e-02 -3.698678943834e-02 -3.782849771329e-02 +-3.852999521197e-02 -3.908944347460e-02 -3.950552068759e-02 -3.977742394431e-02 +-3.990486965171e-02 -3.988809209007e-02 -3.972784013937e-02 -3.942537219222e-02 +-3.898244927969e-02 -3.840132644254e-02 -3.768474238633e-02 -3.683590746490e-02 +-3.585849004241e-02 -3.475660128944e-02 -3.353477847430e-02 -3.219796681543e-02 +-3.075149996562e-02 -2.920107920358e-02 -2.755275141222e-02 -2.581288592724e-02 +-2.398815034318e-02 -2.208548536733e-02 -2.011207881489e-02 -1.807533884159e-02 +-1.598286651190e-02 -1.384242780324e-02 -1.166192514795e-02 -9.449368616029e-03 +-7.212846842601e-03 -4.960497804243e-03 -2.700479548737e-03 -4.409409822704e-04 +1.810007182417e-03 4.044321214475e-03 6.254052788899e-03 8.431376946610e-03 +1.056861949336e-02 1.265828374257e-02 1.469307650983e-02 1.666593327010e-02 +1.857004239157e-02 2.039886836419e-02 2.214617394453e-02 2.380604114285e-02 +2.537289098282e-02 2.684150196859e-02 2.820702719934e-02 2.946501007592e-02 +3.061139854973e-02 3.164255786935e-02 3.255528178579e-02 3.334680218296e-02 +3.401479710578e-02 3.455739716389e-02 3.497319029498e-02 3.526122487769e-02 +3.542101118961e-02 3.545252121225e-02 3.535618679028e-02 3.513289615849e-02 +3.478398885543e-02 3.431124904846e-02 3.371689730043e-02 3.300358081369e-02 +3.217436219224e-02 3.123270676812e-02 3.018246854296e-02 2.902787480027e-02 +2.777350944864e-02 2.642429516031e-02 2.498547437342e-02 2.346258923028e-02 +2.186146052724e-02 2.018816575514e-02 1.844901631213e-02 1.665053397331e-02 +1.479942670392e-02 1.290256390496e-02 1.096695118144e-02 8.999704725225e-03 +7.008025405165e-03 4.999172657959e-03 2.980438273595e-03 9.591201691588e-04 +-1.057503755487e-03 -3.062201587306e-03 -5.047813103120e-03 -7.007275115486e-03 +-8.933646372492e-03 -1.082013192444e-02 -1.266010687264e-02 -1.444713941799e-02 +-1.617501313000e-02 -1.783774835972e-02 -1.942962272361e-02 -2.094519058887e-02 +-2.237930149457e-02 -2.372711744690e-02 -2.498412903130e-02 -2.614617028833e-02 +-2.720943230507e-02 -2.817047547839e-02 -2.902624041133e-02 -2.977405740903e-02 +-3.041165454542e-02 -3.093716427746e-02 -3.134912858868e-02 -3.164650264916e-02 +-3.182865698466e-02 -3.189537815236e-02 -3.184686792677e-02 -3.168374100401e-02 +-3.140702123818e-02 -3.101813642883e-02 -3.051891168338e-02 -2.991156138346e-02 +-2.919867978912e-02 -2.838323031923e-02 -2.746853355148e-02 -2.645825398932e-02 +-2.535638564767e-02 -2.416723651317e-02 -2.289541193861e-02 -2.154579703466e-02 +-2.012353812540e-02 -1.863402333740e-02 -1.708286239459e-02 -1.547586569425e-02 +-1.381902274107e-02 -1.211848001905e-02 -1.038051838184e-02 -8.611530044460e-03 +-6.817995259627e-03 -5.006458763405e-03 -3.183506074999e-03 -1.355739735954e-03 +4.702444261774e-04 2.287880924952e-03 4.090658048933e-03 5.872141019292e-03 +7.625994789379e-03 9.346006406019e-03 1.102610685420e-02 1.266039230890e-02 +1.424314472013e-02 1.576885166011e-02 1.723222536401e-02 1.862822089924e-02 +1.995205340120e-02 2.119921431727e-02 2.236548660433e-02 2.344695882920e-02 +2.444003812529e-02 2.534146196321e-02 2.614830869725e-02 2.685800685435e-02 +2.746834313655e-02 2.797746911293e-02 2.838390658129e-02 2.868655158536e-02 +2.888467707741e-02 2.897793422157e-02 2.896635233780e-02 2.885033749128e-02 +2.863066973694e-02 2.830849903352e-02 2.788533984624e-02 2.736306446191e-02 +2.674389504468e-02 2.603039446512e-02 2.522545593952e-02 2.433229152056e-02 +2.335441948430e-02 2.229565066234e-02 2.116007377167e-02 1.995203979781e-02 +1.867614549062e-02 1.733721603445e-02 1.594028695760e-02 1.449058534836e-02 +1.299351044696e-02 1.145461368516e-02 9.879578246670e-03 8.274198223086e-03 +6.644357441323e-03 4.996008039433e-03 3.335148868278e-03 1.667803796964e-03 +3.832418577154e-15 -1.662253695995e-03 -3.312988328793e-03 -4.946296103549e-03 +-6.556351406844e-03 + L N + 1 11 +0.000000000000e+00 2.179313647908e-02 4.353035148499e-02 6.515589437070e-02 +8.661435557316e-02 1.078508357368e-01 1.288111131402e-01 1.494418088701e-01 +1.696905491932e-01 1.895061245890e-01 2.088386449143e-01 2.276396901883e-01 +2.458624564983e-01 2.634618965462e-01 2.803948543723e-01 2.966201938157e-01 +3.120989202896e-01 3.267942954758e-01 3.406719445652e-01 3.536999556995e-01 +3.658489712929e-01 3.770922709447e-01 3.874058456805e-01 3.967684632900e-01 +4.051617245613e-01 4.125701102424e-01 4.189810185926e-01 4.243847934197e-01 +4.287747425303e-01 4.321471465559e-01 4.345012581483e-01 4.358392915717e-01 +4.361664027526e-01 4.354906598801e-01 4.338230046825e-01 4.311772045361e-01 +4.275697955963e-01 4.230200171681e-01 4.175497375648e-01 4.111833717325e-01 +4.039477909438e-01 3.958722248923e-01 3.869881565445e-01 3.773292101283e-01 +3.669310326625e-01 3.558311694484e-01 3.440689339701e-01 3.316852726619e-01 +3.187226250217e-01 3.052247795617e-01 2.912367261015e-01 2.768045049186e-01 +2.619750532809e-01 2.467960498929e-01 2.313157577933e-01 2.155828662428e-01 +1.996463321450e-01 1.835552215413e-01 1.673585517181e-01 1.511051344618e-01 +1.348434209883e-01 1.186213490687e-01 1.024861928608e-01 8.648441594503e-02 +7.066152805026e-02 5.506194593974e-02 3.972885891084e-02 2.470409934367e-02 +1.002801871455e-02 -4.260630531350e-03 -1.812480687587e-02 -3.152928504390e-02 +-4.444075441587e-02 -5.682791023875e-02 -6.866153736488e-02 -7.991458627492e-02 +-9.056224117035e-02 -1.005819799495e-01 -1.099536259108e-01 -1.186593910576e-01 +-1.266839109077e-01 -1.340142707436e-01 -1.406400232677e-01 -1.465531976587e-01 +-1.517483000572e-01 -1.562223055341e-01 -1.599746416325e-01 -1.630071635954e-01 +-1.653241214276e-01 -1.669321189622e-01 -1.678400651353e-01 -1.680591176933e-01 +-1.676026195889e-01 -1.664860283409e-01 -1.647268386600e-01 -1.623444986645e-01 +-1.593603200295e-01 -1.557973824329e-01 -1.516804326828e-01 -1.470357789218e-01 +-1.418911803256e-01 -1.362757327206e-01 -1.302197505626e-01 -1.237546457239e-01 +-1.169128035497e-01 -1.097274566472e-01 -1.022325568785e-01 -9.446264603178e-02 +-8.645272564422e-02 -7.823812645441e-02 -6.985437795556e-02 -6.133707852051e-02 +-5.272176656260e-02 -4.404379319008e-02 -3.533819680296e-02 -2.663958007102e-02 +-1.798198971996e-02 -9.398799539355e-03 -9.225970114397e-04 7.414926056442e-03 +1.558307853021e-02 2.355227023146e-02 3.129410717687e-02 3.878148146859e-02 +4.598865555143e-02 5.289134057545e-02 5.946676862642e-02 6.569375861076e-02 +7.155277560676e-02 7.702598351955e-02 8.209729090292e-02 8.675238983800e-02 +9.097878778495e-02 9.476583235083e-02 9.810472894348e-02 1.009885513080e-01 +1.034122449693e-01 1.053726236294e-01 1.068683585957e-01 1.078999613413e-01 +1.084697593221e-01 1.085818652020e-01 1.082421396595e-01 1.074581479724e-01 +1.062391105989e-01 1.045958479944e-01 1.025407199239e-01 1.000875595466e-01 +9.725160257056e-02 9.404941178636e-02 9.049879730973e-02 8.661873287188e-02 +8.242926851147e-02 7.795144003197e-02 7.320717559788e-02 6.821919985121e-02 +6.301093593613e-02 5.760640582461e-02 5.203012933925e-02 4.630702227151e-02 +4.046229399383e-02 3.452134496283e-02 2.850966450844e-02 2.245272929924e-02 +1.637590286890e-02 1.030433658157e-02 4.262872405336e-03 -1.724052146652e-03 +-7.632496559132e-03 -1.343910700584e-02 -1.912120286645e-02 -2.465685976182e-02 +-3.002498881579e-02 -3.520541186869e-02 -4.017893238544e-02 -4.492740181995e-02 +-4.943378121662e-02 -5.368219785040e-02 -5.765799672723e-02 -6.134778678827e-02 +-6.473948168299e-02 -6.782233499842e-02 -7.058696985439e-02 -7.302540279695e-02 +-7.513106194530e-02 -7.689879936999e-02 -7.832489770306e-02 -7.940707100312e-02 +-8.014445992091e-02 -8.053762123268e-02 -8.058851183007e-02 -8.030046727682e-02 +-7.967817506226e-02 -7.872764270218e-02 -7.745616085613e-02 -7.587226164889e-02 +-7.398567240102e-02 -7.180726499017e-02 -6.934900108004e-02 -6.662387346879e-02 +-6.364584382149e-02 -6.042977706421e-02 -5.699137272778e-02 -5.334709353956e-02 +-4.951409156995e-02 -4.551013224788e-02 -4.135351656568e-02 -3.706300179806e-02 +-3.265772106416e-02 -2.815710206293e-02 -2.358078531356e-02 -1.894854223191e-02 +-1.428019337201e-02 -9.595527158838e-03 -4.914219434093e-03 -2.557541309840e-04 +4.360654612551e-03 8.916138600968e-03 1.339224969642e-02 1.777103162032e-02 +2.203508917061e-02 2.616765459631e-02 3.015265088436e-02 3.397475172781e-02 +3.761943795926e-02 4.107305024936e-02 4.432283788633e-02 4.735700346988e-02 +5.016474336993e-02 5.273628381917e-02 5.506291252654e-02 5.713700571763e-02 +5.895205052719e-02 6.050266268794e-02 6.178459947919e-02 6.279476791836e-02 +6.353122819741e-02 6.399319238558e-02 6.418101843872e-02 6.409619957396e-02 +6.374134908698e-02 6.312018070691e-02 6.223748460108e-02 6.109909915894e-02 +5.971187870037e-02 5.808365726915e-02 5.622320868722e-02 5.414020305894e-02 +5.184515992814e-02 4.934939830240e-02 4.666498377061e-02 4.380467294984e-02 +4.078185550705e-02 3.761049400912e-02 3.430506186180e-02 3.088047960438e-02 +2.735204983156e-02 2.373539101786e-02 2.004637052257e-02 1.630103705456e-02 +1.251555287685e-02 8.706126029876e-03 4.888942850580e-03 1.080101061262e-03 +-2.704456301719e-03 -6.449005854733e-03 -1.013810747059e-02 -1.375666626791e-02 +-1.728999274300e-02 -2.072386081036e-02 -2.404456352797e-02 -2.723896629411e-02 +-3.029455731476e-02 -3.319949515228e-02 -3.594265317999e-02 -3.851366078028e-02 +-4.090294113888e-02 -4.310174550227e-02 -4.510218378084e-02 -4.689725139583e-02 +-4.848085228438e-02 -4.984781799297e-02 -5.099392280627e-02 -5.191589487472e-02 +-5.261142332107e-02 -5.307916132229e-02 -5.331872518030e-02 -5.333068941089e-02 +-5.311657789653e-02 -5.267885116464e-02 -5.202088986843e-02 -5.114697456235e-02 +-5.006226187908e-02 -4.877275722901e-02 -4.728528415663e-02 -4.560745050123e-02 +-4.374761152173e-02 -4.171483015650e-02 -3.951883460044e-02 -3.716997339087e-02 +-3.467916820333e-02 -3.205786456648e-02 -2.931798071251e-02 -2.647185478601e-02 +-2.353219063955e-02 -2.051200244886e-02 -1.742455838377e-02 -1.428332357382e-02 +-1.110190260871e-02 -7.893981814469e-03 -4.673271545616e-03 -1.453448732228e-03 +1.751900081738e-03 4.929334975789e-03 8.065617937246e-03 1.114776696915e-02 +1.416310880441e-02 1.709933001595e-02 1.994452632029e-02 2.268724988081e-02 +2.531655442606e-02 2.782203800892e-02 3.019388324267e-02 3.242289486188e-02 +3.450053446752e-02 3.641895232851e-02 3.817101612440e-02 3.975033652761e-02 +4.115128953698e-02 4.236903548838e-02 4.339953468251e-02 4.423955958394e-02 +4.488670356038e-02 4.533938614526e-02 4.559685482141e-02 4.565918333805e-02 +4.552726658742e-02 4.520281208183e-02 4.468832808529e-02 4.398710846806e-02 +4.310321436509e-02 4.204145273253e-02 4.080735190866e-02 3.940713429764e-02 +3.784768630540e-02 3.613652566818e-02 3.428176632399e-02 3.229208098661e-02 +3.017666159085e-02 2.794517778511e-02 2.560773365507e-02 2.317482286836e-02 +2.065728243558e-02 1.806624528813e-02 1.541309187673e-02 1.270940099779e-02 +9.966900056893e-03 7.197414979788e-03 4.412819981767e-03 1.624987405761e-03 +-1.154262161871e-03 -3.913209291151e-03 -6.640284420206e-03 -9.324115679194e-03 +-1.195357563138e-02 -1.451782674183e-02 -1.700636539054e-02 -1.940906425357e-02 +-2.171621288381e-02 -2.391855633098e-02 -2.600733164970e-02 -2.797430215388e-02 +-2.981178928597e-02 -3.151270197986e-02 -3.307056340770e-02 -3.447953501202e-02 +-3.573443773653e-02 -3.683077038102e-02 -3.776472501805e-02 -3.853319942200e-02 +-3.913380647322e-02 -3.956488051348e-02 -3.982548064107e-02 -3.991539094731e-02 +-3.983511770864e-02 -3.958588356111e-02 -3.916961869685e-02 -3.858894913381e-02 +-3.784718212267e-02 -3.694828876587e-02 -3.589688393539e-02 -3.469820358660e-02 +-3.335807957590e-02 -3.188291209987e-02 -3.027963988299e-02 -2.855570824968e-02 +-2.671903522478e-02 -2.477797581401e-02 -2.274128462294e-02 -2.061807697903e-02 +-1.841778872704e-02 -1.615013487255e-02 -1.382506725260e-02 -1.145273141545e-02 +-9.043422894160e-03 -6.607543060106e-03 -4.155554743638e-03 -1.697937809094e-03 +7.548551292782e-04 3.192442665382e-03 5.604558050438e-03 7.981091953342e-03 +1.031213435602e-02 1.258801541199e-02 1.479934510156e-02 1.693705152268e-02 +1.899241766321e-02 2.095711650716e-02 2.282324433526e-02 2.458335208836e-02 +2.623047467085e-02 2.775815808054e-02 2.916048426097e-02 3.043209358222e-02 +3.156820486655e-02 3.256463288599e-02 3.341780326972e-02 3.412476477049e-02 +3.468319885036e-02 3.509142655758e-02 3.534841267794e-02 3.545376715538e-02 +3.540774378797e-02 3.521123621720e-02 3.486577123920e-02 3.437349947812e-02 +3.373718347255e-02 3.296018323647e-02 3.204643936670e-02 3.100045377861e-02 +2.982726816161e-02 2.853244025504e-02 2.712201805375e-02 2.560251206090e-02 +2.398086571340e-02 2.226442411211e-02 2.046090119586e-02 1.857834550417e-02 +1.662510467876e-02 1.460978885874e-02 1.254123312817e-02 1.042845917830e-02 +8.280636348997e-03 6.107042216126e-03 3.917022892714e-03 1.719953212175e-03 +-4.748030382492e-04 -2.657932666617e-03 -4.820212242419e-03 -6.952546716402e-03 +-9.046007333782e-03 -1.109186868417e-02 -1.308164473581e-02 -1.500712370661e-02 +-1.686040163002e-02 -1.863391447977e-02 -2.032046872421e-02 -2.191327018802e-02 +-2.340595110683e-02 -2.479259526816e-02 -2.606776114068e-02 -2.722650290280e-02 +-2.826438929035e-02 -2.917752019323e-02 -2.996254094007e-02 -3.061665422028e-02 +-3.113762960290e-02 -3.152381062200e-02 -3.177411940849e-02 -3.188805885902e-02 +-3.186571234266e-02 -3.170774095667e-02 -3.141537835273e-02 -3.099042316541e-02 +-3.043522908428e-02 -2.975269262116e-02 -2.894623863318e-02 -2.801980367190e-02 +-2.697781723715e-02 -2.582518102325e-02 -2.456724625301e-02 -2.320978920269e-02 +-2.175898502853e-02 -2.022138001172e-02 -1.860386234538e-02 -1.691363159244e-02 +-1.515816694857e-02 -1.334519444867e-02 -1.148265325965e-02 -9.578661205024e-03 +-7.641479670110e-03 -5.679478038152e-03 -3.701097809389e-03 -1.714816555726e-03 +2.708881362214e-04 2.247574581434e-03 4.206872621096e-03 6.140518806220e-03 +8.040390993455e-03 9.898542209267e-03 1.170723364232e-02 1.345896662807e-02 +1.514651349440e-02 1.676294714233e-02 1.830166924172e-02 1.975643692822e-02 +2.112138789423e-02 2.239106377415e-02 2.356043173148e-02 2.462490416344e-02 +2.558035644686e-02 2.642314265784e-02 2.715010920632e-02 2.775860633575e-02 +2.824649744724e-02 2.861216621701e-02 2.885452148515e-02 2.897299990333e-02 +2.896756633873e-02 2.883871204058e-02 2.858745058548e-02 2.821531162677e-02 +2.772433248241e-02 2.711704760501e-02 2.639647598612e-02 2.556610655562e-02 +2.462988164546e-02 2.359217859434e-02 2.245778957821e-02 2.123189975812e-02 +1.992006384398e-02 1.852818117902e-02 1.706246945562e-02 1.552943717875e-02 +1.393585499764e-02 1.228872603135e-02 1.059525531705e-02 8.862818513530e-03 +7.098929994781e-03 5.311210470988e-03 3.507354275343e-03 1.695096456355e-03 +-1.178201845162e-04 -1.923677970274e-03 -3.714817002090e-03 -5.483667451956e-03 +-7.222781358961e-03 -8.924863796434e-03 -1.058280328031e-02 -1.218970129275e-02 +-1.373890079919e-02 -1.522401364171e-02 -1.663894669672e-02 -1.797792669063e-02 +-1.923552357318e-02 -2.040667235442e-02 -2.148669331847e-02 -2.247131053399e-02 +-2.335666858892e-02 -2.413934748492e-02 -2.481637563465e-02 -2.538524091358e-02 +-2.584389972606e-02 -2.619078405428e-02 -2.642480646702e-02 -2.654536307404e-02 +-2.655233442062e-02 -2.644608432550e-02 -2.622745667403e-02 -2.589777018717e-02 +-2.545881119531e-02 -2.491282445423e-02 -2.426250204868e-02 -2.351097043711e-02 +-2.266177569858e-02 -2.171886705035e-02 -2.068657871186e-02 -1.956961019731e-02 +-1.837300512556e-02 -1.710212864223e-02 -1.576264355393e-02 -1.436048528026e-02 +-1.290183573343e-02 -1.139309623976e-02 -9.840859620859e-03 -8.251881555604e-03 +-6.633051346524e-03 -4.991362216394e-03 -3.333881262430e-03 -1.667719196465e-03 +-1.252189741753e-15 1.662169377033e-03 3.311729145596e-03 4.941696507830e-03 +6.545195062944e-03 + L N + 1 12 +0.000000000000e+00 2.353708990158e-02 4.700372424124e-02 7.032969852654e-02 +9.344530942979e-02 1.162816029389e-01 1.387706196013e-01 1.608456359111e-01 +1.824414009039e-01 2.034943670446e-01 2.239429145167e-01 2.437275680475e-01 +2.627912054346e-01 2.810792569734e-01 2.985398950222e-01 3.151242129802e-01 +3.307863929987e-01 3.454838617916e-01 3.591774339565e-01 3.718314422736e-01 +3.834138544972e-01 3.938963762135e-01 4.032545393913e-01 4.114677763133e-01 +4.185194786323e-01 4.243970413570e-01 4.290918916348e-01 4.325995022568e-01 +4.349193898750e-01 4.360550979795e-01 4.360141647480e-01 4.348080759372e-01 +4.324522030470e-01 4.289657270467e-01 4.243715480088e-01 4.186961810524e-01 +4.119696390512e-01 4.042253026151e-01 3.954997778998e-01 3.858327428509e-01 +3.752667825307e-01 3.638472142173e-01 3.516219030072e-01 3.386410686858e-01 +3.249570846632e-01 3.106242698036e-01 2.956986739995e-01 2.802378583656e-01 +2.643006709472e-01 2.479470188474e-01 2.312376376950e-01 2.142338593760e-01 +1.969973789599e-01 1.795900217460e-01 1.620735113556e-01 1.445092397843e-01 +1.269580403177e-01 1.094799641977e-01 9.213406190838e-02 7.497816992517e-02 +5.806870374771e-02 4.146045800476e-02 2.520641438815e-02 9.357558136381e-03 +-6.037296249583e-03 -2.093166941763e-02 -3.528157110542e-02 -4.904564305986e-02 +-6.218529043189e-02 -7.466480119359e-02 -8.645145317610e-02 -9.751560838008e-02 +-1.078307942646e-01 -1.173737717757e-01 -1.261245899322e-01 -1.340666268415e-01 +-1.411866170774e-01 -1.474746654061e-01 -1.529242469034e-01 -1.575321935658e-01 +-1.612986675667e-01 -1.642271213709e-01 -1.663242449674e-01 -1.675999005374e-01 +-1.680670449203e-01 -1.677416402926e-01 -1.666425535187e-01 -1.647914446778e-01 +-1.622126453124e-01 -1.589330269841e-01 -1.549818607578e-01 -1.503906682705e-01 +-1.451930650704e-01 -1.394245969404e-01 -1.331225699455e-01 -1.263258749621e-01 +-1.190748074691e-01 -1.114108833905e-01 -1.033766517948e-01 -9.501550526063e-02 +-8.637148872350e-02 -7.748910761920e-02 -6.841313613556e-02 -5.918842637876e-02 +-4.985971924994e-02 -4.047145781489e-02 -3.106760393315e-02 -2.169145889320e-02 +-1.238548877768e-02 -3.191155256908e-03 5.851247519595e-03 1.470274929490e-02 +2.332585273513e-02 3.168467454995e-02 3.974507817269e-02 4.747479751034e-02 +5.484355131576e-02 6.182314777826e-02 6.838757897434e-02 7.451310486650e-02 +8.017832658628e-02 8.536424878543e-02 9.005433088884e-02 9.423452713178e-02 +9.789331531380e-02 1.010217142514e-01 1.036132899601e-01 1.056641506473e-01 +1.071729306415e-01 1.081407634361e-01 1.085712440671e-01 1.084703810920e-01 +1.078465384785e-01 1.067103677557e-01 1.050747308170e-01 1.029546138047e-01 +1.003670325408e-01 9.733093000097e-02 9.386706636109e-02 8.999790217305e-02 +8.574747525279e-02 8.114127188606e-02 7.620609297763e-02 7.096991578680e-02 +6.546175190632e-02 5.971150215286e-02 5.374980904527e-02 4.760790755214e-02 +4.131747479179e-02 3.491047936708e-02 2.841903101303e-02 2.187523122841e-02 +1.531102555213e-02 8.758058132643e-03 2.247529222459e-03 -4.189943788083e-03 +-1.052446120516e-02 -1.672697116450e-02 -2.276939451983e-02 -2.862474397146e-02 +-3.426723695013e-02 -3.967240180334e-02 -4.481717686565e-02 -4.968000202968e-02 +-5.424090247206e-02 -5.848156422675e-02 -6.238540133771e-02 -6.593761436314e-02 +-6.912524004507e-02 -7.193719199910e-02 -7.436429232180e-02 -7.639929405484e-02 +-7.803689448736e-02 -7.927373932002e-02 -8.010841775533e-02 -8.054144862004e-02 +-8.057525766524e-02 -8.021414622903e-02 -7.946425148455e-02 -7.833349853277e-02 +-7.683154463486e-02 -7.496971591223e-02 -7.276093687458e-02 -7.021965316594e-02 +-6.736174794674e-02 -6.420445235596e-02 -6.076625052070e-02 -5.706677960214e-02 +-5.312672538540e-02 -4.896771393767e-02 -4.461219987235e-02 -4.008335176876e-02 +-3.540493530523e-02 -3.060119466994e-02 -2.569673281675e-02 -2.071639113458e-02 +-1.568512909669e-02 -1.062790445193e-02 -5.569554513084e-03 -5.346790876653e-04 +4.452474415033e-03 9.368123181620e-03 1.418905799432e-02 1.889274854904e-02 +2.345744462895e-02 2.786227269385e-02 3.208732747020e-02 3.611375815340e-02 +3.992384886211e-02 4.350109301388e-02 4.683026132252e-02 4.989746314961e-02 +5.269020097593e-02 5.519741779228e-02 5.740953724413e-02 5.931849639975e-02 +6.091777104672e-02 6.220239345799e-02 6.316896260401e-02 6.381564682340e-02 +6.414217899965e-02 6.414984432661e-02 6.384146077934e-02 6.322135244057e-02 +6.229531586555e-02 6.107057969925e-02 5.955575779032e-02 5.776079607494e-02 +5.569691353103e-02 5.337653752900e-02 5.081323392948e-02 4.802163230036e-02 +4.501734664615e-02 4.181689206068e-02 3.843759773068e-02 3.489751673178e-02 +3.121533307059e-02 2.741026643610e-02 2.350197513124e-02 1.951045766075e-02 +1.545595345435e-02 1.135884320487e-02 7.239549299492e-03 3.118436818400e-03 +-9.842844310189e-04 -5.048656384379e-03 -9.055067245289e-03 -1.298434362790e-02 +-1.681783989414e-02 -2.053752427915e-02 -2.412606141631e-02 -2.756689089357e-02 +-3.084430149349e-02 -3.394350079322e-02 -3.685067982415e-02 -3.955307251732e-02 +-4.203900968671e-02 -4.429796733090e-02 -4.632060906158e-02 -4.809882249738e-02 +-4.962574949065e-02 -5.089581008577e-02 -5.190472013790e-02 -5.264950255174e-02 +-5.312849213097e-02 -5.334133405930e-02 -5.328897606445e-02 -5.297365434650e-02 +-5.239887338089e-02 -5.156937973537e-02 -5.049113006756e-02 -4.917125349694e-02 +-4.761800857021e-02 -4.584073506414e-02 -4.384980089242e-02 -4.165654440541e-02 +-3.927321239134e-02 -3.671289410659e-02 -3.398945167938e-02 -3.111744724624e-02 +-2.811206719445e-02 -2.498904389459e-02 -2.176457531741e-02 -1.845524293660e-02 +-1.507792832477e-02 -1.164972885379e-02 -8.187872912099e-03 -4.709635051572e-03 +-1.232251474072e-03 2.227163736248e-03 5.651701235047e-03 9.024737502409e-03 +1.233001400794e-02 1.555171408592e-02 1.867453716340e-02 2.168376999907e-02 +2.456535460730e-02 2.730595255964e-02 2.989300537537e-02 3.231479073357e-02 +3.456047426051e-02 3.662015666949e-02 3.848491605360e-02 4.014684515668e-02 +4.159908347314e-02 4.283584405281e-02 4.385243491366e-02 4.464527499170e-02 +4.521190458397e-02 4.555099026790e-02 4.566232430652e-02 4.554681857598e-02 +4.520649307801e-02 4.464445912564e-02 4.386489731591e-02 4.287303042770e-02 +4.167509140666e-02 4.027828662191e-02 3.869075460117e-02 3.692152047148e-02 +3.498044635225e-02 3.287817796553e-02 3.062608774515e-02 2.823621474180e-02 +2.572120163483e-02 2.309422917390e-02 2.036894838409e-02 1.755941087725e-02 +1.467999761934e-02 1.174534650916e-02 8.770279127717e-03 5.769727019243e-03 +2.758657865373e-03 -2.479980876935e-04 -3.235420992346e-03 -6.188973401328e-03 +-9.094270963014e-03 -1.193725147333e-02 -1.470424195731e-02 -1.738202346467e-02 +-1.995789327655e-02 -2.241972423481e-02 -2.475602092095e-02 -2.695597242837e-02 +-2.900950148962e-02 -3.090730973942e-02 -3.264091891419e-02 -3.420270780943e-02 +-3.558594483822e-02 -3.678481605604e-02 -3.779444854007e-02 -3.861092903422e-02 +-3.923131779467e-02 -3.965365759447e-02 -3.987697786926e-02 -3.990129401035e-02 +-3.972760183458e-02 -3.935786728378e-02 -3.879501142990e-02 -3.804289088384e-02 +-3.710627372834e-02 -3.599081111610e-02 -3.470300469494e-02 -3.325017004113e-02 +-3.164039630063e-02 -2.988250225524e-02 -2.798598904736e-02 -2.596098981158e-02 +-2.381821647562e-02 -2.156890400536e-02 -1.922475237966e-02 -1.679786659066e-02 +-1.430069497284e-02 -1.174596617125e-02 -9.146625064051e-03 -6.515767958077e-03 +-3.866577378258e-03 -1.212256771825e-03 1.434034552759e-03 4.059245935026e-03 +6.650499007036e-03 9.195150166160e-03 1.168085157626e-02 1.409561040614e-02 +1.642784602408e-02 1.866644487885e-02 2.080081280995e-02 2.282092454377e-02 +2.471737014747e-02 2.648139822798e-02 2.810495568084e-02 2.958072381109e-02 +3.090215066733e-02 3.206347944897e-02 3.305977286697e-02 3.388693335837e-02 +3.454171907583e-02 3.502175559447e-02 3.532554329940e-02 3.545246043867e-02 +3.540276184772e-02 3.517757337235e-02 3.477888203842e-02 3.420952203676e-02 +3.347315661224e-02 3.257425596523e-02 3.151807129299e-02 3.031060511655e-02 +2.895857805645e-02 2.746939223695e-02 2.585109151430e-02 2.411231873911e-02 +2.226227027654e-02 2.031064802024e-02 1.826760914738e-02 1.614371387180e-02 +1.394987146110e-02 1.169728479064e-02 9.397393713563e-03 7.061817530047e-03 +4.702296842670e-03 2.330635085978e-03 -4.135998106041e-05 -2.401934532288e-03 +-4.739446396347e-03 -7.042421962398e-03 -9.299611993816e-03 -1.150004608071e-02 +-1.363308546998e-02 -1.568847402071e-02 -1.765638704319e-02 -1.952747779094e-02 +-2.129292138817e-02 -2.294445598809e-02 -2.447442097247e-02 -2.587579201777e-02 +-2.714221286967e-02 -2.826802368440e-02 -2.924828581278e-02 -3.007880292119e-02 +-3.075613836144e-02 -3.127762872114e-02 -3.164139350451e-02 -3.184634091319e-02 +-3.189216971562e-02 -3.177936721315e-02 -3.150920332967e-02 -3.108372087090e-02 +-3.050572201797e-02 -2.977875113787e-02 -2.890707401143e-02 -2.789565359657e-02 +-2.675012246076e-02 -2.547675203290e-02 -2.408241883942e-02 -2.257456790371e-02 +-2.096117350112e-02 -1.925069747389e-02 -1.745204532154e-02 -1.557452029241e-02 +-1.362777571047e-02 -1.162176577991e-02 -9.566695115673e-03 -7.472967254063e-03 +-5.351132400982e-03 -3.211834678294e-03 -1.065759130111e-03 1.076421249074e-03 +3.204098203719e-03 5.306780365748e-03 7.374144607736e-03 9.396086351181e-03 +1.136276858645e-02 1.326466936830e-02 1.509262755937e-02 1.683788660358e-02 +1.849213612178e-02 2.004755113398e-02 2.149682872434e-02 2.283322197900e-02 +2.405057104052e-02 2.514333113776e-02 2.610659746533e-02 2.693612680282e-02 +2.762835578046e-02 2.818041571472e-02 2.859014395465e-02 2.885609169692e-02 +2.897752824546e-02 2.895444170862e-02 2.878753614502e-02 2.847822518599e-02 +2.802862218038e-02 2.744152692387e-02 2.672040905195e-02 2.586938819154e-02 +2.489321098195e-02 2.379722509086e-02 2.258735036519e-02 2.127004727041e-02 +1.985228278456e-02 1.834149392510e-02 1.674554909766e-02 1.507270746599e-02 +1.333157655084e-02 1.153106827415e-02 9.680353671115e-03 7.788816498768e-03 +5.866005974164e-03 3.921588878623e-03 1.965301266782e-03 6.900020163359e-06 +-1.943885515106e-03 -3.877401568169e-03 -5.784117425114e-03 -7.654672120294e-03 +-9.479920109940e-03 -1.125097570653e-02 -1.295925605940e-02 -1.459652247490e-02 +-1.615491987864e-02 -1.762701423181e-02 -1.900582772493e-02 -2.028487158338e-02 +-2.145817633196e-02 -2.252031937854e-02 -2.346644979062e-02 -2.429231015303e-02 +-2.499425540968e-02 -2.556926860766e-02 -2.601497347730e-02 -2.632964379787e-02 +-2.651220951470e-02 -2.656225958916e-02 -2.648004157988e-02 -2.626645796893e-02 +-2.592305926328e-02 -2.545203391726e-02 -2.485619513762e-02 -2.413896464740e-02 +-2.330435350019e-02 -2.235694005013e-02 -2.130184519668e-02 -2.014470503651e-02 +-1.889164106679e-02 -1.754922809596e-02 -1.612446002881e-02 -1.462471370237e-02 +-1.305771095848e-02 -1.143147914647e-02 -9.754310256928e-03 -8.034718893153e-03 +-6.281399292208e-03 -4.503181611217e-03 -2.708987697548e-03 -9.077865632151e-04 +8.914502154210e-04 2.679792952024e-03 4.448397939574e-03 6.188550957985e-03 +7.891709987112e-03 9.549546916831e-03 1.115398805161e-02 1.269725321357e-02 +1.417189325570e-02 1.557082580540e-02 1.688736906771e-02 1.811527352810e-02 +1.924875140520e-02 2.028250371582e-02 2.121174482664e-02 2.203222437996e-02 +2.274024649412e-02 2.333268615299e-02 2.380700271336e-02 2.416125047307e-02 +2.439408625788e-02 2.450477399972e-02 2.449318629390e-02 2.435980293789e-02 +2.410570646921e-02 2.373257473464e-02 2.324267053749e-02 2.263882842416e-02 +2.192443868490e-02 2.110342865723e-02 2.018024143375e-02 1.915981208813e-02 +1.804754154540e-02 1.684926823351e-02 1.557123766391e-02 1.422007009836e-02 +1.280272646852e-02 1.132647272246e-02 9.798842779793e-03 8.227600283368e-03 +6.620699340510e-03 4.986244451547e-03 3.332449826440e-03 1.667598292818e-03 +5.962653679656e-14 -1.662048875611e-03 -3.310307220713e-03 -4.936629666149e-03 +-6.533006660971e-03 + L N + 2 0 +0.000000000000e+00 6.151343072550e-06 2.460487800223e-05 5.535915301733e-05 +9.841173135979e-05 1.537592085658e-04 2.213972081121e-04 3.013203801221e-04 +3.935224033648e-04 4.979959858026e-04 6.147328643266e-04 7.437238061222e-04 +8.849586090783e-04 1.038426102541e-03 1.204114148279e-03 1.382009641428e-03 +1.572098511283e-03 1.774365722706e-03 1.988795276999e-03 2.215370213351e-03 +2.454072609935e-03 2.704883585486e-03 2.967783300631e-03 3.242750959391e-03 +3.529764810930e-03 3.828802151043e-03 4.139839324045e-03 4.462851724483e-03 +4.797813799117e-03 5.144699048842e-03 5.503480030701e-03 5.874128360037e-03 +6.256614712685e-03 6.650908827164e-03 7.056979507058e-03 7.474794623383e-03 +7.904321117087e-03 8.345525001577e-03 8.798371365312e-03 9.262824374517e-03 +9.738847275919e-03 1.022640239958e-02 1.072545116179e-02 1.123595406802e-02 +1.175787071599e-02 1.229115979875e-02 1.283577910784e-02 1.339168553658e-02 +1.395883508334e-02 1.453718285494e-02 1.512668307009e-02 1.572728906294e-02 +1.633895328661e-02 1.696162731691e-02 1.759526185599e-02 1.823980673619e-02 +1.889521092388e-02 1.956142252333e-02 2.023838878078e-02 2.092605608843e-02 +2.162436998860e-02 2.233327517786e-02 2.305271551134e-02 2.378263400702e-02 +2.452297285010e-02 2.527367339742e-02 2.603467618203e-02 2.680592091770e-02 +2.758734650357e-02 2.837889102883e-02 2.918049177751e-02 2.999208523327e-02 +3.081360708427e-02 3.164499222813e-02 3.248617477693e-02 3.333708806224e-02 +3.419766464030e-02 3.506783629711e-02 3.594753405377e-02 3.683668817167e-02 +3.773522815796e-02 3.864308277085e-02 3.956018002516e-02 4.048644719780e-02 +4.142181083340e-02 4.236619674989e-02 4.331953004423e-02 4.428173509816e-02 +4.525273558400e-02 4.623245447050e-02 4.722081402876e-02 4.821773583819e-02 +4.922314079254e-02 5.023694910596e-02 5.125908031911e-02 5.228945330537e-02 +5.332798627704e-02 5.437459679160e-02 5.542920175808e-02 5.649171744338e-02 +5.756205947875e-02 5.864014286621e-02 5.972588198510e-02 6.081919059865e-02 +6.191998186058e-02 6.302816832176e-02 6.414366193692e-02 6.526637407142e-02 +6.639621550800e-02 6.753309645369e-02 6.867692654663e-02 6.982761486302e-02 +7.098506992412e-02 7.214919970320e-02 7.331991163267e-02 7.449711261112e-02 +7.568070901045e-02 7.687060668312e-02 7.806671096926e-02 7.926892670401e-02 +8.047715822478e-02 8.169130937856e-02 8.291128352931e-02 8.413698356539e-02 +8.536831190694e-02 8.660517051338e-02 8.784746089095e-02 8.909508410021e-02 +9.034794076364e-02 9.160593107325e-02 9.286895479821e-02 9.413691129255e-02 +9.540969950282e-02 9.668721797590e-02 9.796936486668e-02 9.925603794593e-02 +1.005471346081e-01 1.018425518791e-01 1.031421864243e-01 1.044459345564e-01 +1.057536922434e-01 1.070653551164e-01 1.083808184777e-01 1.096999773088e-01 +1.110227262786e-01 1.123489597511e-01 1.136785717938e-01 1.150114561856e-01 +1.163475064250e-01 1.176866157382e-01 1.190286770876e-01 1.203735831792e-01 +1.217212264716e-01 1.230714991840e-01 1.244242933040e-01 1.257795005966e-01 +1.271370126117e-01 1.284967206931e-01 1.298585159862e-01 1.312222894466e-01 +1.325879318487e-01 1.339553337933e-01 1.353243857168e-01 1.366949778989e-01 +1.380670004714e-01 1.394403434265e-01 1.408148966248e-01 1.421905498044e-01 +1.435671925888e-01 1.449447144955e-01 1.463230049445e-01 1.477019532664e-01 +1.490814487115e-01 1.504613804574e-01 1.518416376183e-01 1.532221092527e-01 +1.546026843724e-01 1.559832519508e-01 1.573637009312e-01 1.587439202355e-01 +1.601237987727e-01 1.615032254470e-01 1.628820891666e-01 1.642602788521e-01 +1.656376834450e-01 1.670141919159e-01 1.683896932733e-01 1.697640765719e-01 +1.711372309210e-01 1.725090454930e-01 1.738794095319e-01 1.752482123615e-01 +1.766153433942e-01 1.779806921391e-01 1.793441482104e-01 1.807056013362e-01 +1.820649413663e-01 1.834220582810e-01 1.847768421993e-01 1.861291833873e-01 +1.874789722667e-01 1.888260994226e-01 1.901704556126e-01 1.915119317744e-01 +1.928504190344e-01 1.941858087161e-01 1.955179923480e-01 1.968468616722e-01 +1.981723086522e-01 1.994942254817e-01 2.008125045921e-01 2.021270386612e-01 +2.034377206212e-01 2.047444436666e-01 2.060471012624e-01 2.073455871525e-01 +2.086397953674e-01 2.099296202323e-01 2.112149563750e-01 2.124956987344e-01 +2.137717425678e-01 2.150429834592e-01 2.163093173272e-01 2.175706404327e-01 +2.188268493871e-01 2.200778411595e-01 2.213235130854e-01 2.225637628736e-01 +2.237984886144e-01 2.250275887872e-01 2.262509622683e-01 2.274685083383e-01 +2.286801266899e-01 2.298857174355e-01 2.310851811145e-01 2.322784187013e-01 +2.334653316120e-01 2.346458217128e-01 2.358197913265e-01 2.369871432407e-01 +2.381477807144e-01 2.393016074857e-01 2.404485277791e-01 2.415884463125e-01 +2.427212683044e-01 2.438468994814e-01 2.449652460847e-01 2.460762148778e-01 +2.471797131530e-01 2.482756487386e-01 2.493639300059e-01 2.504444658760e-01 +2.515171658267e-01 2.525819398992e-01 2.536386987050e-01 2.546873534324e-01 +2.557278158537e-01 2.567599983310e-01 2.577838138234e-01 2.587991758936e-01 +2.598059987137e-01 2.608041970725e-01 2.617936863812e-01 2.627743826801e-01 +2.637462026449e-01 2.647090635926e-01 2.656628834882e-01 2.666075809504e-01 +2.675430752579e-01 2.684692863554e-01 2.693861348596e-01 2.702935420651e-01 +2.711914299504e-01 2.720797211832e-01 2.729583391272e-01 2.738272078467e-01 +2.746862521131e-01 2.755353974098e-01 2.763745699386e-01 2.772036966244e-01 +2.780227051209e-01 2.788315238163e-01 2.796300818381e-01 2.804183090588e-01 +2.811961361010e-01 2.819634943422e-01 2.827203159204e-01 2.834665337389e-01 +2.842020814712e-01 2.849268935661e-01 2.856409052524e-01 2.863440525436e-01 +2.870362722429e-01 2.877175019478e-01 2.883876800545e-01 2.890467457627e-01 +2.896946390799e-01 2.903313008259e-01 2.909566726372e-01 2.915706969711e-01 +2.921733171103e-01 2.927644771665e-01 2.933441220852e-01 2.939121976490e-01 +2.944686504824e-01 2.950134280548e-01 2.955464786849e-01 2.960677515446e-01 +2.965771966622e-01 2.970747649265e-01 2.975604080899e-01 2.980340787726e-01 +2.984957304652e-01 2.989453175330e-01 2.993827952183e-01 2.998081196445e-01 +3.002212478188e-01 3.006221376354e-01 3.010107478787e-01 3.013870382261e-01 +3.017509692506e-01 3.021025024244e-01 3.024416001209e-01 3.027682256178e-01 +3.030823430996e-01 3.033839176601e-01 3.036729153050e-01 3.039493029542e-01 +3.042130484442e-01 3.044641205303e-01 3.047024888889e-01 3.049281241194e-01 +3.051409977466e-01 3.053410822225e-01 3.055283509279e-01 3.057027781750e-01 +3.058643392084e-01 3.060130102071e-01 3.061487682862e-01 3.062715914985e-01 +3.063814588357e-01 3.064783502299e-01 3.065622465553e-01 3.066331296288e-01 +3.066909822118e-01 3.067357880110e-01 3.067675316796e-01 3.067861988179e-01 +3.067917759749e-01 3.067842506484e-01 3.067636112863e-01 3.067298472868e-01 +3.066829489995e-01 3.066229077256e-01 3.065497157184e-01 3.064633661839e-01 +3.063638532809e-01 3.062511721212e-01 3.061253187701e-01 3.059862902461e-01 +3.058340845212e-01 3.056687005208e-01 3.054901381235e-01 3.052983981609e-01 +3.050934824175e-01 3.048753936301e-01 3.046441354877e-01 3.043997126308e-01 +3.041421306508e-01 3.038713960897e-01 3.035875164389e-01 3.032905001388e-01 +3.029803565781e-01 3.026570960922e-01 3.023207299629e-01 3.019712704172e-01 +3.016087306257e-01 3.012331247021e-01 3.008444677015e-01 3.004427756188e-01 +3.000280653881e-01 2.996003548804e-01 2.991596629023e-01 2.987060091947e-01 +2.982394144306e-01 2.977599002136e-01 2.972674890760e-01 2.967622044769e-01 +2.962440708002e-01 2.957131133525e-01 2.951693583611e-01 2.946128329715e-01 +2.940435652458e-01 2.934615841594e-01 2.928669195994e-01 2.922596023620e-01 +2.916396641496e-01 2.910071375683e-01 2.903620561257e-01 2.897044542274e-01 +2.890343671748e-01 2.883518311621e-01 2.876568832728e-01 2.869495614777e-01 +2.862299046309e-01 2.854979524671e-01 2.847537455983e-01 2.839973255105e-01 +2.832287345605e-01 2.824480159721e-01 2.816552138333e-01 2.808503730919e-01 +2.800335395528e-01 2.792047598735e-01 2.783640815610e-01 2.775115529676e-01 +2.766472232874e-01 2.757711425520e-01 2.748833616268e-01 2.739839322068e-01 +2.730729068125e-01 2.721503387859e-01 2.712162822861e-01 2.702707922851e-01 +2.693139245633e-01 2.683457357052e-01 2.673662830950e-01 2.663756249120e-01 +2.653738201259e-01 2.643609284924e-01 2.633370105482e-01 2.623021276065e-01 +2.612563417521e-01 2.601997158362e-01 2.591323134720e-01 2.580541990295e-01 +2.569654376303e-01 2.558660951426e-01 2.547562381760e-01 2.536359340764e-01 +2.525052509208e-01 2.513642575117e-01 2.502130233718e-01 2.490516187388e-01 +2.478801145597e-01 2.466985824853e-01 2.455070948648e-01 2.443057247399e-01 +2.430945458392e-01 2.418736325726e-01 2.406430600253e-01 2.394029039523e-01 +2.381532407721e-01 2.368941475610e-01 2.356257020471e-01 2.343479826045e-01 +2.330610682465e-01 2.317650386205e-01 2.304599740009e-01 2.291459552836e-01 +2.278230639793e-01 2.264913822074e-01 2.251509926894e-01 2.238019787431e-01 +2.224444242756e-01 2.210784137768e-01 2.197040323134e-01 2.183213655220e-01 +2.169304996024e-01 2.155315213114e-01 2.141245179554e-01 2.127095773847e-01 +2.112867879857e-01 2.098562386748e-01 2.084180188913e-01 2.069722185906e-01 +2.055189282373e-01 2.040582387984e-01 2.025902417358e-01 2.011150290001e-01 +1.996326930228e-01 1.981433267098e-01 1.966470234339e-01 1.951438770279e-01 +1.936339817772e-01 1.921174324128e-01 1.905943241041e-01 1.890647524514e-01 +1.875288134788e-01 1.859866036266e-01 1.844382197446e-01 1.828837590838e-01 +1.813233192899e-01 1.797569983950e-01 1.781848948109e-01 1.766071073212e-01 +1.750237350739e-01 1.734348775737e-01 1.718406346748e-01 1.702411065730e-01 +1.686363937981e-01 1.670265972067e-01 1.654118179737e-01 1.637921575857e-01 +1.621677178324e-01 1.605386007994e-01 1.589049088604e-01 1.572667446692e-01 +1.556242111524e-01 1.539774115009e-01 1.523264491631e-01 1.506714278361e-01 +1.490124514585e-01 1.473496242024e-01 1.456830504654e-01 1.440128348629e-01 +1.423390822201e-01 1.406618975642e-01 1.389813861166e-01 1.372976532846e-01 +1.356108046539e-01 1.339209459803e-01 1.322281831820e-01 1.305326223318e-01 +1.288343696485e-01 1.271335314898e-01 1.254302143434e-01 1.237245248199e-01 +1.220165696442e-01 1.203064556477e-01 1.185942897603e-01 1.168801790025e-01 +1.151642304774e-01 1.134465513624e-01 1.117272489014e-01 1.100064303970e-01 +1.082842032022e-01 1.065606747124e-01 1.048359523575e-01 1.031101435940e-01 +1.013833558967e-01 9.965569675111e-02 9.792727364492e-02 9.619819406051e-02 +9.446856546670e-02 9.273849531082e-02 9.100809101076e-02 8.927745994697e-02 +8.754670945452e-02 8.581594681513e-02 8.408527924925e-02 8.235481390807e-02 +8.062465786567e-02 7.889491811102e-02 7.716570154014e-02 7.543711494817e-02 +7.370926502151e-02 7.198225832993e-02 7.025620131871e-02 6.853120030082e-02 +6.680736144908e-02 6.508479078836e-02 6.336359418773e-02 6.164387735277e-02 +5.992574581770e-02 5.820930493774e-02 5.649465988130e-02 5.478191562229e-02 +5.307117693247e-02 5.136254837371e-02 4.965613429041e-02 4.795203880181e-02 +4.625036579443e-02 4.455121891444e-02 4.285470156015e-02 4.116091687443e-02 +3.946996773719e-02 3.778195675792e-02 3.609698626820e-02 3.441515831429e-02 +3.273657464967e-02 3.106133672767e-02 2.938954569415e-02 2.772130238011e-02 +2.605670729441e-02 2.439586061650e-02 2.273886218918e-02 2.108581151136e-02 +1.943680773091e-02 1.779194963746e-02 1.615133565533e-02 1.451506383642e-02 +1.288323185313e-02 1.125593699137e-02 9.633276143567e-03 8.015345801684e-03 +6.402242050331e-03 4.794060559864e-03 3.190896579538e-03 1.592844930701e-03 +1.458676025507e-14 -1.587544267285e-03 -3.169694374082e-03 -4.746357278045e-03 +-6.317440398246e-03 + L N + 2 1 +0.000000000000e+00 1.531812533440e-05 6.126948243575e-05 1.378450217335e-04 +2.450296627545e-04 3.828022947651e-04 5.511357836279e-04 7.499969751900e-04 +9.793467029496e-04 1.239139794781e-03 1.529325081589e-03 1.849845407535e-03 +2.200637640512e-03 2.581632684492e-03 2.992755492803e-03 3.433925082298e-03 +3.905054548988e-03 4.406051084654e-03 4.936815994632e-03 5.497244716641e-03 +6.087226840896e-03 6.706646131177e-03 7.355380547103e-03 8.033302267488e-03 +8.740277714828e-03 9.476167580832e-03 1.024082685314e-02 1.103410484303e-02 +1.185584521429e-02 1.270588601312e-02 1.358405969917e-02 1.449019317754e-02 +1.542410783195e-02 1.638561955894e-02 1.737453880305e-02 1.839067059312e-02 +1.943381457961e-02 2.050376507291e-02 2.160031108270e-02 2.272323635834e-02 +2.387231943022e-02 2.504733365214e-02 2.624804724465e-02 2.747422333942e-02 +2.872562002452e-02 3.000199039070e-02 3.130308257862e-02 3.262863982701e-02 +3.397840052177e-02 3.535209824602e-02 3.674946183101e-02 3.817021540800e-02 +3.961407846100e-02 4.108076588039e-02 4.256998801741e-02 4.408145073957e-02 +4.561485548684e-02 4.716989932875e-02 4.874627502223e-02 5.034367107038e-02 +5.196177178197e-02 5.360025733177e-02 5.525880382165e-02 5.693708334246e-02 +5.863476403671e-02 6.035151016190e-02 6.208698215470e-02 6.384083669577e-02 +6.561272677535e-02 6.740230175951e-02 6.920920745711e-02 7.103308618742e-02 +7.287357684838e-02 7.473031498559e-02 7.660293286182e-02 7.849105952721e-02 +8.039432089007e-02 8.231233978824e-02 8.424473606111e-02 8.619112662205e-02 +8.815112553158e-02 9.012434407094e-02 9.211039081622e-02 9.410887171302e-02 +9.611939015157e-02 9.814154704239e-02 1.001749408923e-01 1.022191678810e-01 +1.042738219380e-01 1.063384948201e-01 1.084127761890e-01 1.104962536896e-01 +1.125885130285e-01 1.146891380531e-01 1.167977108304e-01 1.189138117271e-01 +1.210370194893e-01 1.231669113224e-01 1.253030629721e-01 1.274450488047e-01 +1.295924418883e-01 1.317448140741e-01 1.339017360777e-01 1.360627775606e-01 +1.382275072125e-01 1.403954928328e-01 1.425663014132e-01 1.447394992196e-01 +1.469146518750e-01 1.490913244415e-01 1.512690815034e-01 1.534474872496e-01 +1.556261055565e-01 1.578045000709e-01 1.599822342926e-01 1.621588716574e-01 +1.643339756200e-01 1.665071097367e-01 1.686778377484e-01 1.708457236630e-01 +1.730103318384e-01 1.751712270650e-01 1.773279746482e-01 1.794801404905e-01 +1.816272911743e-01 1.837689940436e-01 1.859048172859e-01 1.880343300143e-01 +1.901571023487e-01 1.922727054973e-01 1.943807118380e-01 1.964806949988e-01 +1.985722299387e-01 2.006548930280e-01 2.027282621286e-01 2.047919166733e-01 +2.068454377458e-01 2.088884081593e-01 2.109204125357e-01 2.129410373837e-01 +2.149498711770e-01 2.169465044320e-01 2.189305297846e-01 2.209015420676e-01 +2.228591383867e-01 2.248029181965e-01 2.267324833757e-01 2.286474383027e-01 +2.305473899294e-01 2.324319478554e-01 2.343007244016e-01 2.361533346828e-01 +2.379893966803e-01 2.398085313134e-01 2.416103625110e-01 2.433945172818e-01 +2.451606257844e-01 2.469083213969e-01 2.486372407853e-01 2.503470239719e-01 +2.520373144027e-01 2.537077590138e-01 2.553580082979e-01 2.569877163696e-01 +2.585965410301e-01 2.601841438308e-01 2.617501901369e-01 2.632943491899e-01 +2.648162941690e-01 2.663157022524e-01 2.677922546771e-01 2.692456367985e-01 +2.706755381492e-01 2.720816524961e-01 2.734636778979e-01 2.748213167611e-01 +2.761542758950e-01 2.774622665664e-01 2.787450045528e-01 2.800022101955e-01 +2.812336084509e-01 2.824389289415e-01 2.836179060060e-01 2.847702787484e-01 +2.858957910856e-01 2.869941917954e-01 2.880652345620e-01 2.891086780217e-01 +2.901242858070e-01 2.911118265905e-01 2.920710741263e-01 2.930018072925e-01 +2.939038101309e-01 2.947768718866e-01 2.956207870465e-01 2.964353553767e-01 +2.972203819589e-01 2.979756772254e-01 2.987010569940e-01 2.993963425011e-01 +3.000613604334e-01 3.006959429600e-01 3.012999277619e-01 3.018731580613e-01 +3.024154826495e-01 3.029267559140e-01 3.034068378642e-01 3.038555941563e-01 +3.042728961170e-01 3.046586207660e-01 3.050126508376e-01 3.053348748012e-01 +3.056251868804e-01 3.058834870714e-01 3.061096811600e-01 3.063036807379e-01 +3.064654032169e-01 3.065947718436e-01 3.066917157114e-01 3.067561697721e-01 +3.067880748467e-01 3.067873776342e-01 3.067540307204e-01 3.066879925844e-01 +3.065892276045e-01 3.064577060637e-01 3.062934041526e-01 3.060963039724e-01 +3.058663935363e-01 3.056036667694e-01 3.053081235086e-01 3.049797694999e-01 +3.046186163960e-01 3.042246817517e-01 3.037979890185e-01 3.033385675387e-01 +3.028464525373e-01 3.023216851136e-01 3.017643122315e-01 3.011743867083e-01 +3.005519672032e-01 2.998971182038e-01 2.992099100119e-01 2.984904187284e-01 +2.977387262371e-01 2.969549201865e-01 2.961390939721e-01 2.952913467161e-01 +2.944117832470e-01 2.935005140777e-01 2.925576553825e-01 2.915833289735e-01 +2.905776622752e-01 2.895407882988e-01 2.884728456147e-01 2.873739783248e-01 +2.862443360330e-01 2.850840738152e-01 2.838933521878e-01 2.826723370758e-01 +2.814211997793e-01 2.801401169391e-01 2.788292705020e-01 2.774888476838e-01 +2.761190409326e-01 2.747200478905e-01 2.732920713544e-01 2.718353192356e-01 +2.703500045193e-01 2.688363452219e-01 2.672945643488e-01 2.657248898497e-01 +2.641275545746e-01 2.625027962275e-01 2.608508573202e-01 2.591719851246e-01 +2.574664316246e-01 2.557344534665e-01 2.539763119094e-01 2.521922727737e-01 +2.503826063901e-01 2.485475875462e-01 2.466874954338e-01 2.448026135942e-01 +2.428932298635e-01 2.409596363168e-01 2.390021292116e-01 2.370210089303e-01 +2.350165799227e-01 2.329891506464e-01 2.309390335083e-01 2.288665448033e-01 +2.267720046544e-01 2.246557369502e-01 2.225180692832e-01 2.203593328868e-01 +2.181798625714e-01 2.159799966603e-01 2.137600769250e-01 2.115204485198e-01 +2.092614599151e-01 2.069834628316e-01 2.046868121724e-01 2.023718659557e-01 +2.000389852461e-01 1.976885340860e-01 1.953208794259e-01 1.929363910551e-01 +1.905354415306e-01 1.881184061067e-01 1.856856626638e-01 1.832375916362e-01 +1.807745759402e-01 1.782970009015e-01 1.758052541820e-01 1.732997257066e-01 +1.707808075892e-01 1.682488940588e-01 1.657043813846e-01 1.631476678019e-01 +1.605791534359e-01 1.579992402275e-01 1.554083318563e-01 1.528068336656e-01 +1.501951525856e-01 1.475736970569e-01 1.449428769541e-01 1.423031035084e-01 +1.396547892309e-01 1.369983478348e-01 1.343341941583e-01 1.316627440867e-01 +1.289844144746e-01 1.262996230684e-01 1.236087884274e-01 1.209123298467e-01 +1.182106672782e-01 1.155042212530e-01 1.127934128024e-01 1.100786633801e-01 +1.073603947839e-01 1.046390290768e-01 1.019149885091e-01 9.918869544009e-02 +9.646057225962e-02 9.373104130998e-02 9.100052480774e-02 8.826944476576e-02 +8.553822291522e-02 8.280728062779e-02 8.007703883803e-02 7.734791796576e-02 +7.462033783879e-02 7.189471761567e-02 6.917147570873e-02 6.645102970730e-02 +6.373379630117e-02 6.102019120422e-02 5.831062907844e-02 5.560552345805e-02 +5.290528667406e-02 5.021032977901e-02 4.752106247207e-02 4.483789302449e-02 +4.216122820534e-02 3.949147320761e-02 3.682903157474e-02 3.417430512744e-02 +3.152769389097e-02 2.888959602282e-02 2.626040774079e-02 2.364052325152e-02 +2.103033467948e-02 1.843023199642e-02 1.584060295128e-02 1.326183300059e-02 +1.069430523944e-02 8.138400332850e-03 5.594496447773e-03 3.062969185583e-03 +5.441915151351e-04 -1.961466293601e-03 -4.453636735344e-03 -6.931955134693e-03 +-9.396059710736e-03 -1.184559164102e-02 -1.428019512492e-02 -1.669951744633e-02 +-1.910320903574e-02 -2.149092353165e-02 -2.386231784126e-02 -2.621705220053e-02 +-2.855479023354e-02 -3.087519901108e-02 -3.317794910861e-02 -3.546271466342e-02 +-3.772917343111e-02 -3.997700684126e-02 -4.220590005238e-02 -4.441554200608e-02 +-4.660562548045e-02 -4.877584714270e-02 -5.092590760091e-02 -5.305551145506e-02 +-5.516436734719e-02 -5.725218801075e-02 -5.931869031913e-02 -6.136359533333e-02 +-6.338662834875e-02 -6.538751894120e-02 -6.736600101193e-02 -6.932181283189e-02 +-7.125469708505e-02 -7.316440091082e-02 -7.505067594559e-02 -7.691327836338e-02 +-7.875196891555e-02 -8.056651296957e-02 -8.235668054694e-02 -8.412224636006e-02 +-8.586298984828e-02 -8.757869521294e-02 -8.926915145144e-02 -9.093415239040e-02 +-9.257349671783e-02 -9.418698801435e-02 -9.577443478340e-02 -9.733565048052e-02 +-9.887045354160e-02 -1.003786674102e-01 -1.018601205638e-01 -1.033146465390e-01 +-1.047420839562e-01 -1.061422765424e-01 -1.075150731537e-01 -1.088603277966e-01 +-1.101778996484e-01 -1.114676530761e-01 -1.127294576547e-01 -1.139631881848e-01 +-1.151687247082e-01 -1.163459525234e-01 -1.174947621997e-01 -1.186150495903e-01 +-1.197067158441e-01 -1.207696674170e-01 -1.218038160818e-01 -1.228090789373e-01 +-1.237853784159e-01 -1.247326422908e-01 -1.256508036816e-01 -1.265398010595e-01 +-1.273995782505e-01 -1.282300844387e-01 -1.290312741676e-01 -1.298031073411e-01 +-1.305455492228e-01 -1.312585704350e-01 -1.319421469560e-01 -1.325962601165e-01 +-1.332208965957e-01 -1.338160484151e-01 -1.343817129326e-01 -1.349178928343e-01 +-1.354245961266e-01 -1.359018361262e-01 -1.363496314496e-01 -1.367680060015e-01 +-1.371569889621e-01 -1.375166147738e-01 -1.378469231263e-01 -1.381479589410e-01 +-1.384197723545e-01 -1.386624187010e-01 -1.388759584938e-01 -1.390604574056e-01 +-1.392159862483e-01 -1.393426209511e-01 -1.394404425382e-01 -1.395095371059e-01 +-1.395499957974e-01 -1.395619147782e-01 -1.395453952097e-01 -1.395005432216e-01 +-1.394274698847e-01 -1.393262911811e-01 -1.391971279746e-01 -1.390401059799e-01 +-1.388553557311e-01 -1.386430125484e-01 -1.384032165054e-01 -1.381361123943e-01 +-1.378418496908e-01 -1.375205825179e-01 -1.371724696091e-01 -1.367976742705e-01 +-1.363963643424e-01 -1.359687121594e-01 -1.355148945107e-01 -1.350350925984e-01 +-1.345294919964e-01 -1.339982826069e-01 -1.334416586176e-01 -1.328598184571e-01 +-1.322529647502e-01 -1.316213042720e-01 -1.309650479014e-01 -1.302844105739e-01 +-1.295796112340e-01 -1.288508727858e-01 -1.280984220447e-01 -1.273224896865e-01 +-1.265233101970e-01 -1.257011218208e-01 -1.248561665089e-01 -1.239886898664e-01 +-1.230989410988e-01 -1.221871729584e-01 -1.212536416895e-01 -1.202986069733e-01 +-1.193223318724e-01 -1.183250827739e-01 -1.173071293331e-01 -1.162687444158e-01 +-1.152102040403e-01 -1.141317873188e-01 -1.130337763986e-01 -1.119164564024e-01 +-1.107801153683e-01 -1.096250441892e-01 -1.084515365519e-01 -1.072598888758e-01 +-1.060504002507e-01 -1.048233723747e-01 -1.035791094915e-01 -1.023179183271e-01 +-1.010401080265e-01 -9.974599008953e-02 -9.843587830681e-02 -9.711008869505e-02 +-9.576893943208e-02 -9.441275079160e-02 -9.304184507758e-02 -9.165654655835e-02 +-9.025718140046e-02 -8.884407760222e-02 -8.741756492698e-02 -8.597797483621e-02 +-8.452564042233e-02 -8.306089634127e-02 -8.158407874494e-02 -8.009552521338e-02 +-7.859557468684e-02 -7.708456739764e-02 -7.556284480191e-02 -7.403074951117e-02 +-7.248862522382e-02 -7.093681665648e-02 -6.937566947530e-02 -6.780553022714e-02 +-6.622674627067e-02 -6.463966570750e-02 -6.304463731317e-02 -6.144201046821e-02 +-5.983213508912e-02 -5.821536155936e-02 -5.659204066043e-02 -5.496252350287e-02 +-5.332716145741e-02 -5.168630608608e-02 -5.004030907349e-02 -4.838952215812e-02 +-4.673429706373e-02 -4.507498543090e-02 -4.341193874871e-02 -4.174550828648e-02 +-4.007604502575e-02 -3.840389959242e-02 -3.672942218897e-02 -3.505296252701e-02 +-3.337486975997e-02 -3.169549241596e-02 -3.001517833099e-02 -2.833427458227e-02 +-2.665312742194e-02 -2.497208221096e-02 -2.329148335329e-02 -2.161167423042e-02 +-1.993299713617e-02 -1.825579321183e-02 -1.658040238160e-02 -1.490716328846e-02 +-1.323641323026e-02 -1.156848809637e-02 -9.903722304502e-03 -8.242448738125e-03 +-6.584998684143e-03 -4.931701771073e-03 -3.282885907621e-03 -1.638877221717e-03 +3.449232595289e-15 1.633423372251e-03 3.261072470652e-03 4.882628890828e-03 +6.497776306984e-03 + L N + 2 2 +0.000000000000e+00 2.812042488297e-05 1.124715359716e-04 2.530228335488e-04 +4.497235017534e-04 7.025024223055e-04 1.011268200252e-03 1.375909195905e-03 +1.796293564452e-03 2.272269302123e-03 2.803664299497e-03 3.390286402271e-03 +4.031923478534e-03 4.728343493445e-03 5.479294590783e-03 6.284505181447e-03 +7.143684038891e-03 8.056520401487e-03 9.022684081714e-03 1.004182558221e-02 +1.111357621855e-02 1.223754824883e-02 1.341333500986e-02 1.464051106009e-02 +1.591863232905e-02 1.724723627337e-02 1.862584203926e-02 2.005395063144e-02 +2.153104508840e-02 2.305659066398e-02 2.463003501520e-02 2.625080839620e-02 +2.791832385837e-02 2.963197745641e-02 3.139114846044e-02 3.319519957388e-02 +3.504347715725e-02 3.693531145758e-02 3.887001684353e-02 4.084689204604e-02 +4.286522040444e-02 4.492427011796e-02 4.702329450253e-02 4.916153225273e-02 +5.133820770892e-02 5.355253112932e-02 5.580369896706e-02 5.809089415195e-02 +6.041328637708e-02 6.277003238995e-02 6.516027628811e-02 6.758314981927e-02 +7.003777268559e-02 7.252325285227e-02 7.503868686016e-02 7.758316014232e-02 +8.015574734445e-02 8.275551264910e-02 8.538151010339e-02 8.803278395037e-02 +9.070836896367e-02 9.340729078542e-02 9.612856626742e-02 9.887120381516e-02 +1.016342037349e-01 1.044165585836e-01 1.072172535209e-01 1.100352666649e-01 +1.128695694486e-01 1.157191269805e-01 1.185828984057e-01 1.214598372700e-01 +1.243488918857e-01 1.272490056988e-01 1.301591176586e-01 1.330781625877e-01 +1.360050715545e-01 1.389387722459e-01 1.418781893421e-01 1.448222448916e-01 +1.477698586871e-01 1.507199486431e-01 1.536714311721e-01 1.566232215636e-01 +1.595742343614e-01 1.625233837420e-01 1.654695838935e-01 1.684117493930e-01 +1.713487955850e-01 1.742796389591e-01 1.772031975268e-01 1.801183911982e-01 +1.830241421574e-01 1.859193752378e-01 1.888030182955e-01 1.916740025816e-01 +1.945312631144e-01 1.973737390482e-01 2.002003740423e-01 2.030101166275e-01 +2.058019205707e-01 2.085747452379e-01 2.113275559548e-01 2.140593243657e-01 +2.167690287892e-01 2.194556545728e-01 2.221181944431e-01 2.247556488551e-01 +2.273670263375e-01 2.299513438355e-01 2.325076270507e-01 2.350349107771e-01 +2.375322392347e-01 2.399986663991e-01 2.424332563276e-01 2.448350834822e-01 +2.472032330478e-01 2.495368012477e-01 2.518348956542e-01 2.540966354957e-01 +2.563211519592e-01 2.585075884886e-01 2.606551010789e-01 2.627628585657e-01 +2.648300429095e-01 2.668558494765e-01 2.688394873135e-01 2.707801794184e-01 +2.726771630057e-01 2.745296897669e-01 2.763370261255e-01 2.780984534869e-01 +2.798132684832e-01 2.814807832119e-01 2.831003254701e-01 2.846712389819e-01 +2.861928836211e-01 2.876646356275e-01 2.890858878180e-01 2.904560497913e-01 +2.917745481267e-01 2.930408265772e-01 2.942543462559e-01 2.954145858171e-01 +2.965210416303e-01 2.975732279486e-01 2.985706770700e-01 2.995129394934e-01 +3.003995840672e-01 3.012301981318e-01 3.020043876556e-01 3.027217773641e-01 +3.033820108630e-01 3.039847507539e-01 3.045296787440e-01 3.050164957483e-01 +3.054449219859e-01 3.058146970686e-01 3.061255800835e-01 3.063773496684e-01 +3.065698040799e-01 3.067027612555e-01 3.067760588680e-01 3.067895543733e-01 +3.067431250515e-01 3.066366680406e-01 3.064701003632e-01 3.062433589472e-01 +3.059564006380e-01 3.056092022052e-01 3.052017603412e-01 3.047340916539e-01 +3.042062326513e-01 3.036182397201e-01 3.029701890971e-01 3.022621768332e-01 +3.014943187516e-01 3.006667503978e-01 2.997796269836e-01 2.988331233245e-01 +2.978274337691e-01 2.967627721233e-01 2.956393715662e-01 2.944574845607e-01 +2.932173827566e-01 2.919193568869e-01 2.905637166585e-01 2.891507906353e-01 +2.876809261152e-01 2.861544890011e-01 2.845718636646e-01 2.829334528044e-01 +2.812396772972e-01 2.794909760436e-01 2.776878058069e-01 2.758306410464e-01 +2.739199737440e-01 2.719563132257e-01 2.699401859764e-01 2.678721354492e-01 +2.657527218691e-01 2.635825220302e-01 2.613621290888e-01 2.590921523490e-01 +2.567732170448e-01 2.544059641153e-01 2.519910499753e-01 2.495291462808e-01 +2.470209396889e-01 2.444671316132e-01 2.418684379737e-01 2.392255889424e-01 +2.365393286837e-01 2.338104150904e-01 2.310396195152e-01 2.282277264974e-01 +2.253755334855e-01 2.224838505557e-01 2.195535001257e-01 2.165853166650e-01 +2.135801464012e-01 2.105388470220e-01 2.074622873738e-01 2.043513471571e-01 +2.012069166173e-01 1.980298962334e-01 1.948211964026e-01 1.915817371217e-01 +1.883124476660e-01 1.850142662648e-01 1.816881397746e-01 1.783350233486e-01 +1.749558801050e-01 1.715516807916e-01 1.681234034491e-01 1.646720330712e-01 +1.611985612636e-01 1.577039859003e-01 1.541893107782e-01 1.506555452704e-01 +1.471037039775e-01 1.435348063777e-01 1.399498764750e-01 1.363499424470e-01 +1.327360362911e-01 1.291091934701e-01 1.254704525563e-01 1.218208548756e-01 +1.181614441508e-01 1.144932661444e-01 1.108173683010e-01 1.071347993896e-01 +1.034466091460e-01 9.975384791502e-02 9.605756629286e-02 9.235881477011e-02 +8.865864337493e-02 8.495810131684e-02 8.125823663126e-02 7.756009582487e-02 +7.386472352188e-02 7.017316211140e-02 6.648645139600e-02 6.280562824158e-02 +5.913172622872e-02 5.546577530554e-02 5.180880144230e-02 4.816182628779e-02 +4.452586682763e-02 4.090193504467e-02 3.729103758150e-02 3.369417540531e-02 +3.011234347509e-02 2.654653041137e-02 2.299771816864e-02 1.946688171047e-02 +1.595498868745e-02 1.246299911824e-02 8.991865073543e-03 5.542530363382e-03 +2.115930227621e-03 -1.287008970087e-03 -4.665370044848e-03 -8.018245289454e-03 +-1.134473676960e-02 -1.464395661529e-02 -1.791502730828e-02 -2.115708196560e-02 +-2.436926461882e-02 -2.755073048929e-02 -3.070064625892e-02 -3.381819033663e-02 +-3.690255312038e-02 -3.995293725450e-02 -4.296855788249e-02 -4.594864289503e-02 +-4.889243317310e-02 -5.179918282636e-02 -5.466815942637e-02 -5.749864423487e-02 +-6.028993242690e-02 -6.304133330863e-02 -6.575217053008e-02 -6.842178229231e-02 +-7.104952154932e-02 -7.363475620441e-02 -7.617686930102e-02 -7.867525920794e-02 +-8.112933979891e-02 -8.353854062645e-02 -8.590230708989e-02 -8.822010059767e-02 +-9.049139872368e-02 -9.271569535770e-02 -9.489250084984e-02 -9.702134214903e-02 +-9.910176293542e-02 -1.011333237466e-01 -1.031156020979e-01 -1.050481925963e-01 +-1.069307070481e-01 -1.087627745608e-01 -1.105440416380e-01 -1.122741722691e-01 +-1.139528480110e-01 -1.155797680655e-01 -1.171546493488e-01 -1.186772265551e-01 +-1.201472522143e-01 -1.215644967427e-01 -1.229287484875e-01 -1.242398137650e-01 +-1.254975168922e-01 -1.267017002123e-01 -1.278522241133e-01 -1.289489670408e-01 +-1.299918255037e-01 -1.309807140745e-01 -1.319155653819e-01 -1.327963300981e-01 +-1.336229769193e-01 -1.343954925401e-01 -1.351138816210e-01 -1.357781667502e-01 +-1.363883883992e-01 -1.369446048713e-01 -1.374468922449e-01 -1.378953443098e-01 +-1.382900724979e-01 -1.386312058074e-01 -1.389188907211e-01 -1.391532911187e-01 +-1.393345881826e-01 -1.394629802985e-01 -1.395386829495e-01 -1.395619286044e-01 +-1.395329666006e-01 -1.394520630206e-01 -1.393195005628e-01 -1.391355784077e-01 +-1.389006120768e-01 -1.386149332875e-01 -1.382788898014e-01 -1.378928452679e-01 +-1.374571790618e-01 -1.369722861164e-01 -1.364385767506e-01 -1.358564764912e-01 +-1.352264258904e-01 -1.345488803374e-01 -1.338243098662e-01 -1.330531989577e-01 +-1.322360463375e-01 -1.313733647684e-01 -1.304656808394e-01 -1.295135347489e-01 +-1.285174800843e-01 -1.274780835967e-01 -1.263959249722e-01 -1.252715965978e-01 +-1.241057033243e-01 -1.228988622245e-01 -1.216517023480e-01 -1.203648644718e-01 +-1.190390008473e-01 -1.176747749439e-01 -1.162728611890e-01 -1.148339447044e-01 +-1.133587210396e-01 -1.118478959018e-01 -1.103021848828e-01 -1.087223131831e-01 +-1.071090153326e-01 -1.054630349093e-01 -1.037851242546e-01 -1.020760441864e-01 +-1.003365637095e-01 -9.856745972424e-02 -9.676951673183e-02 -9.494352653873e-02 +-9.309028795819e-02 -9.121060651026e-02 -8.930529411987e-02 -8.737516881326e-02 +-8.542105441291e-02 -8.344378023091e-02 -8.144418076104e-02 -7.942309536966e-02 +-7.738136798544e-02 -7.531984678813e-02 -7.323938389640e-02 -7.114083505502e-02 +-6.902505932126e-02 -6.689291875087e-02 -6.474527808360e-02 -6.258300442839e-02 +-6.040696694843e-02 -5.821803654612e-02 -5.601708554807e-02 -5.380498739029e-02 +-5.158261630364e-02 -4.935084699963e-02 -4.711055435682e-02 -4.486261310772e-02 +-4.260789752655e-02 -4.034728111771e-02 -3.808163630530e-02 -3.581183412371e-02 +-3.353874390932e-02 -3.126323299356e-02 -2.898616639734e-02 -2.670840652700e-02 +-2.443081287186e-02 -2.215424170354e-02 -1.987954577704e-02 -1.760757403388e-02 +-1.533917130715e-02 -1.307517802878e-02 -1.081642993911e-02 -8.563757798700e-03 +-6.317987102690e-03 -4.079937797693e-03 -1.850424001331e-03 3.697462754655e-04 +2.579771403298e-03 4.778856406204e-03 6.966213230517e-03 9.141061010585e-03 +1.130262633127e-02 1.345014348713e-02 1.558285473817e-02 1.770001056217e-02 +1.980086990332e-02 2.188470041732e-02 2.395077871259e-02 2.599839058780e-02 +2.802683126538e-02 3.003540562106e-02 3.202342840941e-02 3.399022448515e-02 +3.593512902031e-02 3.785748771706e-02 3.975665701624e-02 4.163200430140e-02 +4.348290809837e-02 4.530875827032e-02 4.710895620815e-02 4.888291501618e-02 +5.063005969317e-02 5.234982730849e-02 5.404166717344e-02 5.570504100770e-02 +5.733942310076e-02 5.894430046840e-02 6.051917300409e-02 6.206355362527e-02 +6.357696841449e-02 6.505895675542e-02 6.650907146351e-02 6.792687891150e-02 +6.931195914959e-02 7.066390602023e-02 7.198232726759e-02 7.326684464163e-02 +7.451709399671e-02 7.573272538478e-02 7.691340314312e-02 7.805880597647e-02 +7.916862703380e-02 8.024257397943e-02 8.128036905865e-02 8.228174915775e-02 +8.324646585855e-02 8.417428548724e-02 8.506498915771e-02 8.591837280926e-02 +8.673424723874e-02 8.751243812706e-02 8.825278606009e-02 8.895514654406e-02 +8.961939001526e-02 9.024540184427e-02 9.083308233453e-02 9.138234671541e-02 +9.189312512975e-02 9.236536261582e-02 9.279901908383e-02 9.319406928693e-02 +9.355050278675e-02 9.386832391348e-02 9.414755172060e-02 9.438821993413e-02 +9.459037689662e-02 9.475408550577e-02 9.487942314775e-02 9.496648162530e-02 +9.501536708061e-02 9.502619991302e-02 9.499911469155e-02 9.493426006246e-02 +9.483179865159e-02 9.469190696188e-02 9.451477526582e-02 9.430060749305e-02 +9.404962111313e-02 9.376204701352e-02 9.343812937277e-02 9.307812552910e-02 +9.268230584436e-02 9.225095356338e-02 9.178436466890e-02 9.128284773200e-02 +9.074672375824e-02 9.017632602944e-02 8.957199994129e-02 8.893410283673e-02 +8.826300383534e-02 8.755908365865e-02 8.682273445152e-02 8.605435959968e-02 +8.525437354350e-02 8.442320158798e-02 8.356127970921e-02 8.266905435722e-02 +8.174698225538e-02 8.079553019644e-02 7.981517483525e-02 7.880640247828e-02 +7.776970887001e-02 7.670559897632e-02 7.561458676484e-02 7.449719498256e-02 +7.335395493060e-02 7.218540623629e-02 7.099209662273e-02 6.977458167578e-02 +6.853342460873e-02 6.726919602462e-02 6.598247367633e-02 6.467384222462e-02 +6.334389299411e-02 6.199322372732e-02 6.062243833697e-02 5.923214665645e-02 +5.782296418875e-02 5.639551185381e-02 5.495041573448e-02 5.348830682111e-02 +5.200982075493e-02 5.051559757034e-02 4.900628143611e-02 4.748252039569e-02 +4.594496610667e-02 4.439427357957e-02 4.283110091591e-02 4.125610904585e-02 +3.966996146536e-02 3.807332397307e-02 3.646686440693e-02 3.485125238070e-02 +3.322715902046e-02 3.159525670120e-02 2.995621878360e-02 2.831071935103e-02 +2.665943294700e-02 2.500303431309e-02 2.334219812741e-02 2.167759874379e-02 +2.000990993170e-02 1.833980461710e-02 1.666795462418e-02 1.499503041830e-02 +1.332170084993e-02 1.164863290000e-02 9.976491426473e-03 8.305938912502e-03 +6.637635215999e-03 4.972237320923e-03 3.310399090263e-03 1.652771020840e-03 +1.407779656454e-14 -1.647270935606e-03 -3.288402839377e-03 -4.922761091662e-03 +-6.549715634615e-03 + L N + 2 3 +0.000000000000e+00 4.457248300609e-05 1.782643907072e-04 4.009991057074e-04 +7.126489819778e-04 1.113035415164e-03 1.601928940826e-03 2.179049363382e-03 +2.844065911793e-03 3.596597423940e-03 4.436212558919e-03 5.362430037396e-03 +6.374718909676e-03 7.472498851489e-03 8.655140487220e-03 9.921965740513e-03 +1.127224821193e-02 1.270521358351e-02 1.422004005004e-02 1.581585877668e-02 +1.749175438281e-02 1.924676545176e-02 2.107988506605e-02 2.299006136809e-02 +2.497619814568e-02 2.703715544230e-02 2.917175019161e-02 3.137875687592e-02 +3.365690820823e-02 3.600489583748e-02 3.842137107649e-02 4.090494565238e-02 +4.345419247888e-02 4.606764645011e-02 4.874380525550e-02 5.148113021525e-02 +5.427804713593e-02 5.713294718568e-02 6.004418778865e-02 6.301009353797e-02 +6.602895712690e-02 6.909904029756e-02 7.221857480672e-02 7.538576340809e-02 +7.859878085057e-02 8.185577489191e-02 8.515486732719e-02 8.849415503146e-02 +9.187171101615e-02 9.528558549845e-02 9.873380698317e-02 1.022143833564e-01 +1.057253029904e-01 1.092645358591e-01 1.128300346638e-01 1.164197359675e-01 +1.200315613388e-01 1.236634185032e-01 1.273132025023e-01 1.309787968591e-01 +1.346580747501e-01 1.383489001823e-01 1.420491291753e-01 1.457566109472e-01 +1.494691891042e-01 1.531847028329e-01 1.569009880945e-01 1.606158788208e-01 +1.643272081105e-01 1.680328094259e-01 1.717305177888e-01 1.754181709754e-01 +1.790936107092e-01 1.827546838509e-01 1.863992435853e-01 1.900251506049e-01 +1.936302742875e-01 1.972124938699e-01 2.007696996148e-01 2.042997939718e-01 +2.078006927304e-01 2.112703261660e-01 2.147066401766e-01 2.181075974111e-01 +2.214711783874e-01 2.247953825998e-01 2.280782296165e-01 2.313177601642e-01 +2.345120372012e-01 2.376591469778e-01 2.407572000828e-01 2.438043324763e-01 +2.467987065080e-01 2.497385119204e-01 2.526219668358e-01 2.554473187279e-01 +2.582128453763e-01 2.609168558033e-01 2.635576911935e-01 2.661337257950e-01 +2.686433678012e-01 2.710850602144e-01 2.734572816884e-01 2.757585473522e-01 +2.779874096115e-01 2.801424589308e-01 2.822223245923e-01 2.842256754343e-01 +2.861512205662e-01 2.879977100613e-01 2.897639356266e-01 2.914487312484e-01 +2.930509738149e-01 2.945695837145e-01 2.960035254092e-01 2.973518079833e-01 +2.986134856677e-01 2.997876583384e-01 3.008734719886e-01 3.018701191768e-01 +3.027768394469e-01 3.035929197232e-01 3.043176946788e-01 3.049505470763e-01 +3.054909080832e-01 3.059382575588e-01 3.062921243152e-01 3.065520863497e-01 +3.067177710513e-01 3.067888553784e-01 3.067650660094e-01 3.066461794661e-01 +3.064320222090e-01 3.061224707043e-01 3.057174514647e-01 3.052169410610e-01 +3.046209661066e-01 3.039296032146e-01 3.031429789265e-01 3.022612696142e-01 +3.012847013538e-01 3.002135497725e-01 2.990481398679e-01 2.977888458001e-01 +2.964360906574e-01 2.949903461941e-01 2.934521325427e-01 2.918220178985e-01 +2.901006181790e-01 2.882885966564e-01 2.863866635645e-01 2.843955756802e-01 +2.823161358792e-01 2.801491926669e-01 2.778956396848e-01 2.755564151915e-01 +2.731325015206e-01 2.706249245140e-01 2.680347529323e-01 2.653630978410e-01 +2.626111119753e-01 2.597799890815e-01 2.568709632367e-01 2.538853081470e-01 +2.508243364242e-01 2.476893988424e-01 2.444818835731e-01 2.412032154019e-01 +2.378548549247e-01 2.344382977253e-01 2.309550735345e-01 2.274067453716e-01 +2.237949086680e-01 2.201211903739e-01 2.163872480489e-01 2.125947689363e-01 +2.087454690225e-01 2.048410920811e-01 2.008834087031e-01 1.968742153133e-01 +1.928153331736e-01 1.887086073738e-01 1.845559058101e-01 1.803591181529e-01 +1.761201548032e-01 1.718409458392e-01 1.675234399531e-01 1.631696033788e-01 +1.587814188122e-01 1.543608843220e-01 1.499100122556e-01 1.454308281366e-01 +1.409253695573e-01 1.363956850664e-01 1.318438330511e-01 1.272718806159e-01 +1.226819024584e-01 1.180759797413e-01 1.134561989637e-01 1.088246508299e-01 +1.041834291183e-01 9.953462954955e-02 9.488034865550e-02 9.022268264941e-02 +8.556372629778e-02 8.090557179462e-02 7.625030763888e-02 7.160001751551e-02 +6.695677918083e-02 6.232266335288e-02 5.769973260732e-02 5.309004027948e-02 +4.849562937322e-02 4.391853147720e-02 3.936076568912e-02 3.482433754858e-02 +3.031123797906e-02 2.582344223978e-02 2.136290888780e-02 1.693157875109e-02 +1.253137391310e-02 8.164196709282e-03 3.831928736336e-03 -4.635701255367e-04 +-4.720462676645e-03 -8.936935347656e-03 -1.311119913473e-02 -1.724149051946e-02 +-2.132607237305e-02 -2.536323484439e-02 -2.935129623136e-02 -3.328860383506e-02 +-3.717353479639e-02 -4.100449691463e-02 -4.477992944750e-02 -4.849830389238e-02 +-5.215812474809e-02 -5.575793025712e-02 -5.929629312760e-02 -6.277182123488e-02 +-6.618315830222e-02 -6.952898456029e-02 -7.280801738516e-02 -7.601901191437e-02 +-7.916076164086e-02 -8.223209898438e-02 -8.523189584023e-02 -8.815906410481e-02 +-9.101255617803e-02 -9.379136544205e-02 -9.649452671631e-02 -9.912111668852e-02 +-1.016702543216e-01 -1.041411012358e-01 -1.065328620670e-01 -1.088447847996e-01 +-1.110761610748e-01 -1.132263264739e-01 -1.152946607763e-01 -1.172805881930e-01 +-1.191835775734e-01 -1.210031425882e-01 -1.227388418859e-01 -1.243902792240e-01 +-1.259571035753e-01 -1.274390092077e-01 -1.288357357390e-01 -1.301470681664e-01 +-1.313728368700e-01 -1.325129175914e-01 -1.335672313864e-01 -1.345357445526e-01 +-1.354184685322e-01 -1.362154597889e-01 -1.369268196606e-01 -1.375526941866e-01 +-1.380932739105e-01 -1.385487936582e-01 -1.389195322919e-01 -1.392058124400e-01 +-1.394080002019e-01 -1.395265048306e-01 -1.395617783907e-01 -1.395143153936e-01 +-1.393846524088e-01 -1.391733676538e-01 -1.388810805603e-01 -1.385084513188e-01 +-1.380561804008e-01 -1.375250080601e-01 -1.369157138120e-01 -1.362291158925e-01 +-1.354660706961e-01 -1.346274721936e-01 -1.337142513307e-01 -1.327273754061e-01 +-1.316678474315e-01 -1.305367054722e-01 -1.293350219701e-01 -1.280639030485e-01 +-1.267244877994e-01 -1.253179475545e-01 -1.238454851391e-01 -1.223083341104e-01 +-1.207077579798e-01 -1.190450494209e-01 -1.173215294620e-01 -1.155385466653e-01 +-1.136974762920e-01 -1.117997194550e-01 -1.098467022581e-01 -1.078398749240e-01 +-1.057807109104e-01 -1.036707060153e-01 -1.015113774717e-01 -9.930426303258e-02 +-9.705092004665e-02 -9.475292452496e-02 -9.241187019960e-02 -9.002936757466e-02 +-8.760704297005e-02 -8.514653755883e-02 -8.264950639862e-02 -8.011761745753e-02 +-7.755255063536e-02 -7.495599678058e-02 -7.232965670356e-02 -6.967524018682e-02 +-6.699446499276e-02 -6.428905586941e-02 -6.156074355494e-02 -5.881126378136e-02 +-5.604235627800e-02 -5.325576377550e-02 -5.045323101064e-02 -4.763650373284e-02 +-4.480732771270e-02 -4.196744775324e-02 -3.911860670445e-02 -3.626254448162e-02 +-3.340099708804e-02 -3.053569564265e-02 -2.766836541325e-02 -2.480072485565e-02 +-2.193448465945e-02 -1.907134680097e-02 -1.621300360381e-02 -1.336113680758e-02 +-1.051741664539e-02 -7.683500930553e-03 -4.861034152950e-03 -2.051646585752e-03 +7.430465972123e-04 3.521446192831e-03 6.281969828383e-03 9.023052809042e-03 +1.174314895274e-02 1.444073141190e-02 1.711429348171e-02 1.976234939429e-02 +2.238343509855e-02 2.497610902513e-02 2.753895283621e-02 3.007057215951e-02 +3.256959730641e-02 3.503468397357e-02 3.746451392777e-02 3.985779567360e-02 +4.221326510369e-02 4.452968613109e-02 4.680585130346e-02 4.904058239882e-02 +5.123273100254e-02 5.338117906521e-02 5.548483944120e-02 5.754265640760e-02 +5.955360616327e-02 6.151669730783e-02 6.343097130024e-02 6.529550289684e-02 +6.710940056866e-02 6.887180689773e-02 7.058189895224e-02 7.223888864046e-02 +7.384202304310e-02 7.539058472419e-02 7.688389202009e-02 7.832129930679e-02 +7.970219724519e-02 8.102601300434e-02 8.229221046263e-02 8.350029038675e-02 +8.464979058844e-02 8.574028605906e-02 8.677138908178e-02 8.774274932152e-02 +8.865405389270e-02 8.950502740454e-02 9.029543198437e-02 9.102506727852e-02 +9.169377043125e-02 9.230141604154e-02 9.284791609794e-02 9.333321989151e-02 +9.375731390701e-02 9.412022169248e-02 9.442200370720e-02 9.466275714840e-02 +9.484261575671e-02 9.496174960057e-02 9.502036483976e-02 9.501870346840e-02 +9.495704303729e-02 9.483569635626e-02 9.465501117629e-02 9.441536985208e-02 +9.411718898495e-02 9.376091904661e-02 9.334704398391e-02 9.287608080494e-02 +9.234857914673e-02 9.176512082490e-02 9.112631936550e-02 9.043281951951e-02 +8.968529676013e-02 8.888445676345e-02 8.803103487260e-02 8.712579554598e-02 +8.616953178973e-02 8.516306457505e-02 8.410724224049e-02 8.300293987988e-02 +8.185105871610e-02 8.065252546120e-02 7.940829166328e-02 7.811933304056e-02 +7.678664880301e-02 7.541126096205e-02 7.399421362883e-02 7.253657230130e-02 +7.103942314083e-02 6.950387223863e-02 6.793104487253e-02 6.632208475452e-02 +6.467815326968e-02 6.300042870677e-02 6.129010548114e-02 5.954839335034e-02 +5.777651662299e-02 5.597571336138e-02 5.414723457828e-02 5.229234342845e-02 +5.041231439542e-02 4.850843247399e-02 4.658199234892e-02 4.463429757040e-02 +4.266665972674e-02 4.068039761486e-02 3.867683640893e-02 3.665730682787e-02 +3.462314430212e-02 3.257568814007e-02 3.051628069495e-02 2.844626653232e-02 +2.636699159894e-02 2.427980239344e-02 2.218604513920e-02 2.008706496005e-02 +1.798420505918e-02 1.587880590191e-02 1.377220440256e-02 1.166573311614e-02 +9.560719435159e-03 7.458484792203e-03 5.360343868524e-03 3.267603809314e-03 +1.181563446000e-03 -8.964874739415e-04 -2.965269049220e-03 -5.023511978570e-03 +-7.069958305755e-03 -9.103362155313e-03 -1.112249045863e-02 -1.312612366988e-02 +-1.511305647156e-02 -1.708209846895e-02 -1.903207487348e-02 -2.096182717423e-02 +-2.287021379752e-02 -2.475611075395e-02 -2.661841227277e-02 -2.845603142301e-02 +-3.026790072120e-02 -3.205297272523e-02 -3.381022061409e-02 -3.553863875319e-02 +-3.723724324485e-02 -3.890507246382e-02 -4.054118757736e-02 -4.214467304981e-02 +-4.371463713124e-02 -4.525021232991e-02 -4.675055586845e-02 -4.821485012336e-02 +-4.964230304767e-02 -5.103214857662e-02 -5.238364701599e-02 -5.369608541310e-02 +-5.496877791009e-02 -5.620106607950e-02 -5.739231924181e-02 -5.854193476503e-02 +-5.964933834590e-02 -6.071398427289e-02 -6.173535567067e-02 -6.271296472603e-02 +-6.364635289518e-02 -6.453509109232e-02 -6.537877985944e-02 -6.617704951726e-02 +-6.692956029730e-02 -6.763600245510e-02 -6.829609636440e-02 -6.890959259254e-02 +-6.947627195680e-02 -6.999594556194e-02 -7.046845481878e-02 -7.089367144401e-02 +-7.127149744118e-02 -7.160186506299e-02 -7.188473675489e-02 -7.212010508019e-02 +-7.230799262665e-02 -7.244845189474e-02 -7.254156516766e-02 -7.258744436323e-02 +-7.258623086790e-02 -7.253809535283e-02 -7.244323757238e-02 -7.230188614518e-02 +-7.211429831779e-02 -7.188075971132e-02 -7.160158405118e-02 -7.127711288012e-02 +-7.090771525475e-02 -7.049378742595e-02 -7.003575250320e-02 -6.953406010323e-02 +-6.898918598315e-02 -6.840163165842e-02 -6.777192400586e-02 -6.710061485204e-02 +-6.638828054735e-02 -6.563552152595e-02 -6.484296185208e-02 -6.401124875290e-02 +-6.314105213826e-02 -6.223306410774e-02 -6.128799844526e-02 -6.030659010162e-02 +-5.928959466533e-02 -5.823778782215e-02 -5.715196480352e-02 -5.603293982456e-02 +-5.488154551165e-02 -5.369863232030e-02 -5.248506794353e-02 -5.124173671111e-02 +-4.996953898025e-02 -4.866939051794e-02 -4.734222187547e-02 -4.598897775549e-02 +-4.461061637206e-02 -4.320810880402e-02 -4.178243834230e-02 -4.033459983128e-02 +-3.886559900497e-02 -3.737645181818e-02 -3.586818377323e-02 -3.434182924260e-02 +-3.279843078799e-02 -3.123903847615e-02 -2.966470919199e-02 -2.807650594939e-02 +-2.647549720008e-02 -2.486275614114e-02 -2.323936002146e-02 -2.160638944768e-02 +-1.996492768990e-02 -1.831605998782e-02 -1.666087285751e-02 -1.500045339944e-02 +-1.333588860800e-02 -1.166826468316e-02 -9.998666344508e-03 -8.328176148179e-03 +-6.657873807088e-03 -4.988835514865e-03 -3.322133273924e-03 -1.658834228060e-03 +9.121000012504e-15 1.653313965754e-03 3.300059054207e-03 4.939194125200e-03 +6.569686152075e-03 + L N + 2 4 +0.000000000000e+00 6.467701394526e-05 2.586542722449e-04 5.817704694811e-04 +1.033756907085e-03 1.614237711695e-03 2.322730138657e-03 3.158644962269e-03 +4.121286952178e-03 5.209855435369e-03 6.423444943357e-03 7.761045944149e-03 +9.221545658196e-03 1.080372895779e-02 1.250627934912e-02 1.432778003624e-02 +1.626671506593e-02 1.832147055267e-02 2.049033598262e-02 2.277150559559e-02 +2.516307984377e-02 2.766306692621e-02 3.026938439749e-02 3.297986084961e-02 +3.579223766544e-02 3.870417084234e-02 4.171323288467e-02 4.481691476325e-02 +4.801262794057e-02 5.129770645970e-02 5.466940909557e-02 5.812492156647e-02 +6.166135880428e-02 6.527576728134e-02 6.896512739216e-02 7.272635588803e-02 +7.655630836242e-02 8.045178178523e-02 8.440951708386e-02 8.842620176875e-02 +9.249847260157e-02 9.662291830356e-02 1.007960823020e-01 1.050144655125e-01 +1.092745291549e-01 1.135726976002e-01 1.179053612464e-01 1.222688794215e-01 +1.266595833095e-01 1.310737788995e-01 1.355077499530e-01 1.399577609892e-01 +1.444200602838e-01 1.488908828806e-01 1.533664536125e-01 1.578429901293e-01 +1.623167059309e-01 1.667838134018e-01 1.712405268457e-01 1.756830655180e-01 +1.801076566519e-01 1.845105384774e-01 1.888879632307e-01 1.932362001498e-01 +1.975515384562e-01 2.018302903183e-01 2.060687937959e-01 2.102634157614e-01 +2.144105547971e-01 2.185066440656e-01 2.225481541504e-01 2.265315958651e-01 +2.304535230296e-01 2.343105352087e-01 2.380992804136e-01 2.418164577626e-01 +2.454588200992e-01 2.490231765652e-01 2.525063951274e-01 2.559054050554e-01 +2.592171993486e-01 2.624388371103e-01 2.655674458674e-01 2.686002238332e-01 +2.715344421129e-01 2.743674468476e-01 2.770966612978e-01 2.797195878629e-01 +2.822338100357e-01 2.846369942908e-01 2.869268919043e-01 2.891013407043e-01 +2.911582667514e-01 2.930956859452e-01 2.949117055595e-01 2.966045257012e-01 +2.981724406948e-01 2.996138403890e-01 3.009272113863e-01 3.021111381935e-01 +3.031643042930e-01 3.040854931329e-01 3.048735890371e-01 3.055275780325e-01 +3.060465485947e-01 3.064296923100e-01 3.066763044547e-01 3.067857844901e-01 +3.067576364736e-01 3.065914693852e-01 3.062869973702e-01 3.058440398959e-01 +3.052625218249e-01 3.045424734030e-01 3.036840301624e-01 3.026874327411e-01 +3.015530266175e-01 3.002812617612e-01 2.988726922006e-01 2.973279755071e-01 +2.956478721966e-01 2.938332450497e-01 2.918850583496e-01 2.898043770398e-01 +2.875923658023e-01 2.852502880559e-01 2.827795048773e-01 2.801814738444e-01 +2.774577478034e-01 2.746099735617e-01 2.716398905060e-01 2.685493291479e-01 +2.653402095987e-01 2.620145399736e-01 2.585744147272e-01 2.550220129220e-01 +2.513595964312e-01 2.475895080768e-01 2.437141697060e-01 2.397360802058e-01 +2.356578134586e-01 2.314820162408e-01 2.272114060649e-01 2.228487689682e-01 +2.183969572496e-01 2.138588871558e-01 2.092375365199e-01 2.045359423538e-01 +1.997571983959e-01 1.949044526175e-01 1.899809046891e-01 1.849898034084e-01 +1.799344440933e-01 1.748181659408e-01 1.696443493552e-01 1.644164132466e-01 +1.591378123033e-01 1.538120342391e-01 1.484425970188e-01 1.430330460631e-01 +1.375869514369e-01 1.321079050210e-01 1.265995176723e-01 1.210654163718e-01 +1.155092413657e-01 1.099346432998e-01 1.043452803504e-01 9.874481535428e-02 +9.313691293955e-02 8.752523666008e-02 8.191344613574e-02 7.630519420076e-02 +7.070412406258e-02 6.511386647350e-02 5.953803691739e-02 5.398023281373e-02 +4.844403074131e-02 4.293298368379e-02 3.745061829925e-02 3.200043221616e-02 +2.658589135768e-02 2.121042729658e-02 1.587743464290e-02 1.059026846634e-02 +5.352241755580e-03 1.666229163423e-04 -4.963366689589e-03 -1.003455516262e-02 +-1.504382243890e-02 -1.998810261728e-02 -2.486438623791e-02 -2.966972251065e-02 +-3.440122149161e-02 -3.905605620602e-02 -4.363146471594e-02 -4.812475213110e-02 +-5.253329256133e-02 -5.685453100917e-02 -6.108598520115e-02 -6.522524735635e-02 +-6.926998589097e-02 -7.321794705754e-02 -7.706695651764e-02 -8.081492084693e-02 +-8.445982897137e-02 -8.799975353358e-02 -9.143285218847e-02 -9.475736882699e-02 +-9.797163472740e-02 -1.010740696331e-01 -1.040631827561e-01 -1.069375737062e-01 +-1.096959333441e-01 -1.123370445592e-01 -1.148597829702e-01 -1.172631175495e-01 +-1.195461111700e-01 -1.217079210747e-01 -1.237477992681e-01 -1.256650928302e-01 +-1.274592441522e-01 -1.291297910945e-01 -1.306763670666e-01 -1.320987010287e-01 +-1.333966174168e-01 -1.345700359890e-01 -1.356189715955e-01 -1.365435338717e-01 +-1.373439268546e-01 -1.380204485240e-01 -1.385734902677e-01 -1.390035362722e-01 +-1.393111628400e-01 -1.394970376326e-01 -1.395619188418e-01 -1.395066542893e-01 +-1.393321804551e-01 -1.390395214367e-01 -1.386297878394e-01 -1.381041755992e-01 +-1.374639647384e-01 -1.367105180573e-01 -1.358452797606e-01 -1.348697740218e-01 +-1.337856034858e-01 -1.325944477119e-01 -1.312980615577e-01 -1.298982735065e-01 +-1.283969839388e-01 -1.267961633501e-01 -1.250978505159e-01 -1.233041506066e-01 +-1.214172332533e-01 -1.194393305656e-01 -1.173727351053e-01 -1.152197978151e-01 +-1.129829259064e-01 -1.106645807066e-01 -1.082672754685e-01 -1.057935731439e-01 +-1.032460841225e-01 -1.006274639388e-01 -9.794041094889e-02 -9.518766397925e-02 +-9.237199994887e-02 -8.949623146779e-02 -8.656320441344e-02 -8.357579548706e-02 +-8.053690975243e-02 -7.744947815873e-02 -7.431645504994e-02 -7.114081566276e-02 +-6.792555361516e-02 -6.467367838778e-02 -6.138821280021e-02 -5.807219048446e-02 +-5.472865335745e-02 -5.136064909501e-02 -4.797122860918e-02 -4.456344353117e-02 +-4.114034370191e-02 -3.770497467241e-02 -3.426037521587e-02 -3.080957485374e-02 +-2.735559139769e-02 -2.390142850954e-02 -2.045007328115e-02 -1.700449383626e-02 +-1.356763695622e-02 -1.014242573161e-02 -6.731757241574e-03 -3.338500262781e-03 +3.450699010114e-05 3.384459090659e-03 6.708585591882e-03 1.000415318049e-02 +1.326846779269e-02 1.649887668971e-02 1.969277049147e-02 2.284758516679e-02 +2.596080397851e-02 2.902995938214e-02 3.205263487648e-02 3.502646680471e-02 +3.794914610479e-02 4.081842000759e-02 4.363209368161e-02 4.638803182301e-02 +4.908416018980e-02 5.171846707893e-02 5.428900474540e-02 5.679389076215e-02 +5.923130931991e-02 6.159951246595e-02 6.389682128100e-02 6.612162699342e-02 +6.827239202987e-02 7.034765100187e-02 7.234601162746e-02 7.426615558751e-02 +7.610683931608e-02 7.786689472434e-02 7.954522985768e-02 8.114082948563e-02 +8.265275562436e-02 8.408014799135e-02 8.542222439227e-02 8.667828103984e-02 +8.784769280450e-02 8.892991339717e-02 8.992447548386e-02 9.083099073243e-02 +9.164914979164e-02 9.237872220263e-02 9.301955624322e-02 9.357157870541e-02 +9.403479460629e-02 9.440928683305e-02 9.469521572246e-02 9.489281857541e-02 +9.500240910722e-02 9.502437683422e-02 9.495918639761e-02 9.480737682502e-02 +9.456956073099e-02 9.424642345693e-02 9.383872215173e-02 9.334728479382e-02 +9.277300915591e-02 9.211686171330e-02 9.137987649695e-02 9.056315389263e-02 +8.966785938705e-02 8.869522226255e-02 8.764653424145e-02 8.652314808142e-02 +8.532647612334e-02 8.405798879298e-02 8.271921305792e-02 8.131173084133e-02 +7.983717739398e-02 7.829723962611e-02 7.669365440074e-02 7.502820679000e-02 +7.330272829607e-02 7.151909503859e-02 6.967922590995e-02 6.778508070034e-02 +6.583865819438e-02 6.384199424077e-02 6.179715979705e-02 5.970625895115e-02 +5.757142692138e-02 5.539482803698e-02 5.317865370071e-02 5.092512033565e-02 +4.863646731778e-02 4.631495489640e-02 4.396286210410e-02 4.158248465821e-02 +3.917613285563e-02 3.674612946285e-02 3.429480760297e-02 3.182450864173e-02 +2.933758007429e-02 2.683637341465e-02 2.432324208952e-02 2.180053933849e-02 +1.927061612244e-02 1.673581904170e-02 1.419848826614e-02 1.166095547863e-02 +9.125541833832e-03 6.594555934047e-03 4.070291823748e-03 1.555027004599e-03 +-9.489795274114e-04 -3.439489221052e-03 -5.914285883511e-03 -8.371177567057e-03 +-1.080799842710e-02 -1.322261055011e-02 -1.561290574995e-02 -1.797680733099e-02 +-2.031227181671e-02 -2.261729064236e-02 -2.488989181013e-02 -2.712814150576e-02 +-2.933014567510e-02 -3.149405155936e-02 -3.361804918796e-02 -3.570037282766e-02 +-3.773930238696e-02 -3.973316477450e-02 -4.168033521061e-02 -4.357923849086e-02 +-4.542835020074e-02 -4.722619788044e-02 -4.897136213900e-02 -5.066247771695e-02 +-5.229823449659e-02 -5.387737845932e-02 -5.539871258930e-02 -5.686109772272e-02 +-5.826345334227e-02 -5.960475831614e-02 -6.088405158118e-02 -6.210043276973e-02 +-6.325306277975e-02 -6.434116428803e-02 -6.536402220605e-02 -6.632098407841e-02 +-6.721146042362e-02 -6.803492501707e-02 -6.879091511625e-02 -6.947903162814e-02 +-7.009893921874e-02 -7.065036636499e-02 -7.113310534910e-02 -7.154701219554e-02 +-7.189200655093e-02 -7.216807150707e-02 -7.237525336760e-02 -7.251366135851e-02 +-7.258346728307e-02 -7.258490512157e-02 -7.251827057659e-02 -7.238392056411e-02 +-7.218227265139e-02 -7.191380444207e-02 -7.157905290935e-02 -7.117861367794e-02 +-7.071314025570e-02 -7.018334321567e-02 -6.958998932949e-02 -6.893390065319e-02 +-6.821595356620e-02 -6.743707776469e-02 -6.659825521027e-02 -6.570051903513e-02 +-6.474495240479e-02 -6.373268733955e-02 -6.266490349590e-02 -6.154282690909e-02 +-6.036772869814e-02 -5.914092373457e-02 -5.786376927608e-02 -5.653766356675e-02 +-5.516404440485e-02 -5.374438767992e-02 -5.228020588032e-02 -5.077304657284e-02 +-4.922449085577e-02 -4.763615178696e-02 -4.600967278826e-02 -4.434672602804e-02 +-4.264901078311e-02 -4.091825178181e-02 -3.915619752961e-02 -3.736461861899e-02 +-3.554530602502e-02 -3.370006938831e-02 -3.183073528694e-02 -2.993914549896e-02 +-2.802715525691e-02 -2.609663149633e-02 -2.414945109941e-02 -2.218749913577e-02 +-2.021266710177e-02 -1.822685116001e-02 -1.623195038059e-02 -1.422986498576e-02 +-1.222249459954e-02 -1.021173650382e-02 -8.199483902594e-03 -6.187624195818e-03 +-4.178037264425e-03 -2.172593768075e-03 -1.731534570916e-04 1.818436499896e-03 +3.800343171147e-03 5.770749498377e-03 7.727855913281e-03 9.669881932597e-03 +1.159506773032e-02 1.350167568574e-02 1.538799190588e-02 1.725232772119e-02 +1.909302115304e-02 2.090843835186e-02 2.269697500474e-02 2.445705771117e-02 +2.618714532593e-02 2.788573026788e-02 2.955133979361e-02 3.118253723494e-02 +3.277792319915e-02 3.433613673106e-02 3.585585643598e-02 3.733580156260e-02 +3.877473304497e-02 4.017145450282e-02 4.152481319930e-02 4.283370095549e-02 +4.409705502095e-02 4.531385889966e-02 4.648314313074e-02 4.760398602330e-02 +4.867551434504e-02 4.969690396393e-02 5.066738044268e-02 5.158621958553e-02 +5.245274793696e-02 5.326634323216e-02 5.402643479884e-02 5.473250391019e-02 +5.538408408892e-02 5.598076136215e-02 5.652217446705e-02 5.700801500733e-02 +5.743802756036e-02 5.781200973523e-02 5.812981218165e-02 5.839133854989e-02 +5.859654540203e-02 5.874544207454e-02 5.883809049276e-02 5.887460493731e-02 +5.885515176296e-02 5.877994907029e-02 5.864926633065e-02 5.846342396483e-02 +5.822279287599e-02 5.792779393747e-02 5.757889743600e-02 5.717662247100e-02 +5.672153631070e-02 5.621425370570e-02 5.565543616079e-02 5.504579116584e-02 +5.438607138658e-02 5.367707381606e-02 5.291963888783e-02 5.211464955159e-02 +5.126303031252e-02 5.036574623496e-02 4.942380191178e-02 4.843824040031e-02 +4.741014212590e-02 4.634062375435e-02 4.523083703419e-02 4.408196761011e-02 +4.289523380852e-02 4.167188539674e-02 4.041320231670e-02 3.912049339471e-02 +3.779509502828e-02 3.643836985150e-02 3.505170538017e-02 3.363651263793e-02 +3.219422476486e-02 3.072629560979e-02 2.923419830763e-02 2.771942384323e-02 +2.618347960300e-02 2.462788791564e-02 2.305418458359e-02 2.146391740623e-02 +1.985864469655e-02 1.823993379249e-02 1.660935956441e-02 1.496850292005e-02 +1.331894930838e-02 1.166228722378e-02 1.000010671186e-02 8.333997878296e-03 +6.665549402163e-03 4.996347054970e-03 3.327972226886e-03 1.662000461435e-03 +-1.198470083746e-15 -1.656469662533e-03 -3.305859209674e-03 -4.946630921512e-03 +-6.577260077874e-03 + L N + 2 5 +0.000000000000e+00 8.843454862814e-05 3.536376431318e-04 7.953077383045e-04 +1.412942629879e-03 2.205840009215e-03 3.173098239592e-03 4.313617352843e-03 +5.626100265260e-03 7.109054211153e-03 8.760792392702e-03 1.057943584416e-02 +1.256291550825e-02 1.470897452253e-02 1.701517071310e-02 1.947887929282e-02 +2.209729576101e-02 2.486743900145e-02 2.778615457506e-02 3.085011820372e-02 +3.405583944115e-02 3.739966552686e-02 4.087778541869e-02 4.448623399960e-02 +4.822089645382e-02 5.207751280750e-02 5.605168262877e-02 6.013886988193e-02 +6.433440793030e-02 6.863350468212e-02 7.303124787377e-02 7.752261048427e-02 +8.210245627513e-02 8.676554544919e-02 9.150654042227e-02 9.632001170095e-02 +1.012004438601e-01 1.061422416135e-01 1.111397359702e-01 1.161871904705e-01 +1.212788074943e-01 1.264087346346e-01 1.315710711288e-01 1.367598743410e-01 +1.419691662889e-01 1.471929402053e-01 1.524251671307e-01 1.576598025256e-01 +1.628907928987e-01 1.681120824415e-01 1.733176196618e-01 1.785013640105e-01 +1.836572924922e-01 1.887794062539e-01 1.938617371432e-01 1.988983542297e-01 +2.038833702822e-01 2.088109481935e-01 2.136753073473e-01 2.184707299184e-01 +2.231915671013e-01 2.278322452582e-01 2.323872719807e-01 2.368512420586e-01 +2.412188433491e-01 2.454848625395e-01 2.496441907972e-01 2.536918293015e-01 +2.576228946506e-01 2.614326241370e-01 2.651163808874e-01 2.686696588600e-01 +2.720880876944e-01 2.753674374084e-01 2.785036229372e-01 2.814927085096e-01 +2.843309118560e-01 2.870146082457e-01 2.895403343460e-01 2.919047919020e-01 +2.941048512312e-01 2.961375545295e-01 2.980001189869e-01 2.996899397059e-01 +3.012045924239e-01 3.025418360331e-01 3.036996148978e-01 3.046760609651e-01 +3.054694956680e-01 3.060784316181e-01 3.065015740870e-01 3.067378222743e-01 +3.067862703616e-01 3.066462083512e-01 3.063171226887e-01 3.057986966696e-01 +3.050908106292e-01 3.041935419158e-01 3.031071646480e-01 3.018321492558e-01 +3.003691618077e-01 2.987190631224e-01 2.968829076694e-01 2.948619422570e-01 +2.926576045123e-01 2.902715211520e-01 2.877055060494e-01 2.849615580978e-01 +2.820418588735e-01 2.789487701018e-01 2.756848309287e-01 2.722527550014e-01 +2.686554273614e-01 2.648959011542e-01 2.609773941583e-01 2.569032851397e-01 +2.526771100344e-01 2.483025579636e-01 2.437834670878e-01 2.391238203025e-01 +2.343277407826e-01 2.293994873787e-01 2.243434498729e-01 2.191641440970e-01 +2.138662069216e-01 2.084543911193e-01 2.029335601097e-01 1.973086825914e-01 +1.915848270677e-01 1.857671562716e-01 1.798609214971e-01 1.738714568434e-01 +1.678041733775e-01 1.616645532235e-01 1.554581435837e-01 1.491905506995e-01 +1.428674337582e-01 1.364944987533e-01 1.300774923044e-01 1.236221954444e-01 +1.171344173807e-01 1.106199892374e-01 1.040847577856e-01 9.753457916862e-02 +9.097531263009e-02 8.441281425030e-02 7.785293069927e-02 7.130149301279e-02 +6.476431039851e-02 5.824716407897e-02 5.175580117834e-02 4.529592865971e-02 +3.887320731955e-02 3.249324584599e-02 2.616159494743e-02 1.988374155795e-02 +1.366510312583e-02 7.511021991405e-03 1.426759860405e-03 -4.582507621236e-03 +-1.051169618524e-02 -1.635581814577e-02 -2.210998748552e-02 -2.776942481765e-02 +-3.332946221840e-02 -3.878554792496e-02 -4.413325089389e-02 -4.936826521520e-02 +-5.448641437729e-02 -5.948365537855e-02 -6.435608268117e-02 -6.909993200312e-02 +-7.371158394439e-02 -7.818756744389e-02 -8.252456306333e-02 -8.671940609498e-02 +-9.076908949011e-02 -9.467076660523e-02 -9.842175376361e-02 -1.020195326294e-01 +-1.054617523925e-01 -1.087462317616e-01 -1.118709607641e-01 -1.148341023516e-01 +-1.176339938086e-01 -1.202691479643e-01 -1.227382542061e-01 -1.250401792949e-01 +-1.271739679803e-01 -1.291388434172e-01 -1.309342073825e-01 -1.325596402933e-01 +-1.340149010263e-01 -1.352999265391e-01 -1.364148312948e-01 -1.373599064912e-01 +-1.381356190951e-01 -1.387426106843e-01 -1.391816960985e-01 -1.394538619017e-01 +-1.395602646572e-01 -1.395022290196e-01 -1.392812456445e-01 -1.388989689197e-01 +-1.383572145215e-01 -1.376579567977e-01 -1.368033259832e-01 -1.357956052489e-01 +-1.346372275904e-01 -1.333307725589e-01 -1.318789628388e-01 -1.302846606768e-01 +-1.285508641666e-01 -1.266807033933e-01 -1.246774364437e-01 -1.225444452862e-01 +-1.202852315255e-01 -1.179034120385e-01 -1.154027144950e-01 -1.127869727698e-01 +-1.100601222512e-01 -1.072261950524e-01 -1.042893151305e-01 -1.012536933192e-01 +-9.812362228211e-02 -9.490347139121e-02 -9.159768153769e-02 -8.821075988073e-02 +-8.474727454061e-02 -8.121184924242e-02 -7.760915791657e-02 -7.394391926241e-02 +-7.022089128150e-02 -6.644486578661e-02 -6.262066289307e-02 -5.875312549865e-02 +-5.484711375854e-02 -5.090749956161e-02 -4.693916101441e-02 -4.294697693916e-02 +-3.893582139206e-02 -3.491055820812e-02 -3.087603557870e-02 -2.683708066795e-02 +-2.279849427414e-02 -1.876504554194e-02 -1.474146673158e-02 -1.073244805069e-02 +-6.742632554596e-03 -2.776611120726e-03 1.161082497283e-03 5.065976530412e-03 +8.933665964617e-03 1.275981721555e-02 1.654017270256e-02 2.027055531696e-02 +2.394687277990e-02 2.756512188498e-02 3.112139262123e-02 3.461187217210e-02 +3.803284878607e-02 4.138071551510e-02 4.465197381679e-02 4.784323701676e-02 +5.095123362750e-02 5.397281052057e-02 5.690493594875e-02 5.974470241534e-02 +6.248932938769e-02 6.513616585240e-02 6.768269270979e-02 7.012652500537e-02 +7.246541399637e-02 7.469724905143e-02 7.682005938187e-02 7.883201560314e-02 +8.073143112517e-02 8.251676337075e-02 8.418661482097e-02 8.573973388724e-02 +8.717501560948e-02 8.849150218024e-02 8.968838329487e-02 9.076499632787e-02 +9.172082633592e-02 9.255550588818e-02 9.326881472473e-02 9.386067924413e-02 +9.433117182145e-02 9.468050995802e-02 9.490905526471e-02 9.501731228041e-02 +9.500592712786e-02 9.487568600880e-02 9.462751354110e-02 9.426247094018e-02 +9.378175404753e-02 9.318669120930e-02 9.247874100793e-02 9.165948985008e-02 +9.073064941431e-02 8.969405396193e-02 8.855165751490e-02 8.730553090442e-02 +8.595785869433e-02 8.451093598347e-02 8.296716509107e-02 8.132905212973e-02 +7.959920347039e-02 7.778032210396e-02 7.587520390419e-02 7.388673379677e-02 +7.181788183948e-02 6.967169921838e-02 6.745131416515e-02 6.515992780077e-02 +6.280080991070e-02 6.037729465690e-02 5.789277623210e-02 5.535070446159e-02 +5.275458035810e-02 5.010795163516e-02 4.741440818459e-02 4.467757752352e-02 +4.190112021655e-02 3.908872527867e-02 3.624410556442e-02 3.337099314900e-02 +3.047313470670e-02 2.755428689236e-02 2.461821173135e-02 2.166867202349e-02 +1.870942676643e-02 1.574422660391e-02 1.277680930427e-02 9.810895274485e-03 +6.850183114978e-03 3.898345220493e-03 9.590234320046e-04 -1.964175255218e-03 +-4.867682922457e-03 -7.747974892461e-03 -1.060157382366e-02 -1.342505372899e-02 +-1.621504391486e-02 -1.896823283569e-02 -2.168137185984e-02 -2.435127894258e-02 +-2.697484220215e-02 -2.954902339493e-02 -3.207086128584e-02 -3.453747491041e-02 +-3.694606672492e-02 -3.929392564125e-02 -4.157842994323e-02 -4.379705008142e-02 +-4.594735134334e-02 -4.802699639650e-02 -5.003374770156e-02 -5.196546979325e-02 +-5.382013142674e-02 -5.559580758741e-02 -5.729068136213e-02 -5.890304567025e-02 +-6.043130485283e-02 -6.187397611862e-02 -6.322969084568e-02 -6.449719573756e-02 +-6.567535383323e-02 -6.676314537007e-02 -6.775966849945e-02 -6.866413985459e-02 +-6.947589497063e-02 -7.019438855687e-02 -7.081919462152e-02 -7.135000644933e-02 +-7.178663643267e-02 -7.212901575695e-02 -7.237719394112e-02 -7.253133823464e-02 +-7.259173287195e-02 -7.255877818608e-02 -7.243298958297e-02 -7.221499637829e-02 +-7.190554049871e-02 -7.150547504972e-02 -7.101576275240e-02 -7.043747425129e-02 +-6.977178629627e-02 -6.901997980085e-02 -6.818343777997e-02 -6.726364317018e-02 +-6.626217653535e-02 -6.518071366117e-02 -6.402102304188e-02 -6.278496326262e-02 +-6.147448028115e-02 -6.009160461257e-02 -5.863844842095e-02 -5.711720252171e-02 +-5.553013329895e-02 -5.387957954164e-02 -5.216794920309e-02 -5.039771608784e-02 +-4.857141647040e-02 -4.669164565024e-02 -4.476105444761e-02 -4.278234564460e-02 +-4.075827037615e-02 -3.869162447569e-02 -3.658524477991e-02 -3.444200539771e-02 +-3.226481394767e-02 -3.005660776926e-02 -2.782035011212e-02 -2.555902630867e-02 +-2.327563993447e-02 -2.097320896137e-02 -1.865476190813e-02 -1.632333399337e-02 +-1.398196329553e-02 -1.163368692469e-02 -9.281537210775e-03 -6.928537913070e-03 +-4.577700455416e-03 -2.232020191838e-03 1.055272929233e-04 2.431989843527e-03 +4.744442350352e-03 7.039990317716e-03 9.315773379721e-03 1.156896875954e-02 +1.379679466805e-02 1.599651363785e-02 1.816543578862e-02 2.030092202019e-02 +2.240038712946e-02 2.446130284760e-02 2.648120079414e-02 2.845767534433e-02 +3.038838640685e-02 3.227106210840e-02 3.410350138237e-02 3.588357645862e-02 +3.760923525171e-02 3.927850364479e-02 4.088948766690e-02 4.244037556115e-02 +4.392943974174e-02 4.535503863768e-02 4.671561842131e-02 4.800971462001e-02 +4.923595360928e-02 5.039305398596e-02 5.147982782019e-02 5.249518178498e-02 +5.343811816249e-02 5.430773572606e-02 5.510323049754e-02 5.582389637918e-02 +5.646912565992e-02 5.703840939578e-02 5.753133766442e-02 5.794759969388e-02 +5.828698386590e-02 5.854937759416e-02 5.873476707813e-02 5.884323693321e-02 +5.887496969808e-02 5.883024522034e-02 5.870943992158e-02 5.851302594329e-02 +5.824157017513e-02 5.789573316698e-02 5.747626792690e-02 5.698401860662e-02 +5.641991907667e-02 5.578499139343e-02 5.508034416032e-02 5.430717078558e-02 +5.346674763916e-02 5.256043211145e-02 5.158966057661e-02 5.055594626341e-02 +4.946087703648e-02 4.830611309131e-02 4.709338456586e-02 4.582448907248e-02 +4.450128915314e-02 4.312570966174e-02 4.169973507682e-02 4.022540674857e-02 +3.870482008348e-02 3.714012167076e-02 3.553350635409e-02 3.388721425273e-02 +3.220352773586e-02 3.048476835413e-02 2.873329373248e-02 2.695149442828e-02 +2.514179075879e-02 2.330662960220e-02 2.144848117626e-02 1.956983579870e-02 +1.767320063363e-02 1.576109642796e-02 1.383605424216e-02 1.190061217943e-02 +9.957312117337e-03 8.008696446310e-03 6.057304818763e-03 4.105670913186e-03 +2.156319217133e-03 2.117618331311e-04 -1.725504688503e-03 -3.653002486023e-03 +-5.568275487930e-03 -7.468892476130e-03 -9.352450106845e-03 -1.121657588556e-02 +-1.305893109241e-02 -1.487721365444e-02 -1.666916096130e-02 -1.843255262097e-02 +-2.016521315220e-02 -2.186501461049e-02 -2.352987914451e-02 -2.515778147985e-02 +-2.674675132734e-02 -2.829487571296e-02 -2.980030122677e-02 -3.126123618819e-02 +-3.267595272522e-02 -3.404278876514e-02 -3.536014993456e-02 -3.662651136660e-02 +-3.784041941333e-02 -3.900049326142e-02 -4.010542644944e-02 -4.115398828509e-02 +-4.214502516090e-02 -4.307746176710e-02 -4.395030220038e-02 -4.476263096751e-02 +-4.551361388285e-02 -4.620249885901e-02 -4.682861658991e-02 -4.739138112576e-02 +-4.789029033958e-02 -4.832492628501e-02 -4.869495544526e-02 -4.900012887330e-02 +-4.924028222339e-02 -4.941533567430e-02 -4.952529374462e-02 -4.957024500079e-02 +-4.955036165852e-02 -4.946589907844e-02 -4.931719515703e-02 -4.910466961379e-02 +-4.882882317603e-02 -4.849023666264e-02 -4.808956996814e-02 -4.762756094888e-02 +-4.710502421290e-02 -4.652284981543e-02 -4.588200186193e-02 -4.518351702076e-02 +-4.442850294764e-02 -4.361813662421e-02 -4.275366261309e-02 -4.183639123185e-02 +-4.086769664858e-02 -3.984901490169e-02 -3.878184184664e-02 -3.766773103258e-02 +-3.650829151167e-02 -3.530518558430e-02 -3.406012648303e-02 -3.277487599862e-02 +-3.145124205122e-02 -3.009107621011e-02 -2.869627116519e-02 -2.726875815371e-02 +-2.581050434560e-02 -2.432351019094e-02 -2.280980673299e-02 -2.127145289039e-02 +-1.971053271207e-02 -1.812915260851e-02 -1.652943856288e-02 -1.491353332576e-02 +-1.328359359712e-02 -1.164178719905e-02 -9.990290243072e-03 -8.331284295577e-03 +-6.666953545004e-03 -4.999481974467e-03 -3.331050543370e-03 -1.663834381623e-03 +-2.402669613501e-15 1.658297479800e-03 3.308917071970e-03 4.949734646731e-03 +6.578645620480e-03 + L N + 2 6 +0.000000000000e+00 1.158449378149e-04 4.632072063712e-04 1.041569421646e-03 +1.850070109012e-03 2.887504951114e-03 4.152328531462e-03 5.642656572161e-03 +7.356268662149e-03 9.290611471778e-03 1.144280244932e-02 1.380963399377e-02 +1.638757809772e-02 1.917279145369e-02 2.216112101614e-02 2.534811001120e-02 +2.872900438505e-02 3.229875968163e-02 3.605204833944e-02 3.998326739671e-02 +4.408654659363e-02 4.835575685968e-02 5.278451917357e-02 5.736621378273e-02 +6.209398976888e-02 6.696077494550e-02 7.195928607265e-02 7.708203937428e-02 +8.232136134232e-02 8.766939981191e-02 9.311813529135e-02 9.865939253019e-02 +1.042848523085e-01 1.099860634300e-01 1.157544549012e-01 1.215813482797e-01 +1.274579701716e-01 1.333754648620e-01 1.393249070584e-01 1.452973147290e-01 +1.512836620174e-01 1.572748922140e-01 1.632619307658e-01 1.692356983058e-01 +1.751871236816e-01 1.811071569663e-01 1.869867824310e-01 1.928170314606e-01 +1.985889953941e-01 2.042938382712e-01 2.099228094656e-01 2.154672561873e-01 +2.209186358363e-01 2.262685281881e-01 2.315086473959e-01 2.366308537893e-01 +2.416271654543e-01 2.464897695783e-01 2.512110335412e-01 2.557835157396e-01 +2.601999761268e-01 2.644533864541e-01 2.685369401979e-01 2.724440621603e-01 +2.761684177267e-01 2.797039217702e-01 2.830447471879e-01 2.861853330583e-01 +2.891203924071e-01 2.918449195724e-01 2.943541971564e-01 2.966438025567e-01 +2.987096140655e-01 3.005478165298e-01 3.021549065652e-01 3.035276973145e-01 +3.046633227465e-01 3.055592414877e-01 3.062132401832e-01 3.066234363819e-01 +3.067882809417e-01 3.067065599532e-01 3.063773961785e-01 3.058002500042e-01 +3.049749199075e-01 3.039015424360e-01 3.025805917007e-01 3.010128783852e-01 +2.991995482717e-01 2.971420802874e-01 2.948422840751e-01 2.923022970908e-01 +2.895245812357e-01 2.865119190253e-01 2.832674093043e-01 2.797944625130e-01 +2.760967955125e-01 2.721784259784e-01 2.680436663704e-01 2.636971174878e-01 +2.591436616213e-01 2.543884553110e-01 2.494369217232e-01 2.442947426555e-01 +2.389678501851e-01 2.334624179713e-01 2.277848522262e-01 2.219417823669e-01 +2.159400513646e-01 2.097867058034e-01 2.034889856661e-01 1.970543138596e-01 +1.904902854990e-01 1.838046569639e-01 1.770053347441e-01 1.701003640922e-01 +1.630979174991e-01 1.560062830099e-01 1.488338523982e-01 1.415891092149e-01 +1.342806167313e-01 1.269170057925e-01 1.195069625999e-01 1.120592164414e-01 +1.045825273864e-01 9.708567396355e-02 8.957744084060e-02 8.206660652352e-02 +7.456193109275e-02 6.707214399493e-02 5.960593190768e-02 5.217192669509e-02 +4.477869347138e-02 3.743471878998e-02 3.014839897518e-02 2.292802861292e-02 +1.578178921756e-02 8.717738090536e-03 1.743797387035e-03 -5.132256593808e-03 +-1.190280388006e-02 -1.856039104457e-02 -2.509774115471e-02 -3.150776344014e-02 +-3.778356266528e-02 -4.391844819326e-02 -4.990594272891e-02 -5.573979072874e-02 +-6.141396646626e-02 -6.692268174186e-02 -7.226039322664e-02 -7.742180943043e-02 +-8.240189728471e-02 -8.719588833174e-02 -9.179928451186e-02 -9.620786354151e-02 +-1.004176838751e-01 -1.044250892447e-01 -1.082267127718e-01 -1.118194806463e-01 +-1.152006153691e-01 -1.183676385534e-01 -1.213183732835e-01 -1.240509460273e-01 +-1.265637881026e-01 -1.288556366940e-01 -1.309255354236e-01 -1.327728344720e-01 +-1.343971902544e-01 -1.357985646509e-01 -1.369772237950e-01 -1.379337364231e-01 +-1.386689717884e-01 -1.391840971439e-01 -1.394805747999e-01 -1.395601587609e-01 +-1.394248909492e-01 -1.390770970207e-01 -1.385193817826e-01 -1.377546242179e-01 +-1.367859721294e-01 -1.356168364080e-01 -1.342508849388e-01 -1.326920361532e-01 +-1.309444522377e-01 -1.290125320121e-01 -1.269009034870e-01 -1.246144161144e-01 +-1.221581327425e-01 -1.195373212894e-01 -1.167574461467e-01 -1.138241593296e-01 +-1.107432913851e-01 -1.075208420744e-01 -1.041629708430e-01 -1.006759870946e-01 +-9.706634028308e-02 -9.334060983866e-02 -8.950549494349e-02 -8.556780417290e-02 +-8.153444501805e-02 -7.741241330612e-02 -7.320878253450e-02 -6.893069313497e-02 +-6.458534168457e-02 -6.017997007931e-02 -5.572185468727e-02 -5.121829549741e-02 +-4.667660528048e-02 -4.210409877825e-02 -3.750808193722e-02 -3.289584120295e-02 +-2.827463289080e-02 -2.365167264895e-02 -1.903412502911e-02 -1.442909318035e-02 +-9.843608681133e-03 -5.284621524332e-03 -7.589902698312e-04 3.726527621051e-03 +8.165285255404e-03 1.255075556925e-02 1.687654036556e-02 2.113637911688e-02 +2.532415752022e-02 2.943391579212e-02 3.345985669244e-02 3.739635326564e-02 +4.123795628897e-02 4.497940141745e-02 4.861561601591e-02 5.214172566905e-02 +5.555306036077e-02 5.884516031483e-02 6.201378148917e-02 6.505490071711e-02 +6.796472048876e-02 7.073967336707e-02 7.337642603310e-02 7.587188295594e-02 +7.822318968311e-02 8.042773574815e-02 8.248315719229e-02 8.438733869820e-02 +8.613841533394e-02 8.773477390620e-02 8.917505392232e-02 9.045814816127e-02 +9.158320285438e-02 9.254961747711e-02 9.335704415391e-02 9.400538667863e-02 +9.449479915370e-02 9.482568425169e-02 9.499869110366e-02 9.501471281903e-02 +9.487488364239e-02 9.458057575324e-02 9.413339571510e-02 9.353518058094e-02 +9.278799366247e-02 9.189411997126e-02 9.085606134019e-02 8.967653123410e-02 +8.835844925907e-02 8.690493538012e-02 8.531930385757e-02 8.360505691270e-02 +8.176587813370e-02 7.980562563325e-02 7.772832496954e-02 7.553816184269e-02 +7.323947457889e-02 7.083674641501e-02 6.833459759641e-02 6.573777730123e-02 +6.305115540435e-02 6.027971409480e-02 5.742853936005e-02 5.450281235135e-02 +5.150780064392e-02 4.844884940628e-02 4.533137249275e-02 4.216084347362e-02 +3.894278661706e-02 3.568276783738e-02 3.238638562369e-02 2.905926196354e-02 +2.570703327558e-02 2.233534136558e-02 1.894982441988e-02 1.555610805018e-02 +1.215979640360e-02 8.766463351712e-03 5.381643771999e-03 2.010824935074e-03 +-1.340561989201e-03 -4.667150293877e-03 -7.963645952750e-03 -1.122483568154e-02 +-1.444559483040e-02 -1.762089509599e-02 -2.074581204182e-02 -2.381553241579e-02 +-2.682536125416e-02 -2.977072876185e-02 -3.264719695903e-02 -3.545046608454e-02 +-3.817638074709e-02 -4.082093581567e-02 -4.338028204082e-02 -4.585073139923e-02 +-4.822876215434e-02 -5.051102362607e-02 -5.269434066359e-02 -5.477571781513e-02 +-5.675234318974e-02 -5.862159200606e-02 -6.038102982396e-02 -6.202841545521e-02 +-6.356170355011e-02 -6.497904685724e-02 -6.627879815424e-02 -6.745951184806e-02 +-6.851994524352e-02 -6.945905947958e-02 -7.027602013348e-02 -7.097019749301e-02 +-7.154116649818e-02 -7.198870635366e-02 -7.231279981420e-02 -7.251363214552e-02 +-7.259158976385e-02 -7.254725855772e-02 -7.238142189594e-02 -7.209505832662e-02 +-7.168933897204e-02 -7.116562462502e-02 -7.052546255272e-02 -6.977058301437e-02 +-6.890289549963e-02 -6.792448469504e-02 -6.683760618612e-02 -6.564468190324e-02 +-6.434829531971e-02 -6.295118641090e-02 -6.145624638359e-02 -5.986651218503e-02 +-5.818516080152e-02 -5.641550335661e-02 -5.456097901941e-02 -5.262514873357e-02 +-5.061168877784e-02 -4.852438416946e-02 -4.636712192160e-02 -4.414388416646e-02 +-4.185874115570e-02 -3.951584415008e-02 -3.711941821030e-02 -3.467375490113e-02 +-3.218320492099e-02 -2.965217066937e-02 -2.708509876424e-02 -2.448647252192e-02 +-2.186080441173e-02 -1.921262849779e-02 -1.654649288024e-02 -1.386695214826e-02 +-1.117855985699e-02 -8.485861040583e-03 -5.793384773283e-03 -3.105636790551e-03 +-4.270921818921e-04 2.237811832983e-03 4.884683033275e-03 7.509181220273e-03 +1.010702512361e-02 1.267399917983e-02 1.520596017277e-02 1.769884372549e-02 +2.014867063378e-02 2.255155303169e-02 2.490370037951e-02 2.720142526540e-02 +2.944114901179e-02 3.161940707838e-02 3.373285425359e-02 3.577826962697e-02 +3.775256133536e-02 3.965277107591e-02 4.147607837955e-02 4.321980463900e-02 +4.488141688568e-02 4.645853131032e-02 4.794891652270e-02 4.935049654612e-02 +5.066135354291e-02 5.187973026750e-02 5.300403224421e-02 5.403282966737e-02 +5.496485902165e-02 5.579902442126e-02 5.653439866677e-02 5.717022401920e-02 +5.770591269104e-02 5.814104705468e-02 5.847537956906e-02 5.870883242566e-02 +5.884149691575e-02 5.887363252092e-02 5.880566572958e-02 5.863818858240e-02 +5.837195695027e-02 5.800788854867e-02 5.754706069270e-02 5.699070779760e-02 +5.634021862982e-02 5.559713331426e-02 5.476314010346e-02 5.384007191516e-02 +5.282990264466e-02 5.173474325923e-02 5.055683768156e-02 4.929855847020e-02 +4.796240230460e-02 4.655098528325e-02 4.506703804324e-02 4.351340071010e-02 +4.189301768686e-02 4.020893229156e-02 3.846428125282e-02 3.666228907290e-02 +3.480626226818e-02 3.289958349719e-02 3.094570558604e-02 2.894814546188e-02 +2.691047800448e-02 2.483632982661e-02 2.272937299373e-02 2.059331869362e-02 +1.843191086655e-02 1.624891980689e-02 1.404813574665e-02 1.183336243172e-02 +9.608410701586e-03 7.377092082996e-03 5.143212408206e-03 2.910565468323e-03 +6.829267120771e-04 -1.535952999666e-03 -3.742353573516e-03 -5.932591787285e-03 +-8.103027308005e-03 -1.025006861455e-02 -1.237017881542e-02 -1.445988135238e-02 +-1.651576558100e-02 -1.853449221918e-02 -2.051279865517e-02 -2.244750410684e-02 +-2.433551462404e-02 -2.617382792650e-02 -2.795953806972e-02 -2.968983993177e-02 +-3.136203351423e-02 -3.297352805078e-02 -3.452184591733e-02 -3.600462633794e-02 +-3.741962888111e-02 -3.876473674135e-02 -4.003795980148e-02 -4.123743747123e-02 +-4.236144129837e-02 -4.340837734873e-02 -4.437678835212e-02 -4.526535561139e-02 +-4.607290067221e-02 -4.679838675192e-02 -4.744091992563e-02 -4.799975006878e-02 +-4.847427155521e-02 -4.886402371075e-02 -4.916869102217e-02 -4.938810310223e-02 +-4.952223441176e-02 -4.957120373998e-02 -4.953527344494e-02 -4.941484845619e-02 +-4.921047504213e-02 -4.892283934503e-02 -4.855276568695e-02 -4.810121465025e-02 +-4.756928093668e-02 -4.695819100941e-02 -4.626930052278e-02 -4.550409154471e-02 +-4.466416957733e-02 -4.375126038127e-02 -4.276720660994e-02 -4.171396425980e-02 +-4.059359894342e-02 -3.940828199207e-02 -3.816028639507e-02 -3.685198258314e-02 +-3.548583406348e-02 -3.406439291435e-02 -3.259029514718e-02 -3.106625594443e-02 +-2.949506478171e-02 -2.787958044259e-02 -2.622272593490e-02 -2.452748331740e-02 +-2.279688844578e-02 -2.103402564700e-02 -1.924202233133e-02 -1.742404355109e-02 +-1.558328651563e-02 -1.372297507176e-02 -1.184635415898e-02 -9.956684249067e-03 +-8.057235779192e-03 -6.151283588064e-03 -4.242101364374e-03 -2.332956116824e-03 +-4.271026749379e-04 1.472221770211e-03 3.361803076335e-03 5.238455502416e-03 +7.099026994534e-03 8.940404396417e-03 1.075951857619e-02 1.255334946101e-02 +1.431893097146e-02 1.605335584770e-02 1.775378035967e-02 1.941742889385e-02 +2.104159840920e-02 2.262366275530e-02 2.416107684589e-02 2.565138068120e-02 +2.709220321295e-02 2.848126604591e-02 2.981638697042e-02 3.109548332051e-02 +3.231657515238e-02 3.347778823884e-02 3.457735687481e-02 3.561362649026e-02 +3.658505606648e-02 3.749022035241e-02 3.832781187797e-02 3.909664276163e-02 +3.979564630983e-02 4.042387840633e-02 4.098051868971e-02 4.146487151789e-02 +4.187636671855e-02 4.221456012506e-02 4.247913389767e-02 4.266989662998e-02 +4.278678324145e-02 4.282985465662e-02 4.279929727237e-02 4.269542221476e-02 +4.251866438748e-02 4.226958131403e-02 4.194885177638e-02 4.155727425296e-02 +4.109576515940e-02 4.056535689547e-02 3.996719570215e-02 3.930253933322e-02 +3.857275454567e-02 3.777931441390e-02 3.692379547270e-02 3.600787469448e-02 +3.503332630624e-02 3.400201845236e-02 3.291590970911e-02 3.177704545739e-02 +3.058755412020e-02 2.934964327168e-02 2.806559562458e-02 2.673776490353e-02 +2.536857161114e-02 2.396049869471e-02 2.251608712102e-02 2.103793136695e-02 +1.952867483397e-02 1.799100519427e-02 1.642764967678e-02 1.484137030113e-02 +1.323495906788e-02 1.161123311312e-02 9.973029835915e-03 8.323202006782e-03 +6.664612865637e-03 5.000131217437e-03 3.332626533897e-03 1.664964069491e-03 +-8.290763950186e-15 -1.659423408319e-03 -3.310482590678e-03 -4.950377429127e-03 +-6.576335943163e-03 + L N + 2 7 +0.000000000000e+00 1.469077281085e-04 5.873534289921e-04 1.320505160705e-03 +2.344978051437e-03 3.658836841987e-03 5.259599439583e-03 7.144241475153e-03 +9.309201856310e-03 1.175038930510e-02 1.446318986865e-02 1.744247538855e-02 +2.068261291309e-02 2.417747503490e-02 2.792045113452e-02 3.190445950907e-02 +3.612196036317e-02 4.056496963804e-02 4.522507365283e-02 5.009344453085e-02 +5.516085638201e-02 6.041770221118e-02 6.585401152093e-02 7.145946857587e-02 +7.722343129452e-02 8.313495073344e-02 8.918279112741e-02 9.535545044823e-02 +1.016411814439e-01 1.080280131193e-01 1.145037726172e-01 1.210561074614e-01 +1.276725081175e-01 1.343403308319e-01 1.410468207053e-01 1.477791349581e-01 +1.545243663455e-01 1.612695666768e-01 1.680017703972e-01 1.747080181883e-01 +1.813753805420e-01 1.879909812661e-01 1.945420208775e-01 2.010157998388e-01 +2.073997415975e-01 2.136814153829e-01 2.198485587212e-01 2.258890996255e-01 +2.317911784205e-01 2.375431691623e-01 2.431337006137e-01 2.485516767361e-01 +2.537862966618e-01 2.588270741088e-01 2.636638562041e-01 2.682868416798e-01 +2.726865984108e-01 2.768540802606e-01 2.807806432055e-01 2.844580607093e-01 +2.878785383179e-01 2.910347274517e-01 2.939197383675e-01 2.965271522693e-01 +2.988510325455e-01 3.008859351137e-01 3.026269178534e-01 3.040695491129e-01 +3.052099152728e-01 3.060446273565e-01 3.065708266738e-01 3.067861894905e-01 +3.066889307167e-01 3.062778066061e-01 3.055521164664e-01 3.045117033749e-01 +3.031569539037e-01 3.014887968528e-01 2.995087009974e-01 2.972186718536e-01 +2.946212474720e-01 2.917194932652e-01 2.885169958845e-01 2.850178561553e-01 +2.812266810873e-01 2.771485749762e-01 2.727891296141e-01 2.681544136287e-01 +2.632509609724e-01 2.580857585848e-01 2.526662332517e-01 2.470002376878e-01 +2.410960358693e-01 2.349622876458e-01 2.286080326604e-01 2.220426736104e-01 +2.152759588798e-01 2.083179645781e-01 2.011790760183e-01 1.938699686717e-01 +1.864015886344e-01 1.787851326427e-01 1.710320276768e-01 1.631539101899e-01 +1.551626050028e-01 1.470701039044e-01 1.388885439972e-01 1.306301858302e-01 +1.223073913581e-01 1.139326017712e-01 1.055183152335e-01 9.707706457492e-02 +8.862139497538e-02 8.016384168477e-02 7.171690781892e-02 6.329304227300e-02 +5.490461779312e-02 4.656390924647e-02 3.828307212992e-02 3.007412135648e-02 +2.194891035837e-02 1.391911054470e-02 5.996191151141e-03 -1.808600481890e-03 +-9.484258167120e-03 -1.702003562959e-02 -2.440546473363e-02 -3.163037314506e-02 +-3.868490139734e-02 -4.555951933149e-02 -5.224504188083e-02 -5.873264417311e-02 +-6.501387592367e-02 -7.108067509496e-02 -7.692538079896e-02 -8.254074542075e-02 +-8.791994594282e-02 -9.305659445147e-02 -9.794474780801e-02 -1.025789164694e-01 +-1.069540724446e-01 -1.110656563734e-01 -1.149095837193e-01 -1.184822500658e-01 +-1.217805355092e-01 -1.248018081440e-01 -1.275439266357e-01 -1.300052418806e-01 +-1.321845977508e-01 -1.340813309275e-01 -1.356952698260e-01 -1.370267326157e-01 +-1.380765243446e-01 -1.388459331740e-01 -1.393367257360e-01 -1.395511416236e-01 +-1.394918870281e-01 -1.391621275383e-01 -1.385654801181e-01 -1.377060042802e-01 +-1.365881924762e-01 -1.352169597232e-01 -1.335976324900e-01 -1.317359368659e-01 +-1.296379860378e-01 -1.273102671008e-01 -1.247596272310e-01 -1.219932592482e-01 +-1.190186865980e-01 -1.158437477845e-01 -1.124765802849e-01 -1.089256039783e-01 +-1.051995041218e-01 -1.013072139095e-01 -9.725789664597e-02 -9.306092757320e-02 +-8.872587538403e-02 -8.426248345993e-02 -7.968065086945e-02 -7.499041316440e-02 +-7.020192301119e-02 -6.532543069481e-02 -6.037126453315e-02 -5.534981123928e-02 +-5.027149626938e-02 -4.514676419385e-02 -3.998605912891e-02 -3.479980526588e-02 +-2.959838753486e-02 -2.439213243917e-02 -1.919128909660e-02 -1.400601052271e-02 +-8.846335191045e-03 -3.722168904420e-03 1.356732989385e-03 6.380783004879e-03 +1.134057851732e-02 1.622691832151e-02 2.103081872114e-02 2.574352911967e-02 +3.035654708513e-02 3.486163286212e-02 3.925082330556e-02 4.351644521183e-02 +4.765112802455e-02 5.164781589304e-02 5.549977906332e-02 5.920062458253e-02 +6.274430629942e-02 6.612513414455e-02 6.933778267570e-02 7.237729887534e-02 +7.523910918842e-02 7.791902579039e-02 8.041325207693e-02 8.271838736825e-02 +8.483143082256e-02 8.674978455485e-02 8.847125595848e-02 8.999405922906e-02 +9.131681609112e-02 9.243855573027e-02 9.335871393438e-02 9.407713144950e-02 +9.459405155731e-02 9.491011688263e-02 9.502636544080e-02 9.494422593643e-02 +9.466551232619e-02 9.419241765992e-02 9.352750721548e-02 9.267371094438e-02 +9.163431524611e-02 9.041295409077e-02 8.901359951046e-02 8.744055148121e-02 +8.569842721830e-02 8.379214990894e-02 8.172693690713e-02 7.950828741665e-02 +7.714196968891e-02 7.463400776333e-02 7.199066777860e-02 6.921844388396e-02 +6.632404378032e-02 6.331437392159e-02 6.019652440715e-02 5.697775359691e-02 +5.366547248077e-02 5.026722883464e-02 4.679069119550e-02 4.324363268817e-02 +3.963391473662e-02 3.596947069273e-02 3.225828941542e-02 2.850839883311e-02 +2.472784952212e-02 2.092469833385e-02 1.710699210281e-02 1.328275146789e-02 +9.459954838185e-03 5.646522534994e-03 1.850301140472e-03 -1.920951916666e-03 +-5.659583508850e-03 -9.358059661809e-03 -1.300898008295e-02 -1.660509233848e-02 +-2.013930565269e-02 -2.360470430360e-02 -2.699456059015e-02 -3.030234734709e-02 +-3.352174998469e-02 -3.664667803149e-02 -3.967127615940e-02 -4.258993467161e-02 +-4.539729943476e-02 -4.808828123843e-02 -5.065806456571e-02 -5.310211576030e-02 +-5.541619057664e-02 -5.759634110094e-02 -5.963892203234e-02 -6.154059631460e-02 +-6.329834011036e-02 -6.490944711108e-02 -6.637153217736e-02 -6.768253430551e-02 +-6.884071891787e-02 -6.984467947550e-02 -7.069333841342e-02 -7.138594739991e-02 +-7.192208692260e-02 -7.230166520569e-02 -7.252491646371e-02 -7.259239849874e-02 +-7.250498964925e-02 -7.226388509986e-02 -7.187059256291e-02 -7.132692734353e-02 +-7.063500680147e-02 -6.979724422389e-02 -6.881634212452e-02 -6.769528498567e-02 +-6.643733146074e-02 -6.504600605567e-02 -6.352509030898e-02 -6.187861349086e-02 +-6.011084284264e-02 -5.822627337901e-02 -5.622961727571e-02 -5.412579286672e-02 +-5.191991327530e-02 -4.961727470382e-02 -4.722334440823e-02 -4.474374838328e-02 +-4.218425878511e-02 -3.955078111839e-02 -3.684934121531e-02 -3.408607203436e-02 +-3.126720030668e-02 -2.839903305828e-02 -2.548794403649e-02 -2.254036006878e-02 +-1.956274738266e-02 -1.656159791469e-02 -1.354341563710e-02 -1.051470292991e-02 +-7.481947026484e-03 -4.451606560117e-03 -1.430098238890e-03 1.576216324357e-03 +4.561043600468e-03 7.518170924900e-03 1.044147904573e-02 1.332495441396e-02 +1.616270119189e-02 1.894895295610e-02 2.167808407238e-02 2.434462072042e-02 +2.694325154733e-02 2.946883792955e-02 3.191642382379e-02 3.428124518852e-02 +3.655873895850e-02 3.874455155588e-02 4.083454692234e-02 4.282481405790e-02 +4.471167405300e-02 4.649168660169e-02 4.816165598479e-02 4.971863651304e-02 +5.115993742146e-02 5.248312720725e-02 5.368603740490e-02 5.476676579313e-02 +5.572367902963e-02 5.655541471085e-02 5.726088285508e-02 5.783926680844e-02 +5.829002357453e-02 5.861288356966e-02 5.880784980680e-02 5.887519651265e-02 +5.881546718310e-02 5.862947208385e-02 5.831828520389e-02 5.788324067062e-02 +5.732592863653e-02 5.664819064849e-02 5.585211451158e-02 5.494002866046e-02 +5.391449605229e-02 5.277830759611e-02 5.153447513440e-02 5.018622399365e-02 +4.873698512129e-02 4.719038682738e-02 4.555024615001e-02 4.382055986426e-02 +4.200549515500e-02 4.010937997467e-02 3.813669310747e-02 3.609205396226e-02 +3.398021211664e-02 3.180603663516e-02 2.957450518526e-02 2.729069297434e-02 +2.495976153231e-02 2.258694736345e-02 2.017755049231e-02 1.773692292786e-02 +1.527045707069e-02 1.278357408768e-02 1.028171227885e-02 7.770315460692e-03 +5.254821390476e-03 2.740650255607e-03 2.331932519382e-04 -2.262198725284e-03 +-4.740226254575e-03 -7.195652402534e-03 -9.623313556838e-03 -1.201813005590e-02 +-1.437511659366e-02 -1.668939237858e-02 -1.895619102653e-02 -2.117087016772e-02 +-2.332892074888e-02 -2.542597601217e-02 -2.745782013337e-02 -2.942039650251e-02 +-3.130981563110e-02 -3.312236267077e-02 -3.485450452901e-02 -3.650289656895e-02 +-3.806438888046e-02 -3.953603211141e-02 -4.091508284839e-02 -4.219900853757e-02 +-4.338549193713e-02 -4.447243509383e-02 -4.545796283729e-02 -4.634042578657e-02 +-4.711840286474e-02 -4.779070331816e-02 -4.835636823817e-02 -4.881467158413e-02 +-4.916512070757e-02 -4.940745637847e-02 -4.954165231564e-02 -4.956791422416e-02 +-4.948667834399e-02 -4.929860951478e-02 -4.900459876297e-02 -4.860576041812e-02 +-4.810342876670e-02 -4.749915425206e-02 -4.679469923055e-02 -4.599203329469e-02 +-4.509332817483e-02 -4.410095223194e-02 -4.301746455484e-02 -4.184560867586e-02 +-4.058830591992e-02 -3.924864840252e-02 -3.782989169286e-02 -3.633544715909e-02 +-3.476887401313e-02 -3.313387107305e-02 -3.143426826184e-02 -2.967401786142e-02 +-2.785718554155e-02 -2.598794118356e-02 -2.407054951920e-02 -2.210936060516e-02 +-2.010880015427e-02 -1.807335974430e-02 -1.600758692586e-02 -1.391607525066e-02 +-1.180345424164e-02 -9.674379326701e-03 -7.533521757299e-03 -5.385558533686e-03 +-3.235162357996e-03 -1.086991636544e-03 1.054319447608e-03 3.184170770956e-03 +5.298005994152e-03 7.391322154623e-03 9.459679107286e-03 1.149870879385e-02 +1.350412432159e-02 1.547172883307e-02 1.739742414856e-02 1.927721916380e-02 +2.110723798592e-02 2.288372779141e-02 2.460306639022e-02 2.626176948115e-02 +2.785649758408e-02 2.938406263563e-02 3.084143423534e-02 3.222574553030e-02 +3.353429872728e-02 3.476457022169e-02 3.591421533407e-02 3.698107264539e-02 +3.796316792334e-02 3.885871763293e-02 3.966613202524e-02 4.038401779937e-02 +4.101118033356e-02 4.154662548216e-02 4.198956093638e-02 4.233939714728e-02 +4.259574781094e-02 4.275842991611e-02 4.282746335595e-02 4.280307010634e-02 +4.268567297399e-02 4.247589391862e-02 4.217455195441e-02 4.178266063662e-02 +4.130142514038e-02 4.073223893931e-02 4.007668009244e-02 3.933650714897e-02 +3.851365468085e-02 3.761022845408e-02 3.662850025054e-02 3.557090235235e-02 +3.444002170214e-02 3.323859375264e-02 3.196949601988e-02 3.063574135499e-02 +2.924047094993e-02 2.778694709296e-02 2.627854569045e-02 2.471874857175e-02 +2.311113559434e-02 2.145937656704e-02 1.976722300894e-02 1.803849976264e-02 +1.627709647992e-02 1.448695899886e-02 1.267208063096e-02 1.083649337755e-02 +8.984259094307e-03 7.119460623156e-03 5.246192910636e-03 3.368554131809e-03 +1.490636838737e-03 -3.834808475741e-04 -2.249743983023e-03 -4.104129465518e-03 +-5.942654601015e-03 -7.761385552468e-03 -9.556445653953e-03 -1.132402357260e-02 +-1.306038130132e-02 -1.476186196578e-02 -1.642489742950e-02 -1.804601568136e-02 +-1.962184799059e-02 -2.114913581438e-02 -2.262473744444e-02 -2.404563437887e-02 +-2.540893740670e-02 -2.671189239304e-02 -2.795188575326e-02 -2.912644960572e-02 +-3.023326659285e-02 -3.127017436145e-02 -3.223516969377e-02 -3.312641228142e-02 +-3.394222813561e-02 -3.468111262711e-02 -3.534173315109e-02 -3.592293141203e-02 +-3.642372532519e-02 -3.684331053186e-02 -3.718106152629e-02 -3.743653239329e-02 +-3.760945715608e-02 -3.769974973505e-02 -3.770750351867e-02 -3.763299054886e-02 +-3.747666032380e-02 -3.723913822194e-02 -3.692122355201e-02 -3.652388723420e-02 +-3.604826911899e-02 -3.549567495034e-02 -3.486757298104e-02 -3.416559024867e-02 +-3.339150852121e-02 -3.254725992210e-02 -3.163492224531e-02 -3.065671397135e-02 +-2.961498899606e-02 -2.851223108433e-02 -2.735104806176e-02 -2.613416575733e-02 +-2.486442171123e-02 -2.354475866194e-02 -2.217821782737e-02 -2.076793199522e-02 +-1.931711843802e-02 -1.782907166866e-02 -1.630715605253e-02 -1.475479829273e-02 +-1.317547980480e-02 -1.157272899787e-02 -9.950113479126e-03 -8.311232198628e-03 +-6.659707551603e-03 -4.999177455396e-03 -3.333287418206e-03 -1.665682616765e-03 +6.108646977042e-15 1.660139564409e-03 3.311139083646e-03 4.949433157140e-03 +6.571495601099e-03 + L N + 2 8 +0.000000000000e+00 1.816222897676e-04 7.260650407621e-04 1.632056859352e-03 +2.897481963991e-03 4.519384988048e-03 6.493977688712e-03 8.816647546195e-03 +1.148196823317e-02 1.448371193045e-02 1.781486346025e-02 2.146763620464e-02 +2.543348977210e-02 2.970314937161e-02 3.426662684946e-02 3.911324334017e-02 +4.423165347922e-02 4.960987112178e-02 5.523529650800e-02 6.109474481226e-02 +6.717447601048e-02 7.346022599663e-02 7.993723887676e-02 8.659030036608e-02 +9.340377221213e-02 1.003616275650e-01 1.074474872126e-01 1.146446565987e-01 +1.219361635373e-01 1.293047965375e-01 1.367331436507e-01 1.442036317510e-01 +1.516985661577e-01 1.592001705108e-01 1.666906268068e-01 1.741521155030e-01 +1.815668555997e-01 1.889171446072e-01 1.961853983078e-01 2.033541902202e-01 +2.104062906784e-01 2.173247054343e-01 2.240927136971e-01 2.306939055224e-01 +2.371122184676e-01 2.433319734278e-01 2.493379095743e-01 2.551152183140e-01 +2.606495761948e-01 2.659271766822e-01 2.709347607358e-01 2.756596461173e-01 +2.800897553645e-01 2.842136423684e-01 2.880205174954e-01 2.915002711977e-01 +2.946434960612e-01 2.974415072413e-01 2.998863612427e-01 3.019708730029e-01 +3.036886312414e-01 3.050340120434e-01 3.060021906490e-01 3.065891514228e-01 +3.067916959852e-01 3.066074494887e-01 3.060348650283e-01 3.050732261781e-01 +3.037226476526e-01 3.019840740932e-01 2.998592769860e-01 2.973508497219e-01 +2.944622008127e-01 2.911975452825e-01 2.875618942573e-01 2.835610427792e-01 +2.792015558782e-01 2.744907529345e-01 2.694366903727e-01 2.640481427281e-01 +2.583345821348e-01 2.523061562833e-01 2.459736649015e-01 2.393485348183e-01 +2.324427936662e-01 2.252690422894e-01 2.178404259217e-01 2.101706042029e-01 +2.022737201060e-01 1.941643678479e-01 1.858575598602e-01 1.773686928971e-01 +1.687135133615e-01 1.599080819292e-01 1.509687375553e-01 1.419120609460e-01 +1.327548375810e-01 1.235140203738e-01 1.142066920539e-01 1.048500273610e-01 +9.546125513622e-02 8.605762039846e-02 7.665634649361e-02 6.727459740229e-02 +5.792944029313e-02 4.863780840654e-02 3.941646435367e-02 3.028196391350e-02 +2.125062041004e-02 1.233846975003e-02 3.561236199343e-03 -5.065701024999e-03 +-1.352734027291e-02 -2.180908901717e-02 -2.989679437747e-02 -3.777677254537e-02 +-4.543583704590e-02 -5.286132577412e-02 -6.004112674843e-02 -6.696370252510e-02 +-7.361811322225e-02 -7.999403810449e-02 -8.608179568331e-02 -9.187236229169e-02 +-9.735738909511e-02 -1.025292175050e-01 -1.073808929647e-01 -1.119061770811e-01 +-1.160995580804e-01 -1.199562595691e-01 -1.234722475869e-01 -1.266442359394e-01 +-1.294696898072e-01 -1.319468276265e-01 -1.340746212460e-01 -1.358527943634e-01 +-1.372818192535e-01 -1.383629118017e-01 -1.390980248599e-01 -1.394898399479e-01 +-1.395417573246e-01 -1.392578844607e-01 -1.386430229430e-01 -1.377026538498e-01 +-1.364429216354e-01 -1.348706165695e-01 -1.329931557753e-01 -1.308185629194e-01 +-1.283554466042e-01 -1.256129775195e-01 -1.226008644118e-01 -1.193293289326e-01 +-1.158090794282e-01 -1.120512837384e-01 -1.080675410706e-01 -1.038698530203e-01 +-9.947059380872e-02 -9.488247981082e-02 -9.011853844896e-02 -8.519207652742e-02 +-8.011664808468e-02 -7.490602184136e-02 -6.957414832194e-02 -6.413512672929e-02 +-5.860317165080e-02 -5.299257967560e-02 -4.731769600168e-02 -4.159288111183e-02 +-3.583247759664e-02 -3.005077720215e-02 -2.426198817900e-02 -1.848020300878e-02 +-1.271936658204e-02 -6.993244901238e-03 -1.315394380088e-03 4.300868190743e-03 +9.842494943682e-03 1.529673543405e-02 2.065116427592e-02 2.589370785255e-02 +3.101267004258e-02 3.599675690559e-02 4.083510027343e-02 4.551728019665e-02 +5.003334619826e-02 5.437383729008e-02 5.852980071023e-02 6.249280934339e-02 +6.625497778907e-02 6.980897704613e-02 7.314804778570e-02 7.626601218788e-02 +7.915728432116e-02 8.181687904745e-02 8.424041943868e-02 8.642414269519e-02 +8.836490455929e-02 9.006018222135e-02 9.150807571923e-02 9.270730783581e-02 +9.365722250242e-02 9.435778172033e-02 9.480956101519e-02 9.501374344343e-02 +9.497211217267e-02 9.468704166176e-02 9.416148746913e-02 9.339897472166e-02 +9.240358527894e-02 9.117994363127e-02 8.973320157228e-02 8.806902168994e-02 +8.619355972266e-02 8.411344582917e-02 8.183576482396e-02 7.936803543167e-02 +7.671818861659e-02 7.389454504481e-02 7.090579173892e-02 6.776095798660e-02 +6.446939056584e-02 6.104072835127e-02 5.748487636690e-02 5.381197935194e-02 +5.003239490686e-02 4.615666628805e-02 4.219549491945e-02 3.815971269027e-02 +3.406025410792e-02 2.990812837531e-02 2.571439146162e-02 2.149011823517e-02 +1.724637472661e-02 1.299419059013e-02 8.744531829237e-03 4.508273852986e-03 +2.961749272744e-04 -3.881149915498e-03 -8.013254446491e-03 -1.208988622993e-02 +-1.610101097347e-02 -2.003683618275e-02 -2.388783406540e-02 -2.764476363204e-02 +-3.129869194379e-02 -3.484101445852e-02 -3.826347443024e-02 -4.155818131877e-02 +-4.471762816948e-02 -4.773470792561e-02 -5.060272863842e-02 -5.331542754373e-02 +-5.586698397572e-02 -5.825203109266e-02 -6.046566639160e-02 -6.250346099278e-02 +-6.436146767730e-02 -6.603622766491e-02 -6.752477612201e-02 -6.882464639312e-02 +-6.993387295238e-02 -7.085099307464e-02 -7.157504722924e-02 -7.210557820247e-02 +-7.244262895797e-02 -7.258673924740e-02 -7.253894098692e-02 -7.230075241770e-02 +-7.187417107211e-02 -7.126166556964e-02 -7.046616626985e-02 -6.949105481195e-02 +-6.834015257368e-02 -6.701770808449e-02 -6.552838343030e-02 -6.387723969000e-02 +-6.206972144544e-02 -6.011164040925e-02 -5.800915821676e-02 -5.576876842981e-02 +-5.339727780257e-02 -5.090178686060e-02 -4.828966984605e-02 -4.556855408335e-02 +-4.274629882071e-02 -3.983097360395e-02 -3.683083624003e-02 -3.375431040840e-02 +-3.060996297894e-02 -2.740648109560e-02 -2.415264908530e-02 -2.085732525166e-02 +-1.752941861326e-02 -1.417786564581e-02 -1.081160708746e-02 -7.439564866003e-03 +-4.070619205987e-03 -7.135859732106e-04 2.622805686953e-03 5.929935361925e-03 +9.199312980668e-03 1.242259996581e-02 1.559162987751e-02 1.869842849911e-02 +2.173523331604e-02 2.469451234151e-02 2.756898224422e-02 3.035162573535e-02 +3.303570817425e-02 3.561479335437e-02 3.808275843334e-02 4.043380797323e-02 +4.266248705992e-02 4.476369347245e-02 4.673268887618e-02 4.856510901611e-02 +5.025697288934e-02 5.180469087832e-02 5.320507182949e-02 5.445532906433e-02 +5.555308531311e-02 5.649637656394e-02 5.728365482286e-02 5.791378978346e-02 +5.838606940722e-02 5.870019941863e-02 5.885630172195e-02 5.885491174902e-02 +5.869697475057e-02 5.838384104567e-02 5.791726024702e-02 5.729937448205e-02 +5.653271063232e-02 5.562017161625e-02 5.456502674237e-02 5.337090116277e-02 +5.204176445833e-02 5.058191838963e-02 4.899598384939e-02 4.728888705396e-02 +4.546584501350e-02 4.353235032190e-02 4.149415530922e-02 3.935725560067e-02 +3.712787312779e-02 3.481243863837e-02 3.241757375288e-02 2.995007261620e-02 +2.741688319407e-02 2.482508826450e-02 2.218188615501e-02 1.949457127667e-02 +1.677051450671e-02 1.401714347104e-02 1.124192277859e-02 8.452334258824e-03 +5.655857253885e-03 2.859949016168e-03 7.202526183728e-05 -2.700559069969e-03 +-5.450528803207e-03 -8.170707208110e-03 -1.085403433436e-02 -1.349358494819e-02 +-1.608258602868e-02 -1.861443377973e-02 -2.108271011576e-02 -2.348119858071e-02 +-2.580389966152e-02 -2.804504545901e-02 -3.019911368107e-02 -3.226084092472e-02 +-3.422523521586e-02 -3.608758777739e-02 -3.784348399868e-02 -3.948881358142e-02 +-4.101977983929e-02 -4.243290813094e-02 -4.372505340850e-02 -4.489340686581e-02 +-4.593550167321e-02 -4.684921778814e-02 -4.763278583322e-02 -4.828479003590e-02 +-4.880417022633e-02 -4.919022289253e-02 -4.944260129431e-02 -4.956131464010e-02 +-4.954672633286e-02 -4.939955129407e-02 -4.912085237686e-02 -4.871203588183e-02 +-4.817484619129e-02 -4.751135953999e-02 -4.672397694244e-02 -4.581541629921e-02 +-4.478870370651e-02 -4.364716399537e-02 -4.239441052864e-02 -4.103433428591e-02 +-3.957109226798e-02 -3.800909525448e-02 -3.635299494945e-02 -3.460767055138e-02 +-3.277821478540e-02 -3.086991943675e-02 -2.888826042553e-02 -2.683888246406e-02 +-2.472758333878e-02 -2.256029785980e-02 -2.034308152151e-02 -1.808209391853e-02 +-1.578358196155e-02 -1.345386293810e-02 -1.109930746339e-02 -8.726322366442e-03 +-6.341333556919e-03 -3.950768917616e-03 -1.561041267603e-03 8.214685595516e-04 +3.190428478422e-03 5.539571711839e-03 7.862713105768e-03 1.015376515704e-02 +1.240675371303e-02 1.461583330327e-02 1.677530206426e-02 1.887961621988e-02 +2.092340408113e-02 2.290147953035e-02 2.480885495661e-02 2.664075361042e-02 +2.839262134767e-02 3.006013773450e-02 3.163922648626e-02 3.312606521612e-02 +3.451709447020e-02 3.580902602862e-02 3.699885045340e-02 3.808384386657e-02 +3.906157394371e-02 3.992990511037e-02 4.068700293090e-02 4.133133768149e-02 +4.186168710125e-02 4.227713831753e-02 4.257708894362e-02 4.276124734946e-02 +4.282963210800e-02 4.278257062179e-02 4.262069693714e-02 4.234494875454e-02 +4.195656364671e-02 4.145707449743e-02 4.084830417625e-02 4.013235946636e-02 +3.931162426453e-02 3.838875207418e-02 3.736665781404e-02 3.624850896700e-02 +3.503771609510e-02 3.373792274817e-02 3.235299479545e-02 3.088700921045e-02 +2.934424234114e-02 2.772915769830e-02 2.604639329640e-02 2.430074858229e-02 +2.249717098781e-02 2.064074214350e-02 1.873666379119e-02 1.679024343397e-02 +1.480687976259e-02 1.279204789768e-02 1.075128448776e-02 8.690172702883e-03 +6.614327164212e-03 4.529378849718e-03 2.440960016003e-03 3.546891762300e-04 +-1.723843826266e-03 -3.789092609477e-03 -5.835568870624e-03 -7.857856792378e-03 +-9.850627199989e-03 -1.180865143274e-02 -1.372681489399e-02 -1.560013024515e-02 +-1.742375020984e-02 -1.919297995581e-02 -2.090328902336e-02 -2.255032277022e-02 +-2.412991330451e-02 -2.563808987852e-02 -2.707108871781e-02 -2.842536226166e-02 +-2.969758779257e-02 -3.088467543407e-02 -3.198377549807e-02 -3.299228516462e-02 +-3.390785447876e-02 -3.472839165117e-02 -3.545206765108e-02 -3.607732008177e-02 +-3.660285633117e-02 -3.702765599168e-02 -3.735097254568e-02 -3.757233431473e-02 +-3.769154467277e-02 -3.770868152547e-02 -3.762409605970e-02 -3.743841076912e-02 +-3.715251676396e-02 -3.676757037443e-02 -3.628498905967e-02 -3.570644663541e-02 +-3.503386783573e-02 -3.426942222548e-02 -3.341551748227e-02 -3.247479206786e-02 +-3.145010731083e-02 -3.034453892367e-02 -2.916136797890e-02 -2.790407137006e-02 +-2.657631178510e-02 -2.518192722021e-02 -2.372492006395e-02 -2.220944578217e-02 +-2.063980123523e-02 -1.902041265998e-02 -1.735582334967e-02 -1.565068106572e-02 +-1.390972521576e-02 -1.213777383294e-02 -1.033971039195e-02 -8.520470497345e-03 +-6.685028480247e-03 -4.838383939254e-03 -2.985548261812e-03 -1.131531161935e-03 +7.186727298842e-04 2.560097188991e-03 4.387817595918e-03 6.196963978004e-03 +7.982733859050e-03 9.740404883418e-03 1.146534718170e-02 1.315303544582e-02 +1.479906068247e-02 1.639914161451e-02 1.794913570120e-02 1.944504974918e-02 +2.088305008724e-02 2.225947227929e-02 2.357083035107e-02 2.481382550780e-02 +2.598535432110e-02 2.708251636518e-02 2.810262128379e-02 2.904319527096e-02 +2.990198695028e-02 3.067697263896e-02 3.136636098475e-02 3.196859696540e-02 +3.248236524221e-02 3.290659286073e-02 3.324045129372e-02 3.348335782306e-02 +3.363497625903e-02 3.369521699747e-02 3.366423641657e-02 3.354243561739e-02 +3.333045851338e-02 3.302918927637e-02 3.263974914783e-02 3.216349262613e-02 +3.160200304192e-02 3.095708753555e-02 3.023077145194e-02 2.942529216962e-02 +2.854309238255e-02 2.758681285422e-02 2.655928466521e-02 2.546352097668e-02 +2.430270833320e-02 2.308019752980e-02 2.179949406905e-02 2.046424823497e-02 +1.907824481156e-02 1.764539247469e-02 1.616971288658e-02 1.465532952316e-02 +1.310645626504e-02 1.152738578322e-02 9.922477751471e-03 8.296146917260e-03 +6.652851063798e-03 4.997078895596e-03 3.333337880273e-03 1.666142079259e-03 +2.389365706608e-15 -1.660597497888e-03 -3.311189210362e-03 -4.947355478647e-03 +-6.564729929525e-03 + L N + 2 9 +0.000000000000e+00 2.199878633592e-04 8.793292279647e-04 1.976159129335e-03 +3.507374991728e-03 5.468645159336e-03 7.854420806498e-03 1.065795119347e-02 +1.387130222513e-02 1.748537826075e-02 2.148994711368e-02 2.587366817106e-02 +3.062412355489e-02 3.572785223720e-02 4.117038701400e-02 4.693629423461e-02 +5.300921617524e-02 5.937191593841e-02 6.600632475287e-02 7.289359154170e-02 +8.001413462032e-02 8.734769538014e-02 9.487339380785e-02 1.025697856858e-01 +1.104149213138e-01 1.183864055887e-01 1.264614592744e-01 1.346169812922e-01 +1.428296118575e-01 1.510757962875e-01 1.593318493033e-01 1.675740196468e-01 +1.757785548339e-01 1.839217658645e-01 1.919800917091e-01 1.999301633953e-01 +2.077488675152e-01 2.154134089799e-01 2.229013728467e-01 2.301907850499e-01 +2.372601718671e-01 2.440886179582e-01 2.506558228185e-01 2.569421554894e-01 +2.629287073803e-01 2.685973430545e-01 2.739307488430e-01 2.789124791541e-01 +2.835270003525e-01 2.877597320911e-01 2.915970859835e-01 2.950265015140e-01 +2.980364790901e-01 3.006166101497e-01 3.027576042443e-01 3.044513130277e-01 +3.056907510889e-01 3.064701135762e-01 3.067847905695e-01 3.066313781658e-01 +3.060076862537e-01 3.049127429601e-01 3.033467957635e-01 3.013113092773e-01 +2.988089597136e-01 2.958436260517e-01 2.924203779398e-01 2.885454603714e-01 +2.842262751846e-01 2.794713594426e-01 2.742903607604e-01 2.686940096552e-01 +2.626940890007e-01 2.563034006781e-01 2.495357295217e-01 2.424058046661e-01 +2.349292584071e-01 2.271225826964e-01 2.190030833979e-01 2.105888324354e-01 +2.018986179717e-01 1.929518927617e-01 1.837687208269e-01 1.743697226046e-01 +1.647760187269e-01 1.550091725908e-01 1.450911318804e-01 1.350441692083e-01 +1.248908220419e-01 1.146538320850e-01 1.043560842835e-01 9.402054562715e-02 +8.367020391676e-02 7.332800666863e-02 6.301680032486e-02 5.275926993817e-02 +4.257787949767e-02 3.249481305968e-02 2.253191684506e-02 1.271064246129e-02 +3.051991403943e-03 -6.423539011990e-03 -1.569600814480e-02 -2.474608280168e-02 +-3.355508616137e-02 -4.210504471356e-02 -5.037873309104e-02 -5.835971667642e-02 +-6.603239187260e-02 -7.338202393252e-02 -8.039478225132e-02 -8.705777303152e-02 +-9.335906923935e-02 -9.928773777867e-02 -1.048338638166e-01 -1.099885722039e-01 +-1.147440459405e-01 -1.190935416471e-01 -1.230314020099e-01 -1.265530651757e-01 +-1.296550710843e-01 -1.323350647308e-01 -1.345917963635e-01 -1.364251186262e-01 +-1.378359806693e-01 -1.388264192555e-01 -1.393995469001e-01 -1.395595370904e-01 +-1.393116066394e-01 -1.386619952351e-01 -1.376179422552e-01 -1.361876609259e-01 +-1.343803099072e-01 -1.322059623985e-01 -1.296755728617e-01 -1.268009414673e-01 +-1.235946763737e-01 -1.200701539568e-01 -1.162414771124e-01 -1.121234317578e-01 +-1.077314416644e-01 -1.030815217573e-01 -9.819023002316e-02 -9.307461816620e-02 +-8.775218116234e-02 -8.224080585759e-02 -7.655871876268e-02 -7.072443319624e-02 +-6.475669593018e-02 -5.867443349193e-02 -5.249669827824e-02 -4.624261463530e-02 +-3.993132505925e-02 -3.358193667011e-02 -2.721346811084e-02 -2.084479702113e-02 +-1.449460823326e-02 -8.181342834745e-03 -1.923148239074e-03 4.262170597480e-03 +1.035719867912e-02 1.634495706419e-02 2.220894742446e-02 2.793319494990e-02 +3.350228948471e-02 3.890142478554e-02 4.411643579911e-02 4.913383386249e-02 +5.394083973606e-02 5.852541438554e-02 6.287628743675e-02 6.698298323374e-02 +7.083584443829e-02 7.442605311622e-02 7.774564926363e-02 8.078754673372e-02 +8.354554653285e-02 8.601434746216e-02 8.818955408889e-02 9.006768203980e-02 +9.164616061647e-02 9.292333274034e-02 9.389845224334e-02 9.457167852718e-02 +9.494406862238e-02 9.501756668542e-02 9.479499097973e-02 9.428001839337e-02 +9.347716655333e-02 9.239177360303e-02 9.102997571616e-02 8.939868242626e-02 +8.750554985761e-02 8.535895194856e-02 8.296794976386e-02 8.034225899804e-02 +7.749221577606e-02 7.442874086263e-02 7.116330239521e-02 6.770787725968e-02 +6.407491123093e-02 6.027727800392e-02 5.632823724291e-02 5.224139177928e-02 +4.803064408986e-02 4.371015218923e-02 3.929428507052e-02 3.479757782977e-02 +3.023468660928e-02 2.562034349494e-02 2.096931150214e-02 1.629633978397e-02 +1.161611919360e-02 6.943238331471e-03 2.292140205463e-03 -2.322920370225e-03 +-6.887918514673e-03 -1.138910003869e-02 -1.581302110610e-02 -2.014658668588e-02 +-2.437708768709e-02 -2.849223667348e-02 -3.248020205920e-02 -3.632964069210e-02 +-4.002972873681e-02 -4.357019077484e-02 -4.694132704532e-02 -5.013403875559e-02 +-5.313985139713e-02 -5.595093600899e-02 -5.856012833683e-02 -6.096094584281e-02 +-6.314760252806e-02 -6.511502153621e-02 -6.685884551357e-02 -6.837544470817e-02 +-6.966192279707e-02 -7.071612043809e-02 -7.153661654906e-02 -7.212272732468e-02 +-7.247450300756e-02 -7.259272243721e-02 -7.247888540685e-02 -7.213520286468e-02 +-7.156458500260e-02 -7.077062728145e-02 -6.975759444778e-02 -6.853040260321e-02 +-6.709459939274e-02 -6.545634238392e-02 -6.362237571384e-02 -6.160000508571e-02 +-5.939707120145e-02 -5.702192172107e-02 -5.448338184333e-02 -5.179072360620e-02 +-4.895363400890e-02 -4.598218206008e-02 -4.288678485997e-02 -3.967817282603e-02 +-3.636735417425e-02 -3.296557876942e-02 -2.948430145944e-02 -2.593514500936e-02 +-2.232986275155e-02 -1.868030106874e-02 -1.499836182640e-02 -1.129596487050e-02 +-7.585010705922e-03 -3.877343469460e-03 -1.847143100734e-04 3.481254713080e-03 +7.109106106306e-03 1.068758168479e-02 1.420565648066e-02 1.765257171565e-02 +2.101786674184e-02 2.429140985759e-02 2.746342790972e-02 3.052453459729e-02 +3.346575739671e-02 3.627856303269e-02 3.895488142433e-02 4.148712804086e-02 +4.386822460664e-02 4.609161810065e-02 4.815129800111e-02 5.004181173166e-02 +5.175827827122e-02 5.329639989576e-02 5.465247202582e-02 5.582339115998e-02 +5.680666088027e-02 5.760039592173e-02 5.820332430421e-02 5.861478753074e-02 +5.883473886252e-02 5.886373968673e-02 5.870295399914e-02 5.835414102910e-02 +5.781964604028e-02 5.710238934612e-02 5.620585358389e-02 5.513406929708e-02 +5.389159888011e-02 5.248351894493e-02 5.091540117308e-02 4.919329172142e-02 +4.732368925408e-02 4.531352167665e-02 4.317012165270e-02 4.090120098583e-02 +3.851482395387e-02 3.601937968419e-02 3.342355366222e-02 3.073629846700e-02 +2.796680382983e-02 2.512446611365e-02 2.221885731196e-02 1.925969366728e-02 +1.625680400978e-02 1.322009791697e-02 1.015953379548e-02 7.085086985819e-03 +4.006717990083e-03 9.343409221033e-04 -2.122207722006e-03 -5.153199876226e-03 +-8.149046205155e-03 -1.110032579993e-02 -1.399781517917e-02 -1.683251650722e-02 +-1.959568494479e-02 -2.227885505038e-02 -2.487386615403e-02 -2.737288662881e-02 +-2.976843698917e-02 -3.205341174916e-02 -3.422109997818e-02 -3.626520449573e-02 +-3.817985965185e-02 -3.995964764408e-02 -4.159961332693e-02 -4.309527747477e-02 +-4.444264846413e-02 -4.563823234630e-02 -4.667904128676e-02 -4.756260035281e-02 +-4.828695263640e-02 -4.885066270423e-02 -4.925281837259e-02 -4.949303080981e-02 +-4.957143297428e-02 -4.948867640132e-02 -4.924592635723e-02 -4.884485538421e-02 +-4.828763526424e-02 -4.757692743560e-02 -4.671587189972e-02 -4.570807466124e-02 +-4.455759374821e-02 -4.326892386370e-02 -4.184697972440e-02 -4.029707814536e-02 +-3.862491893394e-02 -3.683656465934e-02 -3.493841936759e-02 -3.293720631450e-02 +-3.083994479229e-02 -2.865392612774e-02 -2.638668893222e-02 -2.404599368583e-02 +-2.163979673974e-02 -1.917622382202e-02 -1.666354313384e-02 -1.411013812330e-02 +-1.152448002530e-02 -8.915100255805e-03 -6.290562749049e-03 -3.659436326144e-03 +-1.030267182759e-03 1.588448416978e-03 4.188291154379e-03 6.760945293228e-03 +9.298224856821e-03 1.179209926377e-02 1.423471834338e-02 1.661843665371e-02 +1.893583702815e-02 2.117975327884e-02 2.334329198853e-02 2.541985332563e-02 +2.740315082040e-02 2.928723004408e-02 3.106648613639e-02 3.273568013062e-02 +3.428995402986e-02 3.572484459183e-02 3.703629578417e-02 3.822066987657e-02 +3.927475714035e-02 4.019578413094e-02 4.098142053316e-02 4.162978455384e-02 +4.213944685128e-02 4.250943299532e-02 4.273922445695e-02 4.282875813085e-02 +4.277842439880e-02 4.258906374688e-02 4.226196195359e-02 4.179884387064e-02 +4.120186582262e-02 4.047360665596e-02 3.961705747178e-02 3.863561008134e-02 +3.753304422663e-02 3.631351361252e-02 3.498153080037e-02 3.354195101643e-02 +3.199995493175e-02 3.036103047315e-02 2.863095372782e-02 2.681576900667e-02 +2.492176813392e-02 2.295546903276e-02 2.092359367870e-02 1.883304549411e-02 +1.669088625872e-02 1.450431261231e-02 1.228063222673e-02 1.002723972500e-02 +7.751592425892e-03 5.461185992628e-03 3.163530064113e-03 8.661239471169e-04 +-1.423567552895e-03 -3.698138085252e-03 -5.950263415892e-03 -8.172724722765e-03 +-1.035843145153e-02 -1.250044365998e-02 -1.459199378161e-02 -1.662650774079e-02 +-1.859762535438e-02 -2.049921995729e-02 -2.232541719211e-02 -2.407061290580e-02 +-2.572949009978e-02 -2.729703488265e-02 -2.876855137857e-02 -3.013967554749e-02 +-3.140638787734e-02 -3.256502491202e-02 -3.361228958282e-02 -3.454526031495e-02 +-3.536139888491e-02 -3.605855700843e-02 -3.663498164306e-02 -3.708931899344e-02 +-3.742061721175e-02 -3.762832778976e-02 -3.771230564345e-02 -3.767280789506e-02 +-3.751049136182e-02 -3.722640876460e-02 -3.682200367381e-02 -3.629910421392e-02 +-3.565991555179e-02 -3.490701119789e-02 -3.404332315311e-02 -3.307213093760e-02 +-3.199704954126e-02 -3.082201633910e-02 -2.955127701775e-02 -2.818937056221e-02 +-2.674111335517e-02 -2.521158244345e-02 -2.360609802887e-02 -2.193020524305e-02 +-2.018965526765e-02 -1.839038586356e-02 -1.653850137407e-02 -1.464025226861e-02 +-1.270201429484e-02 -1.073026730782e-02 -8.731573845858e-03 -6.712557523091e-03 +-4.679881309316e-03 -2.640225767507e-03 -6.002673194726e-04 1.433343390304e-03 +3.454002963193e-03 5.455176478626e-03 7.430418422352e-03 9.373393244311e-03 +1.127789548115e-02 1.313786938007e-02 1.494742796245e-02 1.670087146789e-02 +1.839270512133e-02 2.001765616846e-02 2.157069012714e-02 2.304702620522e-02 +2.444215183807e-02 2.575183630221e-02 2.697214336435e-02 2.809944292875e-02 +2.913042164873e-02 3.006209247213e-02 3.089180309365e-02 3.161724329081e-02 +3.223645112400e-02 3.274781798471e-02 3.315009247988e-02 3.344238314402e-02 +3.362415997477e-02 3.369525479111e-02 3.365586041739e-02 3.350652870018e-02 +3.324816736855e-02 3.288203575211e-02 3.240973937492e-02 3.183322344671e-02 +3.115476527662e-02 3.037696563770e-02 2.950273911414e-02 2.853530346589e-02 +2.747816804889e-02 2.633512133150e-02 2.511021755107e-02 2.380776255669e-02 +2.243229888701e-02 2.098859013410e-02 1.948160464657e-02 1.791649862706e-02 +1.629859868096e-02 1.463338387485e-02 1.292646736459e-02 1.118357765386e-02 +9.410539545482e-03 7.613254848001e-03 5.797682901151e-03 3.969820983777e-03 +2.135684668175e-03 3.012881846979e-04 -1.527375139800e-03 -3.344352306513e-03 +-5.143749869768e-03 -6.919752901010e-03 -8.666643631123e-03 -1.037881971177e-02 +-1.205081203788e-02 -1.367730207495e-02 -1.525313863681e-02 -1.677335406123e-02 +-1.823317973299e-02 -1.962806090637e-02 -2.095367078140e-02 -2.220592379064e-02 +-2.338098805623e-02 -2.447529697955e-02 -2.548555992892e-02 -2.640877199355e-02 +-2.724222277558e-02 -2.798350419456e-02 -2.863051728270e-02 -2.918147795210e-02 +-2.963492171868e-02 -2.998970737110e-02 -3.024501957619e-02 -3.040037041610e-02 +-3.045559985569e-02 -3.041087514220e-02 -3.026668914282e-02 -3.002385762894e-02 +-2.968351551956e-02 -2.924711209937e-02 -2.871640523051e-02 -2.809345458010e-02 +-2.738061388883e-02 -2.658052230879e-02 -2.569609484180e-02 -2.473051191228e-02 +-2.368720811129e-02 -2.256986015104e-02 -2.138237407161e-02 -2.012887174384e-02 +-1.881367671460e-02 -1.744129944241e-02 -1.601642197357e-02 -1.454388211024e-02 +-1.302865712360e-02 -1.147584706651e-02 -9.890657741144e-03 -8.278383378148e-03 +-6.644389084369e-03 -4.994093117121e-03 -3.332949043045e-03 -1.666427839951e-03 +6.012352329821e-15 1.660882307642e-03 3.310802956777e-03 4.944399409738e-03 +6.556380031865e-03 + L N + 2 10 +0.000000000000e+00 2.620035804377e-04 1.047131718272e-03 2.352739493154e-03 +4.174428330097e-03 6.506060404102e-03 9.339778739069e-03 1.266603293461e-02 +1.647361043433e-02 2.074967323186e-02 2.547979989189e-02 3.064803274651e-02 +3.623693010936e-02 4.222762333385e-02 4.859987852524e-02 5.533216270128e-02 +6.240171418104e-02 6.978461696787e-02 7.745587887891e-02 8.538951316150e-02 +9.355862332505e-02 1.019354909068e-01 1.104916658795e-01 1.191980594019e-01 +1.280250386031e-01 1.369425230876e-01 1.459200828410e-01 1.549270372115e-01 +1.639325546409e-01 1.729057528151e-01 1.818157989018e-01 1.906320095474e-01 +1.993239503004e-01 2.078615341368e-01 2.162151187607e-01 2.243556023625e-01 +2.322545175197e-01 2.398841229321e-01 2.472174926930e-01 2.542286028033e-01 +2.608924146474e-01 2.671849551599e-01 2.730833934219e-01 2.785661134411e-01 +2.836127828782e-01 2.882044175025e-01 2.923234411673e-01 2.959537411153e-01 +2.990807184404e-01 3.016913335443e-01 3.037741464492e-01 3.053193518408e-01 +3.063188087347e-01 3.067660646799e-01 3.066563744277e-01 3.059867130152e-01 +3.047557832314e-01 3.029640174516e-01 3.006135738454e-01 2.977083269830e-01 +2.942538528805e-01 2.902574085479e-01 2.857279061174e-01 2.806758816488e-01 +2.751134587301e-01 2.690543070006e-01 2.625135957503e-01 2.555079427565e-01 +2.480553585404e-01 2.401751862379e-01 2.318880372958e-01 2.232157232141e-01 +2.141811835724e-01 2.048084105866e-01 1.951223704560e-01 1.851489217677e-01 +1.749147312377e-01 1.644471870749e-01 1.537743102598e-01 1.429246640392e-01 +1.319272619409e-01 1.208114746169e-01 1.096069358277e-01 9.834344788108e-02 +8.705088684057e-02 7.575910781808e-02 6.449785066425e-02 5.329664636778e-02 +4.218472447166e-02 3.119092180969e-02 2.034359286162e-02 9.670522018677e-03 +-8.011619562114e-04 -1.104506899723e-02 -2.103562806663e-02 -3.074816449107e-02 +-4.015897405730e-02 -4.924539363317e-02 -5.798586809226e-02 -6.636001333369e-02 +-7.434867520261e-02 -8.193398413123e-02 -8.909940533569e-02 -9.582978441903e-02 +-1.021113882473e-01 -1.079319409817e-01 -1.132806551669e-01 -1.181482577925e-01 +-1.225270112614e-01 -1.264107292183e-01 -1.297947872062e-01 -1.326761281384e-01 +-1.350532625913e-01 -1.369262639391e-01 -1.382967583708e-01 -1.391679098457e-01 +-1.395444000616e-01 -1.394324035245e-01 -1.388395578295e-01 -1.377749292714e-01 +-1.362489739257e-01 -1.342734943514e-01 -1.318615920821e-01 -1.290276160864e-01 +-1.257871073914e-01 -1.221567400729e-01 -1.181542588320e-01 -1.137984133840e-01 +-1.091088898976e-01 -1.041062397316e-01 -9.881180572283e-02 -9.324764628811e-02 +-8.743645760788e-02 -8.140149416526e-02 -7.516648791822e-02 -6.875556638627e-02 +-6.219316993520e-02 -5.550396854491e-02 -4.871277834585e-02 -4.184447820889e-02 +-3.492392667190e-02 -2.797587948395e-02 -2.102490804431e-02 -1.409531900914e-02 +-7.211075333353e-03 -3.957190089499e-04 6.327704246251e-03 1.293671810326e-02 +1.940948630276e-02 2.572488067445e-02 3.186254627760e-02 3.780296345647e-02 +4.352750661626e-02 4.901849953707e-02 5.425926705699e-02 5.923418296817e-02 +6.392871398422e-02 6.832945965134e-02 7.242418809040e-02 7.620186747228e-02 +7.965269314418e-02 8.276811034000e-02 8.554083242365e-02 8.796485463021e-02 +9.003546328530e-02 9.174924049919e-02 9.310406434793e-02 9.409910456930e-02 +9.473481381699e-02 9.501291453183e-02 9.493638150345e-02 9.450942021097e-02 +9.373744104510e-02 9.262702952815e-02 9.118591266185e-02 8.942292154537e-02 +8.734795041872e-02 8.497191229792e-02 8.230669137963e-02 7.936509240319e-02 +7.616078716752e-02 7.270825840950e-02 6.902274125824e-02 6.512016248718e-02 +6.101707779225e-02 5.673060733022e-02 5.227836975588e-02 4.767841500079e-02 +4.294915603927e-02 3.810929988956e-02 3.317777809923e-02 2.817367696430e-02 +2.311616773109e-02 1.802443702837e-02 1.291761777506e-02 7.814720805650e-03 +2.734567451569e-03 -2.304276688186e-03 -7.283566559373e-03 -1.218544082641e-02 +-1.699248319366e-02 -2.168778166772e-02 -2.625498556300e-02 -3.067836006198e-02 +-3.494283815152e-02 -3.903406976697e-02 -4.293846798677e-02 -4.664325213182e-02 +-5.013648763584e-02 -5.340712256517e-02 -5.644502067940e-02 -5.924099093709e-02 +-6.178681336438e-02 -6.407526121752e-02 -6.610011938443e-02 -6.785619898412e-02 +-6.933934813651e-02 -7.054645888953e-02 -7.147547030398e-02 -7.212536771062e-02 +-7.249617816758e-02 -7.258896215997e-02 -7.240580159638e-02 -7.194978417065e-02 +-7.122498416940e-02 -7.023643981868e-02 -6.899012727473e-02 -6.749293137542e-02 +-6.575261328024e-02 -6.377777513672e-02 -6.157782192159e-02 -5.916292061419e-02 +-5.654395686812e-02 -5.373248935576e-02 -5.074070196708e-02 -4.758135405145e-02 +-4.426772889667e-02 -4.081358064510e-02 -3.723307985088e-02 -3.354075788636e-02 +-2.975145040852e-02 -2.588024009840e-02 -2.194239888811e-02 -1.795332989034e-02 +-1.392850924527e-02 -9.883428098751e-03 -5.833534923925e-03 -1.794178395810e-03 +2.219448974676e-03 6.192366244977e-03 1.010985828576e-02 1.395752867415e-02 +1.772135104925e-02 2.138771875041e-02 2.494349256632e-02 2.837604643077e-02 +3.167331090945e-02 3.482381433117e-02 3.781672142661e-02 4.064186934726e-02 +4.328980094801e-02 4.575179522735e-02 4.801989483032e-02 5.008693053066e-02 +5.194654262030e-02 5.359319914616e-02 5.502221094600e-02 5.622974344750e-02 +5.721282520660e-02 5.796935317347e-02 5.849809468655e-02 5.879868620733e-02 +5.887162882027e-02 5.871828053444e-02 5.834084543467e-02 5.774235974177e-02 +5.692667485224e-02 5.589843743883e-02 5.466306670358e-02 5.322672888515e-02 +5.159630913190e-02 4.977938086104e-02 4.778417273319e-02 4.561953337956e-02 +4.329489402663e-02 4.082022917023e-02 3.820601545722e-02 3.546318893891e-02 +3.260310086529e-02 2.963747219388e-02 2.657834699060e-02 2.343804490332e-02 +2.022911289118e-02 1.696427639457e-02 1.365639013154e-02 1.031838870717e-02 +6.963237221582e-03 3.603882061735e-03 2.532020601634e-04 -3.076039798482e-03 +-6.371243945210e-03 -9.620020894655e-03 -1.281023684336e-02 -1.593005803345e-02 +-1.896799372230e-02 -2.191293760479e-02 -2.475420754144e-02 -2.748158345284e-02 +-3.008534324839e-02 -3.255629666528e-02 -3.488581690254e-02 -3.706586994327e-02 +-3.908904146801e-02 -4.094856127127e-02 -4.263832510331e-02 -4.415291386933e-02 +-4.548761012830e-02 -4.663841184443e-02 -4.760204335446e-02 -4.837596352492e-02 +-4.895837108397e-02 -4.934820712322e-02 -4.954515477559e-02 -4.954963608583e-02 +-4.936280610077e-02 -4.898654421662e-02 -4.842344283100e-02 -4.767679335692e-02 +-4.675056966581e-02 -4.564940903605e-02 -4.437859069210e-02 -4.294401202848e-02 +-4.135216262065e-02 -3.961009613287e-02 -3.772540024034e-02 -3.570616469007e-02 +-3.356094763092e-02 -3.129874034941e-02 -2.892893055317e-02 -2.646126434851e-02 +-2.390580706294e-02 -2.127290306701e-02 -1.857313475277e-02 -1.581728082870e-02 +-1.301627409256e-02 -1.018115884487e-02 -7.323048106310e-03 -4.453080802119e-03 +-1.582379076085e-03 1.277994104811e-03 4.117076895743e-03 6.924049912610e-03 +9.688276810099e-03 1.239934394917e-02 1.504709900802e-02 1.762168839540e-02 +2.011359333025e-02 2.251366445745e-02 2.481315487560e-02 2.700375145932e-02 +2.907760436581e-02 3.102735462241e-02 3.284615970016e-02 3.452771698609e-02 +3.606628507543e-02 3.745670281381e-02 3.869440602799e-02 3.977544189305e-02 +4.069648089307e-02 4.145482634156e-02 4.204842143759e-02 4.247585384263e-02 +4.273635777314e-02 4.282981361275e-02 4.275674505787e-02 4.251831381953e-02 +4.211631191349e-02 4.155315157965e-02 4.083185288082e-02 3.995602903911e-02 +3.892986957682e-02 3.775812133673e-02 3.644606746422e-02 3.499950444117e-02 +3.342471726858e-02 3.172845290135e-02 2.991789204487e-02 2.800061942895e-02 +2.598459267953e-02 2.387810991374e-02 2.168977618808e-02 1.942846893310e-02 +1.710330251128e-02 1.472359203784e-02 1.229881660573e-02 9.838582058397e-03 +7.352583454433e-03 4.850567369051e-03 2.342294177207e-03 -1.624995374291e-04 +-2.654138304523e-03 -5.123044678725e-03 -7.559775601667e-03 -9.955058077794e-03 +-1.229982403074e-02 -1.458524421068e-02 -1.680276102726e-02 -1.894412018742e-02 +-2.100140102249e-02 -2.296704539440e-02 -2.483388507685e-02 -2.659516751356e-02 +-2.824457986222e-02 -2.977627123989e-02 -3.118487309266e-02 -3.246551762010e-02 +-3.361385419245e-02 -3.462606370685e-02 -3.549887083663e-02 -3.622955413607e-02 +-3.681595397167e-02 -3.725647825883e-02 -3.755010599193e-02 -3.769638856381e-02 +-3.769544887952e-02 -3.754797827720e-02 -3.725523127767e-02 -3.681901819240e-02 +-3.624169562733e-02 -3.552615492841e-02 -3.467580862197e-02 -3.369457491062e-02 +-3.258686029276e-02 -3.135754038030e-02 -3.001193899610e-02 -2.855580563876e-02 +-2.699529140817e-02 -2.533692349098e-02 -2.358757830999e-02 -2.175445344637e-02 +-1.984503844759e-02 -1.786708463813e-02 -1.582857405291e-02 -1.373768761674e-02 +-1.160277269495e-02 -9.432310142707e-03 -7.234880981712e-03 -5.019132833746e-03 +-2.793746241246e-03 -5.674010047185e-04 1.651257333662e-03 3.853650732059e-03 +6.031301489937e-03 8.175864563376e-03 1.027915923270e-02 1.233320000329e-02 +1.433022662396e-02 1.626273311109e-02 1.812349567089e-02 1.990559941708e-02 +2.160246378597e-02 2.320786655663e-02 2.471596638938e-02 2.612132380187e-02 +2.741892050851e-02 2.860417705536e-02 2.967296868953e-02 3.062163940931e-02 +3.144701414801e-02 3.214640905242e-02 3.271763982383e-02 3.315902809725e-02 +3.346940584235e-02 3.364811777675e-02 3.369502179069e-02 3.361048738904e-02 +3.339539216478e-02 3.305111632528e-02 3.257953530016e-02 3.198301046681e-02 +3.126437803690e-02 3.042693615365e-02 2.947443025706e-02 2.841103677982e-02 +2.724134524376e-02 2.597033883180e-02 2.460337351638e-02 2.314615583044e-02 +2.160471937202e-02 1.998540013785e-02 1.829481078573e-02 1.653981392904e-02 +1.472749457012e-02 1.286513178221e-02 1.096016975200e-02 9.020188297052e-03 +7.052872973721e-03 5.065984892624e-03 3.067330359101e-03 1.064730456563e-03 +-9.340093097221e-04 -2.921129191455e-03 -4.888945082975e-03 -6.829877999512e-03 +-8.736483035799e-03 -1.060147769521e-02 -1.241776948243e-02 -1.417848265595e-02 +-1.587698404013e-02 -1.750690780091e-02 -1.906217909314e-02 -2.053703649256e-02 +-2.192605313036e-02 -2.322415645346e-02 -2.442664653926e-02 -2.552921289965e-02 +-2.652794971473e-02 -2.741936944348e-02 -2.820041476444e-02 -2.886846880682e-02 +-2.942136363844e-02 -2.985738698434e-02 -3.017528715649e-02 -3.037427618212e-02 +-3.045403112513e-02 -3.041469360212e-02 -3.025686750147e-02 -2.998161492074e-02 +-2.959045034473e-02 -2.908533309287e-02 -2.846865807160e-02 -2.774324487347e-02 +-2.691232527115e-02 -2.597952916044e-02 -2.494886901223e-02 -2.382472289889e-02 +-2.261181616584e-02 -2.131520182400e-02 -1.994023974356e-02 -1.849257473380e-02 +-1.697811359776e-02 -1.540300125403e-02 -1.377359602157e-02 -1.209644416594e-02 +-1.037825380810e-02 -8.625868299011e-03 -6.846239164960e-03 -5.046398729735e-03 +-3.233432520802e-03 -1.414451567016e-03 4.034353045415e-04 2.213149065363e-03 +4.007667869506e-03 5.780054119506e-03 7.523481110548e-03 9.231259151201e-03 +1.089686106141e-02 1.251394695115e-02 1.407638818635e-02 1.557829045196e-02 +1.701401582611e-02 1.837820378317e-02 1.966579104810e-02 2.087203022904e-02 +2.199250716028e-02 2.302315689278e-02 2.396027827478e-02 2.480054707111e-02 +2.554102757496e-02 2.617918267265e-02 2.671288232720e-02 2.714041045362e-02 +2.746047016431e-02 2.767218737005e-02 2.777511272791e-02 2.776922193426e-02 +2.765491436722e-02 2.743301008928e-02 2.710474522729e-02 2.667176575308e-02 +2.613611969416e-02 2.550024780987e-02 2.476697277428e-02 2.393948691269e-02 +2.302133854408e-02 2.201641698699e-02 2.092893629145e-02 1.976341776426e-02 +1.852467135921e-02 1.721777600821e-02 1.584805897315e-02 1.442107430156e-02 +1.294258047276e-02 1.141851732369e-02 9.854982346319e-03 8.258206450586e-03 +6.634529288631e-03 4.990374237425e-03 3.332223137968e-03 1.666590889822e-03 +1.678130316268e-15 -1.661044814901e-03 -3.310081874987e-03 -4.940717534258e-03 +-6.546650832582e-03 + L N + 2 11 +0.000000000000e+00 3.076684752969e-04 1.229456822894e-03 2.761718489534e-03 +4.898391469913e-03 7.631021618919e-03 1.094879515999e-02 1.483858026336e-02 +1.928497753096e-02 2.427037919052e-02 2.977503676719e-02 3.577713696791e-02 +4.225288548166e-02 4.917659836780e-02 5.652080067530e-02 6.425633190728e-02 +7.235245791876e-02 8.077698881069e-02 8.949640235977e-02 9.847597250258e-02 +1.076799023726e-01 1.170714613719e-01 1.266131257425e-01 1.362667220913e-01 +1.459935733092e-01 1.557546463171e-01 1.655107010646e-01 1.752224402041e-01 +1.848506588577e-01 1.943563938989e-01 2.037010721695e-01 2.128466570595e-01 +2.217557928846e-01 2.303919465032e-01 2.387195456292e-01 2.467041133084e-01 +2.543123980425e-01 2.615124990639e-01 2.682739862803e-01 2.745680144358e-01 +2.803674310519e-01 2.856468777420e-01 2.903828845161e-01 2.945539567237e-01 +2.981406543082e-01 3.011256630816e-01 3.034938577562e-01 3.052323565036e-01 +3.063305668482e-01 3.067802227308e-01 3.065754126186e-01 3.057125985692e-01 +3.041906261952e-01 3.020107255079e-01 2.991765026582e-01 2.956939226262e-01 +2.915712829478e-01 2.868191785994e-01 2.814504581996e-01 2.754801717169e-01 +2.689255099084e-01 2.618057357443e-01 2.541421081053e-01 2.459577980678e-01 +2.372777981237e-01 2.281288247028e-01 2.185392143984e-01 2.085388143130e-01 +1.981588669688e-01 1.874318902450e-01 1.763915528221e-01 1.650725456318e-01 +1.535104498227e-01 1.417416017660e-01 1.298029556362e-01 1.177319441059e-01 +1.055663377061e-01 9.334410339940e-02 8.110326292147e-02 6.888175144123e-02 +5.671727708871e-02 4.464718189424e-02 3.270830467496e-02 2.093684639556e-02 +9.368238518095e-03 -1.962985157258e-03 -1.302331267469e-02 -2.378037365978e-02 +-3.420305416166e-02 -4.426160617195e-02 -5.392775141475e-02 -6.317477902589e-02 +-7.197763676562e-02 -8.031301543553e-02 -8.815942619899e-02 -9.549727053327e-02 +-1.023089025723e-01 -1.085786836294e-01 -1.142930287224e-01 -1.194404449545e-01 +-1.240115616379e-01 -1.279991520817e-01 -1.313981469958e-01 -1.342056395004e-01 +-1.364208817593e-01 -1.380452732934e-01 -1.390823410596e-01 -1.395377114146e-01 +-1.394190741153e-01 -1.387361385373e-01 -1.375005823238e-01 -1.357259927067e-01 +-1.334278007701e-01 -1.306232089512e-01 -1.273311121030e-01 -1.235720124635e-01 +-1.193679289021e-01 -1.147423008317e-01 -1.097198871991e-01 -1.043266609778e-01 +-9.858969961033e-02 -9.253707185462e-02 -8.619772150607e-02 -7.960134847434e-02 +-7.277828770341e-02 -6.575938642888e-02 -5.857588027130e-02 -5.125926866597e-02 +-4.384119012989e-02 -3.635329786467e-02 -2.882713619011e-02 -2.129401829720e-02 +-1.378490580154e-02 -6.330290568085e-03 1.039920733378e-03 8.296518896249e-03 +1.541110083812e-02 2.235617424116e-02 2.910525777694e-02 3.563297654072e-02 +4.191515234175e-02 4.792888851923e-02 5.365264897716e-02 5.906633115714e-02 +6.415133269386e-02 6.889061152569e-02 7.326873926022e-02 7.727194762380e-02 +8.088816785271e-02 8.410706291371e-02 8.692005247143e-02 8.932033055009e-02 +9.130287586745e-02 9.286445484874e-02 9.400361735845e-02 9.472068521733e-02 +9.501773360112e-02 9.489856544625e-02 9.436867901559e-02 9.343522880452e-02 +9.210697999391e-02 9.039425668188e-02 8.830888415028e-02 8.586412544504e-02 +8.307461257098e-02 7.995627262242e-02 7.652624918934e-02 7.280281939669e-02 +6.880530695008e-02 6.455399157522e-02 6.007001525105e-02 5.537528564737e-02 +5.049237718656e-02 4.544443015637e-02 4.025504830616e-02 3.494819536231e-02 +2.954809090060e-02 2.407910601299e-02 1.856565920428e-02 1.303211295073e-02 +7.502671346696e-03 2.001279258628e-03 -3.448476603728e-03 -8.823464299277e-03 +-1.410110056357e-02 -1.925944163937e-02 -2.427727067176e-02 -2.913418132615e-02 +-3.381065730610e-02 -3.828814746650e-02 -4.254913623868e-02 -4.657720910519e-02 +-5.035711288463e-02 -5.387481061019e-02 -5.711753080991e-02 -6.007381102120e-02 +-6.273353539776e-02 -6.508796629279e-02 -6.712976972852e-02 -6.885303468854e-02 +-7.025328619587e-02 -7.132749216619e-02 -7.207406405214e-02 -7.249285132072e-02 +-7.258512983165e-02 -7.235358420985e-02 -7.180228433038e-02 -7.093665605800e-02 +-6.976344640724e-02 -6.829068331139e-02 -6.652763021048e-02 -6.448473568909e-02 +-6.217357841437e-02 -5.960680764286e-02 -5.679807958219e-02 -5.376198990912e-02 +-5.051400276031e-02 -4.707037652467e-02 -4.344808677825e-02 -3.966474671203e-02 +-3.573852541206e-02 -3.168806435765e-02 -2.753239250910e-02 -2.329084035964e-02 +-1.898295332883e-02 -1.462840487436e-02 -1.024690969872e-02 -5.858137423784e-03 +-1.481627102334e-03 2.863297070612e-03 7.157608491192e-03 1.138265897831e-02 +1.552025736739e-02 1.955274554190e-02 2.346307159151e-02 2.723485979991e-02 +3.085247718102e-02 3.430109629899e-02 3.756675412499e-02 4.063640670257e-02 +4.349797941283e-02 4.614041265109e-02 4.855370274757e-02 5.072893798650e-02 +5.265832959992e-02 5.433523763505e-02 5.575419161718e-02 5.691090595260e-02 +5.780229003971e-02 5.842645307927e-02 5.878270359798e-02 5.887154372239e-02 +5.869465826260e-02 5.825489868764e-02 5.755626209583e-02 5.660386530476e-02 +5.540391420582e-02 5.396366854810e-02 5.229140233518e-02 5.039636003652e-02 +4.828870883190e-02 4.597948712356e-02 4.348054956543e-02 4.080450887244e-02 +3.796467468555e-02 3.497498977904e-02 3.184996390683e-02 2.860460559276e-02 +2.525435217715e-02 2.181499843767e-02 1.830262410672e-02 1.473352061066e-02 +1.112411735750e-02 7.490907899814e-03 3.850376298047e-03 2.189240069475e-04 +-3.387202396787e-03 -6.951982332809e-03 -1.045969087557e-02 -1.389496665532e-02 +-1.724287771342e-02 -2.048898503462e-02 -2.361940349045e-02 -2.662085994112e-02 +-2.948074825712e-02 -3.218718103649e-02 -3.472903781001e-02 -3.709600954258e-02 +-3.927863925708e-02 -4.126835862455e-02 -4.305752038353e-02 -4.463942647041e-02 +-4.600835176212e-02 -4.715956335253e-02 -4.808933530412e-02 -4.879495883629e-02 +-4.927474793281e-02 -4.952804037032e-02 -4.955519419073e-02 -4.935757965981e-02 +-4.893756677430e-02 -4.829850839888e-02 -4.744471913344e-02 -4.638145002913e-02 +-4.511485928961e-02 -4.365197911066e-02 -4.200067882765e-02 -4.016962455577e-02 +-3.816823552227e-02 -3.600663730365e-02 -3.369561219321e-02 -3.124654693566e-02 +-2.867137807613e-02 -2.598253517989e-02 -2.319288218723e-02 -2.031565717474e-02 +-1.736441079973e-02 -1.435294370905e-02 -1.129524319641e-02 -8.205419394279e-03 +-5.097641286770e-03 -1.986072829379e-03 1.115190540756e-03 4.192184723556e-03 +7.231138827680e-03 1.021853582485e-02 1.314117172336e-02 1.598621300531e-02 +1.874125208106e-02 2.139436052478e-02 2.393413986573e-02 2.634976972223e-02 +2.863105307825e-02 3.076845851588e-02 3.275315923222e-02 3.457706868354e-02 +3.623287271619e-02 3.771405805957e-02 3.901493707359e-02 4.013066866018e-02 +4.105727526594e-02 4.179165592093e-02 4.233159527647e-02 4.267576862267e-02 +4.282374288487e-02 4.277597361553e-02 4.253379801639e-02 4.209942404287e-02 +4.147591566015e-02 4.066717433698e-02 3.967791687977e-02 3.851364972527e-02 +3.718063982521e-02 3.568588227123e-02 3.403706482161e-02 3.224252950495e-02 +3.031123148774e-02 2.825269540412e-02 2.607696935661e-02 2.379457680580e-02 +2.141646657547e-02 1.895396120673e-02 1.641870390118e-02 1.382260429823e-02 +1.117778333544e-02 8.496517443904e-03 5.791182332473e-03 3.074196614823e-03 +3.579655333173e-04 -2.345174968402e-03 -5.023013574793e-03 -7.663518084389e-03 +-1.025488881198e-02 -1.278561067257e-02 -1.524450371981e-02 -1.762077191955e-02 +-1.990404994807e-02 -2.208444781460e-02 -2.415259311825e-02 -2.609967076105e-02 +-2.791745995112e-02 -2.959836834282e-02 -3.113546317436e-02 -3.252249927752e-02 +-3.375394384859e-02 -3.482499788491e-02 -3.573161420664e-02 -3.647051199911e-02 +-3.703918782712e-02 -3.743592308850e-02 -3.765978789044e-02 -3.771064134824e-02 +-3.758912832216e-02 -3.729667262398e-02 -3.683546674066e-02 -3.620845813781e-02 +-3.541933222075e-02 -3.447249204577e-02 -3.337303488818e-02 -3.212672578743e-02 +-3.073996820272e-02 -2.921977192474e-02 -2.757371840097e-02 -2.580992364281e-02 +-2.393699889300e-02 -2.196400924095e-02 -1.990043038209e-02 -1.775610372464e-02 +-1.554119005402e-02 -1.326612197031e-02 -1.094155531897e-02 -8.578319838528e-03 +-6.187369251313e-03 -3.779731025096e-03 -1.366456033675e-03 1.041431655932e-03 +3.432984643661e-03 5.797381480523e-03 8.123975156804e-03 1.040234057904e-02 +1.262232082597e-02 1.477407198010e-02 1.684810633883e-02 1.883533381715e-02 +2.072710136309e-02 2.251523021665e-02 2.419205085349e-02 2.575043546574e-02 +2.718382784412e-02 2.848627053771e-02 2.965242918072e-02 3.067761388866e-02 +3.155779764011e-02 3.228963157415e-02 3.287045714778e-02 3.329831511195e-02 +3.357195127965e-02 3.369081907362e-02 3.365507885629e-02 3.346559405883e-02 +3.312392414056e-02 3.263231442430e-02 3.199368286693e-02 3.121160383831e-02 +3.029028899450e-02 2.923456534451e-02 2.804985062158e-02 2.674212608192e-02 +2.531790686509e-02 2.378421006026e-02 2.214852063285e-02 2.041875537461e-02 +1.860322504877e-02 1.671059490926e-02 1.474984377951e-02 1.273022188220e-02 +1.066120761620e-02 8.552463480746e-03 6.413791350159e-03 4.255087304277e-03 +2.086296221165e-03 -8.263366125141e-05 -2.241796008618e-03 -4.381371274271e-03 +-6.491671002218e-03 -8.563181350586e-03 -1.058660564148e-02 -1.255290574840e-02 +-1.445334213826e-02 -1.627951239218e-02 -1.802338803634e-02 -1.967734952298e-02 +-2.123421921034e-02 -2.268729220007e-02 -2.403036490096e-02 -2.525776119861e-02 +-2.636435612188e-02 -2.734559690898e-02 -2.819752138788e-02 -2.891677359852e-02 +-2.950061659689e-02 -2.994694239413e-02 -3.025427899694e-02 -3.042179452880e-02 +-3.044929842495e-02 -3.033723970715e-02 -3.008670235770e-02 -2.969939782500e-02 +-2.917765470601e-02 -2.852440566355e-02 -2.774317164852e-02 -2.683804350933e-02 +-2.581366108219e-02 -2.467518986695e-02 -2.342829540380e-02 -2.207911547618e-02 +-2.063423027435e-02 -1.910063066329e-02 -1.748568470606e-02 -1.579710260156e-02 +-1.404290020202e-02 -1.223136128139e-02 -1.037099873071e-02 -8.470514861073e-03 +-6.538760997688e-03 -4.584696551532e-03 -2.617347756428e-03 -6.457662603618e-04 +1.321012240231e-03 3.274009135404e-03 5.204343619764e-03 7.103272810172e-03 +8.962231082993e-03 1.077286845501e-02 1.252708783712e-02 1.421708099563e-02 +1.583536306260e-02 1.737480544355e-02 1.882866697908e-02 2.019062322502e-02 +2.145479372504e-02 2.261576715911e-02 2.366862426125e-02 2.460895841062e-02 +2.543289381082e-02 2.613710118357e-02 2.671881091458e-02 2.717582360104e-02 +2.750651796229e-02 2.770985608732e-02 2.778538600493e-02 2.773324157453e-02 +2.755413970786e-02 2.724937494400e-02 2.682081141175e-02 2.627087222561e-02 +2.560252637270e-02 2.481927315949e-02 2.392512429765e-02 2.292458371938e-02 +2.182262522185e-02 2.062466805058e-02 1.933655054006e-02 1.796450193866e-02 +1.651511255249e-02 1.499530235009e-02 1.341228817647e-02 1.177354973056e-02 +1.008679446542e-02 8.359921574931e-03 6.600985233967e-03 4.818157262340e-03 +3.019689384381e-03 1.213875257557e-03 -5.909875561334e-04 -2.386635502586e-03 +-4.164876659528e-03 -5.917627901590e-03 -7.636951438803e-03 -9.315090564226e-03 +-1.094450445058e-02 -1.251790184067e-02 -1.402827348179e-02 -1.546892316090e-02 +-1.683349720363e-02 -1.811601230827e-02 -1.931088159343e-02 -2.041293874683e-02 +-2.141746017166e-02 -2.232018503642e-02 -2.311733314391e-02 -2.380562054548e-02 +-2.438227283685e-02 -2.484503608294e-02 -2.519218532972e-02 -2.542253067262e-02 +-2.553542086195e-02 -2.553074443721e-02 -2.540892839351e-02 -2.517093439426e-02 +-2.481825255589e-02 -2.435289284079e-02 -2.377737410594e-02 -2.309471086481e-02 +-2.230839783060e-02 -2.142239231867e-02 -2.044109459549e-02 -1.936932627061e-02 +-1.821230683654e-02 -1.697562846985e-02 -1.566522921396e-02 -1.428736467144e-02 +-1.284857833972e-02 -1.135567073013e-02 -9.815667414928e-03 -8.235786151830e-03 +-6.623403238827e-03 -4.986019255467e-03 -3.331224348814e-03 -1.666663223992e-03 +-5.234270300177e-15 1.661116908350e-03 3.309089722328e-03 4.936405886016e-03 +6.535672151334e-03 + L N + 2 12 +0.000000000000e+00 3.569814882747e-04 1.426287458304e-03 3.203009736563e-03 +5.678992372018e-03 8.842868026574e-03 1.268010869057e-02 1.717309049234e-02 +2.230117230782e-02 2.804078781293e-02 3.436555056104e-02 4.124637160835e-02 +4.865158915351e-02 5.654710960314e-02 6.489655942367e-02 7.366144709087e-02 +8.280133440316e-02 9.227401638268e-02 1.020357089495e-01 1.120412435198e-01 +1.222442676477e-01 1.325974508038e-01 1.430526943619e-01 1.535613448439e-01 +1.640744094647e-01 1.745427730018e-01 1.849174150175e-01 1.951496264531e-01 +2.051912246258e-01 2.149947656614e-01 2.245137534122e-01 2.337028439257e-01 +2.425180445512e-01 2.509169067969e-01 2.588587120793e-01 2.663046495419e-01 +2.732179851554e-01 2.795642213536e-01 2.853112465043e-01 2.904294735591e-01 +2.948919672794e-01 2.986745594874e-01 3.017559518458e-01 3.041178057292e-01 +3.057448188081e-01 3.066247880289e-01 3.067486587350e-01 3.061105597370e-01 +3.047078242075e-01 3.025409963362e-01 2.996138237492e-01 2.959332357614e-01 +2.915093075916e-01 2.863552107395e-01 2.804871497789e-01 2.739242858907e-01 +2.666886475116e-01 2.588050285377e-01 2.503008745740e-01 2.412061577761e-01 +2.315532408807e-01 2.213767310680e-01 2.107133243446e-01 1.996016411774e-01 +1.880820541447e-01 1.761965084072e-01 1.639883358306e-01 1.515020636184e-01 +1.387832183350e-01 1.258781262193e-01 1.128337107019e-01 9.969728804722e-02 +8.651636205180e-02 7.333841872575e-02 6.021072188578e-02 4.718011057796e-02 +3.429279923829e-02 2.159418148252e-02 9.128638397347e-03 -3.060647819018e-03 +-1.493187404649e-02 -2.644478947395e-02 -3.756086111718e-02 -4.824343090815e-02 +-5.845786368133e-02 -6.817168542733e-02 -7.735471123116e-02 -8.597916236248e-02 +-9.401977203692e-02 -1.014538794221e-01 -1.082615115172e-01 -1.144254525935e-01 +-1.199313009396e-01 -1.247675127185e-01 -1.289254327991e-01 -1.323993124896e-01 +-1.351863141592e-01 -1.372865027934e-01 -1.387028245925e-01 -1.394410727781e-01 +-1.395098408326e-01 -1.389204634537e-01 -1.376869455620e-01 -1.358258797502e-01 +-1.333563526199e-01 -1.302998404937e-01 -1.266800950448e-01 -1.225230194247e-01 +-1.178565355123e-01 -1.127104429482e-01 -1.071162706481e-01 -1.011071215248e-01 +-9.471751117380e-02 -8.798320130120e-02 -8.094102869535e-02 -7.362873055691e-02 +-6.608476701707e-02 -5.834814168099e-02 -5.045822103842e-02 -4.245455358404e-02 +-3.437668948673e-02 -2.626400163957e-02 -1.815550891133e-02 -1.008970240501e-02 +-2.104375510424e-03 5.763541484598e-03 1.347814148570e-02 2.100469467665e-02 +2.830979592005e-02 3.536150483243e-02 4.212947793040e-02 4.858509228547e-02 +5.470156016846e-02 6.045403421016e-02 6.581970265261e-02 7.077787431437e-02 +7.531005294468e-02 7.940000069296e-02 8.303379047373e-02 8.619984706080e-02 +8.888897679901e-02 9.109438587652e-02 9.281168715524e-02 9.403889561133e-02 +9.477641249152e-02 9.502699834383e-02 9.479573513343e-02 9.408997770467e-02 +9.291929489961e-02 9.129540069051e-02 8.923207572929e-02 8.674507975962e-02 +8.385205537857e-02 8.057242367249e-02 7.692727228735e-02 7.293923652620e-02 +6.863237409600e-02 6.403203415221e-02 5.916472131247e-02 5.405795533072e-02 +4.874012713881e-02 4.324035197554e-02 3.758832033245e-02 3.181414745065e-02 +2.594822210564e-02 2.002105541476e-02 1.406313039743e-02 8.104753009171e-03 +2.175905358568e-03 -3.693898199159e-03 -9.475751417086e-03 -1.514149230696e-02 +-2.066383445693e-02 -2.601649291622e-02 -3.117430407723e-02 -3.611333901816e-02 +-4.081100980535e-02 -4.524616829199e-02 -4.939919698957e-02 -5.325209163042e-02 +-5.678853508241e-02 -5.999396232195e-02 -6.285561621669e-02 -6.536259391652e-02 +-6.750588369834e-02 -6.927839215825e-02 -7.067496169263e-02 -7.169237825779e-02 +-7.232936944540e-02 -7.258659295852e-02 -7.246661561924e-02 -7.197388308498e-02 +-7.111468049454e-02 -6.989708430856e-02 -6.833090565013e-02 -6.642762549139e-02 +-6.420032206953e-02 -6.166359095147e-02 -5.883345819969e-02 -5.572728712279e-02 +-5.236367912251e-02 -4.876236917484e-02 -4.494411650539e-02 -4.093059103929e-02 +-3.674425622285e-02 -3.240824882765e-02 -2.794625635919e-02 -2.338239269891e-02 +-1.874107261368e-02 -1.404688576745e-02 -9.324470868169e-03 -4.598390577902e-03 +1.069921939384e-04 4.767636005687e-03 9.359940012229e-03 1.386085992999e-02 +1.824802028030e-02 2.249982237581e-02 2.659554753943e-02 3.051545507277e-02 +3.424087452049e-02 3.775429180865e-02 4.103942886873e-02 4.408131639428e-02 +4.686635941380e-02 4.938239540193e-02 5.161874469013e-02 5.356625297829e-02 +5.521732578984e-02 5.656595475443e-02 5.760773564410e-02 5.833987813073e-02 +5.876120727474e-02 5.887215679612e-02 5.867475422040e-02 5.817259803202e-02 +5.737082700748e-02 5.627608193834e-02 5.489645999179e-02 5.324146199149e-02 +5.132193293559e-02 4.914999610088e-02 4.673898111185e-02 4.410334638202e-02 +4.125859636009e-02 3.822119403739e-02 3.500846919386e-02 3.163852287837e-02 +2.813012863500e-02 2.450263100010e-02 2.077584180546e-02 1.696993483036e-02 +1.310533935054e-02 9.202633133727e-03 5.282435431064e-03 1.365300510094e-03 +-2.528387731342e-03 -6.378519539712e-03 -1.016536095001e-02 -1.386965279475e-02 +-1.747270658959e-02 -2.095649682631e-02 -2.430374922523e-02 -2.749802452251e-02 +-3.052379739318e-02 -3.336653013806e-02 -3.601274079175e-02 -3.845006533949e-02 +-4.066731376263e-02 -4.265451966574e-02 -4.440298327273e-02 -4.590530761433e-02 +-4.715542776550e-02 -4.814863302738e-02 -4.888158198534e-02 -4.935231041140e-02 +-4.956023201614e-02 -4.950613209185e-02 -4.919215412463e-02 -4.862177948871e-02 +-4.779980037128e-02 -4.673228610935e-02 -4.542654315340e-02 -4.389106890350e-02 +-4.213549969391e-02 -4.017055323000e-02 -3.800796580869e-02 -3.566042467757e-02 +-3.314149591151e-02 -3.046554820558e-02 -2.764767300241e-02 -2.470360138780e-02 +-2.164961820300e-02 -1.850247383340e-02 -1.527929414273e-02 -1.199748902868e-02 +-8.674660080023e-03 -5.328507817416e-03 -1.976738999011e-03 1.363025530750e-03 +4.673341976597e-03 7.937033247443e-03 1.113727667658e-02 1.425768936526e-02 +1.728241072262e-02 2.019618179192e-02 2.298442097176e-02 2.563329576201e-02 +2.812979018656e-02 3.046176756954e-02 3.261802836707e-02 3.458836278430e-02 +3.636359793551e-02 3.793563933481e-02 3.929750653531e-02 4.044336276610e-02 +4.136853844790e-02 4.206954850082e-02 4.254410339008e-02 4.279111388828e-02 +4.281068956538e-02 4.260413104987e-02 4.217391613683e-02 4.152367984956e-02 +4.065818859268e-02 3.958330856400e-02 3.830596862140e-02 3.683411782884e-02 +3.517667793149e-02 3.334349103529e-02 3.134526278934e-02 2.919350139147e-02 +2.690045275685e-02 2.447903220810e-02 2.194275306091e-02 1.930565249378e-02 +1.658221510205e-02 1.378729454669e-02 1.093603371569e-02 8.043783821492e-03 +5.126022861369e-03 2.198273868379e-03 -7.239766203473e-04 -3.625359454779e-03 +-6.490702704869e-03 -9.305110025117e-03 -1.205403715055e-02 -1.472336613561e-02 +-1.729947696126e-02 -1.976931615114e-02 -2.212046205516e-02 -2.434118647773e-02 +-2.642051234892e-02 -2.834826715853e-02 -3.011513189675e-02 -3.171268526991e-02 +-3.313344298513e-02 -3.437089192496e-02 -3.541951906013e-02 -3.627483497697e-02 +-3.693339192456e-02 -3.739279631585e-02 -3.765171564597e-02 -3.770987982040e-02 +-3.756807691478e-02 -3.722814341700e-02 -3.669294903069e-02 -3.596637614723e-02 +-3.505329412068e-02 -3.395952850627e-02 -3.269182544887e-02 -3.125781143181e-02 +-2.966594862004e-02 -2.792548605296e-02 -2.604640696311e-02 -2.403937251536e-02 +-2.191566227883e-02 -1.968711175892e-02 -1.736604733100e-02 -1.496521892885e-02 +-1.249773085105e-02 -9.976971056863e-03 -7.416539328725e-03 -4.830174683048e-03 +-2.231682412867e-03 3.651388539955e-04 2.946569699445e-03 5.499041684479e-03 +8.009207971345e-03 1.046401243426e-02 1.285075690406e-02 1.515716620353e-02 +1.737145064347e-02 1.948236566420e-02 2.147926832383e-02 2.335217035218e-02 +2.509178750901e-02 2.668958500519e-02 2.813781876764e-02 2.942957235138e-02 +3.055878932574e-02 3.152030098634e-02 3.230984926954e-02 3.292410477172e-02 +3.336067980191e-02 3.361813642247e-02 3.369598945914e-02 3.359470448797e-02 +3.331569083327e-02 3.286128963623e-02 3.223475707978e-02 3.144024288008e-02 +3.048276417933e-02 2.936817499809e-02 2.810313142785e-02 2.669505276609e-02 +2.515207881646e-02 2.348302359571e-02 2.169732570689e-02 1.980499565455e-02 +1.781656039251e-02 1.574300540791e-02 1.359571465714e-02 1.138640867844e-02 +9.127081215007e-03 6.829934687878e-03 4.507314863059e-03 2.171645059743e-03 +-1.646397525505e-04 -2.489158621023e-03 -4.789649696704e-03 -7.054034402038e-03 +-9.270480345647e-03 -1.142746265903e-02 -1.351382343959e-02 -1.551882899580e-02 +-1.743222460296e-02 -1.924428649260e-02 -2.094587081405e-02 -2.252845932386e-02 +-2.398420157694e-02 -2.530595341261e-02 -2.648731154916e-02 -2.752264412166e-02 +-2.840711701980e-02 -2.913671590534e-02 -2.970826381169e-02 -3.011943425206e-02 +-3.036875978628e-02 -3.045563602065e-02 -3.038032103927e-02 -3.014393028902e-02 +-2.974842696479e-02 -2.919660796421e-02 -2.849208550498e-02 -2.763926451953e-02 +-2.664331596408e-02 -2.551014619974e-02 -2.424636262338e-02 -2.285923574506e-02 +-2.135665792659e-02 -1.974709901245e-02 -1.803955909993e-02 -1.624351870902e-02 +-1.436888662551e-02 -1.242594570173e-02 -1.042529690901e-02 -8.377801943820e-03 +-6.294524696237e-03 -4.186671893672e-03 -2.065533236328e-03 5.757865807762e-05 +2.171388182888e-03 4.264716228960e-03 6.326538917132e-03 8.346045270086e-03 +1.031269352377e-02 1.221626578694e-02 1.404692076716e-02 1.579524429305e-02 +1.745229737510e-02 1.900966156133e-02 2.045948135957e-02 2.179450351406e-02 +2.300811294185e-02 2.409436515260e-02 2.504801499478e-02 2.586454159100e-02 +2.654016934616e-02 2.707188493284e-02 2.745745018038e-02 2.769541081551e-02 +2.778510102486e-02 2.772664383151e-02 2.752094730009e-02 2.716969660659e-02 +2.667534203104e-02 2.604108295212e-02 2.527084794387e-02 2.436927109463e-02 +2.334166468786e-02 2.219398840316e-02 2.093281521350e-02 1.956529417156e-02 +1.809911029351e-02 1.654244176341e-02 1.490391469431e-02 1.319255569457e-02 +1.141774249808e-02 9.589152926751e-03 7.716712461102e-03 5.810540701272e-03 +3.880897005497e-03 1.938125596396e-03 -7.399572885525e-06 -1.945329900438e-03 +-3.865396874365e-03 -5.757466180610e-03 -7.611590896222e-03 -9.418063490354e-03 +-1.116746636260e-02 -1.285072065697e-02 -1.445913309993e-02 -1.598444062221e-02 +-1.741885253668e-02 -1.875509005845e-02 -1.998642296793e-02 -2.110670323363e-02 +-2.211039542813e-02 -2.299260378803e-02 -2.374909578719e-02 -2.437632211141e-02 +-2.487143294193e-02 -2.523229047513e-02 -2.545747762597e-02 -2.554630288297e-02 +-2.549880130290e-02 -2.531573165410e-02 -2.499856973722e-02 -2.454949793267e-02 +-2.397139104361e-02 -2.326779852261e-02 -2.244292318909e-02 -2.150159656267e-02 +-2.044925095499e-02 -1.929188847931e-02 -1.803604715275e-02 -1.668876428104e-02 +-1.525753732897e-02 -1.375028249270e-02 -1.217529120126e-02 -1.054118478466e-02 +-8.856867555159e-03 -7.131478555480e-03 -5.374342234077e-03 -3.594918312353e-03 +-1.802751111959e-03 -7.418612344024e-06 1.781518490851e-03 3.554567456869e-03 +5.302353633065e-03 7.015669786734e-03 8.685524377140e-03 1.030318851581e-02 +1.186024137101e-02 1.334861378130e-02 1.476062985342e-02 1.608904633122e-02 +1.732708953465e-02 1.846848968165e-02 1.950751242013e-02 2.043898741241e-02 +2.125833383099e-02 2.196158264097e-02 2.254539556209e-02 2.300708062121e-02 +2.334460422435e-02 2.355659969619e-02 2.364237225367e-02 2.360190039936e-02 +2.343583373928e-02 2.314548724879e-02 2.273283202876e-02 2.220048261284e-02 +2.155168090449e-02 2.079027684038e-02 1.992070589320e-02 1.894796354391e-02 +1.787757686857e-02 1.671557340007e-02 1.546844743863e-02 1.414312399816e-02 +1.274692058738e-02 1.128750703527e-02 9.772863580432e-03 8.211237451988e-03 +6.611098177252e-03 4.981091857210e-03 3.329994655553e-03 1.666665750399e-03 +-1.322155203283e-13 -1.661119426622e-03 -3.307868200098e-03 -4.931527517535e-03 +-6.523530075100e-03 diff --git a/ABACUS.develop/examples/H2O-deepks-lcao/logout.bak b/ABACUS.develop/examples/H2O-deepks-lcao/logout.bak new file mode 100644 index 0000000000..90753c0739 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-lcao/logout.bak @@ -0,0 +1,82 @@ + ********************************************************* + * * + * WELCOME TO ABACUS * + * * + * 'Atomic-orbital Based Ab-initio * + * Computation at UStc' * + * * + * Website: http://abacus.ustc.edu.cn/ * + * * + ********************************************************* + Sun Jan 31 08:33:37 2021 + MAKE THE DIR : OUT.abacus/ + DONE(0.0260551 SEC) : SETUP UNITCELL + DONE(0.0263662 SEC) : INIT K-POINTS + Set NonLocal Pseudopotential Projectors + Set NonLocal Pseudopotential Projectors + --------------------------------------------------------- + This calculation is self-consistent + --------------------------------------------------------- + SPIN KPOINTS PROCESSORS NBASE VNA + 1 Gamma 1 23 No + --------------------------------------------------------- + Use Systematically Improvable Atomic bases + --------------------------------------------------------- + ELEMENT ORBITALS NBASE NATOM XC + H 2s1p-8au 5 2 PBE + O 2s2p1d-7au 13 1 PBE + --------------------------------------------------------- + Initial plane wave basis and FFT box + --------------------------------------------------------- + DONE(2.05283 SEC) : INIT PLANEWAVE + UNIFORM GRID DIM : 48 * 48 * 48 + UNIFORM GRID DIM(BIG): 24 * 24 * 24 + DONE(2.05708 SEC) : INIT CHARGE + DONE(2.05915 SEC) : INIT POTENTIAL + START POTENTIAL : atomic + --------------------------------------------------------- + SELF-CONSISTENT : + --------------------------------------------------------- + ITER ETOT(eV) EDIFF(eV) DRHO2 TIME(s) + GE1 -3.134306e+01 0.000000e+00 5.723e-01 2.655e+00 + GE2 -2.781937e+01 3.523688e+00 2.294e-01 2.212e+00 + GE3 -2.983035e+01 -2.010973e+00 6.208e-02 2.218e+00 + GE4 -2.986621e+01 -3.586508e-02 5.733e-02 2.227e+00 + GE5 -2.995450e+01 -8.828721e-02 5.451e-03 2.181e+00 + GE6 -2.995491e+01 -4.083400e-04 5.742e-04 2.256e+00 + GE7 -2.995495e+01 -3.913860e-05 1.328e-04 2.219e+00 + GE8 -2.995494e+01 5.743730e-06 2.460e-05 2.356e+00 + GE9 -2.995494e+01 -1.697013e-06 6.807e-06 2.237e+00 + GE10 -2.995494e+01 -6.295011e-07 2.400e-07 2.240e+00 + GE11 -2.995494e+01 2.095797e-08 3.145e-08 2.236e+00 + GE12 -2.995494e+01 3.105281e-09 2.690e-09 2.086e+00 + + |CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%------- + A DC_Driv reading 2 1 2 50 % + B Hamilt_Linear set_orb_tables 1.9 1 1.9 49 % + C LCAO_Orbitals Read_Orbitals 1.2 1 1.2 29 % + C Use_Overlap_Table gen_tables 0.78 1 0.78 20 % + D Make_Overlap_Table init_Table 0.46 1 0.46 11 % + D Make_Overlap_Table init_Table_Beta 0.17 1 0.17 4.3 % + A DC_Driv solve_eachf 1.9 1 1.9 48 % + B Run_Frag frag_LCAO_line 1.9 1 1.9 48 % + X FFT FFT3D 0.36 169 0.0021 9.1 % + E potential v_of_rho 0.91 13 0.07 23 % + C Local_Orbital_Ions opt_ions 1.8 1 1.8 46 % + D Local_Orbital_Elec scf 1.7 1 1.7 43 % + E Local_Orbital_Elec cal_bands 0.32 12 0.026 8 % + F Use_Hamilt_Matrix cal_Hgamma 0.3 12 0.025 7.7 % + J Gint_Gamma cal_vlocal 0.3 12 0.025 7.7 % + K Gint_Gamma gamma_vlocal 0.3 12 0.025 7.7 % + E Local_Orbital_Cha sum_bands 0.35 12 0.029 8.8 % + F Gint_Gamma cal_rho 0.34 12 0.029 8.6 % + I Gint_Gamma gamma_charge 0.34 12 0.029 8.6 % + J Gint_Gamma rho_psir_ylm 0.98 164631 5.9e-06 25 % + J Gint_Gamma cal_band_rho 1.5 159095 9.7e-06 39 % + E Charge mix_rho 0.19 12 0.016 4.7 % + ---------------------------------------------------------------------------------------- + + START Time : Sun Jan 31 08:33:37 2021 + FINISH Time : Sun Jan 31 08:33:41 2021 + TOTAL Time : 4 + SEE INFORMATION IN : OUT.abacus/ diff --git a/ABACUS.develop/examples/H2O-deepks-pw/H_ONCV_PBE-1.0.upf b/ABACUS.develop/examples/H2O-deepks-pw/H_ONCV_PBE-1.0.upf new file mode 100644 index 0000000000..f8b1ebb63c --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/H_ONCV_PBE-1.0.upf @@ -0,0 +1,897 @@ + + + + This pseudopotential file has been produced using the code + ONCVPSP (Optimized Norm-Conservinng Vanderbilt PSeudopotential) + scalar-relativistic version 2.1.1, 03/26/2014 by D. R. Hamann + The code is available through a link at URL www.mat-simresearch.com. + Documentation with the package provides a full discription of the + input data below. + + + While it is not required under the terms of the GNU GPL, it is + suggested that you cite D. R. Hamann, Phys. Rev. B 88, 085117 (2013) + in any publication using these pseudopotentials. + + + Copyright 2015 The Regents of the University of California + + This work is licensed under the Creative Commons Attribution-ShareAlike + 4.0 International License. To view a copy of this license, visit + http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to + Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + + This pseudopotential is part of the Schlipf-Gygi norm-conserving + pseudopotential library. Its construction parameters were tuned to + reproduce materials of a training set with very high accuracy and + should be suitable as a general purpose pseudopotential to treat a + variety of different compounds. For details of the construction and + testing of the pseudopotential please refer to: + + [insert reference to paper here] + + We kindly ask that you include this reference in all publications + associated to this pseudopotential. + + + +# ATOM AND REFERENCE CONFIGURATION +# atsym z nc nv iexc psfile + H 1.00 0 1 4 upf +# +# n l f energy (Ha) + 1 0 1.00 +# +# PSEUDOPOTENTIAL AND OPTIMIZATION +# lmax + 0 +# +# l, rc, ep, ncon, nbas, qcut + 0 1.13748 -0.23860 5 8 9.72141 +# +# LOCAL POTENTIAL +# lloc, lpopt, rc(5), dvloc0 + 4 5 0.49352 0.00000 +# +# VANDERBILT-KLEINMAN-BYLANDER PROJECTORs +# l, nproj, debl + 0 2 1.27464 +# +# MODEL CORE CHARGE +# icmod, fcfact + 0 0.00000 +# +# LOG DERIVATIVE ANALYSIS +# epsh1, epsh2, depsh + -5.00 3.00 0.02 +# +# OUTPUT GRID +# rlmax, drl + 6.00 0.01 +# +# TEST CONFIGURATIONS +# ncnf + 0 +# nvcnf +# n l f + + + + + + + + + 0.0000 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 + 0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 + 0.1600 0.1700 0.1800 0.1900 0.2000 0.2100 0.2200 0.2300 + 0.2400 0.2500 0.2600 0.2700 0.2800 0.2900 0.3000 0.3100 + 0.3200 0.3300 0.3400 0.3500 0.3600 0.3700 0.3800 0.3900 + 0.4000 0.4100 0.4200 0.4300 0.4400 0.4500 0.4600 0.4700 + 0.4800 0.4900 0.5000 0.5100 0.5200 0.5300 0.5400 0.5500 + 0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200 0.6300 + 0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100 + 0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900 + 0.8000 0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700 + 0.8800 0.8900 0.9000 0.9100 0.9200 0.9300 0.9400 0.9500 + 0.9600 0.9700 0.9800 0.9900 1.0000 1.0100 1.0200 1.0300 + 1.0400 1.0500 1.0600 1.0700 1.0800 1.0900 1.1000 1.1100 + 1.1200 1.1300 1.1400 1.1500 1.1600 1.1700 1.1800 1.1900 + 1.2000 1.2100 1.2200 1.2300 1.2400 1.2500 1.2600 1.2700 + 1.2800 1.2900 1.3000 1.3100 1.3200 1.3300 1.3400 1.3500 + 1.3600 1.3700 1.3800 1.3900 1.4000 1.4100 1.4200 1.4300 + 1.4400 1.4500 1.4600 1.4700 1.4800 1.4900 1.5000 1.5100 + 1.5200 1.5300 1.5400 1.5500 1.5600 1.5700 1.5800 1.5900 + 1.6000 1.6100 1.6200 1.6300 1.6400 1.6500 1.6600 1.6700 + 1.6800 1.6900 1.7000 1.7100 1.7200 1.7300 1.7400 1.7500 + 1.7600 1.7700 1.7800 1.7900 1.8000 1.8100 1.8200 1.8300 + 1.8400 1.8500 1.8600 1.8700 1.8800 1.8900 1.9000 1.9100 + 1.9200 1.9300 1.9400 1.9500 1.9600 1.9700 1.9800 1.9900 + 2.0000 2.0100 2.0200 2.0300 2.0400 2.0500 2.0600 2.0700 + 2.0800 2.0900 2.1000 2.1100 2.1200 2.1300 2.1400 2.1500 + 2.1600 2.1700 2.1800 2.1900 2.2000 2.2100 2.2200 2.2300 + 2.2400 2.2500 2.2600 2.2700 2.2800 2.2900 2.3000 2.3100 + 2.3200 2.3300 2.3400 2.3500 2.3600 2.3700 2.3800 2.3900 + 2.4000 2.4100 2.4200 2.4300 2.4400 2.4500 2.4600 2.4700 + 2.4800 2.4900 2.5000 2.5100 2.5200 2.5300 2.5400 2.5500 + 2.5600 2.5700 2.5800 2.5900 2.6000 2.6100 2.6200 2.6300 + 2.6400 2.6500 2.6600 2.6700 2.6800 2.6900 2.7000 2.7100 + 2.7200 2.7300 2.7400 2.7500 2.7600 2.7700 2.7800 2.7900 + 2.8000 2.8100 2.8200 2.8300 2.8400 2.8500 2.8600 2.8700 + 2.8800 2.8900 2.9000 2.9100 2.9200 2.9300 2.9400 2.9500 + 2.9600 2.9700 2.9800 2.9900 3.0000 3.0100 3.0200 3.0300 + 3.0400 3.0500 3.0600 3.0700 3.0800 3.0900 3.1000 3.1100 + 3.1200 3.1300 3.1400 3.1500 3.1600 3.1700 3.1800 3.1900 + 3.2000 3.2100 3.2200 3.2300 3.2400 3.2500 3.2600 3.2700 + 3.2800 3.2900 3.3000 3.3100 3.3200 3.3300 3.3400 3.3500 + 3.3600 3.3700 3.3800 3.3900 3.4000 3.4100 3.4200 3.4300 + 3.4400 3.4500 3.4600 3.4700 3.4800 3.4900 3.5000 3.5100 + 3.5200 3.5300 3.5400 3.5500 3.5600 3.5700 3.5800 3.5900 + 3.6000 3.6100 3.6200 3.6300 3.6400 3.6500 3.6600 3.6700 + 3.6800 3.6900 3.7000 3.7100 3.7200 3.7300 3.7400 3.7500 + 3.7600 3.7700 3.7800 3.7900 3.8000 3.8100 3.8200 3.8300 + 3.8400 3.8500 3.8600 3.8700 3.8800 3.8900 3.9000 3.9100 + 3.9200 3.9300 3.9400 3.9500 3.9600 3.9700 3.9800 3.9900 + 4.0000 4.0100 4.0200 4.0300 4.0400 4.0500 4.0600 4.0700 + 4.0800 4.0900 4.1000 4.1100 4.1200 4.1300 4.1400 4.1500 + 4.1600 4.1700 4.1800 4.1900 4.2000 4.2100 4.2200 4.2300 + 4.2400 4.2500 4.2600 4.2700 4.2800 4.2900 4.3000 4.3100 + 4.3200 4.3300 4.3400 4.3500 4.3600 4.3700 4.3800 4.3900 + 4.4000 4.4100 4.4200 4.4300 4.4400 4.4500 4.4600 4.4700 + 4.4800 4.4900 4.5000 4.5100 4.5200 4.5300 4.5400 4.5500 + 4.5600 4.5700 4.5800 4.5900 4.6000 4.6100 4.6200 4.6300 + 4.6400 4.6500 4.6600 4.6700 4.6800 4.6900 4.7000 4.7100 + 4.7200 4.7300 4.7400 4.7500 4.7600 4.7700 4.7800 4.7900 + 4.8000 4.8100 4.8200 4.8300 4.8400 4.8500 4.8600 4.8700 + 4.8800 4.8900 4.9000 4.9100 4.9200 4.9300 4.9400 4.9500 + 4.9600 4.9700 4.9800 4.9900 5.0000 5.0100 5.0200 5.0300 + 5.0400 5.0500 5.0600 5.0700 5.0800 5.0900 5.1000 5.1100 + 5.1200 5.1300 5.1400 5.1500 5.1600 5.1700 5.1800 5.1900 + 5.2000 5.2100 5.2200 5.2300 5.2400 5.2500 5.2600 5.2700 + 5.2800 5.2900 5.3000 5.3100 5.3200 5.3300 5.3400 5.3500 + 5.3600 5.3700 5.3800 5.3900 5.4000 5.4100 5.4200 5.4300 + 5.4400 5.4500 5.4600 5.4700 5.4800 5.4900 5.5000 5.5100 + 5.5200 5.5300 5.5400 5.5500 5.5600 5.5700 5.5800 5.5900 + 5.6000 5.6100 5.6200 5.6300 5.6400 5.6500 5.6600 5.6700 + 5.6800 5.6900 5.7000 5.7100 5.7200 5.7300 5.7400 5.7500 + 5.7600 5.7700 5.7800 5.7900 5.8000 5.8100 5.8200 5.8300 + 5.8400 5.8500 5.8600 5.8700 5.8800 5.8900 5.9000 5.9100 + 5.9200 5.9300 5.9400 5.9500 5.9600 5.9700 5.9800 5.9900 + 6.0000 6.0100 + + + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 + + + + -9.0610437558E+00 -9.0568179440E+00 -9.0440368423E+00 -9.0228074240E+00 + -8.9932366622E+00 -8.9554713856E+00 -8.9096955089E+00 -8.8561267684E+00 + -8.7950131219E+00 -8.7266289853E+00 -8.6512714714E+00 -8.5692567717E+00 + -8.4809167973E+00 -8.3865961577E+00 -8.2866495257E+00 -8.1814394040E+00 + -8.0713342805E+00 -7.9567071423E+00 -7.8379342970E+00 -7.7153944473E+00 + -7.5894679553E+00 -7.4605362378E+00 -7.3289812341E+00 -7.1951848958E+00 + -7.0595286560E+00 -6.9223928378E+00 -6.7841559816E+00 -6.6451940571E+00 + -6.5058795596E+00 -6.3665804704E+00 -6.2276590796E+00 -6.0894706704E+00 + -5.9523620796E+00 -5.8166700798E+00 -5.6827196991E+00 -5.5508223633E+00 + -5.4212739530E+00 -5.2943527007E+00 -5.1703170897E+00 -5.0494035400E+00 + -4.9318240186E+00 -4.8177636487E+00 -4.7073781566E+00 -4.6007912591E+00 + -4.4980919767E+00 -4.3993318735E+00 -4.3045222275E+00 -4.2136312137E+00 + -4.1265808607E+00 -4.0432438377E+00 -3.9634411592E+00 -3.8869595066E+00 + -3.8135916025E+00 -3.7431452942E+00 -3.6754419749E+00 -3.6103158908E+00 + -3.5476125181E+00 -3.4871882092E+00 -3.4289088467E+00 -3.3726496295E+00 + -3.3182938607E+00 -3.2657329154E+00 -3.2148652694E+00 -3.1655961918E+00 + -3.1178374334E+00 -3.0715065944E+00 -3.0265268914E+00 -2.9828269546E+00 + -2.9403403441E+00 -2.8990053187E+00 -2.8587646530E+00 -2.8195654255E+00 + -2.7813586956E+00 -2.7440993328E+00 -2.7077458096E+00 -2.6722599695E+00 + -2.6376068987E+00 -2.6037546665E+00 -2.5706741108E+00 -2.5383386428E+00 + -2.5067240362E+00 -2.4758082142E+00 -2.4455710353E+00 -2.4159940785E+00 + -2.3870604303E+00 -2.3587544755E+00 -2.3310616932E+00 -2.3039684604E+00 + -2.2774618664E+00 -2.2515295388E+00 -2.2261594843E+00 -2.2013399461E+00 + -2.1770592791E+00 -2.1533058441E+00 -2.1300679226E+00 -2.1073336580E+00 + -2.0850909954E+00 -2.0633276674E+00 -2.0420311892E+00 -2.0211888715E+00 + -2.0007878496E+00 -1.9808151272E+00 -1.9612576275E+00 -1.9421022557E+00 + -1.9233359852E+00 -1.9049459279E+00 -1.8869194114E+00 -1.8692440280E+00 + -1.8519077546E+00 -1.8348990301E+00 -1.8182067760E+00 -1.8018204402E+00 + -1.7857300225E+00 -1.7699262307E+00 -1.7544003587E+00 -1.7391444068E+00 + -1.7241513910E+00 -1.7094149041E+00 -1.6949283914E+00 -1.6806851418E+00 + -1.6666793118E+00 -1.6529050288E+00 -1.6393565372E+00 -1.6260283354E+00 + -1.6129151224E+00 -1.6000117236E+00 -1.5873131231E+00 -1.5748145186E+00 + -1.5625112075E+00 -1.5503986290E+00 -1.5384724172E+00 -1.5267282808E+00 + -1.5151620774E+00 -1.5037698221E+00 -1.4925475838E+00 -1.4814916063E+00 + -1.4705982343E+00 -1.4598638619E+00 -1.4492850817E+00 -1.4388585096E+00 + -1.4285808834E+00 -1.4184490612E+00 -1.4084599113E+00 -1.3986104920E+00 + -1.3888978631E+00 -1.3793192008E+00 -1.3698717674E+00 -1.3605528496E+00 + -1.3513598874E+00 -1.3422902990E+00 -1.3333416549E+00 -1.3245115294E+00 + -1.3157975913E+00 -1.3071975681E+00 -1.2987092220E+00 -1.2903304217E+00 + -1.2820590200E+00 -1.2738930123E+00 -1.2658303454E+00 -1.2578691201E+00 + -1.2500073905E+00 -1.2422433402E+00 -1.2345751282E+00 -1.2270010179E+00 + -1.2195192646E+00 -1.2121282090E+00 -1.2048261947E+00 -1.1976116375E+00 + -1.1904829614E+00 -1.1834386556E+00 -1.1764772175E+00 -1.1695972076E+00 + -1.1627971899E+00 -1.1560757951E+00 -1.1494316470E+00 -1.1428634453E+00 + -1.1363698679E+00 -1.1299496816E+00 -1.1236016133E+00 -1.1173244954E+00 + -1.1111170992E+00 -1.1049783153E+00 -1.0989069715E+00 -1.0929019971E+00 + -1.0869622832E+00 -1.0810867896E+00 -1.0752744716E+00 -1.0695243151E+00 + -1.0638353388E+00 -1.0582065507E+00 -1.0526370315E+00 -1.0471258093E+00 + -1.0416720144E+00 -1.0362747227E+00 -1.0309330806E+00 -1.0256462248E+00 + -1.0204133106E+00 -1.0152335359E+00 -1.0101060634E+00 -1.0050301401E+00 + -1.0000049637E+00 -9.9502979509E-01 -9.9010388850E-01 -9.8522650356E-01 + -9.8039695184E-01 -9.7561449875E-01 -9.7087848953E-01 -9.6618823633E-01 + -9.6154307709E-01 -9.5694238357E-01 -9.5238548542E-01 -9.4787179443E-01 + -9.4340068216E-01 -9.3897154786E-01 -9.3458382085E-01 -9.3023689119E-01 + -9.2593022219E-01 -9.2166324612E-01 -9.1743540867E-01 -9.1324619440E-01 + -9.0909505086E-01 -9.0498147929E-01 -9.0090497409E-01 -8.9686501466E-01 + -8.9286113809E-01 -8.8889284780E-01 -8.8495967058E-01 -8.8106115837E-01 + -8.7719683072E-01 -8.7336625731E-01 -8.6956900186E-01 -8.6580460671E-01 + -8.6207267364E-01 -8.5837277569E-01 -8.5470449112E-01 -8.5106743638E-01 + -8.4746119942E-01 -8.4388539099E-01 -8.4033964140E-01 -8.3682355391E-01 + -8.3333676803E-01 -8.2987892766E-01 -8.2644965155E-01 -8.2304860442E-01 + -8.1967544372E-01 -8.1632980376E-01 -8.1301137110E-01 -8.0971981657E-01 + -8.0645479078E-01 -8.0321599828E-01 -8.0000312317E-01 -7.9681583368E-01 + -7.9365384812E-01 -7.9051686526E-01 -7.8740456836E-01 -7.8431668932E-01 + -7.8125294167E-01 -7.7821302127E-01 -7.7519667347E-01 -7.7220362543E-01 + -7.6923358691E-01 -7.6628631304E-01 -7.6336154485E-01 -7.6045900684E-01 + -7.5757846086E-01 -7.5471966218E-01 -7.5188235009E-01 -7.4906629106E-01 + -7.4627125457E-01 -7.4349699489E-01 -7.4074328111E-01 -7.3800989688E-01 + -7.3529661160E-01 -7.3260319525E-01 -7.2992944541E-01 -7.2727514676E-01 + -7.2464006883E-01 -7.2202402266E-01 -7.1942680330E-01 -7.1684819373E-01 + -7.1428800302E-01 -7.1174604062E-01 -7.0922210469E-01 -7.0671599945E-01 + -7.0422754882E-01 -7.0175656648E-01 -6.9930285090E-01 -6.9686623967E-01 + -6.9444655518E-01 -6.9204361057E-01 -6.8965723548E-01 -6.8728726731E-01 + -6.8493353479E-01 -6.8259585830E-01 -6.8027408946E-01 -6.7796806685E-01 + -6.7567761966E-01 -6.7340259451E-01 -6.7114284334E-01 -6.6889821110E-01 + -6.6666853234E-01 -6.6445367341E-01 -6.6225348756E-01 -6.6006782094E-01 + -6.5789652969E-01 -6.5573948134E-01 -6.5359653600E-01 -6.5146754198E-01 + -6.4935237457E-01 -6.4725090244E-01 -6.4516298961E-01 -6.4308849538E-01 + -6.4102730352E-01 -6.3897928686E-01 -6.3694431188E-01 -6.3492225321E-01 + -6.3291299679E-01 -6.3091642140E-01 -6.2893239660E-01 -6.2696081023E-01 + -6.2500155065E-01 -6.2305450228E-01 -6.2111953833E-01 -6.1919655775E-01 + -6.1728545168E-01 -6.1538610939E-01 -6.1349840980E-01 -6.1162225937E-01 + -6.0975755301E-01 -6.0790418385E-01 -6.0606203900E-01 -6.0423102850E-01 + -6.0241105218E-01 -6.0060200743E-01 -5.9880378789E-01 -5.9701630748E-01 + -5.9523947068E-01 -5.9347317955E-01 -5.9171733268E-01 -5.8997184815E-01 + -5.8823663490E-01 -5.8651159997E-01 -5.8479664543E-01 -5.8309169382E-01 + -5.8139665833E-01 -5.7971145131E-01 -5.7803597694E-01 -5.7637016247E-01 + -5.7471392514E-01 -5.7306718215E-01 -5.7142984084E-01 -5.6980183110E-01 + -5.6818307475E-01 -5.6657349289E-01 -5.6497299873E-01 -5.6338152110E-01 + -5.6179898754E-01 -5.6022532279E-01 -5.5866044633E-01 -5.5710428471E-01 + -5.5555677140E-01 -5.5401783464E-01 -5.5248740049E-01 -5.5096539222E-01 + -5.4945174929E-01 -5.4794640331E-01 -5.4644928588E-01 -5.4496032010E-01 + -5.4347944752E-01 -5.4200660421E-01 -5.4054172497E-01 -5.3908473990E-01 + -5.3763558480E-01 -5.3619420258E-01 -5.3476053107E-01 -5.3333450778E-01 + -5.3191606202E-01 -5.3050514339E-01 -5.2910169262E-01 -5.2770565043E-01 + -5.2631695259E-01 -5.2493554186E-01 -5.2356136607E-01 -5.2219436872E-01 + -5.2083449329E-01 -5.1948167463E-01 -5.1813586721E-01 -5.1679701734E-01 + -5.1546507114E-01 -5.1413997141E-01 -5.1282166293E-01 -5.1151009987E-01 + -5.1020523087E-01 -5.0890700456E-01 -5.0761536348E-01 -5.0633026144E-01 + -5.0505165203E-01 -5.0377948626E-01 -5.0251371517E-01 -5.0125428164E-01 + -5.0000114694E-01 -4.9875426449E-01 -4.9751358757E-01 -4.9627906774E-01 + -4.9505065408E-01 -4.9382830847E-01 -4.9261198641E-01 -4.9140164337E-01 + -4.9019723176E-01 -4.8899870589E-01 -4.8780602831E-01 -4.8661915658E-01 + -4.8543804824E-01 -4.8426265702E-01 -4.8309294118E-01 -4.8192886432E-01 + -4.8077038597E-01 -4.7961746566E-01 -4.7847005879E-01 -4.7732812642E-01 + -4.7619163356E-01 -4.7506054163E-01 -4.7393481203E-01 -4.7281440223E-01 + -4.7169927496E-01 -4.7058939701E-01 -4.6948473158E-01 -4.6838524190E-01 + -4.6729088781E-01 -4.6620163267E-01 -4.6511744539E-01 -4.6403829091E-01 + -4.6296413415E-01 -4.6189493768E-01 -4.6083066451E-01 -4.5977128600E-01 + -4.5871676870E-01 -4.5766707919E-01 -4.5662218308E-01 -4.5558204211E-01 + -4.5454663035E-01 -4.5351591594E-01 -4.5248986699E-01 -4.5146845163E-01 + -4.5045163204E-01 -4.4943938274E-01 -4.4843167416E-01 -4.4742847591E-01 + -4.4642975759E-01 -4.4543548505E-01 -4.4444562951E-01 -4.4346016491E-01 + -4.4247906228E-01 -4.4150229265E-01 -4.4052982584E-01 -4.3956162903E-01 + -4.3859767986E-01 -4.3763795070E-01 -4.3668241393E-01 -4.3573104192E-01 + -4.3478380238E-01 -4.3384067158E-01 -4.3290162488E-01 -4.3196663593E-01 + -4.3103567840E-01 -4.3010872454E-01 -4.2918574490E-01 -4.2826671914E-01 + -4.2735162215E-01 -4.2644042882E-01 -4.2553311405E-01 -4.2462964878E-01 + -4.2373001042E-01 -4.2283417718E-01 -4.2194212512E-01 -4.2105383031E-01 + -4.2016926876E-01 -4.1928841078E-01 -4.1841123932E-01 -4.1753773154E-01 + -4.1666786462E-01 -4.1580161574E-01 -4.1493896037E-01 -4.1407987359E-01 + -4.1322433773E-01 -4.1237233102E-01 -4.1152383170E-01 -4.1067881801E-01 + -4.0983726529E-01 -4.0899915239E-01 -4.0816446135E-01 -4.0733317141E-01 + -4.0650526184E-01 -4.0568071187E-01 -4.0485949712E-01 -4.0404159922E-01 + -4.0322700028E-01 -4.0241568050E-01 -4.0160762012E-01 -4.0080279935E-01 + -4.0000119443E-01 -3.9920278882E-01 -3.9840756506E-01 -3.9761550429E-01 + -3.9682658765E-01 -3.9604079630E-01 -3.9525810742E-01 -3.9447850542E-01 + -3.9370197363E-01 -3.9292849408E-01 -3.9215804879E-01 -3.9139061977E-01 + -3.9062618552E-01 -3.8986473052E-01 -3.8910623925E-01 -3.8835069457E-01 + -3.8759807933E-01 -3.8684837639E-01 -3.8610156584E-01 -3.8535763147E-01 + -3.8461655919E-01 -3.8387833266E-01 -3.8314293554E-01 -3.8241035148E-01 + -3.8168056246E-01 -3.8095355083E-01 -3.8022930425E-01 -3.7950780711E-01 + -3.7878904385E-01 -3.7807299889E-01 -3.7735965635E-01 -3.7664899651E-01 + -3.7594100897E-01 -3.7523567887E-01 -3.7453299135E-01 -3.7383293156E-01 + -3.7313548465E-01 -3.7244063248E-01 -3.7174836252E-01 -3.7105866202E-01 + -3.7037151682E-01 -3.6968691275E-01 -3.6900483566E-01 -3.6832527016E-01 + -3.6764820011E-01 -3.6697361536E-01 -3.6630150240E-01 -3.6563184773E-01 + -3.6496463784E-01 -3.6429985924E-01 -3.6363749507E-01 -3.6297753451E-01 + -3.6231996581E-01 -3.6166477608E-01 -3.6101195247E-01 -3.6036148208E-01 + -3.5971335135E-01 -3.5906754455E-01 -3.5842405304E-01 -3.5778286454E-01 + -3.5714396678E-01 -3.5650734748E-01 -3.5587299437E-01 -3.5524089309E-01 + -3.5461103153E-01 -3.5398340017E-01 -3.5335798731E-01 -3.5273478124E-01 + -3.5211377027E-01 -3.5149494269E-01 -3.5087828373E-01 -3.5026378405E-01 + -3.4965143359E-01 -3.4904122118E-01 -3.4843313568E-01 -3.4782716591E-01 + -3.4722330074E-01 -3.4662152533E-01 -3.4602183228E-01 -3.4542421132E-01 + -3.4482865181E-01 -3.4423514312E-01 -3.4364367460E-01 -3.4305423563E-01 + -3.4246681166E-01 -3.4188139641E-01 -3.4129797977E-01 -3.4071655158E-01 + -3.4013710172E-01 -3.3955962003E-01 -3.3898409638E-01 -3.3841051679E-01 + -3.3783887542E-01 -3.3726916258E-01 -3.3670136861E-01 -3.3613548384E-01 + -3.3557149861E-01 -3.3500940324E-01 -3.3444918462E-01 -3.3389083661E-01 + -3.3333435031E-01 -3.3277971650E-01 + + + + 0.0000000000E+00 -2.6088547982E-01 -5.1833275472E-01 -7.6895641941E-01 + -1.0094757748E+00 -1.2367649640E+00 -1.4479004921E+00 -1.6402053307E+00 + -1.8112888675E+00 -1.9590820386E+00 -2.0818670611E+00 -2.1783012866E+00 + -2.2474347945E+00 -2.2887214604E+00 -2.3020233440E+00 -2.2876083718E+00 + -2.2461413919E+00 -2.1786688108E+00 -2.0865971283E+00 -1.9716657861E+00 + -1.8359148921E+00 -1.6816483354E+00 -1.5113931252E+00 -1.3278555788E+00 + -1.1338753152E+00 -9.3237750193E-01 -7.2632508798E-01 -5.1867053707E-01 + -3.1230935470E-01 -1.1003518382E-01 8.5502335005E-02 2.7183628053E-01 + 4.4671684037E-01 6.0814212888E-01 7.5438240005E-01 8.8400019998E-01 + 9.9586420814E-01 1.0891579569E+00 1.1633817902E+00 1.2183503968E+00 + 1.2541845008E+00 1.2712971870E+00 1.2703761390E+00 1.2523616859E+00 + 1.2184214326E+00 1.1699221627E+00 1.1083997635E+00 1.0355281365E+00 + 9.5308744579E-01 8.6293235820E-01 7.6696227219E-01 6.6708583573E-01 + 5.6517138232E-01 4.6301269339E-01 3.6230358110E-01 2.6460354791E-01 + 1.7132725391E-01 8.3714876259E-02 2.8300950036E-03 -7.0461868736E-02 + -1.3548566127E-01 -1.9177104351E-01 -2.3903864371E-01 -2.7719764878E-01 + -3.0633813688E-01 -3.2671240755E-01 -3.3872209753E-01 -3.4290134301E-01 + -3.3989414704E-01 -3.3043492034E-01 -3.1532726713E-01 -2.9542143883E-01 + -2.7159339422E-01 -2.4472437166E-01 -2.1568159041E-01 -1.8530141020E-01 + -1.5437121547E-01 -1.2361699029E-01 -9.3692510618E-02 -6.5170103885E-02 + -3.8534327148E-02 -1.4178178357E-02 7.5982219585E-03 2.6586599843E-02 + 4.2667321458E-02 5.5804230200E-02 6.6037784474E-02 7.3476782950E-02 + 7.8288985480E-02 8.0690950459E-02 8.0937413388E-02 7.9310526716E-02 + 7.6109267813E-02 7.1639300505E-02 6.6203546315E-02 6.0094670030E-02 + 5.3585181276E-02 4.6922886516E-02 4.0325965406E-02 3.3979459512E-02 + 2.8033278554E-02 2.2601546887E-02 1.7764693923E-02 1.3566271071E-02 + 1.0019934924E-02 7.1127553803E-03 4.8089618584E-03 3.0547066732E-03 + 1.7812642827E-03 9.1198278094E-04 3.6682674818E-04 6.5692263071E-05 + -6.8632527182E-05 -1.1027997757E-04 -8.4781932173E-05 -7.5466225625E-06 + 5.5046813283E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 -6.6230384280E-02 -1.3227044522E-01 -1.9793408785E-01 + -2.6304354775E-01 -3.2743324392E-01 -3.9095326529E-01 -4.5347238282E-01 + -5.1488049086E-01 -5.7509039536E-01 -6.3403888294E-01 -6.9168702295E-01 + -7.4801967384E-01 -8.0304418574E-01 -8.5678831251E-01 -9.0929736637E-01 + -9.6063067143E-01 -1.0108573877E+00 -1.0600518025E+00 -1.1082881938E+00 + -1.1556354004E+00 -1.2021512134E+00 -1.2478767659E+00 -1.2928310462E+00 + -1.3370057140E+00 -1.3803603227E+00 -1.4228182118E+00 -1.4642630461E+00 + -1.5045363102E+00 -1.5434357567E+00 -1.5807149649E+00 -1.6160840886E+00 + -1.6492118605E+00 -1.6797288707E+00 -1.7072322005E+00 -1.7312913303E+00 + -1.7514553443E+00 -1.7672614056E+00 -1.7782442660E+00 -1.7839469588E+00 + -1.7839324513E+00 -1.7777959450E+00 -1.7651779669E+00 -1.7457779317E+00 + -1.7193680413E+00 -1.6858073499E+00 -1.6450558238E+00 -1.5971880652E+00 + -1.5424070527E+00 -1.4810575934E+00 -1.4136370872E+00 -1.3407629725E+00 + -1.2630862948E+00 -1.1812692944E+00 -1.0959852410E+00 -1.0079152517E+00 + -9.1774784801E-01 -8.2617381277E-01 -7.3388443997E-01 -6.4156480522E-01 + -5.4989159388E-01 -4.5952456379E-01 -3.7110347095E-01 -2.8524119151E-01 + -2.0251655480E-01 -1.2347058174E-01 -4.8599831493E-02 2.1650489647E-02 + 8.6889253952E-02 1.4678399897E-01 2.0106542651E-01 2.4953062217E-01 + 2.9204347185E-01 3.2853617819E-01 3.5900919836E-01 3.8352979134E-01 + 4.0223095680E-01 4.1530746441E-01 4.2301167574E-01 4.2564876217E-01 + 4.2357093422E-01 4.1717097424E-01 4.0687519421E-01 3.9313595295E-01 + 3.7642387716E-01 3.5721993688E-01 3.3600752955E-01 3.1326472631E-01 + 2.8945683082E-01 2.6502939400E-01 2.4040181789E-01 2.1596166863E-01 + 1.9205980225E-01 1.6900638782E-01 1.4706789081E-01 1.2646640479E-01 + 1.0737471459E-01 8.9919605583E-02 7.4182301027E-02 6.0200233461E-02 + 4.7969874788E-02 3.7450322138E-02 2.8568294126E-02 2.1219868525E-02 + 1.5278963151E-02 1.0602331228E-02 7.0348351713E-03 4.4142517848E-03 + 2.5774088544E-03 1.3667064349E-03 6.3345563442E-04 2.4137577893E-04 + 6.9281378302E-05 2.0772501814E-05 1.5017397331E-05 1.0881212294E-06 + -1.0503836267E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + -2.4016441487E+01 0.0000000000E+00 0.0000000000E+00 -1.0336462913E+00 + + + + + + 0.0000000000E+00 2.4794341471E-04 9.9091894057E-04 2.2263680628E-03 + 3.9500456984E-03 6.1560486329E-03 8.8368548808E-03 1.1983373531E-02 + 1.5585004525E-02 1.9629707710E-02 2.4104080427E-02 2.8993442803E-02 + 3.4281929867E-02 3.9952589544E-02 4.5987485557E-02 5.2367804247E-02 + 5.9073964300E-02 6.6085728409E-02 7.3382315882E-02 8.0942515274E-02 + 8.8744796138E-02 9.6767419086E-02 1.0498854333E-01 1.1338633103E-01 + 1.2193904783E-01 1.3062515893E-01 1.3942342031E-01 1.4831296458E-01 + 1.5727338117E-01 1.6628479066E-01 1.7532791282E-01 1.8438412840E-01 + 1.9343553473E-01 2.0246499428E-01 2.1145617765E-01 2.2039359948E-01 + 2.2926264851E-01 2.3804961085E-01 2.4674168841E-01 2.5532701021E-01 + 2.6379463827E-01 2.7213456885E-01 2.8033772768E-01 2.8839596035E-01 + 2.9630201805E-01 3.0404953869E-01 3.1163302393E-01 3.1904781286E-01 + 3.2629005077E-01 3.3335665407E-01 3.4024527527E-01 3.4695426557E-01 + 3.5348262690E-01 3.5982997159E-01 3.6599648316E-01 3.7198285339E-01 + 3.7779025613E-01 3.8342027746E-01 3.8887488964E-01 3.9415637933E-01 + 3.9926732777E-01 4.0421053528E-01 4.0898900016E-01 4.1360586662E-01 + 4.1806437563E-01 4.2236784139E-01 4.2651960765E-01 4.3052300623E-01 + 4.3438133902E-01 4.3809784793E-01 4.4167568640E-01 4.4511789734E-01 + 4.4842740211E-01 4.5160698378E-01 4.5465927654E-01 4.5758675943E-01 + 4.6039174939E-01 4.6307640307E-01 4.6564271888E-01 4.6809254111E-01 + 4.7042756695E-01 4.7264935579E-01 4.7475934017E-01 4.7675883847E-01 + 4.7864906862E-01 4.8043116285E-01 4.8210618286E-01 4.8367513530E-01 + 4.8513898716E-01 4.8649868075E-01 4.8775514807E-01 4.8890932424E-01 + 4.8996215983E-01 4.9091463191E-01 4.9176775358E-01 4.9252257613E-01 + 4.9318021185E-01 4.9374182540E-01 4.9420863911E-01 4.9458193531E-01 + 4.9486305613E-01 4.9505340201E-01 4.9515442062E-01 4.9516762730E-01 + 4.9509458085E-01 4.9493687901E-01 4.9469615451E-01 4.9437406196E-01 + 4.9397228868E-01 4.9349254046E-01 4.9293652709E-01 4.9230595866E-01 + 4.9160253929E-01 4.9082798382E-01 4.8998398626E-01 4.8907222166E-01 + 4.8809434735E-01 4.8705202061E-01 4.8594687199E-01 4.8478050140E-01 + 4.8355451132E-01 4.8227048421E-01 4.8092996944E-01 4.7953450212E-01 + 4.7808561574E-01 4.7658480457E-01 4.7503353906E-01 4.7343329913E-01 + 4.7178551873E-01 4.7009160857E-01 4.6835299066E-01 4.6657103314E-01 + 4.6474709403E-01 4.6288253276E-01 4.6097864623E-01 4.5903674889E-01 + 4.5705812988E-01 4.5504401645E-01 4.5299568348E-01 4.5091433129E-01 + 4.4880115759E-01 4.4665736345E-01 4.4448406520E-01 4.4228244437E-01 + 4.4005359528E-01 4.3779862199E-01 4.3551861800E-01 4.3321460984E-01 + 4.3088768122E-01 4.2853880795E-01 4.2616903012E-01 4.2377930732E-01 + 4.2137061147E-01 4.1894389471E-01 4.1650006236E-01 4.1404005773E-01 + 4.1156472312E-01 4.0907498816E-01 4.0657164288E-01 4.0405558773E-01 + 4.0152758537E-01 3.9898848719E-01 3.9643903481E-01 3.9388003353E-01 + 3.9131220208E-01 3.8873630343E-01 3.8615303095E-01 3.8356310956E-01 + 3.8096720441E-01 3.7836600704E-01 3.7576015114E-01 3.7315029989E-01 + 3.7053705201E-01 3.6792104757E-01 3.6530284664E-01 3.6268307155E-01 + 3.6006223998E-01 3.5744096187E-01 3.5481970890E-01 3.5219908368E-01 + 3.4957950873E-01 3.4696157326E-01 3.4434567985E-01 3.4173237209E-01 + 3.3912205408E-01 3.3651521191E-01 3.3391226115E-01 3.3131362397E-01 + 3.2871973492E-01 3.2613094713E-01 3.2354771963E-01 3.2097033407E-01 + 3.1839925340E-01 3.1583475732E-01 3.1327723928E-01 3.1072701520E-01 + 3.0818439374E-01 3.0564973754E-01 3.0312326636E-01 3.0060536753E-01 + 2.9809624731E-01 2.9559622996E-01 2.9310557269E-01 2.9062449750E-01 + 2.8815332279E-01 2.8569218837E-01 2.8324141465E-01 2.8080118028E-01 + 2.7837169267E-01 2.7595321500E-01 2.7354583751E-01 2.7114985674E-01 + 2.6876540189E-01 2.6639264465E-01 2.6403181011E-01 2.6168295407E-01 + 2.5934632864E-01 2.5702204381E-01 2.5471021239E-01 2.5241103884E-01 + 2.5012456127E-01 2.4785096372E-01 2.4559036883E-01 2.4334280687E-01 + 2.4110847696E-01 2.3888742000E-01 2.3667972467E-01 2.3448553732E-01 + 2.3230484695E-01 2.3013779622E-01 2.2798447164E-01 2.2584484162E-01 + 2.2371907224E-01 2.2160718423E-01 2.1950918491E-01 2.1742520274E-01 + 2.1535521910E-01 2.1329927590E-01 2.1125746569E-01 2.0922973692E-01 + 2.0721615973E-01 2.0521679417E-01 2.0323156191E-01 2.0126055392E-01 + 1.9930380230E-01 1.9736120736E-01 1.9543287344E-01 1.9351880846E-01 + 1.9161889992E-01 1.8973325450E-01 1.8786185993E-01 1.8600460254E-01 + 1.8416157699E-01 1.8233276208E-01 1.8051803620E-01 1.7871748583E-01 + 1.7693108606E-01 1.7515870043E-01 1.7340041110E-01 1.7165618863E-01 + 1.6992589269E-01 1.6820958701E-01 1.6650724345E-01 1.6481872662E-01 + 1.6314406985E-01 1.6148325248E-01 1.5983614921E-01 1.5820275480E-01 + 1.5658306061E-01 1.5497695691E-01 1.5338439180E-01 1.5180537259E-01 + 1.5023981072E-01 1.4868760030E-01 1.4714876754E-01 1.4562325032E-01 + 1.4411088316E-01 1.4261171261E-01 1.4112567980E-01 1.3965263949E-01 + 1.3819257554E-01 1.3674545831E-01 1.3531117665E-01 1.3388963650E-01 + 1.3248084168E-01 1.3108472136E-01 1.2970109889E-01 1.2833001076E-01 + 1.2697139008E-01 1.2562509939E-01 1.2429108335E-01 1.2296931894E-01 + 1.2165971717E-01 1.2036212317E-01 1.1907655698E-01 1.1780294648E-01 + 1.1654114810E-01 1.1529111045E-01 1.1405280258E-01 1.1282613765E-01 + 1.1161095024E-01 1.1040725990E-01 1.0921499300E-01 1.0803401854E-01 + 1.0686425527E-01 1.0570568262E-01 1.0455822148E-01 1.0342170539E-01 + 1.0229612790E-01 1.0118143008E-01 1.0007751189E-01 9.8984230691E-02 + 9.7901591614E-02 9.6829518883E-02 9.5767884597E-02 9.4716602554E-02 + 9.3675651345E-02 9.2644952595E-02 9.1624357062E-02 9.0613825474E-02 + 8.9613313452E-02 8.8622740963E-02 8.7641943554E-02 8.6670918562E-02 + 8.5709603256E-02 8.4757913158E-02 8.3815684928E-02 8.2882931486E-02 + 8.1959580376E-02 8.1045538566E-02 8.0140663081E-02 7.9244958367E-02 + 7.8358352085E-02 7.7480747512E-02 7.6612013484E-02 7.5752149816E-02 + 7.4901084880E-02 7.4058722878E-02 7.3224935982E-02 7.2399723308E-02 + 7.1583014448E-02 7.0774718909E-02 6.9974704043E-02 6.9182972050E-02 + 6.8399454182E-02 6.7624069401E-02 6.6856672591E-02 6.6097272493E-02 + 6.5345802386E-02 6.4602189287E-02 6.3866284591E-02 6.3138090627E-02 + 6.2417548303E-02 6.1704587356E-02 6.0999076474E-02 6.0300987164E-02 + 5.9610277067E-02 5.8926878874E-02 5.8250682553E-02 5.7581621736E-02 + 5.6919673704E-02 5.6264774278E-02 5.5616838504E-02 5.4975756187E-02 + 5.4341526243E-02 5.3714087760E-02 5.3093374958E-02 5.2479257060E-02 + 5.1871728058E-02 5.1270739451E-02 5.0676229134E-02 5.0088097362E-02 + 4.9506279485E-02 4.8930756928E-02 4.8361471290E-02 4.7798357672E-02 + 4.7241288817E-02 4.6690276084E-02 4.6145264773E-02 4.5606196203E-02 + 4.5072972721E-02 4.4545541444E-02 4.4023881815E-02 4.3507939101E-02 + 4.2997654834E-02 4.2492905991E-02 4.1993703269E-02 4.1499997132E-02 + 4.1011733250E-02 4.0528830544E-02 4.0051217904E-02 3.9578886841E-02 + 3.9111787057E-02 3.8649865000E-02 3.8193021326E-02 3.7741231625E-02 + 3.7294467263E-02 3.6852678829E-02 3.6415813870E-02 3.5983760247E-02 + 3.5556530198E-02 3.5134078994E-02 3.4716358396E-02 3.4303305080E-02 + 3.3894835682E-02 3.3490952616E-02 3.3091611670E-02 3.2696766006E-02 + 3.2306344980E-02 3.1920288091E-02 3.1538589081E-02 3.1161205154E-02 + 3.0788091067E-02 3.0419172782E-02 3.0054404780E-02 2.9693775584E-02 + 2.9337243976E-02 2.8984766463E-02 2.8636269166E-02 2.8291714111E-02 + 2.7951087999E-02 2.7614351317E-02 2.7281462438E-02 2.6952350866E-02 + 2.6626979290E-02 2.6305335782E-02 2.5987382630E-02 2.5673080163E-02 + 2.5362364216E-02 2.5055191839E-02 2.4751555386E-02 2.4451419017E-02 + 2.4154745071E-02 2.3861478444E-02 2.3571564847E-02 2.3285003479E-02 + 2.3001760410E-02 2.2721800031E-02 2.2445078789E-02 2.2171526061E-02 + 2.1901150013E-02 2.1633918647E-02 2.1369798413E-02 2.1108754197E-02 + 2.0850710883E-02 2.0595671221E-02 2.0343610458E-02 2.0094497098E-02 + 1.9848298202E-02 1.9604955310E-02 1.9364442566E-02 1.9126750436E-02 + 1.8891849457E-02 1.8659708833E-02 1.8430288872E-02 1.8203531688E-02 + 1.7979444001E-02 1.7757998342E-02 1.7539166017E-02 1.7322917097E-02 + 1.7109191383E-02 1.6897980399E-02 1.6689269114E-02 1.6483030879E-02 + 1.6279237912E-02 1.6077852629E-02 1.5878825755E-02 1.5682162720E-02 + 1.5487838857E-02 1.5295828455E-02 1.5106104755E-02 1.4918616206E-02 + 1.4733348857E-02 1.4550292886E-02 1.4369424576E-02 1.4190719249E-02 + 1.4014151128E-02 1.3839659221E-02 1.3667256683E-02 1.3496921706E-02 + 1.3328631601E-02 1.3162362793E-02 1.2998080875E-02 1.2835748138E-02 + 1.2675368275E-02 1.2516920489E-02 1.2360383178E-02 1.2205733920E-02 + 1.2052932833E-02 1.1901959252E-02 1.1752810004E-02 1.1605465350E-02 + 1.1459904808E-02 1.1316107146E-02 1.1174029833E-02 1.1033663349E-02 + 1.0895000275E-02 1.0758021954E-02 1.0622709048E-02 1.0489041530E-02 + 1.0356976695E-02 1.0226510813E-02 1.0097634680E-02 9.9703307378E-03 + 9.8445807986E-03 9.7203660474E-03 9.5976457522E-03 9.4764172062E-03 + 9.3566716576E-03 9.2383926415E-03 9.1215631207E-03 9.0061654822E-03 + 8.8921628626E-03 8.7795493594E-03 8.6683186485E-03 8.5584553503E-03 + 8.4499435627E-03 8.3427668572E-03 8.2368939208E-03 8.1323119604E-03 + 8.0290187790E-03 7.9270000634E-03 7.8262410234E-03 7.7267263895E-03 + 7.6284318873E-03 7.5313346684E-03 7.4354380585E-03 7.3407287840E-03 + 7.2471931373E-03 7.1548169739E-03 7.0635843287E-03 6.9734597403E-03 + 6.8844530956E-03 6.7965521281E-03 6.7097441767E-03 6.6240161831E-03 + 6.5393546899E-03 6.4557301699E-03 6.3731393266E-03 6.2915776433E-03 + 6.2110334645E-03 6.1314947748E-03 6.0529491959E-03 5.9753783320E-03 + 5.8987597471E-03 5.8230986296E-03 5.7483842858E-03 5.6746056953E-03 + 5.6017515092E-03 5.5298100485E-03 5.4587541386E-03 5.3885834526E-03 + 5.3192932870E-03 5.2508735670E-03 5.1833139204E-03 5.1166036764E-03 + 5.0507287806E-03 4.9856653379E-03 4.9214203547E-03 4.8579846503E-03 + 4.7953487751E-03 4.7335030098E-03 4.6724373639E-03 4.6121326368E-03 + 4.5525789599E-03 4.4937772672E-03 4.4357189771E-03 4.3783952646E-03 + 4.3217970601E-03 4.2659150477E-03 4.2107269600E-03 4.1562326781E-03 + 4.1024289394E-03 4.0493077557E-03 3.9968609188E-03 3.9450799988E-03 + 3.8939563432E-03 3.8434664007E-03 3.7936159723E-03 3.7443993547E-03 + 3.6958091420E-03 3.6478377293E-03 3.6004773117E-03 3.5537198828E-03 + 3.5075421006E-03 3.4619523711E-03 3.4169441116E-03 3.3725104825E-03 + 3.3286444647E-03 3.2853388583E-03 3.2425862821E-03 3.2003648485E-03 + 3.1586827452E-03 3.1175338565E-03 3.0769118893E-03 3.0368103888E-03 + 2.9972227375E-03 2.9581421546E-03 2.9195492532E-03 2.8814496160E-03 + 2.8438387299E-03 2.8067108257E-03 + + diff --git a/ABACUS.develop/examples/H2O-deepks-pw/H_gga_8au_60Ry_2s1p.orb b/ABACUS.develop/examples/H2O-deepks-pw/H_gga_8au_60Ry_2s1p.orb new file mode 100644 index 0000000000..48eaf466a1 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/H_gga_8au_60Ry_2s1p.orb @@ -0,0 +1,621 @@ +--------------------------------------------------------------------------- +Element H +Energy Cutoff(Ry) 60 +Radius Cutoff(a.u.) 8 +Lmax 1 +Number of Sorbital--> 2 +Number of Porbital--> 1 +--------------------------------------------------------------------------- +SUMMARY END + +Mesh 801 +dr 0.01 + Type L N + 0 0 0 + 1.837183001954e+00 1.836944589913e+00 1.836229654458e+00 1.835039096904e+00 + 1.833374417163e+00 1.831237710329e+00 1.828631661910e+00 1.825559541724e+00 + 1.822025196478e+00 1.818033041051e+00 1.813588048498e+00 1.808695738828e+00 + 1.803362166562e+00 1.797593907128e+00 1.791398042128e+00 1.784782143515e+00 + 1.777754256735e+00 1.770322882882e+00 1.762496959911e+00 1.754285842983e+00 + 1.745699283975e+00 1.736747410234e+00 1.727440702633e+00 1.717789972985e+00 + 1.707806340887e+00 1.697501210064e+00 1.686886244272e+00 1.675973342834e+00 + 1.664774615881e+00 1.653302359357e+00 1.641569029875e+00 1.629587219474e+00 + 1.617369630367e+00 1.604929049734e+00 1.592278324633e+00 1.579430337099e+00 + 1.566397979495e+00 1.553194130183e+00 1.539831629571e+00 1.526323256609e+00 + 1.512681705776e+00 1.498919564642e+00 1.485049292031e+00 1.471083196857e+00 + 1.457033417677e+00 1.442911903007e+00 1.428730392444e+00 1.414500398644e+00 + 1.400233190182e+00 1.385939775333e+00 1.371630886810e+00 1.357316967481e+00 + 1.343008157094e+00 1.328714280028e+00 1.314444834085e+00 1.300208980342e+00 + 1.286015534077e+00 1.271872956757e+00 1.257789349118e+00 1.243772445314e+00 + 1.229829608141e+00 1.215967825332e+00 1.202193706904e+00 1.188513483548e+00 + 1.174933006049e+00 1.161457745704e+00 1.148092795727e+00 1.134842873614e+00 + 1.121712324429e+00 1.108705124991e+00 1.095824888929e+00 1.083074872558e+00 + 1.070457981553e+00 1.057976778365e+00 1.045633490360e+00 1.033430018609e+00 + 1.021367947317e+00 1.009448553813e+00 9.976728190860e-01 9.860414387908e-01 + 9.745548346979e-01 9.632131665266e-01 9.520163441167e-01 9.409640398896e-01 + 9.300557015494e-01 9.192905649774e-01 9.086676672686e-01 8.981858598668e-01 + 8.878438217485e-01 8.776400726115e-01 8.675729860234e-01 8.576408024859e-01 + 8.478416423739e-01 8.381735187085e-01 8.286343497244e-01 8.192219711958e-01 + 8.099341484846e-01 8.007685882774e-01 7.917229499810e-01 7.827948567466e-01 + 7.739819060948e-01 7.652816801187e-01 7.566917552403e-01 7.482097115016e-01 + 7.398331413718e-01 7.315596580552e-01 7.233869032872e-01 7.153125546063e-01 + 7.073343320959e-01 6.994500045870e-01 6.916573953213e-01 6.839543870698e-01 + 6.763389267106e-01 6.688090292670e-01 6.613627814111e-01 6.539983444408e-01 + 6.467139567383e-01 6.395079357207e-01 6.323786792970e-01 6.253246668428e-01 + 6.183444597120e-01 6.114367012998e-01 6.046001166779e-01 5.978335118199e-01 + 5.911357724396e-01 5.845058624632e-01 5.779428221587e-01 5.714457659458e-01 + 5.650138799114e-01 5.586464190548e-01 5.523427042877e-01 5.461021192154e-01 + 5.399241067240e-01 5.338081653994e-01 5.277538458047e-01 5.217607466390e-01 + 5.158285108059e-01 5.099568214136e-01 5.041453977325e-01 4.983939911326e-01 + 4.927023810249e-01 4.870703708276e-01 4.814977839793e-01 4.759844600184e-01 + 4.705302507489e-01 4.651350165105e-01 4.597986225695e-01 4.545209356471e-01 + 4.493018205989e-01 4.441411372598e-01 4.390387374660e-01 4.339944622642e-01 + 4.290081393187e-01 4.240795805231e-01 4.192085798248e-01 4.143949112659e-01 + 4.096383272463e-01 4.049385570104e-01 4.002953053599e-01 3.957082515919e-01 + 3.911770486621e-01 3.867013225703e-01 3.822806719649e-01 3.779146679621e-01 + 3.736028541744e-01 3.693447469412e-01 3.651398357547e-01 3.609875838725e-01 + 3.568874291078e-01 3.528387847874e-01 3.488410408668e-01 3.448935651913e-01 + 3.409957048920e-01 3.371467879035e-01 3.333461245923e-01 3.295930094816e-01 + 3.258867230612e-01 3.222265336680e-01 3.186116994248e-01 3.150414702237e-01 + 3.115150897416e-01 3.080317974748e-01 3.045908307790e-01 3.011914269039e-01 + 2.978328250089e-01 2.945142681489e-01 2.912350052191e-01 2.879942928469e-01 + 2.847913972227e-01 2.816255958578e-01 2.784961792617e-01 2.754024525310e-01 + 2.723437368403e-01 2.693193708300e-01 2.663287118847e-01 2.633711372954e-01 + 2.604460453030e-01 2.575528560170e-01 2.546910122087e-01 2.518599799744e-01 + 2.490592492694e-01 2.462883343097e-01 2.435467738441e-01 2.408341312951e-01 + 2.381499947722e-01 2.354939769580e-01 2.328657148724e-01 2.302648695155e-01 + 2.276911253967e-01 2.251441899519e-01 2.226237928562e-01 2.201296852370e-01 + 2.176616387940e-01 2.152194448327e-01 2.128029132189e-01 2.104118712608e-01 + 2.080461625279e-01 2.057056456128e-01 2.033901928451e-01 2.010996889656e-01 + 1.988340297689e-01 1.965931207221e-01 1.943768755699e-01 1.921852149312e-01 + 1.900180648992e-01 1.878753556493e-01 1.857570200652e-01 1.836629923900e-01 + 1.815932069086e-01 1.795475966703e-01 1.775260922564e-01 1.755286206005e-01 + 1.735551038664e-01 1.716054583896e-01 1.696795936868e-01 1.677774115389e-01 + 1.658988051503e-01 1.640436583889e-01 1.622118451094e-01 1.604032285625e-01 + 1.586176608917e-01 1.568549827195e-01 1.551150228235e-01 1.533975979026e-01 + 1.517025124337e-01 1.500295586177e-01 1.483785164136e-01 1.467491536591e-01 + 1.451412262756e-01 1.435544785550e-01 1.419886435250e-01 1.404434433895e-01 + 1.389185900406e-01 1.374137856375e-01 1.359287232483e-01 1.344630875494e-01 + 1.330165555780e-01 1.315887975315e-01 1.301794776097e-01 1.287882548928e-01 + 1.274147842501e-01 1.260587172734e-01 1.247197032295e-01 1.233973900255e-01 + 1.220914251803e-01 1.208014567985e-01 1.195271345385e-01 1.182681105707e-01 + 1.170240405197e-01 1.157945843848e-01 1.145794074346e-01 1.133781810696e-01 + 1.121905836491e-01 1.110163012772e-01 1.098550285439e-01 1.087064692189e-01 + 1.075703368914e-01 1.064463555568e-01 1.053342601443e-01 1.042337969845e-01 + 1.031447242151e-01 1.020668121220e-01 1.009998434160e-01 9.994361344292e-02 + 9.889793032764e-02 9.786261505153e-02 9.683750146373e-02 9.582243622695e-02 + 9.481727869892e-02 9.382190075086e-02 9.283618652485e-02 9.186003213200e-02 + 9.089334529416e-02 8.993604493153e-02 8.898806069949e-02 8.804933247767e-02 + 8.711980981492e-02 8.619945133369e-02 8.528822409791e-02 8.438610294830e-02 + 8.349306980927e-02 8.260911297183e-02 8.173422635677e-02 8.086840876262e-02 + 8.001166310290e-02 7.916399563701e-02 7.832541519936e-02 7.749593243119e-02 + 7.667555901919e-02 7.586430694553e-02 7.506218775311e-02 7.426921183030e-02 + 7.348538771882e-02 7.271072144857e-02 7.194521590274e-02 7.118887021660e-02 + 7.044167921281e-02 6.970363287618e-02 6.897471587029e-02 6.825490709826e-02 + 6.754417930953e-02 6.684249875447e-02 6.614982488807e-02 6.546611012376e-02 + 6.479129963827e-02 6.412533122782e-02 6.346813521597e-02 6.281963441282e-02 + 6.217974412524e-02 6.154837221742e-02 6.092541922062e-02 6.031077849093e-02 + 5.970433641353e-02 5.910597265146e-02 5.851556043717e-02 5.793296690431e-02 + 5.735805345748e-02 5.679067617719e-02 5.623068625723e-02 5.567793047149e-02 + 5.513225166709e-02 5.459348928055e-02 5.406147987367e-02 5.353605768584e-02 + 5.301705519908e-02 5.250430371249e-02 5.199763392254e-02 5.149687650562e-02 + 5.100186269951e-02 5.051242488017e-02 5.002839713058e-02 4.954961579826e-02 + 4.907592003841e-02 4.860715233943e-02 4.814315902803e-02 4.768379075103e-02 + 4.722890293136e-02 4.677835619574e-02 4.633201677174e-02 4.588975685239e-02 + 4.545145492624e-02 4.501699607151e-02 4.458627221269e-02 4.415918233874e-02 + 4.373563268174e-02 4.331553685543e-02 4.289881595315e-02 4.248539860513e-02 + 4.207522099501e-02 4.166822683595e-02 4.126436730696e-02 4.086360095004e-02 + 4.046589352919e-02 4.007121785247e-02 3.967955355852e-02 3.929088686906e-02 + 3.890521030927e-02 3.852252239779e-02 3.814282730864e-02 3.776613450720e-02 + 3.739245836261e-02 3.702181773910e-02 3.665423556888e-02 3.628973840914e-02 + 3.592835598602e-02 3.557012072822e-02 3.521506729315e-02 3.486323208842e-02 + 3.451465279144e-02 3.416936787005e-02 3.382741610685e-02 3.348883613005e-02 + 3.315366595347e-02 3.282194252816e-02 3.249370130839e-02 3.216897583409e-02 + 3.184779733221e-02 3.153019433907e-02 3.121619234560e-02 3.090581346740e-02 + 3.059907614130e-02 3.029599484973e-02 2.999657987449e-02 2.970083708075e-02 + 2.940876773251e-02 2.912036833994e-02 2.883563053951e-02 2.855454100693e-02 + 2.827708140322e-02 2.800322835388e-02 2.773295346082e-02 2.746622334670e-02 + 2.720299973098e-02 2.694323953697e-02 2.668689502885e-02 2.643391397746e-02 + 2.618423985369e-02 2.593781204788e-02 2.569456611367e-02 2.545443403465e-02 + 2.521734451180e-02 2.498322326994e-02 2.475199338102e-02 2.452357560217e-02 + 2.429788872629e-02 2.407484994296e-02 2.385437520730e-02 2.363637961462e-02 + 2.342077777828e-02 2.320748420868e-02 2.299641369091e-02 2.278748165879e-02 + 2.258060456315e-02 2.237570023195e-02 2.217268822047e-02 2.197149014906e-02 + 2.177203002695e-02 2.157423455996e-02 2.137803344052e-02 2.118335961832e-02 + 2.099014955016e-02 2.079834342757e-02 2.060788538111e-02 2.041872366018e-02 + 2.023081078753e-02 2.004410368768e-02 1.985856378874e-02 1.967415709710e-02 + 1.949085424496e-02 1.930863051036e-02 1.912746581003e-02 1.894734466521e-02 + 1.876825614084e-02 1.859019375878e-02 1.841315538567e-02 1.823714309642e-02 + 1.806216301427e-02 1.788822512858e-02 1.771534309170e-02 1.754353399617e-02 + 1.737281813387e-02 1.720321873867e-02 1.703476171432e-02 1.686747534922e-02 + 1.670139002005e-02 1.653653788602e-02 1.637295257579e-02 1.621066886889e-02 + 1.604972237371e-02 1.589014920400e-02 1.573198565588e-02 1.557526788735e-02 + 1.542003160212e-02 1.526631173980e-02 1.511414217422e-02 1.496355542166e-02 + 1.481458236068e-02 1.466725196525e-02 1.452159105263e-02 1.437762404751e-02 + 1.423537276365e-02 1.409485620432e-02 1.395609038260e-02 1.381908816243e-02 + 1.368385912139e-02 1.355040943570e-02 1.341874178822e-02 1.328885529967e-02 + 1.316074548341e-02 1.303440422391e-02 1.290981977884e-02 1.278697680470e-02 + 1.266585640551e-02 1.254643620432e-02 1.242869043674e-02 1.231259006595e-02 + 1.219810291820e-02 1.208519383795e-02 1.197382486147e-02 1.186395540780e-02 + 1.175554248568e-02 1.164854091516e-02 1.154290356241e-02 1.143858158612e-02 + 1.133552469406e-02 1.123368140788e-02 1.113299933481e-02 1.103342544417e-02 + 1.093490634723e-02 1.083738857850e-02 1.074081887670e-02 1.064514446379e-02 + 1.055031332017e-02 1.045627445440e-02 1.036297816589e-02 1.027037629880e-02 + 1.017842248571e-02 1.008707237956e-02 9.996283872439e-03 9.906017299963e-03 + 9.816235629990e-03 9.726904634575e-03 9.637993044158e-03 9.549472683095e-03 + 9.461318585756e-03 9.373509092547e-03 9.286025925316e-03 9.198854241766e-03 + 9.111982668594e-03 9.025403313231e-03 8.939111754182e-03 8.853107010083e-03 + 8.767391487758e-03 8.681970909646e-03 8.596854221113e-03 8.512053478299e-03 + 8.427583717241e-03 8.343462805139e-03 8.259711274747e-03 8.176352142955e-03 + 8.093410714732e-03 8.010914373688e-03 7.928892360586e-03 7.847375541208e-03 + 7.766396165037e-03 7.685987616284e-03 7.606184158811e-03 7.527020676537e-03 + 7.448532410976e-03 7.370754697499e-03 7.293722701988e-03 7.217471159497e-03 + 7.142034116536e-03 7.067444678566e-03 6.993734764268e-03 6.920934868072e-03 + 6.849073832427e-03 6.778178631184e-03 6.708274165423e-03 6.639383072963e-03 + 6.571525552710e-03 6.504719204914e-03 6.438978888287e-03 6.374316594849e-03 + 6.310741343251e-03 6.248259091204e-03 6.186872667539e-03 6.126581724281e-03 + 6.067382709022e-03 6.009268857733e-03 5.952230208041e-03 5.896253632856e-03 + 5.841322894139e-03 5.787418716443e-03 5.734518879765e-03 5.682598331103e-03 + 5.631629314041e-03 5.581581515517e-03 5.532422228878e-03 5.484116532183e-03 + 5.436627480669e-03 5.389916312153e-03 5.343942664112e-03 5.298664801096e-03 + 5.254039851043e-03 5.210024049057e-03 5.166572987118e-03 5.123641868188e-03 + 5.081185763139e-03 5.039159868908e-03 4.997519766284e-03 4.956221675723e-03 + 4.915222709618e-03 4.874481119449e-03 4.833956536282e-03 4.793610203124e-03 + 4.753405197691e-03 4.713306644192e-03 4.673281912822e-03 4.633300805703e-03 + 4.593335728114e-03 4.553361843925e-03 4.513357214267e-03 4.473302918541e-03 + 4.433183156995e-03 4.392985334212e-03 4.352700122958e-03 4.312321507951e-03 + 4.271846809254e-03 4.231276685107e-03 4.190615114131e-03 4.149869356970e-03 + 4.109049897570e-03 4.068170364395e-03 4.027247432032e-03 3.986300703725e-03 + 3.945352575525e-03 3.904428082829e-03 3.863554730213e-03 3.822762305549e-03 + 3.782082679500e-03 3.741549591582e-03 3.701198424061e-03 3.661065965028e-03 + 3.621190162068e-03 3.581609868005e-03 3.542364580233e-03 3.503494175223e-03 + 3.465038639791e-03 3.427037800768e-03 3.389531054702e-03 3.352557099248e-03 + 3.316153667881e-03 3.280357269556e-03 3.245202934926e-03 3.210723970676e-03 + 3.176951723504e-03 3.143915355211e-03 3.111641630320e-03 3.080154717561e-03 + 3.049476006479e-03 3.019623940341e-03 2.990613866433e-03 2.962457904719e-03 + 2.935164835746e-03 2.908740008560e-03 2.883185269274e-03 2.858498910829e-03 + 2.834675644347e-03 2.811706592354e-03 2.789579304014e-03 2.768277792419e-03 + 2.747782593786e-03 2.728070848352e-03 2.709116402574e-03 2.690889932146e-03 + 2.673359085199e-03 2.656488644942e-03 2.640240710873e-03 2.624574897586e-03 + 2.609448550081e-03 2.594816974380e-03 2.580633682179e-03 2.566850648134e-03 + 2.553418578345e-03 2.540287188493e-03 2.527405490042e-03 2.514722082840e-03 + 2.502185452434e-03 2.489744270362e-03 2.477347695641e-03 2.464945675695e-03 + 2.452489244921e-03 2.439930819104e-03 2.427224483935e-03 2.414326275849e-03 + 2.401194453506e-03 2.387789758222e-03 2.374075661746e-03 2.360018599826e-03 + 2.345588190083e-03 2.330757432809e-03 2.315502893351e-03 2.299804864899e-03 + 2.283647510554e-03 2.267018983675e-03 2.249911525653e-03 2.232321540320e-03 + 2.214249644396e-03 2.195700693471e-03 2.176683783150e-03 2.157212225161e-03 + 2.137303498335e-03 2.116979174517e-03 2.096264819617e-03 2.075189870149e-03 + 2.053787485737e-03 2.032094378211e-03 2.010150618060e-03 1.987999419131e-03 + 1.965686902588e-03 1.943261841281e-03 1.920775385784e-03 1.898280773460e-03 + 1.875833022051e-03 1.853488609337e-03 1.831305140546e-03 1.809341005235e-03 + 1.787655025459e-03 1.766306097099e-03 1.745352826260e-03 1.724853162710e-03 + 1.704864032341e-03 1.685440970664e-03 1.666637759365e-03 1.648506067923e-03 + 1.631095102303e-03 1.614451262697e-03 1.598617812261e-03 1.583634558740e-03 + 1.569537550816e-03 1.556358790976e-03 1.544125966566e-03 1.532862200671e-03 + 1.522585824315e-03 1.513310171416e-03 1.505043397778e-03 1.497788325320e-03 + 1.491542312579e-03 1.486297152434e-03 1.482038997816e-03 1.478748316066e-03 + 1.476399872422e-03 1.474962742997e-03 1.474400357424e-03 1.474670571219e-03 + 1.475725767736e-03 1.477512989424e-03 1.479974097954e-03 1.483045962591e-03 + 1.486660676018e-03 1.490745796644e-03 1.495224616191e-03 1.500016451141e-03 + 1.505036956309e-03 1.510198458459e-03 1.515410307388e-03 1.520579241276e-03 + 1.525609762264e-03 1.530404517056e-03 1.534864675863e-03 1.538890300991e-03 + 1.542380693864e-03 1.545234706066e-03 1.547350996145e-03 1.548628209460e-03 + 1.548965053456e-03 1.548260235761e-03 1.546412228103e-03 1.543318816091e-03 + 1.538876394723e-03 1.532978973774e-03 1.525516867851e-03 1.516375065197e-03 + 1.505431299339e-03 1.492553890171e-03 1.477599476967e-03 1.460410834509e-03 + 1.440815042342e-03 1.418622360790e-03 1.393626247355e-03 1.365605011751e-03 + 1.334325642654e-03 1.299550327874e-03 1.261046115558e-03 1.218598012950e-03 + 1.172025582071e-03 1.121202767714e-03 1.066080293069e-03 1.006709506381e-03 + 9.432660968839e-04 8.760716716887e-04 8.056108587196e-04 7.325414389434e-04 + 6.576950741039e-04 5.820665294703e-04 5.067899161052e-04 4.331013826033e-04 + 3.622888231049e-04 2.956304490814e-04 2.343253757956e-04 1.794205564900e-04 + 1.317393073308e-04 9.181716538704e-05 5.985080447147e-05 3.566514426544e-05 + 1.870263515509e-05 8.037061819656e-06 2.412224729222e-06 3.037233152557e-07 + 0.000000000000e+00 + Type L N + 0 0 1 + -2.482045090982e+00 -2.481575045574e+00 -2.480165470569e+00 -2.477818048460e+00 + -2.474535579529e+00 -2.470321976047e+00 -2.465182254178e+00 -2.459122523607e+00 + -2.452149974922e+00 -2.444272864788e+00 -2.435500498945e+00 -2.425843213088e+00 + -2.415312351675e+00 -2.403920244720e+00 -2.391680182642e+00 -2.378606389230e+00 + -2.364713992806e+00 -2.350018995660e+00 -2.334538241841e+00 -2.318289383390e+00 + -2.301290845115e+00 -2.283561787985e+00 -2.265122071263e+00 -2.245992213466e+00 + -2.226193352253e+00 -2.205747203365e+00 -2.184676018704e+00 -2.163002543674e+00 + -2.140749973900e+00 -2.117941911420e+00 -2.094602320479e+00 -2.070755483035e+00 + -2.046425954085e+00 -2.021638516931e+00 -1.996418138491e+00 -1.970789924772e+00 + -1.944779076620e+00 -1.918410845833e+00 -1.891710491771e+00 -1.864703238550e+00 + -1.837414232921e+00 -1.809868502935e+00 -1.782090917498e+00 -1.754106146882e+00 + -1.725938624312e+00 -1.697612508679e+00 -1.669151648489e+00 -1.640579547098e+00 + -1.611919329315e+00 -1.583193709441e+00 -1.554424960789e+00 -1.525634886761e+00 + -1.496844793516e+00 -1.468075464277e+00 -1.439347135320e+00 -1.410679473678e+00 + -1.382091556583e+00 -1.353601852675e+00 -1.325228204995e+00 -1.296987815763e+00 + -1.268897232963e+00 -1.240972338727e+00 -1.213228339514e+00 -1.185679758069e+00 + -1.158340427166e+00 -1.131223485087e+00 -1.104341372837e+00 -1.077705833050e+00 + -1.051327910559e+00 -1.025217954588e+00 -9.993856225250e-01 -9.738398852256e-01 + -9.485890338035e-01 -9.236406878455e-01 -8.990018049992e-01 -8.746786918694e-01 + -8.506770161618e-01 -8.270018200069e-01 -8.036575343959e-01 -7.806479946579e-01 + -7.579764569072e-01 -7.356456153854e-01 -7.136576206255e-01 -6.920140983600e-01 + -6.707161690980e-01 -6.497644682943e-01 -6.291591670323e-01 -6.088999931456e-01 + -5.889862526999e-01 -5.694168517617e-01 -5.501903183760e-01 -5.313048246828e-01 + -5.127582090964e-01 -4.945479984792e-01 -4.766714302409e-01 -4.591254742947e-01 + -4.419068548071e-01 -4.250120716796e-01 -4.084374217002e-01 -3.921790193109e-01 + -3.762328169342e-01 -3.605946248099e-01 -3.452601302927e-01 -3.302249165662e-01 + -3.154844807329e-01 -3.010342512403e-01 -2.868696046111e-01 -2.729858814433e-01 + -2.593784016562e-01 -2.460424789550e-01 -2.329734344963e-01 -2.201666097361e-01 + -2.076173784471e-01 -1.953211578962e-01 -1.832734191754e-01 -1.714696966828e-01 + -1.599055967545e-01 -1.485768054503e-01 -1.374790955011e-01 -1.266083324259e-01 + -1.159604798325e-01 -1.055316039164e-01 -9.531787717658e-02 -8.531558136803e-02 + -7.552110971417e-02 -6.593096840459e-02 -5.654177740486e-02 -4.735027060758e-02 + -3.835329535547e-02 -2.954781136879e-02 -2.093088911078e-02 -1.249970762590e-02 + -4.251551886934e-03 3.816190312426e-03 1.170603188209e-02 1.942039033924e-02 + 2.696159205295e-02 3.433187679143e-02 4.153340253348e-02 4.856825050611e-02 + 5.543843041030e-02 6.214588579785e-02 6.869249956235e-02 7.508009950864e-02 + 8.131046396552e-02 8.738532740806e-02 9.330638605648e-02 9.907530342034e-02 + 1.046937157578e-01 1.101632374215e-01 1.154854660636e-01 1.206619876754e-01 + 1.256943814368e-01 1.305842243549e-01 1.353330956700e-01 1.399425810130e-01 + 1.444142762956e-01 1.487497913206e-01 1.529507530990e-01 1.570188088635e-01 + 1.609556287699e-01 1.647629082796e-01 1.684423702188e-01 1.719957665107e-01 + 1.754248795804e-01 1.787315234329e-01 1.819175444064e-01 1.849848216051e-01 + 1.879352670179e-01 1.907708253286e-01 1.934934734280e-01 1.961052196373e-01 + 1.986081026534e-01 2.010041902302e-01 2.032955776076e-01 2.054843857050e-01 + 2.075727590925e-01 2.095628637587e-01 2.114568846895e-01 2.132570232773e-01 + 2.149654945789e-01 2.165845244386e-01 2.181163464977e-01 2.195631991075e-01 + 2.209273221665e-01 2.222109538984e-01 2.234163275928e-01 2.245456683249e-01 + 2.256011896732e-01 2.265850904541e-01 2.274995514892e-01 2.283467324239e-01 + 2.291287686120e-01 2.298477680839e-01 2.305058086103e-01 2.311049348788e-01 + 2.316471557937e-01 2.321344419128e-01 2.325687230312e-01 2.329518859239e-01 + 2.332857722547e-01 2.335721766603e-01 2.338128450165e-01 2.340094728926e-01 + 2.341637041983e-01 2.342771300269e-01 2.343512876976e-01 2.343876599986e-01 + 2.343876746309e-01 2.343527038517e-01 2.342840643176e-01 2.341830171224e-01 + 2.340507680278e-01 2.338884678816e-01 2.336972132177e-01 2.334780470324e-01 + 2.332319597286e-01 2.329598902218e-01 2.326627271977e-01 2.323413105132e-01 + 2.319964327307e-01 2.316288407763e-01 2.312392377093e-01 2.308282845948e-01 + 2.303966024653e-01 2.299447743617e-01 2.294733474413e-01 2.289828351401e-01 + 2.284737193796e-01 2.279464528036e-01 2.274014610356e-01 2.268391449436e-01 + 2.262598829013e-01 2.256640330350e-01 2.250519354446e-01 2.244239143880e-01 + 2.237802804204e-01 2.231213324770e-01 2.224473598904e-01 2.217586443352e-01 + 2.210554616904e-01 2.203380838132e-01 2.196067802164e-01 2.188618196441e-01 + 2.181034715407e-01 2.173320074064e-01 2.165477020379e-01 2.157508346485e-01 + 2.149416898674e-01 2.141205586134e-01 2.132877388452e-01 2.124435361850e-01 + 2.115882644171e-01 2.107222458626e-01 2.098458116306e-01 2.089593017498e-01 + 2.080630651817e-01 2.071574597201e-01 2.062428517807e-01 2.053196160848e-01 + 2.043881352429e-01 2.034487992432e-01 2.025020048514e-01 2.015481549280e-01 + 2.005876576690e-01 1.996209257790e-01 1.986483755813e-01 1.976704260747e-01 + 1.966874979431e-01 1.957000125268e-01 1.947083907623e-01 1.937130520990e-01 + 1.927144134003e-01 1.917128878376e-01 1.907088837837e-01 1.897028037141e-01 + 1.886950431228e-01 1.876859894608e-01 1.866760211028e-01 1.856655063495e-01 + 1.846548024717e-01 1.836442548021e-01 1.826341958799e-01 1.816249446540e-01 + 1.806168057486e-01 1.796100687966e-01 1.786050078436e-01 1.776018808259e-01 + 1.766009291261e-01 1.756023772073e-01 1.746064323292e-01 1.736132843462e-01 + 1.726231055887e-01 1.716360508281e-01 1.706522573248e-01 1.696718449590e-01 + 1.686949164427e-01 1.677215576113e-01 1.667518377934e-01 1.657858102547e-01 + 1.648235127145e-01 1.638649679309e-01 1.629101843510e-01 1.619591568219e-01 + 1.610118673583e-01 1.600682859619e-01 1.591283714880e-01 1.581920725539e-01 + 1.572593284833e-01 1.563300702825e-01 1.554042216414e-01 1.544816999540e-01 + 1.535624173536e-01 1.526462817550e-01 1.517331979001e-01 1.508230683987e-01 + 1.499157947616e-01 1.490112784176e-01 1.481094217111e-01 1.472101288739e-01 + 1.463133069667e-01 1.454188667842e-01 1.445267237216e-01 1.436367985950e-01 + 1.427490184141e-01 1.418633171028e-01 1.409796361628e-01 1.400979252795e-01 + 1.392181428654e-01 1.383402565401e-01 1.374642435433e-01 1.365900910811e-01 + 1.357177966027e-01 1.348473680075e-01 1.339788237822e-01 1.331121930672e-01 + 1.322475156536e-01 1.313848419106e-01 1.305242326454e-01 1.296657588954e-01 + 1.288095016572e-01 1.279555515515e-01 1.271040084291e-01 1.262549809187e-01 + 1.254085859213e-01 1.245649480536e-01 1.237241990439e-01 1.228864770852e-01 + 1.220519261490e-01 1.212206952640e-01 1.203929377643e-01 1.195688105119e-01 + 1.187484730975e-01 1.179320870251e-01 1.171198148840e-01 1.163118195149e-01 + 1.155082631729e-01 1.147093066933e-01 1.139151086648e-01 1.131258246146e-01 + 1.123416062101e-01 1.115626004808e-01 1.107889490663e-01 1.100207874929e-01 + 1.092582444838e-01 1.085014413050e-01 1.077504911533e-01 1.070054985858e-01 + 1.062665589972e-01 1.055337581451e-01 1.048071717277e-01 1.040868650141e-01 + 1.033728925300e-01 1.026652978003e-01 1.019641131492e-01 1.012693595590e-01 + 1.005810465875e-01 9.989917234468e-02 9.922372352869e-02 9.855467551939e-02 + 9.789199253004e-02 9.723562781511e-02 9.658552393304e-02 9.594161306219e-02 + 9.530381736785e-02 9.467204941827e-02 9.404621264680e-02 9.342620185774e-02 + 9.281190377258e-02 9.220319761372e-02 9.159995572199e-02 9.100204420476e-02 + 9.040932361060e-02 8.982164962702e-02 8.923887379717e-02 8.866084425155e-02 + 8.808740645081e-02 8.751840393541e-02 8.695367907826e-02 8.639307383603e-02 + 8.583643049534e-02 8.528359240971e-02 8.473440472345e-02 8.418871507860e-02 + 8.364637430141e-02 8.310723706459e-02 8.257116252218e-02 8.203801491369e-02 + 8.150766413444e-02 8.097998626949e-02 8.045486408832e-02 7.993218749807e-02 + 7.941185395312e-02 7.889376881917e-02 7.837784569021e-02 7.786400665701e-02 + 7.735218252609e-02 7.684231298837e-02 7.633434673698e-02 7.582824153397e-02 + 7.532396422600e-02 7.482149070938e-02 7.432080584492e-02 7.382190332363e-02 + 7.332478548422e-02 7.282946308400e-02 7.233595502458e-02 7.184428803444e-02 + 7.135449631029e-02 7.086662111972e-02 7.038071036735e-02 6.989681812752e-02 + 6.941500414608e-02 6.893533331433e-02 6.845787511844e-02 6.798270306730e-02 + 6.750989410234e-02 6.703952799271e-02 6.657168671922e-02 6.610645385066e-02 + 6.564391391592e-02 6.518415177562e-02 6.472725199654e-02 6.427329823257e-02 + 6.382237261541e-02 6.337455515854e-02 6.292992317754e-02 6.248855073011e-02 + 6.205050807862e-02 6.161586117822e-02 6.118467119321e-02 6.075699404408e-02 + 6.033287998787e-02 5.991237323373e-02 5.949551159588e-02 5.908232618562e-02 + 5.867284114390e-02 5.826707341583e-02 5.786503256816e-02 5.746672065053e-02 + 5.707213210109e-02 5.668125369684e-02 5.629406454872e-02 5.591053614136e-02 + 5.553063241703e-02 5.515430990315e-02 5.478151788253e-02 5.441219860513e-02 + 5.404628754010e-02 5.368371366652e-02 5.332439980101e-02 5.296826296042e-02 + 5.261521475725e-02 5.226516182572e-02 5.191800627587e-02 5.157364617311e-02 + 5.123197604056e-02 5.089288738120e-02 5.055626921703e-02 5.022200864208e-02 + 4.988999138625e-02 4.956010238683e-02 4.923222636445e-02 4.890624840040e-02 + 4.858205451206e-02 4.825953222321e-02 4.793857112627e-02 4.761906343324e-02 + 4.730090451237e-02 4.698399340773e-02 4.666823333877e-02 4.635353217719e-02 + 4.603980289863e-02 4.572696400663e-02 4.541493992673e-02 4.510366136851e-02 + 4.479306565364e-02 4.448309700838e-02 4.417370681875e-02 4.386485384718e-02 + 4.355650440959e-02 4.324863251176e-02 4.294121994458e-02 4.263425633753e-02 + 4.232773917023e-02 4.202167374203e-02 4.171607309986e-02 4.141095792483e-02 + 4.110635637812e-02 4.080230390710e-02 4.049884301289e-02 4.019602298032e-02 + 3.989389957220e-02 3.959253468915e-02 3.929199599723e-02 3.899235652507e-02 + 3.869369423287e-02 3.839609155556e-02 3.809963492252e-02 3.780441425648e-02 + 3.751052245430e-02 3.721805485232e-02 3.692710867928e-02 3.663778249950e-02 + 3.635017564953e-02 3.606438767102e-02 3.578051774298e-02 3.549866411634e-02 + 3.521892355383e-02 3.494139077806e-02 3.466615793079e-02 3.439331404622e-02 + 3.412294454091e-02 3.385513072317e-02 3.358994932446e-02 3.332747205505e-02 + 3.306776518651e-02 3.281088916299e-02 3.255689824337e-02 3.230584017620e-02 + 3.205775590890e-02 3.181267933294e-02 3.157063706606e-02 3.133164827289e-02 + 3.109572452458e-02 3.086286969840e-02 3.063307991758e-02 3.040634353182e-02 + 3.018264113840e-02 2.996194564386e-02 2.974422236575e-02 2.952942917404e-02 + 2.931751667125e-02 2.910842841043e-02 2.890210114979e-02 2.869846514259e-02 + 2.849744446083e-02 2.829895735084e-02 2.810291661916e-02 2.790923004642e-02 + 2.771780082720e-02 2.752852803350e-02 2.734130709943e-02 2.715603032450e-02 + 2.697258739298e-02 2.679086590661e-02 2.661075192784e-02 2.643213053071e-02 + 2.625488635676e-02 2.607890417275e-02 2.590406942761e-02 2.573026880550e-02 + 2.555739077224e-02 2.538532611231e-02 2.521396845357e-02 2.504321477699e-02 + 2.487296590891e-02 2.470312699312e-02 2.453360794040e-02 2.436432385330e-02 + 2.419519542382e-02 2.402614930213e-02 2.385711843425e-02 2.368804236721e-02 + 2.351886751988e-02 2.334954741825e-02 2.318004289399e-02 2.301032224513e-02 + 2.284036135821e-02 2.267014379120e-02 2.249966081685e-02 2.232891142617e-02 + 2.215790229212e-02 2.198664769369e-02 2.181516940079e-02 2.164349652049e-02 + 2.147166530554e-02 2.129971892603e-02 2.112770720548e-02 2.095568632269e-02 + 2.078371848085e-02 2.061187154572e-02 2.044021865465e-02 2.026883779851e-02 + 2.009781137868e-02 1.992722574135e-02 1.975717069155e-02 1.958773898944e-02 + 1.941902583141e-02 1.925112831861e-02 1.908414491583e-02 1.891817490323e-02 + 1.875331782404e-02 1.858967293085e-02 1.842733863338e-02 1.826641195074e-02 + 1.810698797073e-02 1.794915931917e-02 1.779301564194e-02 1.763864310237e-02 + 1.748612389659e-02 1.733553578942e-02 1.718695167304e-02 1.704043915097e-02 + 1.689606014922e-02 1.675387055697e-02 1.661391989838e-02 1.647625103740e-02 + 1.634089991718e-02 1.620789533523e-02 1.607725875590e-02 1.594900416081e-02 + 1.582313793839e-02 1.569965881293e-02 1.557855781368e-02 1.545981828421e-02 + 1.534341593208e-02 1.522931891857e-02 1.511748798818e-02 1.500787663728e-02 + 1.490043132113e-02 1.479509169826e-02 1.469179091120e-02 1.459045590195e-02 + 1.449100776098e-02 1.439336210776e-02 1.429742950121e-02 1.420311587785e-02 + 1.411032301568e-02 1.401894902135e-02 1.392888883825e-02 1.384003477310e-02 + 1.375227703819e-02 1.366550430676e-02 1.357960427870e-02 1.349446425360e-02 + 1.340997170838e-02 1.332601487660e-02 1.324248332634e-02 1.315926853392e-02 + 1.307626445035e-02 1.299336805771e-02 1.291047991254e-02 1.282750467341e-02 + 1.274435160999e-02 1.266093509083e-02 1.257717504747e-02 1.249299741209e-02 + 1.240833452676e-02 1.232312552166e-02 1.223731666053e-02 1.215086165114e-02 + 1.206372191923e-02 1.197586684417e-02 1.188727395503e-02 1.179792908573e-02 + 1.170782648826e-02 1.161696890320e-02 1.152536758675e-02 1.143304229394e-02 + 1.134002121778e-02 1.124634088427e-02 1.115204600356e-02 1.105718927751e-02 + 1.096183116447e-02 1.086603960190e-02 1.076988968798e-02 1.067346332336e-02 + 1.057684881457e-02 1.048014044056e-02 1.038343798427e-02 1.028684623118e-02 + 1.019047443688e-02 1.009443576615e-02 9.998846705724e-03 9.903826453530e-03 + 9.809496287006e-03 9.715978913303e-03 9.623397804321e-03 9.531876519539e-03 + 9.441538019746e-03 9.352503974778e-03 9.264894068459e-03 9.178825303950e-03 + 9.094411312729e-03 9.011761670447e-03 8.930981222860e-03 8.852169425054e-03 + 8.775419697083e-03 8.700818799153e-03 8.628446229346e-03 8.558373646848e-03 + 8.490664323513e-03 8.425372626521e-03 8.362543534709e-03 8.302212191092e-03 + 8.244403493880e-03 8.189131728173e-03 8.136400240352e-03 8.086201156981e-03 + 8.038515149877e-03 7.993311248794e-03 7.950546702980e-03 7.910166892631e-03 + 7.872105291106e-03 7.836283478488e-03 7.802611206900e-03 7.770986517756e-03 + 7.741295910874e-03 7.713414565203e-03 7.687206610635e-03 7.662525450201e-03 + 7.639214131691e-03 7.617105767535e-03 7.596024001566e-03 7.575783521055e-03 + 7.556190612210e-03 7.537043757089e-03 7.518134269667e-03 7.499246968516e-03 + 7.480160883308e-03 7.460649991956e-03 7.440483984796e-03 7.419429051600e-03 + 7.397248686374e-03 7.373704503755e-03 7.348557059180e-03 7.321566662708e-03 + 7.292494173217e-03 7.261101755343e-03 7.227153575754e-03 7.190416407734e-03 + 7.150660103394e-03 7.107657880901e-03 7.061186359963e-03 7.011025262750e-03 + 6.956956680516e-03 6.898763789795e-03 6.836228889030e-03 6.769130620249e-03 + 6.697240246048e-03 6.620316875679e-03 6.538101582408e-03 6.450310435006e-03 + 6.356626585950e-03 6.256691722479e-03 6.150097395357e-03 6.036376989510e-03 + 5.914999378528e-03 5.785365589660e-03 5.646810065247e-03 5.498608297878e-03 + 5.339992688839e-03 5.170178377035e-03 4.988400454703e-03 4.793963383463e-03 + 4.586302526504e-03 4.365056527676e-03 4.130147843723e-03 3.881867166025e-03 + 3.620955894071e-03 3.348679427361e-03 3.066883035448e-03 2.778021663412e-03 + 2.485155425306e-03 2.191903869409e-03 1.902354418680e-03 1.620923637512e-03 + 1.352173964869e-03 1.100592970927e-03 8.703466194766e-04 6.650219625807e-04 + 4.873776537196e-04 3.391221866623e-04 2.207395111312e-04 1.313794780193e-04 + 6.882647551390e-05 2.955391019338e-05 8.865353422468e-06 1.115867959482e-06 + 0.000000000000e+00 + Type L N + 0 1 0 + 0.000000000000e+00 -2.619148756396e-02 -5.236486301972e-02 -7.850203930165e-02 + -1.045849793771e-01 -1.305957211313e-01 -1.565164020954e-01 -1.823292839654e-01 + -2.080167768610e-01 -2.335614632739e-01 -2.589461216556e-01 -2.841537495958e-01 + -3.091675865449e-01 -3.339711360326e-01 -3.585481873377e-01 -3.828828365671e-01 + -4.069595070990e-01 -4.307629693521e-01 -4.542783598414e-01 -4.774911994832e-01 + -5.003874111144e-01 -5.229533361944e-01 -5.451757506572e-01 -5.670418798862e-01 + -5.885394127849e-01 -6.096565149199e-01 -6.303818407138e-01 -6.507045446704e-01 + -6.706142916133e-01 -6.901012659255e-01 -7.091561797781e-01 -7.277702803377e-01 + -7.459353559473e-01 -7.636437412768e-01 -7.808883214399e-01 -7.976625350814e-01 + -8.139603764356e-01 -8.297763963643e-01 -8.451057023818e-01 -8.599439576786e-01 + -8.742873791567e-01 -8.881327344938e-01 -9.014773382523e-01 -9.143190470556e-01 + -9.266562538533e-01 -9.384878812996e-01 -9.498133742720e-01 -9.606326915587e-01 + -9.709462967451e-01 -9.807551483301e-01 -9.900606891086e-01 -9.988648348517e-01 + -1.007169962324e+00 -1.014978896675e+00 -1.022294898241e+00 -1.029121648800e+00 + -1.035463237323e+00 -1.041324145256e+00 -1.046709231379e+00 -1.051623716287e+00 + -1.056073166534e+00 -1.060063478479e+00 -1.063600861885e+00 -1.066691823310e+00 + -1.069343149337e+00 -1.071561889677e+00 -1.073355340199e+00 -1.074731025928e+00 + -1.075696684036e+00 -1.076260246899e+00 -1.076429825220e+00 -1.076213691295e+00 + -1.075620262432e+00 -1.074658084579e+00 -1.073335816178e+00 -1.071662212300e+00 + -1.069646109077e+00 -1.067296408467e+00 -1.064622063390e+00 -1.061632063245e+00 + -1.058335419858e+00 -1.054741153859e+00 -1.050858281535e+00 -1.046695802159e+00 + -1.042262685832e+00 -1.037567861841e+00 -1.032620207550e+00 -1.027428537849e+00 + -1.022001595150e+00 -1.016348039963e+00 -1.010476442037e+00 -1.004395272089e+00 + -9.981128941084e-01 -9.916375582498e-01 -9.849773943052e-01 -9.781404057575e-01 + -9.711344644075e-01 -9.639673055695e-01 -9.566465238271e-01 -9.491795693387e-01 + -9.415737446814e-01 -9.338362022213e-01 -9.259739419936e-01 -9.179938100794e-01 + -9.099024974594e-01 -9.017065393285e-01 -8.934123148501e-01 -8.850260473314e-01 + -8.765538047966e-01 -8.680015009377e-01 -8.593748964187e-01 -8.506796005108e-01 + -8.419210730338e-01 -8.331046265803e-01 -8.242354289977e-01 -8.153185061029e-01 + -8.063587446057e-01 -7.973608952151e-01 -7.883295759049e-01 -7.792692753130e-01 + -7.701843562510e-01 -7.610790593002e-01 -7.519575064699e-01 -7.428237048973e-01 + -7.336815505648e-01 -7.245348320142e-01 -7.153872340388e-01 -7.062423413307e-01 + -6.971036420686e-01 -6.879745314249e-01 -6.788583149780e-01 -6.697582120136e-01 + -6.606773587007e-01 -6.516188111292e-01 -6.425855481983e-01 -6.335804743433e-01 + -6.246064220940e-01 -6.156661544547e-01 -6.067623670998e-01 -5.978976903813e-01 + -5.890746911408e-01 -5.802958743272e-01 -5.715636844155e-01 -5.628805066289e-01 + -5.542486679631e-01 -5.456704380175e-01 -5.371480296347e-01 -5.286835993539e-01 + -5.202792476838e-01 -5.119370192015e-01 -5.036589024851e-01 -4.954468298887e-01 + -4.873026771689e-01 -4.792282629741e-01 -4.712253482055e-01 -4.632956352638e-01 + -4.554407671916e-01 -4.476623267261e-01 -4.399618352735e-01 -4.323407518198e-01 + -4.248004717903e-01 -4.173423258741e-01 -4.099675788240e-01 -4.026774282498e-01 + -3.954730034156e-01 -3.883553640567e-01 -3.813254992302e-01 -3.743843262106e-01 + -3.675326894452e-01 -3.607713595818e-01 -3.541010325795e-01 -3.475223289158e-01 + -3.410357929000e-01 -3.346418921031e-01 -3.283410169145e-01 -3.221334802342e-01 + -3.160195173078e-01 -3.099992857124e-01 -3.040728654994e-01 -2.982402594992e-01 + -2.925013937933e-01 -2.868561183560e-01 -2.813042078699e-01 -2.758453627149e-01 + -2.704792101334e-01 -2.652053055693e-01 -2.600231341813e-01 -2.549321125271e-01 + -2.499315904153e-01 -2.450208529216e-01 -2.401991225640e-01 -2.354655616297e-01 + -2.308192746499e-01 -2.262593110115e-01 -2.217846677005e-01 -2.173942921658e-01 + -2.130870852947e-01 -2.088619044905e-01 -2.047175668396e-01 -2.006528523587e-01 + -1.966665073086e-01 -1.927572475643e-01 -1.889237620269e-01 -1.851647160666e-01 + -1.814787549827e-01 -1.778645074676e-01 -1.743205890629e-01 -1.708456055934e-01 + -1.674381565660e-01 -1.640968385230e-01 -1.608202483334e-01 -1.576069864139e-01 + -1.544556598647e-01 -1.513648855108e-01 -1.483332928356e-01 -1.453595267988e-01 + -1.424422505258e-01 -1.395801478620e-01 -1.367719257811e-01 -1.340163166408e-01 + -1.313120802780e-01 -1.286580059372e-01 -1.260529140265e-01 -1.234956576962e-01 + -1.209851242359e-01 -1.185202362876e-01 -1.160999528715e-01 -1.137232702242e-01 + -1.113892224481e-01 -1.090968819726e-01 -1.068453598284e-01 -1.046338057376e-01 + -1.024614080212e-01 -1.003273933296e-01 -9.823102619963e-02 -9.617160844355e-02 + -9.414847837716e-02 -9.216100989289e-02 -9.020861138608e-02 -8.829072454252e-02 + -8.640682299614e-02 -8.455641086620e-02 -8.273902118386e-02 -8.095421421852e-02 + -7.920157571451e-02 -7.748071504934e-02 -7.579126332469e-02 -7.413287140170e-02 + -7.250520789230e-02 -7.090795711826e-02 -6.934081704988e-02 -6.780349723588e-02 + -6.629571673653e-02 -6.481720207113e-02 -6.336768519157e-02 -6.194690149273e-02 + -6.055458787067e-02 -5.919048083885e-02 -5.785431471242e-02 -5.654581987003e-02 + -5.526472110210e-02 -5.401073605396e-02 -5.278357377167e-02 -5.158293335769e-02 + -5.040850274282e-02 -4.925995758026e-02 -4.813696026688e-02 -4.703915909588e-02 + -4.596618754460e-02 -4.491766369995e-02 -4.389318982382e-02 -4.289235205930e-02 + -4.191472027834e-02 -4.095984807036e-02 -4.002727287065e-02 -3.911651622664e-02 + -3.822708419924e-02 -3.735846789596e-02 -3.651014413154e-02 -3.568157621131e-02 + -3.487221483170e-02 -3.408149909199e-02 -3.330885761033e-02 -3.255370973701e-02 + -3.181546685714e-02 -3.109353377455e-02 -3.038731016832e-02 -2.969619211295e-02 + -2.901957365295e-02 -2.835684842224e-02 -2.770741129870e-02 -2.707066008394e-02 + -2.644599719833e-02 -2.583283138132e-02 -2.523057938696e-02 -2.463866766481e-02 + -2.405653401635e-02 -2.348362921731e-02 -2.291941859653e-02 -2.236338356226e-02 + -2.181502306709e-02 -2.127385500310e-02 -2.073941751929e-02 -2.021127025380e-02 + -1.968899547377e-02 -1.917219911649e-02 -1.866051172597e-02 -1.815358927943e-02 + -1.765111389923e-02 -1.715279444616e-02 -1.665836699064e-02 -1.616759515933e-02 + -1.568027035507e-02 -1.519621184885e-02 -1.471526674340e-02 -1.423730980846e-02 + -1.376224318856e-02 -1.328999598499e-02 -1.282052371411e-02 -1.235380764503e-02 + -1.188985402008e-02 -1.142869316246e-02 -1.097037847581e-02 -1.051498534107e-02 + -1.006260991666e-02 -9.613367848339e-03 -9.167392895743e-03 -8.724835483000e-03 + -8.285861181084e-03 -7.850649130099e-03 -7.419390409886e-03 -6.992286367608e-03 + -6.569546911217e-03 -6.151388777816e-03 -5.738033786074e-03 -5.329707081897e-03 + -4.926635386553e-03 -4.529045256425e-03 -4.137161363471e-03 -3.751204805299e-03 + -3.371391453621e-03 -2.997930349555e-03 -2.631022154026e-03 -2.270857661113e-03 + -1.917616381888e-03 -1.571465205837e-03 -1.232557146521e-03 -9.010301776598e-04 + -5.770061652889e-04 -2.605899011067e-04 4.813175843625e-05 3.490906433619e-04 + 6.422379083571e-04 9.275445552270e-04 1.205001837536e-03 1.474621546020e-03 + 1.736436173996e-03 1.990498962683e-03 2.236883826949e-03 2.475685162717e-03 + 2.707017537841e-03 2.931015268937e-03 3.147831887239e-03 3.357639497146e-03 + 3.560628031719e-03 3.757004409902e-03 3.946991600762e-03 4.130827600566e-03 + 4.308764328889e-03 4.481066450456e-03 4.648010129698e-03 4.809881725434e-03 + 4.966976433299e-03 5.119596883860e-03 5.268051704510e-03 5.412654053433e-03 + 5.553720134020e-03 5.691567698189e-03 5.826514547092e-03 5.958877037639e-03 + 6.088968603225e-03 6.217098296899e-03 6.343569365063e-03 6.468677859564e-03 + 6.592711295807e-03 6.715947364200e-03 6.838652701932e-03 6.961081731675e-03 + 7.083475573440e-03 7.206061035334e-03 7.329049688515e-03 7.452637031143e-03 + 7.577001745578e-03 7.702305052573e-03 7.828690165593e-03 7.956281847848e-03 + 8.085186074022e-03 8.215489798083e-03 8.347260827936e-03 8.480547807099e-03 + 8.615380302952e-03 8.751769000514e-03 8.889706000109e-03 9.029165216702e-03 + 9.170102878110e-03 9.312458118742e-03 9.456153665011e-03 9.601096608027e-03 + 9.747179258719e-03 9.894280080088e-03 1.004226469085e-02 1.019098693440e-02 + 1.034029000656e-02 1.049000763547e-02 1.063996530646e-02 1.078998152469e-02 + 1.093986910817e-02 1.108943650339e-02 1.123848911607e-02 1.138683064909e-02 + 1.153426443998e-02 1.168059479010e-02 1.182562827797e-02 1.196917504910e-02 + 1.211105007508e-02 1.225107437457e-02 1.238907618943e-02 1.252489210927e-02 + 1.265836813807e-02 1.278936069695e-02 1.291773755751e-02 1.304337870048e-02 + 1.316617709511e-02 1.328603939499e-02 1.340288654648e-02 1.351665430671e-02 + 1.362729366825e-02 1.373477118843e-02 1.383906922175e-02 1.394018605422e-02 + 1.403813593933e-02 1.413294903569e-02 1.422467124705e-02 1.431336396600e-02 + 1.439910372306e-02 1.448198174369e-02 1.456210341591e-02 1.463958767211e-02 + 1.471456628879e-02 1.478718310873e-02 1.485759319026e-02 1.492596188893e-02 + 1.499246387717e-02 1.505728210784e-02 1.512060672793e-02 1.518263394902e-02 + 1.524356488117e-02 1.530360433731e-02 1.536295961518e-02 1.542183926410e-02 + 1.548045184398e-02 1.553900468373e-02 1.559770264664e-02 1.565674690985e-02 + 1.571633376528e-02 1.577665344884e-02 1.583788900517e-02 1.590021519414e-02 + 1.596379744599e-02 1.602879087085e-02 1.609533932872e-02 1.616357456515e-02 + 1.623361541785e-02 1.630556709873e-02 1.637952055562e-02 1.645555191742e-02 + 1.653372202582e-02 1.661407605643e-02 1.669664323138e-02 1.678143662521e-02 + 1.686845306507e-02 1.695767312578e-02 1.704906121987e-02 1.714256578196e-02 + 1.723811954648e-02 1.733563991699e-02 1.743502942507e-02 1.753617627600e-02 + 1.763895497808e-02 1.774322705193e-02 1.784884181561e-02 1.795563724100e-02 + 1.806344087646e-02 1.817207083037e-02 1.828133680986e-02 1.839104120867e-02 + 1.850098023783e-02 1.861094509253e-02 1.872072314848e-02 1.883009918077e-02 + 1.893885659806e-02 1.904677868516e-02 1.915364984645e-02 1.925925684325e-02 + 1.936339001770e-02 1.946584449621e-02 1.956642136531e-02 1.966492881331e-02 + 1.976118323090e-02 1.985501026443e-02 1.994624581574e-02 2.003473698266e-02 + 2.012034293477e-02 2.020293571936e-02 2.028240099279e-02 2.035863867308e-02 + 2.043156350995e-02 2.050110556888e-02 2.056721062645e-02 2.062984047468e-02 + 2.068897313245e-02 2.074460296295e-02 2.079674069621e-02 2.084541335683e-02 + 2.089066409712e-02 2.093255193665e-02 2.097115140973e-02 2.100655212284e-02 + 2.103885822446e-02 2.106818779056e-02 2.109467212911e-02 2.111845500767e-02 + 2.113969180865e-02 2.115854861693e-02 2.117520124532e-02 2.118983420338e-02 + 2.120263961558e-02 2.121381609520e-02 2.122356758033e-02 2.123210213890e-02 + 2.123963074957e-02 2.124636606559e-02 2.125252116890e-02 2.125830832160e-02 + 2.126393772218e-02 2.126961627368e-02 2.127554637107e-02 2.128192471477e-02 + 2.128894115740e-02 2.129677759051e-02 2.130560687763e-02 2.131559184016e-02 + 2.132688430185e-02 2.133962419759e-02 2.135393875177e-02 2.136994173102e-02 + 2.138773277581e-02 2.140739681481e-02 2.142900356564e-02 2.145260712483e-02 + 2.147824564965e-02 2.150594113364e-02 2.153569927730e-02 2.156750945480e-02 + 2.160134477700e-02 2.163716225049e-02 2.167490303187e-02 2.171449277595e-02 + 2.175584207575e-02 2.179884699208e-02 2.184338966957e-02 2.188933903561e-02 + 2.193655157843e-02 2.198487219960e-02 2.203413513628e-02 2.208416494774e-02 + 2.213477756065e-02 2.218578136687e-02 2.223697836761e-02 2.228816535713e-02 + 2.233913513923e-02 2.238967776935e-02 2.243958181514e-02 2.248863562797e-02 + 2.253662861809e-02 2.258335252583e-02 2.262860268145e-02 2.267217924618e-02 + 2.271388842704e-02 2.275354365840e-02 2.279096674309e-02 2.282598894641e-02 + 2.285845203635e-02 2.288820926393e-02 2.291512627762e-02 2.293908196640e-02 + 2.295996922622e-02 2.297769564529e-02 2.299218410388e-02 2.300337328484e-02 + 2.301121809170e-02 2.301568997160e-02 2.301677714081e-02 2.301448471143e-02 + 2.300883471803e-02 2.299986604390e-02 2.298763424715e-02 2.297221128710e-02 + 2.295368515261e-02 2.293215939400e-02 2.290775256113e-02 2.288059755062e-02 + 2.285084086581e-02 2.281864179350e-02 2.278417150202e-02 2.274761206582e-02 + 2.270915542192e-02 2.266900226427e-02 2.262736088227e-02 2.258444595016e-02 + 2.254047727415e-02 2.249567850465e-02 2.245027582107e-02 2.240449659678e-02 + 2.235856805212e-02 2.231271590338e-02 2.226716301569e-02 2.222212806786e-02 + 2.217782423709e-02 2.213445791144e-02 2.209222743784e-02 2.205132191314e-02 + 2.201192002567e-02 2.197418895432e-02 2.193828333201e-02 2.190434427997e-02 + 2.187249851887e-02 2.184285756262e-02 2.181551699982e-02 2.179055586779e-02 + 2.176803612321e-02 2.174800221325e-02 2.173048074999e-02 2.171548029103e-02 + 2.170299122778e-02 2.169298578312e-02 2.168541811879e-02 2.168022455268e-02 + 2.167732388541e-02 2.167661783493e-02 2.167799157718e-02 2.168131439039e-02 + 2.168644039986e-02 2.169320941939e-02 2.170144788518e-02 2.171096987713e-02 + 2.172157822222e-02 2.173306567395e-02 2.174521616147e-02 2.175780610142e-02 + 2.177060576518e-02 2.178338069396e-02 2.179589315354e-02 2.180790362049e-02 + 2.181917229125e-02 2.182946060530e-02 2.183853277351e-02 2.184615730267e-02 + 2.185210850718e-02 2.185616799866e-02 2.185812614465e-02 2.185778348735e-02 + 2.185495211363e-02 2.184945696779e-02 2.184113709866e-02 2.182984683306e-02 + 2.181545686793e-02 2.179785527376e-02 2.177694840253e-02 2.175266169377e-02 + 2.172494037273e-02 2.169375003548e-02 2.165907711615e-02 2.162092923210e-02 + 2.157933540362e-02 2.153434614529e-02 2.148603342686e-02 2.143449050224e-02 + 2.137983160587e-02 2.132219151644e-02 2.126172498881e-02 2.119860605552e-02 + 2.113302720010e-02 2.106519840518e-02 2.099534607909e-02 2.092371186512e-02 + 2.085055133881e-02 2.077613259864e-02 2.070073475676e-02 2.062464633657e-02 + 2.054816358470e-02 2.047158870559e-02 2.039522802713e-02 2.031939010651e-02 + 2.024438378571e-02 2.017051620651e-02 2.009809079520e-02 2.002740522733e-02 + 1.995874938339e-02 1.989240330600e-02 1.982863516971e-02 1.976769927438e-02 + 1.970983407307e-02 1.965526024551e-02 1.960417882772e-02 1.955676940876e-02 + 1.951318840466e-02 1.947356741995e-02 1.943801170636e-02 1.940659872817e-02 + 1.937937684318e-02 1.935636410766e-02 1.933754721316e-02 1.932288056267e-02 + 1.931228549258e-02 1.930564964660e-02 1.930282650696e-02 1.930363508734e-02 + 1.930785979149e-02 1.931525044047e-02 1.932552247072e-02 1.933835730439e-02 + 1.935340289245e-02 1.937027443016e-02 1.938855524387e-02 1.940779784701e-02 + 1.942752516217e-02 1.944723190571e-02 1.946638612966e-02 1.948443091549e-02 + 1.950078621243e-02 1.951485081234e-02 1.952600445117e-02 1.953361002533e-02 + 1.953701590851e-02 1.953555835114e-02 1.952856393958e-02 1.951535208590e-02 + 1.949523750933e-02 1.946753265869e-02 1.943155000790e-02 1.938660413540e-02 + 1.933201347007e-02 1.926710155243e-02 1.919119761851e-02 1.910363626729e-02 + 1.900375592273e-02 1.889089575277e-02 1.876439066726e-02 1.862356399556e-02 + 1.846771745619e-02 1.829611809251e-02 1.810798198195e-02 1.790245475170e-02 + 1.767858927235e-02 1.743532136835e-02 1.717144498381e-02 1.688558896444e-02 + 1.657619842677e-02 1.624152452384e-02 1.587962718961e-02 1.548839602965e-02 + 1.506559477392e-02 1.460893445471e-02 1.411617955952e-02 1.358528970263e-02 + 1.301459678658e-02 1.240301420140e-02 1.175027046629e-02 1.105715512477e-02 + 1.032576006732e-02 9.559695308356e-03 8.764255204101e-03 7.946509802481e-03 + 7.115297042524e-03 6.281095287844e-03 5.455762355303e-03 4.652136625604e-03 + 3.883507462241e-03 3.162975109536e-03 2.502733260001e-03 1.913319137545e-03 + 1.402884747950e-03 9.765475531969e-04 6.358782201147e-04 3.785767743619e-04 + 1.983765869872e-04 8.519893699498e-05 2.556086363756e-05 3.217573100688e-06 + 0.000000000000e+00 \ No newline at end of file diff --git a/ABACUS.develop/examples/H2O-deepks-pw/INPUT b/ABACUS.develop/examples/H2O-deepks-pw/INPUT new file mode 100644 index 0000000000..4b334117b0 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/INPUT @@ -0,0 +1,29 @@ +INPUT_PARAMETERS +#Parameters (1.General) +suffix abacus +calculation scf +ntype 2 +nbands 6 +symmetry 0 + +#Parameters (2.Iteration) +ecutwfc 50 +dr2 1e-8 +niter 50 + +#Parameters (3.Basis) +basis_type pw +gamma_only 1 + +#Parameters (4.Smearing) +smearing gaussian +sigma 0.02 + +#Parameters (5.Mixing) +mixing_type pulay +mixing_beta 0.4 + +#Parameters (6.File) +out_band 0 +out_descriptor 1 +lmax_descriptor 2 diff --git a/ABACUS.develop/examples/H2O-deepks-pw/INPUTs b/ABACUS.develop/examples/H2O-deepks-pw/INPUTs new file mode 100644 index 0000000000..593f6e0ea7 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/INPUTs @@ -0,0 +1,8 @@ +INPUT_ORBITAL_INFORMATION + +1 // smooth or not +0.1 // sigma +50 // energy cutoff for spherical bessel functions(Ry) +6 // cutoff of wavefunctions(a.u.) +1.0e-12 // tolerence + diff --git a/ABACUS.develop/examples/H2O-deepks-pw/KPT b/ABACUS.develop/examples/H2O-deepks-pw/KPT new file mode 100644 index 0000000000..c289c0158a --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/ABACUS.develop/examples/H2O-deepks-pw/O_ONCV_PBE-1.0.upf b/ABACUS.develop/examples/H2O-deepks-pw/O_ONCV_PBE-1.0.upf new file mode 100644 index 0000000000..7e7db6d66f --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/O_ONCV_PBE-1.0.upf @@ -0,0 +1,1224 @@ + + + + This pseudopotential file has been produced using the code + ONCVPSP (Optimized Norm-Conservinng Vanderbilt PSeudopotential) + scalar-relativistic version 2.1.1, 03/26/2014 by D. R. Hamann + The code is available through a link at URL www.mat-simresearch.com. + Documentation with the package provides a full discription of the + input data below. + + + While it is not required under the terms of the GNU GPL, it is + suggested that you cite D. R. Hamann, Phys. Rev. B 88, 085117 (2013) + in any publication using these pseudopotentials. + + + Copyright 2015 The Regents of the University of California + + This work is licensed under the Creative Commons Attribution-ShareAlike + 4.0 International License. To view a copy of this license, visit + http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to + Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. + + This pseudopotential is part of the Schlipf-Gygi norm-conserving + pseudopotential library. Its construction parameters were tuned to + reproduce materials of a training set with very high accuracy and + should be suitable as a general purpose pseudopotential to treat a + variety of different compounds. For details of the construction and + testing of the pseudopotential please refer to: + + [insert reference to paper here] + + We kindly ask that you include this reference in all publications + associated to this pseudopotential. + + + +# ATOM AND REFERENCE CONFIGURATION +# atsym z nc nv iexc psfile + O 8.00 1 2 4 upf +# +# n l f energy (Ha) + 1 0 2.00 + 2 0 2.00 + 2 1 4.00 +# +# PSEUDOPOTENTIAL AND OPTIMIZATION +# lmax + 1 +# +# l, rc, ep, ncon, nbas, qcut + 0 1.29195 -0.88057 5 8 8.98916 + 1 1.47310 -0.33187 5 8 9.14990 +# +# LOCAL POTENTIAL +# lloc, lpopt, rc(5), dvloc0 + 4 5 0.90330 0.00000 +# +# VANDERBILT-KLEINMAN-BYLANDER PROJECTORs +# l, nproj, debl + 0 2 1.51851 + 1 2 1.53631 +# +# MODEL CORE CHARGE +# icmod, fcfact + 0 0.00000 +# +# LOG DERIVATIVE ANALYSIS +# epsh1, epsh2, depsh + -5.00 3.00 0.02 +# +# OUTPUT GRID +# rlmax, drl + 6.00 0.01 +# +# TEST CONFIGURATIONS +# ncnf + 0 +# nvcnf +# n l f + + + + + + + + + 0.0000 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 + 0.0800 0.0900 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 + 0.1600 0.1700 0.1800 0.1900 0.2000 0.2100 0.2200 0.2300 + 0.2400 0.2500 0.2600 0.2700 0.2800 0.2900 0.3000 0.3100 + 0.3200 0.3300 0.3400 0.3500 0.3600 0.3700 0.3800 0.3900 + 0.4000 0.4100 0.4200 0.4300 0.4400 0.4500 0.4600 0.4700 + 0.4800 0.4900 0.5000 0.5100 0.5200 0.5300 0.5400 0.5500 + 0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200 0.6300 + 0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100 + 0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900 + 0.8000 0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700 + 0.8800 0.8900 0.9000 0.9100 0.9200 0.9300 0.9400 0.9500 + 0.9600 0.9700 0.9800 0.9900 1.0000 1.0100 1.0200 1.0300 + 1.0400 1.0500 1.0600 1.0700 1.0800 1.0900 1.1000 1.1100 + 1.1200 1.1300 1.1400 1.1500 1.1600 1.1700 1.1800 1.1900 + 1.2000 1.2100 1.2200 1.2300 1.2400 1.2500 1.2600 1.2700 + 1.2800 1.2900 1.3000 1.3100 1.3200 1.3300 1.3400 1.3500 + 1.3600 1.3700 1.3800 1.3900 1.4000 1.4100 1.4200 1.4300 + 1.4400 1.4500 1.4600 1.4700 1.4800 1.4900 1.5000 1.5100 + 1.5200 1.5300 1.5400 1.5500 1.5600 1.5700 1.5800 1.5900 + 1.6000 1.6100 1.6200 1.6300 1.6400 1.6500 1.6600 1.6700 + 1.6800 1.6900 1.7000 1.7100 1.7200 1.7300 1.7400 1.7500 + 1.7600 1.7700 1.7800 1.7900 1.8000 1.8100 1.8200 1.8300 + 1.8400 1.8500 1.8600 1.8700 1.8800 1.8900 1.9000 1.9100 + 1.9200 1.9300 1.9400 1.9500 1.9600 1.9700 1.9800 1.9900 + 2.0000 2.0100 2.0200 2.0300 2.0400 2.0500 2.0600 2.0700 + 2.0800 2.0900 2.1000 2.1100 2.1200 2.1300 2.1400 2.1500 + 2.1600 2.1700 2.1800 2.1900 2.2000 2.2100 2.2200 2.2300 + 2.2400 2.2500 2.2600 2.2700 2.2800 2.2900 2.3000 2.3100 + 2.3200 2.3300 2.3400 2.3500 2.3600 2.3700 2.3800 2.3900 + 2.4000 2.4100 2.4200 2.4300 2.4400 2.4500 2.4600 2.4700 + 2.4800 2.4900 2.5000 2.5100 2.5200 2.5300 2.5400 2.5500 + 2.5600 2.5700 2.5800 2.5900 2.6000 2.6100 2.6200 2.6300 + 2.6400 2.6500 2.6600 2.6700 2.6800 2.6900 2.7000 2.7100 + 2.7200 2.7300 2.7400 2.7500 2.7600 2.7700 2.7800 2.7900 + 2.8000 2.8100 2.8200 2.8300 2.8400 2.8500 2.8600 2.8700 + 2.8800 2.8900 2.9000 2.9100 2.9200 2.9300 2.9400 2.9500 + 2.9600 2.9700 2.9800 2.9900 3.0000 3.0100 3.0200 3.0300 + 3.0400 3.0500 3.0600 3.0700 3.0800 3.0900 3.1000 3.1100 + 3.1200 3.1300 3.1400 3.1500 3.1600 3.1700 3.1800 3.1900 + 3.2000 3.2100 3.2200 3.2300 3.2400 3.2500 3.2600 3.2700 + 3.2800 3.2900 3.3000 3.3100 3.3200 3.3300 3.3400 3.3500 + 3.3600 3.3700 3.3800 3.3900 3.4000 3.4100 3.4200 3.4300 + 3.4400 3.4500 3.4600 3.4700 3.4800 3.4900 3.5000 3.5100 + 3.5200 3.5300 3.5400 3.5500 3.5600 3.5700 3.5800 3.5900 + 3.6000 3.6100 3.6200 3.6300 3.6400 3.6500 3.6600 3.6700 + 3.6800 3.6900 3.7000 3.7100 3.7200 3.7300 3.7400 3.7500 + 3.7600 3.7700 3.7800 3.7900 3.8000 3.8100 3.8200 3.8300 + 3.8400 3.8500 3.8600 3.8700 3.8800 3.8900 3.9000 3.9100 + 3.9200 3.9300 3.9400 3.9500 3.9600 3.9700 3.9800 3.9900 + 4.0000 4.0100 4.0200 4.0300 4.0400 4.0500 4.0600 4.0700 + 4.0800 4.0900 4.1000 4.1100 4.1200 4.1300 4.1400 4.1500 + 4.1600 4.1700 4.1800 4.1900 4.2000 4.2100 4.2200 4.2300 + 4.2400 4.2500 4.2600 4.2700 4.2800 4.2900 4.3000 4.3100 + 4.3200 4.3300 4.3400 4.3500 4.3600 4.3700 4.3800 4.3900 + 4.4000 4.4100 4.4200 4.4300 4.4400 4.4500 4.4600 4.4700 + 4.4800 4.4900 4.5000 4.5100 4.5200 4.5300 4.5400 4.5500 + 4.5600 4.5700 4.5800 4.5900 4.6000 4.6100 4.6200 4.6300 + 4.6400 4.6500 4.6600 4.6700 4.6800 4.6900 4.7000 4.7100 + 4.7200 4.7300 4.7400 4.7500 4.7600 4.7700 4.7800 4.7900 + 4.8000 4.8100 4.8200 4.8300 4.8400 4.8500 4.8600 4.8700 + 4.8800 4.8900 4.9000 4.9100 4.9200 4.9300 4.9400 4.9500 + 4.9600 4.9700 4.9800 4.9900 5.0000 5.0100 5.0200 5.0300 + 5.0400 5.0500 5.0600 5.0700 5.0800 5.0900 5.1000 5.1100 + 5.1200 5.1300 5.1400 5.1500 5.1600 5.1700 5.1800 5.1900 + 5.2000 5.2100 5.2200 5.2300 5.2400 5.2500 5.2600 5.2700 + 5.2800 5.2900 5.3000 5.3100 5.3200 5.3300 5.3400 5.3500 + 5.3600 5.3700 5.3800 5.3900 5.4000 5.4100 5.4200 5.4300 + 5.4400 5.4500 5.4600 5.4700 5.4800 5.4900 5.5000 5.5100 + 5.5200 5.5300 5.5400 5.5500 5.5600 5.5700 5.5800 5.5900 + 5.6000 5.6100 5.6200 5.6300 5.6400 5.6500 5.6600 5.6700 + 5.6800 5.6900 5.7000 5.7100 5.7200 5.7300 5.7400 5.7500 + 5.7600 5.7700 5.7800 5.7900 5.8000 5.8100 5.8200 5.8300 + 5.8400 5.8500 5.8600 5.8700 5.8800 5.8900 5.9000 5.9100 + 5.9200 5.9300 5.9400 5.9500 5.9600 5.9700 5.9800 5.9900 + 6.0000 6.0100 + + + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 0.0100 + 0.0100 0.0100 + + + + -2.7605700345E+01 -3.0784865229E+01 -3.2349253618E+01 -3.2751366129E+01 + -3.2443703381E+01 -3.1938024293E+01 -3.1464309182E+01 -3.1081089156E+01 + -3.0780110534E+01 -3.0537539935E+01 -3.0331510013E+01 -3.0145737072E+01 + -2.9968950315E+01 -2.9793612997E+01 -2.9614858119E+01 -2.9429745358E+01 + -2.9236754295E+01 -2.9035419392E+01 -2.8826044018E+01 -2.8609460457E+01 + -2.8386823980E+01 -2.8159440471E+01 -2.7928630453E+01 -2.7695631454E+01 + -2.7461537210E+01 -2.7227268680E+01 -2.6993569183E+01 -2.6761015821E+01 + -2.6530039202E+01 -2.6300945472E+01 -2.6073936437E+01 -2.5849125236E+01 + -2.5626546546E+01 -2.5406161554E+01 -2.5187858066E+01 -2.4971448643E+01 + -2.4756666888E+01 -2.4543166280E+01 -2.4330521781E+01 -2.4118237688E+01 + -2.3905762462E+01 -2.3692510781E+01 -2.3477892157E+01 -2.3261343931E+01 + -2.3042365424E+01 -2.2820549497E+01 -2.2595607833E+01 -2.2367387034E+01 + -2.2135873927E+01 -2.1901189722E+01 -2.1663577130E+01 -2.1423377048E+01 + -2.1181003715E+01 -2.0936919717E+01 -2.0691610496E+01 -2.0445564221E+01 + -2.0199254652E+01 -1.9953130261E+01 -1.9707605286E+01 -1.9463057569E+01 + -1.9219826157E+01 -1.8978213343E+01 -1.8738487400E+01 -1.8500884660E+01 + -1.8265614596E+01 -1.8032862583E+01 -1.7802792920E+01 -1.7575552408E+01 + -1.7351272692E+01 -1.7130071760E+01 -1.6912056036E+01 -1.6697321537E+01 + -1.6485954716E+01 -1.6278033179E+01 -1.6073625719E+01 -1.5872792819E+01 + -1.5675586595E+01 -1.5482050684E+01 -1.5292220051E+01 -1.5106120725E+01 + -1.4923769479E+01 -1.4745173477E+01 -1.4570329881E+01 -1.4399225454E+01 + -1.4231836134E+01 -1.4068126609E+01 -1.3908049886E+01 -1.3751546850E+01 + -1.3598545829E+01 -1.3448962145E+01 -1.3302697611E+01 -1.3159640031E+01 + -1.3019669910E+01 -1.2882669787E+01 -1.2748527869E+01 -1.2617137724E+01 + -1.2488398068E+01 -1.2362212574E+01 -1.2238489692E+01 -1.2117142884E+01 + -1.1998090066E+01 -1.1881253628E+01 -1.1766560302E+01 -1.1653941032E+01 + -1.1543330569E+01 -1.1434668196E+01 -1.1327896756E+01 -1.1222962743E+01 + -1.1119816109E+01 -1.1018409929E+01 -1.0918701041E+01 -1.0820648952E+01 + -1.0724215912E+01 -1.0629366457E+01 -1.0536068056E+01 -1.0444290028E+01 + -1.0354003461E+01 -1.0265180964E+01 -1.0177796938E+01 -1.0091826632E+01 + -1.0007246112E+01 -9.9240322892E+00 -9.8421624187E+00 -9.7616139299E+00 + -9.6823643703E+00 -9.6043910435E+00 -9.5276710191E+00 -9.4521810563E+00 + -9.3778971539E+00 -9.3047950086E+00 -9.2328496504E+00 -9.1620363695E+00 + -9.0923305110E+00 -9.0237077361E+00 -8.9561431451E+00 -8.8896116158E+00 + -8.8240890211E+00 -8.7595512275E+00 -8.6959740871E+00 -8.6333343002E+00 + -8.5716086751E+00 -8.5107748378E+00 -8.4508110921E+00 -8.3916960209E+00 + -8.3334097570E+00 -8.2759323779E+00 -8.2192454990E+00 -8.1633312824E+00 + -8.1081727717E+00 -8.0537547331E+00 -8.0000623436E+00 -7.9470813275E+00 + -7.8947972321E+00 -7.8431966714E+00 -7.7922661900E+00 -7.7419928953E+00 + -7.6923641381E+00 -7.6433675558E+00 -7.5949912477E+00 -7.5472233618E+00 + -7.5000526824E+00 -7.4534678545E+00 -7.4074582876E+00 -7.3620131113E+00 + -7.3171223055E+00 -7.2727754717E+00 -7.2289631023E+00 -7.1856752817E+00 + -7.1429029518E+00 -7.1006366576E+00 -7.0588677730E+00 -7.0175872653E+00 + -6.9767869231E+00 -6.9364581153E+00 -6.8965930059E+00 -6.8571833718E+00 + -6.8182217002E+00 -6.7797001743E+00 -6.7416115702E+00 -6.7039484718E+00 + -6.6667039108E+00 -6.6298708673E+00 -6.5934425974E+00 -6.5574124728E+00 + -6.5217739457E+00 -6.4865207734E+00 -6.4516465808E+00 -6.4171455001E+00 + -6.3830113137E+00 -6.3492384567E+00 -6.3158210267E+00 -6.2827535725E+00 + -6.2500305645E+00 -6.2176466374E+00 -6.1855966333E+00 -6.1538752555E+00 + -6.1224776754E+00 -6.0913987519E+00 -6.0606338291E+00 -6.0301780858E+00 + -6.0000268845E+00 -5.9701757684E+00 -5.9406201055E+00 -5.9113557302E+00 + -5.8823781953E+00 -5.8536833983E+00 -5.8252672254E+00 -5.7971255362E+00 + -5.7692545325E+00 -5.7416501530E+00 -5.7143087187E+00 -5.6872264675E+00 + -5.6603996483E+00 -5.6338248102E+00 -5.6074982583E+00 -5.5814166408E+00 + -5.5555765569E+00 -5.5299745536E+00 -5.5046075112E+00 -5.4794720848E+00 + -5.4545651655E+00 -5.4298837212E+00 -5.4054245210E+00 -5.3811847580E+00 + -5.3571614267E+00 -5.3333515869E+00 -5.3097525260E+00 -5.2863613325E+00 + -5.2631753334E+00 -5.2401918998E+00 -5.2174082208E+00 -5.1948218607E+00 + -5.1724302389E+00 -5.1502307471E+00 -5.1282210592E+00 -5.1063986772E+00 + -5.0847611945E+00 -5.0633063698E+00 -5.0420317959E+00 -5.0209352464E+00 + -5.0000145619E+00 -4.9792674276E+00 -4.9586917756E+00 -4.9382855278E+00 + -4.9180464624E+00 -4.8979726494E+00 -4.8780620924E+00 -4.8583126624E+00 + -4.8387225484E+00 -4.8192898345E+00 -4.8000124892E+00 -4.7808887980E+00 + -4.7619169283E+00 -4.7430949440E+00 -4.7244212124E+00 -4.7058939893E+00 + -4.6875114188E+00 -4.6692719493E+00 -4.6511739183E+00 -4.6332155580E+00 + -4.6153953755E+00 -4.5977117925E+00 -4.5801631296E+00 -4.5627479386E+00 + -4.5454647266E+00 -4.5283119032E+00 -4.5112880519E+00 -4.4943917650E+00 + -4.4776215414E+00 -4.4609759844E+00 -4.4444537713E+00 -4.4280534916E+00 + -4.4117737574E+00 -4.3956133298E+00 -4.3795708900E+00 -4.3636450498E+00 + -4.3478346519E+00 -4.3321384475E+00 -4.3165551080E+00 -4.3010834883E+00 + -4.2857224193E+00 -4.2704706626E+00 -4.2553270471E+00 -4.2402904912E+00 + -4.2253598492E+00 -4.2105339172E+00 -4.1958116967E+00 -4.1811921057E+00 + -4.1666739956E+00 -4.1522563551E+00 -4.1379381819E+00 -4.1237184204E+00 + -4.1095960051E+00 -4.0955700209E+00 -4.0816394841E+00 -4.0678033425E+00 + -4.0540606926E+00 -4.0404106187E+00 -4.0268521620E+00 -4.0133843475E+00 + -4.0000063484E+00 -3.9867172703E+00 -3.9735161622E+00 -3.9604021828E+00 + -3.9473745101E+00 -3.9344322882E+00 -3.9215745909E+00 -3.9088006833E+00 + -3.8961097526E+00 -3.8835009538E+00 -3.8709734686E+00 -3.8585265734E+00 + -3.8461594934E+00 -3.8338713986E+00 -3.8216615661E+00 -3.8095292837E+00 + -3.7974738126E+00 -3.7854943426E+00 -3.7735902317E+00 -3.7617607813E+00 + -3.7500052762E+00 -3.7383229617E+00 -3.7267132311E+00 -3.7151754129E+00 + -3.7037088125E+00 -3.6923127373E+00 -3.6809865997E+00 -3.6697297595E+00 + -3.6585415452E+00 -3.6474213158E+00 -3.6363685045E+00 -3.6253825007E+00 + -3.6144626587E+00 -3.6036083788E+00 -3.5928191167E+00 -3.5820942902E+00 + -3.5714332815E+00 -3.5608355222E+00 -3.5503004929E+00 -3.5398276385E+00 + -3.5294163709E+00 -3.5190661440E+00 -3.5087764652E+00 -3.4985468053E+00 + -3.4883766076E+00 -3.4782653400E+00 -3.4682125383E+00 -3.4582176981E+00 + -3.4482802961E+00 -3.4383998061E+00 -3.4285757940E+00 -3.4188077789E+00 + -3.4090952728E+00 -3.3994377480E+00 -3.3898348019E+00 -3.3802859760E+00 + -3.3707908119E+00 -3.3613487964E+00 -3.3519595367E+00 -3.3426226031E+00 + -3.3333375585E+00 -3.3241039280E+00 -3.3149213002E+00 -3.3057892823E+00 + -3.2967074576E+00 -3.2876753919E+00 -3.2786926486E+00 -3.2697588729E+00 + -3.2608736674E+00 -3.2520366348E+00 -3.2432473253E+00 -3.2345054052E+00 + -3.2258105008E+00 -3.2171622335E+00 -3.2085601965E+00 -3.2000040171E+00 + -3.1914933640E+00 -3.1830278760E+00 -3.1746071920E+00 -3.1662308963E+00 + -3.1578986987E+00 -3.1496102547E+00 -3.1413652201E+00 -3.1331632249E+00 + -3.1250039281E+00 -3.1168870307E+00 -3.1088122044E+00 -3.1007791210E+00 + -3.0927874062E+00 -3.0848367838E+00 -3.0769269476E+00 -3.0690575847E+00 + -3.0612283700E+00 -3.0534389657E+00 -3.0456891132E+00 -3.0379785141E+00 + -3.0303068700E+00 -3.0226738555E+00 -3.0150791818E+00 -3.0075225888E+00 + -3.0000037918E+00 -2.9925225065E+00 -2.9850784103E+00 -2.9776712548E+00 + -2.9703007806E+00 -2.9629667163E+00 -2.9556687906E+00 -2.9484066870E+00 + -2.9411801890E+00 -2.9339890404E+00 -2.9268329824E+00 -2.9197117526E+00 + -2.9126250543E+00 -2.9055726836E+00 -2.8985543940E+00 -2.8915699388E+00 + -2.8846190644E+00 -2.8777014940E+00 -2.8708170314E+00 -2.8639654413E+00 + -2.8571464888E+00 -2.8503599315E+00 -2.8436055055E+00 -2.8368830243E+00 + -2.8301922637E+00 -2.8235329996E+00 -2.8169050030E+00 -2.8103080169E+00 + -2.8037418662E+00 -2.7972063374E+00 -2.7907012166E+00 -2.7842262903E+00 + -2.7777813024E+00 -2.7713660913E+00 -2.7649804532E+00 -2.7586241845E+00 + -2.7522970813E+00 -2.7459989054E+00 -2.7397294879E+00 -2.7334886419E+00 + -2.7272761732E+00 -2.7210918876E+00 -2.7149355663E+00 -2.7088070278E+00 + -2.7027061039E+00 -2.6966326094E+00 -2.6905863591E+00 -2.6845671557E+00 + -2.6785748003E+00 -2.6726091446E+00 -2.6666700119E+00 -2.6607572257E+00 + -2.6548706095E+00 -2.6490099504E+00 -2.6431751131E+00 -2.6373659318E+00 + -2.6315822382E+00 -2.6258238639E+00 -2.6200906210E+00 -2.6143823457E+00 + -2.6086988964E+00 -2.6030401127E+00 -2.5974058340E+00 -2.5917958991E+00 + -2.5862101123E+00 -2.5806483565E+00 -2.5751104788E+00 -2.5695963262E+00 + -2.5641057455E+00 -2.5586385667E+00 -2.5531946375E+00 -2.5477738314E+00 + -2.5423760028E+00 -2.5370010057E+00 -2.5316486943E+00 -2.5263188926E+00 + -2.5210114847E+00 -2.5157263372E+00 -2.5104633109E+00 -2.5052222669E+00 + -2.5000030605E+00 -2.4948055297E+00 -2.4896295712E+00 -2.4844750523E+00 + -2.4793418405E+00 -2.4742298031E+00 -2.4691387940E+00 -2.4640686757E+00 + -2.4590193426E+00 -2.4539906681E+00 -2.4489825259E+00 -2.4439947896E+00 + -2.4390273136E+00 -2.4340799794E+00 -2.4291526807E+00 -2.4242452972E+00 + -2.4193577083E+00 -2.4144897934E+00 -2.4096414103E+00 -2.4048124528E+00 + -2.4000028171E+00 -2.3952123882E+00 -2.3904410511E+00 -2.3856886909E+00 + -2.3809551705E+00 -2.3762403912E+00 -2.3715442531E+00 -2.3668666465E+00 + -2.3622074621E+00 -2.3575665900E+00 -2.3529439004E+00 -2.3483392967E+00 + -2.3437526852E+00 -2.3391839614E+00 -2.3346330208E+00 -2.3300997590E+00 + -2.3255840547E+00 -2.3210858091E+00 -2.3166049363E+00 -2.3121413368E+00 + -2.3076949109E+00 -2.3032655590E+00 -2.2988531707E+00 -2.2944576400E+00 + -2.2900788908E+00 -2.2857168282E+00 -2.2813713571E+00 -2.2770423826E+00 + -2.2727298068E+00 -2.2684335124E+00 -2.2641534347E+00 -2.2598894829E+00 + -2.2556415666E+00 -2.2514095953E+00 -2.2471934785E+00 -2.2429931038E+00 + -2.2388083992E+00 -2.2346392847E+00 -2.2304856742E+00 -2.2263474813E+00 + -2.2222246197E+00 -2.2181169931E+00 -2.2140245088E+00 -2.2099471023E+00 + -2.2058846913E+00 -2.2018371933E+00 -2.1978045263E+00 -2.1937866078E+00 + -2.1897833323E+00 -2.1857946406E+00 -2.1818204576E+00 -2.1778607050E+00 + -2.1739153043E+00 -2.1699841770E+00 -2.1660672366E+00 -2.1621643955E+00 + -2.1582755972E+00 -2.1544007668E+00 -2.1505398296E+00 -2.1466927107E+00 + -2.1428593354E+00 -2.1390396118E+00 -2.1352334757E+00 -2.1314408644E+00 + -2.1276617067E+00 -2.1238959313E+00 -2.1201434667E+00 -2.1164042418E+00 + -2.1126781618E+00 -2.1089651802E+00 -2.1052652307E+00 -2.1015782452E+00 + -2.0979041558E+00 -2.0942428944E+00 -2.0905943898E+00 -2.0869585565E+00 + -2.0833353508E+00 -2.0797247079E+00 -2.0761265629E+00 -2.0725408510E+00 + -2.0689675074E+00 -2.0654064613E+00 -2.0618576366E+00 -2.0583209894E+00 + -2.0547964579E+00 -2.0512839803E+00 -2.0477834948E+00 -2.0442949396E+00 + -2.0408182464E+00 -2.0373533437E+00 -2.0339001895E+00 -2.0304587249E+00 + -2.0270288910E+00 -2.0236106288E+00 -2.0202038794E+00 -2.0168085786E+00 + -2.0134246558E+00 -2.0100520723E+00 -2.0066907719E+00 -2.0033406985E+00 + -2.0000017959E+00 -1.9966740079E+00 + + + + 0.0000000000E+00 -8.2277987587E-02 -1.6449650094E-01 -2.4659331589E-01 + -3.2850076507E-01 -4.1014315697E-01 -4.9143436126E-01 -5.7227561145E-01 + -6.5255357242E-01 -7.3213871601E-01 -8.1088404273E-01 -8.8862418182E-01 + -9.6517489579E-01 -1.0403330086E+00 -1.1138767696E+00 -1.1855666583E+00 + -1.2551466268E+00 -1.3223457701E+00 -1.3868804065E+00 -1.4484565448E+00 + -1.5067727038E+00 -1.5615230499E+00 -1.6124008059E+00 -1.6591018874E+00 + -1.7013287065E+00 -1.7387940878E+00 -1.7712252542E+00 -1.7983677872E+00 + -1.8199895278E+00 -1.8358843512E+00 -1.8458757490E+00 -1.8498201626E+00 + -1.8476100093E+00 -1.8391763180E+00 -1.8244910913E+00 -1.8035689946E+00 + -1.7764688338E+00 -1.7432942635E+00 -1.7041941790E+00 -1.6593624450E+00 + -1.6090370910E+00 -1.5534989864E+00 -1.4930699667E+00 -1.4281104400E+00 + -1.3590165014E+00 -1.2862165869E+00 -1.2101677086E+00 -1.1313513155E+00 + -1.0502688403E+00 -9.6743710159E-01 -8.8338307362E-01 -7.9863905513E-01 + -7.1373774907E-01 -6.2920651981E-01 -5.4556280508E-01 -4.6330924845E-01 + -3.8292814427E-01 -3.0487830138E-01 -2.2958906110E-01 -1.5745833560E-01 + -8.8847539142E-02 -2.4079508545E-02 3.6563691834E-02 9.2844371601E-02 + 1.4456869600E-01 1.9158861786E-01 2.3380285278E-01 2.7115554880E-01 + 3.0363571638E-01 3.3127718718E-01 3.5415591151E-01 3.7238794759E-01 + 3.8612701355E-01 3.9556147997E-01 4.0091144918E-01 4.0242475349E-01 + 4.0037331823E-01 3.9504921005E-01 3.8676054393E-01 3.7582731451E-01 + 3.6257720433E-01 3.4734141910E-01 3.3045059692E-01 3.1223083453E-01 + 2.9299986887E-01 2.7306344758E-01 2.5271191615E-01 2.3221704416E-01 + 2.1182910699E-01 1.9177423337E-01 1.7225200095E-01 1.5343329037E-01 + 1.3546088278E-01 1.1845195585E-01 1.0249965400E-01 8.7673842851E-02 + 7.4022153762E-02 6.1571422473E-02 5.0329214779E-02 4.0284462837E-02 + 3.1410783526E-02 2.3667878040E-02 1.7003522416E-02 1.1355567187E-02 + 6.6538808501E-03 2.8220678737E-03 -2.2001240793E-04 -2.5547866842E-03 + -4.2654366871E-03 -5.4349451843E-03 -6.1429431867E-03 -6.4660691080E-03 + -6.4767064284E-03 -6.2432624449E-03 -5.8262992394E-03 -5.2807905609E-03 + -4.6556441299E-03 -3.9940297562E-03 -3.3299352117E-03 -2.6921631841E-03 + -2.1041805481E-03 -1.5819270303E-03 -1.1356467997E-03 -7.7141771203E-04 + -4.9002008278E-04 -2.8685599057E-04 -1.5440700844E-04 -8.1295680504E-05 + -5.2958831332E-05 -4.9024979272E-05 -2.2654023957E-05 2.0802206378E-06 + 1.6220072646E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 -1.1723087215E-02 -2.2970588285E-02 -3.3277762775E-02 + -4.2201369170E-02 -4.9329936250E-02 -5.4293469599E-02 -5.6772419538E-02 + -5.6505748973E-02 -5.3297954463E-02 -4.7024911330E-02 -3.7638432778E-02 + -2.5169454710E-02 -9.7297804400E-03 8.4876559486E-03 2.9210025055E-02 + 5.2087327705E-02 7.6696576823E-02 1.0254737811E-01 1.2908882978E-01 + 1.5571763119E-01 1.8178728239E-01 2.0661822255E-01 2.2950875795E-01 + 2.4974659019E-01 2.6662075364E-01 2.7943382524E-01 2.8751410085E-01 + 2.9022762150E-01 2.8698983512E-01 2.7727667838E-01 2.6063490065E-01 + 2.3669144662E-01 2.0516162976E-01 1.6585646477E-01 1.1868792319E-01 + 6.3673539750E-02 9.3865644130E-04 -6.9282296205E-02 -1.4664653237E-01 + -2.3070525508E-01 -3.2090755014E-01 -4.1660590836E-01 -5.1706326588E-01 + -6.2146146368E-01 -7.2891100660E-01 -8.3846198150E-01 -9.4911597183E-01 + -1.0598387764E+00 -1.1695734189E+00 -1.2772547958E+00 -1.3818230208E+00 + -1.4822368409E+00 -1.5774891053E+00 -1.6666187728E+00 -1.7487234696E+00 + -1.8229735575E+00 -1.8886194365E+00 -1.9450060422E+00 -1.9915764523E+00 + -2.0278831780E+00 -2.0535914046E+00 -2.0684822557E+00 -2.0724589319E+00 + -2.0655426479E+00 -2.0478740211E+00 -2.0197115502E+00 -1.9814248238E+00 + -1.9334892505E+00 -1.8764808008E+00 -1.8110656211E+00 -1.7379906968E+00 + -1.6580733899E+00 -1.5721902388E+00 -1.4812642140E+00 -1.3862522622E+00 + -1.2881324457E+00 -1.1878908963E+00 -1.0865088556E+00 -9.8494996663E-01 + -8.8414798922E-01 -7.8499509134E-01 -6.8833085835E-01 -5.9493213952E-01 + -5.0550383294E-01 -4.2067068746E-01 -3.4097017799E-01 -2.6684648767E-01 + -1.9864560686E-01 -1.3661153627E-01 -8.0883449121E-02 -3.1493861467E-02 + 1.1620322833E-02 4.8599589644E-02 7.9650226738E-02 1.0503788587E-01 + 1.2508039801E-01 1.4013995079E-01 1.5061541504E-01 1.5693366067E-01 + 1.5954043230E-01 1.5889246200E-01 1.5544945597E-01 1.4966651822E-01 + 1.4199014613E-01 1.3284299597E-01 1.2262519169E-01 1.1170778401E-01 + 1.0042928223E-01 8.9095504256E-02 7.7963775928E-02 6.7255547029E-02 + 5.7152141457E-02 4.7799764163E-02 3.9294804857E-02 3.1701123437E-02 + 2.5050278343E-02 1.9344675342E-02 1.4551822257E-02 1.0621676019E-02 + 7.4866418173E-03 5.0616443312E-03 3.2542385947E-03 1.9673338834E-03 + 1.1012904675E-03 5.6303386455E-04 2.6418408232E-04 1.2416036016E-04 + 8.3638494781E-05 8.3445532246E-05 3.9712888830E-05 -3.5905440177E-06 + -2.7996494097E-06 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 3.5860269827E-03 1.4317078272E-02 3.2112256128E-02 + 5.6837367274E-02 8.8305873299E-02 1.2628021312E-01 1.7047348950E-01 + 2.2055150919E-01 2.7613516420E-01 3.3680313934E-01 4.0209492899E-01 + 4.7151414403E-01 5.4453208758E-01 6.2059157645E-01 6.9911098297E-01 + 7.7948847033E-01 8.6110639245E-01 9.4333582837E-01 1.0255412195E+00 + 1.1070850756E+00 1.1873327175E+00 1.2656570189E+00 1.3414431144E+00 + 1.4140930355E+00 1.4830302391E+00 1.5477039940E+00 1.6075935868E+00 + 1.6622123152E+00 1.7111112337E+00 1.7538826190E+00 1.7901631245E+00 + 1.8196365952E+00 1.8420365276E+00 1.8571481070E+00 1.8648098949E+00 + 1.8649150077E+00 1.8574119504E+00 1.8423049075E+00 1.8196536236E+00 + 1.7895728317E+00 1.7522312003E+00 1.7078498355E+00 1.6567003418E+00 + 1.5991024567E+00 1.5354212770E+00 1.4660641009E+00 1.3914769134E+00 + 1.3121405542E+00 1.2285667331E+00 1.1412932403E+00 1.0508797039E+00 + 9.5790298913E-01 8.6295169350E-01 7.6662172078E-01 6.6951129918E-01 + 5.7221537424E-01 4.7532181715E-01 3.7940524579E-01 2.8502383408E-01 + 1.9271369849E-01 1.0298539150E-01 1.6320224853E-02 -6.6834318537E-02 + -1.4606648327E-01 -2.2100368547E-01 -2.9131520005E-01 -3.5671342275E-01 + -4.1695549560E-01 -4.7184486654E-01 -5.2123135255E-01 -5.6501133337E-01 + -6.0312746230E-01 -6.3556796384E-01 -6.6236527842E-01 -6.8359449970E-01 + -6.9937142322E-01 -7.0985023488E-01 -7.1522090252E-01 -7.1570630926E-01 + -7.1155917402E-01 -7.0305880711E-01 -6.9050775058E-01 -6.7422835456E-01 + -6.5455934146E-01 -6.3185241011E-01 -6.0646893131E-01 -5.7877678564E-01 + -5.4914739239E-01 -5.1795297687E-01 -4.8556415192E-01 -4.5234782509E-01 + -4.1866194064E-01 -3.8484854594E-01 -3.5122924483E-01 -3.1810273720E-01 + -2.8574272301E-01 -2.5439648427E-01 -2.2428377777E-01 -1.9559309794E-01 + -1.6848457254E-01 -1.4308867914E-01 -1.1950650654E-01 -9.7810361217E-02 + -7.8045864567E-02 -6.0228944123E-02 -4.4352023434E-02 -3.0384350338E-02 + -1.8273960617E-02 -7.9495883994E-03 6.7759973479E-04 7.7099198058E-03 + 1.3261526160E-02 1.7457218324E-02 2.0427124578E-02 2.2305646179E-02 + 2.3229681315E-02 2.3338002873E-02 2.2762351834E-02 2.1631893993E-02 + 2.0072411241E-02 1.8198596607E-02 1.6115058374E-02 1.3919754929E-02 + 1.1698898123E-02 9.5228516845E-03 7.4546618226E-03 5.5452981103E-03 + 3.8288793415E-03 2.3331720374E-03 1.0736899984E-03 5.2926998136E-05 + -7.3149996906E-04 -1.2929678601E-03 -1.6511600028E-03 -1.8297965622E-03 + -1.8585360541E-03 -1.7678438403E-03 -1.5911002682E-03 -1.3586955246E-03 + -1.1019690505E-03 -8.4702839256E-04 -6.1497715279E-04 -4.2541468309E-04 + -2.8402093044E-04 -1.9725198792E-04 -1.6029137555E-04 -1.5177315345E-04 + -8.9838576118E-05 -5.4771430827E-06 9.6147639048E-06 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 0.0000000000E+00 9.2893242255E-04 3.7019764676E-03 8.2779769445E-03 + 1.4588689808E-02 2.2539302945E-02 3.2009163013E-02 4.2852705981E-02 + 5.4900588274E-02 6.7961014587E-02 8.1821257513E-02 9.6249363136E-02 + 1.1099603565E-01 1.2579669284E-01 1.4037368313E-01 1.5443865322E-01 + 1.6769505435E-01 1.7984077312E-01 1.9057087191E-01 1.9958042202E-01 + 2.0656741042E-01 2.1123570101E-01 2.1329802783E-01 2.1247899806E-01 + 2.0851807950E-01 2.0117254726E-01 1.9022036400E-01 1.7546296384E-01 + 1.5672791414E-01 1.3387142592E-01 1.0678068413E-01 7.5375969726E-02 + 3.9612545899E-02 -5.1771162367E-04 -4.4984990254E-02 -9.3720492346E-02 + -1.4661576728E-01 -2.0352233418E-01 -2.6425172921E-01 -3.2857590175E-01 + -3.9622799242E-01 -4.6690352048E-01 -5.4026196118E-01 -6.1592871460E-01 + -6.9349745874E-01 -7.7253287529E-01 -8.5257373131E-01 -9.3313629426E-01 + -1.0137180499E+00 -1.0938015836E+00 -1.1728591565E+00 -1.2503568716E+00 + -1.3257591460E+00 -1.3985339592E+00 -1.4681572088E+00 -1.5341175221E+00 + -1.5959215886E+00 -1.6530979289E+00 -1.7052026499E+00 -1.7518226198E+00 + -1.7925806287E+00 -1.8271386946E+00 -1.8552014319E+00 -1.8765200508E+00 + -1.8908940379E+00 -1.8981739659E+00 -1.8982634918E+00 -1.8911201167E+00 + -1.8767560905E+00 -1.8552388890E+00 -1.8266905450E+00 -1.7912868237E+00 + -1.7492558153E+00 -1.7008761570E+00 -1.6464740899E+00 -1.5864208426E+00 + -1.5211291980E+00 -1.4510496961E+00 -1.3766664971E+00 -1.2984929459E+00 + -1.2170668968E+00 -1.1329458601E+00 -1.0467020356E+00 -9.5891730044E-01 + -8.7017821889E-01 -7.8107114433E-01 -6.9217748077E-01 -6.0406917196E-01 + -5.1730448344E-01 -4.3242413992E-01 -3.4994793756E-01 -2.7037179974E-01 + -1.9415879235E-01 -1.2172780433E-01 -5.3447524144E-02 1.0365478214E-02 + 6.9448141778E-02 1.2359143475E-01 1.7264050244E-01 2.1649715017E-01 + 2.5511519340E-01 2.8850025641E-01 3.1670773256E-01 3.3984027408E-01 + 3.5804463559E-01 3.7150996533E-01 3.8046133188E-01 3.8515667437E-01 + 3.8588276317E-01 3.8295243350E-01 3.7669486668E-01 3.6745451357E-01 + 3.5558583975E-01 3.4145309072E-01 3.2541361978E-01 3.0782259726E-01 + 2.8902885306E-01 2.6937446596E-01 2.4917322584E-01 2.2872577817E-01 + 2.0831749242E-01 1.8820101658E-01 1.6860103788E-01 1.4972254242E-01 + 1.3173967350E-01 1.1478834281E-01 9.8985070983E-02 8.4416837992E-02 + 7.1132442003E-02 5.9164183104E-02 4.8515945607E-02 3.9162908641E-02 + 3.1067102133E-02 2.4166226359E-02 1.8383581049E-02 1.3631066681E-02 + 9.8082692597E-03 6.8108066814E-03 4.5261412594E-03 2.8479629339E-03 + 1.6647468801E-03 8.7544647586E-04 3.8748703362E-04 1.0892680591E-04 + -2.3425222903E-05 -7.7922079727E-05 -9.4002294959E-05 -9.5906384375E-05 + -5.6988379155E-05 -3.5463910332E-06 5.9608986436E-06 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 + + + 1.9514303897E+01 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 2.7522534413E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 -9.6137176497E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 -3.2324794045E+00 + + + + + + 0.0000000000E+00 2.4555322044E-04 9.9435596078E-04 2.2826802809E-03 + 4.1704577663E-03 6.7405039734E-03 1.0097446971E-02 1.4366374033E-02 + 1.9691214178E-02 2.6232877622E-02 3.4167176269E-02 4.3682552029E-02 + 5.4977642082E-02 6.8258712011E-02 8.3736989112E-02 1.0162592925E-01 + 1.2213845080E-01 1.4548416964E-01 1.7186666804E-01 2.0148082992E-01 + 2.3451027351E-01 2.7112491013E-01 3.1147865648E-01 3.5570732483E-01 + 4.0392671304E-01 4.5623091264E-01 5.1269085328E-01 5.7335309214E-01 + 6.3823886033E-01 7.0734337238E-01 7.8063540062E-01 8.5805711439E-01 + 9.3952417996E-01 1.0249261017E+00 1.1141268534E+00 1.2069656628E+00 + 1.3032581166E+00 1.4027973581E+00 1.5053555697E+00 1.6106855669E+00 + 1.7185225365E+00 1.8285859201E+00 1.9405813920E+00 2.0542029191E+00 + 2.1691348784E+00 2.2850542133E+00 2.4016326049E+00 2.5185386399E+00 + 2.6354399503E+00 2.7520052604E+00 2.8679065939E+00 2.9828210875E+00 + 3.0964328328E+00 3.2084348565E+00 3.3185305939E+00 3.4264354515E+00 + 3.5318783577E+00 3.6346027795E+00 3.7343681356E+00 3.8309505035E+00 + 3.9241436467E+00 4.0137595888E+00 4.0996291450E+00 4.1816023622E+00 + 4.2595486912E+00 4.3333571276E+00 4.4029361120E+00 4.4682134089E+00 + 4.5291358858E+00 4.5856689029E+00 4.6377959244E+00 4.6855179084E+00 + 4.7288525836E+00 4.7678337886E+00 4.8025102209E+00 4.8329448489E+00 + 4.8592138549E+00 4.8814055976E+00 4.8996195505E+00 4.9139652152E+00 + 4.9245610181E+00 4.9315332006E+00 4.9350147101E+00 4.9351441007E+00 + 4.9320644514E+00 4.9259223085E+00 4.9168666605E+00 4.9050479496E+00 + 4.8906171284E+00 4.8737247647E+00 4.8545202011E+00 4.8331507724E+00 + 4.8097610853E+00 4.7844923629E+00 4.7574818564E+00 4.7288623255E+00 + 4.6987615887E+00 4.6673022280E+00 4.6346013382E+00 4.6007695137E+00 + 4.5659116073E+00 4.5301262966E+00 4.4935060361E+00 4.4561370652E+00 + 4.4180998488E+00 4.3794678786E+00 4.3403092049E+00 4.3006862196E+00 + 4.2606559084E+00 4.2202701844E+00 4.1795755629E+00 4.1386143513E+00 + 4.0974246608E+00 4.0560406954E+00 4.0144930190E+00 3.9728092235E+00 + 3.9310140868E+00 3.8891296584E+00 3.8471763585E+00 3.8051727118E+00 + 3.7631353587E+00 3.7210801524E+00 3.6790222306E+00 3.6369754752E+00 + 3.5949532922E+00 3.5529695496E+00 3.5110371051E+00 3.4691686011E+00 + 3.4273777892E+00 3.3856773650E+00 3.3440802075E+00 3.3026002179E+00 + 3.2612500462E+00 3.2200431162E+00 3.1789931977E+00 3.1381126416E+00 + 3.0974153228E+00 3.0569141416E+00 3.0166213097E+00 2.9765501384E+00 + 2.9367121016E+00 2.8971193603E+00 2.8577833885E+00 2.8187144722E+00 + 2.7799237680E+00 2.7414203117E+00 2.7032138975E+00 2.6653129770E+00 + 2.6277254184E+00 2.5904592077E+00 2.5535203424E+00 2.5169161760E+00 + 2.4806515332E+00 2.4447325241E+00 2.4091633992E+00 2.3739487914E+00 + 2.3390925610E+00 2.3045979624E+00 2.2704685078E+00 2.2367061977E+00 + 2.2033142099E+00 2.1702934279E+00 2.1376466921E+00 2.1053739087E+00 + 2.0734775689E+00 2.0419567389E+00 2.0108135020E+00 1.9800463428E+00 + 1.9496568192E+00 1.9196429197E+00 1.8900057747E+00 1.8607428608E+00 + 1.8318549701E+00 1.8033391361E+00 1.7751957603E+00 1.7474216534E+00 + 1.7200166764E+00 1.6929775891E+00 1.6663036438E+00 1.6399916950E+00 + 1.6140403080E+00 1.5884465799E+00 1.5632083065E+00 1.5383229695E+00 + 1.5137875184E+00 1.4895999441E+00 1.4657562937E+00 1.4422551560E+00 + 1.4190916630E+00 1.3962646344E+00 1.3737695287E+00 1.3516041505E+00 + 1.3297648393E+00 1.3082482527E+00 1.2870517468E+00 1.2661707761E+00 + 1.2456035241E+00 1.2253449792E+00 1.2053930652E+00 1.1857436665E+00 + 1.1663933299E+00 1.1473392986E+00 1.1285766929E+00 1.1101036434E+00 + 1.0919153412E+00 1.0740090637E+00 1.0563813566E+00 1.0390278824E+00 + 1.0219464881E+00 1.0051322370E+00 9.8858273586E-01 9.7229433753E-01 + 9.5626288454E-01 9.4048618717E-01 9.2495945205E-01 9.0968023104E-01 + 8.9464515722E-01 8.7984988668E-01 8.6529242529E-01 8.5096836827E-01 + 8.3687483992E-01 8.2300917666E-01 8.0936653060E-01 7.9594527075E-01 + 7.8274162686E-01 7.6975194584E-01 7.5697415488E-01 7.4440404132E-01 + 7.3203906033E-01 7.1987668706E-01 7.0791241321E-01 6.9614463944E-01 + 6.8457015681E-01 6.7318513862E-01 6.6198789975E-01 6.5097491802E-01 + 6.4014312669E-01 6.2949060514E-01 6.1901366286E-01 6.0870987684E-01 + 5.9857713213E-01 5.8861165082E-01 5.7881152804E-01 5.6917450923E-01 + 5.5969679766E-01 5.5037688431E-01 5.4121243428E-01 5.3219968832E-01 + 5.2333742019E-01 5.1462325731E-01 5.0605357159E-01 4.9762726943E-01 + 4.8934201433E-01 4.8119433956E-01 4.7318319951E-01 4.6530638099E-01 + 4.5756049431E-01 4.4994457445E-01 4.4245651371E-01 4.3509310405E-01 + 4.2785330791E-01 4.2073518522E-01 4.1373575057E-01 4.0685380826E-01 + 4.0008762412E-01 3.9343446965E-01 3.8689291717E-01 3.8046146824E-01 + 3.7413768570E-01 3.6791984300E-01 3.6180669955E-01 3.5579614205E-01 + 3.4988609008E-01 3.4407557281E-01 3.3836282768E-01 3.3274538488E-01 + 3.2722254123E-01 3.2179272713E-01 3.1645359987E-01 3.1120418021E-01 + 3.0604318897E-01 3.0096867591E-01 2.9597910956E-01 2.9107357482E-01 + 2.8625054370E-01 2.8150791508E-01 2.7684511501E-01 2.7226081425E-01 + 2.6775306980E-01 2.6332090390E-01 2.5896332932E-01 2.5467885571E-01 + 2.5046582167E-01 2.4632363995E-01 2.4225111660E-01 2.3824645700E-01 + 2.3430890125E-01 2.3043753190E-01 2.2663103075E-01 2.2288787866E-01 + 2.1920758650E-01 2.1558909889E-01 2.1203087347E-01 2.0853209698E-01 + 2.0509203703E-01 2.0170965015E-01 1.9838332245E-01 1.9511274762E-01 + 1.9189700637E-01 1.8873489405E-01 1.8562532983E-01 1.8256784638E-01 + 1.7956156317E-01 1.7660516721E-01 1.7369802148E-01 1.7083951993E-01 + 1.6802882312E-01 1.6526455844E-01 1.6254643724E-01 1.5987374760E-01 + 1.5724562162E-01 1.5466088112E-01 1.5211928277E-01 1.4962011532E-01 + 1.4716247731E-01 1.4474543496E-01 1.4236869347E-01 1.4003158209E-01 + 1.3773319599E-01 1.3547277982E-01 1.3325001085E-01 1.3106425897E-01 + 1.2891464189E-01 1.2680052175E-01 1.2472157135E-01 1.2267720085E-01 + 1.2066657246E-01 1.1868911133E-01 1.1674450739E-01 1.1483221045E-01 + 1.1295144579E-01 1.1110165375E-01 1.0928256040E-01 1.0749365423E-01 + 1.0573423961E-01 1.0400373057E-01 1.0230190533E-01 1.0062828986E-01 + 9.8982281391E-02 9.7363232570E-02 9.5770986299E-02 9.4205104640E-02 + 9.2665089253E-02 9.1150203181E-02 8.9660362635E-02 8.8195164240E-02 + 8.6754184314E-02 8.5336692055E-02 8.3942565008E-02 8.2571471377E-02 + 8.1223022254E-02 7.9896618189E-02 7.8591960933E-02 7.7308833712E-02 + 7.6046880544E-02 7.4805642086E-02 7.3584629176E-02 7.2383740506E-02 + 7.1202651131E-02 7.0041020775E-02 6.8898242541E-02 6.7774247481E-02 + 6.6668765461E-02 6.5581486791E-02 6.4511958509E-02 6.3459869402E-02 + 6.2425088961E-02 6.1407336085E-02 6.0406316994E-02 5.9421479885E-02 + 5.8452822608E-02 5.7500090972E-02 5.6563019041E-02 5.5641218020E-02 + 5.4734411156E-02 5.3842496378E-02 5.2965233586E-02 5.2102372240E-02 + 5.1253457601E-02 5.0418435755E-02 4.9597119611E-02 4.8789283548E-02 + 4.7994643509E-02 4.7212852717E-02 4.6443878327E-02 4.5687517686E-02 + 4.4943559586E-02 4.4211678082E-02 4.3491681375E-02 4.2783483184E-02 + 4.2086894267E-02 4.1401717619E-02 4.0727603994E-02 4.0064476856E-02 + 3.9412211446E-02 3.8770631668E-02 3.8139554396E-02 3.7518622579E-02 + 3.6907839114E-02 3.6307055480E-02 3.5716108368E-02 3.5134814385E-02 + 3.4562862225E-02 3.4000262270E-02 3.3446869273E-02 3.2902532276E-02 + 3.2367070616E-02 3.1840217984E-02 3.1321976903E-02 3.0812213425E-02 + 3.0310788441E-02 2.9817533657E-02 2.9332204905E-02 2.8854805910E-02 + 2.8385213523E-02 2.7923299942E-02 2.7468917225E-02 2.7021823958E-02 + 2.6582032748E-02 2.6149430718E-02 2.5723900801E-02 2.5305321709E-02 + 2.4893439431E-02 2.4488280997E-02 2.4089743440E-02 2.3697719832E-02 + 2.3312099450E-02 2.2932666819E-02 2.2559404233E-02 2.2192239239E-02 + 2.1831074449E-02 2.1475809062E-02 2.1126270265E-02 2.0782385275E-02 + 2.0444115841E-02 2.0111373508E-02 1.9784066758E-02 1.9462068697E-02 + 1.9145243997E-02 1.8833590598E-02 1.8527028380E-02 1.8225474479E-02 + 1.7928843269E-02 1.7636952905E-02 1.7349817563E-02 1.7067371509E-02 + 1.6789539913E-02 1.6516245476E-02 1.6247359808E-02 1.5982811518E-02 + 1.5722581767E-02 1.5466603166E-02 1.5214806114E-02 1.4967116953E-02 + 1.4723378333E-02 1.4483616032E-02 1.4247769523E-02 1.4015776305E-02 + 1.3787571887E-02 1.3563051106E-02 1.3342146415E-02 1.3124847757E-02 + 1.2911099151E-02 1.2700842848E-02 1.2494019314E-02 1.2290502671E-02 + 1.2090293497E-02 1.1893354059E-02 1.1699632778E-02 1.1509076483E-02 + 1.1321619331E-02 1.1137157247E-02 1.0955705606E-02 1.0777218459E-02 + 1.0601648447E-02 1.0428946789E-02 1.0259036651E-02 1.0091856576E-02 + 9.9274061406E-03 9.7656432701E-03 9.6065246281E-03 9.4500056081E-03 + 9.2960048318E-03 9.1444890831E-03 8.9954481332E-03 8.8488435842E-03 + 8.7046359123E-03 8.5627844608E-03 8.4232085626E-03 8.2858909371E-03 + 8.1508168888E-03 8.0179514903E-03 7.8872588105E-03 7.7587019092E-03 + 7.6322050317E-03 7.5077566051E-03 7.3853419925E-03 7.2649295244E-03 + 7.1464866384E-03 7.0299798746E-03 6.9153417240E-03 6.8025579795E-03 + 6.6916177587E-03 6.5824924357E-03 6.4751525918E-03 6.3695680107E-03 + 6.2656820661E-03 6.1634712357E-03 6.0629312937E-03 5.9640364449E-03 + 5.8667601907E-03 5.7710753252E-03 5.6769381537E-03 5.5843106621E-03 + 5.4931974191E-03 5.4035752507E-03 5.3154203599E-03 5.2287083230E-03 + 5.1434098717E-03 5.0594687788E-03 4.9768997803E-03 4.8956821190E-03 + 4.8157944869E-03 4.7372150220E-03 4.6599213051E-03 4.5838621307E-03 + 4.5090375337E-03 4.4354374536E-03 4.3630428668E-03 4.2918342606E-03 + 4.2217916304E-03 4.1528822007E-03 4.0850770685E-03 4.0183813155E-03 + 3.9527780072E-03 3.8882497776E-03 3.8247788275E-03 3.7623469216E-03 + 3.7009082742E-03 3.6404704082E-03 3.5810223207E-03 3.5225486012E-03 + 3.4650334570E-03 3.4084607124E-03 3.3528049178E-03 3.2980391006E-03 + 3.2441697846E-03 3.1911833332E-03 3.1390657742E-03 3.0878027987E-03 + 3.0373797587E-03 2.9877641034E-03 2.9389511875E-03 2.8909379581E-03 + 2.8437120887E-03 2.7972609573E-03 2.7515716446E-03 2.7066309326E-03 + 2.6624026263E-03 2.6188968441E-03 2.5761042605E-03 2.5340137731E-03 + 2.4926140192E-03 2.4518933742E-03 2.4118369488E-03 2.3724166399E-03 + 2.3336420418E-03 2.2955034166E-03 2.2579907985E-03 2.2210939931E-03 + 2.1848025759E-03 2.1491007974E-03 2.1139679998E-03 2.0794109580E-03 + 2.0454209566E-03 2.0119890803E-03 1.9791062132E-03 1.9467630375E-03 + 1.9149447857E-03 1.8836339902E-03 1.8528364927E-03 1.8225445192E-03 + 1.7927501202E-03 1.7634451708E-03 1.7346213692E-03 1.7062663468E-03 + 1.6783624620E-03 1.6509161204E-03 1.6239204100E-03 1.5973682657E-03 + 1.5712524689E-03 1.5455656462E-03 + + diff --git a/ABACUS.develop/examples/H2O-deepks-pw/O_gga_7au_60Ry_2s2p1d.orb b/ABACUS.develop/examples/H2O-deepks-pw/O_gga_7au_60Ry_2s2p1d.orb new file mode 100644 index 0000000000..d36d9dc128 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/O_gga_7au_60Ry_2s2p1d.orb @@ -0,0 +1,903 @@ +--------------------------------------------------------------------------- +Element O +Energy Cutoff(Ry) 60 +Radius Cutoff(a.u.) 7 +Lmax 2 +Number of Sorbital--> 2 +Number of Porbital--> 2 +Number of Dorbital--> 1 +--------------------------------------------------------------------------- +SUMMARY END + +Mesh 701 +dr 0.01 + Type L N + 0 0 0 + 1.208504975904e+00 1.208605373194e+00 1.208906194767e+00 1.209406330839e+00 + 1.210103935461e+00 1.210996432051e+00 1.212080521101e+00 1.213352190052e+00 + 1.214806725286e+00 1.216438726214e+00 1.218242121389e+00 1.220210186617e+00 + 1.222335564979e+00 1.224610288719e+00 1.227025802911e+00 1.229572990826e+00 + 1.232242200930e+00 1.235023275402e+00 1.237905580090e+00 1.240878035806e+00 + 1.243929150853e+00 1.247047054671e+00 1.250219532508e+00 1.253434060986e+00 + 1.256677844454e+00 1.259937852003e+00 1.263200855037e+00 1.266453465260e+00 + 1.269682172967e+00 1.272873385522e+00 1.276013465884e+00 1.279088771074e+00 + 1.282085690452e+00 1.284990683687e+00 1.287790318310e+00 1.290471306712e+00 + 1.293020542503e+00 1.295425136090e+00 1.297672449397e+00 1.299750129595e+00 + 1.301646141768e+00 1.303348800401e+00 1.304846799603e+00 1.306129241995e+00 + 1.307185666154e+00 1.308006072568e+00 1.308580948012e+00 1.308901288291e+00 + 1.308958619289e+00 1.308745016279e+00 1.308253121443e+00 1.307476159565e+00 + 1.306407951870e+00 1.305042927985e+00 1.303376135990e+00 1.301403250569e+00 + 1.299120579241e+00 1.296525066675e+00 1.293614297106e+00 1.290386494856e+00 + 1.286840522984e+00 1.282975880102e+00 1.278792695375e+00 1.274291721751e+00 + 1.269474327479e+00 1.264342485932e+00 1.258898763833e+00 1.253146307905e+00 + 1.247088830035e+00 1.240730591016e+00 1.234076382930e+00 1.227131510258e+00 + 1.219901769801e+00 1.212393429485e+00 1.204613206140e+00 1.196568242341e+00 + 1.188266082409e+00 1.179714647648e+00 1.170922210923e+00 1.161897370672e+00 + 1.152649024441e+00 1.143186342040e+00 1.133518738417e+00 1.123655846335e+00 + 1.113607488958e+00 1.103383652425e+00 1.092994458510e+00 1.082450137452e+00 + 1.071761001046e+00 1.060937416076e+00 1.049989778166e+00 1.038928486134e+00 + 1.027763916923e+00 1.016506401179e+00 1.005166199535e+00 9.937534796822e-01 + 9.822782942738e-01 9.707505597186e-01 9.591800359220e-01 9.475763070136e-01 + 9.359487631082e-01 9.243065831335e-01 9.126587187607e-01 9.010138794629e-01 + 8.893805187255e-01 8.777668214270e-01 8.661806924029e-01 8.546297462024e-01 + 8.431212980407e-01 8.316623559477e-01 8.202596141073e-01 8.089194473785e-01 + 7.976479069842e-01 7.864507173504e-01 7.753332740738e-01 7.643006429933e-01 + 7.533575603347e-01 7.425084338983e-01 7.317573452518e-01 7.211080528917e-01 + 7.105639963300e-01 7.001283010647e-01 6.898037843852e-01 6.795929619667e-01 + 6.694980552026e-01 6.595209992230e-01 6.496634515475e-01 6.399268013169e-01 + 6.303121790507e-01 6.208204668741e-01 6.114523091586e-01 6.022081235218e-01 + 5.930881121293e-01 5.840922732453e-01 5.752204129759e-01 5.664721571522e-01 + 5.578469633004e-01 5.493441326481e-01 5.409628221155e-01 5.327020562452e-01 + 5.245607390221e-01 5.165376655400e-01 5.086315334724e-01 5.008409543065e-01 + 4.931644643036e-01 4.856005351488e-01 4.781475842592e-01 4.708039847180e-01 + 4.635680748085e-01 4.564381671224e-01 4.494125572203e-01 4.424895318251e-01 + 4.356673765315e-01 4.289443830186e-01 4.223188557530e-01 4.157891181767e-01 + 4.093535183714e-01 4.030104341987e-01 3.967582779147e-01 3.905955002616e-01 + 3.845205940408e-01 3.785320971754e-01 3.726285952702e-01 3.668087236816e-01 + 3.610711691103e-01 3.554146707323e-01 3.498380208855e-01 3.443400653306e-01 + 3.389197031063e-01 3.335758859998e-01 3.283076176573e-01 3.231139523559e-01 + 3.179939934625e-01 3.129468916064e-01 3.079718425888e-01 3.030680850586e-01 + 2.982348979789e-01 2.934715979121e-01 2.887775361507e-01 2.841520957194e-01 + 2.795946882761e-01 2.751047509369e-01 2.706817430510e-01 2.663251429500e-01 + 2.620344446963e-01 2.578091548528e-01 2.536487892964e-01 2.495528700973e-01 + 2.455209224821e-01 2.415524719021e-01 2.376470412212e-01 2.338041480425e-01 + 2.300233021857e-01 2.263040033303e-01 2.226457388361e-01 2.190479817496e-01 + 2.155101890086e-01 2.120317998477e-01 2.086122344148e-01 2.052508925998e-01 + 2.019471530796e-01 1.987003725803e-01 1.955098853571e-01 1.923750028889e-01 + 1.892950137867e-01 1.862691839096e-01 1.832967566851e-01 1.803769536250e-01 + 1.775089750316e-01 1.746920008827e-01 1.719251918891e-01 1.692076907110e-01 + 1.665386233243e-01 1.639171005238e-01 1.613422195507e-01 1.588130658323e-01 + 1.563287148189e-01 1.538882339058e-01 1.514906844251e-01 1.491351236934e-01 + 1.468206071016e-01 1.445461902321e-01 1.423109309892e-01 1.401138917296e-01 + 1.379541413781e-01 1.358307575162e-01 1.337428284304e-01 1.316894551079e-01 + 1.296697531672e-01 1.276828547140e-01 1.257279101100e-01 1.238040896459e-01 + 1.219105851096e-01 1.200466112407e-01 1.182114070645e-01 1.164042370988e-01 + 1.146243924273e-01 1.128711916364e-01 1.111439816100e-01 1.094421381794e-01 + 1.077650666286e-01 1.061122020509e-01 1.044830095586e-01 1.028769843465e-01 + 1.012936516098e-01 9.973256632027e-02 9.819331286249e-02 9.667550453586e-02 + 9.517878292592e-02 9.370281715131e-02 9.224730299217e-02 9.081196190712e-02 + 8.939653994588e-02 8.800080656572e-02 8.662455335980e-02 8.526759270643e-02 + 8.392975634798e-02 8.261089390905e-02 8.131087136337e-02 8.002956945904e-02 + 7.876688211206e-02 7.752271477787e-02 7.629698281079e-02 7.508960982105e-02 + 7.390052603893e-02 7.272966669554e-02 7.157697042927e-02 7.044237772677e-02 + 6.932582940704e-02 6.822726515656e-02 6.714662212340e-02 6.608383357718e-02 + 6.503882764188e-02 6.401152610749e-02 6.300184332609e-02 6.200968519741e-02 + 6.103494824820e-02 6.007751880923e-02 5.913727229295e-02 5.821407257435e-02 + 5.730777147672e-02 5.641820836358e-02 5.554520983723e-02 5.468858954372e-02 + 5.384814808351e-02 5.302367302641e-02 5.221493902883e-02 5.142170805062e-02 + 5.064372966853e-02 4.988074148247e-02 4.913246961043e-02 4.839862926751e-02 + 4.767892542381e-02 4.697305353581e-02 4.628070034542e-02 4.560154474050e-02 + 4.493525867035e-02 4.428150810968e-02 4.363995406407e-02 4.301025360991e-02 + 4.239206096181e-02 4.178502856019e-02 4.118880817199e-02 4.060305199725e-02 + 4.002741377451e-02 3.946154987805e-02 3.890512040018e-02 3.835779021189e-02 + 3.781922999550e-02 3.728911724314e-02 3.676713721524e-02 3.625298385349e-02 + 3.574636064312e-02 3.524698141971e-02 3.475457111613e-02 3.426886644573e-02 + 3.378961651814e-02 3.331658338482e-02 3.284954251156e-02 3.238828317602e-02 + 3.193260878856e-02 3.148233713535e-02 3.103730054297e-02 3.059734596456e-02 + 3.016233498765e-02 2.973214376455e-02 2.930666286665e-02 2.888579706416e-02 + 2.846946503363e-02 2.805759899565e-02 2.765014428579e-02 2.724705886194e-02 + 2.684831275201e-02 2.645388744558e-02 2.606377523410e-02 2.567797850399e-02 + 2.529650898744e-02 2.491938697590e-02 2.454664050137e-02 2.417830449066e-02 + 2.381441989815e-02 2.345503282229e-02 2.310019361138e-02 2.274995596414e-02 + 2.240437603029e-02 2.206351151675e-02 2.172742080447e-02 2.139616208118e-02 + 2.106979249494e-02 2.074836733334e-02 2.043193923274e-02 2.012055742218e-02 + 1.981426700573e-02 1.951310828723e-02 1.921711614086e-02 1.892631943068e-02 + 1.864074048204e-02 1.836039460721e-02 1.808528968752e-02 1.781542581363e-02 + 1.755079498530e-02 1.729138087183e-02 1.703715863360e-02 1.678809480501e-02 + 1.654414723879e-02 1.630526511103e-02 1.607138898614e-02 1.584245094054e-02 + 1.561837474341e-02 1.539907609281e-02 1.518446290469e-02 1.497443565255e-02 + 1.476888775479e-02 1.456770600680e-02 1.437077105450e-02 1.417795790576e-02 + 1.398913647618e-02 1.380417216524e-02 1.362292645883e-02 1.344525755419e-02 + 1.327102100294e-02 1.310007036795e-02 1.293225788984e-02 1.276743515871e-02 + 1.260545378691e-02 1.244616607850e-02 1.228942569134e-02 1.213508828758e-02 + 1.198301216878e-02 1.183305889161e-02 1.168509386064e-02 1.153898689466e-02 + 1.139461276322e-02 1.125185169038e-02 1.111058982280e-02 1.097071965960e-02 + 1.083214044170e-02 1.069475849851e-02 1.055848755032e-02 1.042324896481e-02 + 1.028897196663e-02 1.015559379908e-02 1.002305983731e-02 9.891323652895e-03 + 9.760347029730e-03 9.630099931587e-03 9.500560422003e-03 9.371714537409e-03 + 9.243556114682e-03 9.116086574612e-03 8.989314662992e-03 8.863256151309e-03 + 8.737933499234e-03 8.613375481320e-03 8.489616780520e-03 8.366697551320e-03 + 8.244662955423e-03 8.123562673085e-03 8.003450393317e-03 7.884383286246e-03 + 7.766421461045e-03 7.649627412869e-03 7.534065462274e-03 7.419801190628e-03 + 7.306900874994e-03 7.195430925942e-03 7.085457331716e-03 6.977045112075e-03 + 6.870257785082e-03 6.765156849958e-03 6.661801289045e-03 6.560247091721e-03 + 6.460546803002e-03 6.362749099347e-03 6.266898394024e-03 6.173034474181e-03 + 6.081192171547e-03 5.991401068471e-03 5.903685240785e-03 5.818063038717e-03 + 5.734546906854e-03 5.653143243903e-03 5.573852302742e-03 5.496668131005e-03 + 5.421578552205e-03 5.348565187130e-03 5.277603515021e-03 5.208662973798e-03 + 5.141707098353e-03 5.076693695733e-03 5.013575055786e-03 4.952298195673e-03 + 4.892805136420e-03 4.835033209538e-03 4.778915391542e-03 4.724380664074e-03 + 4.671354397171e-03 4.619758753123e-03 4.569513108242e-03 4.520534489798e-03 + 4.472738025270e-03 4.426037401063e-03 4.380345327754e-03 4.335574008947e-03 + 4.291635610817e-03 4.248442729424e-03 4.205908852936e-03 4.163948815945e-03 + 4.122479243134e-03 4.081418979636e-03 4.040689505537e-03 4.000215332093e-03 + 3.959924377344e-03 3.919748318979e-03 3.879622922454e-03 3.839488342509e-03 + 3.799289396459e-03 3.758975807751e-03 3.718502418544e-03 3.677829370213e-03 + 3.636922250914e-03 3.595752209542e-03 3.554296035627e-03 3.512536204937e-03 + 3.470460890733e-03 3.428063940894e-03 3.385344821255e-03 3.342308525792e-03 + 3.298965454405e-03 3.255331259306e-03 3.211426661165e-03 3.167277236356e-03 + 3.122913176816e-03 3.078369024163e-03 3.033683379905e-03 2.988898593658e-03 + 2.944060431442e-03 2.899217726215e-03 2.854422012908e-03 2.809727150291e-03 + 2.765188932058e-03 2.720864689603e-03 2.676812888925e-03 2.633092724193e-03 + 2.589763710440e-03 2.546885277886e-03 2.504516370328e-03 2.462715050026e-03 + 2.421538111419e-03 2.381040705966e-03 2.341275980300e-03 2.302294729807e-03 + 2.264145069601e-03 2.226872124780e-03 2.190517741691e-03 2.155120221810e-03 + 2.120714079669e-03 2.087329826143e-03 2.054993778194e-03 2.023727896059e-03 + 1.993549648638e-03 1.964471907708e-03 1.936502871376e-03 1.909646017015e-03 + 1.883900083759e-03 1.859259084424e-03 1.835712346564e-03 1.813244582206e-03 + 1.791835985597e-03 1.771462358179e-03 1.752095259818e-03 1.733702185159e-03 + 1.716246763861e-03 1.699688983301e-03 1.683985432221e-03 1.669089563689e-03 + 1.654951975612e-03 1.641520706971e-03 1.628741547856e-03 1.616558361306e-03 + 1.604913414903e-03 1.593747720042e-03 1.583001376732e-03 1.572613921806e-03 + 1.562524678386e-03 1.552673104465e-03 1.542999138498e-03 1.533443539901e-03 + 1.523948222454e-03 1.514456578601e-03 1.504913792757e-03 1.495267141793e-03 + 1.485466280966e-03 1.475463513657e-03 1.465214043408e-03 1.454676206835e-03 + 1.443811686166e-03 1.432585700244e-03 1.420967172999e-03 1.408928878533e-03 + 1.396447562101e-03 1.383504036449e-03 1.370083253078e-03 1.356174348211e-03 + 1.341770663359e-03 1.326869740553e-03 1.311473292454e-03 1.295587147713e-03 + 1.279221172095e-03 1.262389166021e-03 1.245108739338e-03 1.227401164224e-03 + 1.209291207305e-03 1.190806942140e-03 1.171979543369e-03 1.152843063897e-03 + 1.133434196599e-03 1.113792022102e-03 1.093957744276e-03 1.073974415121e-03 + 1.053886650808e-03 1.033740340637e-03 1.013582350744e-03 9.934602243832e-04 + 9.734218806000e-04 9.535153131592e-04 9.337882915143e-04 9.142880656187e-04 + 8.950610763245e-04 8.761526730687e-04 8.576068404897e-04 8.394659355465e-04 + 8.217704366397e-04 8.045587061422e-04 7.878667676593e-04 7.717280992330e-04 + 7.561734436003e-04 7.412306364994e-04 7.269244539011e-04 7.132764789180e-04 + 7.003049890184e-04 6.880248640422e-04 6.764475153823e-04 6.655808365672e-04 + 6.554291753423e-04 6.459933272172e-04 6.372705503164e-04 6.292546012396e-04 + 6.219357915110e-04 6.153010640793e-04 6.093340892045e-04 6.040153789622e-04 + 5.993224194821e-04 5.952298199426e-04 5.917094772441e-04 5.887307552009e-04 + 5.862606770110e-04 5.842641296934e-04 5.827040791224e-04 5.815417942331e-04 + 5.807370789334e-04 5.802485102196e-04 5.800336809728e-04 5.800494458981e-04 + 5.802521690611e-04 5.805979714881e-04 5.810429773026e-04 5.815435569042e-04 + 5.820565657210e-04 5.825395771157e-04 5.829511080708e-04 5.832508363431e-04 + 5.833998078379e-04 5.833606330338e-04 5.830976713629e-04 5.825772025437e-04 + 5.817675839497e-04 5.806393931961e-04 5.791655552238e-04 5.773214532596e-04 + 5.750850231309e-04 5.724368305124e-04 5.693601307693e-04 5.658409111446e-04 + 5.618679151054e-04 5.574326486993e-04 5.525293687938e-04 5.471550530319e-04 + 5.413093512624e-04 5.349945180493e-04 5.282153256417e-04 5.209789564670e-04 + 5.132948738062e-04 5.051746688210e-04 4.966318815478e-04 4.876817929151e-04 + 4.783411843418e-04 4.686280611573e-04 4.585613361105e-04 4.481604698002e-04 + 4.374450661976e-04 4.264344238016e-04 4.151470466072e-04 4.036001241663e-04 + 3.918089966647e-04 3.797866290408e-04 3.675431274054e-04 3.550853407791e-04 + 3.424166004890e-04 3.295366571895e-04 3.164418798350e-04 3.031257803019e-04 + 2.895799200289e-04 2.757952395507e-04 2.617638272220e-04 2.474811096748e-04 + 2.329484046492e-04 2.181757290843e-04 2.031847053963e-04 1.880113615581e-04 + 1.727085816573e-04 1.573479391175e-04 1.420206404514e-04 1.268373278303e-04 + 1.119265365508e-04 9.743167866898e-05 8.350652361154e-05 7.030926427376e-05 + 5.799538389723e-05 4.670966361885e-05 3.657778061112e-05 2.769802994764e-05 + 2.013374906341e-05 1.390702415828e-05 8.994209321926e-06 5.323692408431e-06 + 2.776202480590e-06 1.187782192828e-06 3.553586242532e-07 4.465396560257e-08 + 0.000000000000e+00 + Type L N + 0 0 1 + 7.254873428942e-01 7.256666701836e-01 7.262040651787e-01 7.270977689660e-01 + 7.283448557011e-01 7.299412411073e-01 7.318816943340e-01 7.341598531361e-01 + 7.367682423256e-01 7.396982954341e-01 7.429403795151e-01 7.464838230058e-01 + 7.503169465575e-01 7.544270967320e-01 7.588006824578e-01 7.634232141234e-01 + 7.682793451844e-01 7.733529161466e-01 7.786270007853e-01 7.840839544493e-01 + 7.897054642959e-01 7.954726012944e-01 8.013658738321e-01 8.073652827510e-01 + 8.134503776412e-01 8.196003142102e-01 8.257939125497e-01 8.320097161138e-01 + 8.382260512257e-01 8.444210869251e-01 8.505728949734e-01 8.566595098284e-01 + 8.626589884062e-01 8.685494694476e-01 8.743092323085e-01 8.799167549976e-01 + 8.853507712889e-01 8.905903267386e-01 8.956148334429e-01 9.004041233778e-01 + 9.049385001677e-01 9.091987891354e-01 9.131663854946e-01 9.168233005512e-01 + 9.201522057895e-01 9.231364747249e-01 9.257602224156e-01 9.280083425331e-01 + 9.298665419008e-01 9.313213724179e-01 9.323602602985e-01 9.329715325607e-01 + 9.331444407159e-01 9.328691816115e-01 9.321369153974e-01 9.309397805906e-01 + 9.292709062264e-01 9.271244210907e-01 9.244954600412e-01 9.213801674334e-01 + 9.177756976756e-01 9.136802129486e-01 9.090928781328e-01 9.040138529968e-01 + 8.984442817063e-01 8.923862797242e-01 8.858429181782e-01 8.788182057798e-01 + 8.713170683877e-01 8.633453263117e-01 8.549096694633e-01 8.460176304626e-01 + 8.366775558156e-01 8.268985752843e-01 8.166905695723e-01 8.060641364551e-01 + 7.950305554857e-01 7.836017514115e-01 7.717902564368e-01 7.596091714706e-01 + 7.470721264985e-01 7.341932402185e-01 7.209870790813e-01 7.074686158739e-01 + 6.936531879864e-01 6.795564554976e-01 6.651943592171e-01 6.505830788149e-01 + 6.357389911700e-01 6.206786290648e-01 6.054186403485e-01 5.899757476891e-01 + 5.743667090281e-01 5.586082788498e-01 5.427171703685e-01 5.267100187338e-01 + 5.106033453488e-01 4.944135233878e-01 4.781567445972e-01 4.618489874536e-01 + 4.455059867492e-01 4.291432046671e-01 4.127758034017e-01 3.964186193738e-01 + 3.800861390819e-01 3.637924766262e-01 3.475513529322e-01 3.313760766971e-01 + 3.152795270720e-01 2.992741380906e-01 2.833718848433e-01 2.675842713943e-01 + 2.519223204291e-01 2.363965646160e-01 2.210170396586e-01 2.057932790105e-01 + 1.907343102184e-01 1.758486528546e-01 1.611443179941e-01 1.466288091897e-01 + 1.323091248895e-01 1.181917622427e-01 1.042827222321e-01 9.058751606940e-02 + 7.711117278740e-02 6.385824796008e-02 5.083283347819e-02 3.803856830806e-02 + 2.547865015811e-02 1.315584797747e-02 1.072515209469e-03 -1.076939627721e-02 + -2.236832165731e-02 -3.372306809514e-02 -4.483279924503e-02 -5.569701938217e-02 + -6.631555723891e-02 -7.668854962018e-02 -8.681642487002e-02 -9.669988625927e-02 + -1.063398953624e-01 -1.157376554889e-01 -1.248945952324e-01 -1.338123521969e-01 + -1.424927569584e-01 -1.509378173145e-01 -1.591497028740e-01 -1.671307300327e-01 + -1.748833473792e-01 -1.824101215717e-01 -1.897137237212e-01 -1.967969163142e-01 + -2.036625407039e-01 -2.103135051948e-01 -2.167527737423e-01 -2.229833552850e-01 + -2.290082937227e-01 -2.348306585525e-01 -2.404535361667e-01 -2.458800218186e-01 + -2.511132122536e-01 -2.561561990045e-01 -2.610120623413e-01 -2.656838658696e-01 + -2.701746517613e-01 -2.744874366059e-01 -2.786252078613e-01 -2.825909208870e-01 + -2.863874965356e-01 -2.900178192788e-01 -2.934847358419e-01 -2.967910543192e-01 + -2.999395437417e-01 -3.029329340652e-01 -3.057739165503e-01 -3.084651444993e-01 + -3.110092343197e-01 -3.134087668802e-01 -3.156662891257e-01 -3.177843159192e-01 + -3.197653320763e-01 -3.216117945603e-01 -3.233261348050e-01 -3.249107611349e-01 + -3.263680612502e-01 -3.277004047483e-01 -3.289101456532e-01 -3.299996249235e-01 + -3.309711729154e-01 -3.318271117747e-01 -3.325697577341e-01 -3.332014232962e-01 + -3.337244192811e-01 -3.341410567201e-01 -3.344536485814e-01 -3.346645113114e-01 + -3.347759661800e-01 -3.347903404196e-01 -3.347099681484e-01 -3.345371910720e-01 + -3.342743589580e-01 -3.339238298800e-01 -3.334879702312e-01 -3.329691545064e-01 + -3.323697648556e-01 -3.316921904132e-01 -3.309388264076e-01 -3.301120730579e-01 + -3.292143342673e-01 -3.282480161213e-01 -3.272155252025e-01 -3.261192667336e-01 + -3.249616425617e-01 -3.237450489978e-01 -3.224718745253e-01 -3.211444973951e-01 + -3.197652831201e-01 -3.183365818881e-01 -3.168607259083e-01 -3.153400267090e-01 + -3.137767724032e-01 -3.121732249392e-01 -3.105316173529e-01 -3.088541510394e-01 + -3.071429930586e-01 -3.054002734930e-01 -3.036280828708e-01 -3.018284696709e-01 + -3.000034379238e-01 -2.981549449206e-01 -2.962848990445e-01 -2.943951577350e-01 + -2.924875255971e-01 -2.905637526640e-01 -2.886255328226e-01 -2.866745024101e-01 + -2.847122389875e-01 -2.827402602961e-01 -2.807600234008e-01 -2.787729240243e-01 + -2.767802960736e-01 -2.747834113602e-01 -2.727834795133e-01 -2.707816480860e-01 + -2.687790028506e-01 -2.667765682807e-01 -2.647753082159e-01 -2.627761267031e-01 + -2.607798690080e-01 -2.587873227913e-01 -2.567992194399e-01 -2.548162355453e-01 + -2.528389945197e-01 -2.508680683408e-01 -2.489039794130e-01 -2.469472025355e-01 + -2.449981669661e-01 -2.430572585677e-01 -2.411248220269e-01 -2.392011631321e-01 + -2.372865510986e-01 -2.353812209292e-01 -2.334853757975e-01 -2.315991894418e-01 + -2.297228085585e-01 -2.278563551823e-01 -2.259999290424e-01 -2.241536098838e-01 + -2.223174597432e-01 -2.204915251685e-01 -2.186758393743e-01 -2.168704243221e-01 + -2.150752927189e-01 -2.132904499255e-01 -2.115158957672e-01 -2.097516262416e-01 + -2.079976351174e-01 -2.062539154195e-01 -2.045204607963e-01 -2.027972667658e-01 + -2.010843318391e-01 -1.993816585181e-01 -1.976892541676e-01 -1.960071317613e-01 + -1.943353105025e-01 -1.926738163205e-01 -1.910226822449e-01 -1.893819486610e-01 + -1.877516634493e-01 -1.861318820128e-01 -1.845226671970e-01 -1.829240891082e-01 + -1.813362248350e-01 -1.797591580790e-01 -1.781929787019e-01 -1.766377821957e-01 + -1.750936690819e-01 -1.735607442486e-01 -1.720391162332e-01 -1.705288964560e-01 + -1.690301984164e-01 -1.675431368557e-01 -1.660678268972e-01 -1.646043831701e-01 + -1.631529189255e-01 -1.617135451510e-01 -1.602863696932e-01 -1.588714963937e-01 + -1.574690242455e-01 -1.560790465776e-01 -1.547016502729e-01 -1.533369150254e-01 + -1.519849126425e-01 -1.506457063969e-01 -1.493193504333e-01 -1.480058892333e-01 + -1.467053571418e-01 -1.454177779589e-01 -1.441431645988e-01 -1.428815188187e-01 + -1.416328310171e-01 -1.403970801058e-01 -1.391742334519e-01 -1.379642468930e-01 + -1.367670648229e-01 -1.355826203479e-01 -1.344108355108e-01 -1.332516215814e-01 + -1.321048794113e-01 -1.309704998483e-01 -1.298483642091e-01 -1.287383448054e-01 + -1.276403055193e-01 -1.265541024246e-01 -1.254795844485e-01 -1.244165940690e-01 + -1.233649680437e-01 -1.223245381637e-01 -1.212951320287e-01 -1.202765738365e-01 + -1.192686851828e-01 -1.182712858649e-01 -1.172841946847e-01 -1.163072302453e-01 + -1.153402117357e-01 -1.143829596997e-01 -1.134352967825e-01 -1.124970484522e-01 + -1.115680436898e-01 -1.106481156450e-01 -1.097371022529e-01 -1.088348468094e-01 + -1.079411984998e-01 -1.070560128798e-01 -1.061791523053e-01 -1.053104863089e-01 + -1.044498919210e-01 -1.035972539354e-01 -1.027524651161e-01 -1.019154263471e-01 + -1.010860467232e-01 -1.002642435825e-01 -9.944994248185e-02 -9.864307711501e-02 + -9.784358917552e-02 -9.705142816589e-02 -9.626655115497e-02 -9.548892248592e-02 + -9.471851343733e-02 -9.395530184054e-02 -9.319927165621e-02 -9.245041251371e-02 + -9.170871921683e-02 -9.097419121975e-02 -9.024683207723e-02 -8.952664887308e-02 + -8.881365163121e-02 -8.810785271354e-02 -8.740926620906e-02 -8.671790731849e-02 + -8.603379173875e-02 -8.535693505166e-02 -8.468735212103e-02 -8.402505650228e-02 + -8.337005986852e-02 -8.272237145706e-02 -8.208199753993e-02 -8.144894092187e-02 + -8.082320046907e-02 -8.020477067166e-02 -7.959364124268e-02 -7.898979675599e-02 + -7.839321632536e-02 -7.780387332648e-02 -7.722173516368e-02 -7.664676308235e-02 + -7.607891202816e-02 -7.551813055364e-02 -7.496436077230e-02 -7.441753836036e-02 + -7.387759260550e-02 -7.334444650219e-02 -7.281801689227e-02 -7.229821464967e-02 + -7.178494490761e-02 -7.127810732620e-02 -7.077759639858e-02 -7.028330179286e-02 + -6.979510872749e-02 -6.931289837697e-02 -6.883654830505e-02 -6.836593292207e-02 + -6.790092396314e-02 -6.744139098370e-02 -6.698720186881e-02 -6.653822335263e-02 + -6.609432154426e-02 -6.565536245638e-02 -6.522121253286e-02 -6.479173917170e-02 + -6.436681123969e-02 -6.394629957521e-02 -6.353007747576e-02 -6.311802116687e-02 + -6.271001024920e-02 -6.230592812088e-02 -6.190566237223e-02 -6.150910515026e-02 + -6.111615349049e-02 -6.072670961410e-02 -6.034068118830e-02 -5.995798154845e-02 + -5.957852988044e-02 -5.920225136233e-02 -5.882907726438e-02 -5.845894500696e-02 + -5.809179817626e-02 -5.772758649759e-02 -5.736626576701e-02 -5.700779774157e-02 + -5.665214998938e-02 -5.629929570062e-02 -5.594921346095e-02 -5.560188698908e-02 + -5.525730484048e-02 -5.491546007952e-02 -5.457634992227e-02 -5.423997535275e-02 + -5.390634071546e-02 -5.357545328686e-02 -5.324732282934e-02 -5.292196113045e-02 + -5.259938153099e-02 -5.227959844527e-02 -5.196262687686e-02 -5.164848193346e-02 + -5.133717834423e-02 -5.102872998301e-02 -5.072314940095e-02 -5.042044737174e-02 + -5.012063245275e-02 -4.982371056520e-02 -4.952968459635e-02 -4.923855402661e-02 + -4.895031458408e-02 -4.866495792929e-02 -4.838247137211e-02 -4.810283762315e-02 + -4.782603458131e-02 -4.755203515910e-02 -4.728080714718e-02 -4.701231311894e-02 + -4.674651037613e-02 -4.648335093590e-02 -4.622278155957e-02 -4.596474382297e-02 + -4.570917422813e-02 -4.545600435556e-02 -4.520516105632e-02 -4.495656668270e-02 + -4.471013935597e-02 -4.446579326960e-02 -4.422343902605e-02 -4.398298400479e-02 + -4.374433275935e-02 -4.350738744073e-02 -4.327204824428e-02 -4.303821387741e-02 + -4.280578204466e-02 -4.257464994722e-02 -4.234471479342e-02 -4.211587431678e-02 + -4.188802729821e-02 -4.166107408881e-02 -4.143491712971e-02 -4.120946146551e-02 + -4.098461524766e-02 -4.076029022453e-02 -4.053640221469e-02 -4.031287156008e-02 + -4.008962355603e-02 -3.986658885506e-02 -3.964370384156e-02 -3.942091097474e-02 + -3.919815909734e-02 -3.897540370783e-02 -3.875260719405e-02 -3.852973902653e-02 + -3.830677590993e-02 -3.808370189129e-02 -3.786050842416e-02 -3.763719438785e-02 + -3.741376606137e-02 -3.719023705192e-02 -3.696662817818e-02 -3.674296730868e-02 + -3.651928915615e-02 -3.629563502882e-02 -3.607205254002e-02 -3.584859527756e-02 + -3.562532243500e-02 -3.540229840658e-02 -3.517959234853e-02 -3.495727770905e-02 + -3.473543172998e-02 -3.451413492302e-02 -3.429347052373e-02 -3.407352392670e-02 + -3.385438210523e-02 -3.363613301929e-02 -3.341886501524e-02 -3.320266622131e-02 + -3.298762394241e-02 -3.277382405822e-02 -3.256135042847e-02 -3.235028430897e-02 + -3.214070378242e-02 -3.193268320750e-02 -3.172629268990e-02 -3.152159757872e-02 + -3.131865799163e-02 -3.111752837185e-02 -3.091825708000e-02 -3.072088602362e-02 + -3.052545032675e-02 -3.033197804211e-02 -3.014048990770e-02 -2.995099914979e-02 + -2.976351133363e-02 -2.957802426325e-02 -2.939452793110e-02 -2.921300451825e-02 + -2.903342844527e-02 -2.885576647395e-02 -2.867997785924e-02 -2.850601455098e-02 + -2.833382144417e-02 -2.816333667671e-02 -2.799449197269e-02 -2.782721302956e-02 + -2.766141994684e-02 -2.749702769383e-02 -2.733394661371e-02 -2.717208296080e-02 + -2.701133946797e-02 -2.685161594061e-02 -2.669280987347e-02 -2.653481708672e-02 + -2.637753237709e-02 -2.622085018006e-02 -2.606466523893e-02 -2.590887327648e-02 + -2.575337166480e-02 -2.559806008909e-02 -2.544284120097e-02 -2.528762125705e-02 + -2.513231073838e-02 -2.497682494674e-02 -2.482108457356e-02 -2.466501623762e-02 + -2.450855298765e-02 -2.435163476629e-02 -2.419420883202e-02 -2.403623013573e-02 + -2.387766164928e-02 -2.371847464307e-02 -2.355864891050e-02 -2.339817293711e-02 + -2.323704401269e-02 -2.307526828495e-02 -2.291286075357e-02 -2.274984520407e-02 + -2.258625408096e-02 -2.242212830027e-02 -2.225751700172e-02 -2.209247724135e-02 + -2.192707362565e-02 -2.176137788862e-02 -2.159546841364e-02 -2.142942970219e-02 + -2.126335179210e-02 -2.109732962799e-02 -2.093146238710e-02 -2.076585276399e-02 + -2.060060621782e-02 -2.043583018613e-02 -2.027163326949e-02 -2.010812439128e-02 + -1.994541193741e-02 -1.978360288077e-02 -1.962280189525e-02 -1.946311046452e-02 + -1.930462599078e-02 -1.914744090855e-02 -1.899164180891e-02 -1.883730857935e-02 + -1.868451356458e-02 -1.853332075332e-02 -1.838378499630e-02 -1.823595126041e-02 + -1.808985392377e-02 -1.794551611644e-02 -1.780294911118e-02 -1.766215176856e-02 + -1.752311004029e-02 -1.738579653452e-02 -1.725017014658e-02 -1.711617575804e-02 + -1.698374400709e-02 -1.685279113236e-02 -1.672321889232e-02 -1.659491456194e-02 + -1.646775100755e-02 -1.634158684107e-02 -1.621626665358e-02 -1.609162132846e-02 + -1.596746843346e-02 -1.584361269051e-02 -1.571984652213e-02 -1.559595067190e-02 + -1.547169489659e-02 -1.534683872624e-02 -1.522113228779e-02 -1.509431718645e-02 + -1.496612743749e-02 -1.483629043856e-02 -1.470452796987e-02 -1.457055720485e-02 + -1.443409170812e-02 -1.429484238992e-02 -1.415251837503e-02 -1.400682773128e-02 + -1.385747798508e-02 -1.370417633100e-02 -1.354662941759e-02 -1.338454256474e-02 + -1.321761823931e-02 -1.304555358959e-02 -1.286803681889e-02 -1.268474217206e-02 + -1.249532332271e-02 -1.229940499551e-02 -1.209657274723e-02 -1.188636097593e-02 + -1.166823943872e-02 -1.144159884417e-02 -1.120573644391e-02 -1.095984297292e-02 + -1.070299275375e-02 -1.043413925187e-02 -1.015211878805e-02 -9.855665409747e-03 + -9.543440008834e-03 -9.214076556271e-03 -8.866247718325e-03 -8.498751054188e-03 + -8.110615439050e-03 -7.701225329127e-03 -7.270458073131e-03 -6.818826842202e-03 + -6.347619139072e-03 -5.859018565355e-03 -5.356195924376e-03 -4.843355172226e-03 + -4.325720516624e-03 -3.809453321228e-03 -3.301491475836e-03 -2.809309425588e-03 + -2.340603789462e-03 -1.902916906830e-03 -1.503218023709e-03 -1.147468351328e-03 + -8.402010638750e-04 -5.841497027245e-04 -3.799578710602e-04 -2.259992769873e-04 + -1.183302128984e-04 -5.078691996859e-05 -1.522880477927e-05 -1.916246212603e-06 + 0.000000000000e+00 + Type L N + 0 1 0 + 0.000000000000e+00 4.626669306440e-02 9.247677643884e-02 1.385737661495e-01 + 1.845014292772e-01 2.302039085422e-01 2.756258457606e-01 3.207125038039e-01 + 3.654098866971e-01 4.096648574975e-01 4.534252536048e-01 4.966399991622e-01 + 5.392592142182e-01 5.812343203311e-01 6.225181423090e-01 6.630650057955e-01 + 7.028308304215e-01 7.417732182629e-01 7.798515373591e-01 8.170270000629e-01 + 8.532627360156e-01 8.885238595536e-01 9.227775313771e-01 9.559930143289e-01 + 9.881417231541e-01 1.019197268128e+00 1.049135492469e+00 1.077934503457e+00 + 1.105574697231e+00 1.132038777224e+00 1.157311766233e+00 1.181381012159e+00 + 1.204236187438e+00 1.225869282229e+00 1.246274591448e+00 1.265448695731e+00 + 1.283390436474e+00 1.300100885050e+00 1.315583306407e+00 1.329843117176e+00 + 1.342887838522e+00 1.354727043913e+00 1.365372302051e+00 1.374837115191e+00 + 1.383136853106e+00 1.390288682952e+00 1.396311495311e+00 1.401225826696e+00 + 1.405053778803e+00 1.407818934819e+00 1.409546273083e+00 1.410262078416e+00 + 1.409993851433e+00 1.408770216150e+00 1.406620826218e+00 1.403576270089e+00 + 1.399667975436e+00 1.394928113157e+00 1.389389501250e+00 1.383085508897e+00 + 1.376049961044e+00 1.368317043767e+00 1.359921210742e+00 1.350897091066e+00 + 1.341279398726e+00 1.331102843968e+00 1.320402046811e+00 1.309211452959e+00 + 1.297565252319e+00 1.285497300354e+00 1.273041042453e+00 1.260229441521e+00 + 1.247094908937e+00 1.233669239051e+00 1.219983547349e+00 1.206068212405e+00 + 1.191952821741e+00 1.177666121662e+00 1.163235971158e+00 1.148689299921e+00 + 1.134052070515e+00 1.119349244734e+00 1.104604754140e+00 1.089841474788e+00 + 1.075081206110e+00 1.060344653911e+00 1.045651417444e+00 1.031019980477e+00 + 1.016467706281e+00 1.002010836454e+00 9.876644934525e-01 9.734426867397e-01 + 9.593583224036e-01 9.454232161144e-01 9.316481092715e-01 9.180426881845e-01 + 9.046156061222e-01 8.913745080609e-01 8.783260579512e-01 8.654759683243e-01 + 8.528290320477e-01 8.403891560415e-01 8.281593967612e-01 8.161419972524e-01 + 8.043384255816e-01 7.927494144461e-01 7.813750017691e-01 7.702145720852e-01 + 7.592668985250e-01 7.485301852117e-01 7.380021098828e-01 7.276798665597e-01 + 7.175602080880e-01 7.076394883814e-01 6.979137042049e-01 6.883785363434e-01 + 6.790293900054e-01 6.698614343236e-01 6.608696408190e-01 6.520488207049e-01 + 6.433936609179e-01 6.348987587694e-01 6.265586551227e-01 6.183678660090e-01 + 6.103209126074e-01 6.024123495215e-01 5.946367912964e-01 5.869889371295e-01 + 5.794635937392e-01 5.720556963634e-01 5.647603278708e-01 5.575727359769e-01 + 5.504883485661e-01 5.435027871291e-01 5.366118783351e-01 5.298116637647e-01 + 5.230984078384e-01 5.164686039829e-01 5.099189790850e-01 5.034464962871e-01 + 4.970483561883e-01 4.907219965172e-01 4.844650903499e-01 4.782755429504e-01 + 4.721514873143e-01 4.660912785021e-01 4.600934868494e-01 4.541568901450e-01 + 4.482804648686e-01 4.424633765848e-01 4.367049695852e-01 4.310047558766e-01 + 4.253624036096e-01 4.197777250424e-01 4.142506641348e-01 4.087812838625e-01 + 4.033697533448e-01 3.980163348711e-01 3.927213709139e-01 3.874852712079e-01 + 3.823084999769e-01 3.771915633804e-01 3.721349972533e-01 3.671393552038e-01 + 3.622051971318e-01 3.573330782258e-01 3.525235384903e-01 3.477770928499e-01 + 3.430942218749e-01 3.384753631632e-01 3.339209034105e-01 3.294311711968e-01 + 3.250064305082e-01 3.206468750123e-01 3.163526230955e-01 3.121237136700e-01 + 3.079601027506e-01 3.038616607970e-01 2.998281708131e-01 2.958593271912e-01 + 2.919547352822e-01 2.881139116717e-01 2.843362851372e-01 2.806211982569e-01 + 2.769679096388e-01 2.733755967358e-01 2.698433592092e-01 2.663702228010e-01 + 2.629551436727e-01 2.595970131682e-01 2.562946629558e-01 2.530468705019e-01 + 2.498523648317e-01 2.467098325280e-01 2.436179239222e-01 2.405752594280e-01 + 2.375804359731e-01 2.346320334812e-01 2.317286213597e-01 2.288687649482e-01 + 2.260510318856e-01 2.232739983553e-01 2.205362551671e-01 2.178364136421e-01 + 2.151731112625e-01 2.125450170553e-01 2.099508366804e-01 2.073893171946e-01 + 2.048592514678e-01 2.023594822299e-01 1.998889057289e-01 1.974464749851e-01 + 1.950312026290e-01 1.926421633118e-01 1.902784956831e-01 1.879394039318e-01 + 1.856241588886e-01 1.833320986932e-01 1.810626290297e-01 1.788152229396e-01 + 1.765894202199e-01 1.743848264217e-01 1.722011114618e-01 1.700380078656e-01 + 1.678953086602e-01 1.657728649384e-01 1.636705831165e-01 1.615884219095e-01 + 1.595263890502e-01 1.574845377777e-01 1.554629631231e-01 1.534617980220e-01 + 1.514812092796e-01 1.495213934218e-01 1.475825724573e-01 1.456649895836e-01 + 1.437689048635e-01 1.418945909028e-01 1.400423285557e-01 1.382124026860e-01 + 1.364050980113e-01 1.346206950549e-01 1.328594662287e-01 1.311216720732e-01 + 1.294075576724e-01 1.277173492659e-01 1.260512510763e-01 1.244094423676e-01 + 1.227920747499e-01 1.211992697433e-01 1.196311166126e-01 1.180876704799e-01 + 1.165689507245e-01 1.150749396739e-01 1.136055815889e-01 1.121607819445e-01 + 1.107404070054e-01 1.093442836937e-01 1.079721997437e-01 1.066239041386e-01 + 1.052991078190e-01 1.039974846564e-01 1.027186726775e-01 1.014622755288e-01 + 1.002278641668e-01 9.901497875795e-02 9.782313077323e-02 9.665180525899e-02 + 9.550046326660e-02 9.436854442164e-02 9.325546961334e-02 9.216064378426e-02 + 9.108345880003e-02 9.002329637868e-02 8.897953105904e-02 8.795153318799e-02 + 8.693867190608e-02 8.594031811199e-02 8.495584738619e-02 8.398464285514e-02 + 8.302609797786e-02 8.207961923751e-02 8.114462872159e-02 8.022056657532e-02 + 7.930689331374e-02 7.840309197944e-02 7.750867013367e-02 7.662316167031e-02 + 7.574612844318e-02 7.487716169847e-02 7.401588330588e-02 7.316194678300e-02 + 7.231503810912e-02 7.147487632614e-02 7.064121392554e-02 6.981383702175e-02 + 6.899256531393e-02 6.817725183911e-02 6.736778252125e-02 6.656407552203e-02 + 6.576608040015e-02 6.497377708742e-02 6.418717469067e-02 6.340631012970e-02 + 6.263124662243e-02 6.186207202910e-02 6.109889706828e-02 6.034185341798e-02 + 5.959109171580e-02 5.884677947253e-02 5.810909891384e-02 5.737824476519e-02 + 5.665442199500e-02 5.593784353143e-02 5.522872796790e-02 5.452729727241e-02 + 5.383377451555e-02 5.314838163169e-02 5.247133722744e-02 5.180285445101e-02 + 5.114313893551e-02 5.049238682857e-02 4.985078291990e-02 4.921849887774e-02 + 4.859569160412e-02 4.798250171810e-02 4.737905217510e-02 4.678544702965e-02 + 4.620177034738e-02 4.562808527175e-02 4.506443324922e-02 4.451083341594e-02 + 4.396728214785e-02 4.343375277482e-02 4.291019545869e-02 4.239653723369e-02 + 4.189268220694e-02 4.139851191555e-02 4.091388583593e-02 4.043864204001e-02 + 3.997259799209e-02 3.951555147938e-02 3.906728166825e-02 3.862755027772e-02 + 3.819610286095e-02 3.777267018490e-02 3.735696969794e-02 3.694870707447e-02 + 3.654757782553e-02 3.615326896400e-02 3.576546071256e-02 3.538382824290e-02 + 3.500804343402e-02 3.463777663802e-02 3.427269844162e-02 3.391248141169e-02 + 3.355680181363e-02 3.320534129149e-02 3.285778849928e-02 3.251384067318e-02 + 3.217320513500e-02 3.183560071786e-02 3.150075910546e-02 3.116842607708e-02 + 3.083836265137e-02 3.051034612224e-02 3.018417098153e-02 2.985964972338e-02 + 2.953661352651e-02 2.921491281118e-02 2.889441766852e-02 2.857501816086e-02 + 2.825662449243e-02 2.793916705072e-02 2.762259631970e-02 2.730688266665e-02 + 2.699201600563e-02 2.667800534077e-02 2.636487819401e-02 2.605267992196e-02 + 2.574147292769e-02 2.543133577365e-02 2.512236220262e-02 2.481466007401e-02 + 2.450835022332e-02 2.420356525313e-02 2.390044826409e-02 2.359915153494e-02 + 2.329983516064e-02 2.300266565796e-02 2.270781454790e-02 2.241545692458e-02 + 2.212577001985e-02 2.183893177319e-02 2.155511941611e-02 2.127450808001e-02 + 2.099726943654e-02 2.072357037869e-02 2.045357175104e-02 2.018742713666e-02 + 1.992528170814e-02 1.966727114943e-02 1.941352065482e-02 1.916414401067e-02 + 1.891924276507e-02 1.867890548977e-02 1.844320713834e-02 1.821220850348e-02 + 1.798595577619e-02 1.776448020835e-02 1.754779787984e-02 1.733590957064e-02 + 1.712880073748e-02 1.692644159407e-02 1.672878729330e-02 1.653577820895e-02 + 1.634734031411e-02 1.616338565257e-02 1.598381289929e-02 1.580850800495e-02 + 1.563734491978e-02 1.547018639065e-02 1.530688482563e-02 1.514728321942e-02 + 1.499121613292e-02 1.483851071980e-02 1.468898779289e-02 1.454246292273e-02 + 1.439874756077e-02 1.425765017942e-02 1.411897742129e-02 1.398253524971e-02 + 1.384813009314e-02 1.371556997561e-02 1.358466562605e-02 1.345523155923e-02 + 1.332708712145e-02 1.320005749427e-02 1.307397465026e-02 1.294867825452e-02 + 1.282401650690e-02 1.269984691961e-02 1.257603702582e-02 1.245246501512e-02 + 1.232902029249e-02 1.220560395758e-02 1.208212920209e-02 1.195852162325e-02 + 1.183471945225e-02 1.171067369687e-02 1.158634819813e-02 1.146171960159e-02 + 1.133677724410e-02 1.121152295783e-02 1.108597079338e-02 1.096014666495e-02 + 1.083408792038e-02 1.070784283988e-02 1.058147006741e-02 1.045503797910e-02 + 1.032862399368e-02 1.020231383001e-02 1.007620071720e-02 9.950384563086e-03 + 9.824971087055e-03 9.700070923359e-03 9.575798701242e-03 9.452272108278e-03 + 9.329610943381e-03 9.207936165980e-03 9.087368947783e-03 8.968029733511e-03 + 8.850037316863e-03 8.733507937802e-03 8.618554407078e-03 8.505285263657e-03 + 8.393803970449e-03 8.284208153457e-03 8.176588889091e-03 8.071030044062e-03 + 7.967607671864e-03 7.866389469441e-03 7.767434297208e-03 7.670791765129e-03 + 7.576501887099e-03 7.484594805397e-03 7.395090586489e-03 7.307999088963e-03 + 7.223319903894e-03 7.141042367445e-03 7.061145645014e-03 6.983598885766e-03 + 6.908361445924e-03 6.835383178746e-03 6.764604788651e-03 6.695958246585e-03 + 6.629367263288e-03 6.564747816781e-03 6.502008730030e-03 6.441052294461e-03 + 6.381774934689e-03 6.324067909605e-03 6.267818044733e-03 6.212908490608e-03 + 6.159219501783e-03 6.106629230949e-03 6.055014532629e-03 6.004251770844e-03 + 5.954217625165e-03 5.904789889639e-03 5.855848259131e-03 5.807275097749e-03 + 5.758956184216e-03 5.710781429171e-03 5.662645559677e-03 5.614448766417e-03 + 5.566097309364e-03 5.517504078010e-03 5.468589102591e-03 5.419280013061e-03 + 5.369512443000e-03 5.319230375965e-03 5.268386432279e-03 5.216942094584e-03 + 5.164867870992e-03 5.112143395040e-03 5.058757462124e-03 5.004708002508e-03 + 4.950001991440e-03 4.894655297341e-03 4.838692469426e-03 4.782146466559e-03 + 4.725058329501e-03 4.667476799104e-03 4.609457883366e-03 4.551064376569e-03 + 4.492365334071e-03 4.433435506574e-03 4.374354737978e-03 4.315207331132e-03 + 4.256081386021e-03 4.197068115070e-03 4.138261140407e-03 4.079755777996e-03 + 4.021648313667e-03 3.964035276043e-03 3.907012711426e-03 3.850675465625e-03 + 3.795116477667e-03 3.740426090216e-03 3.686691381401e-03 3.633995522588e-03 + 3.582417166444e-03 3.532029869390e-03 3.482901552337e-03 3.435094003277e-03 + 3.388662425042e-03 3.343655031184e-03 3.300112692642e-03 3.258068637445e-03 + 3.217548205397e-03 3.178568659244e-03 3.141139053489e-03 3.105260161581e-03 + 3.070924461834e-03 3.038116182008e-03 3.006811402101e-03 2.976978214492e-03 + 2.948576940192e-03 2.921560399576e-03 2.895874235616e-03 2.871457287251e-03 + 2.848242010226e-03 2.826154942389e-03 2.805117210156e-03 2.785045072566e-03 + 2.765850499104e-03 2.747441777247e-03 2.729724145494e-03 2.712600447460e-03 + 2.695971802504e-03 2.679738288218e-03 2.663799630071e-03 2.648055893421e-03 + 2.632408173111e-03 2.616759275908e-03 2.601014391046e-03 2.585081744281e-03 + 2.568873230918e-03 2.552305023468e-03 2.535298149731e-03 2.517779037327e-03 + 2.499680020904e-03 2.480939808524e-03 2.461503903985e-03 2.441324982167e-03 + 2.420363214753e-03 2.398586544076e-03 2.375970903129e-03 2.352500380192e-03 + 2.328167326847e-03 2.302972408589e-03 2.276924597575e-03 2.250041107472e-03 + 2.222347270745e-03 2.193876359100e-03 2.164669348201e-03 2.134774628125e-03 + 2.104247661406e-03 2.073150590858e-03 2.041551799704e-03 2.009525426863e-03 + 1.977150840543e-03 1.944512073575e-03 1.911697224169e-03 1.878797826026e-03 + 1.845908191926e-03 1.813124735106e-03 1.780545272907e-03 1.748268317253e-03 + 1.716392356669e-03 1.685015134571e-03 1.654232928608e-03 1.624139835837e-03 + 1.594827068485e-03 1.566382264978e-03 1.538888820844e-03 1.512425243959e-03 + 1.487064538469e-03 1.462873621539e-03 1.439912776851e-03 1.418235148603e-03 + 1.397886279419e-03 1.378903695388e-03 1.361316541089e-03 1.345145267177e-03 + 1.330401372742e-03 1.317087204330e-03 1.305195813119e-03 1.294710871381e-03 + 1.285606648941e-03 1.277848049954e-03 1.271390709857e-03 1.266181151892e-03 + 1.262157002094e-03 1.259247261038e-03 1.257372629988e-03 1.256445888300e-03 + 1.256372317939e-03 1.257050169762e-03 1.258371164675e-03 1.260221020806e-03 + 1.262479995372e-03 1.265023426865e-03 1.267722259454e-03 1.270443527154e-03 + 1.273050770446e-03 1.275404352865e-03 1.277361640234e-03 1.278777001383e-03 + 1.279501587554e-03 1.279382849847e-03 1.278263761804e-03 1.275981729809e-03 + 1.272367199681e-03 1.267242005586e-03 1.260417558647e-03 1.251693037373e-03 + 1.240853818454e-03 1.227670470115e-03 1.211898713617e-03 1.193280830673e-03 + 1.171549041425e-03 1.146431382802e-03 1.117660563243e-03 1.084986141051e-03 + 1.048190158810e-03 1.007106061638e-03 9.616403401761e-04 9.117958912844e-04 + 8.576956167753e-04 7.996043336342e-04 7.379467099683e-04 6.733187363399e-04 + 6.064902563311e-04 5.383963642217e-04 4.701160591847e-04 4.028374193811e-04 + 3.378096816747e-04 2.762838987458e-04 2.194451740707e-04 1.683406996263e-04 + 1.238087845849e-04 8.641461945317e-05 5.639855469582e-05 3.364212299270e-05 + 1.765590279501e-05 7.591682743524e-06 2.279385157959e-06 2.870401658966e-07 + 0.000000000000e+00 + Type L N + 0 1 1 + 0.000000000000e+00 3.375340101333e-02 6.746796349822e-02 1.011049138555e-01 + 1.346256082234e-01 1.679915970424e-01 2.011646892560e-01 2.341070160275e-01 + 2.667810938520e-01 2.991498869451e-01 3.311768687900e-01 3.628260827265e-01 + 3.940622014666e-01 4.248505854211e-01 4.551573397281e-01 4.849493698694e-01 + 5.141944357697e-01 5.428612042712e-01 5.709192998796e-01 5.983393536821e-01 + 6.250930503389e-01 6.511531730530e-01 6.764936464275e-01 7.010895771214e-01 + 7.249172922209e-01 7.479543752446e-01 7.701796997065e-01 7.915734601660e-01 + 8.121172006957e-01 8.317938407052e-01 8.505876980641e-01 8.684845094698e-01 + 8.854714480139e-01 9.015371379059e-01 9.166716663176e-01 9.308665923177e-01 + 9.441149528744e-01 9.564112659059e-01 9.677515303693e-01 9.781332233824e-01 + 9.875552943794e-01 9.960181563106e-01 1.003523673900e+00 1.010075148982e+00 + 1.015677302955e+00 1.020336256368e+00 1.024059505710e+00 1.026855897434e+00 + 1.028735599272e+00 1.029710068925e+00 1.029792020169e+00 1.028995386487e+00 + 1.027335282286e+00 1.024827961803e+00 1.021490775799e+00 1.017342126138e+00 + 1.012401418364e+00 1.006689012392e+00 1.000226171440e+00 9.930350093166e-01 + 9.851384362041e-01 9.765601030744e-01 9.673243448728e-01 9.574561226182e-01 + 9.469809645661e-01 9.359249065863e-01 9.243144319084e-01 9.121764103924e-01 + 8.995380374803e-01 8.864267729912e-01 8.728702799165e-01 8.588963633783e-01 + 8.445329099101e-01 8.298078272199e-01 8.147489845939e-01 7.993841540983e-01 + 7.837409527334e-01 7.678467856909e-01 7.517287908658e-01 7.354137847644e-01 + 7.189282099516e-01 7.022980841725e-01 6.855489512787e-01 6.687058340848e-01 + 6.517931892735e-01 6.348348644627e-01 6.178540575378e-01 6.008732783497e-01 + 5.839143128664e-01 5.669981898627e-01 5.501451502191e-01 5.333746188975e-01 + 5.167051796490e-01 5.001545525002e-01 4.837395740569e-01 4.674761806538e-01 + 4.513793943678e-01 4.354633119048e-01 4.197410963605e-01 4.042249718435e-01 + 3.889262209421e-01 3.738551850050e-01 3.590212671974e-01 3.444329382852e-01 + 3.300977450887e-01 3.160223215414e-01 3.022124022789e-01 2.886728386745e-01 + 2.754076172314e-01 2.624198802337e-01 2.497119485487e-01 2.372853464705e-01 + 2.251408284840e-01 2.132784078267e-01 2.016973867172e-01 1.903963881162e-01 + 1.793733888809e-01 1.686257541706e-01 1.581502729567e-01 1.479431944907e-01 + 1.380002655774e-01 1.283167685047e-01 1.188875594752e-01 1.097071073890e-01 + 1.007695328252e-01 9.206864707152e-02 8.359799105358e-02 7.535087401652e-02 + 6.732041181622e-02 5.949956467938e-02 5.188117429660e-02 4.445800011708e-02 + 3.722275471825e-02 3.016813812988e-02 2.328687099752e-02 1.657172647727e-02 + 1.001556076019e-02 3.611342132348e-03 -2.647821516258e-03 -8.768656812552e-03 + -1.475770072170e-02 -2.062127813107e-02 -2.636548125059e-02 -3.199615087445e-02 + -3.751885954038e-02 -4.293889661385e-02 -4.826125531553e-02 -5.349062170172e-02 + -5.863136559834e-02 -6.368753348054e-02 -6.866284328140e-02 -7.356068110460e-02 + -7.838409980795e-02 -8.313581941656e-02 -8.781822931687e-02 -9.243339217524e-02 + -9.698304951803e-02 -1.014686289032e-01 -1.058912526074e-01 -1.102517477471e-01 + -1.145506577458e-01 -1.187882550557e-01 -1.229645550382e-01 -1.270793309018e-01 + -1.311321295940e-01 -1.351222885425e-01 -1.390489531347e-01 -1.429110948275e-01 + -1.467075297752e-01 -1.504369378627e-01 -1.540978820347e-01 -1.576888278065e-01 + -1.612081628491e-01 -1.646542165373e-01 -1.680252793568e-01 -1.713196220647e-01 + -1.745355145039e-01 -1.776712439735e-01 -1.807251330624e-01 -1.836955568580e-01 + -1.865809594450e-01 -1.893798696175e-01 -1.920909157293e-01 -1.947128396172e-01 + -1.972445095340e-01 -1.996849320388e-01 -2.020332627945e-01 -2.042888162310e-01 + -2.064510740412e-01 -2.085196924792e-01 -2.104945084419e-01 -2.123755443193e-01 + -2.141630116067e-01 -2.158573132777e-01 -2.174590449274e-01 -2.189689946957e-01 + -2.203881419935e-01 -2.217176550569e-01 -2.229588873615e-01 -2.241133729361e-01 + -2.251828206181e-01 -2.261691073020e-01 -2.270742702318e-01 -2.279004983992e-01 + -2.286501231081e-01 -2.293256077729e-01 -2.299295370205e-01 -2.304646051689e-01 + -2.309336041573e-01 -2.313394110069e-01 -2.316849748892e-01 -2.319733038842e-01 + -2.322074515083e-01 -2.323905030937e-01 -2.325255621004e-01 -2.326157364412e-01 + -2.326641248984e-01 -2.326738037117e-01 -2.326478134108e-01 -2.325891459689e-01 + -2.325007323449e-01 -2.323854304855e-01 -2.322460138479e-01 -2.320851605065e-01 + -2.319054428983e-01 -2.317093182599e-01 -2.314991198032e-01 -2.312770486727e-01 + -2.310451667226e-01 -2.308053901448e-01 -2.305594839771e-01 -2.303090575121e-01 + -2.300555606232e-01 -2.298002810200e-01 -2.295443424368e-01 -2.292887037559e-01 + -2.290341590589e-01 -2.287813385964e-01 -2.285307106594e-01 -2.282825843322e-01 + -2.280371130998e-01 -2.277942992806e-01 -2.275539992486e-01 -2.273159294059e-01 + -2.270796728624e-01 -2.268446867758e-01 -2.266103103025e-01 -2.263757731044e-01 + -2.261402043576e-01 -2.259026422030e-01 -2.256620435804e-01 -2.254172943820e-01 + -2.251672198643e-01 -2.249105952529e-01 -2.246461564765e-01 -2.243726109647e-01 + -2.240886484469e-01 -2.237929516866e-01 -2.234842070895e-01 -2.231611151244e-01 + -2.228224004966e-01 -2.224668220165e-01 -2.220931821080e-01 -2.217003359051e-01 + -2.212871998854e-01 -2.208527599957e-01 -2.203960792263e-01 -2.199163045941e-01 + -2.194126735000e-01 -2.188845194288e-01 -2.183312769643e-01 -2.177524860977e-01 + -2.171477958094e-01 -2.165169669117e-01 -2.158598741418e-01 -2.151765075019e-01 + -2.144669728436e-01 -2.137314917035e-01 -2.129704003968e-01 -2.121841483821e-01 + -2.113732959162e-01 -2.105385110171e-01 -2.096805657643e-01 -2.088003319618e-01 + -2.078987761994e-01 -2.069769543454e-01 -2.060360055126e-01 -2.050771455367e-01 + -2.041016600137e-01 -2.031108969411e-01 -2.021062590137e-01 -2.010891956219e-01 + -2.000611946063e-01 -1.990237738205e-01 -1.979784725550e-01 -1.969268428776e-01 + -1.958704409425e-01 -1.948108183233e-01 -1.937495134222e-01 -1.926880430083e-01 + -1.916278939346e-01 -1.905705150858e-01 -1.895173096023e-01 -1.884696274276e-01 + -1.874287582222e-01 -1.863959246844e-01 -1.853722763173e-01 -1.843588836761e-01 + -1.833567331280e-01 -1.823667221539e-01 -1.813896552157e-01 -1.804262402126e-01 + -1.794770855423e-01 -1.785426977825e-01 -1.776234800020e-01 -1.767197307079e-01 + -1.758316434314e-01 -1.749593069500e-01 -1.741027061414e-01 -1.732617234589e-01 + -1.724361410166e-01 -1.716256432660e-01 -1.708298202458e-01 -1.700481713799e-01 + -1.692801097974e-01 -1.685249671453e-01 -1.677819988611e-01 -1.670503898697e-01 + -1.663292606680e-01 -1.656176737570e-01 -1.649146403799e-01 -1.642191275233e-01 + -1.635300651373e-01 -1.628463535283e-01 -1.621668708785e-01 -1.614904808458e-01 + -1.608160401959e-01 -1.601424064214e-01 -1.594684452990e-01 -1.587930383416e-01 + -1.581150900972e-01 -1.574335352539e-01 -1.567473455058e-01 -1.560555361414e-01 + -1.553571723131e-01 -1.546513749544e-01 -1.539373263077e-01 -1.532142750324e-01 + -1.524815408637e-01 -1.517385187968e-01 -1.509846827728e-01 -1.502195888465e-01 + -1.494428778197e-01 -1.486542773268e-01 -1.478536033625e-01 -1.470407612462e-01 + -1.462157460186e-01 -1.453786422729e-01 -1.445296234235e-01 -1.436689504200e-01 + -1.427969699176e-01 -1.419141119176e-01 -1.410208868957e-01 -1.401178824382e-01 + -1.392057594094e-01 -1.382852476765e-01 -1.373571414199e-01 -1.364222940610e-01 + -1.354816128392e-01 -1.345360530754e-01 -1.335866121565e-01 -1.326343232816e-01 + -1.316802490079e-01 -1.307254746382e-01 -1.297711014920e-01 -1.288182401004e-01 + -1.278680033690e-01 -1.269214997512e-01 -1.259798264725e-01 -1.250440628491e-01 + -1.241152637407e-01 -1.231944531781e-01 -1.222826182036e-01 -1.213807029615e-01 + -1.204896030750e-01 -1.196101603416e-01 -1.187431577798e-01 -1.178893150558e-01 + -1.170492843167e-01 -1.162236464545e-01 -1.154129078230e-01 -1.146174974243e-01 + -1.138377645830e-01 -1.130739771182e-01 -1.123263200242e-01 -1.115948946659e-01 + -1.108797184913e-01 -1.101807252617e-01 -1.094977657963e-01 -1.088306092237e-01 + -1.081789447325e-01 -1.075423838067e-01 -1.069204629317e-01 -1.063126467520e-01 + -1.057183316588e-01 -1.051368497861e-01 -1.045674733867e-01 -1.040094195616e-01 + -1.034618553116e-01 -1.029239028794e-01 -1.023946453480e-01 -1.018731324599e-01 + -1.013583866214e-01 -1.008494090529e-01 -1.003451860488e-01 -9.984469530635e-02 + -9.934691228511e-02 -9.885081655779e-02 -9.835539811317e-02 -9.785966357267e-02 + -9.736264228232e-02 -9.686339224335e-02 -9.636100584524e-02 -9.585461536651e-02 + -9.534339821039e-02 -9.482658184372e-02 -9.430344840978e-02 -9.377333898760e-02 + -9.323565747272e-02 -9.268987405661e-02 -9.213552828457e-02 -9.157223167475e-02 + -9.099966988322e-02 -9.041760440345e-02 -8.982587379098e-02 -8.922439440716e-02 + -8.861316067895e-02 -8.799224487455e-02 -8.736179639766e-02 -8.672204060623e-02 + -8.607327716429e-02 -8.541587793847e-02 -8.475028445345e-02 -8.407700492325e-02 + -8.339661087801e-02 -8.270973340809e-02 -8.201705904985e-02 -8.131932533933e-02 + -8.061731606233e-02 -7.991185623101e-02 -7.920380681863e-02 -7.849405928578e-02 + -7.778352993221e-02 -7.707315410983e-02 -7.636388033277e-02 -7.565666432118e-02 + -7.495246301588e-02 -7.425222860060e-02 -7.355690256896e-02 -7.286740987259e-02 + -7.218465318639e-02 -7.150950732601e-02 -7.084281385174e-02 -7.018537589158e-02 + -6.953795321511e-02 -6.890125758787e-02 -6.827594843441e-02 -6.766262883596e-02 + -6.706184188687e-02 -6.647406743135e-02 -6.589971920003e-02 -6.533914236294e-02 + -6.479261151330e-02 -6.426032909359e-02 -6.374242427268e-02 -6.323895228008e-02 + -6.274989420036e-02 -6.227515722821e-02 -6.181457538156e-02 -6.136791066736e-02 + -6.093485469211e-02 -6.051503070615e-02 -6.010799606826e-02 -5.971324511462e-02 + -5.933021241354e-02 -5.895827638510e-02 -5.859676326279e-02 -5.824495137181e-02 + -5.790207569719e-02 -5.756733271290e-02 -5.723988544151e-02 -5.691886871294e-02 + -5.660339458914e-02 -5.629255792112e-02 -5.598544200347e-02 -5.568112429147e-02 + -5.537868214503e-02 -5.507719856411e-02 -5.477576787990e-02 -5.447350136674e-02 + -5.416953274002e-02 -5.386302350631e-02 -5.355316813253e-02 -5.323919900273e-02 + -5.292039113168e-02 -5.259606660662e-02 -5.226559872992e-02 -5.192841583729e-02 + -5.158400476822e-02 -5.123191396769e-02 -5.087175620014e-02 -5.050321085940e-02 + -5.012602586062e-02 -4.974001910291e-02 -4.934507949390e-02 -4.894116753052e-02 + -4.852831543246e-02 -4.810662682810e-02 -4.767627599506e-02 -4.723750666042e-02 + -4.679063036846e-02 -4.633602442617e-02 -4.587412943961e-02 -4.540544645667e-02 + -4.493053373399e-02 -4.445000314847e-02 -4.396451627563e-02 -4.347478015932e-02 + -4.298154279907e-02 -4.248558838326e-02 -4.198773229754e-02 -4.148881593965e-02 + -4.098970137276e-02 -4.049126585042e-02 -3.999439624720e-02 -3.949998342938e-02 + -3.900891660067e-02 -3.852207765799e-02 -3.804033559219e-02 -3.756454096847e-02 + -3.709552052070e-02 -3.663407189310e-02 -3.618095856188e-02 -3.573690496837e-02 + -3.530259189383e-02 -3.487865210461e-02 -3.446566629484e-02 -3.406415935180e-02 + -3.367459696729e-02 -3.329738261618e-02 -3.293285492101e-02 -3.258128541928e-02 + -3.224287674747e-02 -3.191776125334e-02 -3.160600004545e-02 -3.130758248621e-02 + -3.102242613197e-02 -3.075037712086e-02 -3.049121100666e-02 -3.024463403384e-02 + -3.001028484654e-02 -2.978773662133e-02 -2.957649961123e-02 -2.937602408583e-02 + -2.918570364980e-02 -2.900487891999e-02 -2.883284153897e-02 -2.866883850065e-02 + -2.851207676207e-02 -2.836172811322e-02 -2.821693427547e-02 -2.807681219758e-02 + -2.794045951709e-02 -2.780696015387e-02 -2.767539000166e-02 -2.754482268274e-02 + -2.741433533076e-02 -2.728301436604e-02 -2.714996122805e-02 -2.701429802975e-02 + -2.687517309904e-02 -2.673176637293e-02 -2.658329461132e-02 -2.642901639774e-02 + -2.626823689621e-02 -2.610031233427e-02 -2.592465418425e-02 -2.574073301636e-02 + -2.554808199911e-02 -2.534630002494e-02 -2.513505444066e-02 -2.491408336509e-02 + -2.468319757853e-02 -2.444228197111e-02 -2.419129654013e-02 -2.393027692850e-02 + -2.365933449986e-02 -2.337865594821e-02 -2.308850244281e-02 -2.278920831204e-02 + -2.248117927242e-02 -2.216489021197e-02 -2.184088253950e-02 -2.150976111438e-02 + -2.117219077357e-02 -2.082889247518e-02 -2.048063908047e-02 -2.012825079787e-02 + -1.977259031513e-02 -1.941455764743e-02 -1.905508473103e-02 -1.869512979362e-02 + -1.833567153412e-02 -1.797770314545e-02 -1.762222621544e-02 -1.727024454121e-02 + -1.692275789348e-02 -1.658075576729e-02 -1.624521115604e-02 -1.591707438558e-02 + -1.559726704482e-02 -1.528667604908e-02 -1.498614787135e-02 -1.469648297606e-02 + -1.441843048879e-02 -1.415268313393e-02 -1.389987247105e-02 -1.366056445881e-02 + -1.343525537381e-02 -1.322436810926e-02 -1.302824887671e-02 -1.284716433160e-02 + -1.268129914080e-02 -1.253075400823e-02 -1.239554417166e-02 -1.227559838124e-02 + -1.217075836756e-02 -1.208077880421e-02 -1.200532776672e-02 -1.194398768716e-02 + -1.189625680016e-02 -1.186155107347e-02 -1.183920661233e-02 -1.182848252393e-02 + -1.182856422366e-02 -1.183856716099e-02 -1.185754093687e-02 -1.188447377830e-02 + -1.191829732706e-02 -1.195789168909e-02 -1.200209067673e-02 -1.204968715833e-02 + -1.209943840630e-02 -1.215007130625e-02 -1.220028725426e-02 -1.224876652818e-02 + -1.229417187213e-02 -1.233515098480e-02 -1.237033755583e-02 -1.239835045939e-02 + -1.241779070038e-02 -1.242723573197e-02 -1.242523084214e-02 -1.241027746188e-02 + -1.238081850111e-02 -1.233522118866e-02 -1.227175839268e-02 -1.218859002675e-02 + -1.208374688581e-02 -1.195512006101e-02 -1.180045987933e-02 -1.161738899598e-02 + -1.140343469983e-02 -1.115608551522e-02 -1.087287663337e-02 -1.055150743420e-02 + -1.018999225887e-02 -9.786842636481e-03 -9.341275432695e-03 -8.853437083322e-03 + -8.324629554625e-03 -7.757519422508e-03 -7.156308076494e-03 -6.526839170932e-03 + -5.876619671647e-03 -5.214733660413e-03 -4.551633714403e-03 -3.898803112012e-03 + -3.268292897218e-03 -2.672150143947e-03 -2.121766438798e-03 -1.627187242489e-03 + -1.196431908000e-03 -8.348793414504e-04 -5.447745126481e-04 -3.249056704027e-04 + -1.704912337315e-04 -7.329963822255e-05 -2.200628869199e-05 -2.771091616120e-06 + 0.000000000000e+00 + Type L N + 0 2 0 + 0.000000000000e+00 -3.343626342662e-04 -1.336837154607e-03 -3.005584903671e-03 + -5.337546547975e-03 -8.328449682246e-03 -1.197281945274e-02 -1.626399216017e-02 + -2.119413180214e-02 -2.675424950468e-02 -3.293422578324e-02 -3.972283556741e-02 + -4.710777591292e-02 -5.507569631817e-02 -6.361223155362e-02 -7.270203690572e-02 + -8.232882572951e-02 -9.247540919759e-02 -1.031237381265e-01 -1.142549467555e-01 + -1.258493983485e-01 -1.378867324813e-01 -1.503459138772e-01 -1.632052826437e-01 + -1.764426057637e-01 -1.900351296900e-01 -2.039596338880e-01 -2.181924851715e-01 + -2.327096926724e-01 -2.474869632865e-01 -2.624997574346e-01 -2.777233449784e-01 + -2.931328611333e-01 -3.087033622181e-01 -3.244098810844e-01 -3.402274820706e-01 + -3.561313153280e-01 -3.720966703679e-01 -3.880990286845e-01 -4.041141153094e-01 + -4.201179491604e-01 -4.360868920511e-01 -4.519976962312e-01 -4.678275503368e-01 + -4.835541236322e-01 -4.991556084334e-01 -5.146107606085e-01 -5.298989380595e-01 + -5.450001370934e-01 -5.598950266029e-01 -5.745649799796e-01 -5.889921046952e-01 + -6.031592694904e-01 -6.170501291222e-01 -6.306491466272e-01 -6.439416130674e-01 + -6.569136647327e-01 -6.695522977849e-01 -6.818453803336e-01 -6.937816619452e-01 + -7.053507805935e-01 -7.165432670680e-01 -7.273505468671e-01 -7.377649396064e-01 + -7.477796559861e-01 -7.573887923636e-01 -7.665873229882e-01 -7.753710899610e-01 + -7.837367909893e-01 -7.916819650125e-01 -7.992049757811e-01 -8.063049934769e-01 + -8.129819744702e-01 -8.192366393094e-01 -8.250704490495e-01 -8.304855800252e-01 + -8.354848971804e-01 -8.400719260699e-01 -8.442508236491e-01 -8.480263479737e-01 + -8.514038269297e-01 -8.543891261192e-01 -8.569886160244e-01 -8.592091385765e-01 + -8.610579732544e-01 -8.625428028381e-01 -8.636716789393e-01 -8.644529874351e-01 + -8.648954139221e-01 -8.650079093126e-01 -8.647996556872e-01 -8.642800325178e-01 + -8.634585833709e-01 -8.623449831963e-01 -8.609490063045e-01 -8.592804951284e-01 + -8.573493298636e-01 -8.551653990737e-01 -8.527385713425e-01 -8.500786680519e-01 + -8.471954373523e-01 -8.440985293945e-01 -8.407974728780e-01 -8.373016529705e-01 + -8.336202906425e-01 -8.297624234571e-01 -8.257368878476e-01 -8.215523029081e-01 + -8.172170557172e-01 -8.127392882070e-01 -8.081268855835e-01 -8.033874662982e-01 + -7.985283735640e-01 -7.935566684020e-01 -7.884791242011e-01 -7.833022227637e-01 + -7.780321518080e-01 -7.726748038897e-01 -7.672357767027e-01 -7.617203747098e-01 + -7.561336120554e-01 -7.504802167010e-01 -7.447646357266e-01 -7.389910417321e-01 + -7.331633402733e-01 -7.272851782609e-01 -7.213599532512e-01 -7.153908235516e-01 + -7.093807190655e-01 -7.033323527959e-01 -6.972482329292e-01 -6.911306754180e-01 + -6.849818169812e-01 -6.788036284404e-01 -6.725979283113e-01 -6.663663965707e-01 + -6.601105885181e-01 -6.538319486556e-01 -6.475318245087e-01 -6.412114803151e-01 + -6.348721105083e-01 -6.285148529281e-01 -6.221408016911e-01 -6.157510196589e-01 + -6.093465504440e-01 -6.029284298983e-01 -5.964976970317e-01 -5.900554043133e-01 + -5.836026273123e-01 -5.771404736385e-01 -5.706700911490e-01 -5.641926753898e-01 + -5.577094762487e-01 -5.512218037973e-01 -5.447310333076e-01 -5.382386094324e-01 + -5.317460495410e-01 -5.252549462125e-01 -5.187669688857e-01 -5.122838646765e-01 + -5.058074583733e-01 -4.993396516261e-01 -4.928824213526e-01 -4.864378173819e-01 + -4.800079593679e-01 -4.735950330014e-01 -4.672012855581e-01 -4.608290208195e-01 + -4.544805934091e-01 -4.481584025867e-01 -4.418648855484e-01 -4.356025102794e-01 + -4.293737680101e-01 -4.231811653276e-01 -4.170272159956e-01 -4.109144325344e-01 + -4.048453176194e-01 -3.988223553477e-01 -3.928480024327e-01 -3.869246793767e-01 + -3.810547616785e-01 -3.752405711272e-01 -3.694843672348e-01 -3.637883388583e-01 + -3.581545960596e-01 -3.525851622505e-01 -3.470819666678e-01 -3.416468372203e-01 + -3.362814937487e-01 -3.309875417352e-01 -3.257664664965e-01 -3.206196278925e-01 + -3.155482555784e-01 -3.105534448246e-01 -3.056361529269e-01 -3.007971962230e-01 + -2.960372477322e-01 -2.913568354266e-01 -2.867563411432e-01 -2.822360001380e-01 + -2.777959012850e-01 -2.734359879143e-01 -2.691560592826e-01 -2.649557726669e-01 + -2.608346460667e-01 -2.567920614966e-01 -2.528272688523e-01 -2.489393903234e-01 + -2.451274253294e-01 -2.413902559506e-01 -2.377266528210e-01 -2.341352814527e-01 + -2.306147089543e-01 -2.271634111079e-01 -2.237797797652e-01 -2.204621305236e-01 + -2.172087106397e-01 -2.140177071397e-01 -2.108872550835e-01 -2.078154459384e-01 + -2.048003360207e-01 -2.018399549607e-01 -1.989323141484e-01 -1.960754151182e-01 + -1.932672578291e-01 -1.905058488019e-01 -1.877892090725e-01 -1.851153819227e-01 + -1.824824403534e-01 -1.798884942646e-01 -1.773316973091e-01 -1.748102533895e-01 + -1.723224227703e-01 -1.698665277787e-01 -1.674409580705e-01 -1.650441754402e-01 + -1.626747181578e-01 -1.603312048155e-01 -1.580123376728e-01 -1.557169054900e-01 + -1.534437858432e-01 -1.511919469166e-01 -1.489604487725e-01 -1.467484440982e-01 + -1.445551784381e-01 -1.423799899146e-01 -1.402223084519e-01 -1.380816545125e-01 + -1.359576373628e-01 -1.338499528870e-01 -1.317583809666e-01 -1.296827824501e-01 + -1.276230957362e-01 -1.255793329962e-01 -1.235515760637e-01 -1.215399720218e-01 + -1.195447285159e-01 -1.175661088266e-01 -1.156044267334e-01 -1.136600412031e-01 + -1.117333509371e-01 -1.098247888115e-01 -1.079348162442e-01 -1.060639175244e-01 + -1.042125941364e-01 -1.023813591143e-01 -1.005707314578e-01 -9.878123064275e-02 + -9.701337125784e-02 -9.526765779625e-02 -9.354457963214e-02 -9.184460620859e-02 + -9.016818246269e-02 -8.851572451171e-02 -8.688761562231e-02 -8.528420248277e-02 + -8.370579179616e-02 -8.215264721034e-02 -8.062498659825e-02 -7.912297969974e-02 + -7.764674613412e-02 -7.619635378974e-02 -7.477181759514e-02 -7.337309867347e-02 + -7.200010387990e-02 -7.065268571912e-02 -6.933064263796e-02 -6.803371968591e-02 + -6.676160953406e-02 -6.551395384105e-02 -6.429034495247e-02 -6.309032791849e-02 + -6.191340281251e-02 -6.075902733211e-02 -5.962661966204e-02 -5.851556157749e-02 + -5.742520176494e-02 -5.635485933641e-02 -5.530382751238e-02 -5.427137744758e-02 + -5.325676217347e-02 -5.225922063068e-02 -5.127798176446e-02 -5.031226865597e-02 + -4.936130266255e-02 -4.842430754004e-02 -4.750051352083e-02 -4.658916132185e-02 + -4.568950605718e-02 -4.480082103116e-02 -4.392240138864e-02 -4.305356760016e-02 + -4.219366876109e-02 -4.134208568535e-02 -4.049823377542e-02 -3.966156565219e-02 + -3.883157352997e-02 -3.800779132324e-02 -3.718979647415e-02 -3.637721149118e-02 + -3.556970519142e-02 -3.476699364092e-02 -3.396884078953e-02 -3.317505879834e-02 + -3.238550806028e-02 -3.160009691578e-02 -3.081878106792e-02 -3.004156270276e-02 + -2.926848932289e-02 -2.849965230358e-02 -2.773518518292e-02 -2.697526169857e-02 + -2.622009358570e-02 -2.546992815167e-02 -2.472504564458e-02 -2.398575643389e-02 + -2.325239802234e-02 -2.252533190942e-02 -2.180494032745e-02 -2.109162287172e-02 + -2.038579304718e-02 -1.968787475392e-02 -1.899829873448e-02 -1.831749900579e-02 + -1.764590929849e-02 -1.698395952636e-02 -1.633207230820e-02 -1.569065956384e-02 + -1.506011920558e-02 -1.444083194557e-02 -1.383315823866e-02 -1.323743537947e-02 + -1.265397477111e-02 -1.208305938198e-02 -1.152494140576e-02 -1.097984013816e-02 + -1.044794008281e-02 -9.929389296949e-03 -9.424297986017e-03 -8.932737354798e-03 + -8.454738720835e-03 -7.990292894352e-03 -7.539349827129e-03 -7.101818531054e-03 + -6.677567265404e-03 -6.266423990178e-03 -5.868177081158e-03 -5.482576300744e-03 + -5.109334017007e-03 -4.748126661889e-03 -4.398596418013e-03 -4.060353122176e-03 + -3.732976372278e-03 -3.416017823244e-03 -3.109003656357e-03 -2.811437205408e-03 + -2.522801722167e-03 -2.242563262875e-03 -1.970173676792e-03 -1.705073677284e-03 + -1.446695975487e-03 -1.194468456330e-03 -9.478173764667e-04 -7.061705636916e-04 + -4.689605974468e-04 -2.356279502815e-04 -5.624070443108e-06 2.215856137444e-04 + 4.465187864809e-04 6.696734521357e-04 8.915252751909e-04 1.112525068831e-03 + 1.333096447502e-03 1.553633657665e-03 1.774499599783e-03 1.996024053307e-03 + 2.218502115094e-03 2.442192860297e-03 2.667318233328e-03 2.894062174991e-03 + 3.122569990378e-03 3.352947960583e-03 3.585263199706e-03 3.819543757117e-03 + 4.055778963323e-03 4.293920016333e-03 4.533880803833e-03 4.775538955066e-03 + 5.018737114848e-03 5.263284430803e-03 5.508958243561e-03 5.755505968455e-03 + 6.002647156047e-03 6.250075717768e-03 6.497462301937e-03 6.744456804555e-03 + 6.990690998455e-03 7.235781263722e-03 7.479331401700e-03 7.720935514475e-03 + 7.960180931322e-03 8.196651163443e-03 8.429928868145e-03 8.659598803677e-03 + 8.885250756012e-03 9.106482419171e-03 9.322902210975e-03 9.534132006645e-03 + 9.739809773209e-03 9.939592088387e-03 1.013315652839e-02 1.032020390999e-02 + 1.050046037311e-02 1.067367929138e-02 1.083964299904e-02 1.099816432397e-02 + 1.114908791773e-02 1.129229137491e-02 1.142768613538e-02 1.155521816451e-02 + 1.167486840766e-02 1.178665301699e-02 1.189062334975e-02 1.198686573886e-02 + 1.207550103810e-02 1.215668394523e-02 1.223060210846e-02 1.229747502216e-02 + 1.235755271998e-02 1.241111427384e-02 1.245846610930e-02 1.249994014833e-02 + 1.253589179188e-02 1.256669775556e-02 1.259275377257e-02 1.261447217886e-02 + 1.263227939621e-02 1.264661332954e-02 1.265792069506e-02 1.266665429669e-02 + 1.267327026786e-02 1.267822529655e-02 1.268197385112e-02 1.268496542450e-02 + 1.268764181424e-02 1.269043445550e-02 1.269376182389e-02 1.269802692425e-02 + 1.270361488126e-02 1.271089064677e-02 1.272019683810e-02 1.273185172070e-02 + 1.274614734761e-02 1.276334786702e-02 1.278368800834e-02 1.280737175581e-02 + 1.283457121768e-02 1.286542569759e-02 1.290004097353e-02 1.293848878846e-02 + 1.298080655521e-02 1.302699727721e-02 1.307702968475e-02 1.313083858562e-02 + 1.318832542729e-02 1.324935906660e-02 1.331377674153e-02 1.338138523858e-02 + 1.345196224768e-02 1.352525789593e-02 1.360099644967e-02 1.367887817415e-02 + 1.375858133831e-02 1.383976435191e-02 1.392206802105e-02 1.400511790768e-02 + 1.408852677781e-02 1.417189712294e-02 1.425482373845e-02 1.433689634259e-02 + 1.441770221955e-02 1.449682886970e-02 1.457386665042e-02 1.464841139079e-02 + 1.472006696371e-02 1.478844779938e-02 1.485318132444e-02 1.491391031148e-02 + 1.497029512441e-02 1.502201584577e-02 1.506877427283e-02 1.511029577033e-02 + 1.514633096835e-02 1.517665729523e-02 1.520108033617e-02 1.521943500936e-02 + 1.523158655287e-02 1.523743131645e-02 1.523689735383e-02 1.522994481228e-02 + 1.521656611768e-02 1.519678595426e-02 1.517066104006e-02 1.513827969981e-02 + 1.509976123868e-02 1.505525512150e-02 1.500493996308e-02 1.494902233675e-02 + 1.488773540916e-02 1.482133741048e-02 1.475010995040e-02 1.467435619093e-02 + 1.459439888821e-02 1.451057831614e-02 1.442325008548e-02 1.433278287269e-02 + 1.423955607319e-02 1.414395739449e-02 1.404638040462e-02 1.394722205179e-02 + 1.384688017131e-02 1.374575099580e-02 1.364422668469e-02 1.354269288897e-02 + 1.344152636660e-02 1.334109266410e-02 1.324174387886e-02 1.314381651665e-02 + 1.304762945779e-02 1.295348204502e-02 1.286165230509e-02 1.277239531539e-02 + 1.268594172582e-02 1.260249644524e-02 1.252223750064e-02 1.244531507624e-02 + 1.237185073831e-02 1.230193685046e-02 1.223563618299e-02 1.217298171836e-02 + 1.211397665396e-02 1.205859460168e-02 1.200677998284e-02 1.195844861567e-02 + 1.191348849118e-02 1.187176073223e-02 1.183310072929e-02 1.179731944541e-02 + 1.176420488159e-02 1.173352369290e-02 1.170502294478e-02 1.167843199771e-02 + 1.165346450811e-02 1.162982053213e-02 1.160718871857e-02 1.158524857654e-02 + 1.156367280306e-02 1.154212965511e-02 1.152028535082e-02 1.149780648386e-02 + 1.147436243525e-02 1.144962776679e-02 1.142328458018e-02 1.139502482655e-02 + 1.136455255094e-02 1.133158605705e-02 1.129585997790e-02 1.125712723852e-02 + 1.121516089784e-02 1.116975585722e-02 1.112073042436e-02 1.106792772183e-02 + 1.101121693077e-02 1.095049436119e-02 1.088568434131e-02 1.081673991978e-02 + 1.074364337555e-02 1.066640653153e-02 1.058507086931e-02 1.049970744365e-02 + 1.041041659643e-02 1.031732747148e-02 1.022059733232e-02 1.012041068691e-02 + 1.001697822396e-02 9.910535567088e-03 9.801341854133e-03 9.689678149904e-03 + 9.575845701974e-03 9.460164049946e-03 9.342968999703e-03 9.224610474943e-03 + 9.105450259188e-03 8.985859642125e-03 8.866216984828e-03 8.746905218928e-03 + 8.628309295287e-03 8.510813598082e-03 8.394799340493e-03 8.280641958326e-03 + 8.168708518025e-03 8.059355155419e-03 7.952924561508e-03 7.849743531260e-03 + 7.750120591151e-03 7.654343720673e-03 7.562678182560e-03 7.475364475847e-03 + 7.392616425167e-03 7.314619418914e-03 7.241528808031e-03 7.173468476237e-03 + 7.110529591491e-03 7.052769547440e-03 7.000211102441e-03 6.952841722580e-03 + 6.910613133880e-03 6.873441087605e-03 6.841205341262e-03 6.813749856528e-03 + 6.790883213907e-03 6.772379242453e-03 6.757977861265e-03 6.747386127750e-03 + 6.740279485677e-03 6.736303203743e-03 6.735073992636e-03 6.736181785112e-03 + 6.739191659263e-03 6.743645879500e-03 6.749066022504e-03 6.754955146012e-03 + 6.760799946435e-03 6.766072836490e-03 6.770233856141e-03 6.772732309341e-03 + 6.773007995942e-03 6.770491884438e-03 6.764606049322e-03 6.754762681147e-03 + 6.740361973409e-03 6.720788705873e-03 6.695407387943e-03 6.663555908574e-03 + 6.624537771248e-03 6.577613182754e-03 6.521989517875e-03 6.456811997516e-03 + 6.381155784392e-03 6.294021095072e-03 6.194333312052e-03 6.080950401236e-03 + 5.952680131222e-03 5.808309573621e-03 5.646649058578e-03 5.466592095872e-03 + 5.267191701375e-03 5.047752081595e-03 4.807932768711e-03 4.547860173024e-03 + 4.268239306083e-03 3.970456368326e-03 3.656661280562e-03 3.329818380641e-03 + 2.993713697702e-03 2.652908684317e-03 2.312633146252e-03 1.978614320966e-03 + 1.656844398248e-03 1.353294841584e-03 1.073592084013e-03 8.226748497738e-04 + 6.044577664810e-04 4.215284098635e-04 2.749049451014e-04 1.638788182719e-04 + 8.596153714402e-05 3.694682421181e-05 1.109000226043e-05 1.396308876444e-06 + 0.000000000000e+00 \ No newline at end of file diff --git a/ABACUS.develop/examples/H2O-deepks-pw/STRU b/ABACUS.develop/examples/H2O-deepks-pw/STRU new file mode 100644 index 0000000000..3ffd869801 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/STRU @@ -0,0 +1,28 @@ +ATOMIC_SPECIES +H 1.008 H_ONCV_PBE-1.0.upf +O 15.9994 O_ONCV_PBE-1.0.upf + +NUMERICAL_ORBITAL +H_gga_6au_60Ry_2s1p.orb +O_gga_6au_60Ry_2s2p1d.orb + +LATTICE_CONSTANT +10 + +LATTICE_VECTORS +1 0 0 +0 1 0 +0 0 1 + +ATOMIC_POSITIONS +Cartesian + +H +0 +2 +0.2336137046291667 0.8630016418166666 0.7271997623458333 1 1 1 +0.23417266949166665 0.9245341895916668 0.7207232227333333 1 1 1 +O +0 +1 +0.20910677665833333 0.894927691625 0.7301984601833333 1 1 1 diff --git a/ABACUS.develop/examples/H2O-deepks-pw/descriptor.dat b/ABACUS.develop/examples/H2O-deepks-pw/descriptor.dat new file mode 100644 index 0000000000..843547ef0c --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/descriptor.dat @@ -0,0 +1,48 @@ +H atom_index 1 n_descriptor 117 +8.6337 1.64286 0.335071 0.131771 0.0476684 0.0225226 0.0116164 0.00588298 +0.00324368 0.00153789 0.000798237 0.000364279 0.000169084 0.405463 0.774783 3.17103 +0.320238 0.401018 0.416599 0.14597 0.167703 0.171042 0.0557152 0.0694168 +0.0828051 0.0175949 0.0286645 0.0360523 0.0056741 0.0115018 0.0162086 0.00148592 +0.00484878 0.00673434 0.00040785 0.00193997 0.00298168 9.45225e-05 0.000774866 0.00111817 +4.80692e-05 0.000284433 0.00046522 3.31228e-05 9.92706e-05 0.000144674 2.49332e-05 3.36781e-05 +6.29598e-05 3.55959e-06 3.76563e-06 9.19828e-06 1.86463e-05 0.000495479 0.0158654 0.0164122 +0.131167 1.21854e-06 0.000498166 0.0170361 0.0182622 0.0229838 2.37349e-06 9.79136e-05 +0.0136992 0.0149038 0.0194728 1.80217e-06 5.19709e-05 0.00925381 0.0100169 0.0128096 +1.06341e-06 2.84027e-05 0.00556941 0.00600754 0.00883919 7.26986e-07 1.36759e-05 0.00323978 +0.00348365 0.00503592 3.53711e-07 8.26414e-06 0.0018024 0.00181919 0.00317192 2.11246e-07 +4.17861e-06 0.000941667 0.00095985 0.00160115 8.42441e-08 2.41634e-06 0.000409661 0.000474298 +0.000895715 3.5565e-08 1.34604e-06 0.000179148 0.000214292 0.000381697 8.8433e-09 7.5638e-07 +6.30949e-05 9.13342e-05 0.000190989 1.63448e-09 4.21859e-07 2.09944e-05 2.95453e-05 5.76515e-05 +2.52811e-11 1.59956e-08 9.63818e-08 1.87631e-07 3.57585e-06 +H atom_index 2 n_descriptor 117 +8.58629 1.64279 0.333321 0.131436 0.0468976 0.0222956 0.0113884 0.00582681 +0.00319229 0.00153173 0.000789979 0.000365163 0.000168024 0.428327 0.774951 3.22546 +0.323387 0.400148 0.416881 0.146513 0.167956 0.171337 0.055514 0.0696468 +0.084421 0.017907 0.0288043 0.0363163 0.0057377 0.0115866 0.0166051 0.00156437 +0.0048947 0.00681812 0.000422159 0.0019657 0.00307941 0.000100246 0.00078749 0.00113914 +4.58591e-05 0.00029052 0.000486945 2.9619e-05 0.000101678 0.000148827 2.33115e-05 3.48065e-05 +6.73526e-05 3.39956e-06 3.69115e-06 9.03414e-06 1.10973e-05 0.000561533 0.0158827 0.0160544 +0.10203 6.96469e-07 0.000543107 0.0165868 0.0179468 0.0209534 1.26938e-06 9.31636e-05 +0.0134988 0.0147624 0.0188412 3.49364e-07 5.21841e-05 0.00908559 0.00980599 0.0124494 +4.8741e-07 2.80017e-05 0.00548797 0.00595887 0.00872226 1.47042e-07 1.40112e-05 0.00319001 +0.00341412 0.00497452 1.55652e-07 8.11539e-06 0.00178868 0.00181172 0.00315219 4.1026e-08 +4.25747e-06 0.000928262 0.000949085 0.00159341 4.33366e-08 2.31115e-06 0.000414829 0.000471228 +0.000894336 6.82658e-09 1.32567e-06 0.000177523 0.00021326 0.000381831 8.50005e-09 6.9477e-07 +6.49545e-05 9.12906e-05 0.000191355 1.17968e-09 4.23974e-07 2.02826e-05 2.98077e-05 5.78414e-05 +1.08748e-09 1.83654e-08 6.91167e-08 2.28524e-07 2.85146e-06 +O atom_index 1 n_descriptor 117 +8.39927 1.74924 0.320158 0.112639 0.0233291 0.00835168 0.00230151 0.0010965 +0.000685832 0.000358311 0.000283113 0.000141987 0.000102514 0.382931 0.785038 3.18816 +0.325464 0.403513 0.435225 0.17871 0.182868 0.186876 0.081024 0.0943096 +0.0978905 0.0362042 0.0431748 0.0474245 0.0161162 0.0227891 0.0232373 0.00758905 +0.0103734 0.0116325 0.00351414 0.00558713 0.00573454 0.00161866 0.00241805 0.00274659 +0.000718772 0.00125817 0.00128576 0.000294225 0.000473332 0.000545205 0.000127139 0.00025082 +0.000258046 1.45077e-05 2.71564e-05 2.99321e-05 5.9403e-06 0.000288006 0.000502287 0.000630795 +0.184366 1.39968e-06 0.000332439 0.000510098 0.000734575 0.00738666 1.21917e-06 0.000269666 +0.000294478 0.000627856 0.00317448 8.51215e-07 0.000146432 0.000184091 0.000469511 0.000989314 +5.24365e-07 8.09823e-05 0.000142 0.000310221 0.000470881 2.93804e-07 4.30581e-05 8.14991e-05 +0.000204871 0.000233799 1.7751e-07 2.40895e-05 6.00404e-05 0.0001152 0.000138208 9.21282e-08 +1.2903e-05 3.32158e-05 6.96494e-05 8.43918e-05 5.36017e-08 7.13565e-06 2.17522e-05 3.78762e-05 +5.14935e-05 2.54311e-08 3.67034e-06 1.15774e-05 2.31958e-05 2.95982e-05 1.37544e-08 1.98643e-06 +6.89745e-06 1.34907e-05 1.75484e-05 5.01753e-09 8.71328e-07 3.17905e-06 8.07677e-06 8.7924e-06 +3.33246e-11 5.102e-09 4.27705e-08 5.0544e-08 4.80027e-06 diff --git a/ABACUS.develop/examples/H2O-deepks-pw/descriptor.dat.bak b/ABACUS.develop/examples/H2O-deepks-pw/descriptor.dat.bak new file mode 100644 index 0000000000..843547ef0c --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/descriptor.dat.bak @@ -0,0 +1,48 @@ +H atom_index 1 n_descriptor 117 +8.6337 1.64286 0.335071 0.131771 0.0476684 0.0225226 0.0116164 0.00588298 +0.00324368 0.00153789 0.000798237 0.000364279 0.000169084 0.405463 0.774783 3.17103 +0.320238 0.401018 0.416599 0.14597 0.167703 0.171042 0.0557152 0.0694168 +0.0828051 0.0175949 0.0286645 0.0360523 0.0056741 0.0115018 0.0162086 0.00148592 +0.00484878 0.00673434 0.00040785 0.00193997 0.00298168 9.45225e-05 0.000774866 0.00111817 +4.80692e-05 0.000284433 0.00046522 3.31228e-05 9.92706e-05 0.000144674 2.49332e-05 3.36781e-05 +6.29598e-05 3.55959e-06 3.76563e-06 9.19828e-06 1.86463e-05 0.000495479 0.0158654 0.0164122 +0.131167 1.21854e-06 0.000498166 0.0170361 0.0182622 0.0229838 2.37349e-06 9.79136e-05 +0.0136992 0.0149038 0.0194728 1.80217e-06 5.19709e-05 0.00925381 0.0100169 0.0128096 +1.06341e-06 2.84027e-05 0.00556941 0.00600754 0.00883919 7.26986e-07 1.36759e-05 0.00323978 +0.00348365 0.00503592 3.53711e-07 8.26414e-06 0.0018024 0.00181919 0.00317192 2.11246e-07 +4.17861e-06 0.000941667 0.00095985 0.00160115 8.42441e-08 2.41634e-06 0.000409661 0.000474298 +0.000895715 3.5565e-08 1.34604e-06 0.000179148 0.000214292 0.000381697 8.8433e-09 7.5638e-07 +6.30949e-05 9.13342e-05 0.000190989 1.63448e-09 4.21859e-07 2.09944e-05 2.95453e-05 5.76515e-05 +2.52811e-11 1.59956e-08 9.63818e-08 1.87631e-07 3.57585e-06 +H atom_index 2 n_descriptor 117 +8.58629 1.64279 0.333321 0.131436 0.0468976 0.0222956 0.0113884 0.00582681 +0.00319229 0.00153173 0.000789979 0.000365163 0.000168024 0.428327 0.774951 3.22546 +0.323387 0.400148 0.416881 0.146513 0.167956 0.171337 0.055514 0.0696468 +0.084421 0.017907 0.0288043 0.0363163 0.0057377 0.0115866 0.0166051 0.00156437 +0.0048947 0.00681812 0.000422159 0.0019657 0.00307941 0.000100246 0.00078749 0.00113914 +4.58591e-05 0.00029052 0.000486945 2.9619e-05 0.000101678 0.000148827 2.33115e-05 3.48065e-05 +6.73526e-05 3.39956e-06 3.69115e-06 9.03414e-06 1.10973e-05 0.000561533 0.0158827 0.0160544 +0.10203 6.96469e-07 0.000543107 0.0165868 0.0179468 0.0209534 1.26938e-06 9.31636e-05 +0.0134988 0.0147624 0.0188412 3.49364e-07 5.21841e-05 0.00908559 0.00980599 0.0124494 +4.8741e-07 2.80017e-05 0.00548797 0.00595887 0.00872226 1.47042e-07 1.40112e-05 0.00319001 +0.00341412 0.00497452 1.55652e-07 8.11539e-06 0.00178868 0.00181172 0.00315219 4.1026e-08 +4.25747e-06 0.000928262 0.000949085 0.00159341 4.33366e-08 2.31115e-06 0.000414829 0.000471228 +0.000894336 6.82658e-09 1.32567e-06 0.000177523 0.00021326 0.000381831 8.50005e-09 6.9477e-07 +6.49545e-05 9.12906e-05 0.000191355 1.17968e-09 4.23974e-07 2.02826e-05 2.98077e-05 5.78414e-05 +1.08748e-09 1.83654e-08 6.91167e-08 2.28524e-07 2.85146e-06 +O atom_index 1 n_descriptor 117 +8.39927 1.74924 0.320158 0.112639 0.0233291 0.00835168 0.00230151 0.0010965 +0.000685832 0.000358311 0.000283113 0.000141987 0.000102514 0.382931 0.785038 3.18816 +0.325464 0.403513 0.435225 0.17871 0.182868 0.186876 0.081024 0.0943096 +0.0978905 0.0362042 0.0431748 0.0474245 0.0161162 0.0227891 0.0232373 0.00758905 +0.0103734 0.0116325 0.00351414 0.00558713 0.00573454 0.00161866 0.00241805 0.00274659 +0.000718772 0.00125817 0.00128576 0.000294225 0.000473332 0.000545205 0.000127139 0.00025082 +0.000258046 1.45077e-05 2.71564e-05 2.99321e-05 5.9403e-06 0.000288006 0.000502287 0.000630795 +0.184366 1.39968e-06 0.000332439 0.000510098 0.000734575 0.00738666 1.21917e-06 0.000269666 +0.000294478 0.000627856 0.00317448 8.51215e-07 0.000146432 0.000184091 0.000469511 0.000989314 +5.24365e-07 8.09823e-05 0.000142 0.000310221 0.000470881 2.93804e-07 4.30581e-05 8.14991e-05 +0.000204871 0.000233799 1.7751e-07 2.40895e-05 6.00404e-05 0.0001152 0.000138208 9.21282e-08 +1.2903e-05 3.32158e-05 6.96494e-05 8.43918e-05 5.36017e-08 7.13565e-06 2.17522e-05 3.78762e-05 +5.14935e-05 2.54311e-08 3.67034e-06 1.15774e-05 2.31958e-05 2.95982e-05 1.37544e-08 1.98643e-06 +6.89745e-06 1.34907e-05 1.75484e-05 5.01753e-09 8.71328e-07 3.17905e-06 8.07677e-06 8.7924e-06 +3.33246e-11 5.102e-09 4.27705e-08 5.0544e-08 4.80027e-06 diff --git a/ABACUS.develop/examples/H2O-deepks-pw/logout.bak b/ABACUS.develop/examples/H2O-deepks-pw/logout.bak new file mode 100644 index 0000000000..bc638446e8 --- /dev/null +++ b/ABACUS.develop/examples/H2O-deepks-pw/logout.bak @@ -0,0 +1,73 @@ + ********************************************************* + * * + * WELCOME TO ABACUS * + * * + * 'Atomic-orbital Based Ab-initio * + * Computation at UStc' * + * * + * Website: http://abacus.ustc.edu.cn/ * + * * + ********************************************************* + Sat Jan 30 16:21:16 2021 + MAKE THE DIR : OUT.abacus/ + DONE(0.0508616 SEC) : SETUP UNITCELL + DONE(0.0510054 SEC) : INIT K-POINTS + --------------------------------------------------------- + This calculation is self-consistent + --------------------------------------------------------- + SPIN KPOINTS PROCESSORS + 1 1 1 + --------------------------------------------------------- + Use plane wave basis + --------------------------------------------------------- + ELEMENT NATOM XC + H 2 PBE + O 1 PBE + --------------------------------------------------------- + Initial plane wave basis and FFT box + --------------------------------------------------------- + DONE(0.128295 SEC) : INIT PLANEWAVE + UNIFORM GRID DIM : 48 * 48 * 48 + UNIFORM GRID DIM(BIG): 48 * 48 * 48 + MEMORY FOR PSI (MB) : 0.552155 + DONE(0.142381 SEC) : LOCAL POTENTIAL + DONE(0.147029 SEC) : NON-LOCAL POTENTIAL + START POTENTIAL : atomic + DONE(0.220855 SEC) : INIT POTENTIAL + DONE(0.25472 SEC) : INIT BASIS + ------------------------------------------- + SELF-CONSISTENT : + ------------------------------------------- + ITER ETOT(eV) EDIFF(eV) DRHO2 CG_ITER TIME(S) + CG1 -2.835018e+01 0.000000e+00 5.192e+00 1.000e+01 3.332e-01 + CG2 -2.718276e+01 1.167415e+00 6.586e-01 3.000e+00 1.672e-01 + CG3 -2.922537e+01 -2.042603e+00 3.547e-02 2.667e+00 1.576e-01 + CG4 -2.927314e+01 -4.777474e-02 5.820e-02 4.000e+00 1.858e-01 + CG5 -2.937300e+01 -9.986165e-02 1.613e-03 2.667e+00 1.610e-01 + CG6 -2.937923e+01 -6.231003e-03 1.783e-05 5.500e+00 2.225e-01 + CG7 -2.937924e+01 -3.778364e-06 8.821e-06 5.000e+00 2.062e-01 + CG8 -2.937925e+01 -9.245653e-06 6.311e-07 2.667e+00 1.563e-01 + CG9 -2.937925e+01 -1.147022e-06 5.296e-08 4.667e+00 2.033e-01 + CG10 -2.937925e+01 -1.211570e-07 9.727e-09 5.167e+00 2.038e-01 + DONE(2.398e+00 SEC) : jlq3d_overlap + DONE(2.399e+00 SEC) : GENERATE DESCRIPTOR FOR DEEPKS + + |CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%------- + A DC_Driv solve_eachf 2.3 1 2.3 95 % + B Run_Frag frag_pw_line 2.3 1 2.3 95 % + X FFT FFT3D 1.2 879 0.0014 50 % + E potential v_of_rho 0.56 11 0.051 23 % + G Hamilt_PW cinitcgg 0.26 11 0.023 11 % + H Hamilt_PW h_psi 1.1 338 0.0034 47 % + C Ions opt_ions_pw 2 1 2 83 % + D electrons self_consistent 2 1 2 83 % + E electrons c_bands 1.2 10 0.12 51 % + F Hamilt diago 1.2 10 0.12 51 % + G Diago_CG diag 0.98 10 0.098 41 % + E Charge mix_rho 0.13 10 0.013 5.5 % + ---------------------------------------------------------------------------------------- + + START Time : Sat Jan 30 16:21:16 2021 + FINISH Time : Sat Jan 30 16:21:18 2021 + TOTAL Time : 2 + SEE INFORMATION IN : OUT.abacus/ diff --git a/ABACUS.develop/source/Makefile b/ABACUS.develop/source/Makefile index 8bf15a37c7..f6f828d6f8 100644 --- a/ABACUS.develop/source/Makefile +++ b/ABACUS.develop/source/Makefile @@ -1,14 +1,17 @@ -# Makefile for plane wave basis code. +# This is the Makefile of ABACUS + include Makefile.system include Makefile.Objects VPATH=./src_global\ -:./src_parallel\ -:./src_external/src_pdiag\ :./src_pw\ :./src_lcao\ :./src_ions\ -:./src_external/src_pdiag/MRRR\ +:./src_io\ +:./src_parallel\ +:./src_pdiag\ +:./src_pdiag/MRRR\ +:./src_ri\ :./\ #========================== @@ -20,7 +23,9 @@ HONG_SER_SELINV = -D__FP ${HONG_FFTW} -D__SELINV HONG_GDB = -g -D__FP ${HONG_FFTW} #(2)mpi HONG_MPI = -D__FP ${HONG_FFTW} -D__MPI -HONG_MPI_SELINV = -D__FP ${HONG_FFTW} -D__MPI -D__SELINV -DMETIS +# mohan comment out 2021-02-06, add -DUSE_LIBXC=0 if you want to use LIBXC +#HONG_MPI_SELINV = -D__FP ${HONG_FFTW} -D__MPI -D__SELINV -DMETIS -DMKL_ILP64 -DEXX_DM=3 -DEXX_H_COMM=2 -DUSE_LIBXC=0 -DTEST_EXX_LCAO=0 -DTEST_EXX_RADIAL=1 -DUSE_CEREAL_SERIALIZATION +HONG_MPI_SELINV = -D__FP ${HONG_FFTW} -D__MPI -D__SELINV -DMETIS -DMKL_ILP64 -DEXX_DM=3 -DEXX_H_COMM=2 -DTEST_EXX_LCAO=0 -DTEST_EXX_RADIAL=1 -DUSE_CEREAL_SERIALIZATION #(3)memory HONG_MEM = ${HONG_FFTW} -D__FP -D_MCD_CHECK -DWIN32 -DMCD_VERBOSE @@ -33,59 +38,77 @@ HONG=${HONG_MPI_SELINV} #========================== # OPTIMIZE OPTIONS #========================== -#OPTS = -I/global/u2/m/mohan/software/boost_1_39_0/ -I../src_siao/ -#OPTS = -I/home/xiaohui/lib/boost_1_39_0/ -O3 -#OPTS = -I/home/mohan/software/boost_1_39_0/ -O3 #(1)gdb #xiaohui modify 2013-12-27 -OPTS_GDB = -g -W -I/home/mohan/software/boost_1_39_0/ +OPTS_GDB = -g -W -I${BOOST_INCLUDE_DIR} #(2)gprof #POTS = -pg #========================== # OBJECTS NEEDED #========================== -FP_OBJS=$(OBJS_OTHER)\ -$(OBJS_FIRST_PRINCIPLE)\ +FP_OBJS_0=$(OBJS_FIRST_PRINCIPLES)\ $(OBJS_PARALLEL)\ $(OBJS_TOOLS) \ -$(OBJS_ONSCALING)\ -$(OBJS_SELINV)\ -$(OBJS_CG)\ -$(OBJS_WANNIER)\ $(OBJS_COMMON)\ -$(OBJS_MLWF)\ -$(OBJS_EXX)\ -main.o \ +main.o\ -PDIAG_OBJS=$(OBJS_PDIAG)\ +FP_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${FP_OBJS_0}) +PDIAG_OBJS=$(patsubst %.o, ${OBJ_DIR}/%.o, ${OBJS_PDIAG}) +PDIAG_MR=$(patsubst %.o, ${OBJ_DIR}/%.o, ${PDIAG_MR_0}) #========================== # MAKING OPTIONS #========================== -fp_mpi : ${FP_OBJS} ${PDIAG_MR} ${PDIAG_OBJS}$ ${HEADERS} - ${CPLUSPLUS_MPI} ${OPTS} ${OPTS_MPI} $(FP_OBJS) ${PDIAG_OBJS} ${PDIAG_MR} ${LIBS} -o ../bin/${VERSION}.mpi.1.0.0 +fp_mpi : + @ make init + @ make -j $(NP) parallel + +fp : + @ make init + @ make -j $(NP) serial + +fp_gbd : + @ make init + @ make -j $(NP) serial_gbd + +fp_gprof : + @ make init + @ make -j $(NP) serial_gprof + +fp_mem : + @ make init + @ make -j $(NP) serial_mem + +init : + @ if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi + @ if [ ! -d $(OBJ_DIR)/README ]; then echo "This directory contains all of the .o files" > $(OBJ_DIR)/README; fi + @ if [ ! -d ../bin ]; then mkdir ../bin; fi + +parallel : ${FP_OBJS} ${PDIAG_OBJS} ${PDIAG_MR} ${HEADERS} + ${CPLUSPLUS_MPI} ${OPTS} ${OPTS_MPI} $(FP_OBJS) ${PDIAG_OBJS} ${PDIAG_MR} ${LIBS} -o ../bin/${VERSION}.mpi -fp : ${FP_OBJS} ${HEADERS} +serial : ${FP_OBJS} ${HEADERS} ${CPLUSPLUS} ${OPTS} $(FP_OBJS) ${LIBS} -o ${VERSION}.fp.x -fp_gdb : ${FP_OBJS} ${HEADERS} +serial_gdb : ${FP_OBJS} ${HEADERS} ${CPLUSPLUS} ${OPTS_GDB} $(FP_OBJS) ${LIBS} -o ${VERSION}.fp_gdb.x -fp_gprof : ${FP_OBJS} ${HEADERS} +serial_gprof : ${FP_OBJS} ${HEADERS} ${CPLUSPLUS} ${OPTS} $(FP_OBJS) ${LIBS} -o ${VERSION}.fp_gprof.x -fp_mem : ${FP_OBJS} ../src_parallel/mcd.o ${HEADERS} +serial_mem : ${FP_OBJS} ../src_parallel/mcd.o ${HEADERS} ${CPLUSPLUS} $(FP_OBJS) ../src_parallel/mcd.o ${LIBS} -o ${VERSION}.fp_mem.x #========================== # rules #========================== -.cpp.o: +${OBJ_DIR}/%.o:%.cpp ${CPLUSPLUS_MPI} ${OPTS} ${OPTS_MPI} -c ${HONG} $< -o $@ -.f.o: - ${FORTRAN} ${OPTS} -c ${HONG} $< -o $@ +${OBJ_DIR}/%.o:%.f + ${FORTRAN} -c ${HONG} $< -o $@ .PHONY:clean clean: - $(RM) *.o ../bin/ABACUS* + @ if [ -d $(OBJ_DIR) ]; then rm -rf $(OBJ_DIR); fi + @ if [ -d ../bin ]; then rm -rf ../bin; fi diff --git a/ABACUS.develop/source/Makefile.Objects b/ABACUS.develop/source/Makefile.Objects index 20f60ae9bb..bed1c5618c 100644 --- a/ABACUS.develop/source/Makefile.Objects +++ b/ABACUS.develop/source/Makefile.Objects @@ -9,30 +9,26 @@ # machine specific and depend on the local installation. Hence the name. # -#xiaohui modify 2015-03-25 -#VERSION = MESIA-ALPHA VERSION = ABACUS HEADERS = *.h -#xiaohui modified 2013-03-23, adding "#" before OBJS_SELINV -#OBJS_SELINV=selinv.o\ -cal_reduce_rho.o\ -getpolef.o\ -siao_interf.o\ -trace_rho_hs.o\ -chem_pot.o\ - -#OBJS_CG=hpsi_ao.o\ -cg_lcao.o\ -cg_precon.o\ - -OBJS_DC=dc_driv.o\ +OBJS_MAIN=driver.o\ input.o \ +write_input.o\ input_conv.o\ -run_frag.o\ +run_pw.o\ +run_lcao.o\ -OBJS_PW_BASIC=functional.o \ +OBJS_PW=xc_type.o \ xc_functional.o\ +xc_1.o\ +xc_2.o\ +xc_3.o \ +vdwd2.o\ +vdwd2_parameters.o\ +dftd3_subroutine.o\ +vdwd3.o\ +vdwd3_parameters.o\ pseudopot_upf.o\ pseudo_h.o \ pseudo_atom.o \ @@ -41,20 +37,20 @@ pseudo_nc.o \ pseudo_us.o \ pseudopot_cell_vl.o \ pseudopot_cell_vnl.o \ -pseudopot_cell_us.o\ atom_pseudo.o\ unitcell_pseudo.o\ threshold_elec.o\ electrons.o \ forces.o\ -stress.o\ -myfunc1.o\ -myfunc2.o\ -vdwd2.o\ -vdwd2-parameters.o\ -dftd3_subroutine.o\ -vdwd3.o\ -vdwd3-parameters.o\ +stress_pw.o\ +stress_func_cc.o\ +stress_func_gga.o\ +stress_func_kin.o\ +stress_func_nl.o\ +stress_func_ewa.o\ +stress_func_har.o\ +stress_func_loc.o\ +stress_func_print.o\ chi0_hilbert.o\ chi0_standard.o\ epsilon0_pwscf.o\ @@ -62,10 +58,16 @@ epsilon0_vasp.o\ md.o\ mdNVE.o\ mdNVT.o\ +exx_lip.o\ soc.o\ -toWannier90.o \ -unkOverlap_pw.o \ +to_wannier90.o \ +unk_overlap_pw.o \ berryphase.o \ +sto_elec.o\ +sto_wf.o\ +sto_iter.o\ +sto_hchi.o\ +sto_che.o\ OBJS_TOOLS=complexarray.o\ complexmatrix.o \ @@ -73,10 +75,10 @@ realarray.o \ intarray.o\ matrix.o \ matrix3.o\ -sparsematrix.o\ export.o\ timer.o\ memory.o\ +print_info.o\ mathzone.o\ mathzone_add1.o\ integral.o \ @@ -90,117 +92,122 @@ global_function.o \ global_file.o \ element_basis_index.o \ restart.o \ +mymath1.o \ +mymath3.o \ -OBJS_ONSCALING=sltk_grid.o\ +OBJS_LCAO=sltk_grid.o\ sltk_grid_driver.o \ sltk_atom_arrange.o\ sltk_atom.o\ sltk_adjacent_set.o\ sltk_atom_input.o\ -orbital_information_0.o\ -make_gaunt_table.o\ -make_overlap_table.o\ -make_vna_table.o\ -use_overlap_table.o\ -use_overlap_matrix.o\ -use_hamilt_matrix.o\ build_st_pw.o\ grid_technique.o\ grid_meshk.o\ grid_meshcell.o\ grid_bigcell.o\ grid_meshball.o\ -grid_integral.o\ -gint_speed.o\ -gint_speed2.o\ -gint_speed_rho.o\ gint_gamma.o\ gint_gamma_fvl.o\ gint_gamma_vl.o\ gint_gamma_rho.o\ gint_gamma_mull.o\ gint_gamma_env.o \ -gint_gamma_bfield.o\ -gint_gamma_fvna.o\ -gint_gamma_vna.o\ -gint_gamma_vna_d.o\ -gint_gamma_stap.o\ gint_k.o\ gint_k_init.o\ gint_k_vl.o\ gint_k_rho.o\ gint_k_fvl.o\ -gint_k_fvna.o\ -gint_k_vna.o\ -gint_k_vna_d.o\ grid_base.o\ grid_base_beta.o\ -lcao_orbitals.o\ -lcao_vna.o\ -neutral_pot.o \ -numerical_orbital.o\ -numerical_orbital_lm.o\ -numerical_nonlocal.o\ -numerical_nonlocal_lm.o\ -numerical_vna_lm.o\ +ORB_control.o\ +ORB_read.o\ +ORB_atomic.o\ +ORB_atomic_lm.o\ +ORB_nonlocal.o\ +ORB_nonlocal_lm.o\ +ORB_gaunt_table.o\ +ORB_table_beta.o\ +ORB_table_phi.o\ +ORB_table_alpha.o\ +ORB_gen_tables.o\ local_orbital_wfc.o\ -local_orbital_elec.o\ -local_orbital_ions.o\ local_orbital_charge.o\ +ELEC_cbands_k.o\ +ELEC_cbands_gamma.o\ +ELEC_evolve.o\ +ELEC_scf.o\ +ELEC_nscf.o\ +LOOP_cell.o\ +LOOP_elec.o\ +LOOP_ions.o\ +run_md.o\ +DM_gamma.o\ +DM_k.o\ record_adj.o\ -lcao_matrix.o\ -lcao_nnr.o \ istate_charge.o \ istate_envelope.o \ -diago_lcao_matrix.o\ -evolve_lcao_matrix.o\ -bfield.o\ +LCAO_gen_fixedH.o\ +LCAO_hamilt.o\ +LCAO_matrix.o\ +LCAO_nnr.o \ +LCAO_diago.o\ +LCAO_evolve.o\ ylm.o\ -force_lcao.o\ -force_lcao_gamma.o\ -force_lcao_k.o\ -stress_lcao.o\ -local_orbital_pairs.o\ -hamilt_linear.o \ -parallel_atoms.o \ +FORCE_STRESS.o\ +FORCE_gamma.o\ +FORCE_gamma_edm.o\ +FORCE_gamma_vl.o\ +FORCE_gamma_tvnl.o\ +FORCE_k.o\ parallel_orbitals.o \ global_fp.o \ pdiag_double.o \ pdiag_basic.o \ pdiag_common.o \ -hs_matrix.o \ subgrid_oper.o \ GenELPA.o \ +conv_coulomb_pot.o \ +conv_coulomb_pot_k.o \ center2_orb-orb11.o \ center2_orb-orb21.o \ center2_orb-orb22.o \ +abfs.o \ +abfs-vector3_order.o \ +exx_abfs.o \ +exx_abfs-abfs_index.o \ +exx_abfs-dm.o \ +exx_abfs-inverse_matrix_double.o \ +exx_abfs-jle.o \ +exx_abfs-io.o \ +exx_abfs-construct_orbs.o \ +exx_abfs-matrix_orbs11.o \ +exx_abfs-matrix_orbs21.o \ +exx_abfs-matrix_orbs22.o \ +exx_abfs-matrix_lcaoslcaos_lcaoslcaos.o \ +exx_abfs-pca.o \ +exx_abfs-parallel-communicate-function.o \ +exx_abfs-parallel-communicate-dm3.o \ +exx_abfs-parallel-communicate-dm3-allreduce.o \ +exx_abfs-parallel-communicate-hexx.o \ +exx_abfs-parallel-communicate-hexx-allreduce2.o \ +exx_abfs-parallel-distribute-htime.o \ +exx_abfs-parallel-distribute-kmeans.o \ +exx_abfs-parallel-distribute-order.o \ +exx_abfs-util.o \ +exx_abfs-screen-schwarz.o \ +exx_abfs-screen-cauchy.o \ +exx_lcao.o \ +exx_opt_orb.o \ +exx_opt_orb-print.o \ wfc_dm_2d.o \ -unkOverlap_lcao.o \ +unk_overlap_lcao.o \ cal_r_overlap_R.o \ - -OBJS_WANNIER=wan_global.o\ bessel_basis.o\ numerical_basis.o\ +numerical_descriptor.o\ wavefunc_in_pw.o\ -OBJS_EPM=run_epm.o\ -potential_epm.o\ -atom_epm.o\ -unitcell_epm.o\ -so_common.o\ -so_pw.o\ -so_smallbox.o\ -fft_smallbox.o\ -eigen_common.o\ -zeeman.o\ -epm_cg.o\ -epm_fs.o\ -fs_cg.o\ -fs_dav.o\ -nscf_epm.o\ -input.o \ -main.o \ - OBJS_PARALLEL=parallel_global.o\ parallel_kpoints.o\ parallel_common.o\ @@ -209,15 +216,31 @@ parallel_pw.o\ ft.o\ parallel_grid.o\ -OBJS_FIRST_PRINCIPLE=$(OBJS_PW_BASIC)\ -$(OBJS_DC)\ +OBJS_FIRST_PRINCIPLES=$(OBJS_MAIN)\ +$(OBJS_PW)\ +$(OBJS_LCAO)\ charge.o \ charge_mixing.o \ charge_pulay.o \ charge_broyden.o \ charge_extra.o \ -gga_pw.o \ +xc_gga_pw.o \ potential.o \ +H_Ewald_pw.o\ +H_Hartree_pw.o\ +H_XC_pw.o \ +H_TDDFT_pw.o\ +read_rho.o\ +read_atoms.o\ +read_pseudopot.o\ +read_dm.o\ +write_pot.o\ +write_rho.o\ +write_rho_dipole.o\ +write_HS.o\ +write_HS_R.o\ +write_dm.o\ +potential_libxc.o \ efield.o \ magnetism.o\ optical.o\ @@ -229,14 +252,16 @@ ions_move_sd.o\ ions_move_basic.o\ bfgs_basic.o\ occupy.o\ -cal_test0.o\ cal_test.o\ winput.o\ -update_input.o \ +input_update.o\ lattice_change_methods.o \ lattice_change_cg.o \ lattice_change_basic.o \ +variable_cell.o\ dftu.o\ +dftu_yukawa.o\ +dftu_relax.o\ lscc.o\ OBJS_COMMON=atom_spec.o \ @@ -252,8 +277,10 @@ output.o \ dos.o \ inverse_matrix.o \ energy.o \ +energy_dos.o\ wavefunc.o\ wf_io.o \ +rwstream.o\ wf_atomic.o \ wf_igk.o \ use_fft.o\ @@ -262,21 +289,9 @@ global.o \ symmetry.o \ symmetry_basic.o \ symmetry_rho.o \ -symm_book.o \ symm_other.o \ eximport.o \ -Mulliken_Charge.o\ - -OBJS_EXX=exx_pw.o\ -exx_div.o\ - -#OBJS_MLWF=mlwf_kmesh.o\ -mlwf_overlap.o\ -mlwf_optimize.o\ - -OBJS_OTHER=mymath1.o \ -mymath3.o \ -myfunc5.o \ +mulliken_charge.o\ OBJS_PDIAG=pdgseps.o \ pzgseps.o \ @@ -294,7 +309,7 @@ pzt2s.o\ pdtrsm.o\ pzhtrsm.o\ -PDIAG_MR=dcopy.o\ +PDIAG_MR_0=dcopy.o\ dlae2.o\ dlaebz.o\ dlaev2.o\ diff --git a/ABACUS.develop/source/Makefile.system b/ABACUS.develop/source/Makefile.system index c55b85c263..80237901c1 100644 --- a/ABACUS.develop/source/Makefile.system +++ b/ABACUS.develop/source/Makefile.system @@ -4,6 +4,8 @@ include Makefile.vars # LIB and INCLUDE #========================== BOOST_INCLUDE_DIR = ${BOOST_DIR}/include +#BOOST_LIB_DIR = ${BOOST_DIR}/lib +#BOOST_LIB = -L${BOOST_LIB_DIR} -lboost_serialization -lboost_mpi -Wl,-rpath=${BOOST_LIB_DIR} LAPACK_INCLUDE_DIR = ${LAPACK_DIR}/include LAPACK_LIB_DIR = ${LAPACK_DIR}/lib/intel64 @@ -18,18 +20,28 @@ FFTW_LIB_DIR = ${FFTW_DIR}/lib FFTW_LIB = -L${FFTW_LIB_DIR} -lfftw3 -Wl,-rpath=${FFTW_LIB_DIR} ELPA_LIB_DIR = ${ELPA_DIR}/lib +# comment out by mohan 2021-02-06 +#ELPA_LIB = -L${ELPA_LIB_DIR} -lelpa_openmp -Wl,-rpath=${ELPA_LIB_DIR} ELPA_LIB = -L${ELPA_LIB_DIR} -lelpa -Wl,-rpath=${ELPA_LIB_DIR} +LIBXC_INCLUDE_DIR = ${LIBXC_DIR}/include +LIBXC_LIB_DIR = ${LIBXC_DIR}/lib +LIBXC_LIB = -L${LIBXC_LIB_DIR} -lxc -Wl,-rpath=${LIBXC_LIB_DIR} + +CEREAL_INCLUDE_DIR = ${CEREAL_DIR}/include + #========================== # LIBS and INCLUDES #========================== -LIBS = -lifcore -lm -lpthread ${LAPACK_LIB} ${FFTW_LIB} ${ELPA_LIB} -#LIBS = -liomp5 -lpthread -lm -ldl ${LAPACK_LIB} ${FFTW_LIB} ${ELPA_LIB} +# comment out by mohan 2021-02-06 +#LIBS = -lifcore -lm -lpthread ${LAPACK_LIB} ${FFTW_LIB} ${ELPA_LIB} ${LIBXC_LIB} +LIBS = -lifcore -lm -lpthread ${LAPACK_LIB} ${FFTW_LIB} ${ELPA_LIB} +#LIBS = -liomp5 -lpthread -lm -ldl ${BOOST_LIB} ${LAPACK_LIB} ${FFTW_LIB} ${LPA_LIB} ${LIBXC_LIB} -INCLUDES = -I. -Icommands -I${BOOST_INCLUDE_DIR} -I${LAPACK_INCLUDE_DIR} -I${FFTW_INCLUDE_DIR} +INCLUDES = -I. -Icommands -I${BOOST_INCLUDE_DIR} -I${LAPACK_INCLUDE_DIR} -I${FFTW_INCLUDE_DIR} -I${LIBXC_INCLUDE_DIR} -I${CEREAL_INCLUDE_DIR} #========================== # OPTIMIZE OPTIONS #========================== -OPTS = ${INCLUDES} -Ofast -g -traceback -xHost -std=c++11 -simd -march=native -m64 -qopenmp -Werror -Wall -pedantic +OPTS = ${INCLUDES} -Ofast -traceback -std=c++11 -simd -march=native -xHost -m64 -qopenmp -Werror -Wall -pedantic -g OPTS_MPI = -cxx=${CPLUSPLUS} diff --git a/ABACUS.develop/source/Makefile.system.centos7-devel b/ABACUS.develop/source/Makefile.system.centos7-devel deleted file mode 100644 index 41807349e1..0000000000 --- a/ABACUS.develop/source/Makefile.system.centos7-devel +++ /dev/null @@ -1,38 +0,0 @@ -#--------------------------------------------- -# FFTW directories -#--------------------------------------------- -FFTW_INCLUDE=/usr/include -FFTW_LIB_DIR=/usr/lib64 -#--------------------------------------------- -# BOOST directories -#--------------------------------------------- -BOOST_INCLUDE=/usr/include/boost -BOOST_LIB_DIR=/usr/lib64 -#--------------------------------------------- -# LAPACK/BLAS directories -#--------------------------------------------- -#--------------------------------------------- -# LAPACK/BLAS directories -#--------------------------------------------- -BLAS_LAPACK_LIB="${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -Wl,--end-group -lpthread -lm" -# ELPA root directory, may be changed if necessary -ELPA=/opt/elpa -ELPA_LIB=${ELPA}/lib -#ELPA_INCLUDE=${ELPA}/include/elpa-2016.05.004 - -#--------------------------------------------- -# All libraries -#--------------------------------------------- -LIBS = -L${FFTW_LIB_DIR} -L${ELPA_LIB} -L${BOOST_LIB_DIR} -lfftw -lelpa -lifcore -qopenmp "${BLAS_LAPACK_LIB}" - -#--------------------------------------------- -# Compiler flags for all compilers -#--------------------------------------------- -#OPTS = -I. -Icommands -I${BOOST_INCLUDE} -I${FFTW_INCLUDE} -Ofast -xHost -diag-disable=858 -std=c++11 -OPTS = -I. -Icommands -I${BOOST_INCLUDE} -I${FFTW_INCLUDE} -ipo -Ofast -xHost -diag-disable=858 -std=c++11 - -#--------------------------------------------- -# C++ compiler and options -#--------------------------------------------- -CPLUSPLUS = mpiicc -CPLUSPLUS_MPI = mpiicc diff --git a/ABACUS.develop/source/Makefile.vars b/ABACUS.develop/source/Makefile.vars index e1c8800df9..4a9d6c2b19 100644 --- a/ABACUS.develop/source/Makefile.vars +++ b/ABACUS.develop/source/Makefile.vars @@ -1,15 +1,34 @@ FORTRAN = ifort -#CPLUSPLUS = icpc -#CPLUSPLUS_MPI = mpiicpc -CPLUSPLUS = /public/intel2017/bin/icpc -CPLUSPLUS_MPI = /public/intel2017/impi/2017.1.132/intel64/bin/mpiicpc + +CPLUSPLUS = icpc +#CPLUSPLUS = /public/intel2017/bin/icpc + +CPLUSPLUS_MPI = mpiicpc +#CPLUSPLUS_MPI = /public/intel2017/impi/2017.1.132/intel64/bin/mpiicpc + +LAPACK_DIR = $(MKLROOT) #LAPACK_DIR = /public/intel2017/compilers_and_libraries_2017.1.132/linux/mkl #LAPACK_DIR = $(MKLROOT) -LAPACK_DIR = /public/intel2017/mkl +#LAPACK_DIR = /public/intel2017/mkl + +FFTW_DIR = /home/mohan/1_Software/impi_fftw-3.3.8 +#FFTW_DIR = /home/qianrui/intelcompile/impi_fftw #FFTW_DIR = /public/udata/xiaohui/software/fftw2 #FFTW_DIR =/opt/fftw/3.3.6-p12/intel/2017.update4 -FFTW_DIR = /public/fftw-3.3.8 -BOOST_DIR = /public/udata/xiaohui/software/boost_1_39_0 +#FFTW_DIR = /public/fftw-3.3.8 + +BOOST_DIR = /home/mohan/1_Software/impi_boost-1.70.0 +#BOOST_DIR = /home/qianrui/intelcompile/impi_boost +#BOOST_DIR = /public/udata/xiaohui/software/boost_1_39_0 #BOOST_DIR = /opt/boost/1.64.0 -ELPA_DIR = /public/udata/xiaohui/ELPA-2016.05.004 + +ELPA_DIR = /home/mohan/1_Software/impi_elpa-16.05.005 +#ELPA_DIR = /home/qianrui/intelcompile/impi_elpa +#ELPA_DIR = /public/udata/xiaohui/ELPA-2016.05.004 #ELPA_DIR = /opt/elpa/intel_2017_update4 + +CEREAL_DIR = /home/mohan/1_Software/ABACUS_Github/cereal/cereal/ +#CEREAL_DIR = /home/qianrui/intelcompile/cereal/ + +OBJ_DIR = obj +NP = 14 diff --git a/ABACUS.develop/source/README b/ABACUS.develop/source/README new file mode 100644 index 0000000000..191291c344 --- /dev/null +++ b/ABACUS.develop/source/README @@ -0,0 +1,29 @@ +Currently we are working on optimizing the code structure of ABACUS, +implementing new functions, and adding more autotests. + +-- mohan 2021-02-11 + +URGENT: + +Ask Xiaohui Liu: all functions named with 'after_vc' should be reconstructed. +The 'FINAL_SCF' global varialble should be removed. +(condition: need to reconstruct these codes within a given time) + +Ask Xiaohui Liu and Daye Zheng: We need test examples. + +Ask Fuxiang He: we need to remove all TDDFT-related global variables +in global_variable.h, we need TDDFT examples. +(condition: need to reconstruct these codes within a given time) + +Ask Daye Zheng: MD, force, stress modules need reconstruction + +NEED TO DO: + +Ask Xiaohui: we need to remove DQ and NQX in global_variable.h, +but the NQX is computed in ./src_pw/pseudopot_cell_vnl.cpp + +Ask Peize: exx_lip.h and related Exx codes + +QUESTION: + +* in pw_basis.cpp, why ggwfc2=ggwfc if gamma_only is used? diff --git a/ABACUS.develop/source/dc_driv.cpp b/ABACUS.develop/source/dc_driv.cpp deleted file mode 100644 index ed344dee74..0000000000 --- a/ABACUS.develop/source/dc_driv.cpp +++ /dev/null @@ -1,497 +0,0 @@ -#include "dc_driv.h" - -#ifdef __EPM -#include "../src_epm/run_epm.h" -#else -#include "run_frag.h" -#endif - -#include "input.h" -#include "input_conv.h" -#include "src_lcao/global_fp.h" -#include "src_pw/global.h" - -DC_Driv::DC_Driv() -{} - -DC_Driv::~DC_Driv() -{} - -void DC_Driv::init() -{ - TITLE("DC_Driv","init"); - - time_t time_start = std::time(NULL); - - timer::start(); - - // read the parameters. - this->reading(); - -#ifdef __FP - // divide the system into fragments. - this->divide_frag(); - - // setup the information for each fragment. - this->setup_frag(); -#endif - - // solve each fragment. - this->solve_eachf(); - - time_t time_finish= std::time(NULL); - - cout << "\n START Time : " << ctime(&time_start); - cout << " FINISH Time : " << ctime(&time_finish); - cout << " TOTAL Time : " << difftime(time_finish, time_start) << endl; - cout << " SEE INFORMATION IN : "<0) - cout << setw(12) << "Yes"; - } - - cout << endl; - - - - - cout << " ---------------------------------------------------------" << endl; - //if(LOCAL_BASIS==4 && LINEAR_SCALING==1) xiaohui modify 2013-09-01 - if(BASIS_TYPE=="lcao") //xiaohui add 2013-09-01 - { - if(COLOUR && MY_RANK==0) - { - string a = "Use Systematically Improvable Atomic bases"; - //printf( " \e[36m%-45s\e[0m\n", a.c_str()); - printf( " [36m%-45s[0m\n", a.c_str()); - } - else - { - cout << " Use Systematically Improvable Atomic bases" << endl; - } - } - //else if(LOCAL_BASIS==4 && LINEAR_SCALING==0) xiaohui modify 2013-09-01 - else if(BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-01 - { - //cout << " Expand Systematically Improvable Atomic bases into plane waves" << endl; - cout << " Expand Atomic bases into plane waves" << endl; - } - //else if(LOCAL_BASIS==0 && LINEAR_SCALING==0) xiaohui modify 2013-09-01 - else if(BASIS_TYPE=="pw") //xiaohui add 2013-09-01 - { - cout << " Use plane wave basis" << endl; - } - cout << " ---------------------------------------------------------" << endl; - - - - //---------------------------------- - // second part - //---------------------------------- - - cout << " " << setw(8) << "ELEMENT"; - - //if(LOCAL_BASIS==4) xiaohui modify 2013-09-01 - if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-01 - { - cout << setw(16) << "ORBITALS"; - cout << setw(12) << "NBASE"; - //cout << setw(12) << "NATOM"; //move it below 2015-09-06, xiaohui - } - cout << setw(12) << "NATOM"; //add 2015-09-06, xiaohui - - cout << setw(12) << "XC"; - cout << endl; - - - - for(int it=0; itreading(); + + // (2) welcome to the atomic world! + this->atomic_world(); + + // (3) close all of the running logs + INPUT.close_log(); + + return; +} + + +void Driver::reading(void) +{ + timer::tick("Driver","reading",'A'); + + // (1) read INPUT + INPUT.Init( global_in_card ); + + // (2) copy the variables from INPUT to each class + Input_Conv::Convert(); + + // (3) define the 'DIAGONALIZATION' world in MPI + Parallel_Global::split_diag_world(DIAGO_PROC); + Parallel_Global::split_grid_world(DIAGO_PROC); + OUT(ofs_running,"DRANK",DRANK+1); + OUT(ofs_running,"DSIZE",DSIZE); + OUT(ofs_running,"DCOLOR",DCOLOR+1); + OUT(ofs_running,"GRANK",GRANK+1); + OUT(ofs_running,"GSIZE",GSIZE); + +#ifdef __MPI + // (4) divide the NPROC processors into NPOOL for k-points parallelization. + Pkpoints.init_pools(); +#endif + + // (5) Read in parameters about wannier functions. + winput::Init( global_wannier_card ); + + // (6) Print the parameters into INPUT file. + stringstream ss1; + ss1 << global_out_dir << global_in_card; + INPUT.Print( ss1.str() ); + //DONE(ofs_running,"READING CARDS"); + + timer::tick("Driver","reading",'A'); + return; +} + +void Driver::atomic_world(void) +{ + TITLE("Driver","atomic_world"); + + //-------------------------------------------------- + // choose basis sets: + // pw: plane wave basis set + // lcao_in_pw: LCAO expaned by plane wave basis set + // lcao: linear combination of atomic orbitals + //-------------------------------------------------- + if(BASIS_TYPE=="pw" || BASIS_TYPE=="lcao_in_pw") + { + Run_pw::plane_wave_line(); + } + else if(BASIS_TYPE=="lcao") + { + Run_lcao::lcao_line(); + } + + timer::finish( ofs_running ); + + Memory::print_all( ofs_running ) ; + + return; +} diff --git a/ABACUS.develop/source/driver.h b/ABACUS.develop/source/driver.h new file mode 100644 index 0000000000..a1367abb87 --- /dev/null +++ b/ABACUS.develop/source/driver.h @@ -0,0 +1,28 @@ +//========================================================== +// AUTHOR : mohan +// DATE : 2011-06-12 +//========================================================== +#ifndef DRIVER_H +#define DRIVER_H + +class Driver +{ + public: + + Driver(); + ~Driver(); + + void init(); + + private: + + // reading the parameters + void reading(); + + // do stuff, have fun! + void atomic_world(); + + +}; + +#endif diff --git a/ABACUS.develop/source/input.cpp b/ABACUS.develop/source/input.cpp index e058ca7ced..af16488f3f 100644 --- a/ABACUS.develop/source/input.cpp +++ b/ABACUS.develop/source/input.cpp @@ -20,7 +20,9 @@ Input::Input() angle2 = new double[1]; // all values set in Default } -Input::~Input() { + +Input::~Input() +{ delete[] angle1; delete[] angle2; } @@ -58,39 +60,10 @@ void Input::Init(const string &fn) // OTHRE CLASS MEMBER FUNCTION : // NAME : Run::make_dir( dir name : OUT.suffix) //---------------------------------------------------------- - //Global_File::make_dir_out( this->suffix , this->calculation, MY_RANK, this->linear_scaling, this->out_alllog); xiaohui modify 2013-09-01, delete "this->linear_scaling" Global_File::make_dir_out( this->suffix , this->calculation, MY_RANK, this->out_alllog); //xiaohui add 2013-09-01 Check(); time_t time_now = time(NULL); - //xiaohui modify 2015-03-25 - /* - ofs_running << " ------------------------------------------------------------------------------------" << endl; - ofs_running << " " << endl; - ofs_running << " ############ " << endl; - ofs_running << " ################## " << endl; - ofs_running << " ##### #### ##### " << endl; - ofs_running << " ### ########## " << endl; - ofs_running << " ##### ##### ############## ###### ### ############ " << endl; - ofs_running << " ######## ######### ################# #### #### ################ " << endl; - ofs_running << " ########### ###### #### #### ####### #### #### ###### " << endl; - ofs_running << " #### ########## #### #### ###### #### #### ######### #### " << endl; - ofs_running << " #### #### #### #### ########### #### #### ########### #### " << endl; - ofs_running << " #### #### ##### ##### #### #### #### #### " << endl; - ofs_running << " #### #### ################ #### #### ################# " << endl; - ofs_running << " #### #### ############## #### #### ############### " << endl; - ofs_running << " ##### " << endl; - ofs_running << " ###### " << endl; - ofs_running << " #### " << endl; - ofs_running << " " << endl; - ofs_running << " ------------------------------------------------------------------------------------" << endl; - - ofs_running << " " << endl; - ofs_running << " WELCOME TO MESIA " << endl; - ofs_running << " " << endl; - ofs_running << " 'Massive Electronic simulation based on Systematically Improvable Atomic bases' " << endl; - ofs_running << " " << endl; - */ ofs_running << " " << endl; ofs_running << " WELCOME TO ABACUS " << endl; ofs_running << " " << endl; @@ -102,7 +75,6 @@ void Input::Init(const string &fn) ofs_running << setiosflags(ios::right); - #ifdef __MPI //ofs_running << " Version: Parallel, under ALPHA test" << endl; ofs_running << " Version: Parallel, in development" << endl; @@ -145,16 +117,16 @@ void Input::Default(void) pseudo_dir = ""; pseudo_type = "auto"; // mohan add 2013-05-20 (xiaohui add 2013-06-23) wannier_card = ""; - epm_pseudo_card = ""; latname = "test"; //xiaohui modify 2015-09-15, relax -> scf //calculation = "relax"; calculation = "scf"; ntype = 0; nbands = 0; + nbands_sto = 0; nbands_istate = 5; + nche_sto = 0; npool = 1; - epm_spin_orbital = 0; berry_phase = false; gdir = 3; towannier90 = false; @@ -167,14 +139,6 @@ void Input::Default(void) eopreg = 0.1; eamp = 0.001; // (a.u. = 51.44 * 10^10 V/m ) - bfield = 0; - bfield_teslax = 0.0; - bfield_teslay = 0.0; - bfield_teslaz = 0.0; - bfield_gauge_x = 0.0; - bfield_gauge_y = 0.0; - bfield_gauge_z = 0.0; - opt_epsilon2 = false;//mohan add 2010-03-24 opt_nbands = 0; lda_plus_u = false; @@ -195,12 +159,8 @@ void Input::Default(void) ks_solver = "default"; //xiaohui add 2013-09-01 search_radius=-1.0; // unit: a.u. -1.0 has no meaning. search_pbc=true; - sparse_matrix=false; - atom_distribution=0; symmetry=false; mlwf_flag=false; - vna = 0; - grid_speed=1; //mohan add 2012-03-29 force=0; force_set=false; force_thr=1.0e-3; @@ -252,10 +212,8 @@ void Input::Default(void) t_in_h = 1; vl_in_h = 1; vnl_in_h = 1; - zeeman_in_h = 1; test_force = 0; test_stress = 0; - fs_ref_energy = 0.0; //---------------------------------------------------------- // iteration //---------------------------------------------------------- @@ -287,10 +245,14 @@ void Input::Default(void) charge_extrap = "atomic";//xiaohui modify 2015-02-01 out_charge = 0; out_dm = 0; + + out_descriptor = 0; // caoyu added 2020-11-24, mohan added 2021-01-03 + lmax_descriptor = 2; // mohan added 2021-01-03 + out_potential = 0; out_wf = false; out_dos = 0; - out_band = 0; + out_band = 0; out_hs = 0; out_hs2 = 0; //LiuXh add 2019-07-15 out_r_matrix = 0; // jingan add 2019-8-14 @@ -299,7 +261,7 @@ void Input::Default(void) dos_emin_ev = -15;//(ev) dos_emax_ev = 15;//(ev) dos_edelta_ev = 0.01;//(ev) - b_coef = 0.07; + b_coef = 0.07; //---------------------------------------------------------- // LCAO //---------------------------------------------------------- @@ -308,12 +270,6 @@ void Input::Default(void) lcao_dr = 0.01; lcao_rmax = 30; // (a.u.) //---------------------------------------------------------- -// Divide and Conqure -//---------------------------------------------------------- - dc_nx = 1; - dc_ny = 1; - dc_nz = 1; -//---------------------------------------------------------- // Selinv //---------------------------------------------------------- selinv_npole = 40; @@ -335,27 +291,27 @@ void Input::Default(void) md_tstep=1; //reduec md_delt every md_tstep step. md_delt=1.0; */ -//md and related parameters(added by zheng da ye) - md_mdtype=1; - md_tauthermo=0; - md_taubaro=0; - md_dt=-1; - md_nresn=3; - md_nyosh=3; - md_qmass=1; - md_tfirst=-1; //kelvin - md_tlast=md_tfirst; - md_dumpmdfred=1; - md_mdoutpath="mdoutput"; + //md and related parameters(added by zheng da ye) + md_mdtype=1; + md_tauthermo=0; + md_taubaro=0; + md_dt=-1; + md_nresn=3; + md_nyosh=3; + md_qmass=1; + md_tfirst=-1; //kelvin + md_tlast=md_tfirst; + md_dumpmdfred=1; + md_mdoutpath="mdoutput"; md_domsd=0; - md_domsdatom=0; - md_rstmd=0; - md_outputstressperiod=1; - md_fixtemperature=1; - md_ediff=1e-4; + md_domsdatom=0; + md_rstmd=0; + md_outputstressperiod=1; + md_fixtemperature=1; + md_ediff=1e-4; md_ediffg=1e-3; - md_msdstartTime=1; -//end of zhengdaye's add. + md_msdstartTime=1; + //end of zhengdaye's add. /* //---------------------------------------------------------- // vdwD2 //Peize Lin add 2014-03-31, update 2015-09-30 @@ -396,46 +352,75 @@ void Input::Default(void) //----------------------------------------------------------- // spectrum // pengfei Li add 2016-11-23 //----------------------------------------------------------- - //epsilon=false; - //epsilon_choice=0; - spectral_type="None"; - spectral_method=0; - kernel_type="rpa"; - eels_method=0; - absorption_method=0; - system="bulk"; - eta=0.05; - domega=0.01; - nomega=300; - ecut_chi=1; - //oband=1; - q_start[0]=0.1; q_start[1]=0.1; q_start[2]=0.1; - q_direct[0]=1; q_direct[1]=0; q_direct[2]=0; - //start_q=1; - //interval_q=1; - nq=1; - out_epsilon=true; - out_chi=false; - out_chi0=false; - fermi_level=0.0; - coulomb_cutoff=false; - - kmesh_interpolation=false; - for(int i=0; i<100; i++) - { - qcar[i][0] = 0.0; qcar[i][1] = 0.0; qcar[i][2] = 0.0; - } - - lcao_box[0] = 10; lcao_box[1] = 10; lcao_box[2] = 10; + //epsilon=false; + //epsilon_choice=0; + spectral_type="None"; + spectral_method=0; + kernel_type="rpa"; + eels_method=0; + absorption_method=0; + system="bulk"; + eta=0.05; + domega=0.01; + nomega=300; + ecut_chi=1; + //oband=1; + q_start[0]=0.1; q_start[1]=0.1; q_start[2]=0.1; + q_direct[0]=1; q_direct[1]=0; q_direct[2]=0; + //start_q=1; + //interval_q=1; + nq=1; + out_epsilon=true; + out_chi=false; + out_chi0=false; + fermi_level=0.0; + coulomb_cutoff=false; + + kmesh_interpolation=false; + for(int i=0; i<100; i++) + { + qcar[i][0] = 0.0; qcar[i][1] = 0.0; qcar[i][2] = 0.0; + } + + lcao_box[0] = 10; lcao_box[1] = 10; lcao_box[2] = 10; + + //epsilon0 = false; + //intersmear = 0.01; + intrasmear = 0.0; + shift = 0.0; + metalcalc = false; + eps_degauss = 0.01; + + //epsilon0_choice = 0; + +//---------------------------------------------------------- +// exx //Peize Lin add 2018-06-20 +//---------------------------------------------------------- + exx_hybrid_type = "no"; + + exx_hybrid_alpha = 0.25; + exx_hse_omega = 0.11; - //epsilon0 = false; - //intersmear = 0.01; - intrasmear = 0.0; - shift = 0.0; - metalcalc = false; - eps_degauss = 0.01; + exx_separate_loop = true; + exx_hybrid_step = 100; - //epsilon0_choice = 0; + exx_lambda = 0.3; + + exx_pca_threshold = 0; + exx_c_threshold = 0; + exx_v_threshold = 0; + exx_dm_threshold = 0; + exx_schwarz_threshold = 0; + exx_cauchy_threshold = 0; + exx_ccp_threshold = 1E-8; + exx_ccp_rmesh_times = 10; + + exx_distribute_type = "htime"; + + exx_opt_orb_lmax = 0; + exx_opt_orb_ecut = 0.0; + exx_opt_orb_tolerence = 0.0; + //added by zhengdy-soc noncolin = false; lspinorb = false; @@ -457,7 +442,7 @@ void Input::Default(void) val_elec_03=1; vext=0; vext_dire=1; - + //---------------------------------------------------------- //Fuxiang He add 2016-10-26 // constrained DFT //---------------------------------------------------------- @@ -466,14 +451,14 @@ void Input::Default(void) ocp_set = "none"; // for(int i=0; i<10000; i++) // { - // ocp_kb[i] = 0.0; + // ocp_kb[i] = 0.0; // } - - cell_factor = 1.2; //LiuXh add 20180619 - - newDM=0; // Shen Yu add 2019/5/9 - mulliken=0;// qi feng add 2019/9/10 - + + cell_factor = 1.2; //LiuXh add 20180619 + + newDM=1; // Shen Yu add 2019/5/9 + mulliken=0;// qi feng add 2019/9/10 + //---------------------------------------------------------- //Peize Lin add 2020-04-04 // restart //---------------------------------------------------------- @@ -568,10 +553,6 @@ bool Input::Read(const string &fn) { read_value(ifs, wannier_card); } - else if (strcmp("epm_pseudo_card",word) == 0 ) - { - read_value(ifs, epm_pseudo_card); - } else if (strcmp("latname", word) == 0)// which material { read_value(ifs, latname); @@ -588,33 +569,21 @@ bool Input::Read(const string &fn) { read_value(ifs, nbands); } - else if (strcmp("nbands_istate", word) == 0)// number of atom bands + else if (strcmp("nbands_sto", word) == 0)//number of stochastic bands { - read_value(ifs, nbands_istate); + read_value(ifs, nbands_sto); } - else if (strcmp("npool", word) == 0)// number of pools - { - read_value(ifs, npool); - } - else if (strcmp("epm_spin_orbital", word) == 0) - { - read_value(ifs, epm_spin_orbital); - } - else if (strcmp("epm_zeeman", word) == 0) - { - read_value(ifs, epm_zeeman); - } - else if (strcmp("epm_mag_field_x", word) == 0) + else if (strcmp("nbands_istate", word) == 0)// number of atom bands { - read_value(ifs, epm_mag_field_x); + read_value(ifs, nbands_istate); } - else if (strcmp("epm_mag_field_y", word) == 0) + else if (strcmp("nche_sto", word) == 0)// Chebyshev expansion order { - read_value(ifs, epm_mag_field_y); + read_value(ifs, nche_sto); } - else if (strcmp("epm_mag_field_z", word) == 0) + else if (strcmp("npool", word) == 0)// number of pools { - read_value(ifs, epm_mag_field_z); + read_value(ifs, npool); } else if (strcmp("berry_phase", word) == 0)// berry phase calculation { @@ -656,34 +625,6 @@ bool Input::Read(const string &fn) { read_value(ifs, eamp); } - else if (strcmp("bfield", word) == 0)// magnetic B field - { - read_value(ifs, bfield); - } - else if (strcmp("bfield_teslax", word) == 0)// magnetic Bx field - { - read_value(ifs, bfield_teslax); - } - else if (strcmp("bfield_teslay", word) == 0)// magnetic By field - { - read_value(ifs, bfield_teslay); - } - else if (strcmp("bfield_teslaz", word) == 0)// magnetic Bz field - { - read_value(ifs, bfield_teslaz); - } - else if (strcmp("bfield_gauge_x", word) == 0)// origin of magnetic Bz field - { - read_value(ifs, bfield_gauge_x); - } - else if (strcmp("bfield_gauge_y", word) == 0)// origin of magnetic Bz field - { - read_value(ifs, bfield_gauge_y); - } - else if (strcmp("bfield_gauge_z", word) == 0)// origin of magnetic Bz field - { - read_value(ifs, bfield_gauge_z); - } else if (strcmp("opt_epsilon2", word) == 0)// optical field { read_value(ifs, opt_epsilon2); @@ -747,14 +688,6 @@ bool Input::Read(const string &fn) { read_value(ifs, search_pbc); } - else if (strcmp("sparse_matrix", word) == 0) - { - read_value(ifs, sparse_matrix); - } - else if (strcmp("atom_distribution", word) == 0) - { - read_value(ifs, atom_distribution); - } else if (strcmp("symmetry", word) == 0) { read_value(ifs, symmetry); @@ -763,14 +696,6 @@ bool Input::Read(const string &fn) { read_value(ifs, mlwf_flag); } - else if (strcmp("vna", word) == 0) - { - read_value(ifs, vna); - } - else if (strcmp("grid_speed", word) == 0)//mohan 2012-03-29 - { - read_value(ifs, grid_speed); - } else if (strcmp("force", word) == 0) { read_value(ifs, force); @@ -945,10 +870,6 @@ bool Input::Read(const string &fn) { read_value(ifs, vnl_in_h); } - else if (strcmp("zeeman_in_h", word) == 0) - { - read_value(ifs, zeeman_in_h); - } else if (strcmp("test_force", word) == 0) { read_value(ifs, test_force); @@ -957,15 +878,6 @@ bool Input::Read(const string &fn) { read_value(ifs, test_stress); } - else if (strcmp("fs_ref_energy_ev", word) == 0) - { - read_value(ifs, fs_ref_energy); - fs_ref_energy = fs_ref_energy / Ry_to_eV; - } - else if (strcmp("fs_ref_energy_ry", word) == 0) - { - read_value(ifs, fs_ref_energy); - } //---------------------------------------------------------- // iteration //---------------------------------------------------------- @@ -1065,6 +977,14 @@ bool Input::Read(const string &fn) { read_value(ifs, out_dm); } + else if (strcmp("out_descriptor", word) == 0) // caoyu added 2020-11-24, mohan modified 2021-01-03 + { + read_value(ifs, out_descriptor); + } + else if (strcmp("lmax_descriptor", word) == 0)// mohan added 2021-01-03 + { + read_value(ifs, lmax_descriptor); + } else if (strcmp("out_potential", word) == 0) { read_value(ifs, out_potential); @@ -1141,19 +1061,6 @@ bool Input::Read(const string &fn) { read_value(ifs, lcao_rmax); } -// Divide&Conqure - else if (strcmp("dc_nx", word) == 0) - { - read_value(ifs, dc_nx); - } - else if (strcmp("dc_ny", word) == 0) - { - read_value(ifs, dc_ny); - } - else if (strcmp("dc_nz", word) == 0) - { - read_value(ifs, dc_nz); - } else if (strcmp("selinv_npole", word) == 0) { read_value(ifs, selinv_npole); @@ -1336,49 +1243,49 @@ bool Input::Read(const string &fn) // Peize Lin add 2014-03-31 //---------------------------------------------------------- else if (strcmp("vdwd2", word) == 0) - { - read_value(ifs, vdwD2); - } - else if (strcmp("vdwd2_scaling", word) == 0) - { - read_value(ifs, vdwD2_scaling); - } - else if (strcmp("vdwd2_d", word) == 0) - { - read_value(ifs, vdwD2_d); - } - else if (strcmp("vdwd2_c6_file", word) == 0) - { - read_value(ifs, vdwD2_C6_file); - } - else if (strcmp("vdwd2_c6_unit", word) == 0) - { - read_value(ifs, vdwD2_C6_unit); - } - else if (strcmp("vdwd2_r0_file", word) == 0) - { - read_value(ifs, vdwD2_R0_file); - } - else if (strcmp("vdwd2_r0_unit", word) == 0) - { - read_value(ifs, vdwD2_R0_unit); - } - else if (strcmp("vdwd2_model", word) == 0) - { - read_value(ifs, vdwD2_model); - } - else if (strcmp("vdwd2_period", word) == 0) - { + { + read_value(ifs, vdwD2); + } + else if (strcmp("vdwd2_scaling", word) == 0) + { + read_value(ifs, vdwD2_scaling); + } + else if (strcmp("vdwd2_d", word) == 0) + { + read_value(ifs, vdwD2_d); + } + else if (strcmp("vdwd2_c6_file", word) == 0) + { + read_value(ifs, vdwD2_C6_file); + } + else if (strcmp("vdwd2_c6_unit", word) == 0) + { + read_value(ifs, vdwD2_C6_unit); + } + else if (strcmp("vdwd2_r0_file", word) == 0) + { + read_value(ifs, vdwD2_R0_file); + } + else if (strcmp("vdwd2_r0_unit", word) == 0) + { + read_value(ifs, vdwD2_R0_unit); + } + else if (strcmp("vdwd2_model", word) == 0) + { + read_value(ifs, vdwD2_model); + } + else if (strcmp("vdwd2_period", word) == 0) + { ifs >> vdwD2_period.x >> vdwD2_period.y; - read_value(ifs, vdwD2_period.z); - } - else if (strcmp("vdwd2_radius", word) == 0) - { - read_value(ifs, vdwD2_radius); - } - else if (strcmp("vdwd2_radius_unit", word) == 0) - { - read_value(ifs, vdwD2_radius_unit); + read_value(ifs, vdwD2_period.z); + } + else if (strcmp("vdwd2_radius", word) == 0) + { + read_value(ifs, vdwD2_radius); + } + else if (strcmp("vdwd2_radius_unit", word) == 0) + { + read_value(ifs, vdwD2_radius_unit); } */ //---------------------------------------------------------- // vdw @@ -1452,7 +1359,7 @@ bool Input::Read(const string &fn) { ifs >> vdw_period.x >> vdw_period.y; read_value(ifs, vdw_period.z); - } + } //-------------------------------------------------------- // restart Peize Lin 2020-04-04 //-------------------------------------------------------- @@ -1467,109 +1374,109 @@ bool Input::Read(const string &fn) //-------------------------------------------------------- // epsilon pengfei Li 2016-11-23 //-------------------------------------------------------- - //else if (strcmp("epsilon", word) == 0) - //{ - // read_value(ifs, epsilon); - //} - //else if (strcmp("epsilon_choice", word) == 0) - //{ - // read_value(ifs, epsilon_choice); - //} + //else if (strcmp("epsilon", word) == 0) + //{ + // read_value(ifs, epsilon); + //} + //else if (strcmp("epsilon_choice", word) == 0) + //{ + // read_value(ifs, epsilon_choice); + //} else if (strcmp("spectral_type", word) == 0) - { - read_value(ifs, spectral_type); - } + { + read_value(ifs, spectral_type); + } else if (strcmp("spectral_method", word) == 0) - { - read_value(ifs, spectral_method); - } + { + read_value(ifs, spectral_method); + } else if (strcmp("kernel_type", word) == 0) - { - read_value(ifs, kernel_type); - } + { + read_value(ifs, kernel_type); + } else if (strcmp("eels_method", word) == 0) - { - read_value(ifs, eels_method); - } + { + read_value(ifs, eels_method); + } else if (strcmp("absorption_method", word) == 0) - { - read_value(ifs, absorption_method); - } - else if (strcmp("system", word) == 0) - { - read_value(ifs, system); - } - else if (strcmp("eta", word) == 0) - { - read_value(ifs, eta); - } - else if (strcmp("domega", word) == 0) - { - read_value(ifs, domega); - } - else if (strcmp("nomega", word) == 0) - { - read_value(ifs, nomega); - } - else if (strcmp("ecut_chi", word) == 0) - { - read_value(ifs, ecut_chi); - } - //else if (strcmp("oband", word) == 0) - //{ - // read_value(ifs, oband); - //} - else if (strcmp("q_start", word) == 0) - { + { + read_value(ifs, absorption_method); + } + else if (strcmp("system", word) == 0) + { + read_value(ifs, system); + } + else if (strcmp("eta", word) == 0) + { + read_value(ifs, eta); + } + else if (strcmp("domega", word) == 0) + { + read_value(ifs, domega); + } + else if (strcmp("nomega", word) == 0) + { + read_value(ifs, nomega); + } + else if (strcmp("ecut_chi", word) == 0) + { + read_value(ifs, ecut_chi); + } + //else if (strcmp("oband", word) == 0) + //{ + // read_value(ifs, oband); + //} + else if (strcmp("q_start", word) == 0) + { ifs >> q_start[0]; ifs >> q_start[1]; read_value(ifs, q_start[2]); - } - else if (strcmp("q_direction", word) == 0) - { + } + else if (strcmp("q_direction", word) == 0) + { ifs >> q_direct[0]; ifs >> q_direct[1]; read_value(ifs, q_direct[2]); - } - //else if (strcmp("start_q", word) == 0) - //{ - // read_value(ifs, start_q); - //} - //else if (strcmp("interval_q", word) == 0) - //{ - // read_value(ifs, interval_q); - //} - else if (strcmp("nq", word) == 0) - { - read_value(ifs, nq); - } - else if (strcmp("out_epsilon", word) == 0) - { - read_value(ifs, out_epsilon); - } - else if (strcmp("out_chi", word) == 0) - { - read_value(ifs, out_chi); - } - else if (strcmp("out_chi0", word) == 0) - { - read_value(ifs, out_chi0); - } - else if (strcmp("fermi_level", word) == 0) - { - read_value(ifs, fermi_level); - } - else if (strcmp("coulomb_cutoff", word) == 0) - { - read_value(ifs, coulomb_cutoff); - } - else if (strcmp("kmesh_interpolation", word) == 0) - { - read_value(ifs, kmesh_interpolation); - } - else if (strcmp("qcar", word) == 0) - { - for(int i=0; i> qcar[i][0]; ifs >> qcar[i][1]; read_value(ifs, qcar[i][2]); - } - } + } + //else if (strcmp("start_q", word) == 0) + //{ + // read_value(ifs, start_q); + //} + //else if (strcmp("interval_q", word) == 0) + //{ + // read_value(ifs, interval_q); + //} + else if (strcmp("nq", word) == 0) + { + read_value(ifs, nq); + } + else if (strcmp("out_epsilon", word) == 0) + { + read_value(ifs, out_epsilon); + } + else if (strcmp("out_chi", word) == 0) + { + read_value(ifs, out_chi); + } + else if (strcmp("out_chi0", word) == 0) + { + read_value(ifs, out_chi0); + } + else if (strcmp("fermi_level", word) == 0) + { + read_value(ifs, fermi_level); + } + else if (strcmp("coulomb_cutoff", word) == 0) + { + read_value(ifs, coulomb_cutoff); + } + else if (strcmp("kmesh_interpolation", word) == 0) + { + read_value(ifs, kmesh_interpolation); + } + else if (strcmp("qcar", word) == 0) + { + for(int i=0; i> qcar[i][0]; ifs >> qcar[i][1]; read_value(ifs, qcar[i][2]); + } + } else if (strcmp("ocp", word) == 0) { read_value(ifs, ocp); @@ -1577,7 +1484,7 @@ bool Input::Read(const string &fn) else if (strcmp("ocp_set", word) == 0) { getline(ifs, ocp_set); - ifs.ignore(150, '\n'); +// ifs.ignore(150, '\n'); } // else if (strcmp("ocp_n", word) == 0) // { @@ -1595,34 +1502,114 @@ bool Input::Read(const string &fn) { read_value(ifs, mulliken); }//qifeng add 2019/9/10 - else if (strcmp("supercell_scale", word) == 0) + else if (strcmp("supercell_scale", word) == 0) + { + ifs >> lcao_box[0]; ifs >> lcao_box[1]; + read_value(ifs, lcao_box[2]); + } + //else if (strcmp("epsilon0", word) == 0) + //{ + // read_value(ifs, epsilon0); + //} + //else if (strcmp("intersmear", word) == 0) + //{ + // read_value(ifs, intersmear); + //} + else if (strcmp("intrasmear", word) == 0) + { + read_value(ifs, intrasmear); + } + else if (strcmp("shift", word) == 0) + { + read_value(ifs, shift); + } + else if (strcmp("metalcalc", word) == 0) + { + read_value(ifs, metalcalc); + } + else if (strcmp("eps_degauss", word) == 0) + { + read_value(ifs, eps_degauss); + } + //else if (strcmp("epsilon0_choice", word) == 0) + //{ + // read_value(ifs, epsilon0_choice); + //} +//---------------------------------------------------------- +// exx +// Peize Lin add 2018-06-20 +//---------------------------------------------------------- + else if (strcmp("exx_hybrid_type", word) == 0) + { + read_value(ifs, exx_hybrid_type); + } + else if (strcmp("exx_hybrid_alpha", word) == 0) { - ifs >> lcao_box[0]; ifs >> lcao_box[1]; - read_value(ifs, lcao_box[2]); - } - //else if (strcmp("epsilon0", word) == 0) - //{ - // read_value(ifs, epsilon0); - //} - //else if (strcmp("intersmear", word) == 0) - //{ - // read_value(ifs, intersmear); - //} - else if (strcmp("intrasmear", word) == 0) + read_value(ifs, exx_hybrid_alpha); + } + else if (strcmp("exx_hse_omega", word) == 0) + { + read_value(ifs, exx_hse_omega); + } + else if (strcmp("exx_separate_loop", word) == 0) + { + read_value(ifs, exx_separate_loop); + } + else if (strcmp("exx_hybrid_step", word) == 0) + { + read_value(ifs, exx_hybrid_step); + } + else if (strcmp("exx_lambda", word) == 0) + { + read_value(ifs, exx_lambda); + } + else if (strcmp("exx_pca_threshold", word) == 0) + { + read_value(ifs, exx_pca_threshold); + } + else if (strcmp("exx_c_threshold", word) == 0) { - read_value(ifs, intrasmear); + read_value(ifs, exx_c_threshold); + } + else if (strcmp("exx_v_threshold", word) == 0) + { + read_value(ifs, exx_v_threshold); + } + else if (strcmp("exx_dm_threshold", word) == 0) + { + read_value(ifs, exx_dm_threshold); + } + else if (strcmp("exx_schwarz_threshold", word) == 0) + { + read_value(ifs, exx_schwarz_threshold); + } + else if (strcmp("exx_cauchy_threshold", word) == 0) + { + read_value(ifs, exx_cauchy_threshold); + } + else if (strcmp("exx_ccp_threshold", word) == 0) + { + read_value(ifs, exx_ccp_threshold); + } + else if (strcmp("exx_ccp_rmesh_times", word) == 0) + { + read_value(ifs, exx_ccp_rmesh_times); + } + else if (strcmp("exx_distribute_type", word) == 0) + { + read_value(ifs, exx_distribute_type); } - else if (strcmp("shift", word) == 0) + else if (strcmp("exx_opt_orb_lmax", word) == 0) { - read_value(ifs, shift); + read_value(ifs, exx_opt_orb_lmax); } - else if (strcmp("metalcalc", word) == 0) + else if (strcmp("exx_opt_orb_ecut", word) == 0) { - read_value(ifs, metalcalc); - } - else if (strcmp("eps_degauss", word) == 0) + read_value(ifs, exx_opt_orb_ecut); + } + else if (strcmp("exx_opt_orb_tolerence", word) == 0) { - read_value(ifs, eps_degauss); + read_value(ifs, exx_opt_orb_tolerence); } else if (strcmp("noncolin", word) == 0) { @@ -1697,9 +1684,9 @@ bool Input::Read(const string &fn) cout<<" THE PARAMETER NAME '" << word << "' IS NOT USED!" << endl; } // mohan screen this 2012-06-30 -// cout << " THE PARAMETER NAME '" << word -// << "' IS NOT USED!" << endl; - ifs.ignore(150, '\n'); +// cout << " THE PARAMETER NAME '" << word +// << "' IS NOT USED!" << endl; + ifs.ignore(150, '\n'); } ifs.rdstate(); @@ -1951,14 +1938,14 @@ void Input::Bcast() Parallel_Common::bcast_string( pseudo_type ); // mohan add 2013-05-20 (xiaohui add 2013-06-23) Parallel_Common::bcast_string( kpoint_file );//xiaohui modify 2015-02-01 Parallel_Common::bcast_string( wannier_card ); - Parallel_Common::bcast_string( epm_pseudo_card ); Parallel_Common::bcast_string( latname ); Parallel_Common::bcast_string( calculation ); Parallel_Common::bcast_int( ntype ); Parallel_Common::bcast_int( nbands ); + Parallel_Common::bcast_int( nbands_sto ); Parallel_Common::bcast_int( nbands_istate ); + Parallel_Common::bcast_int( nche_sto ); Parallel_Common::bcast_int( npool ); - Parallel_Common::bcast_int( epm_spin_orbital ); Parallel_Common::bcast_bool( berry_phase ); Parallel_Common::bcast_int( gdir ); Parallel_Common::bcast_bool(towannier90); @@ -1971,13 +1958,6 @@ void Input::Bcast() Parallel_Common::bcast_double( eamp ); - Parallel_Common::bcast_int( bfield ); - Parallel_Common::bcast_double( bfield_teslax ); - Parallel_Common::bcast_double( bfield_teslay ); - Parallel_Common::bcast_double( bfield_teslaz ); - Parallel_Common::bcast_double( bfield_gauge_x );//sunzhiyuan - Parallel_Common::bcast_double( bfield_gauge_y ); - Parallel_Common::bcast_double( bfield_gauge_z ); Parallel_Common::bcast_bool( opt_epsilon2 ); Parallel_Common::bcast_int( opt_nbands ); Parallel_Common::bcast_bool( lda_plus_u ); @@ -1989,19 +1969,13 @@ void Input::Bcast() Parallel_Common::bcast_double( tot_magnetization ); - //Parallel_Common::bcast_int( local_basis ); xiaohui modify 2013-09-01 Parallel_Common::bcast_string( basis_type ); //xiaohui add 2013-09-01 - //Parallel_Common::bcast_int ( linear_scaling ); xiaohui modify 2013-09-01 Parallel_Common::bcast_string( ks_solver ); //xiaohui add 2013-09-01 Parallel_Common::bcast_double( search_radius ); Parallel_Common::bcast_bool( search_pbc ); - Parallel_Common::bcast_bool ( sparse_matrix ); - Parallel_Common::bcast_int ( atom_distribution ); Parallel_Common::bcast_double( search_radius ); Parallel_Common::bcast_bool( symmetry ); Parallel_Common::bcast_bool( mlwf_flag ); - Parallel_Common::bcast_int( vna ); - Parallel_Common::bcast_int( grid_speed );//mohan add 2012-03-29 Parallel_Common::bcast_int( force ); Parallel_Common::bcast_bool( force_set ); Parallel_Common::bcast_double( force_thr); @@ -2022,7 +1996,6 @@ void Input::Bcast() Parallel_Common::bcast_double( trust_radius_min); Parallel_Common::bcast_double( trust_radius_ini); - //Parallel_Common::bcast_bool( gamma_only ); Parallel_Common::bcast_bool( gamma_only ); Parallel_Common::bcast_bool( gamma_only_local ); Parallel_Common::bcast_double( ecutwfc ); @@ -2037,7 +2010,6 @@ void Input::Bcast() Parallel_Common::bcast_int( by ); Parallel_Common::bcast_int( bz ); - //Parallel_Common::bcast_string( diago_type ); xiaohui modify 2013-09-01 Parallel_Common::bcast_int( diago_proc ); //mohan add 2012-01-03 Parallel_Common::bcast_int( diago_cg_maxiter ); Parallel_Common::bcast_int( diago_cg_prec ); @@ -2049,13 +2021,10 @@ void Input::Bcast() Parallel_Common::bcast_int( t_in_h ); Parallel_Common::bcast_int( vl_in_h ); Parallel_Common::bcast_int( vnl_in_h ); - Parallel_Common::bcast_int( zeeman_in_h ); Parallel_Common::bcast_int( test_force ); Parallel_Common::bcast_int( test_stress ); - Parallel_Common::bcast_double( fs_ref_energy ); - Parallel_Common::bcast_double( dr2 ); Parallel_Common::bcast_int( niter ); Parallel_Common::bcast_int( nstep ); @@ -2078,6 +2047,9 @@ void Input::Bcast() Parallel_Common::bcast_string( charge_extrap );//xiaohui modify 2015-02-01 Parallel_Common::bcast_int( out_charge ); Parallel_Common::bcast_int( out_dm ); + Parallel_Common::bcast_int( out_descriptor ); // caoyu added 2020-11-24, mohan modified 2021-01-03 + Parallel_Common::bcast_int( lmax_descriptor ); // mohan modified 2021-01-03 + Parallel_Common::bcast_int( out_potential ); Parallel_Common::bcast_bool( out_wf ); Parallel_Common::bcast_int( out_dos ); @@ -2099,11 +2071,6 @@ void Input::Bcast() Parallel_Common::bcast_double( lcao_dr ); Parallel_Common::bcast_double( lcao_rmax ); - // mohan add 2011-06-12 - Parallel_Common::bcast_int( dc_nx ); - Parallel_Common::bcast_int( dc_ny ); - Parallel_Common::bcast_int( dc_nz ); - // mohan add 2011-09-28 Parallel_Common::bcast_int( selinv_npole); Parallel_Common::bcast_double( selinv_temp); @@ -2186,41 +2153,41 @@ void Input::Bcast() Parallel_Common::bcast_double(td_force_dt); Parallel_Common::bcast_int(vext); Parallel_Common::bcast_int(vext_dire); - // pengfei Li add 2016-11-23 - //Parallel_Common::bcast_bool( epsilon ); - //Parallel_Common::bcast_int( epsilon_choice ); - Parallel_Common::bcast_string( spectral_type ); - Parallel_Common::bcast_int( spectral_method ); - Parallel_Common::bcast_string( kernel_type ); - Parallel_Common::bcast_int( eels_method ); - Parallel_Common::bcast_int( absorption_method ); - Parallel_Common::bcast_string( system ); - Parallel_Common::bcast_double( eta ); - Parallel_Common::bcast_double( domega ); - Parallel_Common::bcast_int( nomega ); - Parallel_Common::bcast_int( ecut_chi ); - //Parallel_Common::bcast_int( oband ); - Parallel_Common::bcast_double( q_start[0]); - Parallel_Common::bcast_double( q_start[1]); - Parallel_Common::bcast_double( q_start[2]); - Parallel_Common::bcast_double( q_direct[0]); - Parallel_Common::bcast_double( q_direct[1]); - Parallel_Common::bcast_double( q_direct[2]); - //Parallel_Common::bcast_int( start_q ); - //Parallel_Common::bcast_int( interval_q ); - Parallel_Common::bcast_int( nq ); - Parallel_Common::bcast_bool( out_epsilon ); - Parallel_Common::bcast_bool( out_chi ); - Parallel_Common::bcast_bool( out_chi0 ); - Parallel_Common::bcast_double( fermi_level ); - Parallel_Common::bcast_bool( coulomb_cutoff ); - Parallel_Common::bcast_bool( kmesh_interpolation ); - for(int i=0; i<100; i++) - { - Parallel_Common::bcast_double( qcar[i][0] ); - Parallel_Common::bcast_double( qcar[i][1] ); - Parallel_Common::bcast_double( qcar[i][2] ); - } + // pengfei Li add 2016-11-23 + //Parallel_Common::bcast_bool( epsilon ); + //Parallel_Common::bcast_int( epsilon_choice ); + Parallel_Common::bcast_string( spectral_type ); + Parallel_Common::bcast_int( spectral_method ); + Parallel_Common::bcast_string( kernel_type ); + Parallel_Common::bcast_int( eels_method ); + Parallel_Common::bcast_int( absorption_method ); + Parallel_Common::bcast_string( system ); + Parallel_Common::bcast_double( eta ); + Parallel_Common::bcast_double( domega ); + Parallel_Common::bcast_int( nomega ); + Parallel_Common::bcast_int( ecut_chi ); + //Parallel_Common::bcast_int( oband ); + Parallel_Common::bcast_double( q_start[0]); + Parallel_Common::bcast_double( q_start[1]); + Parallel_Common::bcast_double( q_start[2]); + Parallel_Common::bcast_double( q_direct[0]); + Parallel_Common::bcast_double( q_direct[1]); + Parallel_Common::bcast_double( q_direct[2]); + //Parallel_Common::bcast_int( start_q ); + //Parallel_Common::bcast_int( interval_q ); + Parallel_Common::bcast_int( nq ); + Parallel_Common::bcast_bool( out_epsilon ); + Parallel_Common::bcast_bool( out_chi ); + Parallel_Common::bcast_bool( out_chi0 ); + Parallel_Common::bcast_double( fermi_level ); + Parallel_Common::bcast_bool( coulomb_cutoff ); + Parallel_Common::bcast_bool( kmesh_interpolation ); + for(int i=0; i<100; i++) + { + Parallel_Common::bcast_double( qcar[i][0] ); + Parallel_Common::bcast_double( qcar[i][1] ); + Parallel_Common::bcast_double( qcar[i][2] ); + } Parallel_Common::bcast_int(ocp); // Parallel_Common::bcast_int(ocp_n); Parallel_Common::bcast_string(ocp_set); @@ -2229,45 +2196,66 @@ void Input::Bcast() // Parallel_Common::bcast_double( ocp_kb[i] ); // } Parallel_Common::bcast_int( mulliken);//qifeng add 2019/9/10 - Parallel_Common::bcast_int( lcao_box[0] ); - Parallel_Common::bcast_int( lcao_box[1] ); - Parallel_Common::bcast_int( lcao_box[2] ); - //Parallel_Common::bcast_bool( epsilon0 ); - //Parallel_Common::bcast_double( intersmear ); - Parallel_Common::bcast_double( intrasmear ); - Parallel_Common::bcast_double( shift ); - Parallel_Common::bcast_bool( metalcalc ); - Parallel_Common::bcast_double( eps_degauss ); - Parallel_Common::bcast_bool( noncolin ); - Parallel_Common::bcast_bool( lspinorb ); - if(noncolin) - { - if(MY_RANK==0) - { - if((sizeof(angle1) / sizeof(angle1[0]) != this->ntype)){ - delete[] angle1; - angle1 = new double [this->ntype]; - ZEROS(angle1, this->ntype); - } - if(sizeof(angle2) / sizeof(angle2[0]) != this->ntype){ - delete[] angle2; - angle2 = new double [this->ntype]; - ZEROS(angle2, this->ntype); - } - } - if(MY_RANK!=0) - { + Parallel_Common::bcast_int( lcao_box[0] ); + Parallel_Common::bcast_int( lcao_box[1] ); + Parallel_Common::bcast_int( lcao_box[2] ); + //Parallel_Common::bcast_bool( epsilon0 ); + //Parallel_Common::bcast_double( intersmear ); + Parallel_Common::bcast_double( intrasmear ); + Parallel_Common::bcast_double( shift ); + Parallel_Common::bcast_bool( metalcalc ); + Parallel_Common::bcast_double( eps_degauss ); + + // Peize Lin add 2018-06-20 + Parallel_Common::bcast_string( exx_hybrid_type ); + Parallel_Common::bcast_double( exx_hybrid_alpha ); + Parallel_Common::bcast_double( exx_hse_omega ); + Parallel_Common::bcast_bool( exx_separate_loop ); + Parallel_Common::bcast_int( exx_hybrid_step ); + Parallel_Common::bcast_double( exx_lambda ); + Parallel_Common::bcast_double( exx_pca_threshold ); + Parallel_Common::bcast_double( exx_c_threshold ); + Parallel_Common::bcast_double( exx_v_threshold ); + Parallel_Common::bcast_double( exx_dm_threshold ); + Parallel_Common::bcast_double( exx_schwarz_threshold ); + Parallel_Common::bcast_double( exx_cauchy_threshold ); + Parallel_Common::bcast_double( exx_ccp_threshold ); + Parallel_Common::bcast_double( exx_ccp_rmesh_times ); + Parallel_Common::bcast_string( exx_distribute_type ); + Parallel_Common::bcast_int( exx_opt_orb_lmax ); + Parallel_Common::bcast_double( exx_opt_orb_ecut ); + Parallel_Common::bcast_double( exx_opt_orb_tolerence ); + + Parallel_Common::bcast_bool( noncolin ); + Parallel_Common::bcast_bool( lspinorb ); + if(noncolin) + { + if(MY_RANK==0) + { + if((sizeof(angle1) / sizeof(angle1[0]) != this->ntype)){ delete[] angle1; angle1 = new double [this->ntype]; + ZEROS(angle1, this->ntype); + } + if(sizeof(angle2) / sizeof(angle2[0]) != this->ntype){ delete[] angle2; angle2 = new double [this->ntype]; + ZEROS(angle2, this->ntype); } - for(int i = 0;intype;i++) - { - Parallel_Common::bcast_double(angle1[i]); - Parallel_Common::bcast_double(angle2[i]); - } } + if(MY_RANK!=0) + { + delete[] angle1; + angle1 = new double [this->ntype]; + delete[] angle2; + angle2 = new double [this->ntype]; + } + for(int i = 0;intype;i++) + { + Parallel_Common::bcast_double(angle1[i]); + Parallel_Common::bcast_double(angle2[i]); + } + } //Parallel_Common::bcast_int( epsilon0_choice ); Parallel_Common::bcast_double( cell_factor); //LiuXh add 20180619 @@ -2302,6 +2290,7 @@ void Input::Bcast() } #endif + void Input::Check(void) { TITLE("Input","Check"); @@ -2384,17 +2373,26 @@ void Input::Check(void) AUTO_SET("mem_savre","0"); } //xiaohui modify 2015-09-15, 0 -> 1 - //force = 0; + //force = 0; /* - if(!noncolin) - force = 1; - else { + if(!noncolin) + force = 1; + else + { force = 0;//modified by zhengdy-soc, can't calculate force now! cout<<"sorry, can't calculate force with soc now, would be implement in next version!"< nbndxx) + if (nbands > 100000) { - WARNING_QUIT("Input","nbnd out of range, increase nbndxx!"); + WARNING_QUIT("Input","nbnd >100000, out of range"); } if ( nelec > 0 && nbands > 0 && nelec > 2*nbands ) { WARNING_QUIT("Input","nelec > 2*nbnd , bands not enough!"); } - if (nspin < 1 || nspin > nspinx) + if (nspin < 1 || nspin > 4) { WARNING_QUIT("Input","nspin out of range!"); } - //if(local_basis==0) xiaohui modify 2013-09-01 if(basis_type=="pw") //xiaohui add 2013-09-01 { - //if(diago_type=="default") xiaohui modify 2013-09-01 if(ks_solver=="default") //xiaohui add 2013-09-01 { - //diago_type = "cg"; ks_solver = "cg"; - //AUTO_SET("diago_type","cg"); AUTO_SET("ks_solver","cg"); } else if(ks_solver=="cg") @@ -2597,7 +2591,6 @@ void Input::Check(void) { ofs_warning << " It's ok to use dav." << endl; } - //if(diago_type=="hpseps") xiaohui modify 2013-09-01 else if(ks_solver=="genelpa") //yshen add 2016-07-20 { WARNING_QUIT("Input","genelpa can not be used with plane wave basis."); @@ -2606,60 +2599,34 @@ void Input::Check(void) { WARNING_QUIT("Input","scalapack_gvx can not be used with plane wave basis."); } - else if(ks_solver=="hpseps") //xiaohui add 2013-09-01 + else if(ks_solver=="hpseps") { - //ofs_warning << " hpseps can't be used with plane wave basis." << endl; xiaohui modify 2013-09-04 - //diago_type = "cg"; - //ks_solver = "cg"; xiaohui modify 2013-09-04 - //AUTO_SET("diago_type","cg"); - //AUTO_SET("ks_solver","cg"); xiaohui modify 2013-09-04 WARNING_QUIT("Input","hpseps can not be used with plane wave basis."); //xiaohui add 2013-09-04 } - //else if(diago_type=="selinv") xiaohui modify 2013-09-01 - else if(ks_solver=="selinv") //xiaohui add 2013-09-01 + else if(ks_solver=="selinv") { - //ofs_warning << " selinv can't be used with plane wave basis." << endl; xiaohui modify 2013-09-04 - //diago_type = "cg"; - //ks_solver = "cg"; xiaohui modify 2013-09-04 - //AUTO_SET("diago_type","cg"); - //AUTO_SET("ks_solver","cg"); xiaohui modify 2013-09-04 WARNING_QUIT("Input","selinv can not be used with plane wave basis."); //xiaohui add 2013-09-04 } - //xiaohui add 2013-09-04 else if(ks_solver=="lapack") { - //ofs_warning << " lapack can't be used with plane wave basis." << endl; xiaohui modify 2013-09-04 WARNING_QUIT("Input","lapack can not be used with plane wave basis."); - }//xiaohui add 2013-09-04 - else //xiaohui add 2013-09-04 + } + else { WARNING_QUIT("Input","please check the ks_solver parameter!"); - } //xiaohui add 2013-09-04 + } } - //else if(local_basis==4) xiaohui modify 2013-09-01 - else if(basis_type=="lcao") //xiaohui add 2013-09-01 + else if(basis_type=="lcao") { - //if(linear_scaling == 1) xiaohui modify 2013-09-01 - //{ - //if(diago_type == "default") if(ks_solver == "default") { - //diago_type = "hpseps"; - //ks_solver = "hpseps"; ks_solver = "genelpa"; - //AUTO_SET("diago_type","hpseps"); - //AUTO_SET("ks_solver","hpseps"); AUTO_SET("ks_solver","genelpa"); } - //else if(diago_type == "cg" ) else if (ks_solver == "cg") { - //ofs_warning << " Use CG method in LCAO." << endl; xiaohui 2013-09-04 - //atom_distribution=1; xiaohui 2013-09-04 - //AUTO_SET("atom_distribution",1); xiaohui 2013-09-04 WARNING_QUIT("Input","not ready for cg method in lcao ."); //xiaohui add 2013-09-04 } - //else if( diago_type == "hpseps" ) else if (ks_solver == "genelpa") { #ifdef __MPI @@ -2684,82 +2651,45 @@ void Input::Check(void) WARNING_QUIT("Input","hpseps can not be used for series version."); #endif } - //else if( diago_type == "lapack" ) else if (ks_solver == "lapack") { #ifdef __MPI - //WARNING_QUIT("Input","diago_type=lapack is not an option for parallel version of MESIA (try hpseps)."); - //xiaohui modify 2015-03-25 - //WARNING_QUIT("Input","ks_solver=lapack is not an option for parallel version of MESIA (try hpseps)."); WARNING_QUIT("Input","ks_solver=lapack is not an option for parallel version of ABACUS (try hpseps)."); #else ofs_warning << " It's ok to use lapack." << endl; #endif } - //else if( diago_type == "selinv") else if (ks_solver == "selinv") { - WARNING_QUIT("Input","not ready for selinv method in lcao ."); //xiaohui add 2013-09-04 + WARNING_QUIT("Input","not ready for selinv method in lcao ."); } - //xiaohui add 2013-09-04 else if(ks_solver == "linear_scaling") { WARNING_QUIT("Input","not ready for linear_scaling method in lcao ."); - } //xiaohui add 2013-09-04 + } else { - //WARNING_QUIT("Input","please check the diago_type parameter!"); WARNING_QUIT("Input","please check the ks_solver parameter!"); } - //}xiaohui modify 2013-09-01 - //else if(linear_scaling == 2) xiaohui modify 2013-09-01. Attention! Maybe there is some problem. - //{ - //if(diago_type != "canonical" && diago_type != "trace_correcting" && diago_type != "trace_resetting") - //{ - // diago_type = "canonical"; - // AUTO_SET("diago_type","canonical"); - //} - //} - //else xiaohui modify 2013-09-01, move this part to "lcao in pw" - //{ - //if( diago_type != "lapack" ) - //{ - //ofs_warning << " LCAO in plane wave can only done with lapack." << endl; - //diago_type = "lapack"; - //AUTO_SET("diago_type","lapack"); - //} - //} } - else if(basis_type=="lcao_in_pw") //xiaohui add 2013-09-01 + else if(basis_type=="lcao_in_pw") { if( ks_solver != "lapack" ) { - //ofs_warning << " LCAO in plane wave can only done with lapack." << endl; xiaohui modify 2013-09-04 - //ks_solver = "lapack"; xiaohui modify 2013-09-04 - //AUTO_SET("ks_solver","lapack"); xiaohui modify 2013-09-04 WARNING_QUIT("Input","LCAO in plane wave can only done with lapack."); } } - else //xiaohui add 2013-09-01 + else { WARNING_QUIT("Input","please check the basis_type parameter!"); } - //if(local_basis==0 && linear_scaling>0) xiaohui modify 2013-09-01. Attention! Maybe there is some problem. - //{ - // WARNING_QUIT("Input","linear scaling method can not used for plane wave basis!"); - //} - - // add 2010-09-04 - //if(local_basis==0 && gamma_only) xiaohui modify 2013-09-01 - if(basis_type=="pw" && gamma_only) //xiaohui add 2013-09-01 + if(basis_type=="pw" && gamma_only) { WARNING_QUIT("Input","gamma_only not implemented for plane wave now."); } - // add 2010-09-06 - //if(local_basis==0 || (local_basis==4 && !linear_scaling) ) xiaohui modify 2013-09-01 - if(basis_type=="pw" || basis_type=="lcao_in_pw") //xiaohui add 2013-09-01 + if(basis_type=="pw" || basis_type=="lcao_in_pw") { if(gamma_only_local) { @@ -2769,7 +2699,6 @@ void Input::Check(void) } } - //if( (local_basis>0 && linear_scaling) && !gamma_only_local) xiaohui modify 2013-09-01 if(basis_type=="lcao" && !gamma_only_local) //xiaohui add 2013-09-01. Attention! Maybe there is some problem. { WARNING("Input","gamma_only_local algorithm is not used."); @@ -2787,7 +2716,6 @@ void Input::Check(void) } } - //if(NPROC>1 && diago_type=="lapack") xiaohui modify 2013-09-01 if(NPROC>1 && ks_solver=="lapack") //xiaohui add 2013-09-01 { //if(local_basis ==4 && linear_scaling==0) xiaohui modify 2013-09-01 @@ -2801,7 +2729,8 @@ void Input::Check(void) } } - if(ion_dynamics!= "sd" && ion_dynamics!="cg" && ion_dynamics!="bfgs" && ion_dynamics!="cg_bfgs") // pengfei add 13-8-10 a new method cg to bfgs + // pengfei add 13-8-10 a new method cg to bfgs + if(ion_dynamics!= "sd" && ion_dynamics!="cg" && ion_dynamics!="bfgs" && ion_dynamics!="cg_bfgs") { WARNING_QUIT("Input","ion_dynamics can only be sd, cg, bfgs or cg_bfgs."); } @@ -2811,8 +2740,7 @@ void Input::Check(void) WARNING_QUIT("Input","please Input the opt_nbands for optical properties calculations"); } - //if(local_basis==0) xiaohui modify 2013-09-01 - if(basis_type=="pw") //xiaohui add 2013-09-01 + if(basis_type=="pw") { bx=1; by=1; @@ -2840,36 +2768,9 @@ void Input::Check(void) } } -/* - if(vdwD2) //Peize Lin add 2-14-04-05, update 2015-09-30 - { - if( (vdwD2_C6_unit!="Jnm6/mol") && (vdwD2_C6_unit!="eVA6") ) - { - WARNING_QUIT("Input","vdwD2_C6_unit must be Jnm6/mol or eVA6"); - } - if( (vdwD2_R0_unit!="A") && (vdwD2_R0_unit!="Bohr") ) - { - WARNING_QUIT("Input","vdwD2_R0_unit must be A or Bohr"); - } - if( (vdwD2_model!="radius") && (vdwD2_model!="period") ) - { - WARNING_QUIT("Input","vdwD2_model must be radius or period"); - } - if( (vdwD2_period.x<=0) || (vdwD2_period.y<=0) || (vdwD2_period.z<=0) ) - { - WARNING_QUIT("Input","vdwD2_period <= 0 is not allowd"); - } - if( vdwD2_radius<=0 ) - { - WARNING_QUIT("Input","vdwD2_radius <= 0 is not allowd"); - } - if( (vdwD2_radius_unit!="A") && (vdwD2_radius_unit!="Bohr") ) - { - WARNING_QUIT("Input","vdwD2_radius_unit must be A or Bohr"); - } - } */ - if(vdw_method=="d2" || vdw_method=="d3_0" || vdw_method=="d3_bj") //jiyy add 2019-08-04 + // jiyy add 2019-08-04 + if(vdw_method=="d2" || vdw_method=="d3_0" || vdw_method=="d3_bj") { if( (vdw_C6_unit!="Jnm6/mol") && (vdw_C6_unit!="eVA6") ) { @@ -2910,7 +2811,8 @@ void Input::Check(void) WARNING_QUIT("INPUT","spectral_type must be eels or absorption !"); } - if(spectral_type!="None") // pengfei 2016-12-14 + // pengfei 2016-12-14 + if(spectral_type!="None") { if( system!="bulk" && system!="surface") { @@ -2938,11 +2840,58 @@ void Input::Check(void) // } } -//2015-06-15, xiaohui - if(mixing_mode == "pulay" && mixing_gg0 > 0.0) - { - WARNING("Input","To use pulay-kerker mixing method, please set mixing_type=pulay-kerker"); - } + if(exx_hybrid_type!="no" && + exx_hybrid_type!="hf" && + exx_hybrid_type!="pbe0" && + exx_hybrid_type!="hse" && + exx_hybrid_type!="opt_orb") + { + WARNING_QUIT("INPUT","exx_hybrid_type must be no or hf or pbe0 or hse or opt_orb"); + } + + if(exx_hybrid_type=="hf" || exx_hybrid_type=="pbe0" || exx_hybrid_type=="hse") + { + if(exx_hybrid_alpha<0 || exx_hybrid_alpha>1) + { + WARNING_QUIT("INPUT","must 0 < exx_hybrid_alpha < 1"); + } + if(exx_hybrid_step<=0) + { + WARNING_QUIT("INPUT","must exx_hybrid_step > 0"); + } + if(exx_ccp_rmesh_times<1) + { + WARNING_QUIT("INPUT","must exx_ccp_rmesh_times >= 1"); + } + if(exx_distribute_type!="htime" + && exx_distribute_type!="kmeans2" + && exx_distribute_type!="kmeans1" + && exx_distribute_type!="order") + { + WARNING_QUIT("INPUT","exx_distribute_type must be htime or kmeans2 or kmeans1"); + } + } + if(exx_hybrid_type=="opt_orb") + { + if(exx_opt_orb_lmax<0) + { + WARNING_QUIT("INPUT","exx_opt_orb_lmax must >=0"); + } + if(exx_opt_orb_ecut<0) + { + WARNING_QUIT("INPUT","exx_opt_orb_ecut must >=0"); + } + if(exx_opt_orb_tolerence<0) + { + WARNING_QUIT("INPUT","exx_opt_orb_tolerence must >=0"); + } + } + + //2015-06-15, xiaohui + if(mixing_mode == "pulay" && mixing_gg0 > 0.0) + { + WARNING("Input","To use pulay-kerker mixing method, please set mixing_type=pulay-kerker"); + } if(berry_phase) { @@ -2991,345 +2940,6 @@ void Input::Check(void) return; } - - -void Input::Print(const string &fn)const -{ - if (MY_RANK!=0) return; - - TITLE("Input","Print"); - - ofstream ofs(fn.c_str()); - - //---------------------------------- - // output the information in INPUT. - //---------------------------------- - ofs << "INPUT_PARAMETERS" << endl; - ofs << setiosflags(ios::left); - - ofs << "#Parameters (1.General)" << endl; - OUTP(ofs,"suffix",suffix,"the name of main output directory"); - OUTP(ofs,"latname",latname,"the name of lattice name"); - OUTP(ofs,"atom_file",global_atom_card,"the filename of file containing atom positions");//xiaohui modify 2015-02-01 - OUTP(ofs,"kpoint_file",global_kpoint_card,"the name of file containing k points");//xiaohui modify 2015-02-01 - OUTP(ofs,"pseudo_dir",global_pseudo_dir,"the directory containing pseudo files"); - OUTP(ofs,"pseudo_type",global_pseudo_type,"the type pseudo files"); // mohan add 2013-05-20 (xiaohui add 2013-06-23) - OUTP(ofs,"dft_functional",dft_functional,"exchange correlation functional"); // xiaohui add 2015-03-24 -// OUTP(ofs,"wannier_card",wannier_card,"not used now"); -#ifdef __EPM - OUTP(ofs,"epm_pseudo_card",epm_pseudo_card,"name of empirical pseudo"); - OUTP(ofs,"epm_spin_orbital",epm_spin_orbital,"spin orbital in emprical pseudo"); -#endif - OUTP(ofs,"calculation",calculation,"test; scf; relax; nscf; ienvelope; istate;"); - OUTP(ofs,"ntype",ntype,"atom species number"); - OUTP(ofs,"nspin",nspin,"1: single spin; 2: up and down spin; 4: noncollinear spin"); - OUTP(ofs,"nbands",nbands,"number of bands"); - OUTP(ofs,"nbands_istate",nbands_istate,"number of bands around Fermi level for istate calulation"); - OUTP(ofs,"symmetry",symmetry,"turn symmetry on or off"); - OUTP(ofs,"nelec",nelec,"input number of electrons"); - //OUTP(ofs,"lmax1",lmax1,"lmax"); - ofs << "\n#Parameters (2.PW)" << endl; - OUTP(ofs,"ecutwfc",ecutwfc,"#energy cutoff for wave functions"); - //if(diago_type=="cg") xiaohui modify 2013-09-01 - if(ks_solver=="cg") //xiaohui add 2013-09-01 - { - OUTP(ofs,"diago_cg_maxiter",diago_cg_maxiter,"max iteration number for cg"); - OUTP(ofs,"diago_cg_prec",diago_cg_prec,"diago_cg_prec"); - } - //else if(diago_type=="dav") xiaohui modify 2013-09-01 - else if(ks_solver=="dav") //xiaohui add 2013-09-01 - { - OUTP(ofs,"diago_david_ndim",diago_david_ndim,"max dimension for davidson"); - } - OUTP(ofs,"ethr",ethr,"threshold for eigenvalues is cg electron iterations"); - OUTP(ofs,"dr2",dr2,"charge density error"); - OUTP(ofs,"start_wfc",start_wfc,"start wave functions are from 'atomic' or 'file'"); - OUTP(ofs,"start_charge",start_pot,"start charge is from 'atomic' or file"); - OUTP(ofs,"charge_extrap",charge_extrap,"atomic; first-order; second-order; dm:coefficients of SIA"); - OUTP(ofs,"out_charge",out_charge,">0 output charge density for selected electron steps"); - OUTP(ofs,"out_potential",out_potential,"output realspace potential"); - OUTP(ofs,"out_wf",out_wf,"output wave functions"); - OUTP(ofs,"out_dos",out_dos,"output energy and dos"); - OUTP(ofs,"out_band",out_band,"output energy and band structure"); - OUTP(ofs,"restart_save",restart_save,"print to disk every step for restart"); - OUTP(ofs,"restart_load",restart_load,"restart from disk"); -// OUTP(ofs,"ecutrho",ecutrho); -// OUTP(ofs,"ncx",ncx); -// OUTP(ofs,"ncy",ncy); -// OUTP(ofs,"ncz",ncz); - OUTP(ofs,"nx",nx,"number of points along x axis for FFT grid"); - OUTP(ofs,"ny",ny,"number of points along y axis for FFT grid"); - OUTP(ofs,"nz",nz,"number of points along z axis for FFT grid"); - - ofs << "\n#Parameters (3.Relaxation)" << endl; - //OUTP(ofs,"diago_type",DIAGO_TYPE,"cg; david; lapack; hpseps;"); xiaohui modify 2013-09-01 - OUTP(ofs,"ks_solver",KS_SOLVER,"cg; david; lapack; genelpa; hpseps; scalapack_gvx"); - OUTP(ofs,"niter",niter,"#number of electron iterations"); - OUTP(ofs,"vna",vna,"use the vna or not"); - OUTP(ofs,"grid_speed",grid_speed,"1:normal 2:fast");//mohan add 2012-03-29 - //OUTP(ofs,"force",force,"calculate the force or not"); - OUTP(ofs,"force_set",force_set,"output the force_set or not"); - OUTP(ofs,"nstep",nstep,"number of ion iteration steps"); - OUTP(ofs,"out_stru",out_stru,"output the structure files after each ion step"); - OUTP(ofs,"force_thr",force_thr,"force threshold, unit: Ry/Bohr"); - OUTP(ofs,"force_thr_ev",force_thr*13.6058/0.529177,"force threshold, unit: eV/Angstrom"); - OUTP(ofs,"force_thr_ev2",force_thr_ev2,"force invalid threshold, unit: eV/Angstrom"); - OUTP(ofs,"stress_thr",stress_thr,"stress threshold"); //LiuXh add 20180515 - OUTP(ofs,"press1",press1,"target pressure, unit: KBar"); - OUTP(ofs,"press2",press2,"target pressure, unit: KBar"); - OUTP(ofs,"press3",press3,"target pressure, unit: KBar"); - OUTP(ofs,"bfgs_w1",bfgs_w1,"wolfe condition 1 for bfgs"); - OUTP(ofs,"bfgs_w2",bfgs_w2,"wolfe condition 2 for bfgs"); - OUTP(ofs,"trust_radius_max", trust_radius_max,"maximal trust radius, unit: Bohr"); - OUTP(ofs,"trust_radius_min", trust_radius_min,"minimal trust radius, unit: Bohr"); - OUTP(ofs,"trust_radius_ini", trust_radius_ini,"initial trust radius, unit: Bohr"); - OUTP(ofs,"stress",stress,"calculate the stress or not"); - OUTP(ofs,"fixed_axes",fixed_axes,"which axes are fixed"); - OUTP(ofs,"move_method",ion_dynamics,"bfgs; sd; cg; cg_bfgs;"); //pengfei add 2013-08-15 - OUTP(ofs,"out_level",out_level,"ie(for electrons); i(for ions);"); - OUTP(ofs,"out_dm",out_dm,">0 output density matrix"); - - ofs << "\n#Parameters (4.LCAO)" << endl; - //OUTP(ofs,"local_basis",local_basis,"0:PW; 1:LO in pw; 4:LCAO"); xiaohui modify 2013-09-01 - OUTP(ofs,"basis_type",basis_type,"PW; LCAO in pw; LCAO"); //xiaohui add 2013-09-01 - //OUTP(ofs,"linear_scaling",linear_scaling,"0:PW 1:LCAO 2:DMM"); xiaohui modify 2013-09-01 - //if(diago_type=="HPSEPS") xiaohui modify 2013-09-01 - if(ks_solver=="HPSEPS" || ks_solver=="genelpa" || ks_solver=="scalapack_gvx") //xiaohui add 2013-09-01 - { - OUTP(ofs,"nb2d",nb2d,"2d distribution of atoms"); - } - OUTP(ofs,"search_radius",search_radius,"input search radius (Bohr)"); - OUTP(ofs,"search_pbc",search_pbc,"input periodic boundary condition"); - OUTP(ofs,"lcao_ecut",lcao_ecut,"energy cutoff for LCAO"); - OUTP(ofs,"lcao_dk",lcao_dk,"delta k for 1D integration in LCAO"); - OUTP(ofs,"lcao_dr",lcao_dr,"delta r for 1D integration in LCAO"); - OUTP(ofs,"lcao_rmax",lcao_rmax,"max R for 1D two-center integration table"); - OUTP(ofs,"out_hs",out_hs,"output H and S matrix"); - OUTP(ofs,"out_lowf",out_lowf,"ouput LCAO wave functions"); - OUTP(ofs,"bx",bx,"division of an element grid in FFT grid along x"); - OUTP(ofs,"by",by,"division of an element grid in FFT grid along y"); - OUTP(ofs,"bz",bz,"division of an element grid in FFT grid along z"); - - ofs << "\n#Parameters (5.Smearing)" << endl; - //OUTP(ofs,"occupations",occupations,"fixed; smearing"); - OUTP(ofs,"smearing",smearing,"type of smearing: gauss; fd; fixed; mp; mp2"); - OUTP(ofs,"sigma",degauss,"energy range for smearing"); - - ofs << "\n#Parameters (6.Charge Mixing)" << endl; -//2015-06-15 - OUTP(ofs,"mixing_type",mixing_mode,"plain; kerker; pulay; pulay-kerker"); - OUTP(ofs,"mixing_beta",mixing_beta,"mixing parameter: 0 means no new charge"); - OUTP(ofs,"mixing_ndim",mixing_ndim,"mixing dimension in pulay"); - OUTP(ofs,"mixing_gg0",mixing_gg0,"mixing parameter in kerker"); - - ofs << "\n#Parameters (7.DOS)" << endl; - OUTP(ofs,"dos_emin_ev",dos_emin_ev,"minimal range for dos"); - OUTP(ofs,"dos_emax_ev",dos_emax_ev,"maximal range for dos"); - OUTP(ofs,"dos_edelta_ev",dos_edelta_ev,"delta energy for dos"); - OUTP(ofs,"dos_sigma",b_coef,"gauss b coefficeinet(default=0.07)"); - - ofs << "\n#Parameters (8.Technique)" << endl; - OUTP(ofs,"gamma_only",gamma_only,"gamma only"); - //OUTP(ofs,"gamma_only_local",gamma_only_local,"gamma only in LCAO (important)"); - OUTP(ofs,"diago_proc",DIAGO_PROC,"number of proc used to diago");//mohan add 2012-01-13 - //OUTP(ofs,"gamma_only_pw",gamma_only,"gamma only in pw"); - OUTP(ofs,"npool",npool,"number of pools for k points, pw only"); - OUTP(ofs,"sparse_matrix",sparse_matrix,"use sparse matrix, in DMM"); - OUTP(ofs,"atom_distribution",atom_distribution,"distribute atoms, in DMM"); - OUTP(ofs,"mem_saver",mem_saver,"memory saver for many k points used"); - OUTP(ofs,"printe",printe,"print band energy for selectively ionic steps"); - -// ofs << "\n#Parameters (11.Divide&Conqure)" << endl; -// OUTP(ofs,"DC_nx",dc_nx,"division of atoms along x"); -// OUTP(ofs,"DC_ny",dc_ny,"division of atoms along y"); -// OUTP(ofs,"DC_nz",dc_nz,"division of atoms along z"); - - ofs << "\n#Parameters (9.SIAO)" << endl; - OUTP(ofs,"selinv_npole",selinv_npole,"number of selected poles"); - OUTP(ofs,"selinv_temp",selinv_temp,"temperature for Fermi-Dirac distribution"); - OUTP(ofs,"selinv_gap",selinv_gap,"supposed gap in the calculation"); - OUTP(ofs,"selinv_deltae",selinv_deltae,"expected energy range"); - OUTP(ofs,"selinv_mu",selinv_mu,"chosen mu as Fermi energy"); - OUTP(ofs,"selinv_threshold",selinv_threshold,"threshold for calculated electron number"); - OUTP(ofs,"selinv_niter",selinv_niter,"max number of steps to update mu"); - - ofs << "\n#Parameters (10.Molecular dynamics)" << endl; -/* - OUTP(ofs,"md_dt",md_dt,"time step for molecular dynamics"); - OUTP(ofs,"md_restart",md_restart,"restart molecular dynamics from previous steps."); - OUTP(ofs,"md_thermostat",md_thermostat,"ionic temperature: various md_thermostat"); - OUTP(ofs,"md_temp0",md_temp0,"start temperature"); - OUTP(ofs,"md_tolv",md_tolv,"tolerence for velocity scaling"); - OUTP(ofs,"md_tstep",md_tstep,"the temperature will reduce every md_tstep"); - OUTP(ofs,"md_delt",md_delt,"the reduce amount of temperature"); -*/ -//added by zheng daye - OUTP(ofs,"md_mdtype",md_mdtype,"choose ensemble"); - //OUTP(ofs,"md_tauthermo",md_tauthermo,); - //OUTP(ofs,"md_taubaro",md_taubaro,); - OUTP(ofs,"md_dt",md_dt,"time step"); - OUTP(ofs,"md_nresn",md_nresn,"parameter during integrater"); - OUTP(ofs,"md_nyosh",md_nyosh,"parameter during integrater"); - OUTP(ofs,"md_qmass",md_qmass,"mass of thermostat"); - OUTP(ofs,"md_tfirst",md_tfirst,"temperature first"); - OUTP(ofs,"md_tlast",md_tlast,"temperature last"); - OUTP(ofs,"md_dumpmdfred",md_dumpmdfred,"The period to dump MD information for monitoring and restarting MD"); - OUTP(ofs,"md_mdoutpath",md_mdoutpath,"output path of md"); - OUTP(ofs,"md_domsd",md_domsd,"whether compute "); - OUTP(ofs,"md_domsdatom",md_domsdatom,"whether compute msd for each atom"); - OUTP(ofs,"md_rstmd",md_rstmd,"whether restart"); - //OUTP(ofs,"md_outputstressperiod",md_outputstressperiod,"period to output stress"); - OUTP(ofs,"md_fixtemperature",md_fixtemperature,"period to change temperature"); - OUTP(ofs,"md_ediff",md_ediff,"parameter for constraining total energy change"); - OUTP(ofs,"md_ediffg",md_ediffg,"parameter for constraining max force change"); - OUTP(ofs,"md_msdstarttime",md_msdstartTime,"choose which step that msd be calculated"); -//end of zheng daye's adding - - ofs << "\n#Parameters (11.Efield)" << endl; - OUTP(ofs,"efield",efield,"add electric field"); - OUTP(ofs,"edir",edir,"add electric field"); - OUTP(ofs,"emaxpos",emaxpos,"maximal position of efield [0,1)"); - OUTP(ofs,"eopreg",eopreg,"where sawlike potential decrease"); - OUTP(ofs,"eamp",eamp,"amplitute of the efield, unit is a.u."); - OUTP(ofs,"eamp_v",eamp*51.44,"amplitute of the efield, unit is V/A"); - - ofs << "\n#Parameters (12.Bfield)" << endl; - OUTP(ofs,"bfield",bfield,"add magnetic field"); - OUTP(ofs,"bfield_teslax",bfield_teslax,"magnetic field strength"); - OUTP(ofs,"bfield_teslay",bfield_teslay,"magnetic field strength"); - OUTP(ofs,"bfield_teslaz",bfield_teslaz,"magnetic field strength"); - OUTP(ofs,"bfield_gauge_x",bfield_gauge_x,"magnetic field gauge origin"); - OUTP(ofs,"bfield_gauge_y",bfield_gauge_y,"magnetic field gauge origin"); - OUTP(ofs,"bfield_gauge_z",bfield_gauge_z,"magnetic field gauge origin"); - - ofs << "\n#Parameters (13.Test)" << endl; - OUTP(ofs,"out_alllog",out_alllog,"output information for each processor, when parallel"); - OUTP(ofs,"nurse", nurse,"for coders"); - OUTP(ofs,"colour", colour,"for coders, make their live colourful"); - OUTP(ofs,"t_in_h", t_in_h,"calculate the kinetic energy or not"); - OUTP(ofs,"vl_in_h", vl_in_h,"calculate the local potential or not"); - OUTP(ofs,"vnl_in_h", vnl_in_h,"calculate the nonlocal potential or not"); - OUTP(ofs,"zeeman_in_h", zeeman_in_h,"calculate the zeeman term or not"); - OUTP(ofs,"test_force", test_force, "test the force"); - OUTP(ofs,"test_stress", test_stress, "test the force"); - -#ifdef __EPM_ - OUTP(ofs,"fs_ref_energy",fs_ref_energy); -#endif - - ofs << "\n#Parameters (14.Other Methods)" << endl; - OUTP(ofs,"mlwf_flag",mlwf_flag,"turn MLWF on or off"); - OUTP(ofs,"opt_epsilon2",opt_epsilon2,"calculate the dielectic function"); - OUTP(ofs,"opt_nbands",opt_nbands,"number of bands for optical calculation"); -// OUTP(ofs,"berry_phase",berry_phase); -// OUTP(ofs,"lda_plus_u",lda_plus_u); - -/* ofs << "\n#Parameters (15.vdw-D2)" << endl; //Peize Lin add 2014-04-05, update 2015-09-30 - OUTP(ofs,"vdwD2",vdwD2,"calculate vdw-D2 or not"); - OUTP(ofs,"vdwD2_scaling",vdwD2_scaling,"scaling of vdw-D2"); - OUTP(ofs,"vdwD2_d",vdwD2_d,"damping parameter"); - OUTP(ofs,"vdwD2_C6_file",vdwD2_C6_file,"filename of C6"); - OUTP(ofs,"vdwD2_C6_unit",vdwD2_C6_unit,"unit of C6, Jnm6/mol or eVA6"); - OUTP(ofs,"vdwD2_R0_file",vdwD2_R0_file,"filename of R0"); - OUTP(ofs,"vdwD2_R0_unit",vdwD2_R0_unit,"unit of R0, A or Bohr"); - OUTP(ofs,"vdwD2_model",vdwD2_model,"expression model of periodic structure, radius or period"); - OUTP(ofs,"vdwD2_radius",vdwD2_radius,"radius cutoff for periodic structure"); - OUTP(ofs,"vdwD2_radius_unit",vdwD2_radius_unit,"unit of radius cutoff for periodic structure"); - ofs << setw(20) << "vdwD2_period" << vdwD2_period.x << " " << vdwD2_period.y << " " << vdwD2_period.z<< " #periods of periodic structure" << endl; */ - - ofs << "\n#Parameters (15.VdW Correction)" << endl; -//jiyy add 2019-08-04 - OUTP(ofs,"vdw_method",vdw_method,"the method of calculating vdw (none ; d2 ; d3_0 ; d3_bj"); - OUTP(ofs,"vdw_s6",vdw_s6,"scale parameter of d2/d3_0/d3_bj"); - OUTP(ofs,"vdw_s8",vdw_s8,"scale parameter of d3_0/d3_bj"); - OUTP(ofs,"vdw_a1",vdw_a1,"damping parameter of d3_0/d3_bj"); - OUTP(ofs,"vdw_a2",vdw_a2,"damping parameter of d3_bj"); - OUTP(ofs,"vdw_d",vdw_d,"damping parameter of d2"); - OUTP(ofs,"vdw_abc",vdw_abc,"third-order term?"); - OUTP(ofs,"vdw_C6_file",vdw_C6_file,"filename of C6"); - OUTP(ofs,"vdw_C6_unit",vdw_C6_unit,"unit of C6, Jnm6/mol or eVA6"); - OUTP(ofs,"vdw_R0_file",vdw_R0_file,"filename of R0"); - OUTP(ofs,"vdw_R0_unit",vdw_R0_unit,"unit of R0, A or Bohr"); - OUTP(ofs,"vdw_model",vdw_model,"expression model of periodic structure, radius or period"); - OUTP(ofs,"vdw_radius",vdw_radius,"radius cutoff for periodic structure"); - OUTP(ofs,"vdw_radius_unit",vdw_radius_unit,"unit of radius cutoff for periodic structure"); - OUTP(ofs,"vdw_cn_thr",vdw_cn_thr,"radius cutoff for cn"); - OUTP(ofs,"vdw_cn_thr_unit",vdw_cn_thr_unit,"unit of cn_thr, Bohr or Angstrom"); - ofs << setw(20) << "vdw_period" << vdw_period.x << " " << vdw_period.y << " " << vdw_period.z<< " #periods of periodic structure" << endl; - - - ofs << "\n#Parameters (16.spectrum)" << endl; // pengfei Li add 2016-11-23 - //OUTP(ofs,"epsilon",epsilon,"calculate epsilon or not"); - //OUTP(ofs,"epsilon_choice",epsilon_choice,"0: hilbert_transform method; 1: standard method"); - OUTP(ofs,"spectral_type",spectral_type,"the type of the calculated spectrum"); - OUTP(ofs,"spectral_method",spectral_method,"0: tddft(linear response)"); - OUTP(ofs,"kernel_type",kernel_type,"the kernel type: rpa, tdlda ..."); - OUTP(ofs,"eels_method",eels_method,"0: hilbert_transform method; 1: standard method"); - OUTP(ofs,"absorption_method",absorption_method,"0: vasp's method 1: pwscf's method"); - OUTP(ofs,"system",system,"the calculate system"); - OUTP(ofs,"eta",eta,"eta(Ry)"); - OUTP(ofs,"domega",domega,"domega(Ry)"); - OUTP(ofs,"nomega",nomega,"nomega"); - OUTP(ofs,"ecut_chi",ecut_chi,"the dimension of chi matrix"); - //OUTP(ofs,"oband",oband,"the number of occupied bands"); - ofs << setw(20) <<"q_start"<"); - for(int i=0; i" < using namespace std; -//========================================================== -// CLASS : -// NAME : Input(readin "input_parameters" from "in_data" dir) -//========================================================== class Input { -public: + public: Input(); ~Input(); + void Init(const string &fn); + void Print(const string &fn)const; - void close_log(void)const; - int npool; + void close_log(void)const; //========================================================== -// MEMBER VARIABLES : -// main parameters +// directories of files //========================================================== + string suffix; // suffix of out put dir - string atom_file; //xiaohui modify 2015-02-01 - string pseudo_dir; // dir of pseudopotential - - string pseudo_type; // the type of pseudopotential, mohan add 2013-05-20, we can accept - // UPF format (default) and vwr format. (xiaohui add 2013-06-23) - string kpoint_file; //xiaohui modify 2015-02-01 + string atom_file; // file contains atomic positions -- xiaohui modify 2015-02-01 + string pseudo_dir; // directory of pseudopotential + string pseudo_type; // the type of pseudopotential, mohan add 2013-05-20, ABACUS supports + // UPF format (default) and vwr format. (xiaohui add 2013-06-23) + string kpoint_file; // file contains k-points -- xiaohui modify 2015-02-01 string wannier_card; // input card for wannier functions. - string epm_pseudo_card; // string latname; // lattice name + + string calculation; // "scf" : self consistent calculation. - // "nscf" : non-self consistent calculation. + // "nscf" : non-self consistent calculation. + // "relax" : cell relaxations int ntype; // number of atom types int nbands; // number of bands + int nbands_sto; // number of stochastic bands //qianrui 2021-2-5 int nbands_istate; // number of bands around fermi level for istate calculation. - int epm_spin_orbital; // 0: no so effect; 1: plane wave; 2: small box - bool epm_zeeman; - double epm_mag_field_x; - double epm_mag_field_y; - double epm_mag_field_z; + int nche_sto; // number of orders for Chebyshev expansion in stochastic DFT //qinarui 2021-2-5 + + bool symmetry; // turn on symmetry or not + int npool; // ecch pool is for one k point bool berry_phase; // berry phase calculation int gdir; // berry phase calculation + +//========================================================== +// Wannier functions +//========================================================== bool towannier90; // add by jingan for wannier90 string NNKP; // add by jingan for wannier90 string wannier_spin; // add by jingan for wannier90 + + bool mlwf_flag; // add by mohan + +//========================================================== +// E field +//========================================================== int efield; // add electrical field int edir; double emaxpos; double eopreg; double eamp; - int bfield; // add magnetic field - double bfield_teslax; // - double bfield_teslay; // - double bfield_teslaz; // - double bfield_gauge_x; // add by sunzhuyuan, - double bfield_gauge_y; - double bfield_gauge_z; + +//========================================================== +// Optical properties +//========================================================== bool opt_epsilon2; // true : calculate the dielectric functions int opt_nbands; // number of bands for optical transition matrix bool lda_plus_u; // true : lda plus u calculation + //========================================================== // electrons / spin //========================================================== string dft_functional; // input DFT functional. - int nspin; // LDA ; LSDA ; non-linear spin + int nspin; // LDA ; LSDA ; non-linear spin double nelec; // total number of electrons int lmaxmax; double tot_magnetization; + +//========================================================== +// LCAO parameters +//========================================================== + string basis_type; //xiaohui add 2013-09-01, for structural adjustment + string ks_solver; //xiaohui add 2013-09-01 + +//========================================================== +// Forces //========================================================== -// new function -//========================================================== - //int local_basis; xiaohui modify 2013-09-01, for structural adjustment // 0:pw 1:lo 2:atomic - //int linear_scaling; xiaohui modify 2013-09-01 // - string basis_type; //xiaohui add 2013-09-01, for structural adjustment - string ks_solver; //xiaohui add 2013-09-01 - bool sparse_matrix; - int atom_distribution; - bool symmetry; // - bool mlwf_flag; - int vna; //control the vna term. - int grid_speed; //1:normal 2:fast, mohan add 2012-03-29 int force; bool force_set; double force_thr; // threshold of force in unit (Ry/Bohr) double force_thr_ev2; // invalid force threshold, mohan add 2011-04-17 + +//========================================================== +// Stress +//========================================================== double stress_thr; // Pengfei Li 2017-11-01 //LiuXh update 20180515 double press1; double press2; double press3; bool stress; // calculate the stress - string fixed_axes; //which axes are fixed - string ion_dynamics; // methods to move_ion: sd, bfgs, cg... + + string fixed_axes; //which axes are fixed + string ion_dynamics; // methods to move_ion: sd, bfgs, cg... + double cg_threshold; // threshold when cg to bfgs, pengfei add 2011-08-15 + double bfgs_w1; // wolfe condition 1 double bfgs_w2; // wolfe condition 2 + double trust_radius_max; // trust radius max double trust_radius_min; // trust radius min double trust_radius_ini; // initial move -// bool gauss_pao_flag + //========================================================== -// planewave +// Planewave //========================================================== - //bool gamma_only; bool gamma_only; // for plane wave. bool gamma_only_local; // for local orbitals. + double ecutwfc; // energy cutoff for wavefunctions double ecutrho; // energy cutoff for charge/potential + int ncx,ncy,ncz; // three dimension of FFT charge/grid int nx,ny,nz; // three dimension of FFT wavefunc int bx,by,bz; // big mesh ball. mohan add 2011-04-21 + //========================================================== // technique //========================================================== - //string diago_type; xiaohui modify 2013-09-01 // "cg","davidson","fs" int diago_proc; // the number of procs used to diag. mohan add 2012-01-13 int diago_cg_maxiter; int diago_cg_prec; // mohan add 2012-03-31 int diago_david_ndim; double ethr; // used in cg method - double fs_ref_energy; // folded-spectrum reference energy + int nb2d; // matrix 2d division. + int nurse; // used for debug. + bool colour; // used for fun. - int t_in_h; // calculate the T or not. + + int t_in_h; // calculate the T or not. int vl_in_h; // calculate the T or not. int vnl_in_h; // calculate the T or not. - int zeeman_in_h; // calculate the zeeman energy or not. + int test_force; // test the force. int test_stress; // test the stress. + //========================================================== // iteration //========================================================== @@ -146,16 +163,19 @@ class Input int nstep; // number of max ionic iter int out_stru; // outut stru file each ion step string out_level; // control the output information. - bool out_md_control; // internal parameter , added by zhengdy 2019-04-07 + bool out_md_control; // internal parameter , added by zhengdy 2019-04-07 + //========================================================== // occupation //========================================================== string occupations; // "fixed","smearing","tetrahedra","from_input" + string smearing; // "gaussian", - // "mp","methfessel-paxton" - // "mv","marzari-vanderbilt","cold" - // "fd","fermi-dirac" + // "mp","methfessel-paxton" + // "mv","marzari-vanderbilt","cold" + // "fd","fermi-dirac" double degauss; // + //========================================================== // charge mixing //========================================================== @@ -163,32 +183,40 @@ class Input double mixing_beta; // 0 : no_mixing int mixing_ndim; // used in Broden method double mixing_gg0; // used in kerker method. mohan add 2014-09-27 + //========================================================== // potential / charge / wavefunction / energy //========================================================== string restart_mode; // + string start_wfc; // "file","atomic","random" string start_pot; // "file","atomic" - string charge_extrap; // xiaohui modify 2015-02-01 + + string charge_extrap; // xiaohui modify 2015-02-01 + int mem_saver; // 1: save psi when nscf calculation. + int printe; // mohan add 2011-03-16 int out_charge; // output charge density. int out_dm; // output density matrix. int out_potential; // yes or no bool out_wf; // yes or no int out_dos; // dos calculation. mohan add 20090909 - int out_band; // band calculation pengfei 2014-10-13 + int out_band; // band calculation pengfei 2014-10-13 int out_hs; // output H matrix and S matrix in local basis. int out_hs2; //LiuXh add 2019-07-16, output H(R) matrix and S(R) matrix in local basis. int out_r_matrix; // jingan add 2019-8-14, output r(R) matrix. bool out_lowf; // output the wave functions in local basis. bool out_alllog; // output all logs. + double dos_emin_ev; double dos_emax_ev; double dos_edelta_ev; - double b_coef; // pengfei 2014-10-13 + + double b_coef; // pengfei 2014-10-13 + //========================================================== -// parameters about LCAO calculation. +// two center integrals in LCAO // mohan add 2009-11-11 //========================================================== double lcao_ecut; // ecut of two center integral @@ -198,11 +226,10 @@ class Input double search_radius; //11.1 bool search_pbc; // 11.2 - // Divide&Conqure - int dc_nx; - int dc_ny; - int dc_nz; +//========================================================== +// selected inversion method +//========================================================== // selinv method parameter (cooperate with LinLin) int selinv_npole; double selinv_temp; @@ -212,57 +239,33 @@ class Input double selinv_threshold; int selinv_niter; -/* - // md and related parameters. - double md_dt; //dt: time step for MD. - int md_restart; // mohan add: restart from file. - double md_tolv; // tolv: tolerence for velocity scaling. - string md_thermostat; //ionic temperature: various md_thermostat - double md_temp0; // tempw: start temperature. - int md_tstep; // nraise: the temperature will reduce every md_tstep. - double md_delt; // delta_t: the reduce amount of temperature. -*/ - -//md and related parameters(added by zheng da ye) - int md_mdtype; //choose ensemble - double md_tauthermo; - double md_taubaro; - double md_dt; //time step - int md_nresn; //parameter during integrater - int md_nyosh; //parameter during integrater - double md_qmass; //mass of thermostat - double md_tfirst; //temperature begin - double md_tlast; //temperature end - int md_dumpmdfred; //The period to dump MD information for monitoring and restarting MD - string md_mdoutpath; //output path for md +//========================================================== +// molecular dynamics +// added by Daye Zheng +//========================================================== + int md_mdtype; //choose ensemble + double md_tauthermo; + double md_taubaro; + double md_dt; //time step + int md_nresn; //parameter during integrater + int md_nyosh; //parameter during integrater + double md_qmass; //mass of thermostat + double md_tfirst; //temperature begin + double md_tlast; //temperature end + int md_dumpmdfred; //The period to dump MD information for monitoring and restarting MD + string md_mdoutpath; //output path for md bool md_domsd; //whether compute - bool md_domsdatom; //whether compute msd for each atom - int md_rstmd; //whether restart; - int md_outputstressperiod; //period to output stress - int md_fixtemperature; //period to change temperature - double md_ediff; //parameter for constraining total energy change + bool md_domsdatom; //whether compute msd for each atom + int md_rstmd; //whether restart; + int md_outputstressperiod; //period to output stress + int md_fixtemperature; //period to change temperature + double md_ediff; //parameter for constraining total energy change double md_ediffg; //parameter for constraining max force change - int md_msdstartTime; //choose which step that msd be calculated -//end of zhengdaye's add -/* //========================================================== -// vdwD2 -// Peize Lin add 2014-03-31 -//========================================================== - bool vdwD2; //calculate vdwD2 or not - double vdwD2_scaling; - double vdwD2_d; //damping parameter - string vdwD2_C6_file; - string vdwD2_C6_unit; //"Bohr" or "Angstrom" - string vdwD2_R0_file; - string vdwD2_R0_unit; //"Bohr" or "Angstrom" - string vdwD2_model; //"period" or "radius" - Vector3 vdwD2_period; - double vdwD2_radius; - string vdwD2_radius_unit; //"Bohr" or "Angstrom" */ + int md_msdstartTime; //choose which step that msd be calculated //========================================================== // vdw -//Peize Lin add 2014-03-31, jiyy update 2019-08-01 +// Peize Lin add 2014-03-31, jiyy update 2019-08-01 //========================================================== string vdw_method; //the method of vdw calculation string vdw_s6; //scale parameter @@ -282,61 +285,86 @@ class Input string vdw_model; //"period" or "radius" Vector3 vdw_period; - //========================================================== -// spectrum +// Spectrum // pengfei Li add 2016-11-23 //========================================================== - //bool epsilon; // calculate epsilon or not - string spectral_type; // the type of the calculated spectrum - int spectral_method; // 0: tddft(linear response) - int eels_method; // 0: hilbert_transform method; 1: standard method - int absorption_method; // 0: vasp's method 1: pwscf's method - //int epsilon_choice; // 0: hilbert_transform method; 1: standard method - - string kernel_type; // the kernel type: rpa, tdlda ... - - string system; // bulk or surface - double eta; // unit(Ry) - double domega; // unit(Ry) - int nomega; - int ecut_chi; // the dimension of G - //int oband; // the number of "occupied" bands - double q_start[3]; // the position of the first q point in direct coordinate - double q_direct[3]; // the q direction - //int start_q; // the serial number of the start qpoint - //int interval_q; // the interval of the qpoints - int nq; // the total number of qpoints for calculation - bool out_epsilon; // output epsilon or not - bool out_chi; // output chi or not - bool out_chi0; // output chi0 or not - double fermi_level; // the change the fermi level(Ry) - bool coulomb_cutoff; // turn on or off the Coulomb_cutoff 0/1 - - //bool epsilon0; // calculate the macroscopic dielectric constant or not - //double intersmear; // eta - double intrasmear; // Eta - double shift; - bool metalcalc; // metal or not - double eps_degauss; // degauss - - //int epsilon0_choice; // 0: vasp's method 1: pwscf's method - - bool kmesh_interpolation; // calculting - double qcar[100][3]; // the Cartesian position of q points(unit: 2*PI/lat0) - int ocp; - //int ocp_n; - string ocp_set; - //double ocp_kb[10000]; - int lcao_box[3]; // the scale for searching the existence of the overlap + //bool epsilon; // calculate epsilon or not + string spectral_type; // the type of the calculated spectrum + int spectral_method; // 0: tddft(linear response) + int eels_method; // 0: hilbert_transform method; 1: standard method + int absorption_method; // 0: vasp's method 1: pwscf's method + //int epsilon_choice; // 0: hilbert_transform method; 1: standard method + string kernel_type; // the kernel type: rpa, tdlda ... + string system; // bulk or surface + double eta; // unit(Ry) + double domega; // unit(Ry) + int nomega; + int ecut_chi; // the dimension of G + //int oband; // the number of "occupied" bands + double q_start[3]; // the position of the first q point in direct coordinate + double q_direct[3]; // the q direction + //int start_q; // the serial number of the start qpoint + //int interval_q; // the interval of the qpoints + int nq; // the total number of qpoints for calculation + bool out_epsilon; // output epsilon or not + bool out_chi; // output chi or not + bool out_chi0; // output chi0 or not + double fermi_level; // the change the fermi level(Ry) + bool coulomb_cutoff; // turn on or off the Coulomb_cutoff 0/1 + //bool epsilon0; // calculate the macroscopic dielectric constant or not + //double intersmear; // eta + double intrasmear; // Eta + double shift; + bool metalcalc; // metal or not + double eps_degauss; // degauss + //int epsilon0_choice; // 0: vasp's method 1: pwscf's method + bool kmesh_interpolation; // calculting + double qcar[100][3]; // the Cartesian position of q points(unit: 2*PI/lat0) + int ocp; + //int ocp_n; + string ocp_set; + //double ocp_kb[10000]; + int lcao_box[3]; // the scale for searching the existence of the overlap int mulliken;//qifeng add 2019-9-10 //added by zhengdy-soc bool noncolin; bool lspinorb; -// bool starting_spin_angle; + + // bool starting_spin_angle; double *angle1; double *angle2; + +//========================================================== +// exx +// Peize Lin add 2018-06-20 +//========================================================== + string exx_hybrid_type; // "no", "hf", "pbe0", "hse" + + double exx_hybrid_alpha; + double exx_hse_omega; + + bool exx_separate_loop; // 0 or 1 + int exx_hybrid_step; + + double exx_lambda; + + double exx_pca_threshold; + double exx_c_threshold; + double exx_v_threshold; + double exx_dm_threshold; + double exx_schwarz_threshold; + double exx_cauchy_threshold; + double exx_ccp_threshold; + double exx_ccp_rmesh_times; + + string exx_distribute_type; + + int exx_opt_orb_lmax; + double exx_opt_orb_ecut; + double exx_opt_orb_tolerence; + //========================================================== // tddft // Fuxiang He add 2016-10-26 @@ -357,11 +385,8 @@ class Input //========================================================== bool restart_save; bool restart_load; - - //xiaohui add 2015-09-16 bool input_error; - double cell_factor; //LiuXh add 20180619 //========================================================== @@ -385,10 +410,20 @@ class Input bool omc; //whether turn on occupation matrix control method or not bool yukawa_potential; //default:false double yukawa_lambda; //default:0.0 + //The two parameters below are not usable currently + int dftu_type; //1:rotationally invarient formalism; 2:simplified form(default) int double_counting; // 1:FLL(fully localized limit)(default); 2:AMF(around mean field) + +//========================================================== +// DeepKS -- added by caoyu and mohan +//========================================================== + int out_descriptor; // output descritpor for deepks. caoyu added 2020-11-24, mohan modified 2021-01-03 + int lmax_descriptor; // lmax used in descriptor, mohan added 2021-01-03 + private: + //========================================================== // MEMBER FUNCTIONS : // NAME : Read() @@ -398,19 +433,21 @@ class Input // from first cpu, and distribute the data to the // other processors) //========================================================== + bool Read(const string &fn); + void Default(void); + void Default_2(void); //jiyy add 2019-08-04 + void Check(void); + #ifdef __MPI void Bcast(void); #endif public: -//========================================================== -// MEMBER FUNCTION : -// NAME : read_value(a module used to read in datas) -//========================================================== + template static void read_value(ifstream &ifs, T &var) { diff --git a/ABACUS.develop/source/input_conv.cpp b/ABACUS.develop/source/input_conv.cpp index 53d6dda963..0cc6c51edb 100644 --- a/ABACUS.develop/source/input_conv.cpp +++ b/ABACUS.develop/source/input_conv.cpp @@ -3,24 +3,23 @@ #include "input.h" #include "input_conv.h" #include "src_ions/ions_move_basic.h" -#include "src_pw/optical.h" -#include "src_lcao/bfield.h" -#include "src_lcao/force_lcao.h" +#include "src_io/optical.h" +#include "src_lcao/FORCE_STRESS.h" #include "src_lcao/local_orbital_charge.h" -#include "src_lcao/lcao_orbitals.h" +#include "src_lcao/ORB_read.h" #include "src_pw/efield.h" -#include "src_pw/vdwd2.h" +#include "src_lcao/global_fp.h" +#include "src_pw/vdwd2_parameters.h" #include "src_pw/vdwd3.h" -#include "src_pw/chi0_hilbert.h" -#include "src_pw/chi0_standard.h" -#include "src_pw/epsilon0_pwscf.h" -#include "src_pw/epsilon0_vasp.h" +#include "src_io/chi0_hilbert.h" +#include "src_io/chi0_standard.h" +#include "src_io/epsilon0_pwscf.h" +#include "src_io/epsilon0_vasp.h" #include "src_pw/unitcell.h" - -//xiaohui modified 2013-03-23, adding "//" before #include... -//#include "../../src_develop/src_siao/selinv.h" -//#include "../src_develop/src_dc/dc_info.h" -//#include "../../src_develop/src_md/md.h" +#include "src_ri/exx_abfs-jle.h" +#include "src_pw/occupy.h" +#include "src_io/berryphase.h" +#include "src_pw/symmetry.h" void Input_Conv::Convert(void) { @@ -30,121 +29,112 @@ void Input_Conv::Convert(void) // main parameters / electrons / spin ( 10/16 ) //---------------------------------------------------------- // suffix - if(INPUT.atom_file!="")global_atom_card = INPUT.atom_file;//xiaohui modify 2015-02-01 + if(INPUT.atom_file!="") global_atom_card = INPUT.atom_file; global_wannier_card = INPUT.wannier_card; - if(INPUT.kpoint_file!= "")global_kpoint_card = INPUT.kpoint_file;//xiaohui modify 2015-02-01 - if(INPUT.pseudo_dir != "")global_pseudo_dir = INPUT.pseudo_dir + "/"; // mohan add slash 2013-04-13 (xiaohui add 2013-06-23) - global_pseudo_type = INPUT.pseudo_type; // mohan add this on 2013-05-20 (xiaohui add 2013-06-23) - global_epm_pseudo_card = INPUT.epm_pseudo_card; + if(INPUT.kpoint_file!= "") global_kpoint_card = INPUT.kpoint_file; + if(INPUT.pseudo_dir != "") global_pseudo_dir = INPUT.pseudo_dir + "/"; + global_pseudo_type = INPUT.pseudo_type; ucell.latName = INPUT.latname; ucell.ntype = INPUT.ntype; ucell.nelec = INPUT.nelec; -// ucell.lmaxmax = INPUT.lmaxmax; -// calculation : 2 - NBANDS = INPUT.nbands; // 1 - NBANDS_ISTATE = INPUT.nbands_istate;// 1 - NPOOL = INPUT.npool; // mohan add 2010-06-09 - CALCULATION = INPUT.calculation; // 2 - BERRY_PHASE = INPUT.berry_phase; // 3 +// ucell.lmaxmax = INPUT.lmaxmax; + + NBANDS = INPUT.nbands; + NBANDS_ISTATE = INPUT.nbands_istate; + NPOOL = INPUT.npool; + CALCULATION = INPUT.calculation; + // qianrui add 2021-2-5 + STO_WF.nchi = INPUT.nbands_sto; + STO_WF.nche_sto = INPUT.nche_sto; + + // Electrical Field EFIELD = INPUT.efield; Efield::edir = INPUT.edir; Efield::emaxpos = INPUT.emaxpos; Efield::eopreg = INPUT.eopreg; Efield::eamp = INPUT.eamp; -#ifdef __FP - BFIELD = INPUT.bfield; // mohan add 2011-04-08 - bfid.tesla_x = INPUT.bfield_teslax; - bfid.tesla_y = INPUT.bfield_teslay; - bfid.tesla_z = INPUT.bfield_teslaz; - bfid.Gauge_Origin_x = INPUT.bfield_gauge_x; - bfid.Gauge_Origin_y = INPUT.bfield_gauge_y; - bfid.Gauge_Origin_z = INPUT.bfield_gauge_z; - bfid.convert(); //Zhiyuan add at 2011-12-26, for converting unit to Rydberg - bfid.check(); -#endif - + // optical Optical::opt_epsilon2=INPUT.opt_epsilon2; // mohan add 2010-03-24 Optical::opt_nbands=INPUT.opt_nbands; // number of bands for optical transition. - LDA_PLUS_U = INPUT.lda_plus_u; // 5 - DFT_FUNCTIONAL = INPUT.dft_functional; // 6.5 - NSPIN = INPUT.nspin; // 7 - CURRENT_SPIN = 0; // 8 - VNA = INPUT.vna; - GRID_SPEED = INPUT.grid_speed; // - FORCE = INPUT.force; // 8.1 - FORCE_THR = INPUT.force_thr; // 8.2 - STRESS_THR = INPUT.stress_thr; //LiuXh add 20180515 + + DFT_FUNCTIONAL = INPUT.dft_functional; + NSPIN = INPUT.nspin; + CURRENT_SPIN = 0; + + FORCE = INPUT.force; + FORCE_THR = INPUT.force_thr; + + STRESS_THR = INPUT.stress_thr; PRESS1 = INPUT.press1; PRESS2 = INPUT.press2; PRESS3 = INPUT.press3; -#ifdef __FP - Force_LCAO::force_invalid_threshold_ev = INPUT.force_thr_ev2; -#endif + Force_Stress_LCAO::force_invalid_threshold_ev = INPUT.force_thr_ev2; + BFGS_Basic::w1 = INPUT.bfgs_w1; BFGS_Basic::w2 = INPUT.bfgs_w2; + Ions_Move_Basic::trust_radius_max = INPUT.trust_radius_max; Ions_Move_Basic::trust_radius_min = INPUT.trust_radius_min; Ions_Move_Basic::trust_radius_ini = INPUT.trust_radius_ini; Ions_Move_Basic::out_stru = INPUT.out_stru; //mohan add 2012-03-23 + STRESS = INPUT.stress; - if(INPUT.fixed_axes == "None") // pengfei Li add 2018-11-11 - { - ucell.lc[0] = 1; ucell.lc[1] = 1; ucell.lc[2] = 1; - } + + + // pengfei Li add 2018-11-11 + if(INPUT.fixed_axes == "None") + { + ucell.lc[0] = 1; ucell.lc[1] = 1; ucell.lc[2] = 1; + } else if(INPUT.fixed_axes == "volume") { ucell.lc[0] = 1; ucell.lc[1] = 1; ucell.lc[2] = 1; } - else if(INPUT.fixed_axes == "a") - { - ucell.lc[0] = 0; ucell.lc[1] = 1; ucell.lc[2] = 1; - } - else if(INPUT.fixed_axes == "b") - { - ucell.lc[0] = 1; ucell.lc[1] = 0; ucell.lc[2] = 1; - } - else if(INPUT.fixed_axes == "c") - { - ucell.lc[0] = 1; ucell.lc[1] = 1; ucell.lc[2] = 0; - } - else if(INPUT.fixed_axes == "ab") - { - ucell.lc[0] = 0; ucell.lc[1] = 0; ucell.lc[2] = 1; - } - else if(INPUT.fixed_axes == "ac") - { - ucell.lc[0] = 0; ucell.lc[1] = 1; ucell.lc[2] = 0; - } - else if(INPUT.fixed_axes == "bc") - { - ucell.lc[0] = 1; ucell.lc[1] = 0; ucell.lc[2] = 0; - } - else if(INPUT.fixed_axes == "abc") - { - ucell.lc[0] = 0; ucell.lc[1] = 0; ucell.lc[2] = 0; - } - else - { - WARNING_QUIT("Input", "fixed_axes should be None,a,b,c,ab,ac,bc or abc!"); - } + else if(INPUT.fixed_axes == "a") + { + ucell.lc[0] = 0; ucell.lc[1] = 1; ucell.lc[2] = 1; + } + else if(INPUT.fixed_axes == "b") + { + ucell.lc[0] = 1; ucell.lc[1] = 0; ucell.lc[2] = 1; + } + else if(INPUT.fixed_axes == "c") + { + ucell.lc[0] = 1; ucell.lc[1] = 1; ucell.lc[2] = 0; + } + else if(INPUT.fixed_axes == "ab") + { + ucell.lc[0] = 0; ucell.lc[1] = 0; ucell.lc[2] = 1; + } + else if(INPUT.fixed_axes == "ac") + { + ucell.lc[0] = 0; ucell.lc[1] = 1; ucell.lc[2] = 0; + } + else if(INPUT.fixed_axes == "bc") + { + ucell.lc[0] = 1; ucell.lc[1] = 0; ucell.lc[2] = 0; + } + else if(INPUT.fixed_axes == "abc") + { + ucell.lc[0] = 0; ucell.lc[1] = 0; ucell.lc[2] = 0; + } + else + { + WARNING_QUIT("Input", "fixed_axes should be None,a,b,c,ab,ac,bc or abc!"); + } + MOVE_IONS = INPUT.ion_dynamics; OUT_LEVEL = INPUT.out_level; Ions_Move_CG::CG_THRESHOLD = INPUT.cg_threshold; // pengfei add 2013-09-09 -//---------------------------------------------------------- -// new function (5/5) -//---------------------------------------------------------- - SYMMETRY = INPUT.symmetry; // 9 - MLWF_FLAG = INPUT.mlwf_flag; // 9.1 - //LOCAL_BASIS = INPUT.local_basis; xiaohui modify 2013-09-01 // 10 - //LINEAR_SCALING = INPUT.linear_scaling; xiaohui modify 2013-09-01 // 11 - BASIS_TYPE = INPUT.basis_type; //xiaohui add 2013-09-01 - KS_SOLVER = INPUT.ks_solver; //xiaohui add 2013-09-01 - SEARCH_RADIUS = INPUT.search_radius; // 11.1 - SEARCH_PBC = INPUT.search_pbc; // 11.2 - SPARSE_MATRIX = INPUT.sparse_matrix; // 11.3 - ATOM_DISTRIBUTION = INPUT.atom_distribution; // 11.4 + + Symmetry::symm_flag = INPUT.symmetry; // 9 + BASIS_TYPE = INPUT.basis_type; + KS_SOLVER = INPUT.ks_solver; + SEARCH_RADIUS = INPUT.search_radius; + SEARCH_PBC = INPUT.search_pbc; + //---------------------------------------------------------- // planewave (8/8) //---------------------------------------------------------- @@ -163,29 +153,28 @@ void Input_Conv::Convert(void) INPUT.bz ); GAMMA_ONLY_LOCAL = INPUT.gamma_only_local; + //---------------------------------------------------------- // diagonalization (5/5) //---------------------------------------------------------- - //DIAGO_TYPE = INPUT.diago_type; xiaohui modify 2013-09-01 // 12 - DIAGO_PROC = INPUT.diago_proc; // 12.1 mohan add 2012-01-13 - DIAGO_CG_MAXITER = INPUT.diago_cg_maxiter; // 13 - DIAGO_CG_PREC = INPUT.diago_cg_prec; // 13.1 - DIAGO_DAVID_NDIM = INPUT.diago_david_ndim; // 14 - ETHR = INPUT.ethr; // 15 + DIAGO_PROC = INPUT.diago_proc; + DIAGO_CG_MAXITER = INPUT.diago_cg_maxiter; + DIAGO_CG_PREC = INPUT.diago_cg_prec; + DIAGO_DAVID_NDIM = INPUT.diago_david_ndim; + ETHR = INPUT.ethr; NB2D = INPUT.nb2d; - NURSE = INPUT.nurse; // 21 + NURSE = INPUT.nurse; COLOUR = INPUT.colour; - T_IN_H = INPUT.t_in_h; // 23 - VL_IN_H = INPUT.vl_in_h; // 24 - VNL_IN_H = INPUT.vnl_in_h; // 25 - ZEEMAN_IN_H = INPUT.zeeman_in_h; // - TEST_FORCE = INPUT.test_force; // 26 + T_IN_H = INPUT.t_in_h; + VL_IN_H = INPUT.vl_in_h; + VNL_IN_H = INPUT.vnl_in_h; + TEST_FORCE = INPUT.test_force; TEST_STRESS = INPUT.test_stress; - FS_REF_ENERGY = INPUT.fs_ref_energy; // 16 + //---------------------------------------------------------- // iteration (1/3) //---------------------------------------------------------- - DRHO2 = INPUT.dr2; // 17 + DRHO2 = INPUT.dr2; //---------------------------------------------------------- // wavefunction / charge / potential / (2/4) @@ -195,48 +184,32 @@ void Input_Conv::Convert(void) wf.mem_saver = INPUT.mem_saver; //mohan add 2010-09-07 en.printe = INPUT.printe; // mohan add 2011-03-16 - - //DC_Info::dcnx = INPUT.dc_nx; - //DC_Info::dcny = INPUT.dc_ny; - //DC_Info::dcnz = INPUT.dc_nz; - -/* //---------------------------------------------------------- -// about vdwD2 //Peize Lin add 2014-03-31 -//---------------------------------------------------------- - if(INPUT.vdwD2) - { - vdwd2.vdwD2 = INPUT.vdwD2; - vdwd2.scaling = INPUT.vdwD2_scaling; - vdwd2.damping = INPUT.vdwD2_d; - vdwd2.C6_input(INPUT.vdwD2_C6_file, INPUT.vdwD2_C6_unit); - vdwd2.R0_input(INPUT.vdwD2_R0_file, INPUT.vdwD2_R0_unit); - vdwd2.model = INPUT.vdwD2_model; - if(INPUT.vdwD2_model=="radius") - if(INPUT.vdwD2_radius_unit=="Bohr") - vdwd2.radius = INPUT.vdwD2_radius; - else - vdwd2.radius = INPUT.vdwD2_radius * BOHR_TO_A; - else if(INPUT.vdwD2_model=="period") - vdwd2.period = INPUT.vdwD2_period; - } */ //---------------------------------------------------------- -// about vdw //jiyy add 2019-08-04 +// about vdw, jiyy add 2019-08-04 //---------------------------------------------------------- if(INPUT.vdw_method=="d2") { - vdwd2.vdwD2 = true; - vdwd2.scaling = std::stod(INPUT.vdw_s6); - vdwd2.damping = INPUT.vdw_d; - vdwd2.C6_input(INPUT.vdw_C6_file, INPUT.vdw_C6_unit); - vdwd2.R0_input(INPUT.vdw_R0_file, INPUT.vdw_R0_unit); - vdwd2.model = INPUT.vdw_model; + vdwd2_para.flag_vdwd2 = true; + vdwd2_para.scaling = std::stod(INPUT.vdw_s6); + vdwd2_para.damping = INPUT.vdw_d; + vdwd2_para.C6_input(INPUT.vdw_C6_file, INPUT.vdw_C6_unit); + vdwd2_para.R0_input(INPUT.vdw_R0_file, INPUT.vdw_R0_unit); + vdwd2_para.model = INPUT.vdw_model; if(INPUT.vdw_model=="radius") + { if(INPUT.vdw_radius_unit=="Bohr") - vdwd2.radius = std::stod(INPUT.vdw_radius); + { + vdwd2_para.radius = std::stod(INPUT.vdw_radius); + } else - vdwd2.radius = std::stod(INPUT.vdw_radius) * BOHR_TO_A; + { + vdwd2_para.radius = std::stod(INPUT.vdw_radius) * BOHR_TO_A; + } + } else if(INPUT.vdw_model=="period") - vdwd2.period = INPUT.vdw_period; + { + vdwd2_para.period = INPUT.vdw_period; + } } if(INPUT.vdw_method=="d3_0" || INPUT.vdw_method=="d3_bj") { @@ -283,11 +256,13 @@ void Input_Conv::Convert(void) } //---------------------------------------------------------- -// about spectrum // pengfei 2016-12-14 +// about spectrum, pengfei 2016-12-14 //---------------------------------------------------------- - //if( (INPUT.epsilon && (INPUT.epsilon_choice == 0)) || ((!INPUT.epsilon) && (INPUT.epsilon_choice == 0) && INPUT.kmesh_interpolation)) - if( (INPUT.spectral_type == "eels" && INPUT.eels_method == 0) || (INPUT.spectral_type == "None" && INPUT.eels_method == 0 && INPUT.kmesh_interpolation) ) + if( (INPUT.spectral_type == "eels" && INPUT.eels_method == 0) + || (INPUT.spectral_type == "None" + && INPUT.eels_method == 0 + && INPUT.kmesh_interpolation) ) { if(INPUT.spectral_type == "eels") { @@ -305,8 +280,15 @@ void Input_Conv::Convert(void) chi0_hilbert.nomega = INPUT.nomega; chi0_hilbert.dim = INPUT.ecut_chi; //chi0_hilbert.oband = INPUT.oband; - chi0_hilbert.q_start[0] = INPUT.q_start[0]; chi0_hilbert.q_start[1] = INPUT.q_start[1]; chi0_hilbert.q_start[2] = INPUT.q_start[2]; - chi0_hilbert.direct[0] = INPUT.q_direct[0]; chi0_hilbert.direct[1] = INPUT.q_direct[1]; chi0_hilbert.direct[2] = INPUT.q_direct[2]; + + chi0_hilbert.q_start[0] = INPUT.q_start[0]; + chi0_hilbert.q_start[1] = INPUT.q_start[1]; + chi0_hilbert.q_start[2] = INPUT.q_start[2]; + + chi0_hilbert.direct[0] = INPUT.q_direct[0]; + chi0_hilbert.direct[1] = INPUT.q_direct[1]; + chi0_hilbert.direct[2] = INPUT.q_direct[2]; + //chi0_hilbert.start_q = INPUT.start_q; //chi0_hilbert.interval_q = INPUT.interval_q; chi0_hilbert.nq = INPUT.nq; @@ -318,9 +300,13 @@ void Input_Conv::Convert(void) chi0_hilbert.kmesh_interpolation = INPUT.kmesh_interpolation; for(int i=0; i<100; i++) { - chi0_hilbert.qcar[i][0] = INPUT.qcar[i][0]; chi0_hilbert.qcar[i][1] = INPUT.qcar[i][1]; chi0_hilbert.qcar[i][2] = INPUT.qcar[i][2]; + chi0_hilbert.qcar[i][0] = INPUT.qcar[i][0]; + chi0_hilbert.qcar[i][1] = INPUT.qcar[i][1]; + chi0_hilbert.qcar[i][2] = INPUT.qcar[i][2]; } - chi0_hilbert.lcao_box[0] = INPUT.lcao_box[0]; chi0_hilbert.lcao_box[1] = INPUT.lcao_box[1]; chi0_hilbert.lcao_box[2] = INPUT.lcao_box[2]; + chi0_hilbert.lcao_box[0] = INPUT.lcao_box[0]; + chi0_hilbert.lcao_box[1] = INPUT.lcao_box[1]; + chi0_hilbert.lcao_box[2] = INPUT.lcao_box[2]; } //if( INPUT.epsilon && (INPUT.epsilon_choice == 1)) @@ -334,8 +320,12 @@ void Input_Conv::Convert(void) chi0_standard.nomega = INPUT.nomega; chi0_standard.dim = INPUT.ecut_chi; //chi0_standard.oband = INPUT.oband; - chi0_standard.q_start[0] = INPUT.q_start[0]; chi0_standard.q_start[1] = INPUT.q_start[1]; chi0_standard.q_start[2] = INPUT.q_start[2]; - chi0_standard.direct[0] = INPUT.q_direct[0]; chi0_standard.direct[1] = INPUT.q_direct[1]; chi0_standard.direct[2] = INPUT.q_direct[2]; + chi0_standard.q_start[0] = INPUT.q_start[0]; + chi0_standard.q_start[1] = INPUT.q_start[1]; + chi0_standard.q_start[2] = INPUT.q_start[2]; + chi0_standard.direct[0] = INPUT.q_direct[0]; + chi0_standard.direct[1] = INPUT.q_direct[1]; + chi0_standard.direct[2] = INPUT.q_direct[2]; //chi0_standard.start_q = INPUT.start_q; //chi0_standard.interval_q = INPUT.interval_q; chi0_standard.nq = INPUT.nq; @@ -366,8 +356,11 @@ void Input_Conv::Convert(void) epsilon0_vasp.eta = INPUT.eta; } - //added by zhengdy-soc - if(INPUT.noncolin||INPUT.lspinorb) { +//-------------------------------------------- +// added by zhengdy-soc +//-------------------------------------------- + if(INPUT.noncolin||INPUT.lspinorb) + { NSPIN = 4; } if(NSPIN == 4) @@ -423,11 +416,13 @@ void Input_Conv::Convert(void) val_elec_03 = INPUT.val_elec_03; vext = INPUT.vext; vext_dire = INPUT.vext_dire; - + + + // jiyy add 2020.10.11 ocp = INPUT.ocp; //ocp_n = INPUT.ocp_n; ocp_set = INPUT.ocp_set; - if(ocp == 1) // jiyy add 2020.10.11 + if(ocp == 1) { int count = 0; string pattern("([0-9]+\\*[0-9.]+|[0-9,.]+)"); @@ -444,7 +439,9 @@ void Input_Conv::Convert(void) pos2 = ocp_set.find(c, pos1); } if(pos1 != ocp_set.length()) + { str.push_back(ocp_set.substr(pos1)); + } regex_t reg; regcomp(®, pattern.c_str(), REG_EXTENDED); @@ -453,7 +450,9 @@ void Input_Conv::Convert(void) for(int i=0; ichange(ofs_warning,"force_thr threshold(Ry/Bohr)",Force_LCAO::force_invalid_threshold_ev,force_thr_ev2); - Force_LCAO::force_invalid_threshold_ev = this->force_thr_ev2; + this->change(ofs_warning,"force_thr threshold(Ry/Bohr)",Force_Stress_LCAO::force_invalid_threshold_ev,force_thr_ev2); + Force_Stress_LCAO::force_invalid_threshold_ev = this->force_thr_ev2; } } #endif @@ -148,10 +148,10 @@ bool Update_input::Read(const string &fn) else if (strcmp("mixing_beta", word) == 0) { read_value(ifs, mixing_beta); - if(mixing_beta!=chr.mixing_beta) + if(mixing_beta!=CHR.mixing_beta) { - this->change(ofs_warning,"mixing_beta",chr.mixing_beta,mixing_beta); - chr.mixing_beta = mixing_beta; + this->change(ofs_warning,"mixing_beta",CHR.mixing_beta,mixing_beta); + CHR.mixing_beta = mixing_beta; } } // 8 @@ -188,10 +188,10 @@ bool Update_input::Read(const string &fn) else if (strcmp("out_charge", word) == 0) { read_value(ifs, out_charge); - if(out_charge!=chr.out_charge) + if(out_charge!=CHR.out_charge) { - this->change(ofs_warning,"out_charge",chr.out_charge,out_charge); - chr.out_charge = this->out_charge; + this->change(ofs_warning,"out_charge",CHR.out_charge,out_charge); + CHR.out_charge = this->out_charge; } } // 11 @@ -267,14 +267,14 @@ void Update_input::Bcast() { Parallel_Common::bcast_int( FORCE ); Parallel_Common::bcast_double( FORCE_THR); - Parallel_Common::bcast_double( Force_LCAO::force_invalid_threshold_ev); + Parallel_Common::bcast_double( Force_Stress_LCAO::force_invalid_threshold_ev); Parallel_Common::bcast_double( DRHO2 ); Parallel_Common::bcast_int( NITER ); Parallel_Common::bcast_int( NSTEP ); - Parallel_Common::bcast_double( chr.mixing_beta ); + Parallel_Common::bcast_double( CHR.mixing_beta ); Parallel_Common::bcast_int( en.printe ); Parallel_Common::bcast_string( pot.extra_pot );//xiaohui modify 2015-02-01 - Parallel_Common::bcast_int( chr.out_charge ); + Parallel_Common::bcast_int( CHR.out_charge ); Parallel_Common::bcast_int( LOC.out_dm ); Parallel_Common::bcast_int( en.out_dos ); Parallel_Common::bcast_int( ParaO.out_lowf ); diff --git a/ABACUS.develop/source/src_lcao/update_input.h b/ABACUS.develop/source/input_update.h similarity index 100% rename from ABACUS.develop/source/src_lcao/update_input.h rename to ABACUS.develop/source/input_update.h diff --git a/ABACUS.develop/source/main.cpp b/ABACUS.develop/source/main.cpp index 0745e9ccbb..2811b7bc1c 100644 --- a/ABACUS.develop/source/main.cpp +++ b/ABACUS.develop/source/main.cpp @@ -2,27 +2,60 @@ // AUTHOR : mohan // DATE : 2008-11-10 //========================================================== -#include "dc_driv.h" +#include "driver.h" #include "src_parallel/parallel_global.h" #include "src_global/global_variable.h" +#include "src_global/timer.h" + #include + void calculate(); int main(int argc, char **argv) { Parallel_Global::read_mpi_parameters(argc,argv); + calculate(); + return 0; } + void calculate() { - // divide and conqure (DC) starts here, - DC_Driv DD; + + time_t time_start = std::time(NULL); + + timer::start(); + + //---------------------------------------------------------- + // main program for doing electronic structure calculations + //---------------------------------------------------------- + Driver DD; DD.init(); + time_t time_finish= std::time(NULL); + + // print out information before ABACUS ends + cout << "\n START Time : " << ctime(&time_start); + cout << " FINISH Time : " << ctime(&time_finish); + cout << " TOTAL Time : " << difftime(time_finish, time_start) << endl; + cout << " SEE INFORMATION IN : "< 1, After reading in NPOOL, - // divide the NPROC processprs into NPOOL. - Pkpoints.init(); -#endif - - // (3) Read in parameters about wannier functions. - winput::Init( global_wannier_card ); - - //xiaohui move 3 lines, 2015-09-30 - //stringstream ss2; - //ss2 << global_out_dir << "INPUTw"; - //winput::Print( ss2.str() ); - - // (4) Print the parameters into INPUT file. - stringstream ss1; - ss1 << global_out_dir << global_in_card; - INPUT.Print( ss1.str() ); - //DONE(ofs_running,"READING CARDS"); - - // (5) Setup the unitcell. - ucell.setup_cell( global_pseudo_dir , global_atom_card , ofs_running); - DONE(ofs_running, "SETUP UNITCELL"); - - // (6) symmetry analysize. - if (SYMMETRY) - { - symm.analy_sys(); - DONE(ofs_running, "SYMMETRY"); - } - - // (7) Setup the k points according to symmetry. - kv.set( symm, global_kpoint_card, NSPIN, ucell.G, ucell.latvec ); - DONE(ofs_running,"INIT K-POINTS"); - - // (8) About Wannier functions, not used now. - //wannier::init_dir( ofs_running ); - - // (9) check the number of basis - // mohan add 2011-01-5 - //if( LOCAL_BASIS ) xiaohui modify 2013-09-01 - if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-01. Attention! Maybe there is some problem. - { - if( NLOCAL < NBANDS ) - { - WARNING_QUIT("UnitCell_pseudo::cal_nwfc","NLOCAL < NBANDS"); - } - else - { - //OUT(ofs_running,"NLOCAL",NLOCAL); - OUT(ofs_running,"NBASE",NLOCAL); - OUT(ofs_running,"NBANDS",NBANDS); - } - } - - timer::tick("Run_Frag","frag_init",'B'); - return; -} - -void Run_Frag::frag_LCAO_line(void) -{ - TITLE("Run_Frag","frag_lcao_line"); - timer::tick("Run_Frag","frag_LCAO_line",'B'); - - // (2) Init the charge density. - chr.init(); - DONE(ofs_running,"INIT CHARGE"); - - // (3) Init the potential. - pot.init(pw.nrxx); - DONE(ofs_running,"INIT POTENTIAL"); - - // declration - enum use_wf_coef {SOME_PW, ALL_LO}; - use_wf_coef uoc = ALL_LO; - - switch (uoc) - { - case ALL_LO: - // (4) Init the local wave functions. - wf.init_local(); - // (5) Init the FFT. - UFFT.allocate(); - // (6) Init the hamiltonian. - // first0 stands for nkb, but no used. - // second0 stands for no use hpw.init() - hm.init(0); - // (7) Init the local part of NC pseudopotential. - ppcell.init_vloc(); - // (8) Init the potential. - pot.init_pot(0);//atomic_rho, v_of_rho, set_vrs - break; - case SOME_PW: - wf.init(kv.nks); - UFFT.allocate(); - ppcell.init(ucell.ntype); - hm.init(); - ppcell.init_vloc(); - ppcell.init_vnl(); - pot.init_pot(0);//atomic_rho, v_of_rho, set_vrs - pot.newd();//once - DONE(ofs_running,"INIT POTENTIAL"); - wf.wfcinit(); - DONE(ofs_running,"INIT SOME_PW"); - break; - } - - //Quxin added for DFT+U - if(INPUT.dft_plus_u) dftu.init(); - - Local_Orbital_Ions ions; - ions.opt_ions(); - en.perform_dos(); - - timer::tick("Run_Frag","frag_LCAO_line",'B'); - return; -} - -void Run_Frag::frag_pw_line(void) -{ - TITLE("Run_Frag","frag_pw_line"); - timer::tick("Run_Frag","frag_pw_line",'B'); - -//---------------------------------------------------------- -// preprocess part, consist of : -// 1 print out copyright informations: version,authors, ... -// 2 read in initial data: -// a lattice structure:atom_species,atom_positions,lattice vector -// b k_points -// c pseudopotential -// 3 setup planeware basis, FFT,structure factor, ... -// 4 initialize local and nonlocal pseudopotential in G_space -// 5 initialize charge desity and warefunctios in G_space -//---------------------------------------------------------- - - //if (winput::begin_stop_flag) - //{ - // wannier::begin_stop(); - //} - - //===================== - // init potential - //===================== - chr.init(); - pot.init(pw.nrxx); - //===================== - // init wave functions - //===================== - wf.init(kv.nks); - UFFT.allocate(); - - //======================= - // init pseudopotential - //======================= - ppcell.init(ucell.ntype); - //===================== - // init hamiltonian - //===================== - hm.init(); -// DONE(ofs_running,"CHARGE, POTENTIAL, WAVE FUNCTINOS ALLOCATION"); - //================================= - // initalize local pseudopotential - //================================= - ppcell.init_vloc(); - DONE(ofs_running,"LOCAL POTENTIAL"); - //====================================== - // Initalize non local pseudopotential - //====================================== - ppcell.init_vnl(); - DONE(ofs_running,"NON-LOCAL POTENTIAL"); - //========================================================= - // calculate the total local pseudopotential in real space - //========================================================= - pot.init_pot(0);//atomic_rho, v_of_rho, set_vrs - - pot.newd();//once - DONE(ofs_running,"INIT POTENTIAL"); - - //================================================== - // create ppcell.tab_at , for trial wave functions. - //================================================== - wf.init_at_1(); - //================================== - // Initial localized wave functions - //================================== - //if (LOCAL_BASIS == 1) wannier::running( ofs_running ); - - //================================ - // Initial start wave functions - //================================ - wf.wfcinit(); - - //if (winput::before_iter) - //{ - // wannier::running( ofs_running ) ; - // return; - //} - - DONE(ofs_running,"INIT BASIS"); - //========================================================= - // - // Third Part: Electronic structure calculation begin! - // - //========================================================= - // -// if(SCF || (!SCF && LOCAL_BASIS==0) ) -// { - Ions ions; - ions.opt_ions_pw(); - -// } - //if (LOCAL_BASIS==0 && winput::out_spillage) xiaohui modify 2013-09-01 - if(BASIS_TYPE=="pw" && winput::out_spillage) //xiaohui add 2013-09-01 - { - //cout << "\n Output Spillage Information : " << endl; - // calculate spillage value. - if ( winput::out_spillage == 3) - { - // control here!! - //LOCAL_BASIS = 0; xiaohui modify 2013-09-01 - BASIS_TYPE="pw"; //xiaohui add 2013-09-01 - //LOCAL_BASIS = 0; - cout << " NLOCAL = " << NLOCAL << endl; - - for (int ik=0; ik +#include +using namespace std; + +template +static void print_tmp(const T &S) +{ + for( const auto &s1 : S) + { + const auto i1=s1.first; + for( const auto &s2 : s1.second ) + { + const auto i2=s2.first; + for( const auto &s3 : s2.second ) + { + const auto i3=s3.first; + cout<,weak_ptr>>> &ms, ofstream &ofs) +{ + for( const auto & c1 : ms ) + for( const auto & c2 : c1.second ) + for( const auto & c3 : c2.second ) + { + ofs<,shared_ptr>>> &ms, ofstream &ofs) +{ + for( const auto & c1 : ms ) + for( const auto & c2 : c1.second ) + for( const auto & c3 : c2.second ) + { + ofs<1E-10) + { + if(std::imag(m(ir,ic))>1E-10) + os< + +static void test_adjs( ostream & os ) +{ + for( size_t it=0; it!=ucell.ntype; ++it ) + for( size_t ia=0; ia!=ucell.atoms[it].na; ++ia ) + { + const int iat = ucell.itia2iat(it,ia); + const map>> adjs = Abfs::get_adjs(iat); + os<<"@@@\t"< &box2 : atom2.second ) + os< +#include +#include + +static void print_orbs( const vector>>> & orbs, const std::string & file_name ) +{ + std::ofstream ofsN(file_name); + for( size_t T=0; T!=orbs.size(); ++T ) + for( size_t L=0; L!=orbs[T].size(); ++L ) + for( size_t N=0; N!=orbs[T][L].size(); ++N ) + { + ofsN<>> & orbs, const std::string & file_name ) +{ + std::ofstream ofsN(file_name); + for( size_t T=0; T!=orbs.size(); ++T ) + for( size_t L=0; L!=orbs[T].size(); ++L ) + for( size_t N=0; N!=orbs[T][L].size(); ++N ) + { + ofsN< +#include +#include +#include +#include "src_global/global_function.h" +#include "src_global/matrix.h" +#include "src_pw/global.h" + +class Exx_Abfs_DM_Test +{ +public: + static map>> cal_DMk_raw_readfile( const set> &atom_pairs ); + static vector>> read_wfc( const string &file_name ); + static matrix read_wg( const string &file_name ); +}; + +map>> +Exx_Abfs_DM_Test::cal_DMk_raw_readfile( const set> &atom_pairs ) +{ + static int istep=-1; ++istep; + TITLE("cal_DMk_raw_readfile_"+TO_STRING(istep)); + matrix wf_wg = read_wg( "wf.wg/wf.wg_"+TO_STRING(istep) ); + vector>>> wfc(kv.nks); + for( size_t ik=0; ik!=kv.nks; ++ik ) + wfc[ik] = read_wfc( "hvec/hvec_"+TO_STRING(istep)+"_"+TO_STRING(ik) ); + + + const double SPIN_multiple = 0.5*NSPIN; + + map>> DMk_raw; + for( const pair & atom_pair : atom_pairs ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + const size_t it1 = ucell.iat2it[iat1]; + const size_t it2 = ucell.iat2it[iat2]; + const size_t ia1 = ucell.iat2ia[iat1]; + const size_t ia2 = ucell.iat2ia[iat2]; + + DMk_raw[iat1][iat2] = vector( kv.nks, {ucell.atoms[it1].nw,ucell.atoms[it2].nw} ); + for( size_t ik=0; ik!=kv.nks; ++ik ) + { + for( size_t iw1=0; iw1!=ucell.atoms[it1].nw; ++iw1 ) + { + for( size_t iw2=0; iw2!=ucell.atoms[it2].nw; ++iw2 ) + { + for( size_t ib=0; ib!=NBANDS; ++ib ) + { + DMk_raw[iat1][iat2][ik](iw1,iw2) += wf_wg(ik,ib) * conj(wfc[ik][ib][ucell.itiaiw2iwt(it1,ia1,iw1)]) * wfc[ik][ib][ucell.itiaiw2iwt(it2,ia2,iw2)]; + } + } + } + DMk_raw[iat1][iat2][ik] *= SPIN_multiple; + } + } + return DMk_raw; +} + + + +vector>> Exx_Abfs_DM_Test::read_wfc( const string &file_name ) +{ + vector>> wfc(NBANDS,vector>(NLOCAL)); + ifstream ifs(file_name); + for( size_t iw=0; iw!=NLOCAL; ++iw ) + { + for( size_t ib=0; ib!=NBANDS; ++ib ) + { + double a,b; + ifs>>a>>b; + wfc[ib][iw] = {a,b}; + } + } + ifs.close(); + return wfc; +} + + + +matrix Exx_Abfs_DM_Test::read_wg( const string &file_name ) +{ + matrix wf_wg(kv.nks,NBANDS); + ifstream ifs(file_name); + for( size_t ik=0; ik!=kv.nks; ++ik ) + { + for( size_t ib=0; ib!=NBANDS; ++ib ) + { + ifs>>wf_wg(ik,ib); + } + } + ifs.close(); + return wf_wg; +} diff --git a/ABACUS.develop/source/src_external/src_test/src_ri/exx_abfs-inverse_matrix_double-test.h b/ABACUS.develop/source/src_external/src_test/src_ri/exx_abfs-inverse_matrix_double-test.h new file mode 100644 index 0000000000..930e55ea4a --- /dev/null +++ b/ABACUS.develop/source/src_external/src_test/src_ri/exx_abfs-inverse_matrix_double-test.h @@ -0,0 +1,466 @@ +#ifndef EXX_ABFS_INVERSE_MATRIX_DOUBLE_TEST_H +#define EXX_ABFS_INVERSE_MATRIX_DOUBLE_TEST_H + +#include "src_lcao/exx_abfs-inverse_matrix_double.h" + +matrix init_matrix(); + +int inverse_matrix_double_test() +{ + matrix m = init_matrix(); + matrix mI(m.nr,m.nc); + + Exx_Abfs::Inverse_Matrix_Double I; + I.init(m.nr); + I.input(m); + I.cal_inverse( Exx_Abfs::Inverse_Matrix_Double::Method::dsyev ); + I.output(mI); + + ofstream ofs("m_mI.dat"); + ofs< +#include +#include "src_ri/abfs.h" + +static void test_screen( const string & file_name, const map,double>>> & m ) +{ + ofstream ofs(file_name); + for( const auto m1 : m ) + for( const auto m2 : m1.second ) + for( const auto m3 : m2.second ) + ofs< +#include +using namespace std; + +#include "src_ri/exx_abfs.h" + +#include "src_external/src_test/src_global/matrix-test.h" +#include "src_external/src_test/src_ri/exx_abfs-unittest.h" + +static void of_abfs_cpp( const string &file_name, const vector>> &orb ) +{ + for( int i=0; i!=orb.size(); ++i ) + for( int j=0; j!=orb[i].size(); ++j ) + for( int k=0; k!=orb[i][j].size(); ++k ) + { + stringstream ss; ss<>>> &matrix ) +{ + for( const auto & m1 : matrix ) + { + const size_t TA = m1.first; + { + for( const auto & m2 : m1.second ) + { + const size_t IA = m2.first; + for( const auto & m3 : m2.second ) + { + const size_t TB = m3.first; + for( const auto & m4 : m3.second ) + { + const size_t IB = m4.first; + const auto & m = m4.second; + + cout<>>> &ms ) +{ + ofstream ofs(file_name.c_str()); + ofs<<"0000"<>>>> &ms ) +{ + ofstream ofs(file_name.c_str()); + ofs<<"0000"<>>>>> &ms ) +{ + ofstream ofs(file_name.c_str()); + ofs<<"0000"< +#include +#include +#include +#include +#include +using namespace std; + +inline double time_during ( const timeval &t_start, const timeval &t_end ) +{ + return (double)(t_end.tv_sec-t_start.tv_sec) + (double)(t_end.tv_usec-t_start.tv_usec)/1000000.0; +}; +inline double time_during ( const timeval &t_start ) +{ + timeval t_end; + gettimeofday( &t_end, NULL ); + return time_during(t_start,t_end); +}; +inline double time_cut(timeval &t) +{ + const double t_delta = time_during(t); + gettimeofday(&t, NULL ); + return t_delta; +} + + + +inline size_t get_sizeof( const matrix & m ){ return sizeof(double)*m.nr*m.nc; } +inline size_t get_sizeof( const ComplexMatrix & m ){ return sizeof(double)*m.nr*m.nc; } +inline size_t get_sizeof( const shared_ptr & m ){ return sizeof(matrix)+sizeof(double)*m->nr*m->nc; } +inline size_t get_sizeof( const shared_ptr & m ){ return sizeof(ComplexMatrix)+sizeof(double)*m->nr*m->nc; } +inline size_t get_sizeof( const weak_ptr & m ){ return sizeof(matrix)+sizeof(double)*m.lock()->nr*m.lock()->nc; } +inline size_t get_sizeof( const weak_ptr & m ){ return sizeof(ComplexMatrix)+sizeof(double)*m.lock()->nr*m.lock()->nc; } +template static size_t get_sizeof( const vector & v ) +{ + size_t length = sizeof(T)*v.size(); + for( const T & i : v ) length+=get_sizeof(i); + return length; +} +template static size_t get_sizeof( const map & m ) +{ + size_t length = (sizeof(T1)+sizeof(T2))*m.size(); + for( const auto & i : m ) length+=get_sizeof(i.second); + return length; +} + + + +template +static void ofs_matrixes( const string & file_name, const map &ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + for( const auto &m : ms ) + { + ofs< +static void ofs_matrixes( const string & file_name, const vector &ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + for( size_t i=0; i +static void ofs_matrixes( const string & file_name, const weak_ptr & ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + if(flag_print_content) + ofs<<*ms.lock()< +static void ofs_matrixes( const string & file_name, const shared_ptr & ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + if(flag_print_content) + ofs<<*ms< +static void ofs_matrixes( const string & file_name, const map>>> & ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + for( const auto &m1 : ms ) + { + const auto i1 = m1.first; + for( const auto &m2 : m1.second ) + { + const auto i2 = m2.first; + for( const auto &m3 : m2.second ) + { + const auto i3 = m3.first; + ofs< +static void ofs_matrixes( const string & file_name, const map>>> & ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + for( const auto &m1 : ms ) + { + const auto i1 = m1.first; + for( const auto &m2 : m1.second ) + { + const auto i2 = m2.first; + for( const auto &m3 : m2.second ) + { + const auto i3 = m3.first; + ofs< +static void ofs_matrixes( const string & file_name, const map>> & ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + for( const auto &m1 : ms ) + { + const auto i1 = m1.first; + for( const auto &m2 : m1.second ) + { + const auto i2 = m2.first; + for( size_t i3=0; i3!=m2.second.size(); ++i3 ) + { + ofs< +static void ofs_matrixes( const string & file_name, const map>>> & ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + for( const auto &m1 : ms ) + { + const auto i1 = m1.first; + for( const auto &m2 : m1.second ) + { + const auto i2 = m2.first; + for( const auto &m3 : m2.second ) + { + const auto i3 = m3.first; + for( size_t i4=0; i4!=m3.second.size(); ++i4 ) + { + ofs< +static void ofs_matrixes( const string & file_name, const map>> & ms, const bool flag_print_content=true ) +{ + ofstream ofs(file_name,ofstream::app); + for( const auto &m1 : ms ) + { + const auto i1 = m1.first; + for( const auto &m2 : m1.second ) + { + const auto i2 = m2.first; + for( const auto &m3 : m2.second ) + { + const auto i3 = m3.first; + ofs< #include +#include +#include #include #include #include @@ -14,7 +16,7 @@ static void MPI_RANK_OFSTREAM( const std::string& file_name, std::stringstream & int my_rank; MPI_Comm_rank(MPI_COMM_WORLD,&my_rank); file< static std::ostream & operator<<( std::ostream & os, const std::vector &v ) { + os<<"["; for( const T &i : v ) - os< +static std::ostream & operator<<( std::ostream & os, const std::set &v ) +{ + os<<"("; + for( const T &i : v ) + os< +static std::ostream & operator<<( std::ostream & os, const std::map &v ) +{ + for( const auto &i : v ) +// os<<"{"< +static std::ostream & operator<<( std::ostream & os, const std::pair &p ) +{ + os<<"<"<"; return os; } @@ -38,5 +71,29 @@ static double cal_time( const timeval &t_begin ) return (double)(t_end.tv_sec-t_begin.tv_sec) + (double)(t_end.tv_usec-t_begin.tv_usec)/1000000.0; } +// Peize Lin add 2016-10-10 +static double cut_time( timeval &t ) +{ + const double time = cal_time(t); + gettimeofday( &t, NULL); + return time; +} + +// Peize Lin add 2019-12-12 +static vector get_memory(const int N) +{ + vector m; + string s; + ifstream ifs("/proc/meminfo"); + ifs>>s>>s; + m.push_back(stoi(s)/1024); + for(int i=1; i>s>>s>>s; + m.push_back(stoi(s)/1024); + } + ifs.close(); + return m; +} #endif // TEST_FUNCTION_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_lcao/blas_interface.h b/ABACUS.develop/source/src_global/blas_interface.h similarity index 100% rename from ABACUS.develop/source/src_lcao/blas_interface.h rename to ABACUS.develop/source/src_global/blas_interface.h diff --git a/ABACUS.develop/source/src_global/complexmatrix.h b/ABACUS.develop/source/src_global/complexmatrix.h index 4dea2e8248..34fdfe2b47 100644 --- a/ABACUS.develop/source/src_global/complexmatrix.h +++ b/ABACUS.develop/source/src_global/complexmatrix.h @@ -29,7 +29,7 @@ class ComplexMatrix ComplexMatrix(const int nrows,const int ncols,const bool flag_zero=true); // Peize Lin add flag_zero 2019-05-13 ComplexMatrix(const ComplexMatrix &m1); ComplexMatrix(ComplexMatrix && m1); // Peize Lin add 2016-08-05 - ComplexMatrix(const matrix &m); // Peize Lin add 2017-03-29 + explicit ComplexMatrix(const matrix &m); // Peize Lin add 2017-03-29 ~ComplexMatrix(); void create(const int nrow,const int ncol,const bool flag_zero=true); // Peize Lin add flag_zero 2019-05-13 diff --git a/ABACUS.develop/source/src_global/constants.h b/ABACUS.develop/source/src_global/constants.h index c4e9fc1947..6e0b31b71a 100644 --- a/ABACUS.develop/source/src_global/constants.h +++ b/ABACUS.develop/source/src_global/constants.h @@ -11,7 +11,6 @@ using namespace std; // GLOBAL CONSTANTS //========================================================== - //========================================================== // EXPLAIN : constants // NAME : pi @@ -36,6 +35,7 @@ const double SQRT3 = 1.73205080756887729352; //========================================================== const complex ZERO(0.0, 0.0); const complex ONE(1.0, 0.0); +const complex NEG_ONE(-1.0, 0.0); const complex IMAG_UNIT(0.0,1.0); const complex NEG_IMAG_UNIT(0.0,-1.0); @@ -93,46 +93,7 @@ const double AMCONV = 1.660538782e-27 / 9.10938215e-31 * 0.50; // mass conversio const double uakbar = 147105.0; // pressure conversion from Ry/(a.u)^3 to K // zero up to a given accuracy -const double eps4 = 1.0e-4; -const double eps8 = 1.0e-8; -const double eps9 = 1.0e-9; -const double eps16 = 1.0e-16; -const double eps32 = 1.0e-32; const double epsr = 1.0e-6; const double epsg = 1.0e-10; -//========================================================== -// EXPLAIN : max constants we limit.(x stands for max) -// NAME : nspinx( max number of sionors ) -// NAME : ntypx( max number of different types of atom) -// NAME : npsx( max number of different PPs) -// NAME : natx( maximum number of atoms ) -// NAME : nbndxx( maximum number of electronic states ) -// NAME : MAX_KPOINTS( max number of k-points) -// NAME : nchix( max number of atomic wavefunctions per atom) -// NAME : ndmx( max number of points in the atomic radial mesh) -//========================================================== -const int nspinx= 4; -const int ntypx = 50; -const int npsx = ntypx; -const int natx = 1000000; -const int nbndxx= 4000000; -const int MAX_KPOINTS = 40000;// npk -const int nchix = 10; -const int nchix_nc = 20; -const int ndmx = 2000; - -//========================================================== -// NAME : lmaxx( max non-local angular momentum) -// NAME : nbrx( max number of beta functions ) -// NAME : lqmax( max number of angular momenta of Q) -// NAME : nqfx( max number of coefficients in Q smoothing) -//========================================================== -#ifndef __EPM -const int lmaxx = 3; -const int nbrx = 10; -const int nbrx_nc = 20; -const int lqmax = 2*lmaxx + 1; -const int nqfx = 8; -#endif #endif diff --git a/ABACUS.develop/source/src_global/container_operator.h b/ABACUS.develop/source/src_global/container_operator.h new file mode 100644 index 0000000000..eaaf220e39 --- /dev/null +++ b/ABACUS.develop/source/src_global/container_operator.h @@ -0,0 +1,69 @@ +#ifndef CONTAINER_OPERATOR_H +#define CONTAINER_OPERATOR_H + +#include +#include +#include +using namespace std; + + + +template< typename T> +vector operator + ( const vector & x1, const vector & x2 ) +{ + assert(x1.size()==x2.size()); + vector x; + for( size_t i=0; i!=x1.size(); ++i ) + x.push_back(x1[i]+x2[i]); + return x; +} + +template< typename T> +vector operator - ( const vector & x1, const vector & x2 ) +{ + assert(x1.size()==x2.size()); + vector x; + for( size_t i=0; i!=x1.size(); ++i ) + x.push_back(x1[i]-x2[i]); + return x; +} + +template< typename T1, typename T2 > +map operator + ( const map & x1, const map & x2 ) +{ + map x; + for( const auto &x1i : x1 ) + x.insert(make_pair( x1i.first, x1i.second + x2.at(x1i.first) )); + return x; +} + +template< typename T1, typename T2 > +map operator - ( const map & x1, const map & x2 ) +{ + map x; + for( const auto &x1i : x1 ) + x.insert(make_pair( x1i.first, x1i.second - x2.at(x1i.first) )); + return x; +} + + + +template< typename T1, typename T2 > +vector operator * ( const T1 & x1, const vector & x2 ) +{ + vector x; + for( size_t i=0; i!=x2.size(); ++i ) + x.push_back(x1*x2[i]); + return x; +} + +template< typename T1, typename T21, typename T22 > +map operator * ( const T1 & x1, const map & x2 ) +{ + map x; + for( const auto & x2i : x2 ) + x.insert(make_pair( x2i.first, x1*x2i.second )); + return x; +} + +#endif // CONTAINER_OPERATOR_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_global/global_function.cpp b/ABACUS.develop/source/src_global/global_function.cpp index 1aa2e15bfa..df5062502c 100644 --- a/ABACUS.develop/source/src_global/global_function.cpp +++ b/ABACUS.develop/source/src_global/global_function.cpp @@ -44,11 +44,11 @@ void TITLE(const string &class_name,const string &function_name) void TITLE(ofstream &ofs,const string &class_name,const string &function_name) { - //cout<<"\n\n ==> "< "< "< "<>label>>size>>kB; + if(label=="MemAvailable:") + return std::stol(size); + else if(label=="MemFree:" || label=="Buffers:" || label=="Cached:") + { + mem_sum += std::stol(size); + ++i; + } + if(i==3) + return mem_sum; + } + throw runtime_error("read /proc/meminfo error in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); +} diff --git a/ABACUS.develop/source/src_global/global_function.h b/ABACUS.develop/source/src_global/global_function.h index 00a2b30004..fc9835478b 100644 --- a/ABACUS.develop/source/src_global/global_function.h +++ b/ABACUS.develop/source/src_global/global_function.h @@ -7,6 +7,7 @@ #define GLOBAL_FUNCTION_H #include +#include #include #include #include @@ -17,7 +18,7 @@ #include #include "global_variable.h" -//#include "global_function-func_each_2.h" // Peize Lin add 2016-09-07 +#include "global_function-func_each_2.h" // Peize Lin add 2016-09-07 using namespace std; @@ -183,7 +184,7 @@ void SCAN_END(ifstream &ifs, const string &TargetName); template static inline void DCOPY( const T &a, T &b, const int &dim) { - for (int i=0; i & v ) { return &(v[0]); } +template +static inline T * VECTOR_TO_PTR( std::valarray & v ) +{ + return &(v[0]); +} template static inline const T * VECTOR_TO_PTR( const std::vector & v ) { return &(v[0]); } +template +static inline const T * VECTOR_TO_PTR( const std::valarray & v ) +{ + return &(v[0]); +} //========================================================== // GLOBAL FUNCTION : @@ -221,4 +232,53 @@ std::string TO_STRING ( const T &n ) return newstr.str(); } +//========================================================== +// GLOBAL FUNCTION : +// NAME : MAP_EXIST +// find whether exists the map index +// if exist return the ptr called, else return nullptr +// example: map_exist(ms,i,j,k) -> try to find ms[i][j][k] +// Peize Lin add 2018-07-16 +//========================================================== +template< typename T_map, typename T_key1 > +inline void* MAP_EXIST( T_map &ms, const T_key1 &key1 ) +{ + auto ms1 = ms.find(key1); + if( ms1 == ms.end() ) return nullptr; + return static_cast(&ms1->second); +} + +template< typename T_map, typename T_key1, typename... T_key_tail > +inline void* MAP_EXIST( T_map &ms, const T_key1 &key1, const T_key_tail&... key_tail ) +{ + auto ms1 = ms.find(key1); + if( ms1 == ms.end() ) return nullptr; + return MAP_EXIST( ms1->second, key_tail... ); +} + +template< typename T_map, typename T_key1 > +inline const void* MAP_EXIST( const T_map &ms, const T_key1 &key1 ) +{ + auto ms1 = ms.find(key1); + if( ms1 == ms.end() ) return nullptr; + return static_cast(&ms1->second); +} + +template< typename T_map, typename T_key1, typename... T_key_tail > +inline const void* MAP_EXIST( const T_map &ms, const T_key1 &key1, const T_key_tail&... key_tail ) +{ + auto ms1 = ms.find(key1); + if( ms1 == ms.end() ) return nullptr; + return MAP_EXIST( ms1->second, key_tail... ); +} + +//========================================================== +// GLOBAL FUNCTION : +// NAME : MemAvailable +// read /proc/meminfo +// unit: kB +// Peize Lin add 2019-12-21 +//========================================================== +size_t MemAvailable(); + #endif diff --git a/ABACUS.develop/source/src_global/global_variable.cpp b/ABACUS.develop/source/src_global/global_variable.cpp index a0492352e6..e7d0a7c5de 100644 --- a/ABACUS.develop/source/src_global/global_variable.cpp +++ b/ABACUS.develop/source/src_global/global_variable.cpp @@ -22,18 +22,13 @@ int NBANDS_ISTATE = 0; // default number. int NLOCAL = 0; // total number of local basis. string CALCULATION = "scf"; -bool BERRY_PHASE = false; -bool LDA_PLUS_U = false; int EFIELD = 0; // 5: add electric field -int BFIELD = 0; // 6: add magnetic field int DIPOLE = 0; // 7: add dipole field string DFT_FUNCTIONAL = "none"; int NSPIN = 1; // LDA bool TWO_EFERMI = 0; // two fermi energy, exist only magnetization is fixed. int CURRENT_SPIN = 0; -int VNA = 0;//mohan add 2011-05-27 -int GRID_SPEED = 1; //mohan add 2012-03-29 int FORCE = 0;// if force >1, means do the grid integration 'force' times. double FORCE_THR = 1.0e-3; bool STRESS = false; @@ -46,18 +41,12 @@ string OUT_LEVEL = "ie"; int NSTEP = 20; int NITER = 50; -bool SYMMETRY = false; -bool MLWF_FLAG = false; -//int LOCAL_BASIS = 0; xiaohui modify 2013-09-01 // 0: plane wave; 1:radial wave functions; 2: PAO; 3: Jlq coef; -//int LINEAR_SCALING = false; xiaohui modify 2013-09-01 string BASIS_TYPE = "pw"; //xiaohui add 2013-09-01 string KS_SOLVER = "cg"; //xiaohui add 2013-09-01 double SEARCH_RADIUS = -1.0; bool SEARCH_PBC = true; bool SPARSE_MATRIX = false; -int ATOM_DISTRIBUTION = false; -//string DIAGO_TYPE = "cg"; xiaohui modify 2013-09-01 int DIAGO_PROC = 0; int DIAGO_CG_MAXITER = 30; int DIAGO_CG_PREC = 1; //mohan add 2012-03-31 @@ -137,22 +126,9 @@ string global_out_dir; ofstream ofs_running; ofstream ofs_warning; -#ifdef __EPM -int EPM_SPIN_ORBITAL = false; -// 0 stands for no spin-orbital coupling; -// 1 stands for plane wave method; -// 2 stands for small-box technique; -bool EPM_ZEEMAN = false; -double EPM_MAG_FIELD_X = 0.0; -double EPM_MAG_FIELD_Y = 0.0; -double EPM_MAG_FIELD_Z = 0.0; -#endif - //---------------------------------------------------------- // EXPLAIN : test level for each class //---------------------------------------------------------- -int test_run = 0; - int test_input = 0; int test_winput = 0; int test_kpoint = 0; @@ -163,14 +139,11 @@ int test_symmetry = 0; int test_fft = 0; int test_pw = 0; int test_elec = 0; -int test_hm = 0; int test_wf = 0; int test_charge = 0; int test_potential = 0; int test_energy = 0; - -int test_geo; //---------------------------------------------------------- // src_lcao //---------------------------------------------------------- @@ -183,36 +156,15 @@ int TEST_FORCE = 0;//mohan add 2011-03-18 int TEST_STRESS = 0;//zhengdy add 2018-05-16 int test_gridt = 0; // mohan add 2011-03-17 //---------------------------------------------------------- -// src_wannier -//---------------------------------------------------------- -int test_spillage = 0; -int test_improve_pao = 0; -int test_eximport = 0; -int test_operation = 0; -int test_recon = 0; -int test_sph_proj = 0; -int test_build = 0; -int test_setout = 0; -//---------------------------------------------------------- -// src_epm || src_pseudo +// src_pseudo //---------------------------------------------------------- -#ifdef __EPM -int test_epm = 10; -int test_epm_unitcell = 10; -int test_epm_nscf = 10; -#else int test_pseudo_cell = 0;// 2 : output readin data int test_pp = 0;// pp: pseudopotential int test_kmesh = 0; -int test_mlwf_overlap = 0; -int test_mlwf_optimize = 0; int test_ion_dynamics = 0; -#endif //---------------------------------------------------------- // src_tools //---------------------------------------------------------- -int test_figure = 0; -int test_mathzone = 0; int test_deconstructor = 0; //added by zhengdy-soc diff --git a/ABACUS.develop/source/src_global/global_variable.h b/ABACUS.develop/source/src_global/global_variable.h index 2c83f988ec..b8b0b2a3e1 100644 --- a/ABACUS.develop/source/src_global/global_variable.h +++ b/ABACUS.develop/source/src_global/global_variable.h @@ -17,15 +17,12 @@ using namespace std; // EXPLAIN : Basic Global Variables //========================================================== -extern int NBANDS; // 1 +extern int NBANDS; extern int NBANDS_ISTATE; // 1.05 // mohan add 2011-03-22 extern int NLOCAL; // 1.1 // mohan add 2009-05-29 extern string CALCULATION; // 2 "scf";"nscf" ;"symmetry" -extern bool BERRY_PHASE; // 3 berry phase calculation -extern bool LDA_PLUS_U; // 4 LDA + U method extern int EFIELD; // 5 add electric field -extern int BFIELD; // 6 add magnetic field extern int DIPOLE; // 7 add dipole correction @@ -34,8 +31,6 @@ extern int NSPIN; // 7 extern bool TWO_EFERMI; // 7.5 mohan add 2011-04-03, two fermi energy, exist if magnetization is fixed. extern int CURRENT_SPIN; // 8 -extern int VNA; // 8.01 // mohan add 2011-05-27 -extern int GRID_SPEED; // 8.02 // mohan add 2012-03-29 extern int FORCE; // 8.1 extern double FORCE_THR; // 8.2 extern bool STRESS; // 8.25 calcualte the stress @@ -43,22 +38,17 @@ extern double PRESS1; extern double PRESS2; extern double PRESS3; extern double PRESSURE; -extern string MOVE_IONS; // 8.26 -extern string OUT_LEVEL; // 8.27 +extern string MOVE_IONS; +extern string OUT_LEVEL; extern int NSTEP; // 8.3 extern int NITER; // 8.4 -extern bool SYMMETRY; // 9 -extern bool MLWF_FLAG; // 9.1 mohan add 2010-01-26 -//extern int LOCAL_BASIS; xiaohui modify 2013-09-01 // 10 -//extern int LINEAR_SCALING; xiaohui modify 2013-09-01 // 11 // -1: test 0: pw 1:lcao 2:O(N) -extern string BASIS_TYPE; //xiaohui add 2013-09-01 -extern string KS_SOLVER; //xiaohui add 2013-09-01 +extern string BASIS_TYPE; //xiaohui add 2013-09-01 +extern string KS_SOLVER; //xiaohui add 2013-09-01 extern double SEARCH_RADIUS; // 11.1 // mohan add 2011-03-10 extern bool SEARCH_PBC; // 11.2 // mohan add 2011-03-10 extern bool SPARSE_MATRIX; // 11.3 // mohan add 2009-03-13 -extern int ATOM_DISTRIBUTION; // 11.4 // mohan add 2010-06-28 //added by zhengdy-soc extern bool NONCOLIN; //0 : collinear ; 1 : non-collinear @@ -68,8 +58,7 @@ extern bool DOMAG_Z; //1 : constrain the magnetism to z axis extern int NPOL; //1 : no soc; 2 : has soc extern int PRENSPIN; //NSPIN used before, for restart with soc -// diagonalization (5) -//extern string DIAGO_TYPE; xiaohui modify 2013-09-01 // 12 "cg","davidson","fs","hpseps" + extern int DIAGO_PROC; // 12.1 number of processors used to diag. extern int DIAGO_CG_MAXITER; // 13 extern int DIAGO_CG_PREC; // 13.1 @@ -93,7 +82,6 @@ extern bool GAMMA_ONLY_PW; // mohan add 2012-06-05 extern int T_IN_H; // 23, calculate T in H or not. extern int VL_IN_H; // 24, calculate Vl in H or not. extern int VNL_IN_H; // 25, calculate Vnl in H or not. -extern int ZEEMAN_IN_H; // SunZhiyuan add extern double STRESS_THR; //LiuXh add 20180515 extern int tddft; //fuxiang add 2016-10-27 @@ -149,7 +137,6 @@ extern int GSIZE; // NAME : global_wannier_card // NAME : global_pseudo_dir // NAME : global_pseudo_type // mohan add 2013-05-20 (xiaohui add 2013-06-23) -// NAME : global_epm_pseudo_card // NAME : global_out_dir // NAME : ofs_running( contain information during runnnig) // NAME : ofs_warning( contain warning information, including error) @@ -159,31 +146,16 @@ extern string global_atom_card; extern string global_kpoint_card; extern string global_wannier_card; -//#ifndef __EPM extern string global_pseudo_dir; extern string global_pseudo_type; // mohan add 2013-05-20 (xiaohui add 2013-06-23) -//#else -extern string global_epm_pseudo_card; -//#endif - extern string global_out_dir; extern ofstream ofs_running; extern ofstream ofs_warning; -#ifdef __EPM -extern int EPM_SPIN_ORBITAL; -extern bool EPM_ZEEMAN; -extern double EPM_MAG_FIELD_X; -extern double EPM_MAG_FIELD_Y; -extern double EPM_MAG_FIELD_Z; -#endif - //========================================================== // EXPLAIN : test level for each class //========================================================== -extern int test_run; - extern int test_input; extern int test_winput; extern int test_kpoint; @@ -194,13 +166,11 @@ extern int test_symmetry; extern int test_fft; extern int test_pw; extern int test_elec; -extern int test_hm; extern int test_wf; extern int test_charge; extern int test_potential; extern int test_energy; -extern int test_geo; // mohan add 2011-03-17 //========================================================== // src_onscaling //========================================================== @@ -213,39 +183,18 @@ extern int TEST_FORCE;// mohan add 2011-03-18 extern int TEST_STRESS;//zhengdy add 2018-05-16 extern int test_gridt; // mohan add 2011-03-17 //========================================================== -// src_wannier -//========================================================== -extern int test_spillage; -extern int test_improve_pao; -extern int test_eximport; -extern int test_operation; -extern int test_recon; -extern int test_sph_proj; -extern int test_build; -extern int test_setout; +// src_pseudo //========================================================== -// src_epm || src_pseudo -//========================================================== -#ifdef __EPM -extern int test_epm; -extern int test_epm_unitcell; -extern int test_epm_nscf; -#else extern int test_pseudo_cell; extern int test_pp; extern int test_kmesh; -extern int test_mlwf_overlap; -extern int test_mlwf_optimize; extern int test_ion_dynamics; -#endif //========================================================== // src_tools //========================================================== -extern int test_figure; -extern int test_mathzone; extern int test_deconstructor; -extern bool FINAL_SCF; //LiuXh add 20180619 +extern bool FINAL_SCF; //LiuXh add 20180619 extern int NEW_DM; // Shen Yu add 2019/5/9 #endif diff --git a/ABACUS.develop/source/src_global/gram_schmidt_orth.h b/ABACUS.develop/source/src_global/gram_schmidt_orth.h index 29c91c1299..702e212ffe 100644 --- a/ABACUS.develop/source/src_global/gram_schmidt_orth.h +++ b/ABACUS.develop/source/src_global/gram_schmidt_orth.h @@ -23,7 +23,7 @@ class Gram_Schmidt_Orth private: - const Coordinate &coordinate; + const Coordinate coordinate; const vector &rab; vector radial_2; diff --git a/ABACUS.develop/source/src_pw/inverse_matrix.cpp b/ABACUS.develop/source/src_global/inverse_matrix.cpp similarity index 100% rename from ABACUS.develop/source/src_pw/inverse_matrix.cpp rename to ABACUS.develop/source/src_global/inverse_matrix.cpp diff --git a/ABACUS.develop/source/src_pw/inverse_matrix.h b/ABACUS.develop/source/src_global/inverse_matrix.h similarity index 100% rename from ABACUS.develop/source/src_pw/inverse_matrix.h rename to ABACUS.develop/source/src_global/inverse_matrix.h diff --git a/ABACUS.develop/source/src_global/lapack_connector.h b/ABACUS.develop/source/src_global/lapack_connector.h index 659982b02f..3494a65c18 100644 --- a/ABACUS.develop/source/src_global/lapack_connector.h +++ b/ABACUS.develop/source/src_global/lapack_connector.h @@ -82,11 +82,16 @@ extern "C" void zgetrf_(const int* m, const int *n, const complex *A, const int *lda, int *ipiv, const int* info); void zgetri_(const int* n, complex *A, const int *lda, int *ipiv, complex *work, int *lwork, const int *info); void pdgetrf_(const int *m, const int *n, double *a, const int *ia, const int *ja, int *desca, int *ipiv, int *info); - // Peize Lin add ?nrm2 2018-06-12, to compute out = ||x||_2 = \sqrt{ \sum_i x_i**2 } - float snrm2_( const int *N, const float *X, const int *incX ); - double dnrm2_( const int *N, const double *X, const int *incX ); - double dznrm2_( const int *N, const complex *X, const int *incX ); + float snrm2_( const int *n, const float *X, const int *incX ); + double dnrm2_( const int *n, const double *X, const int *incX ); + double dznrm2_( const int *n, const complex *X, const int *incX ); + // Peize Lin add zherk 2019-04-14 + // if trans=='N': C = a * A * A.H + b * C + // if trans=='C': C = a * A.H * A + b * C + void zherk_(const char *uplo, const char *trans, const int *n, const int *k, + const double *alpha, const complex *A, const int *lda, + const double *beta, complex *C, const int *ldc); } // Class LapackConnector provide the connector to fortran lapack routine. @@ -171,10 +176,33 @@ class LapackConnector { case 'U': return 'L'; case 'L': return 'U'; - default: throw invalid_argument("Uplo must be 'U' or 'L'"); + default: throw invalid_argument("uplo must be 'U' or 'L'"); } } + // Peize Lin add 2019-04-14 + static inline + char change_trans_NT(const char &trans) + { + switch(trans) + { + case 'N': return 'T'; + case 'T': return 'N'; + default: throw invalid_argument("trans must be 'N' or 'T'"); + } + } + // Peize Lin add 2019-04-14 + static inline + char change_trans_NC(const char &trans) + { + switch(trans) + { + case 'N': return 'C'; + case 'C': return 'N'; + default: throw invalid_argument("trans must be 'N' or 'C'"); + } + } + public: static inline @@ -470,7 +498,6 @@ class LapackConnector dpotrf_( &uplo_changed, &n, a.c, &lda, info ); } - // Peize Lin add 2016-07-09 static inline void dpotri( char uplo, const int n, matrix &a, const int lda, int *info ) @@ -482,60 +509,60 @@ class LapackConnector // Peize Lin add 2016-08-04 // y=a*x+y static inline - void axpy( const int N, const float alpha, const float *X, const int incX, float *Y, const int incY) + void axpy( const int n, const float alpha, const float *X, const int incX, float *Y, const int incY) { - saxpy_(&N, &alpha, X, &incX, Y, &incY); + saxpy_(&n, &alpha, X, &incX, Y, &incY); } static inline - void axpy( const int N, const double alpha, const double *X, const int incX, double *Y, const int incY) + void axpy( const int n, const double alpha, const double *X, const int incX, double *Y, const int incY) { - daxpy_(&N, &alpha, X, &incX, Y, &incY); + daxpy_(&n, &alpha, X, &incX, Y, &incY); } static inline - void axpy( const int N, const complex alpha, const complex *X, const int incX, complex *Y, const int incY) + void axpy( const int n, const complex alpha, const complex *X, const int incX, complex *Y, const int incY) { - caxpy_(&N, &alpha, X, &incX, Y, &incY); + caxpy_(&n, &alpha, X, &incX, Y, &incY); } static inline - void axpy( const int N, const complex alpha, const complex *X, const int incX, complex *Y, const int incY) + void axpy( const int n, const complex alpha, const complex *X, const int incX, complex *Y, const int incY) { - zaxpy_(&N, &alpha, X, &incX, Y, &incY); + zaxpy_(&n, &alpha, X, &incX, Y, &incY); } // Peize Lin add 2016-08-04 // x=a*x static inline - void scal( const int N, const float alpha, float *X, const int incX) + void scal( const int n, const float alpha, float *X, const int incX) { - sscal_(&N, &alpha, X, &incX); + sscal_(&n, &alpha, X, &incX); } static inline - void scal( const int N, const double alpha, double *X, const int incX) + void scal( const int n, const double alpha, double *X, const int incX) { - dscal_(&N, &alpha, X, &incX); + dscal_(&n, &alpha, X, &incX); } static inline - void scal( const int N, const complex alpha, complex *X, const int incX) + void scal( const int n, const complex alpha, complex *X, const int incX) { - cscal_(&N, &alpha, X, &incX); + cscal_(&n, &alpha, X, &incX); } static inline - void scal( const int N, const complex alpha, complex *X, const int incX) + void scal( const int n, const complex alpha, complex *X, const int incX) { - zscal_(&N, &alpha, X, &incX); + zscal_(&n, &alpha, X, &incX); } // Peize Lin add 2017-10-27 // d=x*y static inline - float dot( const int N, const float *X, const int incX, const float *Y, const int incY) + float dot( const int n, const float *X, const int incX, const float *Y, const int incY) { - return sdot_(&N, X, &incX, Y, &incY); + return sdot_(&n, X, &incX, Y, &incY); } static inline - double dot( const int N, const double *X, const int incX, const double *Y, const int incY) + double dot( const int n, const double *X, const int incX, const double *Y, const int incY) { - return ddot_(&N, X, &incX, Y, &incY); + return ddot_(&n, X, &incX, Y, &incY); } // Peize Lin add 2017-10-27, fix bug trans 2019-01-17 @@ -571,19 +598,19 @@ class LapackConnector // Peize Lin add 2018-06-12 // out = ||x||_2 static inline - float nrm2( const int N, const float *X, const int incX ) + float nrm2( const int n, const float *X, const int incX ) { - return snrm2_( &N, X, &incX ); + return snrm2_( &n, X, &incX ); } static inline - double nrm2( const int N, const double *X, const int incX ) + double nrm2( const int n, const double *X, const int incX ) { - return dnrm2_( &N, X, &incX ); + return dnrm2_( &n, X, &incX ); } static inline - double nrm2( const int N, const complex *X, const int incX ) + double nrm2( const int n, const complex *X, const int incX ) { - return dznrm2_( &N, X, &incX ); + return dznrm2_( &n, X, &incX ); } static inline @@ -597,5 +624,18 @@ class LapackConnector zcopy_(&n, a, &incx, b, &incy); } + // Peize Lin add 2019-04-14 + // if trans=='N': C = a * A * A.H + b * C + // if trans=='C': C = a * A.H * A + b * C + static inline + void zherk(const char uplo, const char trans, const int n, const int k, + const double alpha, const complex *A, const int lda, + const double beta, complex *C, const int ldc) + { + const char uplo_changed = change_uplo(uplo); + const char trans_changed = change_trans_NC(trans); + zherk_(&uplo_changed, &trans_changed, &n, &k, &alpha, A, &lda, &beta, C, &ldc); + } + }; #endif // LAPACKCONNECTOR_HPP diff --git a/ABACUS.develop/source/src_global/mathzone.cpp b/ABACUS.develop/source/src_global/mathzone.cpp index c9f2031908..7a8f3176b1 100644 --- a/ABACUS.develop/source/src_global/mathzone.cpp +++ b/ABACUS.develop/source/src_global/mathzone.cpp @@ -89,8 +89,8 @@ double Mathzone::Polynomial_Interpolation cout << "\n x = " << x; cout << "\n table_interval = " << table_interval; cout << "\n iq=" << iq << " table_length = " << table_length << endl; - cout << "\n Not enough space allocated for radial FFT: try restarting with a larger cell_factor" << endl; //LiuXh add 20180619 - cout << "\n Now cell_factor is: " << ppcell.cell_factor << endl; //LiuXh add 20180619 + cout << "\n Not enough space allocated for radial FFT: try restarting with a larger cell_factor" << endl; //LiuXh add 20180619 + cout << "\n Now cell_factor is: " << ppcell.cell_factor << endl; //LiuXh add 20180619 } assert(iq < table_length-4); const double x0 = position - static_cast(iq); diff --git a/ABACUS.develop/source/src_global/mathzone_add1.cpp b/ABACUS.develop/source/src_global/mathzone_add1.cpp index e866048f90..c9907290f8 100644 --- a/ABACUS.develop/source/src_global/mathzone_add1.cpp +++ b/ABACUS.develop/source/src_global/mathzone_add1.cpp @@ -18,6 +18,7 @@ typedef fftw_complex FFTW_COMPLEX; //#include //#include //#include +#include bool Mathzone_Add1::flag_jlx_expand_coef = false; double** Mathzone_Add1::c_ln_c = nullptr; @@ -1042,54 +1043,50 @@ void Mathzone_Add1::SplineD2 // modified by pengfei 13-8-8 add second derivative timer::tick("Mathzone_Add1","SplineD2"); } - +// Peize Lin add openmp 2019-12-13 void Mathzone_Add1::Cubic_Spline_Interpolation ( - const double *rad, - const double *rad_f, - const double *y2, + const double * const rad, + const double * const rad_f, + const double * const y2, const int& mesh, - const double* r, + const double * const r, const int& rsize, - double* y, - double* dy + double * const y, + double * const dy ) { timer::tick("Mathzone_Add1","Cubic_Spline_Interpolation"); - - //begin interpolation - int k, klo, khi, m; - double h, b, a; - for(m = 0; m < rsize ; m++) + #pragma omp parallel for schedule(static) + for(int m = 0; m < rsize ; m++) { - klo = 0; - khi = mesh-1; - + int klo = 0; + int khi = mesh-1; while (khi - klo > 1) { - k = (khi + klo) / 2 ; + const int k = (khi + klo) / 2 ; if(rad[k] > r[m]) khi = k; else klo = k; } - //if(klo==0 && khi==1) // extrapolation - //{ - // klo = 1; - // khi = 2; - //} + //if(klo==0 && khi==1) // extrapolation + //{ + // klo = 1; + // khi = 2; + //} - h = rad[khi] - rad[klo]; - + const double h = rad[khi] - rad[klo]; if(h == 0.0) WARNING_QUIT("Cubic_Spline_Interpolation","h == 0.0 so that cannot be divided"); - a = (rad[khi] - r[m]) / h; - b = (r[m] - rad[klo]) / h; + const double a = (rad[khi] - r[m]) / h; + const double b = (r[m] - rad[klo]) / h; - dy[m] = (rad_f[khi] - rad_f[klo]) / h - + const double dy_tmp = (rad_f[khi] - rad_f[klo]) / h - (3.0 * a * a - 1.0) / 6.0 * h * y2[klo] + ( 3.0 * b * b - 1.0) / 6.0 * h * y2[khi]; - - y[m] = a * rad_f[klo] + b * rad_f[khi] + ((a*a*a - a) * y2[klo] + (b*b*b - b) * y2[khi]) * (h*h) / 6.0; + dy[m] = dy_tmp; + const double y_tmp = a * rad_f[klo] + b * rad_f[khi] + ((a*a*a - a) * y2[klo] + (b*b*b - b) * y2[khi]) * (h*h) / 6.0; + y[m] = y_tmp; } timer::tick("Mathzone_Add1","Cubic_Spline_Interpolation"); diff --git a/ABACUS.develop/source/src_global/mathzone_add1.h b/ABACUS.develop/source/src_global/mathzone_add1.h index 634cbca3b9..310738d745 100644 --- a/ABACUS.develop/source/src_global/mathzone_add1.h +++ b/ABACUS.develop/source/src_global/mathzone_add1.h @@ -135,14 +135,14 @@ class Mathzone_Add1 static void Cubic_Spline_Interpolation ( - const double *rad, - const double *rad_f, - const double *y2, + const double * const rad, + const double * const rad_f, + const double * const y2, const int& mesh, - const double* r, + const double * const r, const int& rsize, - double* y, - double* dy + double * const y, + double * const dy ); static double RadialF diff --git a/ABACUS.develop/source/src_global/matrix-inl.h b/ABACUS.develop/source/src_global/matrix-inl.h new file mode 100644 index 0000000000..e27eb576be --- /dev/null +++ b/ABACUS.develop/source/src_global/matrix-inl.h @@ -0,0 +1,79 @@ +#ifndef MATRIX_INL_H +#define MATRIX_INL_H + +#include "matrix.h" +#include + +// test +#include +using namespace std; + +inline matrix::matrix( const int nrows, const int ncols, const bool flag_zero ) + :nr(nrows), nc(ncols), c(nullptr) +{ +cout<<__FILE__<<__LINE__<zero_out(); + } +} + +inline matrix::matrix( const matrix &m_in ) +{ +cout<<__FILE__<<__LINE__<create( m_in.nr, m_in.nc, false ); +cout<<__FILE__<<__LINE__<=0); assert(ir=0); assert(ic=0); assert(ir=0); assert(ic::min(); + double value = 0; const int size = nr * nc; for( int i=0; i=0); assert(ir=0); assert(ic=0); assert(ir=0); assert(ic=0); assert(ir=0); assert(ic=0); assert(ir=0); assert(ic + +// !!! Attention: c is very dangerous, may be changed by other class, +// e.g. changed the value, size!=nr*nc, deleted + +class Matrix_Wrapper +{ +public: + double *c; + int nr; + int nc; + bool flag_delete_c; + + Matrix_Wrapper(): nr(0), nc(0), c(nullptr), flag_delete_c(false){} + Matrix_Wrapper( const matrix &m ): nr(m.nr), nc(m.nc), c(m.c), flag_delete_c(false){} + inline void create( const int nr_in, const int nc_in, const bool flag_zero ); + inline matrix to_matrix(); + ~Matrix_Wrapper(){ if(flag_delete_c) delete[]c; } + Matrix_Wrapper( const Matrix_Wrapper &m )=delete; + Matrix_Wrapper( Matrix_Wrapper &m )=delete; + inline Matrix_Wrapper( Matrix_Wrapper &&m ); + inline Matrix_Wrapper&operator=( const Matrix_Wrapper&m ); + inline Matrix_Wrapper&operator=( Matrix_Wrapper&&m ); +}; + + +inline void Matrix_Wrapper::create( const int nr_in, const int nc_in, const bool flag_zero ) +{ + nr = nr_in; nc = nc_in; + if(flag_delete_c) + delete[] c; + c = new double[nr*nc]; + flag_delete_c = true; + if(flag_zero) + memset( c, 0, sizeof(double)*nr*nc ); +} + +inline matrix Matrix_Wrapper::to_matrix() +{ + assert( flag_delete_c==true ); + flag_delete_c = false; + matrix m; + m.nr = nr; m.nc = nc; + m.c = c; + return m; +} + +inline Matrix_Wrapper::Matrix_Wrapper( Matrix_Wrapper &&m ) + :nr(m.nr), + nc(m.nc), + c(m.c), + flag_delete_c(m.flag_delete_c) +{ + m.nr = m.nc = 0; + m.c = nullptr; + m.flag_delete_c = false; +} + +inline Matrix_Wrapper& Matrix_Wrapper::operator=( const Matrix_Wrapper&m ) +{ + assert( !m.flag_delete_c ); + nr = m.nr; nc = m.nc; c = m.c; flag_delete_c = m.flag_delete_c; + return *this; +} + +inline Matrix_Wrapper& Matrix_Wrapper::operator=( Matrix_Wrapper&&m ) +{ + nr = m.nr; nc = m.nc; c = m.c; flag_delete_c = m.flag_delete_c; + m.nr = 0; m.nc = 0; m.c = nullptr; m.flag_delete_c = false; + return *this; +} + +#endif + +#else +#include "matrix_wrapper_tianhe2.h" +#endif diff --git a/ABACUS.develop/source/src_global/matrix_wrapper_tianhe2.h b/ABACUS.develop/source/src_global/matrix_wrapper_tianhe2.h new file mode 100644 index 0000000000..ccf11728f3 --- /dev/null +++ b/ABACUS.develop/source/src_global/matrix_wrapper_tianhe2.h @@ -0,0 +1,52 @@ +//========================================================== +// AUTHOR : Peize Lin +// DATE : 2018-07-31 +//========================================================== + +#ifndef MATRIX_WRAPPER_H +#define MATRIX_WRAPPER_H + +#include "src_global/matrix.h" +#include + +// !!! Attention: c is very dangerous, may point to somewhere deleted + +class Matrix_Wrapper +{ +public: + double *c; + int nr; + int nc; + + Matrix_Wrapper(): nr(0), nc(0), c(nullptr){} + Matrix_Wrapper( const matrix &m ): nr(m.nr), nc(m.nc), c(m.c){} + inline void create( const int nr_in, const int nc_in, const bool flag_zero ); + inline matrix to_matrix(); + Matrix_Wrapper( const Matrix_Wrapper &m ): nr(m.nr), nc(m.nc), c(m.c){} + Matrix_Wrapper( Matrix_Wrapper &m ): nr(m.nr), nc(m.nc), c(m.c){} + Matrix_Wrapper( Matrix_Wrapper &&m ): nr(m.nr), nc(m.nc), c(m.c){} + inline Matrix_Wrapper&operator=( const Matrix_Wrapper&m ){ nr=m.nr; nc=m.nc; c=m.c; return *this; }; + inline Matrix_Wrapper&operator=( Matrix_Wrapper&m ){ nr=m.nr; nc=m.nc; c=m.c; return *this; }; + inline Matrix_Wrapper&operator=( Matrix_Wrapper&&m ){ nr=m.nr; nc=m.nc; c=m.c; return *this; }; +}; + + +inline void Matrix_Wrapper::create( const int nr_in, const int nc_in, const bool flag_zero ) +{ + nr = nr_in; nc = nc_in; + c = new double[nr*nc]; + if(flag_zero) + memset( c, 0, sizeof(double)*nr*nc ); +} + +inline matrix Matrix_Wrapper::to_matrix() +{ + matrix m; + m.nr = nr; m.nc = nc; + m.c = c; + nr = nc = 0; + c = nullptr; + return m; +} + +#endif diff --git a/ABACUS.develop/source/src_pw/mymath.h b/ABACUS.develop/source/src_global/mymath.h similarity index 68% rename from ABACUS.develop/source/src_pw/mymath.h rename to ABACUS.develop/source/src_global/mymath.h index 18c6442884..c035071f1b 100644 --- a/ABACUS.develop/source/src_pw/mymath.h +++ b/ABACUS.develop/source/src_global/mymath.h @@ -1,5 +1,3 @@ -/* mymath.h file */ - #ifndef MYMATH_H #define MYMATH_H #include "../src_pw/tools.h" @@ -18,26 +16,17 @@ void fftw_zeros(fftw_complex *data,int n); #endif - -// in mymath1.cpp double rndm(); void simpson(const int mesh,const double *func,const double *rab, double &asum); -//void simpson_cp90( int mesh, double *func, double *rab, double intg ); -//void simpson_fpmd(int n, double *func, double dx, double s); double my_erf(double x); double my_erfc(double x); double gauss_freq(double x); -// in mymath3.cpp void heapsort(int n, double *r, int *ind); void heapAjust(double r[], int ind[], int s, int m); void hpsort(int n, double *ra, int *ind); - -// in mymath4.cpp -//void Jacobi(ComplexMatrix &Ain,double *evals, ComplexMatrix &evecs); - #endif // MYMATH_H diff --git a/ABACUS.develop/source/src_pw/mymath1.cpp b/ABACUS.develop/source/src_global/mymath1.cpp similarity index 100% rename from ABACUS.develop/source/src_pw/mymath1.cpp rename to ABACUS.develop/source/src_global/mymath1.cpp diff --git a/ABACUS.develop/source/src_pw/mymath3.cpp b/ABACUS.develop/source/src_global/mymath3.cpp similarity index 100% rename from ABACUS.develop/source/src_pw/mymath3.cpp rename to ABACUS.develop/source/src_global/mymath3.cpp diff --git a/ABACUS.develop/source/src_global/realarray.cpp b/ABACUS.develop/source/src_global/realarray.cpp index c7813d59d1..9f9546f3a5 100644 --- a/ABACUS.develop/source/src_global/realarray.cpp +++ b/ABACUS.develop/source/src_global/realarray.cpp @@ -21,11 +21,11 @@ realArray::realArray(const int d1,const int d2,const int d3) bound3 = (d3 <= 0) ? 1 : d3; bound4 = 0; - set_new_handler(realArrayAlloc); - size = bound1 * bound2 * bound3 ; //* sizeof(float); + auto handler_old = set_new_handler(realArrayAlloc); ptr = new double[size]; + set_new_handler(handler_old); zero_out(); assert(ptr != 0); @@ -40,11 +40,11 @@ realArray::realArray(const int d1,const int d2,const int d3,const int d4) bound3 = (d3 <= 0) ? 1 : d3; bound4 = (d4 <= 0) ? 1 : d4; - set_new_handler(realArrayAlloc); - size = bound1 * bound2 * bound3 * bound4 ; //* sizeof(float); + auto handler_old = set_new_handler(realArrayAlloc); ptr = new double[size]; + set_new_handler(handler_old); zero_out(); ++arrayCount; diff --git a/ABACUS.develop/source/src_global/restart.cpp b/ABACUS.develop/source/src_global/restart.cpp index fdecf4b4a0..f70c8d0679 100644 --- a/ABACUS.develop/source/src_global/restart.cpp +++ b/ABACUS.develop/source/src_global/restart.cpp @@ -38,7 +38,7 @@ void Restart::read_file2(const std::string &file_name, void*const ptr, const siz void Restart::save_disk(const std::string mode, const int i) const { if("charge"==mode) - write_file2(folder+"charge_"+TO_STRING(MY_RANK)+"_"+TO_STRING(i), chr.rho[i], pw.nrxx*sizeof(double)); + write_file2(folder+"charge_"+TO_STRING(MY_RANK)+"_"+TO_STRING(i), CHR.rho[i], pw.nrxx*sizeof(double)); if("H"==mode) { if(GAMMA_ONLY_LOCAL) @@ -51,7 +51,7 @@ void Restart::save_disk(const std::string mode, const int i) const void Restart::load_disk(const std::string mode, const int i) const { if("charge"==mode) - read_file2(folder+"charge_"+TO_STRING(MY_RANK)+"_"+TO_STRING(i), chr.rho[i], pw.nrxx*sizeof(double)); + read_file2(folder+"charge_"+TO_STRING(MY_RANK)+"_"+TO_STRING(i), CHR.rho[i], pw.nrxx*sizeof(double)); if("H"==mode) { if(GAMMA_ONLY_LOCAL) @@ -59,4 +59,4 @@ void Restart::load_disk(const std::string mode, const int i) const else read_file2(folder+"Hk_"+TO_STRING(MY_RANK)+"_"+TO_STRING(i), LM.Hloc2, ParaO.nloc*sizeof(complex)); } -} \ No newline at end of file +} diff --git a/ABACUS.develop/source/src_global/scalapack_connector.h b/ABACUS.develop/source/src_global/scalapack_connector.h index a4d8c84b7f..541cbd80fa 100644 --- a/ABACUS.develop/source/src_global/scalapack_connector.h +++ b/ABACUS.develop/source/src_global/scalapack_connector.h @@ -76,6 +76,11 @@ extern "C" const double* vl, const double* vu, const int* il, const int* iu, const double* abstol, int* m, int* nz, double* w, const double*orfac, double* Z, const int* iz, const int* jz, const int*descz, double* work, int* lwork, int*iwork, int*liwork, int* ifail, int*iclustr, double*gap, int* info); + void pzhegvx_(const int* itype, const char* jobz, const char* range, const char* uplo, + const int* n, std::complex* A, const int* ia, const int* ja, const int*desca, std::complex* B, const int* ib, const int* jb, const int*descb, + const double* vl, const double* vu, const int* il, const int* iu, + const double* abstol, int* m, int* nz, double* w, const double*orfac, std::complex* Z, const int* iz, const int* jz, const int*descz, + std::complex* work, int* lwork, double* rwork, int* lrwork, int*iwork, int*liwork, int* ifail, int*iclustr, double*gap, int* info); } /* diff --git a/ABACUS.develop/source/src_global/serialization_boost.h b/ABACUS.develop/source/src_global/serialization_boost.h new file mode 100644 index 0000000000..c6cd30af42 --- /dev/null +++ b/ABACUS.develop/source/src_global/serialization_boost.h @@ -0,0 +1,97 @@ +#ifndef SERIALIZATION_BOOST_H +#define SERIALIZATION_BOOST_H + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "src_global/vector3.h" +#include "src_lcao/abfs-vector3_order.h" +#include "src_global/matrix.h" +#include "src_global/matrix_wrapper.h" + +namespace boost +{ + namespace serialization + { + // Vector3 Peize Lin add 2018-07-01 + template + inline void serialize(Archive & ar, Vector3 & v, const unsigned int version) + { + ar & v.x; + ar & v.y; + ar & v.z; + } + + // Abfs::Vector3_Order Peize Lin add 2018-07-01 + template + inline void serialize(Archive & ar, Abfs::Vector3_Order & v, const unsigned int version) + { + ar & v.x; + ar & v.y; + ar & v.z; + } + + // matrix Peize Lin add 2018-07-01 + template + inline void save( Archive & ar, const matrix & m, const unsigned int /*file_version*/ ) + { + const collection_size_type nr(m.nr), nc(m.nc); + ar << BOOST_SERIALIZATION_NVP(nr) << BOOST_SERIALIZATION_NVP(nc); + if( nr && nc ) + ar << serialization::make_array( m.c, nr*nc ); + } + template + inline void load( Archive & ar, matrix &m, const unsigned int /*file_version*/ ) + { + collection_size_type nr, nc; + ar >> BOOST_SERIALIZATION_NVP(nr) >> BOOST_SERIALIZATION_NVP(nc); + m.create(nr,nc,false); + if( nr && nc ) + ar >> serialization::make_array( m.c, nr*nc ); + } + template + inline void serialize( Archive & ar, matrix & m, const unsigned int file_version ) + { + boost::serialization::split_free(ar, m, file_version); + } + + // MatrixWrapper Peize Lin add 2018-07-31 + template + inline void save( Archive & ar, const Matrix_Wrapper & m, const unsigned int /*file_version*/ ) + { + const collection_size_type nr(m.nr), nc(m.nc); + ar << BOOST_SERIALIZATION_NVP(nr) << BOOST_SERIALIZATION_NVP(nc); + if( nr && nc ) + ar << serialization::make_array( m.c, nr*nc ); + } + template + inline void load( Archive & ar, Matrix_Wrapper &m, const unsigned int /*file_version*/ ) + { + collection_size_type nr, nc; + ar >> BOOST_SERIALIZATION_NVP(nr) >> BOOST_SERIALIZATION_NVP(nc); + m.create(nr,nc,false); + if( nr && nc ) + ar >> serialization::make_array( m.c, nr*nc ); + } + template + inline void serialize( Archive & ar, Matrix_Wrapper & m, const unsigned int file_version ) + { + boost::serialization::split_free(ar, m, file_version); + } + } +} + + +#include + +BOOST_SERIALIZATION_COLLECTION_TRAITS(Vector3) +BOOST_SERIALIZATION_COLLECTION_TRAITS(Abfs::Vector3_Order) + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_global/serialization_cereal.h b/ABACUS.develop/source/src_global/serialization_cereal.h new file mode 100644 index 0000000000..d017095ff5 --- /dev/null +++ b/ABACUS.develop/source/src_global/serialization_cereal.h @@ -0,0 +1,32 @@ +#ifndef SERIALIZATION_CEREAL_H +#define SERIALIZATION_CEREAL_H + +#include + +#include +#include +#include + +#include "src_global/vector3.h" +#include "src_ri/abfs-vector3_order.h" +#include "src_global/matrix.h" + + +template void serialize( Archive & ar, Vector3 & v ){ ar(v.x); ar(v.y); ar(v.z); } +template void serialize( Archive & ar, Abfs::Vector3_Order & v ){ ar(v.x); ar(v.y); ar(v.z); } + + +template void save( Archive & ar, const matrix & m ) +{ + ar(m.nr); ar(m.nc); + ar(cereal::binary_data(m.c, m.nr*m.nc*sizeof(double))); +} +template void load( Archive & ar, matrix & m ) +{ + int nr, nc; + ar(nr); ar(nc); + m.create(nr,nc); + ar(cereal::binary_data(m.c, m.nr*m.nc*sizeof(double))); +} + +#endif diff --git a/ABACUS.develop/source/src_lcao/sltk_adjacent_set.cpp b/ABACUS.develop/source/src_global/sltk_adjacent_set.cpp similarity index 99% rename from ABACUS.develop/source/src_lcao/sltk_adjacent_set.cpp rename to ABACUS.develop/source/src_global/sltk_adjacent_set.cpp index 1e06f22c41..7ea63f29c0 100644 --- a/ABACUS.develop/source/src_lcao/sltk_adjacent_set.cpp +++ b/ABACUS.develop/source/src_global/sltk_adjacent_set.cpp @@ -67,7 +67,6 @@ void AdjacentSet::set } void AdjacentSet::assertCoordinateIsRight(const int x, const int y, const int z, const char* const s) -throw(std::out_of_range) { /* if (x > 1 || x < -1 || y > 1 || y < -1 || z > 1 || z < -1) { diff --git a/ABACUS.develop/source/src_lcao/sltk_adjacent_set.h b/ABACUS.develop/source/src_global/sltk_adjacent_set.h similarity index 97% rename from ABACUS.develop/source/src_lcao/sltk_adjacent_set.h rename to ABACUS.develop/source/src_global/sltk_adjacent_set.h index 95ef0f459f..64404f5b7a 100644 --- a/ABACUS.develop/source/src_lcao/sltk_adjacent_set.h +++ b/ABACUS.develop/source/src_global/sltk_adjacent_set.h @@ -31,8 +31,7 @@ class AdjacentSet // throw the exception "out_of_range". //========================================================== static - void assertCoordinateIsRight(const int x, const int y, const int z, const char* const s) - throw(std::out_of_range); + void assertCoordinateIsRight(const int x, const int y, const int z, const char* const s); // Peize Lin delete throw(std::out_of_range) 2018-07-14 //========================================================== // MEMBER VARIABLE : diff --git a/ABACUS.develop/source/src_lcao/sltk_atom.cpp b/ABACUS.develop/source/src_global/sltk_atom.cpp similarity index 100% rename from ABACUS.develop/source/src_lcao/sltk_atom.cpp rename to ABACUS.develop/source/src_global/sltk_atom.cpp diff --git a/ABACUS.develop/source/src_lcao/sltk_atom.h b/ABACUS.develop/source/src_global/sltk_atom.h similarity index 98% rename from ABACUS.develop/source/src_lcao/sltk_atom.h rename to ABACUS.develop/source/src_global/sltk_atom.h index fe787f4bec..c6959b34a9 100644 --- a/ABACUS.develop/source/src_lcao/sltk_atom.h +++ b/ABACUS.develop/source/src_global/sltk_atom.h @@ -6,7 +6,7 @@ #ifndef INCLUDE_FATOM #define INCLUDE_FATOM -#include "util.h" +#include "sltk_util.h" #include "sltk_adjacent_set.h" class AdjacentSet; diff --git a/ABACUS.develop/source/src_lcao/sltk_atom_arrange.cpp b/ABACUS.develop/source/src_global/sltk_atom_arrange.cpp similarity index 98% rename from ABACUS.develop/source/src_lcao/sltk_atom_arrange.cpp rename to ABACUS.develop/source/src_global/sltk_atom_arrange.cpp index 401aa24b90..0e497d9aca 100644 --- a/ABACUS.develop/source/src_lcao/sltk_atom_arrange.cpp +++ b/ABACUS.develop/source/src_global/sltk_atom_arrange.cpp @@ -4,6 +4,8 @@ #include "sltk_grid.h" #include "sltk_grid_driver.h" +#include "../src_lcao/global_fp.h" // mohan add 2021-01-30 + atom_arrange::atom_arrange() { diff --git a/ABACUS.develop/source/src_lcao/sltk_atom_arrange.h b/ABACUS.develop/source/src_global/sltk_atom_arrange.h similarity index 100% rename from ABACUS.develop/source/src_lcao/sltk_atom_arrange.h rename to ABACUS.develop/source/src_global/sltk_atom_arrange.h diff --git a/ABACUS.develop/source/src_lcao/sltk_atom_input.cpp b/ABACUS.develop/source/src_global/sltk_atom_input.cpp similarity index 100% rename from ABACUS.develop/source/src_lcao/sltk_atom_input.cpp rename to ABACUS.develop/source/src_global/sltk_atom_input.cpp diff --git a/ABACUS.develop/source/src_lcao/sltk_atom_input.h b/ABACUS.develop/source/src_global/sltk_atom_input.h similarity index 100% rename from ABACUS.develop/source/src_lcao/sltk_atom_input.h rename to ABACUS.develop/source/src_global/sltk_atom_input.h diff --git a/ABACUS.develop/source/src_lcao/sltk_grid.cpp b/ABACUS.develop/source/src_global/sltk_grid.cpp similarity index 100% rename from ABACUS.develop/source/src_lcao/sltk_grid.cpp rename to ABACUS.develop/source/src_global/sltk_grid.cpp diff --git a/ABACUS.develop/source/src_lcao/sltk_grid.h b/ABACUS.develop/source/src_global/sltk_grid.h similarity index 99% rename from ABACUS.develop/source/src_lcao/sltk_grid.h rename to ABACUS.develop/source/src_global/sltk_grid.h index 27b00b379f..27fcd5a397 100644 --- a/ABACUS.develop/source/src_lcao/sltk_grid.h +++ b/ABACUS.develop/source/src_global/sltk_grid.h @@ -8,7 +8,7 @@ #include #include -#include "util.h" +#include "sltk_util.h" #include "sltk_atom.h" #include "sltk_atom_input.h" #include "../src_pw/tools.h" diff --git a/ABACUS.develop/source/src_lcao/sltk_grid_driver.cpp b/ABACUS.develop/source/src_global/sltk_grid_driver.cpp similarity index 100% rename from ABACUS.develop/source/src_lcao/sltk_grid_driver.cpp rename to ABACUS.develop/source/src_global/sltk_grid_driver.cpp diff --git a/ABACUS.develop/source/src_lcao/sltk_grid_driver.h b/ABACUS.develop/source/src_global/sltk_grid_driver.h similarity index 87% rename from ABACUS.develop/source/src_lcao/sltk_grid_driver.h rename to ABACUS.develop/source/src_global/sltk_grid_driver.h index 27c8cdf260..07e05a9b7e 100644 --- a/ABACUS.develop/source/src_lcao/sltk_grid_driver.h +++ b/ABACUS.develop/source/src_global/sltk_grid_driver.h @@ -1,14 +1,3 @@ -// ============================================================================= -// C++ Header File -// Project: Find Adjacent Atom -// File: grid_driver.hpp -// Principal Class: grid_driver -// Author: ywcui -// Comment: -// Warning: -// Start time: 2008-11-10 -// Last modified: -// ============================================================================= #ifndef GRID_DRIVER_H #define GRID_DRIVER_H diff --git a/ABACUS.develop/source/src_lcao/util.h b/ABACUS.develop/source/src_global/sltk_util.h similarity index 100% rename from ABACUS.develop/source/src_lcao/util.h rename to ABACUS.develop/source/src_global/sltk_util.h diff --git a/ABACUS.develop/source/src_global/sparsematrix.cpp b/ABACUS.develop/source/src_global/sparsematrix.cpp deleted file mode 100644 index 80de48f97e..0000000000 --- a/ABACUS.develop/source/src_global/sparsematrix.cpp +++ /dev/null @@ -1,215 +0,0 @@ -#include "sparsematrix.h" -#include -#include -#include -using namespace std; - -double SparseMatrix::zero = 0.0; - -SparseMatrix::SparseMatrix(const int row_num, const int col_num) -{ - this->init(row_num, col_num); -} -SparseMatrix::~SparseMatrix() -{ - delete[] this->RowSet; -} - -void SparseMatrix::init(const int row_num, const int col_num) -{ - /*Set Size of the Matrix*/ - assert(row_num >= 0); - assert(col_num >= 0); - - this->row = row_num; - this->col = col_num; - this->size = row_num * col_num; - this->size_sparse = 0; - - /*Allocate Space for the Matrix*/ - this->RowSet = new Row[row]; - for(int i=0;i= 0); - assert(col_num >= 0); - delete[] this->RowSet; - this->init(row_num, col_num); - return; -} - -// Set a member -void SparseMatrix::set(const int row_wanted,const int column_wanted,const double &value) -{ - this->RowSet[row_wanted].member.push_back(value); - this->RowSet[row_wanted].j_col.push_back(column_wanted); - this->RowSet[row_wanted].n_col++; - this->size_sparse++; - -// cout<<"\n set()"<<" row="<row); - assert(row_wanted >= 0 ); - assert(column_wanted < this->col); - assert(column_wanted >= 0); - - for(int ic=0; icRowSet[ row_wanted].j_col[ic] == column_wanted) - { - this->RowSet[row_wanted].member[ic] += value; - return; - } - } - - this->set(row_wanted, column_wanted, value); - return; -} - -SparseMatrix& SparseMatrix::operator=(const SparseMatrix &m) -{ - if(m.row!=this->row || m.col!=this->col) - { - cout << "\n row/col number can't match in ComplexMatrix '=' operator\n"; - cout << " this row = " << this->row; - cout << " this col = " << this->col; - cout << " in row = " << m.row; - cout << " in col = " << m.col; - exit(0); - } - else { - this->create(m.row, m.col); - this->size_sparse=0; - } - - for(int ir=0; ir SparseMatrix::convert_to_matrix"; - matrix cm(this->row, this->col); -// cout << "\n row = " << this->row << " col = " << this->col; - for(int i=0;irow;i++) - { - for(int j=0;jRowSet[i].n_col;j++) - { - // cout<<"\n i="<RowSet[i].member[j]; - cm(i, this->RowSet[i].j_col[j]) = this->RowSet[i].member[j]; - } - } - return cm; -} - -void SparseMatrix::multiply_vector( - const double* psi, // - double* h_psi)const -{ - for(int i=0;irow;i++) - { - h_psi[i] = 0.0; - } - - for(int i=0;irow;i++) - { - for(int j=0;jRowSet[i].n_col;j++) - { - -// if( abs( this->RowSet[i].member[j].real() ) > 1.0e-5) -// cout<<"\n i="<RowSet[i].member[j].real() -// <<" "<RowSet[i].j_col[j] ].real(); - - h_psi[i] += this->RowSet[i].member[j] * psi[ this->RowSet[i].j_col[j] ]; - } -// cout<<"\n result ==> "<< h_psi[i]; - } - return; -} - -double SparseMatrix::rate(void) const -{ - assert(size!=0); -// cout << "\n size_sparse = " << size_sparse; - const double occupy_rate = static_cast(size_sparse)/ - static_cast(size); - return occupy_rate; -} diff --git a/ABACUS.develop/source/src_global/sparsematrix.h b/ABACUS.develop/source/src_global/sparsematrix.h deleted file mode 100644 index f3fd78acb3..0000000000 --- a/ABACUS.develop/source/src_global/sparsematrix.h +++ /dev/null @@ -1,85 +0,0 @@ -//========================================================== -// Author: ywcui ,mohan -// Last Upstae : 2009-3-8 -//========================================================== -#ifndef SPARSEMATRIX_H -#define SPARSEMATRIX_H - -#include -#include -#include -#include "matrix.h" - -using namespace std; - -// define a row in the matrix -struct Row -{ - Row():n_col(0){}; - ~Row(){}; - - vector< double > member; - vector j_col;//column number j of a member - int n_col;//non_zero member number in a row - // Constructors and destructor -}; - - -class SparseMatrix -{ -public: - // default constructor - SparseMatrix(const int row_num=0, const int col_num=0); - ~SparseMatrix(); - - // matrix size - int row; //row number - int col; //column number - - // rows in the matrix - Row * RowSet; - - //allocate new space for a sparse matrix - void create (const int row_num, const int col_num); - - //add an new element - void set( - const int row_wanted, - const int column_wanted, - const double &value); - - void set_add( - const int row_wanted, - const int column_wanted, - const double &value); - - void reset( - const int row_wanted, - const int column_wanted, - const double &value); - - // An important function - void multiply_vector( - const double* psi, - double* h_psi - )const; - - //operators - double &operator()(const int row,const int column); - const double &operator()(const int row,const int column)const ; - SparseMatrix& operator=(const SparseMatrix &m); - - const matrix convert_to_matrix(void)const; - - double rate(void) const; - -private: - void init(const int row_num, const int col_num); - int size_sparse; - int size; - - static double zero; - -}; - -#endif diff --git a/ABACUS.develop/source/src_global/sph_bessel_recursive-d2.cpp b/ABACUS.develop/source/src_global/sph_bessel_recursive-d2.cpp index 02dc3fb7b7..945f691f69 100644 --- a/ABACUS.develop/source/src_global/sph_bessel_recursive-d2.cpp +++ b/ABACUS.develop/source/src_global/sph_bessel_recursive-d2.cpp @@ -13,6 +13,8 @@ // Peize Lin test #include #include +#include"src_external/src_test/src_ri/exx_lcao-test.h" +#include"src_lcao/global_fp.h" using namespace std; vector Sph_Bessel_Recursive_Pool::D2::sb_pool; @@ -46,20 +48,12 @@ void Sph_Bessel_Recursive::D2::cal_jlx_0( const int l_size, const size_t ix1_siz for( int l=0; l!=l_size; ++l ) { const double jlx0 = (0==l) ? 1.0 : 0.0; - + if( jlx[l].size()(1,jlx0)); if( jlx[l][0].size() &v) :x(v.x),y(v.y),z(v.z){}; // Peize Lin add 2018-07-16 void set(const T &x1, const T &y1,const T &z1) { x = x1; y = y1; z = z1; } Vector3& operator =(const Vector3 &u) { x=u.x; y=u.y; z=u.z; return *this; } @@ -35,8 +36,8 @@ class Vector3 T norm2(void) const { return x*x + y*y + z*z; } T norm(void) const { return sqrt(norm2()); } - void normalize(void){ const T m=norm(); x/=m; y/=m; z/=m; } - void reverse(void) { x=-x; y=-y; z=-z; } + Vector3& normalize(void){ const T m=norm(); x/=m; y/=m; z/=m; return *this; } // Peize Lin update return 2019-09-08 + Vector3& reverse(void){ x=-x; y=-y; z=-z; return *this; } // Peize Lin update return 2019-09-08 void print(void)const ; // mohan add 2009-11-29 }; diff --git a/ABACUS.develop/source/src_lcao/ylm.cpp b/ABACUS.develop/source/src_global/ylm.cpp similarity index 100% rename from ABACUS.develop/source/src_lcao/ylm.cpp rename to ABACUS.develop/source/src_global/ylm.cpp diff --git a/ABACUS.develop/source/src_lcao/ylm.h b/ABACUS.develop/source/src_global/ylm.h similarity index 100% rename from ABACUS.develop/source/src_lcao/ylm.h rename to ABACUS.develop/source/src_global/ylm.h diff --git a/ABACUS.develop/source/src_pw/berryphase.cpp b/ABACUS.develop/source/src_io/berryphase.cpp similarity index 98% rename from ABACUS.develop/source/src_pw/berryphase.cpp rename to ABACUS.develop/source/src_io/berryphase.cpp index 90ead4a1a6..e7f06e6053 100644 --- a/ABACUS.develop/source/src_pw/berryphase.cpp +++ b/ABACUS.develop/source/src_io/berryphase.cpp @@ -1,5 +1,7 @@ #include "berryphase.h" +bool berryphase::berry_phase_flag=false; + berryphase::berryphase() { GDIR = INPUT.gdir; @@ -19,26 +21,31 @@ void berryphase::get_occupation_bands() } occ_nbands = (int) occupied_bands; - if(occ_nbands > NBANDS) WARNING_QUIT("berryphase::get_occupation_bands","you set the band numer is not enough for berryphase, please add bands number."); + if(occ_nbands > NBANDS) + { + WARNING_QUIT("berryphase::get_occupation_bands","not enough bands for berryphase, increase band numbers."); + } //ofs_running << "the berryphase's occ_nbands is " << occ_nbands << endl; } void berryphase::lcao_init() { + TITLE("berryphase","lcao_init"); lcao_method.init(); lcao_method.cal_R_number(); lcao_method.cal_orb_overlap(); - + return; } // this routine 依赖于 kpoint的mp生成方式 void berryphase::set_kpoints(const int direction) { + TITLE("berryphase","set_kpoints"); + const int mp_x = kv.nmp[0]; // x,y,z方向k点的数目 const int mp_y = kv.nmp[1]; const int mp_z = kv.nmp[2]; - const int num_k = int(kv.nkstot/2); - + const int num_k = int(kv.nkstot/2); if( direction == 1 ) // 计算x方向 { @@ -63,6 +70,7 @@ void berryphase::set_kpoints(const int direction) int string_index = -1; for(int iz = 0; iz < mp_z; iz++) + { for(int iy = 0; iy < mp_y; iy++) { string_index++; @@ -72,6 +80,7 @@ void berryphase::set_kpoints(const int direction) if( ix == (mp_x-1) ) k_index[string_index][ix+1] = k_index[string_index][0]; } } + } if( NSPIN == 2 ) { @@ -109,6 +118,7 @@ void berryphase::set_kpoints(const int direction) int string_index = -1; for(int iz = 0; iz < mp_z; iz++) + { for(int ix = 0; ix < mp_x; ix++) { string_index++; @@ -118,6 +128,7 @@ void berryphase::set_kpoints(const int direction) if( iy == (mp_y-1) ) k_index[string_index][iy+1] = k_index[string_index][0]; } } + } if( NSPIN == 2 ) { @@ -155,6 +166,7 @@ void berryphase::set_kpoints(const int direction) int string_index = -1; for(int iy = 0; iy < mp_y; iy++) + { for(int ix = 0; ix < mp_x; ix++) { string_index++; @@ -164,6 +176,7 @@ void berryphase::set_kpoints(const int direction) if( iz == (mp_z-1) ) k_index[string_index][iz+1] = k_index[string_index][0]; } } + } if( NSPIN == 2 ) { diff --git a/ABACUS.develop/source/src_pw/berryphase.h b/ABACUS.develop/source/src_io/berryphase.h similarity index 75% rename from ABACUS.develop/source/src_pw/berryphase.h rename to ABACUS.develop/source/src_io/berryphase.h index cd21383e51..c368bec2e9 100644 --- a/ABACUS.develop/source/src_pw/berryphase.h +++ b/ABACUS.develop/source/src_io/berryphase.h @@ -1,17 +1,24 @@ -#ifndef BERRYPHASE -#define BERRYPHASE - - -#include "../src_pw/unkOverlap_pw.h" -#include "../src_lcao/unkOverlap_lcao.h" - +#ifndef BERRYPHASE_H +#define BERRYPHASE_H +#include "../src_io/unk_overlap_pw.h" +#include "../src_io/unk_overlap_lcao.h" class berryphase { + public: + + berryphase(); + ~berryphase(); + + // mohan add 2021-02-16 + static bool berry_phase_flag; + unkOverlap_pw pw_method; + unkOverlap_lcao lcao_method; + int total_string; vector> k_index; int nppstr; @@ -19,14 +26,18 @@ class berryphase int occ_nbands; int GDIR; - berryphase(); - ~berryphase(); void get_occupation_bands(); + void lcao_init(); + void set_kpoints(const int direction); + double stringPhase(int index_str, int nbands); + void Berry_Phase(int nbands, double &pdl_elec_tot, int &mod_elec_tot); + void Macroscopic_polarization(); + string outFormat(const double polarization, const double modulus, const Vector3 project); }; diff --git a/ABACUS.develop/source/src_pw/bessel_basis.cpp b/ABACUS.develop/source/src_io/bessel_basis.cpp similarity index 80% rename from ABACUS.develop/source/src_pw/bessel_basis.cpp rename to ABACUS.develop/source/src_io/bessel_basis.cpp index a0c12f1fb7..47f7a40d8e 100644 --- a/ABACUS.develop/source/src_pw/bessel_basis.cpp +++ b/ABACUS.develop/source/src_io/bessel_basis.cpp @@ -18,6 +18,7 @@ void Bessel_Basis::init( const bool start_from_file, const double &ecutwfc, const int &ntype, + const int &lmax_in, const double &dk, const double &dr) { @@ -42,7 +43,7 @@ void Bessel_Basis::init( //------------------ // Making a table //------------------ - this->init_TableOne( this->smooth, this->sigma, ecutwfc, rcut, dr, Dk, ucell.lmax, Ecut_number, tolerence); + this->init_TableOne( this->smooth, this->sigma, ecutwfc, rcut, dr, Dk, lmax_in, Ecut_number, tolerence); //----------------------------------------------- // for test. @@ -56,14 +57,14 @@ void Bessel_Basis::init( if( start_from_file ) { // setup C4 - this->allocate_C4(ntype, ucell.lmax, ucell.nmax, Ecut_number); + this->allocate_C4(ntype, lmax_in, ucell.nmax, Ecut_number); // check tolerence this->readin_C4("INPUTs", ntype, ecut, rcut, Ecut_number, tolerence); #ifdef __MPI Parallel_Common::bcast_double( C4.ptr, C4.getSize() ); #endif - this->init_Faln(ntype, ucell.lmax, ucell.nmax, Ecut_number); + this->init_Faln(ntype, lmax_in, ucell.nmax, Ecut_number); } return; @@ -119,7 +120,7 @@ void Bessel_Basis::init_Faln( const int &nmax, const int &ecut_number) { - if(test_spillage) TITLE("Bessel_Basis","init_Faln"); + TITLE("Bessel_Basis","init_Faln"); timer::tick("Spillage","init_Faln"); assert( this->kmesh > 0); @@ -143,7 +144,7 @@ void Bessel_Basis::init_Faln( } } } - if(test_spillage)OUT("nwfc = ",nwfc); + OUT("nwfc = ",nwfc); timer::tick("Spillage","init_Faln"); return; @@ -161,7 +162,7 @@ void Bessel_Basis::init_TableOne( const int &ecut_number, const double &tolerence) { - if(test_spillage) TITLE("Bessel_Basis","init_TableOne"); + TITLE("Bessel_Basis","init_TableOne"); timer::tick("Spillage","TableONe"); // check assert(ecutwfc > 0.0); @@ -202,11 +203,47 @@ void Bessel_Basis::init_TableOne( } } + //caoyu add 2021-3-10 + //=========output .orb format============= + stringstream ss; + ss << global_out_dir << "jle.orb"; + ofstream ofs(ss.str().c_str()); + ofs << "---------------------------------------------------------------------------"<< endl; + ofs << setiosflags(ios::left) << setw(28) << "Energy Cutoff(Ry)" << ecutwfc << endl; + ofs << setiosflags(ios::left) << setw(28) << "Radius Cutoff(a.u.)" << rcut << endl; + ofs << setiosflags(ios::left) << setw(28) << "Lmax" << lmax << endl; + for (int l = 0; l < lmax + 1; l++) + { + switch (l) + { + case 0: + ofs << setiosflags(ios::left) << setw(28) << "Number of Sorbitals-->" << ecut_number << endl; + break; + case 1: + ofs << setiosflags(ios::left) << setw(28) << "Number of Porbitals-->" << ecut_number << endl; + break; + case 2: + ofs << setiosflags(ios::left) << setw(28) << "Number of Dorbitals-->" << ecut_number << endl; + break; + case 3: + ofs << setiosflags(ios::left) << setw(28) << "Number of Forbitals-->" << ecut_number << endl; + break; + default: + ofs << setiosflags(ios::left) << setw(28) << "Number of Gorbitals-->" << ecut_number << endl; + } + } + ofs << "---------------------------------------------------------------------------"<< endl; + ofs << "SUMMARY END" << endl << endl; + ofs << setiosflags(ios::left) << setw(28) << "Mesh" << rmesh << endl; + ofs << setiosflags(ios::left) << setw(28) << "dr" << dr << endl ; + //=========output .orb format============= // init eigenvalue of Jl for(int l=0; l1)cout << "\n" << setw(5) << it << setw(5) << il << setw(5) << in; - if(test_spillage>1)cout << "\n file=" << filec4; + //for tests + //cout << "\n" << setw(5) << it << setw(5) << il << setw(5) << in; + //cout << "\n file=" << filec4; ifstream inc4( filec4.c_str() ); if(!inc4) @@ -353,7 +408,8 @@ void Bessel_Basis::readin_C4( for(int ie=0; ie> this->C4(it, il, in, ie); - if(test_spillage>1)cout << "\n" << setw(5) << ie << setw(25) << this->C4(it, il, in, ie); + // for tests + //cout << "\n" << setw(5) << ie << setw(25) << this->C4(it, il, in, ie); } } else @@ -388,7 +444,7 @@ void Bessel_Basis::allocate_C4( const int &nmax, const int &ecut_number) { - if(test_spillage) TITLE("Bessel_Basis","allocate_C4"); + TITLE("Bessel_Basis","allocate_C4"); this->C4.create(ntype, lmax+1, nmax, ecut_number); @@ -411,7 +467,7 @@ void Bessel_Basis::allocate_C4( void Bessel_Basis::bcast(void) { #ifdef __MPI - if(test_spillage) TITLE("Bessel_Basis", "bcast"); + TITLE("Bessel_Basis", "bcast"); Parallel_Common::bcast_double( ecut ); Parallel_Common::bcast_double( rcut ); diff --git a/ABACUS.develop/source/src_pw/bessel_basis.h b/ABACUS.develop/source/src_io/bessel_basis.h similarity index 84% rename from ABACUS.develop/source/src_pw/bessel_basis.h rename to ABACUS.develop/source/src_io/bessel_basis.h index 03887730fa..c69b9a992b 100644 --- a/ABACUS.develop/source/src_pw/bessel_basis.h +++ b/ABACUS.develop/source/src_io/bessel_basis.h @@ -1,7 +1,7 @@ //========================================================== // AUTHOR : mohan // DATE : 2009-3-29 -// Last Modify : 2009-08-28 +// Last Modify : 2021-01-04 //========================================================== #ifndef BESSEL_BASIS_H #define BESSEL_BASIS_H @@ -17,11 +17,20 @@ class Bessel_Basis Bessel_Basis(); ~Bessel_Basis(); + //-------------------------------------------------------------------------- // used for a specific group of C4 coefficients. + // mohan updated 2021-01-04, + // mohan added a new input parameter lmax_in, + // if we only generate numerical atomic orbitals based on + // spherical Bessel functions, lmax_in = ucell.lmax + // However, if we want to generate spherical Bessel functions for descriptor, + // then the lmax_in is controlled by user. + //-------------------------------------------------------------------------- void init( const bool start_from_file, const double &ecutwfc, const int &ntype, + const int &lmax_in, const double &dk = 0.01, const double &dr = 0.01); diff --git a/ABACUS.develop/source/src_lcao/cal_r_overlap_R.cpp b/ABACUS.develop/source/src_io/cal_r_overlap_R.cpp similarity index 81% rename from ABACUS.develop/source/src_lcao/cal_r_overlap_R.cpp rename to ABACUS.develop/source/src_io/cal_r_overlap_R.cpp index 27b89cbcb3..ff803ecd56 100644 --- a/ABACUS.develop/source/src_lcao/cal_r_overlap_R.cpp +++ b/ABACUS.develop/source/src_io/cal_r_overlap_R.cpp @@ -24,6 +24,8 @@ cal_r_overlap_R::~cal_r_overlap_R() void cal_r_overlap_R::init() { + TITLE("cal_r_overlap_R","init"); + this->R_x_num = GridD.getCellX(); this->R_y_num = GridD.getCellY(); this->R_z_num = GridD.getCellZ(); @@ -31,7 +33,7 @@ void cal_r_overlap_R::init() this->R_minY = (int)GridD.getD_minY(); this->R_minZ = (int)GridD.getD_minZ(); - + // allocate for psi_r_psi psi_r_psi = new Vector3 ***[R_x_num]; for(int ix = 0; ix < R_x_num; ix++) { @@ -48,7 +50,8 @@ void cal_r_overlap_R::init() this->allocate_psi_r_psi = true; - int Lmax_used, Lmax; + int Lmax_used=0; + int Lmax=0; MOT.allocate( ORB.get_ntype(),// number of atom types @@ -198,33 +201,62 @@ void cal_r_overlap_R::init() } for( auto &co1 : center2_orb11 ) + { for( auto &co2 : co1.second ) + { for( auto &co3 : co2.second ) + { for( auto &co4 : co3.second ) + { for( auto &co5 : co4.second ) + { for( auto &co6 : co5.second ) + { co6.second.init_radial_table(); + } + } + } + } + } + } for( auto &co1 : center2_orb21_r ) + { for( auto &co2 : co1.second ) + { for( auto &co3 : co2.second ) + { for( auto &co4 : co3.second ) + { for( auto &co5 : co4.second ) + { for( auto &co6 : co5.second ) + { co6.second.init_radial_table(); + } + } + } + } + } + } - + return; } void cal_r_overlap_R::out_r_overlap_R(const int nspin) { + TITLE("cal_r_overlap_R","out_r_overlap_R"); + timer::tick("cal_r_overlap_R","out_r_overlap_R"); + Vector3 tau1, tau2, dtau; Vector3 origin_point(0.0,0.0,0.0); int R_x; int R_y; int R_z; + + double factor = sqrt(FOUR_PI/3.0); for(int ix = 0; ix < R_x_num; ix++) { @@ -239,34 +271,53 @@ void cal_r_overlap_R::out_r_overlap_R(const int nspin) Vector3 R_car = Vector3(dRx,dRy,dRz) * ucell.latvec; int ir,ic; - for(int orb_index_in_NLOCAL_1 = 0; orb_index_in_NLOCAL_1 < NLOCAL; orb_index_in_NLOCAL_1++) + for(int iw1 = 0; iw1 < NLOCAL; iw1++) { - ir = ParaO.trace_loc_row[orb_index_in_NLOCAL_1]; + ir = ParaO.trace_loc_row[iw1]; if(ir >= 0) { - for(int orb_index_in_NLOCAL_2 = 0; orb_index_in_NLOCAL_2 < NLOCAL; orb_index_in_NLOCAL_2++) + for(int iw2 = 0; iw2 < NLOCAL; iw2++) { - ic = ParaO.trace_loc_col[orb_index_in_NLOCAL_2]; + ic = ParaO.trace_loc_col[iw2]; if(ic >= 0) { int icc = ir + ic * ParaO.nrow; - int orb_index_row = orb_index_in_NLOCAL_1 / NPOL; - int orb_index_col = orb_index_in_NLOCAL_2 / NPOL; + int orb_index_row = iw1 / NPOL; + int orb_index_col = iw2 / NPOL; // soc中非对角项为零,两个对角项相同 - int new_index = orb_index_in_NLOCAL_1 - NPOL*orb_index_row + (orb_index_in_NLOCAL_2 - NPOL*orb_index_col)*NPOL; + int new_index = iw1 - NPOL*orb_index_row + + (iw2 - NPOL*orb_index_col)*NPOL; if(new_index == 0 || new_index == 3) { - int atomType1 = iw2it(orb_index_row); int ia1 = iw2ia(orb_index_row); int N1 = iw2iN(orb_index_row); int L1 = iw2iL(orb_index_row); int m1 = iw2im(orb_index_row); - int atomType2 = iw2it(orb_index_col); int ia2 = iw2ia(orb_index_col); int N2 = iw2iN(orb_index_col); int L2 = iw2iL(orb_index_col); int m2 = iw2im(orb_index_col); - Vector3 r_distance = ( ucell.atoms[atomType2].tau[ia2] - ucell.atoms[atomType1].tau[ia1] + R_car ) * ucell.lat0; - double overlap_o = center2_orb11[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, m2 ); - double overlap_x = -1 * sqrt(FOUR_PI/3.0) * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 1, m2 ); // m = 1 - double overlap_y = -1 * sqrt(FOUR_PI/3.0) * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 2, m2 ); // m = -1 - double overlap_z = sqrt(FOUR_PI/3.0) * center2_orb21_r[atomType1][atomType2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 0, m2 ); // m = 0 - psi_r_psi[ix][iy][iz][icc] = Vector3( overlap_x,overlap_y,overlap_z ) + ucell.atoms[atomType1].tau[ia1] * ucell.lat0 * overlap_o; + int it1 = iw2it(orb_index_row); + int ia1 = iw2ia(orb_index_row); + int N1 = iw2iN(orb_index_row); + int L1 = iw2iL(orb_index_row); + int m1 = iw2im(orb_index_row); + + int it2 = iw2it(orb_index_col); + int ia2 = iw2ia(orb_index_col); + int N2 = iw2iN(orb_index_col); + int L2 = iw2iL(orb_index_col); + int m2 = iw2im(orb_index_col); + + Vector3 r_distance = ( ucell.atoms[it2].tau[ia2] + - ucell.atoms[it1].tau[ia1] + R_car ) * ucell.lat0; + +double overlap_o = center2_orb11[it1][it2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, m2 ); + double overlap_x = -1 * factor * +center2_orb21_r[it1][it2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 1, m2 ); // m = 1 + double overlap_y = -1 * factor * +center2_orb21_r[it1][it2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 2, m2 ); // m = -1 + double overlap_z = factor * +center2_orb21_r[it1][it2][L1][N1][L2].at(N2).cal_overlap( origin_point, r_distance, m1, 0, m2 ); // m = 0 + + psi_r_psi[ix][iy][iz][icc] = Vector3( overlap_x,overlap_y,overlap_z ) ++ ucell.atoms[it1].tau[ia1] * ucell.lat0 * overlap_o; + } else { @@ -339,7 +390,8 @@ void cal_r_overlap_R::out_r_overlap_R(const int nspin) { if(i==0 && j==0) { - out_r << dRx << " " << dRy << " " << dRz << " //R vector(R2 - R1,unit: lattice vector)" < using std::set; -#include "../src_lcao/center2_orb.h" -#include "../src_lcao/center2_orb-orb11.h" -#include "../src_lcao/center2_orb-orb21.h" +#include "src_lcao/center2_orb.h" +#include "src_lcao/center2_orb-orb11.h" +#include "src_lcao/center2_orb-orb21.h" -#include "../src_lcao/make_overlap_table.h" -#include "../src_lcao/make_gaunt_table.h" -#include "../src_lcao/numerical_orbital_lm.h" -#include "../src_lcao/lcao_orbitals.h" -#include "../src_global/vector3.h" -#include "../src_lcao/ylm.h" -#include "../src_lcao/global_fp.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/ORB_atomic_lm.h" +#include "src_lcao/ORB_read.h" +#include "src_global/vector3.h" +#include "src_global/ylm.h" +#include "src_lcao/global_fp.h" -#include "../src_pw/global.h" +#include "src_pw/global.h" + +// output r_R matrix, added by Jingan class cal_r_overlap_R { -public: - Make_Overlap_Table MOT; - Make_Gaunt_Table MGT; + + public: + + cal_r_overlap_R(); + ~cal_r_overlap_R(); + + + ORB_table_phi MOT; + + ORB_gaunt_table MGT; + Numerical_Orbital_Lm orb_r; + vector>> orbital_phi; int R_x_num; @@ -56,11 +67,6 @@ class cal_r_overlap_R map>>>>> center2_orb21_r; - - - cal_r_overlap_R(); - ~cal_r_overlap_R(); - void init(); void out_r_overlap_R(const int nspin); diff --git a/ABACUS.develop/source/src_pw/cal_test.cpp b/ABACUS.develop/source/src_io/cal_test.cpp similarity index 94% rename from ABACUS.develop/source/src_pw/cal_test.cpp rename to ABACUS.develop/source/src_io/cal_test.cpp index fa314ad380..9cefcaa5c7 100644 --- a/ABACUS.develop/source/src_pw/cal_test.cpp +++ b/ABACUS.develop/source/src_io/cal_test.cpp @@ -1,7 +1,6 @@ -#include "global.h" -#include "tools.h" +#include "src_pw/global.h" +#include "src_pw/tools.h" #include "cal_test.h" -#include "cal_test0.h" double Cal_Test::mporter; @@ -62,13 +61,13 @@ void Cal_Test::test_memory(void) mrho_core = mrho; // (2) memory for charge mixing - cout << " Mixing mode = " << chr.mixing_mode << endl; - if(chr.mixing_mode == "pulay") + cout << " Mixing mode = " << CHR.mixing_mode << endl; + if(CHR.mixing_mode == "pulay") { - cout << " Mixing dimension = " << chr.mixing_ndim << endl; - mRrho = chr.mixing_ndim * mrho; - mdRrho = (chr.mixing_ndim-1) * mrho; - mdrho = (chr.mixing_ndim-1) * mrho; + cout << " Mixing dimension = " << CHR.mixing_ndim << endl; + mRrho = CHR.mixing_ndim * mrho; + mdRrho = (CHR.mixing_ndim-1) * mrho; + mdrho = (CHR.mixing_ndim-1) * mrho; mrho_save2 = mrho; // cout << " Memory for pulay mixing: " << mrho << " MB" << endl; } @@ -86,7 +85,8 @@ void Cal_Test::test_memory(void) mhs = Memory::calculate_mem( NLOCAL*NLOCAL, "double" ); mwf = Memory::calculate_mem( NLOCAL*NBANDS, "double" ); mnonzero = Memory::calculate_mem( NLOCAL*(NLOCAL+1)/2, "bool"); - mspar_hsrho = Memory::calculate_mem( Hnnz*3, "double"); +// mohan comment out 2021-02-11 +// mspar_hsrho = Memory::calculate_mem( Hnnz*3, "double"); mgvec = Memory::calculate_mem( ngmc * 3 * 2, "double" ); diff --git a/ABACUS.develop/source/src_pw/cal_test.h b/ABACUS.develop/source/src_io/cal_test.h similarity index 100% rename from ABACUS.develop/source/src_pw/cal_test.h rename to ABACUS.develop/source/src_io/cal_test.h diff --git a/ABACUS.develop/source/src_pw/chi0_hilbert.cpp b/ABACUS.develop/source/src_io/chi0_hilbert.cpp similarity index 99% rename from ABACUS.develop/source/src_pw/chi0_hilbert.cpp rename to ABACUS.develop/source/src_io/chi0_hilbert.cpp index 9b5c645c36..e9f183d295 100644 --- a/ABACUS.develop/source/src_pw/chi0_hilbert.cpp +++ b/ABACUS.develop/source/src_io/chi0_hilbert.cpp @@ -7,14 +7,15 @@ //theory . and it is a basic work and use the hilbert-transform to reduce the //calculated quantities. //------------------------------------------------------------------------------- -#include "global.h" +#include "src_pw/global.h" #include "chi0_hilbert.h" -#include "algorithms.h" -#include "hamilt_pw.h" -#include "wavefunc_in_pw.h" -#include "optical.h" -#include "klist.h" +#include "src_pw/hamilt_pw.h" +#include "src_pw/wavefunc_in_pw.h" +#include "../src_io/optical.h" +#include "src_pw/klist.h" #include +#include "../src_lcao/global_fp.h" + using namespace std; Chi0_hilbert chi0_hilbert; @@ -50,6 +51,7 @@ Chi0_hilbert::~Chi0_hilbert() } // begin calculate +#include "src_pw/occupy.h" void Chi0_hilbert::Chi() { TITLE("Chi0_hilbert","Chi"); @@ -476,9 +478,12 @@ void Chi0_hilbert::Chi() { for(int i=0; i *b_core; - int *num_G_core; - int *num_G_dis; - complex *b_summary; - complex *b_order; - double *G_r_core; - int *num_Gvector_core; - int *num_Gvector_dis; - int *flag; - double *G_r; - double *Gvec_core; - double *Gvec; - double **cweight; - complex **psi_r1; - complex **psi_r2; - complex ***b; - complex **chi0s; - complex **chi0_gg; - complex **T; - complex **kernel; - complex **rpa; + complex *b_core; + int *num_G_core; + int *num_G_dis; + complex *b_summary; + complex *b_order; + double *G_r_core; + int *num_Gvector_core; + int *num_Gvector_dis; + int *flag; + double *G_r; + double *Gvec_core; + double *Gvec; + double **cweight; + complex **psi_r1; + complex **psi_r2; + complex ***b; + complex **chi0s; + complex **chi0_gg; + complex **T; + complex **kernel; + complex **rpa; + + int *flag1; + double **para_g; + complex **chi0_para; + complex **rpa1; + complex **chi_para; - int *flag1; - double **para_g; - complex **chi0_para; - complex **rpa1; - complex **chi_para; - - Vector3 ***R; - Vector3 ***Rcar; - int ** Rmax; - int NR; - complex ****overlap; + Vector3 ***R; + Vector3 ***Rcar; + int ** Rmax; + int NR; + complex ****overlap; }; extern Chi0_hilbert chi0_hilbert; diff --git a/ABACUS.develop/source/src_pw/chi0_standard.cpp b/ABACUS.develop/source/src_io/chi0_standard.cpp similarity index 98% rename from ABACUS.develop/source/src_pw/chi0_standard.cpp rename to ABACUS.develop/source/src_io/chi0_standard.cpp index 666148e914..ec0eb6457e 100644 --- a/ABACUS.develop/source/src_pw/chi0_standard.cpp +++ b/ABACUS.develop/source/src_io/chi0_standard.cpp @@ -6,16 +6,17 @@ //this part is for calculating some optical properties using the linear response //theory . //------------------------------------------------------------------------------- -#include "global.h" + +#include "src_pw/global.h" #include "chi0_standard.h" -#include "algorithms.h" -#include "hamilt_pw.h" -#include "wavefunc_in_pw.h" -#include "optical.h" -#include "klist.h" +#include "src_pw/hamilt_pw.h" +#include "src_pw/wavefunc_in_pw.h" +#include "src_io/optical.h" +#include "src_pw/klist.h" #include #include #include + using namespace std; Chi0_standard chi0_standard; @@ -262,7 +263,7 @@ void Chi0_standard:: Chi() Cal_rpa(iq); Cal_chi(); cout<<"chi iq= "< +#include +#include + + +void energy::perform_dos(void) +{ + TITLE("energy","perform_dos"); + + + if(out_dos !=0 || out_band !=0) + { + ofs_running << "\n\n\n\n"; + ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl; + ofs_running << " | |" << endl; + ofs_running << " | Post-processing of data: |" << endl; + ofs_running << " | DOS (density of states) and bands will be output here. |" << endl; + ofs_running << " | If atomic orbitals are used, Mulliken charge analysis can be done. |" << endl; + ofs_running << " | Also the .bxsf file containing fermi surface information can be |" << endl; + ofs_running << " | done here. |" << endl; + ofs_running << " | |" << endl; + ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl; + ofs_running << "\n\n\n\n"; + } + + + if(MY_RANK==0) + { + if(CALCULATION=="scf" || CALCULATION=="md" || CALCULATION=="relax") + { + stringstream ss; + ss << global_out_dir << "istate.info" ; + ofstream ofsi( ss.str().c_str() ); + /*for(int ib=0; ibout_dos) + { + // find the maximal and minimal band energy. + double emax = wf.ekb[0][0]; + double emin = wf.ekb[0][0]; + for(int ik=0; ikdos_edelta_ev; + + + const int npoints = static_cast(std::floor ( ( emax - emin ) / de_ev )); + + int NUM=NLOCAL*npoints; + + Wfc_Dm_2d D; + D.init(); + if(GAMMA_ONLY_LOCAL) + { + for(int in=0;in*waveg = new complex[NLOCAL]; + + double*Gauss = new double[np]; + + for(int is=0; is Mulk; + Mulk.resize(1); + Mulk[0].create(ParaO.ncol,ParaO.nrow); + + + matrix Dwf = D.wfc_gamma[is]; + for (int i=0; i Mulk; + Mulk.resize(1); + Mulk[0].create(ParaO.ncol,ParaO.nrow); + + + for(int ik=0;ik" <" << NSPIN<< "<"<<"/"<<"nspin"<<">"<< endl; + out << "<"<<"norbitals"<<">" <"<< endl; + out << "<"<<"energy"<<"_"<<"values units"<<"="<<"\""<<"eV"<<"\""<<">"<" <nw; ++j) + { + const int L1 = atom1->iw2l[j]; + const int N1 = atom1->iw2n[j]; + const int m1 = atom1->iw2m[j]; + const int w = ucell.itiaiw2iwt(t, a, j); + + //out << "<"<<"/"<<"energy"<<"_"<<"values"<<">" <" <" <" <" <" <nw; ++j) + { + const int L1 = atom1->iw2l[j]; + const int N1 = atom1->iw2n[j]; + const int m1 = atom1->iw2m[j]; + out <dos_edelta_ev, + emax, + emin, + kv.nks, kv.nkstot, kv.wk, wf.wg, NBANDS, wf.ekb ); + ifstream in(ss.str().c_str()); + if(!in) + { + // cout<<"\n Can't find file : "<< name << endl; + // return 0; + } + + //---------------------------------------------------------- + // FOUND LOCAL VARIABLES : + // NAME : number(number of DOS points) + // NAME : nk(number of k point used) + // NAME : energy(energy range,from emin_ev to emax_ev) + // NAME : dos(old,count k points in the energy range) + // NAME : dos2(new,count k points in the energy range) + //---------------------------------------------------------- + int number=0; + int nk=0; + in >> number; + in >> nk; + double *energy = new double[number]; + double *dos = new double[number]; + double *dos2 = new double[number]; + for(int i=0 ;i> energy[i] >> dos[i]; + } + if(!in.eof()) + { + //cout<<"\n Read Over!"<ef << " Rydberg" << endl; + } + else if(nspin0==2) + { + ofs_running << " Fermi energy (spin = 1) is " << this->ef_up << " Rydberg" << endl; + ofs_running << " Fermi energy (spin = 2) is " << this->ef_dw << " Rydberg" << endl; + } + + //int nks; + //if(nspin0==1) nks = kv.nkstot; + //else if(nspin0==2) nks = kv.nkstot/2; + + + + /*for(int is=0; isef, wf.ekb); + }*/ + + if(out_dos==3) + { + for(int i=0; iout_band) //pengfei 2014-10-13 + { + + int nks; + if(nspin0==1) nks = kv.nkstot; + else if(nspin0==2) nks = kv.nkstot/2; + + + + for(int is=0; isef*0, wf.ekb); + } + + } + return; +} diff --git a/ABACUS.develop/source/src_pw/epsilon0_pwscf.cpp b/ABACUS.develop/source/src_io/epsilon0_pwscf.cpp similarity index 99% rename from ABACUS.develop/source/src_pw/epsilon0_pwscf.cpp rename to ABACUS.develop/source/src_io/epsilon0_pwscf.cpp index bedf1c0519..8d65f715dd 100644 --- a/ABACUS.develop/source/src_pw/epsilon0_pwscf.cpp +++ b/ABACUS.develop/source/src_io/epsilon0_pwscf.cpp @@ -6,14 +6,14 @@ //this part is for calculating the macroscopic dielectric tensor using the linear //response theory . //------------------------------------------------------------------------------- -#include "global.h" -#include "algorithms.h" -#include "hamilt_pw.h" +#include "src_pw/global.h" +#include "src_pw/hamilt_pw.h" #include "../src_pw/wavefunc_in_pw.h" -#include "optical.h" +#include "src_io/optical.h" #include "epsilon0_pwscf.h" #include #include + using namespace std; Epsilon0_pwscf epsilon0_pwscf; diff --git a/ABACUS.develop/source/src_pw/epsilon0_pwscf.h b/ABACUS.develop/source/src_io/epsilon0_pwscf.h similarity index 76% rename from ABACUS.develop/source/src_pw/epsilon0_pwscf.h rename to ABACUS.develop/source/src_io/epsilon0_pwscf.h index dd9fa5cbdc..bd086fcb45 100644 --- a/ABACUS.develop/source/src_pw/epsilon0_pwscf.h +++ b/ABACUS.develop/source/src_io/epsilon0_pwscf.h @@ -1,13 +1,8 @@ #ifndef EPSILON0_PWSCF_H #define EPSILON0_PWSCF_H -#include "wavefunc.h" +#include "src_pw/wavefunc.h" #include "../src_parallel/parallel_global.h" -//#if defined __FFTW2 -//#include "../src_parallel/fftw.h" -//#elif defined __FFTW3 -//#include "../src_parallel/fftw3.h" -//#endif class Epsilon0_pwscf { @@ -46,4 +41,4 @@ class Epsilon0_pwscf extern Epsilon0_pwscf epsilon0_pwscf; -#endif \ No newline at end of file +#endif diff --git a/ABACUS.develop/source/src_pw/epsilon0_vasp.cpp b/ABACUS.develop/source/src_io/epsilon0_vasp.cpp similarity index 96% rename from ABACUS.develop/source/src_pw/epsilon0_vasp.cpp rename to ABACUS.develop/source/src_io/epsilon0_vasp.cpp index 7eaa2feebe..9fdd5e8786 100644 --- a/ABACUS.develop/source/src_pw/epsilon0_vasp.cpp +++ b/ABACUS.develop/source/src_io/epsilon0_vasp.cpp @@ -6,14 +6,14 @@ //this part is for calculating the macroscopic dielectric tensor using the linear //response theory . //------------------------------------------------------------------------------- -#include "global.h" -#include "algorithms.h" -#include "hamilt_pw.h" +#include "src_pw/global.h" +#include "src_pw/hamilt_pw.h" #include "../src_pw/wavefunc_in_pw.h" -#include "optical.h" +#include "./src_io/optical.h" #include "epsilon0_vasp.h" #include #include + using namespace std; Epsilon0_vasp epsilon0_vasp; diff --git a/ABACUS.develop/source/src_pw/epsilon0_vasp.h b/ABACUS.develop/source/src_io/epsilon0_vasp.h similarity index 80% rename from ABACUS.develop/source/src_pw/epsilon0_vasp.h rename to ABACUS.develop/source/src_io/epsilon0_vasp.h index d6a073954e..dfb7e3c3ef 100644 --- a/ABACUS.develop/source/src_pw/epsilon0_vasp.h +++ b/ABACUS.develop/source/src_io/epsilon0_vasp.h @@ -1,13 +1,8 @@ #ifndef EPSILON0_VASP_H #define EPSILON0_VASP_H -#include "wavefunc.h" +#include "src_pw/wavefunc.h" #include "../src_parallel/parallel_global.h" -//#if defined __FFTW2 -//#include "../src_parallel/fftw.h" -//#elif defined __FFTW3 -//#include "../src_parallel/fftw3.h" -//#endif class Epsilon0_vasp { diff --git a/ABACUS.develop/source/src_pw/eximport.cpp b/ABACUS.develop/source/src_io/eximport.cpp similarity index 92% rename from ABACUS.develop/source/src_pw/eximport.cpp rename to ABACUS.develop/source/src_io/eximport.cpp index 444167a69f..569952cdf2 100644 --- a/ABACUS.develop/source/src_pw/eximport.cpp +++ b/ABACUS.develop/source/src_io/eximport.cpp @@ -2,7 +2,7 @@ // AUTHOR : mohan // DATE : 2008-11-5 //========================================================== -#include "wan_global.h" +#include "../src_pw/global.h" #include "eximport.h" eximport::eximport() @@ -23,7 +23,7 @@ void eximport::write_data const string &type ) { - if(test_eximport) TITLE("eximport","write_data"); + TITLE("eximport","write_data"); ofstream ofs(fn.c_str()); this->out_input(ofs); @@ -81,7 +81,7 @@ void eximport::write_data void eximport::read_data(const string &fn) { - if(test_eximport) TITLE("eximport","read_data"); + TITLE("eximport","read_data"); ifstream ifs(fn.c_str()); if(!ifs) @@ -107,7 +107,7 @@ void eximport::read_data(const string &fn) void eximport::print_data(const string &fn) const { - if(test_eximport) TITLE("eximport","print_data"); + TITLE("eximport","print_data"); ofstream ofs( fn.c_str() ); ofs << setw(20) << "basis" << setw(20) << this->basis << endl; @@ -202,7 +202,7 @@ void eximport::fir_wf(ComplexMatrix *psi, const int npsi, const string &fn) void eximport::out_gspace_wan(const ComplexMatrix *psi,const int iw,const string &file_name) { - if(test_eximport)cout<<"\n ==> ei.wanG_for_fit"; + //cout<<"\n ==> ei.wanG_for_fit"; ofstream out_gwan(file_name.c_str()); int qtot = 0; for(int ik=0; ik ***psi, const int npsi, const string &fn //****************** void eximport::out_wannier(ofstream &out_data) { - if(test_eximport) cout<<"\n ==> out_wannier"< out_wannier"< out_unitcell" << endl; + //cout << "\n ==> out_unitcell" << endl; out_data << setw(20) << "UNITCELL" << endl; //2.0 out_data << setw(20) << ucell.lat0 << endl; //2.1 @@ -413,7 +413,7 @@ void eximport::in_unitcell(ifstream &in) //*************** void eximport::out_kpoints(ofstream &out_data) { - if(test_eximport)cout << "\n ==> out_k-points" << endl; + //cout << "\n ==> out_k-points" << endl; out_data << "\n"; out_data << "\n" << kv.nkstot << " Number of total k points"; //3.1 int sumq = 0; @@ -440,7 +440,7 @@ void eximport::out_kpoints(ofstream &out_data) void eximport::out_planewave(ofstream &out_data) { - if(test_eximport)cout << "\n ==> out_planewave" << endl; + //cout << "\n ==> out_planewave" << endl; out_data << "\n"; out_data << "\n" << ucell.lat0 << " Lattice constant"; out_data << "\n" << pw.ngmc_g << " Number of plane waves."< out_igk" << endl; + //cout << "\n ==> out_igk" << endl; out_data << "\n"; for(int ik=0; ik out_input" << endl; + //cout << "\n ==> out_input" << endl; out_data << "
"; //1.0 out_data << "\n" << ucell.latName << " Lattice Name";//1.1 @@ -540,12 +540,8 @@ void eximport::out_input(ofstream &out_data) << setw(20) << pw.ny << setw(20) << pw.nz << setw(20) << pw.nxyz << endl;//1.6 -#ifndef __EPM out_data << setw(20) << pot.startingpot << endl;//1.7 - out_data << setw(20) << chr.mixing_beta << endl;//1.8 -#else - out_data << setw(20) << "EPM" << endl; -#endif + out_data << setw(20) << CHR.mixing_beta << endl;//1.8 */ out_data << "\n
"< out_band" << endl; + //cout << "\n ==> out_band" << endl; out_data << setw(20) << "BAND" << endl;//6.0 for (int ik = 0; ik < kv.nks; ik++) { @@ -632,7 +628,7 @@ void eximport::in_band(ifstream &in) //***** void eximport::out_evc(ofstream &out_data) { - if(test_eximport)cout << "=== out_evc ===" << endl; + //cout << "=== out_evc ===" << endl; out_data << setw(20) << "EVC" << endl; out_data << setw(20) << ucell.natomwfc << endl; //4.1 int iw; @@ -703,19 +699,20 @@ void eximport::in_evc(ifstream &in) //=========== // energy //=========== +#include "src_pw/H_Ewald_pw.h" +#include "src_pw/H_Hartree_pw.h" +#include "src_pw/H_XC_pw.h" void eximport::out_energy(ofstream &out_data) { - if(test_eximport)cout << "\n ==> out_energy" << endl; + //cout << "\n ==> out_energy" << endl; out_data << setw(20) << "ENERGY" << endl; //6.0 out_data << setw(20) << en.etot << endl; //6.2 //out_data << setw(20) << elec.dE << endl; //6.3 out_data << setw(20) << en.eband << endl; //6.4 out_data << setw(20) << en.eband + en.deband << endl; //6.5 - out_data << setw(20) << en.ehart << endl; //6.6 -#ifndef __EPM - out_data << setw(20) << en.etxc - en.etxcc << endl; //6.7 -#endif - out_data << setw(20) << en.ewld << endl; //6.8 + out_data << setw(20) << H_Hartree_pw::hartree_energy << endl; + out_data << setw(20) << H_XC_pw::etxc - en.etxcc << endl; //6.7 + out_data << setw(20) << H_Ewald_pw::ewald_energy << endl; //6.8 } void eximport::in_energy(ifstream &in) @@ -727,22 +724,16 @@ void eximport::in_energy(ifstream &in) cout << "== wrong in in_energy ===" << endl; exit(0); } -#ifndef __EPM in >> iter;//6.1 -#endif in >> etot;//6.2 in >> eband;//6.4 in >> one_electron;//6.5 in >> hartree;//6.6 -#ifndef __EPM in >> xc;//6.7 -#endif in >> ewald;//6.8 } #ifdef __MPI -#ifdef __EPM -#else void eximport::in_charge_mpi(const string &dir) { cout << "\n ==> eximport::in_charge()" << endl; @@ -810,7 +801,7 @@ void eximport::in_charge_mpi(const string &dir) { for(iz=0;iz eximport::nscf_chgfile()"; cout<<" file_name : "< 0) mode = 1; else mode = 2; - int fermi_band, bands_below, bands_above; + int fermi_band=0; + int bands_below=0; + int bands_above=0; // (2) cicle: // (2.1) calculate the selected density matrix @@ -42,7 +38,6 @@ void IState_Charge::begin(void) // (1.1) allocate the space for LOWF.WFC_GAMMA // (1.2) read in LOWF_GAMMA.dat - OUT(ofs_running,"LOWF.allocate_flag",LOWF.get_allocate_flag()); cout << " number of electrons = " << ucell.nelec << endl; @@ -115,7 +110,7 @@ void IState_Charge::begin(void) { cout << " Perform band decomposed charge density for band " << ib+1 << endl; // (1) - // This has been done once in local_orbital_ions. + // This has been done once in LOOP_ions. // but here we need to done for each band. LOC.allocate_gamma(GridT); @@ -126,20 +121,20 @@ void IState_Charge::begin(void) // (3) zero out of charge density array. for(int is=0; is= 0) { + //--------------------------------------------------------- + // LOWF.WFC_GAMMA has been replaced by wfc_dm_2d.cpp + // we need to fix this function in near future. + // -- mohan add 2021-02-09 + //--------------------------------------------------------- + WARNING_QUIT("IState_Charge::idmatrix","need to update LOWF.WFC_GAMMA"); // 2 stands for degeneracy. - alpha[nu_local] += 2.0 * LOWF.WFC_GAMMA[is][ib][mu_local] * LOWF.WFC_GAMMA[is][ib][nu_local]; + //alpha[nu_local] += 2.0 * LOWF.WFC_GAMMA[is][ib][mu_local] * LOWF.WFC_GAMMA[is][ib][nu_local]; } } } diff --git a/ABACUS.develop/source/src_lcao/istate_charge.h b/ABACUS.develop/source/src_io/istate_charge.h similarity index 99% rename from ABACUS.develop/source/src_lcao/istate_charge.h rename to ABACUS.develop/source/src_io/istate_charge.h index 63510f03b1..a112f53b6d 100644 --- a/ABACUS.develop/source/src_lcao/istate_charge.h +++ b/ABACUS.develop/source/src_io/istate_charge.h @@ -4,13 +4,14 @@ class IState_Charge { public: + IState_Charge(); ~IState_Charge(); void begin(); - private: + int *bands_picked; void idmatrix(const int &ib); diff --git a/ABACUS.develop/source/src_lcao/istate_envelope.cpp b/ABACUS.develop/source/src_io/istate_envelope.cpp similarity index 77% rename from ABACUS.develop/source/src_lcao/istate_envelope.cpp rename to ABACUS.develop/source/src_io/istate_envelope.cpp index 0148001ed0..b156770f04 100644 --- a/ABACUS.develop/source/src_lcao/istate_envelope.cpp +++ b/ABACUS.develop/source/src_io/istate_envelope.cpp @@ -3,14 +3,10 @@ #include "../src_pw/tools.h" IState_Envelope::IState_Envelope() -{ - -} +{} IState_Envelope::~IState_Envelope() -{ - -} +{} void IState_Envelope::begin(void) @@ -76,14 +72,25 @@ void IState_Envelope::begin(void) for(int is=0; is +#include +#include "src_global/sltk_atom_arrange.h" +#include "src_lcao/LCAO_nnr.h" + + +Mulliken_Charge::Mulliken_Charge() +{ + M.init(); + if(GAMMA_ONLY_LOCAL) + { + for(int in=0;in [NLOCAL]; + + + DecMulP = new double* [NSPIN]; + for(int is=0; is mud; + mud.resize(1); + mud[0].create(ParaO.ncol,ParaO.nrow); + + matrix Dwf = M.wfc_gamma[is]; + for (int i=0; i mud; + mud.resize(1); + mud[0].create(ParaO.ncol,ParaO.nrow); + atom_arrange::set_sr_NL(); + atom_arrange::search( SEARCH_RADIUS );//qifeng-2019-01-21 + hm.orb_con.set_orb_tables(); + LM.allocate_HS_R(LNNR.nnr); + LM.zeros_HSR('S', LNNR.nnr); + UHM.genH.calculate_S_no(); + UHM.genH.build_ST_new('S', false); + + for(int ik=0;iknw; ++j) + { + int k = ucell.itiaiw2iwt(t,a,j); + ADecMulP[is][i][j] = DecMulP[is][k]; + + } + } + + } + + }//is + + return; +} + +void Mulliken_Charge::stdout_mulliken(void) +{ this->cal_mulliken(); + if(MY_RANK == 0) + { + TITLE("Dos","calculate_Mulliken"); + ofstream fout; + const char * fn= "mulliken.txt"; + fout.open(fn); + // ofstream fout; + // string wordqf="mulliken.txt"; + // wordqf += char(MY_RANK + 48); + // wordqf += ".txt"; + // fout.open(wordqf.c_str(),ios::app); + int num,l,m,mul; + double Tcharge; + double* sum_l = new double[2]; + double* sum_mul = new double[2]; + + string Name_Angular[5][11]; + /* decomposed Mulliken charge */ + + Name_Angular[0][0] = "s "; + Name_Angular[1][0] = "px "; + Name_Angular[1][1] = "py "; + Name_Angular[1][2] = "pz "; + Name_Angular[2][0] = "d3z^2-r^2 "; + Name_Angular[2][1] = "dxy "; + Name_Angular[2][2] = "dxz "; + Name_Angular[2][3] = "dx^2-y^2 "; + Name_Angular[2][4] = "dyz "; + Name_Angular[3][0] = "f5z^2-3r^2 "; + Name_Angular[3][1] = "f5xz^2-xr^2"; + Name_Angular[3][2] = "f5yz^2-yr^2"; + Name_Angular[3][3] = "fzx^2-zy^2 "; + Name_Angular[3][4] = "fxyz "; + Name_Angular[3][5] = "fx^3-3*xy^2"; + Name_Angular[3][6] = "f3yx^2-y^3 "; + Name_Angular[4][0] = "g1 "; + Name_Angular[4][1] = "g2 "; + Name_Angular[4][2] = "g3 "; + Name_Angular[4][3] = "g4 "; + Name_Angular[4][4] = "g5 "; + Name_Angular[4][5] = "g6 "; + Name_Angular[4][6] = "g7 "; + Name_Angular[4][7] = "g8 "; + Name_Angular[4][8] = "g9 "; + fout << "\n CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << endl; + + // calculate the total charge of the system. + double sch = 0.0; + fout << setprecision(8); + for(int is=0; isnw; ++j) + { + const int L1 = atom1->iw2l[j]; + const int N1 = atom1->iw2n[j]; + const int m1 = atom1->iw2m[j]; + fout << Name_Angular[L1][m1] << " " << N1 << " " << ADecMulP[0][i][j] << " " << ADecMulP[0][i][j] << endl; + } + }*/ + for (int i=0; i + +// by qifeng +class Mulliken_Charge +{ + public: + + Mulliken_Charge(); + ~Mulliken_Charge(); + + double** DecMulP ; + double** MecMulP ; + double*** ADecMulP ; + Wfc_Dm_2d M; + + complex *mug; + + void cal_mulliken(void); + + void stdout_mulliken(void); + + private: + +}; +#endif diff --git a/ABACUS.develop/source/src_pw/numerical_basis.cpp b/ABACUS.develop/source/src_io/numerical_basis.cpp similarity index 94% rename from ABACUS.develop/source/src_pw/numerical_basis.cpp rename to ABACUS.develop/source/src_io/numerical_basis.cpp index eea53aecc3..9053eb7c0f 100644 --- a/ABACUS.develop/source/src_pw/numerical_basis.cpp +++ b/ABACUS.develop/source/src_io/numerical_basis.cpp @@ -28,12 +28,12 @@ Numerical_Basis::~Numerical_Basis() {} //============================================================ void Numerical_Basis::start_from_file_k( const int &ik, ComplexMatrix &psi) { - if (test_spillage>1) TITLE("Numerical_Basis","start_from_file_k"); + TITLE("Numerical_Basis","start_from_file_k"); if (!Numerical_Basis::init_label) { // 1 stands for : start_from_file - Numerical_Basis::bessel_basis.init( 1, pw.ecutwfc, ucell.ntype ); + Numerical_Basis::bessel_basis.init( 1, pw.ecutwfc, ucell.ntype, ucell.lmax ); Numerical_Basis::init_mu_index(); Numerical_Basis::init_label = true; } @@ -41,11 +41,11 @@ void Numerical_Basis::start_from_file_k( const int &ik, ComplexMatrix &psi) return; } + // The function is called in run_fp.cpp. void Numerical_Basis::output_overlap( const ComplexMatrix *psi) { TITLE("Numerical_Basis","output_overlap"); - NEW_PART("Overlap Data For Spillage Minimization"); //--------------------------------------------------------- @@ -55,7 +55,7 @@ void Numerical_Basis::output_overlap( const ComplexMatrix *psi) if (!Numerical_Basis::init_label) { // 0 stands for : 'Faln' is not used. - Numerical_Basis::bessel_basis.init( 0, pw.ecutwfc, ucell.ntype ); + Numerical_Basis::bessel_basis.init( 0, pw.ecutwfc, ucell.ntype, ucell.lmax ); Numerical_Basis::init_mu_index(); Numerical_Basis::init_label = true; } @@ -357,7 +357,7 @@ void Numerical_Basis::output_overlap_Q( for (int i=0; i1) TITLE("Numerical_Basis","Sq_overlap"); + TITLE("Numerical_Basis","Sq_overlap"); timer::tick("Numerical_Basis","Sq_overlap"); ofs_running << " OUTPUT THE OVERLAP BETWEEN SPHERICAL BESSEL FUNCTIONS" << endl; @@ -515,7 +515,7 @@ void Numerical_Basis::jlq3d_overlap( const int &np, const ComplexMatrix &psi) { - if (test_spillage>1) TITLE("Numerical_Basis","jlq3d_overlap"); + TITLE("Numerical_Basis","jlq3d_overlap"); timer::tick("Numerical_Basis","jlq3d_overlap"); ofs_running << " OUTPUT THE OVERLAP BETWEEN SPHERICAL BESSEL FUNCTIONS AND BLOCH WAVE FUNCTIONS" << endl; @@ -541,7 +541,7 @@ void Numerical_Basis::jlq3d_overlap( << endl; double *flq = new double[np]; - //complex overlapQ = ZERO; + complex overlapQ = ZERO; for (int T1 = 0; T1 < ucell.ntype; T1++) { //OUT("T1",T1); @@ -597,6 +597,7 @@ void Numerical_Basis::jlq3d_overlap( void Numerical_Basis::init_mu_index(void) { + ofs_running << " Initialize the mu index" << endl; Numerical_Basis::mu_index = new IntArray[ucell.ntype]; int mu = 0; @@ -608,6 +609,13 @@ void Numerical_Basis::init_mu_index(void) ucell.nmax, 2*(ucell.atoms[it].nwl+1)+1); // m ==> 2*l+1 + // mohan added 2021-01-03 + ofs_running << "Type " << it+1 + << " number_of_atoms " << ucell.atoms[it].na + << " number_of_L " << ucell.atoms[it].nwl+1 + << " number_of_n " << ucell.nmax + << " number_of_m " << 2*(ucell.atoms[it].nwl+1)+1 << endl; + for (int ia=0; ia 2) TITLE("Numerical_Basis", "numerical_atomic_wfc"); + TITLE("Numerical_Basis", "numerical_atomic_wfc"); const int total_lm = ( ucell.lmax + 1) * ( ucell.lmax + 1); matrix ylm(total_lm, np); @@ -644,7 +652,7 @@ void Numerical_Basis::numerical_atomic_wfc( Mathzone::Ylm_Real(total_lm, np, gk, ylm); - //int index = 0; + int index = 0; double *flq = new double[np]; for (int it = 0; it < ucell.ntype; it++) { diff --git a/ABACUS.develop/source/src_pw/numerical_basis.h b/ABACUS.develop/source/src_io/numerical_basis.h similarity index 100% rename from ABACUS.develop/source/src_pw/numerical_basis.h rename to ABACUS.develop/source/src_io/numerical_basis.h diff --git a/ABACUS.develop/source/src_io/numerical_descriptor.cpp b/ABACUS.develop/source/src_io/numerical_descriptor.cpp new file mode 100644 index 0000000000..f7843b675d --- /dev/null +++ b/ABACUS.develop/source/src_io/numerical_descriptor.cpp @@ -0,0 +1,358 @@ +#include "numerical_descriptor.h" +#include "../src_pw/global.h" +#include "../src_pw/symmetry.h" +#include "winput.h" + +Numerical_Descriptor::Numerical_Descriptor() +{ + this->init_label = false; + this->lmax = -1; + this->nmax = -1; +} + +Numerical_Descriptor::~Numerical_Descriptor() +{ + if(init_label==true) + { + delete[] mu_index; + } + return; +} + + +void Numerical_Descriptor::output_descriptor(const ComplexMatrix *psi, const int &lmax_in) +{ + TITLE("Numerical_Descriptor","output_descriptor"); + NEW_PART("DeepKS descriptor: D_{Inl}"); + + //----------------------------------- + // 1. Initialize parameters + //----------------------------------- + + //ofs_running << "D_{Inl}_m_m'=sum_{i}" << endl; + ofs_running << "input lmax = " << lmax << endl; + this->lmax = lmax_in; + assert(lmax>=0); + + const int nks = kv.nks; + int ne = 0; + + // 0 stands for : 'Faln' is not used. + this->bessel_basis.init( 0, pw.ecutwfc, ucell.ntype, this->lmax ); + this->nmax = Numerical_Descriptor::bessel_basis.get_ecut_number(); + this->init_mu_index(); + this->init_label = true; + + assert(nmax>0); + + + //----------------------------------- + // 2. Open the file + //----------------------------------- + ofstream ofs; + stringstream ss; + // the parameter 'winput::spillage_outdir' is read from INPUTw. + ss << winput::spillage_outdir << "/" << "descriptor.dat"; + if (MY_RANK==0) + { + ofs.open(ss.str().c_str()); + } + + + //------------------------------------- + // 3. Initialize overlap_Q1 and Q2 + //------------------------------------- + // OVERLAP : < J_mu | Psi > + realArray overlap_Q1(nks, NBANDS, this->nlocal ); + realArray overlap_Q2(nks, NBANDS, this->nlocal ); + + ZEROS(overlap_Q1.ptr, overlap_Q1.getSize() ); + ZEROS(overlap_Q2.ptr, overlap_Q2.getSize() ); + + OUT(ofs_running,"number of k points",overlap_Q1.getBound1()); + OUT(ofs_running,"number of bands",overlap_Q1.getBound2()); + OUT(ofs_running,"number of local orbitals",overlap_Q1.getBound3()); + + + //------------------------------------- + // 4. Compute overlap_Q1 and Q2 + //------------------------------------- + // nks now is the reduced k-points. + for (int ik=0; ikjlq3d_overlap(overlap_Q1, overlap_Q2, ik, ik, npw, psi[ik]); + DONE(ofs_running,"jlq3d_overlap"); + } + +#ifdef __MPI + Parallel_Reduce::reduce_double_pool( overlap_Q1.ptr, overlap_Q1.getSize() ); + Parallel_Reduce::reduce_double_pool( overlap_Q2.ptr, overlap_Q2.getSize() ); +#endif + + // do not need to output here + //this->output_overlap_Q( ofs, overlap_Q1, overlap_Q2 ); + + + + //------------------------------------- + // 5. Generate descriptors for each atom + //------------------------------------- + + for (int it=0; itgenerate_descriptor(overlap_Q1, overlap_Q2, it ,ia, d, nd); + + ofs << ucell.atoms[it].label << " atom_index " << ia+1 << " n_descriptor " << nd << endl; + for(int id=0; id0 && id%8==0) ofs << endl; + // if(abs(d[id]>1.0e-9)) ofs << d[id] << " "; + // else ofs << "0 "; + ofs << d[id] << " "; + } + ofs << endl; + + delete[] d; + } + } + + + + if (MY_RANK==0) ofs.close(); + return; +} + + +void Numerical_Descriptor::generate_descriptor(realArray &overlap_Q1, realArray &overlap_Q2, +const int &it, const int &ia, double *d, const int &nd) +{ + int nbands = overlap_Q1.getBound2(); + // nwfc = nd * ne + int nwfc = overlap_Q1.getBound3(); + int start0 = mu_index[it](ia, 0, 0, 0); //min mu_index for each atom + + + // for 1 k-point only now + int ik=0; + + + ofs_running << " print out each descriptor" << endl; + int id=0; + for (int l=0; l c1(overlap_Q1(ik, ib, ii), overlap_Q2(ik, ib, ii)); + complex c2(overlap_Q1(ik, ib, jj), -overlap_Q2(ik, ib, jj)); + des(m,m2) += c1*c2; + } + // ofs_running << setw(15) << des(m,m2); + } + // ofs_running << endl; + } + ofs_running << "dimension of des is " << 2*l+1 << endl; + + if(l==0) + { + d[id]=des(0,0).real(); + ++id; + } + else + { + // diagonalizae + // assume des matrix is Hermitian + char jobz = 'N'; // eigenvalues only + char uplo = 'U'; // upper matrix is stored + int ndim = des.nr; + double* tmpd = new double[ndim](); + const int lwork = 2*ndim; + complex* work = new complex[lwork](); + double* rwork = new double[3 * ndim - 2](); + int infor = 0; + // diag by calling zheev + LapackConnector::zheev(jobz, uplo, ndim, des, ndim, tmpd, work, lwork, rwork, &infor); + // put the eigenvalues into d (descriptor) + for(int idim=0; idim " << endl; + + const double normalization = (4 * PI) / sqrt(ucell.omega);// Peize Lin add normalization 2015-12-29 + + const int total_lm = ( this->lmax + 1) * ( this->lmax + 1); + matrix ylm(total_lm, np); + + Vector3 *gk = new Vector3 [np]; + for (int ig=0; ig overlapQ = ZERO; + for (int T1 = 0; T1 < ucell.ntype; T1++) + { + for (int I1 = 0; I1 < ucell.atoms[T1].na; I1++) + { + complex *sk = wf.get_sk(ik, T1, I1); + for (int L=0; L< lmax+1; L++) + { + ofs_running << " " << setw(5) << ik+1 + << setw(8) << ucell.atoms[T1].label + << setw(8) << I1+1 + << setw(8) << L + << endl; + //OUT("l",l); + complex lphase = normalization * pow(IMAG_UNIT, L); // Peize Lin add normalization 2015-12-29 + for (int ie=0; ie < nmax; ie++) + { + for (int ig=0; ig overlap_tmp = ZERO; + for (int ig=0; ig local_tmp = lphase * sk[ig] * ylm(lm, ig) * flq[ig]; + overlap_tmp += conj( local_tmp ) * psi(ib, ig); // psi is bloch orbitals + } + overlap_Q1(ik_ibz, ib, mu_index[T1](I1, L, ie, m)) = overlap_tmp.real(); + overlap_Q2(ik_ibz, ib, mu_index[T1](I1, L, ie, m)) = overlap_tmp.imag(); + } + } + }//end ie + }//end l + delete[] sk; + } + } + + delete[] flq; + delete[] gk; + timer::tick("Numerical_Descriptor","jlq3d_overlap"); + return; +} + + +void Numerical_Descriptor::init_mu_index(void) +{ + ofs_running << " Initialize the mu index for deepks" << endl; + ofs_running << " lmax = " << this->lmax << endl; + ofs_running << " nmax = " << this->nmax << endl; + Numerical_Descriptor::mu_index = new IntArray[ucell.ntype]; + + assert(lmax>=0); + assert(nmax>0); + + int mu=0; + for (int it=0; itmu_index[it].create( + ucell.atoms[it].na, + lmax+1, // l starts from 0 + nmax, + 2*lmax+1); // m ==> 2*l+1 + + ofs_running << "Type " << it+1 + << " number_of_atoms " << ucell.atoms[it].na + << " number_of_L " << lmax+1 + << " number_of_n " << nmax + << " number_of_m " << 2*lmax+1 << endl; + + for (int ia=0; iamu_index[it](ia,l,n,m) = mu; + mu++; + } + } + } + } + + } + + this->nlocal = mu; + ofs_running << " total number of atomic orbitals " << nlocal << endl; + + return; +} diff --git a/ABACUS.develop/source/src_io/numerical_descriptor.h b/ABACUS.develop/source/src_io/numerical_descriptor.h new file mode 100644 index 0000000000..92c31e15bd --- /dev/null +++ b/ABACUS.develop/source/src_io/numerical_descriptor.h @@ -0,0 +1,42 @@ +//========================================================== +// AUTHOR : mohan +// DATE : 2021-01-04 +//========================================================== +#ifndef NUMERICAL_DESCRIPTOR_H +#define NUMERICAL_DESCRIPTOR_H +#include "../src_pw/tools.h" +#include "bessel_basis.h" +//========================================================== +// CLASS : +// NAME : Numerical_Descriptor +//========================================================== +class Numerical_Descriptor +{ + public: + Numerical_Descriptor(); + ~Numerical_Descriptor(); + + void output_descriptor( const ComplexMatrix *psi, const int &lmax_in); // mohan added 2021-01-03 + + private: + + bool init_label; + + int lmax; // lmax for descriptor + int nmax; // nmax for descriptor + int nlocal; // total number of atomic orbitals + + Bessel_Basis bessel_basis; + + IntArray *mu_index; + void init_mu_index(void);//mohan added 2021-01-03 + + void jlq3d_overlap(realArray &overlap_Q1, realArray &overlap_Q2, + const int &ik_ibz, const int &ik, const int &np, const ComplexMatrix &psi); + + void generate_descriptor(realArray &overlap_Q1, realArray &overlap_Q2, + const int &it, const int &ia, double *d, const int &nd); + +}; + +#endif diff --git a/ABACUS.develop/source/src_pw/optical.cpp b/ABACUS.develop/source/src_io/optical.cpp similarity index 98% rename from ABACUS.develop/source/src_pw/optical.cpp rename to ABACUS.develop/source/src_io/optical.cpp index 7e5646bd53..ce7eba161a 100644 --- a/ABACUS.develop/source/src_pw/optical.cpp +++ b/ABACUS.develop/source/src_io/optical.cpp @@ -1,6 +1,6 @@ #include "optical.h" -#include "tools.h" -#include "global.h" +#include "../src_pw/tools.h" +#include "../src_pw/global.h" bool Optical::opt_epsilon2 = false; int Optical::opt_nbands = 0; diff --git a/ABACUS.develop/source/src_pw/optical.h b/ABACUS.develop/source/src_io/optical.h similarity index 100% rename from ABACUS.develop/source/src_pw/optical.h rename to ABACUS.develop/source/src_io/optical.h diff --git a/ABACUS.develop/source/src_pw/output.cpp b/ABACUS.develop/source/src_io/output.cpp similarity index 100% rename from ABACUS.develop/source/src_pw/output.cpp rename to ABACUS.develop/source/src_io/output.cpp diff --git a/ABACUS.develop/source/src_pw/output.h b/ABACUS.develop/source/src_io/output.h similarity index 100% rename from ABACUS.develop/source/src_pw/output.h rename to ABACUS.develop/source/src_io/output.h diff --git a/ABACUS.develop/source/src_io/print_info.cpp b/ABACUS.develop/source/src_io/print_info.cpp new file mode 100644 index 0000000000..515cca97db --- /dev/null +++ b/ABACUS.develop/source/src_io/print_info.cpp @@ -0,0 +1,236 @@ +#include "print_info.h" +#include "../src_global/global_variable.h" +#include "../src_pw/global.h" + +Print_Info::Print_Info(){} + +Print_Info::~Print_Info(){} + + +void Print_Info::setup_parameters(void) +{ + TITLE("Print_Info","setup_parameters"); + + if(CALCULATION=="scf" || CALCULATION=="relax" || CALCULATION=="cell-relax" || CALCULATION=="nscf" + || CALCULATION=="istate" || CALCULATION=="ienvelope" || CALCULATION=="md") + { + cout << " ---------------------------------------------------------" << endl; + if(CALCULATION=="scf") + { + cout << " Self-consistent calculations for electrons" << endl; + } + else if(CALCULATION=="test") + { + cout << " Test run" << endl; + } + if(CALCULATION=="relax") + { + cout << " Ion relaxation calculations" << endl; + } + if(CALCULATION=="cell-relax") + { + cout << " Cell relaxation calculations" << endl; + } + if(CALCULATION=="md") + { + cout << " Molecular Dynamics simulations" << endl; + + cout << " ---------------------------------------------------------" << endl; + + if(INPUT.md_mdtype ==1 || INPUT.md_mdtype==2) + { + cout << " ENSEMBLE : " << "NVT" << endl; + } + else if(INPUT.md_mdtype==0) + { + cout << " ENSEMBLE : " << "NVE" << endl; + } + cout << " Qmass for NVT(a.u.) : " << INPUT.md_qmass/6.02/9.109*1e5 << endl; + cout << " Time interval(fs) : " << INPUT.md_dt << endl; + } + cout << " ---------------------------------------------------------" << endl; + + + cout << " " << setw(8) << "SPIN" + << setw(16) << "KPOINTS" + << setw(12) << "PROCESSORS"; + + if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") + { + cout << setw(12) << "NBASE"; + } + + cout << endl; + + + + cout << " " << setw(8) << NSPIN; + + if(GAMMA_ONLY_LOCAL) + { + if(COLOUR && MY_RANK==0) + { + // red + //printf( "\e[31m%-16s\e[0m", "Gamma"); + printf( "[31m%-16s[0m", "Gamma"); + } + else + { + cout << setw(16) << "Gamma"; + } + } + else + { + if(COLOUR && MY_RANK==0) + { + // zi + //printf( "\e[35m%-16d\e[0m", kv.nkstot); + printf( "[35m%-16d[0m", kv.nkstot); + } + else + { + cout << setw(16) << kv.nkstot; + } + } + + cout << setw(12) << NPROC; + + if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") + { + cout << setw(12) << NLOCAL; + } + + cout << endl; + + + + + cout << " ---------------------------------------------------------" << endl; + if(BASIS_TYPE=="lcao") + { + if(COLOUR && MY_RANK==0) + { + string a = "Use Systematically Improvable Atomic bases"; + //printf( " \e[36m%-45s\e[0m\n", a.c_str()); + printf( " [36m%-45s[0m\n", a.c_str()); + } + else + { + cout << " Use Systematically Improvable Atomic bases" << endl; + } + } + else if(BASIS_TYPE=="lcao_in_pw") + { + cout << " Expand Atomic bases into plane waves" << endl; + } + else if(BASIS_TYPE=="pw") + { + cout << " Use plane wave basis" << endl; + } + cout << " ---------------------------------------------------------" << endl; + + + + //---------------------------------- + // second part + //---------------------------------- + + cout << " " << setw(8) << "ELEMENT"; + + if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") + { + cout << setw(16) << "ORBITALS"; + cout << setw(12) << "NBASE"; + } + cout << setw(12) << "NATOM"; + + cout << setw(12) << "XC"; + cout << endl; + + + + for(int it=0; it // Peize Lin fix bug about strcmp 2016-08-02 + +void UnitCell_pseudo::read_atom_species(ifstream &ifa) +{ + TITLE("UnitCell_pseudo","read_atom_species"); + + this->atom_mass = new double[ntype]; //atom masses + this->atom_label = new string[ntype]; //atom labels + this->pseudo_fn = new string[ntype]; //file name of pseudopotential + + string word; + //========================================== + // read in information of each type of atom + //========================================== + if( SCAN_BEGIN(ifa, "ATOMIC_SPECIES") ) + { + OUT(ofs_running,"ntype",ntype); + for (int i = 0;i < ntype;i++) + { + ifa >> atom_label[i] >> atom_mass[i]; + + stringstream ss; + ss << "atom label for species " << i+1; + OUT(ofs_running,ss.str(),atom_label[i]); + READ_VALUE(ifa, pseudo_fn[i]); + if(test_pseudo_cell==2) + { + ofs_running << "\n" << setw(6) << atom_label[i] + << setw(12) << atom_mass[i] + << setw(18) << pseudo_fn[i]; + } + } + } + + if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") + { + if( SCAN_BEGIN(ifa, "NUMERICAL_ORBITAL") ) + { + ORB.read_in_flag = true; + for(int i=0; i> ofile; + //----------------------------------- + // Turn off the read in NONLOCAL file + // function since 2013-08-02 by mohan + //----------------------------------- + //READ_VALUE(ifa, nfile); + + ORB.orbital_file.push_back(ofile); + + //----------------------------------- + // Turn off the read in NONLOCAL file + // function since 2013-08-02 by mohan + //----------------------------------- + //ORB.nonlocal_file.push_back(nfile); + +// ofs_running << " For atom type " << i + 1 << endl; +// ofs_running << " Read in numerical orbitals from file " << ofile << endl; +// ofs_running << " Read in nonlocal projectors from file " << nfile << endl; + + } + } + } + + // Peize Lin add 2016-09-23 + if( Exx_Global::Hybrid_Type::HF == exx_lcao.info.hybrid_type || + Exx_Global::Hybrid_Type::PBE0 == exx_lcao.info.hybrid_type || + Exx_Global::Hybrid_Type::HSE == exx_lcao.info.hybrid_type ) + { + if( SCAN_BEGIN(ifa, "ABFS_ORBITAL") ) + { + for(int i=0; i> ofile; + exx_lcao.info.files_abfs.push_back(ofile); + } + } + } + + //========================== + // read in lattice constant + //========================== + if( SCAN_BEGIN(ifa, "LATTICE_CONSTANT") ) + { + READ_VALUE(ifa, lat0); + if(lat0<=0.0) + { + WARNING_QUIT("read_atom_species","lat0<=0.0"); + } + lat0_angstrom = lat0 * 0.529177 ; + OUT(ofs_running,"lattice constant (Bohr)",lat0); + OUT(ofs_running,"lattice constant (Angstrom)",lat0_angstrom); + this->tpiba = TWO_PI / lat0; + this->tpiba2 = tpiba * tpiba; + } + + //=========================== + // Read in latticies vector + //=========================== + if( SCAN_BEGIN(ifa, "LATTICE_VECTORS") ) + { + // Reading lattice vectors. notice + // here that only one cpu read these + // parameters. + ifa >> latvec.e11 >> latvec.e12; + READ_VALUE(ifa, latvec.e13); + ifa >> latvec.e21 >> latvec.e22; + READ_VALUE(ifa, latvec.e23); + ifa >> latvec.e31 >> latvec.e32; + READ_VALUE(ifa, latvec.e33); + + // lattice vectors in another form. + a1.x = latvec.e11; + a1.y = latvec.e12; + a1.z = latvec.e13; + + a2.x = latvec.e21; + a2.y = latvec.e22; + a2.z = latvec.e23; + + a3.x = latvec.e31; + a3.y = latvec.e32; + a3.z = latvec.e33; + + } + return; +} + +// Read atomic positions +// return 1: no problem. +// return 0: some problems. +bool UnitCell_pseudo::read_atom_positions(ifstream &ifpos) +{ + TITLE("UnitCell_pseudo","read_atom_positions"); + + bool use_xyz = false; + /* LiuXh 20171109 + if( SCAN_BEGIN(ifpos, "USE_XYZ") ) + { + use_xyz = true; + } + */ + + if( SCAN_BEGIN(ifpos, "ATOMIC_POSITIONS")) + { + READ_VALUE( ifpos, Coordinate); + if(Coordinate != "Cartesian" + && Coordinate != "Direct" + && Coordinate != "Cartesian_angstrom" + && Coordinate != "Cartesian_au" + && Coordinate != "Cartesian_angstrom_center_xy" + && Coordinate != "Cartesian_angstrom_center_xz" + && Coordinate != "Cartesian_angstrom_center_yz" + && Coordinate != "Cartesian_angstrom_center_xyz" + ) + { + WARNING("read_atom_position","Cartesian or Direct?"); + ofs_warning << " There are several options for you:" << endl; + ofs_warning << " Direct" << endl; + ofs_warning << " Cartesian_angstrom" << endl; + ofs_warning << " Cartesian_au" << endl; + ofs_warning << " Cartesian_angstrom_center_xy" << endl; + ofs_warning << " Cartesian_angstrom_center_xz" << endl; + ofs_warning << " Cartesian_angstrom_center_yz" << endl; + ofs_warning << " Cartesian_angstrom_center_xyz" << endl; + return 0; + } + + Vector3 v; + Vector3 mv; + int na = 0; + this->nat = 0; + + //====================================== + // calculate total number of atoms + // and adjust the order of atom species + //====================================== + assert(ntype>0); + for (int it = 0;it < ntype; it++) + { + ofs_running << "\n READING ATOM TYPE " << it+1 << endl; + + //======================================= + // (1) read in atom label + // start magnetization + //======================================= + READ_VALUE(ifpos, atoms[it].label); + bool found = false; + for(int it2=0; it2atoms[it].label == this->atom_label[it] ) + found = true; + } + if(!found) + { + ofs_warning << " Label read from ATOMIC_POSITIONS is " << this->atoms[it].label << endl; + ofs_warning << " Lable from ATOMIC_SPECIES is " << this->atom_label[it] << endl; + return 0; + } + READ_VALUE(ifpos, mag.start_magnetization[it] ); + + OUT(ofs_running, "atom label",atoms[it].label); + + if(NSPIN==4)//added by zhengdy-soc + { + if(NONCOLIN) + { + soc.m_loc[it].x = mag.start_magnetization[it] * + sin(soc.angle1[it]) * cos(soc.angle2[it]); + soc.m_loc[it].y = mag.start_magnetization[it] * + sin(soc.angle1[it]) * sin(soc.angle2[it]); + soc.m_loc[it].z = mag.start_magnetization[it] * + cos(soc.angle1[it]); + } + else + { + soc.m_loc[it].x = 0; + soc.m_loc[it].y = 0; + soc.m_loc[it].z = mag.start_magnetization[it]; + } + + OUT(ofs_running, "noncollinear magnetization_x",soc.m_loc[it].x); + OUT(ofs_running, "noncollinear magnetization_y",soc.m_loc[it].y); + OUT(ofs_running, "noncollinear magnetization_z",soc.m_loc[it].z); + + ZEROS(soc.ux ,3); + } + else if(NSPIN==2) + { + soc.m_loc[it].x = mag.start_magnetization[it]; + OUT(ofs_running, "start magnetization",mag.start_magnetization[it]); + } + else if(NSPIN==1) + { + OUT(ofs_running, "start magnetization","FALSE"); + } + + //=========================================== + // (2) read in numerical orbital information + // int atoms[it].nwl + // int* atoms[it].l_nchi; + //=========================================== + /*READ_VALUE(ifpos, this->atoms[it].nwl); + assert(this->atoms[it].nwl<10); + OUT(ofs_running,"L max for local orbitals",atoms[it].nwl); + + delete[] this->atoms[it].l_nchi; + this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1]; + this->atoms[it].nw = 0; + for(int L=0; Latoms[it].l_nchi[L]); + + // calculate the number of local basis(3D) + this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; + + stringstream ss; + ss << "L=" << L << ", number of zeta"; + OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); + }*/ + if (BASIS_TYPE == "lcao" || BASIS_TYPE == "lcao_in_pw") + { + ifstream ifs(ORB.orbital_file[it].c_str(), ios::in); // pengfei 2014-10-13 + if (!ifs) + { + cout << " Can't find the ORBITAL file." << endl; + } + + char word[80]; + delete[] this->atoms[it].l_nchi; + this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1]; + this->atoms[it].nw = 0; + int L =0; + + while (ifs.good()) + { + ifs >> word; + if (strcmp("Lmax", word) == 0) + { + READ_VALUE(ifs, this->atoms[it].nwl); + } + assert(this->atoms[it].nwl<10); + + if (strcmp("Cutoff(a.u.)", word) == 0) // pengfei Li 16-2-29 + { + READ_VALUE(ifs, this->atoms[it].Rcut); + } + + //cout << "atoms[it].nwl = "<", word) == 0) + { + READ_VALUE(ifs, this->atoms[it].l_nchi[L]); + this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; + stringstream ss; + ss << "L=" << L << ", number of zeta"; + OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); + L++; + } + if (strcmp("Porbital-->", word) == 0) + { + READ_VALUE(ifs, this->atoms[it].l_nchi[L]); + this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; + stringstream ss; + ss << "L=" << L << ", number of zeta"; + OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); + L++; + } + if (strcmp("Dorbital-->", word) == 0) + { + READ_VALUE(ifs, this->atoms[it].l_nchi[L]); + this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; + stringstream ss; + ss << "L=" << L << ", number of zeta"; + OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); + L++; + } + if (strcmp("Forbital-->", word) == 0) + { + READ_VALUE(ifs, this->atoms[it].l_nchi[L]); + this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; + stringstream ss; + ss << "L=" << L << ", number of zeta"; + OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); + L++; + } + if (strcmp("Gorbital-->", word) == 0) + { + READ_VALUE(ifs, this->atoms[it].l_nchi[L]); + this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; + stringstream ss; + ss << "L=" << L << ", number of zeta"; + OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); + L++; + } + //cout <<" atoms[it].nw = "<atoms[it].l_nchi; + this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1]; + this->atoms[it].nw = 0; + + this->atoms[it].nwl = 2; + //cout << INPUT.lmaxmax << endl; + if ( INPUT.lmaxmax != 2 ) + { + this->atoms[it].nwl = INPUT.lmaxmax; + } + for(int L=0; Latoms[it].l_nchi[L] = 1; + // calculate the number of local basis(3D) + this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; + + stringstream ss; + ss << "L=" << L << ", number of zeta"; + OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); + } + + /* this->atoms[it].l_nchi[0] = 1; + this->atoms[it].nw += (2*0 + 1) * this->atoms[it].l_nchi[0]; + // stringstream s0; + // s0 << "L=" << 0 << ", number of zeta"; + // OUT(ofs_running,s0.str(),atoms[it].l_nchi[0]); + + this->atoms[it].l_nchi[1] = 1; + this->atoms[it].nw += (2*1 + 1) * this->atoms[it].l_nchi[1]; + // stringstream s1; + // s1 << "L=" << 1 << ", number of zeta"; + // OUT(ofs_running,s1.str(),atoms[it].l_nchi[1]); + + this->atoms[it].l_nchi[2] = 1; + this->atoms[it].nw += (2*2 + 1) * this->atoms[it].l_nchi[2];*/ + // stringstream s2; + // s2 << "L=" << 2 << ", number of zeta"; + // OUT(ofs_running,s2.str(),atoms[it].l_nchi[2]);*/ + + } + + //OUT(ofs_running,"Total number of local orbitals",atoms[it].nw); + + //========================= + // (3) read in atom number + //========================= + READ_VALUE(ifpos, na); + this->atoms[it].na = na; + + OUT(ofs_running,"number of atom for this type",na); + + this->nat += na; + if (na <= 0) + { + WARNING("read_atom_positions"," atom number < 0."); + return 0; + } + if (na > 0) + { + delete[] atoms[it].tau; + delete[] atoms[it].taud; + delete[] atoms[it].mbl; + delete[] atoms[it].mag; + atoms[it].tau = new Vector3[na]; + atoms[it].taud = new Vector3[na]; + atoms[it].mbl = new Vector3[na]; + atoms[it].mag = new double[na]; + atoms[it].mass = this->atom_mass[it]; //mohan add 2011-11-07 + ZEROS(atoms[it].mag,na); + for (int ia = 0;ia < na; ia++) + { + if(use_xyz) + { + string tmpid; + ifpos >> tmpid; + if(tmpid != atoms[it].label) + { + WARNING("read_atom_positions","atom label not match"); + return 0; + } + else + { + ifpos >> v.x >> v.y >> v.z; + + mv.x = true; + mv.y = true; + mv.z = true; + + string mags; + std::getline( ifpos, mags ); + // change string to double. + //atoms[it].mag[ia] = std::atof(mags.c_str()); + atoms[it].mag[ia] = 0.0; + } + } + else + { + ifpos >> v.x >> v.y >> v.z + >> mv.x >> mv.y >> mv.z; + string mags; + std::getline( ifpos, mags ); + // change string to double. + //atoms[it].mag[ia] = std::atof(mags.c_str()); + atoms[it].mag[ia] = 0.0; + } + + if(Coordinate=="Direct") + { + // change v from direct to cartesian, + // the unit is pw.lat0 + atoms[it].taud[ia] = v; + atoms[it].tau[ia] = v * latvec; + } + else if(Coordinate=="Cartesian") + { + atoms[it].tau[ia] = v ;// in unit lat0 + //cout << " T=" << it << " I=" << ia << " tau=" << atoms[it].tau[ia].x << " " << + //atoms[it].tau[ia].y << " " << atoms[it].tau[ia].z << endl; + } + else if(Coordinate=="Cartesian_angstrom") + { + atoms[it].tau[ia] = v / 0.529177 / lat0; + } + else if(Coordinate=="Cartesian_angstrom_center_xy") + { + // calculate lattice center + latcenter.x = (latvec.e11 + latvec.e21 + latvec.e31)/2.0; + latcenter.y = (latvec.e12 + latvec.e22 + latvec.e32)/2.0; + latcenter.z = 0.0; + atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; + } + else if(Coordinate=="Cartesian_angstrom_center_xz") + { + // calculate lattice center + latcenter.x = (latvec.e11 + latvec.e21 + latvec.e31)/2.0; + latcenter.y = 0.0; + latcenter.z = (latvec.e13 + latvec.e23 + latvec.e33)/2.0; + atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; + } + else if(Coordinate=="Cartesian_angstrom_center_yz") + { + // calculate lattice center + latcenter.x = 0.0; + latcenter.y = (latvec.e12 + latvec.e22 + latvec.e32)/2.0; + latcenter.z = (latvec.e13 + latvec.e23 + latvec.e33)/2.0; + atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; + } + else if(Coordinate=="Cartesian_angstrom_center_xyz") + { + // calculate lattice center + latcenter.x = (latvec.e11 + latvec.e21 + latvec.e31)/2.0; + latcenter.y = (latvec.e12 + latvec.e22 + latvec.e32)/2.0; + latcenter.z = (latvec.e13 + latvec.e23 + latvec.e33)/2.0; + atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; + } + else if(Coordinate=="Cartesian_au") + { + atoms[it].tau[ia] = v / lat0; + } + + if(Coordinate=="Cartesian" || + Coordinate=="Cartesian_angstrom" || + Coordinate=="Cartesian_angstrom_center_xy" || + Coordinate=="Cartesian_angstrom_center_xz" || + Coordinate=="Cartesian_angstrom_center_yz" || + Coordinate=="Cartesian_angstrom_center_xyz" || + Coordinate=="Cartesian_au") + { + double dx,dy,dz; + Mathzone::Cartesian_to_Direct(atoms[it].tau[ia].x, atoms[it].tau[ia].y, atoms[it].tau[ia].z, + latvec.e11, latvec.e12, latvec.e13, + latvec.e21, latvec.e22, latvec.e23, + latvec.e31, latvec.e32, latvec.e33, + dx,dy,dz); + + atoms[it].taud[ia].x = dx; + atoms[it].taud[ia].y = dy; + atoms[it].taud[ia].z = dz; + + } + + atoms[it].mbl[ia] = mv; + }//endj + }// end na + }//end for ntype + }// end scan_begin + + + ofs_running << endl; + OUT(ofs_running,"TOTAL ATOM NUMBER",nat); + + // mohan add 2010-06-30 + //xiaohui modify 2015-03-15, cancel outputfile "STRU_READIN.xyz" + //this->print_cell_xyz("STRU_READIN.xyz"); + this->check_dtau(); + + if ( this->check_tau() ) + { + + } + else + { + return 0; + } + this->print_tau(); + //xiaohui modify 2015-03-15, cancel outputfile "STRU_READIN.xyz" + //this->print_cell_xyz("STRU_READIN_ADJUST.xyz"); + this->print_cell_cif("STRU_READIN_ADJUST.cif"); + + return 1; +}//end read_atom_positions + +bool UnitCell_pseudo::check_tau(void)const +{ + TITLE("UnitCell_pseudo","check_tau"); + timer::tick("UnitCell_pseudo","check_tau"); + + Vector3 diff = 0.0; + double norm = 0.0; + double tolerence_bohr = 1.0e-3; + + //ofs_running << "\n Output nearest atom not considering periodic boundary condition" << endl; + //ofs_running << " " << setw(5) << "TYPE" << setw(6) << "INDEX" + //<< setw(20) << "NEAREST(Bohr)" + //<< setw(20) << "NEAREST(Angstrom)" << endl; + for(int T1=0; T1< this->ntype; T1++) + { + for(int I1=0; I1< this->atoms[T1].na; I1++) + { + double shortest_norm = 10000.0; // a large number + //int nearest_atom_type = 0; + //int nearest_atom_index = 0; + for(int T2=0; T2ntype; T2++) + { + for(int I2=0; I2atoms[T2].na; I2++) + { + if(T1==T2 && I1==I2) + { + shortest_norm = 0.0; + //nearest_atom_type = T1; + //nearest_atom_index = I2; + // self atom + } + else + { + diff = atoms[T1].tau[I1] - atoms[T2].tau[I2]; + norm = diff.norm() * ucell.lat0; + if( shortest_norm > norm ) + { + shortest_norm = norm; + //nearest_atom_type = T2; + //nearest_atom_index = I2; + } + if( norm < tolerence_bohr ) // unit is Bohr + { + ofs_warning << " two atoms are too close!" << endl; + ofs_warning << " type:" << this->atoms[T1].label << " atom " << I1 + 1 << endl; + ofs_warning << " type:" << this->atoms[T2].label << " atom " << I2 + 1 << endl; + ofs_warning << " distance = " << norm << " Bohr" << endl; + return 0; + } + } + } + } + //ofs_running << " " << setw(5) << atoms[T1].label << setw(6) << I1+1 + //<< setw(20) << shortest_norm + //<< setw(20) << shortest_norm * BOHR_TO_A << endl; + } + } + + timer::tick("UnitCell_pseudo","check_tau"); + return 1; +} + +void UnitCell_pseudo::print_stru_file(const string &fn, const int &type)const +{ + TITLE("UnitCell_pseudo","print_stru_file"); + + if(MY_RANK!=0) return; + + ofstream ofs(fn.c_str()); + + ofs << "ATOMIC_SPECIES" << endl; + ofs << setprecision(12); + + for(int it=0; it0); + for(int it=0;ittaud[ia].x+10000) - int(atom1->taud[ia].x+10000); + double dy2 = (atom1->taud[ia].y+10000) - int(atom1->taud[ia].y+10000); + double dz2 = (atom1->taud[ia].z+10000) - int(atom1->taud[ia].z+10000); + + // mohan add 2011-04-07 + while(dx2 >= 1) + { + ofs_warning << " dx2 is >=1 " << endl; + dx2 -= 1.0; + } + while(dy2 >= 1) + { + ofs_warning << " dy2 is >=1 " << endl; + dy2 -= 1.0; + } + while(dz2 >= 1) + { + ofs_warning << " dz2 is >=1 " << endl; + dz2 -= 1.0; + } + // mohan add 2011-04-07 + while(dx2<0) + { + ofs_warning << " dx2 is <0 " << endl; + dx2 += 1.0; + } + while(dy2<0) + { + ofs_warning << " dy2 is <0 " << endl; + dy2 += 1.0; + } + while(dz2<0) + { + ofs_warning << " dz2 is <0 " << endl; + dz2 += 1.0; + } + + atom1->taud[ia].x = dx2; + atom1->taud[ia].y = dy2; + atom1->taud[ia].z = dz2; + + double cx2, cy2, cz2; + + Mathzone::Direct_to_Cartesian( + atom1->taud[ia].x, atom1->taud[ia].y, atom1->taud[ia].z, + latvec.e11, latvec.e12, latvec.e13, + latvec.e21, latvec.e22, latvec.e23, + latvec.e31, latvec.e32, latvec.e33, + cx2, cy2, cz2); + + atom1->tau[ia].x = cx2; + atom1->tau[ia].y = cy2; + atom1->tau[ia].z = cz2; + + // cout << setw(15) << dx2 << setw(15) << dy2 << setw(15) << dz2 + // << setw(15) << cx2 << setw(15) << cy2 << setw(15) << cz2 + // << endl; + + } + } + return; +} diff --git a/ABACUS.develop/source/src_io/read_dm.cpp b/ABACUS.develop/source/src_io/read_dm.cpp new file mode 100644 index 0000000000..c92a0ffd69 --- /dev/null +++ b/ABACUS.develop/source/src_io/read_dm.cpp @@ -0,0 +1,185 @@ +#include "src_lcao/local_orbital_charge.h" +#include "src_pw/global.h" +#include "src_global/blas_connector.h" + + +void Local_Orbital_Charge::read_dm(const int &is, const string &fn) +{ + TITLE("Local_Orbital_Charge","read_dm"); + timer::tick("Local_Orbital_Charge","read_dm"); + + ofs_running << "\n processor 0 is reading density matrix from file < " << fn << " > " << endl; + //xiaohui modify 2015-03-25 + //bool quit_mesia = false; + bool quit_abacus = false; + + ifstream ifs; + if(MY_RANK==0) + { + ifs.open(fn.c_str()); + if (!ifs) + { + //xiaohui modify 2015-03-25 + //quit_mesia = true; + quit_abacus = true; + } + else + { + // if the number is not match, + // quit the program or not. + bool quit=false; + + string name; + ifs >> name; + + // check lattice constant, unit is Angstrom + CHECK_DOUBLE(ifs,ucell.lat0 * BOHR_TO_A,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e11,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e12,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e13,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e21,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e22,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e23,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e31,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e32,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e33,quit); + + for(int it=0; it> coordinate; + + for(int it=0; it> DM[is][i][j]; + } + } + } + else + { + WARNING_QUIT("Local_Orbital_Charge::read_dm","The nnrg should not be update"); + CHECK_INT(ifs,LNNR.nnrg); + + for(int i=0; i> DM_R[is][i]; + } + } +#else + + // distribution of necessary data + //xiaohui modify 2015-03-25 + //Parallel_Common::bcast_bool(quit_mesia); + Parallel_Common::bcast_bool(quit_abacus); + //xiaohui modify 2015-03-25 + //if(quit_mesia) + if(quit_abacus) + { + WARNING_QUIT("Local_Orbital_Charge::read_dm","Can not find the density matrix file."); + } + + + if(NSPIN==1||NSPIN==4) + { + Parallel_Common::bcast_double(en.ef); + } + else if(NSPIN==2) + { + Parallel_Common::bcast_double(en.ef_up); + Parallel_Common::bcast_double(en.ef_dw); + } + + + if(GAMMA_ONLY_LOCAL) + { + //ofs_running << " NLOCAL=" << NLOCAL << endl; + //ofs_running << " lgd_now=" << lgd_now << endl; + //ofs_running << " GridT.lgd=" << GridT.lgd << endl; + + double *tmp = new double[NLOCAL]; + for(int i=0; i // Peize Lin fix bug about strcmp 2016-08-02 + + +//========================================================== +// Read pseudopotential according to the dir +//========================================================== +void UnitCell_pseudo::read_pseudopot(const string &pp_dir) +{ + if(test_pseudo_cell) TITLE("UnitCell_pseudo","read_pseudopot"); +//---------------------------------------------------------- +// EXPLAIN : setup reading log for pseudopot_upf +//---------------------------------------------------------- + stringstream ss; + ss << global_out_dir << "atom_pseudo.log"; + +// ofstream ofs; + +// if(MY_RANK==0) +// { +// ofs.open( ss.str().c_str(), ios::out); +// } + +//---------------------------------------------------------- +// EXPLAIN : Read in the atomic pseudo potential +//---------------------------------------------------------- + string pp_address; + for (int i = 0;i < ntype;i++) + { + Pseudopot_upf upf; + + // mohan update 2010-09-12 + int error = 0, error_ap = 0; + + if(MY_RANK==0) + { + pp_address = pp_dir + this->pseudo_fn[i]; + //error = upf.read_pseudo_upf( pp_address ); xiaohui modify 2013-06-23 + error = upf.init_pseudo_reader( pp_address ); //xiaohui add 2013-06-23 + //average pseudopotential if needed + error_ap = upf.average_p(); //added by zhengdy 2020-10-20 + } + +#ifdef __MPI + Parallel_Common::bcast_int(error); + Parallel_Common::bcast_int(error_ap); +#endif + + if(error_ap) WARNING_QUIT("UnitCell_pseudo::read_pseudopot","error when average the pseudopotential."); + + if(error==1) + { + cout << " Pseudopotential directory now is : " << pp_address << endl; + ofs_warning << " Pseudopotential directory now is : " << pp_address << endl; + WARNING_QUIT("UnitCell_pseudo::read_pseudopot","Couldn't find pseudopotential file."); + } + else if(error==2) + { + WARNING_QUIT("UnitCell_pseudo::read_pseudopot","Something in pseudopotential not match."); + } + else if(error==3) + { + WARNING_QUIT("UnitCell_pseudo::read_pseudopot","Please check the reference states in pseudopotential .vwr file.\n Also the norm of the read in pseudo wave functions\n explicitly please check S, P and D channels.\n If the norm of the wave function is \n unreasonable large (should be near 1.0), ABACUS would quit. \n The solution is to turn off the wave functions \n and the corresponding non-local projectors together\n in .vwr pseudopotential file."); + } +// OUT(ofs_running,"PP_ERRROR",error); + +//xiaohui add 2015-03-24 +#ifdef __MPI + Parallel_Common::bcast_bool(upf.functional_error); +#endif + //xiaohui add 2015-03-24 + if(upf.functional_error == 1) + { + WARNING_QUIT("Pseudopot_upf::read_pseudo_header","input xc functional does not match that in pseudopot file"); + } + + if(MY_RANK==0) + { +// upf.print_pseudo_upf( ofs ); + atoms[i].set_pseudo_us( upf ); + + ofs_running << "\n Read in pseudopotential file is " << pseudo_fn[i] << endl; + OUT(ofs_running,"pseudopotential type",atoms[i].pp_type); + OUT(ofs_running,"functional Ex", atoms[i].dft[0]); + OUT(ofs_running,"functional Ec", atoms[i].dft[1]); + OUT(ofs_running,"functional GCEx", atoms[i].dft[2]); + OUT(ofs_running,"functional GCEc", atoms[i].dft[3]); + OUT(ofs_running,"nonlocal core correction", atoms[i].nlcc); +// OUT(ofs_running,"spin orbital",atoms[i].has_so); + OUT(ofs_running,"valence electrons", atoms[i].zv); + OUT(ofs_running,"lmax", atoms[i].lmax); + OUT(ofs_running,"number of zeta", atoms[i].nchi); + OUT(ofs_running,"number of projectors", atoms[i].nbeta); + for(int ib=0; ibprint_cell(ofs); + for (int i = 0;i < ntype;i++) + { + atoms[i].print_Atom(ofs); + } + + ofs.close(); + return; +} + + +#ifdef __MPI +void UnitCell_pseudo::bcast_unitcell_pseudo(void) +{ + Parallel_Common::bcast_int( meshx ); + Parallel_Common::bcast_int( natomwfc ); + Parallel_Common::bcast_int( lmax ); + Parallel_Common::bcast_int( lmax_ppwf ); + Parallel_Common::bcast_double( nelec ); + + bcast_unitcell(); +} + +void UnitCell_pseudo::bcast_unitcell_pseudo2(void) +{ + bcast_unitcell2(); +} +#endif diff --git a/ABACUS.develop/source/src_io/read_rho.cpp b/ABACUS.develop/source/src_io/read_rho.cpp new file mode 100644 index 0000000000..4e4a33a616 --- /dev/null +++ b/ABACUS.develop/source/src_io/read_rho.cpp @@ -0,0 +1,120 @@ +#include "src_pw/charge.h" +#include "src_pw/global.h" + +bool Charge::read_rho(const int &is, const string &fn, double* rho) //add by dwan +{ + TITLE("Charge","read_rho"); + ifstream ifs(fn.c_str()); + if (!ifs) + { + ofs_running << " !!! Couldn't find the charge file !!!" << endl; + return false; + } + else + { + ofs_running << " Find the file, try to read charge from file." << endl; + } + + bool quit=false; + + string name; + ifs >> name; + + // check lattice constant, unit is Angstrom + CHECK_DOUBLE(ifs,ucell.lat0 * 0.529177,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e11,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e12,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e13,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e21,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e22,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e23,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e31,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e32,quit); + CHECK_DOUBLE(ifs,ucell.latvec.e33,quit); + + for(int it=0; it> coordinate; + + for(int it=0; it> rho[i*pw.ncy*pw.ncz + j*pw.ncz +k]; + } + } + } +#else + + const int nxy = pw.ncx * pw.ncy; + double *zpiece = new double[nxy]; + for(int iz=0; iz +#include +#include +#include +using namespace std; + + +//A class to read or write binary data. +//By qianrui 2020-1-6 +class Rwstream +{ + public: + Rwstream(){ + fileptr=NULL; + }; + Rwstream(const string,const char*); + Rwstream(FILE* &ptr); + ~Rwstream(){}; + void setptr(FILE* &ptr); + FILE* fileptr; + void close(); + void open(const string,const char*); + bool operator!() const; + operator bool() const; +}; + + +//For template operator, you had better write defination in .h file!! +//for variation or array +template +Rwstream& operator<<(Rwstream& wstream,const T data) +{ + int size=sizeof(T); + int n=sizeof(data)/sizeof(T); + fwrite(&data,size,n,wstream.fileptr); + return wstream; +} +/*//for dynamic memory +//malloc_usable_size has problem! +template +Rwstream& operator<<(Rwstream& wstream,T* &data) +{ + int size=sizeof(T); + int n=malloc_usable_size(data)/sizeof(T); + fwrite(data,size,n,wstream.fileptr); + return wstream; +}*/ +template +Rwstream& operator>>(Rwstream& rstream,T& data) +{ + int size=sizeof(T); + int n=sizeof(data)/sizeof(T); + size_t ch; + ch=fread(&data,size,n,rstream.fileptr); + if(ch +Rwstream& operator>>(Rwstream& rstream,T* &data) +{ + int size=sizeof(T); + int n=malloc_usable_size(data)/sizeof(T); + cout< +void rwread(Rwstream& rstream,T* &data,int n) +{ + int size=sizeof(T); + size_t ch; + ch=fread(data,size,n,rstream.fileptr); + if(ch eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e12 - ucell.latvec.e12) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e13 - ucell.latvec.e13) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e21 - ucell.latvec.e21) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e22 - ucell.latvec.e22) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e23 - ucell.latvec.e23) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e31 - ucell.latvec.e31) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e32 - ucell.latvec.e32) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); - if(abs(real_lattice_nnkp.e33 - ucell.latvec.e33) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e11 - ucell.latvec.e11) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e12 - ucell.latvec.e12) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e13 - ucell.latvec.e13) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e21 - ucell.latvec.e21) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e22 - ucell.latvec.e22) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e23 - ucell.latvec.e23) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e31 - ucell.latvec.e31) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e32 - ucell.latvec.e32) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); + if(abs(real_lattice_nnkp.e33 - ucell.latvec.e33) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error real_lattice in *.nnkp file"); } @@ -118,16 +128,24 @@ void toWannier90::read_nnkp() const double tpiba_angstrom = TWO_PI / ucell.lat0_angstrom; recip_lattice_nnkp = recip_lattice_nnkp / tpiba_angstrom; - if(abs(recip_lattice_nnkp.e11 - ucell.G.e11) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e12 - ucell.G.e12) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e13 - ucell.G.e13) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e21 - ucell.G.e21) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e22 - ucell.G.e22) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e23 - ucell.G.e23) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e31 - ucell.G.e31) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e32 - ucell.G.e32) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - if(abs(recip_lattice_nnkp.e33 - ucell.G.e33) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); - + if(abs(recip_lattice_nnkp.e11 - ucell.G.e11) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e12 - ucell.G.e12) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e13 - ucell.G.e13) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e21 - ucell.G.e21) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e22 - ucell.G.e22) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e23 - ucell.G.e23) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e31 - ucell.G.e31) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e32 - ucell.G.e32) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); + if(abs(recip_lattice_nnkp.e33 - ucell.G.e33) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error recip_lattice in *.nnkp file"); } if( SCAN_BEGIN(nnkp_read,"kpoints") ) @@ -141,9 +159,12 @@ void toWannier90::read_nnkp() for(int ik = 0; ik < numkpt_nnkp; ik++) { nnkp_read >> kpoints_direct_nnkp[ik].x >> kpoints_direct_nnkp[ik].y >> kpoints_direct_nnkp[ik].z; - if(abs(kpoints_direct_nnkp[ik].x - kv.kvec_d[ik].x) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error kpoints in *.nnkp file"); - if(abs(kpoints_direct_nnkp[ik].y - kv.kvec_d[ik].y) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error kpoints in *.nnkp file"); - if(abs(kpoints_direct_nnkp[ik].z - kv.kvec_d[ik].z) > eps4) WARNING_QUIT("toWannier90::read_nnkp","Error kpoints in *.nnkp file"); + if(abs(kpoints_direct_nnkp[ik].x - kv.kvec_d[ik].x) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error kpoints in *.nnkp file"); + if(abs(kpoints_direct_nnkp[ik].y - kv.kvec_d[ik].y) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error kpoints in *.nnkp file"); + if(abs(kpoints_direct_nnkp[ik].z - kv.kvec_d[ik].z) > 1.0e-4) + WARNING_QUIT("toWannier90::read_nnkp","Error kpoints in *.nnkp file"); } delete[] kpoints_direct_nnkp; diff --git a/ABACUS.develop/source/src_pw/toWannier90.h b/ABACUS.develop/source/src_io/to_wannier90.h similarity index 100% rename from ABACUS.develop/source/src_pw/toWannier90.h rename to ABACUS.develop/source/src_io/to_wannier90.h diff --git a/ABACUS.develop/source/src_lcao/unkOverlap_lcao.cpp b/ABACUS.develop/source/src_io/unk_overlap_lcao.cpp similarity index 99% rename from ABACUS.develop/source/src_lcao/unkOverlap_lcao.cpp rename to ABACUS.develop/source/src_io/unk_overlap_lcao.cpp index d074b23b03..82e6c6b57e 100644 --- a/ABACUS.develop/source/src_lcao/unkOverlap_lcao.cpp +++ b/ABACUS.develop/source/src_io/unk_overlap_lcao.cpp @@ -1,5 +1,5 @@ -#include "unkOverlap_lcao.h" -#include "../src_lcao/lcao_nnr.h" +#include "unk_overlap_lcao.h" +#include "../src_lcao/LCAO_nnr.h" #include "ctime" #include "src_global/scalapack_connector.h" diff --git a/ABACUS.develop/source/src_lcao/unkOverlap_lcao.h b/ABACUS.develop/source/src_io/unk_overlap_lcao.h similarity index 78% rename from ABACUS.develop/source/src_lcao/unkOverlap_lcao.h rename to ABACUS.develop/source/src_io/unk_overlap_lcao.h index a68029d66e..1104bbc4d6 100644 --- a/ABACUS.develop/source/src_lcao/unkOverlap_lcao.h +++ b/ABACUS.develop/source/src_io/unk_overlap_lcao.h @@ -8,25 +8,25 @@ using std::map; #include using std::set; -#include "../src_lcao/center2_orb.h" -#include "../src_lcao/center2_orb-orb11.h" -#include "../src_lcao/center2_orb-orb21.h" +#include "src_lcao/center2_orb.h" +#include "src_lcao/center2_orb-orb11.h" +#include "src_lcao/center2_orb-orb21.h" -#include "../src_lcao/make_overlap_table.h" -#include "../src_lcao/make_gaunt_table.h" -#include "../src_lcao/numerical_orbital_lm.h" -#include "../src_lcao/lcao_orbitals.h" -#include "../src_global/vector3.h" -#include "../src_lcao/ylm.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/ORB_atomic_lm.h" +#include "src_lcao/ORB_read.h" +#include "src_global/vector3.h" +#include "src_global/ylm.h" -#include "../src_pw/global.h" +#include "src_pw/global.h" class unkOverlap_lcao { public: - Make_Overlap_Table MOT; - Make_Gaunt_Table MGT; + ORB_table_phi MOT; + ORB_gaunt_table MGT; Numerical_Orbital_Lm orb_r; // 新建的r矢量,以原子轨道形式存在,以solid球谐函数展开 vector>>> orb1_orb2_R; diff --git a/ABACUS.develop/source/src_pw/unkOverlap_pw.cpp b/ABACUS.develop/source/src_io/unk_overlap_pw.cpp similarity index 99% rename from ABACUS.develop/source/src_pw/unkOverlap_pw.cpp rename to ABACUS.develop/source/src_io/unk_overlap_pw.cpp index 24b187ccdf..5becc9f52d 100644 --- a/ABACUS.develop/source/src_pw/unkOverlap_pw.cpp +++ b/ABACUS.develop/source/src_io/unk_overlap_pw.cpp @@ -1,4 +1,4 @@ -#include "unkOverlap_pw.h" +#include "unk_overlap_pw.h" unkOverlap_pw::unkOverlap_pw() { diff --git a/ABACUS.develop/source/src_pw/unkOverlap_pw.h b/ABACUS.develop/source/src_io/unk_overlap_pw.h similarity index 100% rename from ABACUS.develop/source/src_pw/unkOverlap_pw.h rename to ABACUS.develop/source/src_io/unk_overlap_pw.h diff --git a/ABACUS.develop/source/src_io/wf_io.cpp b/ABACUS.develop/source/src_io/wf_io.cpp new file mode 100644 index 0000000000..d9baad3403 --- /dev/null +++ b/ABACUS.develop/source/src_io/wf_io.cpp @@ -0,0 +1,209 @@ +#include "wf_io.h" +#include "../src_pw/global.h" +//#include "../../src_develop/src_wannier/eximport.h" + +//qianrui add 2020-10-15 +/*inline int getink(const int &ik,const int &ipool,const int &nktot,const int &npool) +{ + int nkp=nktot/npool; + int rem=nktot%npool; + if(ipool"; + ofs << "\n" << NBANDS << " Number of bands." << endl; + ofs << setprecision(6); + for (int i=0; i"; + + ofs.close(); + return; +} + +void WF_io::write_wfc2(const string &fn, const ComplexMatrix *psi, const Vector3 *gkk) +{ + if (test_wf) TITLE("WF_io","write_wfc2"); + + string * wfilename; + wfilename=new string[kv.nkstot]; + for(int ik=0;ik"<\n"<"<\n"<" <" < *gkk); void read_wfc(const string &fn, const ComplexMatrix *psi); } diff --git a/ABACUS.develop/source/src_lcao/wf_local.cpp b/ABACUS.develop/source/src_io/wf_local.cpp similarity index 99% rename from ABACUS.develop/source/src_lcao/wf_local.cpp rename to ABACUS.develop/source/src_io/wf_local.cpp index 13f6b3525e..87efed6ce4 100644 --- a/ABACUS.develop/source/src_lcao/wf_local.cpp +++ b/ABACUS.develop/source/src_io/wf_local.cpp @@ -252,7 +252,8 @@ int WF_Local::read_lowf(double **c) if(error==3) return 3; // mohan add 2012-02-15, - SGO.cal_totwfc(); + // mohan comment out 2021-02-09 + //SGO.cal_totwfc(); // distri_lowf need all processors. // otherwise, read in sucessfully. @@ -264,7 +265,8 @@ int WF_Local::read_lowf(double **c) // mohan add 2012-02-15, // still have bugs, but can solve it later. // distribute the wave functions again. - SGO.dis_subwfc(); + // mohan comment out 2021-02-09 + // SGO.dis_subwfc(); if (MY_RANK==0) { diff --git a/ABACUS.develop/source/src_lcao/wf_local.h b/ABACUS.develop/source/src_io/wf_local.h similarity index 79% rename from ABACUS.develop/source/src_lcao/wf_local.h rename to ABACUS.develop/source/src_io/wf_local.h index 07bb3ce0d6..c19a434f78 100644 --- a/ABACUS.develop/source/src_lcao/wf_local.h +++ b/ABACUS.develop/source/src_io/wf_local.h @@ -3,25 +3,20 @@ #include "../src_pw/tools.h" +// mohan add 2010-09-09 namespace WF_Local { - // mohan add 2010-09-09 void write_lowf(const string &name, double** ctot); void write_lowf_complex(const string &name, complex** ctot, const int &ik); - // mohan add 2010-09-10 void distri_lowf(double** ctot, double **c); void distri_lowf_complex(complex** ctot, complex **cc); - // mohan add 2010-09-24 void distri_lowf_aug(double** ctot, double **c_aug); - // mohan add 2012-01-09 void distri_lowf_aug_complex(complex** ctot, complex **c_aug); - // mohan add 2010-09-10 int read_lowf(double **c); - // mohan add 2012-03-04 int read_lowf_complex(complex **c, const int &ik); } diff --git a/ABACUS.develop/source/src_pw/winput.cpp b/ABACUS.develop/source/src_io/winput.cpp similarity index 99% rename from ABACUS.develop/source/src_pw/winput.cpp rename to ABACUS.develop/source/src_io/winput.cpp index 6fe482e86f..b5c415b695 100644 --- a/ABACUS.develop/source/src_pw/winput.cpp +++ b/ABACUS.develop/source/src_io/winput.cpp @@ -3,7 +3,8 @@ #endif #include #include -#include "wan_global.h" +#include "winput.h" +#include "src_pw/global.h" string winput::target;//add 2008-06-04 diff --git a/ABACUS.develop/source/src_pw/winput.h b/ABACUS.develop/source/src_io/winput.h similarity index 100% rename from ABACUS.develop/source/src_pw/winput.h rename to ABACUS.develop/source/src_io/winput.h diff --git a/ABACUS.develop/source/src_lcao/hs_matrix.cpp b/ABACUS.develop/source/src_io/write_HS.cpp similarity index 98% rename from ABACUS.develop/source/src_lcao/hs_matrix.cpp rename to ABACUS.develop/source/src_io/write_HS.cpp index b15bbfca02..86f20b2ef7 100644 --- a/ABACUS.develop/source/src_lcao/hs_matrix.cpp +++ b/ABACUS.develop/source/src_io/write_HS.cpp @@ -1,6 +1,6 @@ -#include "hs_matrix.h" +#include "write_HS.h" #include "../src_pw/global.h" -#include "../src_lcao/local_orbital_elec.h" + void HS_Matrix::saving_HS(const double *Hloc, const double* Sloc, bool bit, const int &out_hs) { @@ -28,6 +28,7 @@ void HS_Matrix::saving_HS(const double *Hloc, const double* Sloc, bool bit, cons } +/* void HS_Matrix::save_HS_ccf(const int &iter, const int &Hnnz, const int *colptr_H, const int *rowind_H, const double *nzval_H, const double *nzval_S, bool bit) { @@ -37,6 +38,7 @@ void HS_Matrix::save_HS_ccf(const int &iter, const int &Hnnz, const int *colptr_ stringstream ssh; stringstream sss; + if(bit) { ssh << global_out_dir << "H_bit.ccf"; @@ -44,8 +46,9 @@ void HS_Matrix::save_HS_ccf(const int &iter, const int &Hnnz, const int *colptr_ } else { - ssh << global_out_dir << "H" << Local_Orbital_Elec::iter << "_" << iter+1 << ".ccf"; - sss << global_out_dir << "S" << Local_Orbital_Elec::iter << "_" << iter+1 << ".ccf"; + // mohan update 2021-02-10 + ssh << global_out_dir << "H" << ELEC_scf::iter << "_" << iter+1 << ".ccf"; + sss << global_out_dir << "S" << ELEC_scf::iter << "_" << iter+1 << ".ccf"; } if(bit) @@ -100,6 +103,7 @@ void HS_Matrix::save_HS_ccf(const int &iter, const int &Hnnz, const int *colptr_ } return; } +*/ // mohan add 2010/3/20, output H and S matrix, convinence for diagonalization // test or save the middle information for next start. diff --git a/ABACUS.develop/source/src_lcao/hs_matrix.h b/ABACUS.develop/source/src_io/write_HS.h similarity index 76% rename from ABACUS.develop/source/src_lcao/hs_matrix.h rename to ABACUS.develop/source/src_io/write_HS.h index e9565cc7fc..0bc2a011f1 100644 --- a/ABACUS.develop/source/src_lcao/hs_matrix.h +++ b/ABACUS.develop/source/src_io/write_HS.h @@ -9,12 +9,17 @@ namespace HS_Matrix void saving_HS(const double *Hloc, const double* Sloc, bool bit, const int &out_hs); void save_HS(const double *H, const double *S, bool bit); + void save_HS_complex(const complex *H, const complex *S, bool bit); + void save_HSR_tr(const int current_spin); //LiuXh add 2019-07-15 - void save_HS_ccf(const int &iter, const int &Hnnz, const int *colptr_H, const int *rowind_H, - const double *nzval_H, const double *nzval_S, bool bit); +// mohan comment out 2021-02-10 +// void save_HS_ccf(const int &iter, const int &Hnnz, const int *colptr_H, const int *rowind_H, +// const double *nzval_H, const double *nzval_S, bool bit); + void saving_HS_complex(complex *Hloc, complex* Sloc, bool bit, const int &out_hs); //LiuXh, 2017-03-21 + void save_HS_complex(complex *H, complex *S, bool bit); //LiuXh, 2017-03-21 } diff --git a/ABACUS.develop/source/src_io/write_HS_R.cpp b/ABACUS.develop/source/src_io/write_HS_R.cpp new file mode 100644 index 0000000000..4fa4d14102 --- /dev/null +++ b/ABACUS.develop/source/src_io/write_HS_R.cpp @@ -0,0 +1,63 @@ +#include "src_lcao/LOOP_ions.h" +#include "src_io/cal_r_overlap_R.h" +#include "src_pw/global.h" +#include "src_io/write_HS.h" + + +void LOOP_ions::output_HS_R(void) +{ + TITLE("LOOP_ions","output_HS_R"); + timer::tick("LOOP_ions","output_HS_R",'D'); + + // add by jingan for out r_R matrix 2019.8.14 + if(INPUT.out_r_matrix) + { + cal_r_overlap_R r_matrix; + r_matrix.init(); + r_matrix.out_r_overlap_R(NSPIN); + } + + if(NSPIN==1||NSPIN==4) + { + UHM.calculate_STN_R(); + UHM.GK.cal_vlocal_R(0); + UHM.GK.distribute_pvpR_tr(); + HS_Matrix::save_HSR_tr(0); + } + ///* + else if(NSPIN==2) + { + UHM.calculate_STN_R(); + for(int ik=0; iktaud[ia].x + << " " << atom->taud[ia].y + << " " << atom->taud[ia].z << endl; + } + } + + ofs << "\n " << NSPIN; + if(NSPIN==1||NSPIN==4) + { + ofs << "\n " << en.ef << " (fermi energy)"; + } + else if(NSPIN==2) + { + if(is==0)ofs << "\n " << en.ef_up << " (fermi energy for spin=1)"; + else if(is==1)ofs << "\n " << en.ef_dw << " (fermi energy for spin=2)"; + } + else + { + WARNING_QUIT("write_rho","check nspin!"); + } + + + ofs << "\n " << NLOCAL << " " << NLOCAL << endl; + + ofs << setprecision(precision); + ofs << scientific; + + } + + //ofs << "\n " << GAMMA_ONLY_LOCAL << " (GAMMA ONLY LOCAL)" << endl; +#ifndef __MPI + if(GAMMA_ONLY_LOCAL) + { + for(int i=0; iDM[is][i][j]; + } + } + } + else + { + WARNING_QUIT("write_dm","not ready yet"); + ofs << " " << LNNR.nnrg << " (nnrg)" << endl; + for(int i=0; iDM_R[is][i]; + } + } +#else + if(GAMMA_ONLY_LOCAL) + { + //xiaohui modify 2014-06-18 + + double* tmp = new double[NLOCAL]; + int* count = new int[NLOCAL]; + for (int i=0; i= 0) + { + for (int j=0; j= 0) + { + count[j]=1; + } + } + } + Parallel_Reduce::reduce_int_all( count, NLOCAL ); + + // reduce the density matrix for 'i' line. + ZEROS(tmp, NLOCAL); + if (mu >= 0) + { + for (int j=0; j=0) + { + tmp[j] = DM[is][mu][nu]; + //ofs_running << " dmi=" << i << " j=" << j << " " << DM[is][mu][nu] << endl; + } + } + } + Parallel_Reduce::reduce_double_all( tmp, NLOCAL ); + + if(MY_RANK==0) + { + for (int j=0; j0) + { + ofs << " " << tmp[j]/(double)count[j]; + } + else + { + ofs << " 0"; + } + } + } + } + delete[] tmp; + delete[] count; + + //xiaohui add 2014-06-18 + //for(int i=0; iDM[is][i][j]; + // } + //} + + } + else + { + ofs << " " << LNNR.nnrg << " (nnrg)" << endl; + WARNING_QUIT("local_orbital_charge","not ready to output DM_R"); + } +#endif + if(MY_RANK==0) + { + end = time(NULL); + OUT_TIME("write_rho",start,end); + ofs.close(); + } + timer::tick("Local_Orbital_Charge","write_dm"); + + return; +} diff --git a/ABACUS.develop/source/src_io/write_input.cpp b/ABACUS.develop/source/src_io/write_input.cpp new file mode 100644 index 0000000000..c715edc478 --- /dev/null +++ b/ABACUS.develop/source/src_io/write_input.cpp @@ -0,0 +1,293 @@ +#include "input.h" +#include "src_pw/tools.h" + +void Input::Print(const string &fn)const +{ + if (MY_RANK!=0) return; + + TITLE("Input","Print"); + + ofstream ofs(fn.c_str()); + + //---------------------------------- + // output the information in INPUT. + //---------------------------------- + ofs << "INPUT_PARAMETERS" << endl; + ofs << setiosflags(ios::left); + + ofs << "#Parameters (1.General)" << endl; + OUTP(ofs,"suffix",suffix,"the name of main output directory"); + OUTP(ofs,"latname",latname,"the name of lattice name"); + OUTP(ofs,"atom_file",global_atom_card,"the filename of file containing atom positions"); + OUTP(ofs,"kpoint_file",global_kpoint_card,"the name of file containing k points"); + OUTP(ofs,"pseudo_dir",global_pseudo_dir,"the directory containing pseudo files"); + OUTP(ofs,"pseudo_type",global_pseudo_type,"the type pseudo files"); + OUTP(ofs,"dft_functional",dft_functional,"exchange correlation functional"); + OUTP(ofs,"calculation",calculation,"test; scf; relax; nscf; ienvelope; istate;"); + OUTP(ofs,"ntype",ntype,"atom species number"); + OUTP(ofs,"nspin",nspin,"1: single spin; 2: up and down spin; 4: noncollinear spin"); + OUTP(ofs,"nbands",nbands,"number of bands"); + OUTP(ofs,"nbands_sto",nbands_sto,"number of stochastic bands"); + OUTP(ofs,"nbands_istate",nbands_istate,"number of bands around Fermi level for istate calulation"); + OUTP(ofs,"nche_sto",nche_sto,"number of orders for Chebyshev expansion in stochastic DFT"); + OUTP(ofs,"symmetry",symmetry,"turn symmetry on or off"); + OUTP(ofs,"nelec",nelec,"input number of electrons"); + OUTP(ofs,"newdm",newDM,""); + + ofs << "\n#Parameters (2.PW)" << endl; + OUTP(ofs,"ecutwfc",ecutwfc,"#energy cutoff for wave functions"); + if(ks_solver=="cg") + { + OUTP(ofs,"diago_cg_maxiter",diago_cg_maxiter,"max iteration number for cg"); + OUTP(ofs,"diago_cg_prec",diago_cg_prec,"diago_cg_prec"); + } + else if(ks_solver=="dav") + { + OUTP(ofs,"diago_david_ndim",diago_david_ndim,"max dimension for davidson"); + } + OUTP(ofs,"ethr",ethr,"threshold for eigenvalues is cg electron iterations"); + OUTP(ofs,"dr2",dr2,"charge density error"); + OUTP(ofs,"start_wfc",start_wfc,"start wave functions are from 'atomic' or 'file'"); + OUTP(ofs,"start_charge",start_pot,"start charge is from 'atomic' or file"); + OUTP(ofs,"charge_extrap",charge_extrap,"atomic; first-order; second-order; dm:coefficients of SIA"); + OUTP(ofs,"out_charge",out_charge,">0 output charge density for selected electron steps"); + OUTP(ofs,"out_potential",out_potential,"output realspace potential"); + OUTP(ofs,"out_wf",out_wf,"output wave functions"); + OUTP(ofs,"out_dos",out_dos,"output energy and dos"); + OUTP(ofs,"out_band",out_band,"output energy and band structure"); + OUTP(ofs,"restart_save",restart_save,"print to disk every step for restart"); + OUTP(ofs,"restart_load",restart_load,"restart from disk"); + OUTP(ofs,"nx",nx,"number of points along x axis for FFT grid"); + OUTP(ofs,"ny",ny,"number of points along y axis for FFT grid"); + OUTP(ofs,"nz",nz,"number of points along z axis for FFT grid"); + + ofs << "\n#Parameters (3.Relaxation)" << endl; + OUTP(ofs,"ks_solver",KS_SOLVER,"cg; dav; lapack; genelpa; hpseps; scalapack_gvx"); + OUTP(ofs,"niter",niter,"#number of electron iterations"); + OUTP(ofs,"force_set",force_set,"output the force_set or not"); + OUTP(ofs,"nstep",nstep,"number of ion iteration steps"); + OUTP(ofs,"out_stru",out_stru,"output the structure files after each ion step"); + OUTP(ofs,"force_thr",force_thr,"force threshold, unit: Ry/Bohr"); + OUTP(ofs,"force_thr_ev",force_thr*13.6058/0.529177,"force threshold, unit: eV/Angstrom"); + OUTP(ofs,"force_thr_ev2",force_thr_ev2,"force invalid threshold, unit: eV/Angstrom"); + OUTP(ofs,"stress_thr",stress_thr,"stress threshold"); + OUTP(ofs,"press1",press1,"target pressure, unit: KBar"); + OUTP(ofs,"press2",press2,"target pressure, unit: KBar"); + OUTP(ofs,"press3",press3,"target pressure, unit: KBar"); + OUTP(ofs,"bfgs_w1",bfgs_w1,"wolfe condition 1 for bfgs"); + OUTP(ofs,"bfgs_w2",bfgs_w2,"wolfe condition 2 for bfgs"); + OUTP(ofs,"trust_radius_max", trust_radius_max,"maximal trust radius, unit: Bohr"); + OUTP(ofs,"trust_radius_min", trust_radius_min,"minimal trust radius, unit: Bohr"); + OUTP(ofs,"trust_radius_ini", trust_radius_ini,"initial trust radius, unit: Bohr"); + OUTP(ofs,"stress",stress,"calculate the stress or not"); + OUTP(ofs,"fixed_axes",fixed_axes,"which axes are fixed"); + OUTP(ofs,"move_method",ion_dynamics,"bfgs; sd; cg; cg_bfgs;"); //pengfei add 2013-08-15 + OUTP(ofs,"out_level",out_level,"ie(for electrons); i(for ions);"); + OUTP(ofs,"out_dm",out_dm,">0 output density matrix"); + + // for deepks + OUTP(ofs,"out_descriptor",out_descriptor,">0 compute descriptor for deepks"); + OUTP(ofs,"lmax_descriptor",lmax_descriptor,">0 lmax used in descriptor for deepks"); + + ofs << "\n#Parameters (4.LCAO)" << endl; + OUTP(ofs,"basis_type",basis_type,"PW; LCAO in pw; LCAO"); + if(ks_solver=="HPSEPS" || ks_solver=="genelpa" || ks_solver=="scalapack_gvx") + { + OUTP(ofs,"nb2d",nb2d,"2d distribution of atoms"); + } + OUTP(ofs,"search_radius",search_radius,"input search radius (Bohr)"); + OUTP(ofs,"search_pbc",search_pbc,"input periodic boundary condition"); + OUTP(ofs,"lcao_ecut",lcao_ecut,"energy cutoff for LCAO"); + OUTP(ofs,"lcao_dk",lcao_dk,"delta k for 1D integration in LCAO"); + OUTP(ofs,"lcao_dr",lcao_dr,"delta r for 1D integration in LCAO"); + OUTP(ofs,"lcao_rmax",lcao_rmax,"max R for 1D two-center integration table"); + OUTP(ofs,"out_hs",out_hs,"output H and S matrix"); + OUTP(ofs,"out_lowf",out_lowf,"ouput LCAO wave functions"); + OUTP(ofs,"bx",bx,"division of an element grid in FFT grid along x"); + OUTP(ofs,"by",by,"division of an element grid in FFT grid along y"); + OUTP(ofs,"bz",bz,"division of an element grid in FFT grid along z"); + + ofs << "\n#Parameters (5.Smearing)" << endl; + OUTP(ofs,"smearing",smearing,"type of smearing: gauss; fd; fixed; mp; mp2; mv"); + OUTP(ofs,"sigma",degauss,"energy range for smearing"); + + ofs << "\n#Parameters (6.Charge Mixing)" << endl; + OUTP(ofs,"mixing_type",mixing_mode,"plain; kerker; pulay; pulay-kerker; broyden"); + OUTP(ofs,"mixing_beta",mixing_beta,"mixing parameter: 0 means no new charge"); + OUTP(ofs,"mixing_ndim",mixing_ndim,"mixing dimension in pulay"); + OUTP(ofs,"mixing_gg0",mixing_gg0,"mixing parameter in kerker"); + + ofs << "\n#Parameters (7.DOS)" << endl; + OUTP(ofs,"dos_emin_ev",dos_emin_ev,"minimal range for dos"); + OUTP(ofs,"dos_emax_ev",dos_emax_ev,"maximal range for dos"); + OUTP(ofs,"dos_edelta_ev",dos_edelta_ev,"delta energy for dos"); + OUTP(ofs,"dos_sigma",b_coef,"gauss b coefficeinet(default=0.07)"); + + ofs << "\n#Parameters (8.Technique)" << endl; + OUTP(ofs,"gamma_only",gamma_only,"gamma only, only used in LCAO basis"); + OUTP(ofs,"diago_proc",DIAGO_PROC,"number of proc used to diago"); + OUTP(ofs,"npool",npool,"number of pools for k points, pw only"); + OUTP(ofs,"mem_saver",mem_saver,"memory saver for many k points used"); + OUTP(ofs,"printe",printe,"print band energy for selectively ionic steps"); + + ofs << "\n#Parameters (9.SIAO)" << endl; + OUTP(ofs,"selinv_npole",selinv_npole,"number of selected poles"); + OUTP(ofs,"selinv_temp",selinv_temp,"temperature for Fermi-Dirac distribution"); + OUTP(ofs,"selinv_gap",selinv_gap,"supposed gap in the calculation"); + OUTP(ofs,"selinv_deltae",selinv_deltae,"expected energy range"); + OUTP(ofs,"selinv_mu",selinv_mu,"chosen mu as Fermi energy"); + OUTP(ofs,"selinv_threshold",selinv_threshold,"threshold for calculated electron number"); + OUTP(ofs,"selinv_niter",selinv_niter,"max number of steps to update mu"); + + ofs << "\n#Parameters (10.Molecular dynamics)" << endl; + OUTP(ofs,"md_mdtype",md_mdtype,"choose ensemble"); + OUTP(ofs,"md_dt",md_dt,"time step"); + OUTP(ofs,"md_nresn",md_nresn,"parameter during integrater"); + OUTP(ofs,"md_nyosh",md_nyosh,"parameter during integrater"); + OUTP(ofs,"md_qmass",md_qmass,"mass of thermostat"); + OUTP(ofs,"md_tfirst",md_tfirst,"temperature first"); + OUTP(ofs,"md_tlast",md_tlast,"temperature last"); + OUTP(ofs,"md_dumpmdfred",md_dumpmdfred,"The period to dump MD information for monitoring and restarting MD"); + OUTP(ofs,"md_mdoutpath",md_mdoutpath,"output path of md"); + OUTP(ofs,"md_domsd",md_domsd,"whether compute "); + OUTP(ofs,"md_domsdatom",md_domsdatom,"whether compute msd for each atom"); + OUTP(ofs,"md_rstmd",md_rstmd,"whether restart"); + OUTP(ofs,"md_fixtemperature",md_fixtemperature,"period to change temperature"); + OUTP(ofs,"md_ediff",md_ediff,"parameter for constraining total energy change"); + OUTP(ofs,"md_ediffg",md_ediffg,"parameter for constraining max force change"); + OUTP(ofs,"md_msdstarttime",md_msdstartTime,"choose which step that msd be calculated"); + + ofs << "\n#Parameters (11.Efield)" << endl; + OUTP(ofs,"efield",efield,"add electric field"); + OUTP(ofs,"edir",edir,"add electric field"); + OUTP(ofs,"emaxpos",emaxpos,"maximal position of efield [0,1)"); + OUTP(ofs,"eopreg",eopreg,"where sawlike potential decrease"); + OUTP(ofs,"eamp",eamp,"amplitute of the efield, unit is a.u."); + OUTP(ofs,"eamp_v",eamp*51.44,"amplitute of the efield, unit is V/A"); + + ofs << "\n#Parameters (12.Test)" << endl; + OUTP(ofs,"out_alllog",out_alllog,"output information for each processor, when parallel"); + OUTP(ofs,"nurse", nurse,"for coders"); + OUTP(ofs,"colour", colour,"for coders, make their live colourful"); + OUTP(ofs,"t_in_h", t_in_h,"calculate the kinetic energy or not"); + OUTP(ofs,"vl_in_h", vl_in_h,"calculate the local potential or not"); + OUTP(ofs,"vnl_in_h", vnl_in_h,"calculate the nonlocal potential or not"); + OUTP(ofs,"test_force", test_force, "test the force"); + OUTP(ofs,"test_stress", test_stress, "test the force"); + + ofs << "\n#Parameters (13.Other Methods)" << endl; + OUTP(ofs,"mlwf_flag",mlwf_flag,"turn MLWF on or off"); + OUTP(ofs,"opt_epsilon2",opt_epsilon2,"calculate the dielectic function"); + OUTP(ofs,"opt_nbands",opt_nbands,"number of bands for optical calculation"); + + ofs << "\n#Parameters (14.VdW Correction)" << endl; + OUTP(ofs,"vdw_method",vdw_method,"the method of calculating vdw (none ; d2 ; d3_0 ; d3_bj"); + OUTP(ofs,"vdw_s6",vdw_s6,"scale parameter of d2/d3_0/d3_bj"); + OUTP(ofs,"vdw_s8",vdw_s8,"scale parameter of d3_0/d3_bj"); + OUTP(ofs,"vdw_a1",vdw_a1,"damping parameter of d3_0/d3_bj"); + OUTP(ofs,"vdw_a2",vdw_a2,"damping parameter of d3_bj"); + OUTP(ofs,"vdw_d",vdw_d,"damping parameter of d2"); + OUTP(ofs,"vdw_abc",vdw_abc,"third-order term?"); + OUTP(ofs,"vdw_C6_file",vdw_C6_file,"filename of C6"); + OUTP(ofs,"vdw_C6_unit",vdw_C6_unit,"unit of C6, Jnm6/mol or eVA6"); + OUTP(ofs,"vdw_R0_file",vdw_R0_file,"filename of R0"); + OUTP(ofs,"vdw_R0_unit",vdw_R0_unit,"unit of R0, A or Bohr"); + OUTP(ofs,"vdw_model",vdw_model,"expression model of periodic structure, radius or period"); + OUTP(ofs,"vdw_radius",vdw_radius,"radius cutoff for periodic structure"); + OUTP(ofs,"vdw_radius_unit",vdw_radius_unit,"unit of radius cutoff for periodic structure"); + OUTP(ofs,"vdw_cn_thr",vdw_cn_thr,"radius cutoff for cn"); + OUTP(ofs,"vdw_cn_thr_unit",vdw_cn_thr_unit,"unit of cn_thr, Bohr or Angstrom"); + ofs << setw(20) << "vdw_period" << vdw_period.x + << " " << vdw_period.y << " " + << vdw_period.z<< " #periods of periodic structure" << endl; + + + ofs << "\n#Parameters (15.spectrum)" << endl; // pengfei Li add 2016-11-23 + OUTP(ofs,"spectral_type",spectral_type,"the type of the calculated spectrum"); + OUTP(ofs,"spectral_method",spectral_method,"0: tddft(linear response)"); + OUTP(ofs,"kernel_type",kernel_type,"the kernel type: rpa, tdlda ..."); + OUTP(ofs,"eels_method",eels_method,"0: hilbert_transform method; 1: standard method"); + OUTP(ofs,"absorption_method",absorption_method,"0: vasp's method 1: pwscf's method"); + OUTP(ofs,"system",system,"the calculate system"); + OUTP(ofs,"eta",eta,"eta(Ry)"); + OUTP(ofs,"domega",domega,"domega(Ry)"); + OUTP(ofs,"nomega",nomega,"nomega"); + OUTP(ofs,"ecut_chi",ecut_chi,"the dimension of chi matrix"); + ofs << setw(20) <<"q_start"<"); + for(int i=0; i" <=start_z[NPROC_IN_POOL-1]) + { + which_ip[iz] = NPROC_IN_POOL-1; + break; + } + else if(iz>=start_z[ip] && iz *Porter = UFFT.porter; + ZEROS( Porter, pw.nrxx ); + + int nspin0 = 1; + if(NSPIN==2) nspin0 = NSPIN; + for(int is=0; is( CHR.rho[is][ir], 0.0 ); + } + } + + //============================= + // bring rho (aux) to G space + //============================= + pw.FFT_chg.FFT3D(Porter, -1); + + //======================================================= + // calculate hartree potential in G-space (NB: V(G=0)=0 ) + //======================================================= + complex *vh_g = new complex[pw.ngmc]; + ZEROS(vh_g, pw.ngmc); + + for(int ig = pw.gstart; ig= 1.0e-12) //LiuXh 20180410 + { + const double fac = e2 * FOUR_PI / (ucell.tpiba2 * pw.gg [ig]); + vh_g[ig] = fac * Porter[j]; + } + } + + ZEROS(Porter, pw.nrxx); + + for (int ig = 0;ig < pw.ngmc;ig++) + { + Porter[pw.ig2fftc[ig]] = vh_g[ig]; + } + + //========================================== + //transform hartree potential to real space + //========================================== + pw.FFT_chg.FFT3D(Porter, 1); + //========================================== + //Add hartree potential and local pseudopot + //========================================== + for (int ir = 0;ir < pw.nrxx;ir++) + { + v_elecstat[ir] = Porter[ir].real() + this->vltot[ir]; + } + + //------------------------------------------- + // output the electrostatic potential into a file. + //------------------------------------------- + ofstream ofs; + ofstream ofs_ave; + + if(MY_RANK==0) + { + ofs.open( fn.c_str() ); + ofs_ave.open( fn_ave.c_str() ); + + ofs << ucell.latName << endl;//1 + ofs << " " << ucell.lat0 * 0.529177 << endl; + ofs << " " << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; + ofs << " " << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; + ofs << " " << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; + + ofs_ave << ucell.latName << endl;//1 + ofs_ave << " " << ucell.lat0 * 0.529177 << endl; + ofs_ave << " " << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; + ofs_ave << " " << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; + ofs_ave << " " << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; + + for(int it=0; it=start_z[NPROC_IN_POOL-1]) + { + which_ip[iz] = NPROC_IN_POOL-1; + break; + } + else if(iz>=start_z[ip] && iz( pw.ncxyz ); + dipole_elec_y *= ucell.omega / static_cast( pw.ncxyz ); + dipole_elec_z *= ucell.omega / static_cast( pw.ncxyz ); + Parallel_Reduce::reduce_double_pool( dipole_elec_x ); + Parallel_Reduce::reduce_double_pool( dipole_elec_y ); + Parallel_Reduce::reduce_double_pool( dipole_elec_z ); + + //cout << "dipole_elec_x: " << dipole_elec_x <0); + delete[] lat0; delete[] grad0; delete[] cg_grad0; delete[] move0; + this->lat0 = new double[dim]; this->grad0 = new double[dim]; this->cg_grad0 = new double[dim]; this->move0 = new double[dim]; + ZEROS(lat0, dim); ZEROS(grad0, dim); ZEROS(cg_grad0, dim); diff --git a/ABACUS.develop/source/src_ions/lattice_change_cg.h b/ABACUS.develop/source/src_ions/lattice_change_cg.h index 50a5998743..0296249224 100644 --- a/ABACUS.develop/source/src_ions/lattice_change_cg.h +++ b/ABACUS.develop/source/src_ions/lattice_change_cg.h @@ -4,7 +4,9 @@ #include "../src_pw/tools.h" class Lattice_Change_CG { + public: + Lattice_Change_CG(); ~Lattice_Change_CG(); @@ -12,16 +14,23 @@ class Lattice_Change_CG void start(matrix &stress, const double &etot); private: + double* lat0; double* grad0; double* cg_grad0; double* move0; double e0; - // setup gradients. - void setup_cg_grad(double *grad, const double *grad0, double *cg_grad, const double *cg_grad0, const int &ncggrad, int &flag); + + // setup gradients. + void setup_cg_grad(double *grad, const double *grad0, double *cg_grad, + const double *cg_grad0, const int &ncggrad, int &flag); + void setup_move( double *move, double *cg_gradn, const double &trust_radius ); + void Brent(double &fa,double &fb,double &fc,double &xa,double &xb,double &xc,double &best_x,double &xpt); + void f_cal(const double *g0,const double *g1,const int &dim,double &f_value); + void third_order(const double &e0,const double &e1,const double &fa, const double &fb, const double x, double &best_x); }; diff --git a/ABACUS.develop/source/src_ions/lattice_change_methods.h b/ABACUS.develop/source/src_ions/lattice_change_methods.h index e6f372c744..968e189c06 100644 --- a/ABACUS.develop/source/src_ions/lattice_change_methods.h +++ b/ABACUS.develop/source/src_ions/lattice_change_methods.h @@ -8,14 +8,19 @@ using namespace std; class Lattice_Change_Methods { public: + Lattice_Change_Methods(); + ~Lattice_Change_Methods(); void allocate(void); + void cal_lattice_change(const int &istep, matrix &stress, const double &etot); bool get_converged(void)const {return Lattice_Change_Basic::converged;} + double get_ediff(void)const {return Lattice_Change_Basic::ediff;} + double get_largest_grad(void)const {return Lattice_Change_Basic::largest_grad;} private: diff --git a/ABACUS.develop/source/src_ions/variable_cell.cpp b/ABACUS.develop/source/src_ions/variable_cell.cpp new file mode 100644 index 0000000000..009e700837 --- /dev/null +++ b/ABACUS.develop/source/src_ions/variable_cell.cpp @@ -0,0 +1,166 @@ +#include "variable_cell.h" +#include "../src_pw/global.h" +#include "../input.h" + +Variable_Cell::Variable_Cell(){} +Variable_Cell::~Variable_Cell(){} + +void Variable_Cell::init_after_vc(void) +{ + TITLE("Variable_Cell","init_after_vc"); + + ucell.setup_cell_after_vc(global_pseudo_dir, global_atom_card, ofs_running); + DONE(ofs_running, "SETUP UNITCELL"); + + if(Symmetry::symm_flag) + { + symm.analy_sys(); + DONE(ofs_running, "SYMMETRY"); + } + + kv.set_after_vc(symm, global_kpoint_card, NSPIN, ucell.G, ucell.latvec); + DONE(ofs_running, "INIT K-POINTS"); + + pw.update_gvectors(ofs_running, ucell); + + pw.setup_structure_factor(); + + if(BASIS_TYPE=="pw") + { + wf.init_after_vc(kv.nks); + wf.init_at_1(); + } + + ofs_running << " Setup the Vl+Vh+Vxc according to new structure factor and new charge." << endl; + //================================= + // initalize local pseudopotential + //================================= + ppcell.init_vloc(pw.nggm, ppcell.vloc); + DONE(ofs_running,"LOCAL POTENTIAL"); + + //====================================== + // Initalize non local pseudopotential + //====================================== + if(BASIS_TYPE=="pw") + { + ppcell.init_vnl(ucell); + DONE(ofs_running,"NON-LOCAL POTENTIAL"); + } + + return; +} + + +void Variable_Cell::final_calculation_after_vc(void) +{ + TITLE("Variable_Cell","final_after_vc"); + + cout<<" -----------------------------------------------------------------"<=0) + { + //trace_global[iLocalGrid]=iGlobal; + int p; + trace_2D_row[iLocalGrid]=localIndex(iGlobal, nblk, nprows, p); + trace_2D_prow[iLocalGrid]=p; + nRow_in_proc[trace_2D_prow[iLocalGrid]]++; + trace_2D_col[iLocalGrid]=localIndex(iGlobal, nblk, npcols, p); + trace_2D_pcol[iLocalGrid]=p; + nCol_in_proc[trace_2D_pcol[iLocalGrid]]++; + } + } + // OUT(ofs_running,"NLOCAL",NLOCAL); + receiver_displacement_process[0]=0; + // OUT(ofs_running,"receiver_displacement_process[0]",receiver_displacement_process[0]); + for(int pnum=0; pnum1) + { + OUT(ofs_running,"pnum",pnum); + OUT(ofs_running,"prow",prow); + OUT(ofs_running,"pcol",pcol); + OUT(ofs_running,"nRow_in_proc",nRow_in_proc[prow]); + OUT(ofs_running,"nCol_in_proc",nCol_in_proc[pcol]); + } + if(pnum>0) + { + receiver_displacement_process[pnum]=receiver_displacement_process[pnum-1]+receiver_size_process[pnum-1]; + } + } + // OUT(ofs_running,"last receiver_size_process",receiver_size_process[nprocs-1]); + + // build the index to be received + int* pos=new int[nprocs]; + int *receiver_2D_index=new int[receiver_size]; + for(int i=0; i1) + { + ofs_running<<"receiver_size is "<lgd_now = gt.lgd; + //xiaohui add 'OUT_LEVEL' line, 2015-09-16 + if(OUT_LEVEL != "m") OUT(ofs_running,"lgd_last",lgd_last); + if(OUT_LEVEL != "m") OUT(ofs_running,"lgd_now",lgd_now); + + // mohan add 2010-07-01 + if(this->init_DM) + { + assert(lgd_last > 0); + for (int is=0; is 0) + { + this->DM = new double**[NSPIN]; + this->DM_pool = new double *[NSPIN]; + for(int is=0; isDM_pool[is]=new double [lgd_now*lgd_now]; + ZEROS(DM_pool[is], lgd_now*lgd_now); + this->DM[is] = new double*[lgd_now]; + + for (int i=0; iinit_DM = true; + this->lgd_last = lgd_now; + //xiaohui add 'OUT_LEVEL', 2015-09-16 + if(OUT_LEVEL != "m") ofs_running << " allocate DM , the dimension is " << lgd_now << endl; + } + else if(lgd_now == 0) + { + this->init_DM = false; + } + else + { + WARNING_QUIT("Local_Orbital_Charge::allocate","lgd<0!Something Wrong!"); + } + + setAlltoallvParameter(ParaO.comm_2D, ParaO.blacs_ctxt, ParaO.nb); + + // Peize Lin test 2019-01-16 + wfc_dm_2d.init(); + + return; +} + + +// calculate the grid distributed DM matrix from 2D block-cyclic distributed DM matrix +// transform dm_gamma[is].c to this->DM[is] +void Local_Orbital_Charge::cal_dk_gamma_from_2D(void) +{ + timer::tick("LCAO_Charge","dm_2dTOgrid",'F'); + OUT(ofs_running,"cal_dk_gamma_from_2D, NSPIN", NSPIN); + + for(int is=0; is1) + // outputDM( ParaO.blacs_ctxt, ParaO.nb); + { + // int myid; + // MPI_Comm_rank(MPI_COMM_WORLD, &myid); + // if(myid==0) + // { + // ofs_running<<"DM[0][0:1][0:1] before send:"<1) + { + OUT(ofs_running,"number of non-zero elements in sender_buffer",nNONZERO); + OUT(ofs_running,"sender_size",sender_size); + OUT(ofs_running,"last sender_buffer",sender_buffer[sender_size-1]); + } + // transform data via MPI_Alltoallv + MPI_Alltoallv(sender_buffer, sender_size_process, sender_displacement_process, MPI_DOUBLE, + receiver_buffer, receiver_size_process, receiver_displacement_process, MPI_DOUBLE, ParaO.comm_2D); + // put data from receiver buffer to this->DM[is] + nNONZERO=0; + // init DM[is] + /*for(int i=0; i1) + { + OUT(ofs_running,"number of non-zero elements in receiver_buffer",nNONZERO); + OUT(ofs_running,"receiver_size",receiver_size); + OUT(ofs_running,"last receiver_buffer",receiver_buffer[receiver_size-1]); + // ofs_running<<"DM[0][0:1][0:1] after receiver:"<=0) + // { + // ofs_running<<"DM(0,0)"<=0 && idx1>=0) + // { + // ofs_running<<"DM(0,1)"<=0) + // { + // ofs_running<<"DM(1,1)"<DM[is][i], lgd_now); + } + } + + // initialize + int nprocs=0; + int myid=0; + //MPI_Status status; + MPI_Comm_size(DIAG_HPSEPS_WORLD,&nprocs); + MPI_Comm_rank(DIAG_HPSEPS_WORLD,&myid); + + + // DSIZE: number of processors in diag world + vector bands_local(DSIZE); + for (int id=0; id= NBANDS) + { + lastband_in_proc = id; + break; + } + } + + matrix wg_local(NSPIN,band_local); + for(int id=0, Total_Bands=0; id <= lastband_in_proc; ++id) + { + if(myid == id) + { + for(int is=0; isDM[is][row_mu][col_nu] = rho_row_col(i_row,i_col); + } + } + } + + #if EXX_DM==2 + if( Exx_Global::Hybrid_Type::HF==exx_lcao.info.hybrid_type + || Exx_Global::Hybrid_Type::PBE0==exx_lcao.info.hybrid_type + || Exx_Global::Hybrid_Type::HSE==exx_lcao.info.hybrid_type ) + { + exx_lcao.DM_para.set_DM_gamma( rho_row_col, is, {row_count*300,col_count*300} ); + } + #endif + } // end for col_count + } // end for row_count + + ofs_running<<"DM[0][0:1][0:1] in cal_dk_gamma:"<=0) + { + ofs_running<<"DM(0,0)"<=0 && idx1>=0) + { + ofs_running<<"DM(0,1)"<=0) + { + ofs_running<<"DM(1,1)"<nnrg_now = LNNR.nnrg; + //xiaohui add 'OUT_LEVEL' line, 2015-09-16 + if(OUT_LEVEL != "m") OUT(ofs_running,"nnrg_last",nnrg_last); + if(OUT_LEVEL != "m") OUT(ofs_running,"nnrg_now",nnrg_now); + + if(this->init_DM_R) + { + assert(nnrg_last > 0); + for(int is=0; is0) + { + this->DM_R = new double*[NSPIN]; + for(int is=0; isDM_R[is] = new double[nnrg_now]; + ZEROS(DM_R[is], nnrg_now); + } + this->nnrg_last = nnrg_now; + this->init_DM_R = true; + Memory::record("LocalOrbital_Charge","Density_Matrix",NSPIN*nnrg_now,"double"); + } + else if(nnrg_now==0) + { + this->init_DM_R = false; + } + else + { + WARNING_QUIT("Local_Orbital_Charge::allocate_k","check init_DM_R."); + } + + // Peize Lin test 2019-01-16 + wfc_dm_2d.init(); + + return; +} + + + +#include "record_adj.h" +inline void cal_DM_ATOM(const Grid_Technique >, const complex fac, Record_adj RA, + const int ia1, const int iw1_lo, const int nw1, const int gstart, + complex *WFC_PHASE, complex **DM_ATOM) +{ + + const char transa='N', transb='T'; + const complex alpha=1, beta=1; + + for(int ik=0; ik **wfc = LOWF.WFC_K[ik]; + const int ispin = kv.isk[ik]; + int atom2start=0; + + for (int ia2 = 0; ia2 < RA.na_each[ia1]; ++ia2) + { + complex *DM=&DM_ATOM[ispin][atom2start]; + const int T2 = RA.info[ia1][ia2][3]; + const int I2 = RA.info[ia1][ia2][4]; + Atom* atom2 = &ucell.atoms[T2]; + const int start2 = ucell.itiaiw2iwt(T2,I2,0); + const int iw2_lo=gt.trace_lo[start2]; + const int nw2=atom2->nw; + complex exp_R= exp( fac * ( + kv.kvec_d[ik].x * RA.info[ia1][ia2][0] + + kv.kvec_d[ik].y * RA.info[ia1][ia2][1] + + kv.kvec_d[ik].z * RA.info[ia1][ia2][2] + ) ); + + //ZEROS(WFC_PHASE, NBANDS*nw1); + int ibStart=0; + int nRow=0; + for(int ib=0; ib0) + { + if(nRow==0) ibStart=ib; + const int iline=nRow*nw1; + complex phase=exp_R*wg_local; + for(int iw1=0; iw1 fac, Record_adj RA, + const int ia1, const int iw1_lo, const int nw1, const int gstart, + complex *WFC_PHASE, complex **DM_ATOM) +{ + if(NSPIN !=4 ) WARNING_QUIT("Local_Orbital_Charge","NSPIN not match!"); + const char transa='N', transb='T'; + const complex alpha=1, beta=1; + int ispin=0; + + for(int is1=0;is1<2;is1++) + { + for(int is2=0;is2<2;is2++) + { + for(int ik=0; ik **wfc = LOWF.WFC_K[ik]; + int atom2start=0; + + for (int ia2 = 0; ia2 < RA.na_each[ia1]; ++ia2) + { + complex *DM=&DM_ATOM[ispin][atom2start]; + const int T2 = RA.info[ia1][ia2][3]; + const int I2 = RA.info[ia1][ia2][4]; + Atom* atom2 = &ucell.atoms[T2]; + const int start2 = ucell.itiaiw2iwt(T2,I2,0); + const int iw2_lo=gt.trace_lo[start2]/NPOL + gt.lgd/NPOL*is2; + const int nw2=atom2->nw; + complex exp_R= exp( fac * ( + kv.kvec_d[ik].x * RA.info[ia1][ia2][0] + + kv.kvec_d[ik].y * RA.info[ia1][ia2][1] + + kv.kvec_d[ik].z * RA.info[ia1][ia2][2] + ) ); + + //ZEROS(WFC_PHASE, NBANDS*nw1); + int ibStart=0; + int nRow=0; + for(int ib=0; ib0) + { + if(nRow==0) + { + ibStart=ib; + } + const int iline=nRow*nw1; + complex phase=exp_R*w1; + for(int iw1=0; iw1 tau1, dtau; + + Record_adj RA; + RA.for_grid(gt); + + int ca = 0; + complex fac = TWO_PI * IMAG_UNIT; + + complex *WFC_PHASE=new complex[NLOCAL*ucell.nwmax]; + + int DM_ATOM_SIZE=1; + complex **DM_ATOM=new complex *[NSPIN]; + for(int is=0; is[DM_ATOM_SIZE]; + ZEROS(DM_ATOM[is], DM_ATOM_SIZE); + } + for(int T1=0; T1na; I1++) + { + const int iat = ucell.itia2iat(T1,I1); + if(gt.in_this_processor[iat]) + { + const int start1 = ucell.itiaiw2iwt(T1,I1,0); + const int gstart = LNNR.nlocstartg[iat]; + const int ng = LNNR.nlocdimg[iat]; + const int iw1_lo=gt.trace_lo[start1]/NPOL; + const int nw1=atom1->nw; + + if(DM_ATOM_SIZE[DM_ATOM_SIZE]; + } + } + for(int is=0; isDM_R[is][gstart+iv]=DM_ATOM[is][iv].real(); + } + } + } + else + {//zhengdy-soc + for(int iv=0; ivDM_R[0][gstart+iv]=DM_ATOM[0][iv].real() + DM_ATOM[3][iv].real(); + if(NONCOLIN) + {//DOMAG + this->DM_R[1][gstart+iv]=DM_ATOM[1][iv].real() + DM_ATOM[2][iv].real(); + this->DM_R[2][gstart+iv]=DM_ATOM[1][iv].imag() - DM_ATOM[2][iv].imag(); + this->DM_R[3][gstart+iv]=DM_ATOM[0][iv].real() - DM_ATOM[3][iv].real(); + } + else if(!NONCOLIN)//DOMAG_Z + { + this->DM_R[1][gstart+iv]= 0.0; + this->DM_R[1][gstart+iv]= 0.0; + this->DM_R[3][gstart+iv]=DM_ATOM[0][iv].real() - DM_ATOM[3][iv].real(); + } + else//soc with no mag + { + this->DM_R[1][gstart+iv]= 0.0; + this->DM_R[2][gstart+iv]= 0.0; + this->DM_R[3][gstart+iv]= 0.0; + } + } + } + } // if gt.in_this_processor + }// I1 + }// T1 + + + //------------ + // for test + //------------ +/* cout << setprecision(3); + for(int i=0; i for a new spin. + //-------------------------------------------- + if(CURRENT_SPIN == uhm.GK.get_spin() ) + { + //ofs_running << " Same spin, same vlocal integration." << endl; + } + else + { + //ofs_running << " (spin change)" << endl; + uhm.GK.reset_spin( CURRENT_SPIN ); + + // if you change the place of the following code, + // rememeber to delete the #include + if(VL_IN_H) + { + // vlocal = Vh[rho] + Vxc[rho] + Vl(pseudo) + uhm.GK.cal_vlocal_k(pot.vr_eff1,GridT); + // added by zhengdy-soc, for non-collinear case + // integral 4 times, is there any method to simplify? + if(NSPIN==4) + { + for(int is=1;is<4;is++) + { + for(int ir=0; ir ***wfc) +{ + TITLE("ELEC_evolve","eveolve_psi"); + timer::tick("ELEC_evolve","evolve_psi",'E'); + + int start_spin = -1; + uhm.GK.reset_spin(start_spin); + uhm.GK.allocate_pvpR(); + + // pool parallization in future -- mohan note 2021-02-09 + for(int ik=0; ik for a new spin. + //-------------------------------------------- + if(CURRENT_SPIN == uhm.GK.get_spin() ) + { + //ofs_running << " Same spin, same vlocal integration." << endl; + } + else + { + uhm.GK.reset_spin( CURRENT_SPIN ); + + // vlocal = Vh[rho] + Vxc[rho] + Vl(pseudo) + uhm.GK.cal_vlocal_k(pot.vr_eff1,GridT); + // added by zhengdy-soc, for non-collinear case + // integral 4 times, is there any method to simplify? + if(NSPIN==4) + { + for(int is=1;is<4;is++) + { + for(int ir=0; ir= 1) diago = false; + if(diago) + { + timer::tick("Efficience","diago_k"); + Diago_LCAO_Matrix DLM; + DLM.solve_complex_matrix(ik, LOWF.WFC_K[ik], LOC.wfc_dm_2d.wfc_k[ik]); + timer::tick("Efficience","diago_k"); + } + else + { + timer::tick("Efficience","evolve_k"); + Evolve_LCAO_Matrix ELM; + ELM.evolve_complex_matrix(ik, LOWF.WFC_K[ik], wfc[ik]); + timer::tick("Efficience","evolve_k"); + } + } // end k + + // LiuXh modify 2019-07-15*/ + if(!ParaO.out_hsR) + { + uhm.GK.destroy_pvpR(); + } + + timer::tick("ELEC_evolve","evolve_psi",'E'); + return; +} + diff --git a/ABACUS.develop/source/src_lcao/ELEC_evolve.h b/ABACUS.develop/source/src_lcao/ELEC_evolve.h new file mode 100644 index 0000000000..05043833fe --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ELEC_evolve.h @@ -0,0 +1,31 @@ +#ifndef ELEC_EVOLVE_H +#define ELEC_EVOLVE_H + +#include "../src_pw/tools.h" +#include "LCAO_hamilt.h" + +//----------------------------------------------------------- +// mohan add 2021-02-09 +// This class is used to evolve the electronic wave functions +// in TDDFT in terms of the multiple k points +// k is the index for the points in the first Brillouin zone +//----------------------------------------------------------- + +class ELEC_evolve +{ + + friend class ELEC_scf; + + public: + + ELEC_evolve(); + ~ELEC_evolve(); + + private: + + static void evolve_psi(const int &istep, LCAO_Hamilt &uhm, complex*** wfc); + + +}; + +#endif diff --git a/ABACUS.develop/source/src_lcao/ELEC_nscf.cpp b/ABACUS.develop/source/src_lcao/ELEC_nscf.cpp new file mode 100644 index 0000000000..b37d8434d7 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ELEC_nscf.cpp @@ -0,0 +1,95 @@ +#include "ELEC_nscf.h" +#include "../src_pw/global.h" +#include "../src_ri/exx_abfs.h" +#include "../src_ri/exx_opt_orb.h" +#include "global_fp.h" +#include "ELEC_cbands_gamma.h" +#include "ELEC_cbands_k.h" +#include "../src_io/berryphase.h" +#include "../src_io/to_wannier90.h" + +ELEC_nscf::ELEC_nscf(){} +ELEC_nscf::~ELEC_nscf(){} + +void ELEC_nscf::nscf(LCAO_Hamilt &uhm) +{ + TITLE("ELEC_nscf","nscf"); + + cout << " NON-SELF CONSISTENT CALCULATIONS" << endl; + + time_t time_start= std::time(NULL); + + // Peize Lin add 2018-08-14 + switch(exx_lcao.info.hybrid_type) + { + case Exx_Global::Hybrid_Type::HF: + case Exx_Global::Hybrid_Type::PBE0: + case Exx_Global::Hybrid_Type::HSE: + exx_lcao.cal_exx_elec_nscf(); + break; + } + + // mohan add 2021-02-09 + // in LOOP_ions, istep starts from 1, + // then when the istep is a variable of scf or nscf, + // istep becomes istep-1, this should be fixed in future + int istep=0; + if(GAMMA_ONLY_LOCAL) + { + ELEC_cbands_gamma::cal_bands(istep, uhm); + } + else + { + ELEC_cbands_k::cal_bands(istep, uhm); + } + + time_t time_finish=std::time(NULL); + OUT_TIME("cal_bands",time_start, time_finish); + + ofs_running << " end of band structure calculation " << endl; + ofs_running << " band eigenvalue in this processor (eV) :" << endl; + + for (int ik = 0; ik < kv.nks; ik++) + { + if (NSPIN==2) + { + if (ik==0) + { + ofs_running << " spin up :" << endl; + } + if (ik==( kv.nks / 2)) + { + ofs_running << " spin down :" << endl; + } + } + + ofs_running << " k-points" + << ik+1 << "(" << kv.nkstot << "): " + << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y << " " << kv.kvec_c[ik].z << endl; + + for (int ib = 0; ib < NBANDS; ib++) + { + ofs_running << " spin" << kv.isk[ik]+1 + << "final_state " << ib+1 << " " + << wf.ekb[ik][ib] * Ry_to_eV + << " " << wf.wg(ik, ib)*kv.nks << endl; + } + ofs_running << endl; + } + + // add by jingan in 2018.11.7 + if(CALCULATION == "nscf" && INPUT.towannier90) + { + toWannier90 myWannier(kv.nkstot,ucell.G); + myWannier.init_wannier(); + } + + // add by jingan + if (berryphase::berry_phase_flag && Symmetry::symm_flag == 0) + { + berryphase bp; + bp.Macroscopic_polarization(); + } + + return; +} diff --git a/ABACUS.develop/source/src_lcao/ELEC_nscf.h b/ABACUS.develop/source/src_lcao/ELEC_nscf.h new file mode 100644 index 0000000000..711c2a6f4f --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ELEC_nscf.h @@ -0,0 +1,32 @@ +#ifndef ELEC_NSCF_H +#define ELEC_NSCF_H + +#include "../src_pw/tools.h" +#include "LCAO_hamilt.h" + +//----------------------------------------------------------- +// mohan add 2021-02-09 +// This class is used to run non-self-consistent calculations +// to solve the Kohn-Sham equation by reading in electron +// charge density +//----------------------------------------------------------- + +class ELEC_nscf +{ + + friend class LOOP_ions; + friend class LOOP_elec; + + public: + + ELEC_nscf(); + ~ELEC_nscf(); + + private: + + static void nscf(LCAO_Hamilt &uhm); + + +}; + +#endif diff --git a/ABACUS.develop/source/src_lcao/ELEC_scf.cpp b/ABACUS.develop/source/src_lcao/ELEC_scf.cpp new file mode 100644 index 0000000000..b65d190f66 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ELEC_scf.cpp @@ -0,0 +1,609 @@ +#include "ELEC_scf.h" +#include "src_pw/global.h" +#include "src_io/chi0_hilbert.h" +#include "src_pw/symmetry_rho.h" +#include "dftu.h" +#include "LCAO_evolve.h" +#include "ELEC_cbands_k.h" +#include "ELEC_cbands_gamma.h" +#include "ELEC_evolve.h" +#include "input_update.h" +#include "src_pw/occupy.h" +//new +#include "src_pw/H_Ewald_pw.h" + +ELEC_scf::ELEC_scf(){} +ELEC_scf::~ELEC_scf(){} + +int ELEC_scf::iter=0; + +void ELEC_scf::scf(const int &istep) +{ + TITLE("ELEC_scf","scf"); + timer::tick("ELEC_scf","scf",'D'); + + // (1) calculate ewald energy. + // mohan update 2021-02-25 + H_Ewald_pw::compute_ewald(ucell,pw); + + // mohan add 2012-02-08 + set_ethr(); + + // the electron charge density should be symmetrized, + // here is the initialization + Symmetry_rho srho; + for(int is=0; isupdate_ethr(iter); + if(FINAL_SCF && iter==1) + { + init_mixstep_final_scf(); + //CHR.irstep=0; + //CHR.idstep=0; + //CHR.totstep=0; + } + + // mohan update 2012-06-05 + en.calculate_harris(1); + + // mohan move it outside 2011-01-13 + // first need to calculate the weight according to + // electrons number. + // mohan add iter > 1 on 2011-04-02 + // because the en.ekb has not value now. + // so the smearing can not be done. + if(iter>1)Occupy::calculate_weights(); + + if(wf.start_wfc == "file") + { + if(iter==1) + { + cout << " WAVEFUN -> CHARGE " << endl; + + // The occupation should be read in together. + // Occupy::calculate_weights(); //mohan add 2012-02-15 + + // calculate the density matrix using read in wave functions + // and the ncalculate the charge density on grid. + LOC.sum_bands(); + // calculate the local potential(rho) again. + // the grid integration will do in later grid integration. + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // a puzzle remains here. + // if I don't renew potential, + // The dr2 is very small. + // OneElectron, Hartree and + // Exc energy are all correct + // except the band energy. + // + // solved by mohan 2010-09-10 + // there are there rho here: + // rho1: formed by read in orbitals. + // rho2: atomic rho, used to construct H + // rho3: generated by after diagonalize + // here converged because rho3 and rho1 + // are very close. + // so be careful here, make sure + // rho1 and rho2 are the same rho. + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + pot.v_of_rho(CHR.rho, pot.vr); + en.delta_escf(); + if (vext == 0) + { + pot.set_vr_eff(); + } + else + { + pot.set_vrs_tddft(istep); + } + } + } + + // fuxiang add 2016-11-1 + // need reconstruction in near future -- mohan 2021-02-09 + // the initialization of wave functions should be moved to + // somewhere else + if(tddft==1 && iter == 1) + { + this->WFC_init = new complex**[kv.nks]; + for(int ik=0; ikWFC_init[ik] = new complex*[NBANDS]; + } + for(int ik=0; ikWFC_init[ik][ib] = new complex[NLOCAL]; + } + } + if(istep>=1) + { + for (int ik=0; ik(0.0,0.0); + } + } + } + } + } + + // calculate exact-exchange + switch(xcf.iexch_now) // Peize Lin add 2018-10-30 + { + case 5: case 6: case 9: + if( !exx_global.info.separate_loop ) + { + exx_lcao.cal_exx_elec(); + } + break; + } + + if(INPUT.dft_plus_u) + { + dftu.cal_slater_UJ(istep, iter); // Calculate U and J if Yukawa potential is used + } + + // (1) calculate the bands. + // mohan add 2021-02-09 + if(GAMMA_ONLY_LOCAL) + { + ELEC_cbands_gamma::cal_bands(istep, UHM); + } + else + { + if(tddft) + { + ELEC_evolve::evolve_psi(istep, UHM, this->WFC_init); + } + else + { + ELEC_cbands_k::cal_bands(istep, UHM); + } + } + + +// for(int ib=0; ibLOWF.init_Cij( 0 ); // check the orthogonality of local orbital. + // CHR.sum_band(); use local orbital in plane wave basis to calculate bands. + // but must has evc first! + //------------------------------------------------------------------------- + + // (7) calculate delta energy + en.deband = en.delta_e(); + + // (8) Mix charge density + CHR.mix_rho(dr2,0,DRHO2,iter,conv_elec); + + // Peize Lin add 2020.04.04 + if(restart.info_save.save_charge) + { + for(int is=0; is*** WFC_init; + + void init_mixstep_final_scf(void); + +}; + +#endif diff --git a/ABACUS.develop/source/src_lcao/FORCE_STRESS.cpp b/ABACUS.develop/source/src_lcao/FORCE_STRESS.cpp new file mode 100644 index 0000000000..770a3d4bf9 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/FORCE_STRESS.cpp @@ -0,0 +1,745 @@ +#include "FORCE_STRESS.h" +#include "../src_pw/global.h" +#include "../src_pw/potential_libxc.h" +#include "./dftu.h" //Quxin add for DFT+U on 20201029 +// new +#include "../src_pw/H_XC_pw.h" +#include "src_pw/vdwd2.h" + +double Force_Stress_LCAO::force_invalid_threshold_ev = 0.00; +double Force_Stress_LCAO::output_acc = 1.0e-8; + +Force_Stress_LCAO::Force_Stress_LCAO (){} +Force_Stress_LCAO::~Force_Stress_LCAO (){} + + +void Force_Stress_LCAO::allocate(void) +{ + TITLE("Force_Stress_LCAO","allocate"); + + // reduce memory occupy by vlocal + delete[] ParaO.sender_local_index; + delete[] ParaO.sender_size_process; + delete[] ParaO.sender_displacement_process; + delete[] ParaO.receiver_global_index; + delete[] ParaO.receiver_size_process; + delete[] ParaO.receiver_displacement_process; + + ParaO.sender_local_index = new int[1]; + ParaO.sender_size_process = new int[1]; + ParaO.sender_displacement_process = new int[1]; + ParaO.receiver_global_index = new int[1]; + ParaO.receiver_size_process = new int[1]; + ParaO.receiver_displacement_process = new int[1]; + + return; +} + + +#include "../src_pw/efield.h" +void Force_Stress_LCAO::getForceStress( + const bool isforce, + const bool isstress, + const bool istestf, + const bool istests, + matrix &fcs, + matrix &scs) +{ + TITLE("Force_Stress_LCAO","getForceStress"); + timer::tick("Force_Stress_LCAO","getForceStress",'E'); + + if(!isforce&&!isstress) return; + + const int nat = ucell.nat; + + //total force : matrix fcs; + + // part of total force + matrix foverlap; + matrix ftvnl_dphi; + matrix fvnl_dbeta; + matrix fvl_dphi; + matrix fvl_dvl; + matrix fewalds; + matrix fcc; + matrix fscc; + + fvl_dphi.create (nat, 3);//must do it now, update it later, noted by zhengdy + + if(isforce) + { + fcs.create (nat, 3); + foverlap.create (nat, 3); + ftvnl_dphi.create (nat, 3); + fvnl_dbeta.create (nat, 3); + fvl_dvl.create (nat, 3); + fewalds.create (nat, 3); + fcc.create (nat, 3); + fscc.create (nat, 3); + //calculate basic terms in Force, same method with PW base + this->calForcePwPart(fvl_dvl, fewalds, fcc, fscc); + } + + //total stress : matrix scs + matrix sigmacc; + matrix sigmadvl; + matrix sigmaewa; + matrix sigmaxc; + matrix sigmahar; + matrix soverlap; + matrix stvnl_dphi; + matrix svnl_dbeta; + matrix svl_dphi; + + if(isstress) + { + scs.create(3,3); + sigmacc.create(3,3); + sigmadvl.create(3,3); + sigmaewa.create(3,3); + sigmaxc.create(3,3); + sigmahar.create(3,3); + + soverlap.create(3,3); + stvnl_dphi.create(3,3); + svnl_dbeta.create(3,3); + svl_dphi.create(3,3); + //calculate basic terms in Stress, similar method with PW base + this->calStressPwPart( + sigmadvl, + sigmahar, + sigmaewa, + sigmacc, + sigmaxc); + } + + //-------------------------------------------------------- + // implement four terms which needs integration + //-------------------------------------------------------- + this->calForceStressIntegralPart( + GAMMA_ONLY_LOCAL, + isforce, + isstress, + foverlap, + ftvnl_dphi, + fvnl_dbeta, + fvl_dphi, + soverlap, + stvnl_dphi, + svnl_dbeta, + svl_dphi); + + //implement vdw force or stress here + // Peize Lin add 2014-04-04, update 2021-03-09 + matrix force_vdw; + matrix stress_vdw; + if(vdwd2_para.flag_vdwd2) + { + if(isforce) + { + force_vdw.create(nat,3); + Vdwd2 vdwd2(ucell,vdwd2_para); + vdwd2.cal_force(); + for(int iat=0; iatforceSymmetry(fcs); + } + + // print Rydberg force or not + bool ry = false; + if(istestf) + { + // test + //matrix fvlocal; + //fvlocal.create(nat,3); + matrix ftvnl; + ftvnl.create(nat, 3); + for (int iat = 0; iat < nat; iat++) + { + for(int i=0; i<3; i++) + { + //fvlocal(iat,i) = fvl_dphi(iat,i) + fvl_dvl(iat,i); + ftvnl(iat,i) = ftvnl_dphi(iat,i) + fvnl_dbeta(iat,i); + } + } + + ofs_running << "\n PARTS OF FORCE: " << endl; + ofs_running << setiosflags(ios::showpos); + ofs_running << setiosflags(ios::fixed) << setprecision(8) << endl; + //----------------------------- + //regular force terms test. + //----------------------------- + this->print_force("OVERLAP FORCE",foverlap,1,ry); + // this->print_force("TVNL_DPHI force",ftvnl_dphi,TEST_FORCE); + // this->print_force("VNL_DBETA force",fvnl_dbeta,TEST_FORCE); + this->print_force("T_VNL FORCE",ftvnl,1,ry); + this->print_force("VL_dPHI FORCE",fvl_dphi,1,ry); + this->print_force("VL_dVL FORCE",fvl_dvl,1,ry); + // this->print_force("VLOCAL FORCE",fvlocal,TEST_FORCE); + this->print_force("EWALD FORCE",fewalds,1,ry); + this->print_force("NLCC FORCE",fcc,1,ry); + this->print_force("SCC FORCE",fscc,1,ry); + //------------------------------- + //put extra force here for test! + //------------------------------- + if(EFIELD) + { + this->print_force("EFIELD FORCE",fefield,1,ry); + } + if(vdwd2_para.flag_vdwd2||vdwd3.vdwD3) + { + this->print_force("VDW FORCE",force_vdw,1,ry); + } + } + + ofs_running << setiosflags(ios::left); + + this->printforce_total(ry, istestf, fcs); + if(istestf) + { + ofs_running << "\n FORCE INVALID TABLE." << endl; + ofs_running << " " << setw(8) << "atom" << setw(5) << "x" << setw(5) << "y" << setw(5) << "z" << endl; + for(int iat=0; iatoutput_acc) ofs_running << setw(15) << f(iat,0)*fac; + else ofs_running << setw(15) << "0"; + if( abs(f(iat,1)) >output_acc) ofs_running << setw(15) << f(iat,1)*fac; + else ofs_running << setw(15) << "0"; + if( abs(f(iat,2)) >output_acc) ofs_running << setw(15) << f(iat,2)*fac; + else ofs_running << setw(15) << "0"; + ofs_running << endl; + + if(screen) + { + cout << " " << setw(8) << ss.str(); + if( abs(f(iat,0)) >output_acc) cout << setw(15) << f(iat,0)*fac; + else cout << setw(15) << "0"; + if( abs(f(iat,1)) >output_acc) cout << setw(15) << f(iat,1)*fac; + else cout << setw(15) << "0"; + if( abs(f(iat,2)) >output_acc) cout << setw(15) << f(iat,2)*fac; + else cout << setw(15) << "0"; + cout << endl; + } + + iat++; + } + } + + + cout << resetiosflags(ios::showpos); + + return; +} + + +void Force_Stress_LCAO::printforce_total (const bool ry, const bool istestf, matrix& fcs) +{ + TITLE("Force_Stress_LCAO","printforce_total"); + double unit_transform = 1; + + if(!ry) + { + unit_transform = Ry_to_eV / 0.529177; + } +// cout.setf(ios::fixed); + + int iat=0; + + //ofs_running << setiosflags(ios::right); + ofs_running << setprecision(6) << setiosflags(ios::showpos) << setiosflags(ios::fixed) << endl; + NEW_PART("TOTAL-FORCE (eV/Angstrom)"); + + // print out forces + if(INPUT.force_set == 1) + { + ofstream ofs("FORCE.dat"); + if(!ofs) + { + cout << "open FORCE.dat error !" <allocate_gamma(); + + // calculate the 'energy density matrix' here. + this->cal_foverlap(isforce, isstress, foverlap, soverlap); + + if(NEW_DM>0) + { + this->cal_ftvnl_dphi(LOC.wfc_dm_2d.dm_gamma, isforce, isstress, ftvnl_dphi, stvnl_dphi); + this->cal_fvnl_dbeta(LOC.wfc_dm_2d.dm_gamma, isforce, isstress, fvnl_dbeta, svnl_dbeta); + this->cal_fvl_dphi(LOC.wfc_dm_2d.dm_gamma, isforce, isstress, fvl_dphi, svl_dphi); + + //quxin added for DFT+U + if(INPUT.dft_plus_u) + { + dftu.force_stress(); + dftu.erase_force_stress(); + } + } + else + { + timer::tick("Force_LCAO_gamma","cal_dm_grid",'G'); + // calculate the 'density matrix' here. + matrix dm2d; + dm2d.create(NSPIN, ParaO.nloc); + Memory::record ("Force_LCAO_gamma", "dm2d", ParaO.nloc*NSPIN, "double"); + + bool with_energy = false; + + this->set_EDM_gamma(dm2d, with_energy); + + timer::tick("Force_LCAO_gamma","cal_dm_grid",'G'); + + this->cal_ftvnl_dphi(dm2d, isforce, isstress, ftvnl_dphi, stvnl_dphi); + this->cal_fvnl_dbeta(dm2d, isforce, isstress, fvnl_dbeta, svnl_dbeta); + + //quxin added for DFT+U + if(INPUT.dft_plus_u) + { + dftu.force_stress(); + dftu.erase_force_stress(); + } + + // calculate < dphi | V | phi > on real space grid. + this->cal_fvl_dphi(dm2d, isforce, isstress, fvl_dphi, svl_dphi); + + } + if(isforce) + { + Parallel_Reduce::reduce_double_pool( foverlap.c, foverlap.nr * foverlap.nc); + Parallel_Reduce::reduce_double_pool( ftvnl_dphi.c, ftvnl_dphi.nr * ftvnl_dphi.nc); + Parallel_Reduce::reduce_double_pool( fvnl_dbeta.c, fvnl_dbeta.nr * fvnl_dbeta.nc); + Parallel_Reduce::reduce_double_pool( fvl_dphi.c, fvl_dphi.nr * fvl_dphi.nc); + } + if(isstress) + { + Parallel_Reduce::reduce_double_pool( soverlap.c, soverlap.nr * soverlap.nc); + Parallel_Reduce::reduce_double_pool( stvnl_dphi.c, stvnl_dphi.nr * stvnl_dphi.nc); + Parallel_Reduce::reduce_double_pool( svnl_dbeta.c, svnl_dbeta.nr * svnl_dbeta.nc); + Parallel_Reduce::reduce_double_pool( svl_dphi.c, svl_dphi.nr * svl_dphi.nc); + } + + // delete DSloc_x, DSloc_y, DSloc_z + // delete DHloc_fixed_x, DHloc_fixed_y, DHloc_fixed_z + this->finish_ftable_gamma(); + + timer::tick("Force_LCAO_gamma","ftable_gamma",'F'); + return; +} + +void Force_LCAO_gamma::allocate_gamma(void) +{ + TITLE("Force_LCAO_gamma","allocate_gamma"); + timer::tick("Force_LCAO_gamma","allocate_gamma",'G'); + + // need to calculate the derivative in build_ST_new + bool cal_deri = true; + + //calculate dS in LCAO + //liaochen add on 2010/7/12 + //save the results in dense matrix by now. + //ParaO.nloc: number of H elements in this proc. + LM.DSloc_x = new double [ParaO.nloc]; + LM.DSloc_y = new double [ParaO.nloc]; + LM.DSloc_z = new double [ParaO.nloc]; + ZEROS(LM.DSloc_x, ParaO.nloc); + ZEROS(LM.DSloc_y, ParaO.nloc); + ZEROS(LM.DSloc_z, ParaO.nloc); + //allocate stress part in gamma_only-line, added by zhengdy-stress + if(STRESS) + { + LM.DSloc_11 = new double [ParaO.nloc]; + LM.DSloc_12 = new double [ParaO.nloc]; + LM.DSloc_13 = new double [ParaO.nloc]; + LM.DSloc_22 = new double [ParaO.nloc]; + LM.DSloc_23 = new double [ParaO.nloc]; + LM.DSloc_33 = new double [ParaO.nloc]; + ZEROS(LM.DSloc_11, ParaO.nloc); + ZEROS(LM.DSloc_12, ParaO.nloc); + ZEROS(LM.DSloc_13, ParaO.nloc); + ZEROS(LM.DSloc_22, ParaO.nloc); + ZEROS(LM.DSloc_23, ParaO.nloc); + ZEROS(LM.DSloc_33, ParaO.nloc); + LM.DHloc_fixed_11 = new double [ParaO.nloc]; + LM.DHloc_fixed_12 = new double [ParaO.nloc]; + LM.DHloc_fixed_13 = new double [ParaO.nloc]; + LM.DHloc_fixed_22 = new double [ParaO.nloc]; + LM.DHloc_fixed_23 = new double [ParaO.nloc]; + LM.DHloc_fixed_33 = new double [ParaO.nloc]; + ZEROS (LM.DHloc_fixed_11, ParaO.nloc); + ZEROS (LM.DHloc_fixed_12, ParaO.nloc); + ZEROS (LM.DHloc_fixed_13, ParaO.nloc); + ZEROS (LM.DHloc_fixed_22, ParaO.nloc); + ZEROS (LM.DHloc_fixed_23, ParaO.nloc); + ZEROS (LM.DHloc_fixed_33, ParaO.nloc); + } + //calculate dS in LCAO basis + // tips: build_ST_new --> ParaO.set_force + //timer::tick("Force_LCAO_gamma","build_S_new",'H'); + UHM.genH.build_ST_new ('S', cal_deri); + //timer::tick("Force_LCAO_gamma","build_S_new",'H'); + + Memory::record("force_lo", "dS", ParaO.nloc*3, "double"); + + //calculate dT in LCAP + //allocation dt + //liaochen add on 2010/7/12 + LM.DHloc_fixed_x = new double [ParaO.nloc]; + LM.DHloc_fixed_y = new double [ParaO.nloc]; + LM.DHloc_fixed_z = new double [ParaO.nloc]; + ZEROS (LM.DHloc_fixed_x, ParaO.nloc); + ZEROS (LM.DHloc_fixed_y, ParaO.nloc); + ZEROS (LM.DHloc_fixed_z, ParaO.nloc); + + //calculate dT + //calculate T + VNL(P1) in LCAO basis + //timer::tick("Force_LCAO_gamma","build_T_new",'H'); + UHM.genH.build_ST_new ('T', cal_deri); + //timer::tick("Force_LCAO_gamma","build_T_new",'H'); + //test_gamma(LM.DHloc_fixed_x, "dHloc_fixed_x T part"); + + //UHM.genH.build_Nonlocal_beta (cal_deri); + //timer::tick("Force_LCAO_gamma","build_Nonlocal_mu",'H'); + UHM.genH.build_Nonlocal_mu (cal_deri); + //timer::tick("Force_LCAO_gamma","build_Nonlocal_mu",'H'); + //test_gamma(LM.DHloc_fixed_x, "dHloc_fixed_x Vnl part"); + + Memory::record("force_lo", "dTVNL", ParaO.nloc*3, "double"); + + timer::tick("Force_LCAO_gamma","allocate_gamma",'G'); + return; +} + +void Force_LCAO_gamma::finish_ftable_gamma(void) +{ + delete [] LM.DSloc_x; + delete [] LM.DSloc_y; + delete [] LM.DSloc_z; + delete [] LM.DHloc_fixed_x; + delete [] LM.DHloc_fixed_y; + delete [] LM.DHloc_fixed_z; + if(STRESS)//added by zhengdy-stress + { + delete [] LM.DSloc_11; + delete [] LM.DSloc_12; + delete [] LM.DSloc_13; + delete [] LM.DHloc_fixed_11; + delete [] LM.DHloc_fixed_12; + delete [] LM.DHloc_fixed_13; + delete [] LM.DSloc_22; + delete [] LM.DSloc_23; + delete [] LM.DSloc_33; + delete [] LM.DHloc_fixed_22; + delete [] LM.DHloc_fixed_23; + delete [] LM.DHloc_fixed_33; + } + return; +} + + +void Force_LCAO_gamma::DerivT_PW(void) +{ + WARNING_QUIT("Force_LCAO_gamma::DerivT_PW","no use for a long time."); + /* + //------------------------------------------ + //TEST OUTPUT OF S Deriv Matrix in PW + //------------------------------------------ + //test under pw basis + hm.hon.genH.ForcedT = new matrix[3]; + this->dt = hm.hon.genH.ForcedT; + for (int i = 0; i < 3; i++) this->dt[i].create (NLOCAL, NLOCAL); + + hm.hon.genH.build_ST (1, 'T', true); + + cout << "\n===========================================================================" << endl; + out.printrm("Force_LCAO_gamma, X Directional Derivatives of T Matrix in PW", this->dt[0]); + cout << "\n===========================================================================" << endl; + + for (int i = 0; i < 3; i++) this->dt[i].freemem (); + delete[] this->dt; + */ + return; +} + + +void Force_LCAO_gamma::test_gamma(double* mm, const string &name) +{ + cout << "\n PRINT " << name << endl; + cout << setprecision(6) << endl; + for(int i=0; i1.0e-5) + { + cout << setw(12) << mm[i*NLOCAL+j]; + } + else + { + cout << setw(12) << "0"; + } + } + cout << endl; + } + return; +} diff --git a/ABACUS.develop/source/src_lcao/FORCE_gamma.h b/ABACUS.develop/source/src_lcao/FORCE_gamma.h new file mode 100644 index 0000000000..4e57209567 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/FORCE_gamma.h @@ -0,0 +1,108 @@ +#ifndef FORCE_LCAO_GAMMA_H +#define FORCE_LCAO_GAMMA_H + +#include "../src_pw/tools.h" +#include "LCAO_matrix.h" + +class Force_LCAO_gamma +{ + public : + + friend class Force_Stress_LCAO; + + Force_LCAO_gamma (); + ~Force_LCAO_gamma (); + + private: + + //orthonormal force + contribution from T and VNL + void ftable_gamma ( + const bool isforce, + const bool isstress, + matrix& foverlap, + matrix& ftvnl_dphi, + matrix& fvnl_dbeta, + matrix& fvl_dphi, + matrix& soverlap, + matrix& stvnl_dphi, + matrix& svnl_dbeta, + matrix& svl_dphi + ); + + // get the ds, dt, dvnl. + void allocate_gamma(void); + + void finish_ftable_gamma(void); + + void DerivT_PW (void); + + void average_force(double* fm); + + void test_gamma(double* mm, const string &name); + + + //------------------------------------------------------------- + // forces reated to overlap matrix + // forces related to energy density matrix + //------------------------------------------------------------- + void set_EDM_gamma(matrix& dm, bool with_energy); + + double set_EDM_element(const int &ii, const int &jj, const bool with_energy, + double*** coef1, double*** coef2, const int &is); + + void cal_foverlap( + const bool isforce, + const bool isstress, + matrix& foverlap, + matrix& soverlap); + + //------------------------------------------------------------- + // forces related to kinetic and non-local pseudopotentials + //-------------------------------------------------------------- + void cal_ftvnl_dphi( + matrix& dm2d, + const bool isforce, + const bool isstress, + matrix& ftvnl_dphi, + matrix& stvnl_dphi); + + void cal_ftvnl_dphi( + const std::vector &dm2d, + const bool isforce, + const bool isstress, + matrix& ftvnl_dphi, + matrix& stvnl_dphi); + + void cal_fvnl_dbeta( + matrix& dm2d, + const bool isforce, + const bool isstress, + matrix& fvnl_dbeta, + matrix& svnl_dbeta); + + void cal_fvnl_dbeta( + const std::vector &dm2d, + const bool isforce, + const bool isstress, + matrix& fvnl_dbeta, + matrix& svnl_dbeta); + + //------------------------------------------- + // forces related to local pseudopotentials + //------------------------------------------- + void cal_fvl_dphi( + matrix& dm2d, + const bool isforce, + const bool isstress, + matrix& fvl_dphi, + matrix& svl_dphi); + + void cal_fvl_dphi( + const std::vector &dm2d, + const bool isforce, + const bool isstress, + matrix& fvl_dphi, + matrix& svl_dphi); + +}; +#endif diff --git a/ABACUS.develop/source/src_lcao/FORCE_gamma_edm.cpp b/ABACUS.develop/source/src_lcao/FORCE_gamma_edm.cpp new file mode 100644 index 0000000000..e82c9e9e1c --- /dev/null +++ b/ABACUS.develop/source/src_lcao/FORCE_gamma_edm.cpp @@ -0,0 +1,794 @@ +#include "FORCE_gamma.h" +#include "../src_pw/global.h" + +double Force_LCAO_gamma::set_EDM_element( + const int &ii, const int &jj, + const bool with_energy, + double*** coef1, double*** coef2, const int &is) +{ + double ene = 0.0; + for (int ib = 0; ib < NBANDS; ib++) + { + const double w1 = wf.wg(is,ib); + if(w1>0.0) + { + if(with_energy) + { + ene += w1 * wf.ekb[is][ib] * coef1[is][ib][ii] * coef2[is][ib][jj]; + } + else + { + ene += w1 * coef1[is][ib][ii] * coef2[is][ib][jj]; + } + } + } + return ene; +} + +//#include "../src_develop/src_siao/selinv.h" +void Force_LCAO_gamma::set_EDM_gamma(matrix& dm, bool with_energy) +{ + TITLE("Force_LCAO_gamma","set_EDM_gamma"); + timer::tick("Force_LCAO_gamma","set_EDM"); + +#ifdef __SELINV +//xiaohui modified 2013-03-23, adding "/*" +/* if(DIAGO_TYPE=="selinv") + { +// cout << " set_EDM_gamma()" << endl; +// cout << " fill dm with density matrix or energy density matrix here." << endl; + + //-------------------------------------------------- + // job=1: density matrix for charge density (grid). + // job=2: density matrix for force (dm2d). + // job=3: energy density matrix for force (dm2d). + //-------------------------------------------------- + const int ik = 0; + int job = 0; + if(with_energy) + { + job=3; + } + else + { + job=2; + } + Selinv::dm_ptr = dm; + Selinv::using_SELINV(ik, job, LM.Hloc, LM.Sloc); + + return; + } +*/ +#endif + //xiaohui add 2015-03-24, like density matrix calculation +#ifdef __MPI //2015-09-06, xiaohui + int nprocs,myid; + MPI_Status status; + MPI_Comm_size(DIAG_HPSEPS_WORLD,&nprocs); + MPI_Comm_rank(DIAG_HPSEPS_WORLD,&myid); + + int local_band=NBANDS/DSIZE; + if (DRANK= NBANDS) + { + lastband_in_proc = i; + lastband_number = NBANDS - (count_bands - local_bands[i]); + break; + } + } + + for(int ispin=0;ispin= 1) + { + double** ZW_300; + ZW_300 = new double*[NSPIN]; + for(int is=0; is= 0 && col_nu >= 0) + { + int index = row_mu * ParaO.ncol + col_nu; + //dm[index] = rho_300[ispin][i_col + i_row*300]; + dm(ispin, index) = rho_300[ispin][i_row + i_col*300]; + } + } + } + } + for(int is=0; is= 0 && col_nu >= 0) + { + int index = row_mu * ParaO.ncol + col_nu; + //dm[index] = rho_300_remain[ispin][i_col + i_row*col_remain]; + dm(ispin, index) = rho_300_remain[ispin][i_row + i_col*300]; + } + } + } + } + for(int is=0; is= 0 && col_nu >= 0) + { + int index = row_mu * ParaO.ncol + col_nu; + dm(ispin, index) = rho_remain_300[ispin][i_row + i_col*row_remain]; + } + } + } + } + for(int is=0; is= 0 && col_nu >= 0) + { + int index = row_mu * ParaO.ncol + col_nu; + dm(ispin, index) = rho_remain_remain[ispin][i_row + i_col*row_remain]; + } + } + } + } + for(int is=0; is= 0 && col_nu >= 0) + { + int index = row_mu * ParaO.ncol + col_nu; + dm(ispin, index) = rho_NLOCAL_NLOCAL[ispin][i_col + i_row*NLOCAL]; + } + } + } + } + for(int is=0; is=0 && jj>=0) + { + ene = this->set_EDM_element(ii, jj, with_energy, LOWF.WFC_GAMMA, LOWF.WFC_GAMMA, ispin); + } + + // (2) + else if(ii>=0 && jj<0) + { + const int a4 = LOWF.trace_aug[j]; + assert(a4>=0); + ene = this->set_EDM_element(ii, a4, with_energy, LOWF.WFC_GAMMA, LOWF.WFC_GAMMA_aug, ispin); + } + else if(ii<0 && jj>=0) + { + const int a3 = LOWF.trace_aug[i]; + assert(a3>=0); + // mohan fix serious bug 2011-07-01 (ii, a3) -> (a3, jj) !!!!!!!!!!!! + ene = this->set_EDM_element(a3, jj, with_energy, LOWF.WFC_GAMMA_aug, LOWF.WFC_GAMMA, ispin); + } + else if(ii<0 && jj<0) + { + const int a3 = LOWF.trace_aug[i]; + const int a4 = LOWF.trace_aug[j]; + assert(a3>=0); + assert(a4>=0); + ene = this->set_EDM_element(a3, a4, with_energy, LOWF.WFC_GAMMA_aug, LOWF.WFC_GAMMA_aug, ispin); + } + + dm(ispin, index) = ene; + //dm[index] = 1.0;// mohan tmp + }// end j + }// end i + }//end ispin +#endif //2015-09-06, xiaohui + timer::tick("Force_LCAO_gamma","set_EDM"); + return; +} + + +// force due to the overlap matrix. +// need energy density matrix here. +void Force_LCAO_gamma::cal_foverlap( + const bool isforce, + const bool isstress, + matrix& foverlap, + matrix& soverlap) +{ + TITLE("Force_LCAO_gamma","cal_foverlap"); + timer::tick("Force_LCAO_gamma","cal_foverlap",'G'); + + // set energy density matrix. + if(NEW_DM>0) + { + timer::tick("Force_LCAO_gamma","cal_edm_2d",'H'); + + matrix wgEkb; + wgEkb.create(NSPIN, NBANDS); + + for(int is=0; is=0 && nu>=0) + { + const int index = mu * ParaO.ncol + nu; + double sum = 0.0; + for(int is=0; isset_EDM_gamma(edm2d, with_energy); + + timer::tick("Force_LCAO_gamma","cal_edm_grid",'H'); + + //summation \sum_{i,j} E(i,j)*dS(i,j) + //BEGIN CALCULATION OF FORCE OF EACH ATOM + + for(int i=0; i= 0 && nu >= 0 ) + { + const int index = mu * ParaO.ncol + nu; + + //================================================================ + // here is the normal order, the force of each atom is calculated + // according to each 'column' in DSloc_x, y, z + // because the DSloc_x,y,z are anti-symmetry matrix. + //================================================================ + + double sum = 0.0; + for(int is=0; is= 0 && nu >= 0 ) + { + const int index = mu * ParaO.ncol + nu; + //contribution from deriv of AO's in T+VNL term + + double sum = 0.0; + for(int is=0; is tau0 = ucell.atoms[it].tau[ia]; + //find ajacent atom of atom ia + //GridD.Find_atom( ucell.atoms[it].tau[ia] ); + GridD.Find_atom( ucell.atoms[it].tau[ia] ,it, ia); + const double Rcut_Beta = ORB.Beta[it].get_rcut_max(); + + //FOLLOWING ARE CONTRIBUTIONS FROM + //VNL DUE TO PROJECTOR'S DISPLACEMENT + for (int ad1 =0 ; ad1 < GridD.getAdjacentNum()+1; ad1++) + { + const int T1 = GridD.getType (ad1); + const Atom* atom1 = &ucell.atoms[T1]; + const int I1 = GridD.getNatom (ad1); + const int start1 = ucell.itiaiw2iwt(T1, I1, 0); + const Vector3 tau1 = GridD.getAdjacentTau (ad1); + const double Rcut_AO1 = ORB.Phi[T1].getRcut(); + + for (int ad2 =0 ; ad2 < GridD.getAdjacentNum()+1; ad2++) + { + const int T2 = GridD.getType (ad2); + const Atom* atom2 = &ucell.atoms[T2]; + const int I2 = GridD.getNatom (ad2); + const int start2 = ucell.itiaiw2iwt(T2, I2, 0); + const Vector3 tau2 = GridD.getAdjacentTau (ad2); + const double Rcut_AO2 = ORB.Phi[T2].getRcut(); + + const double dist1 = (tau1-tau0).norm() * ucell.lat0; + const double dist2 = (tau2-tau0).norm() * ucell.lat0; + if(isstress) + { + r1[0] = ( tau1.x - tau0.x) ; + r1[1] = ( tau1.y - tau0.y) ; + r1[2] = ( tau1.z - tau0.z) ; + r0[0] = ( tau2.x - tau0.x) ; + r0[1] = ( tau2.y - tau0.y) ; + r0[2] = ( tau2.z - tau0.z) ; + } + + if (dist1 > Rcut_Beta + Rcut_AO1 + || dist2 > Rcut_Beta + Rcut_AO2) + { + continue; + } + + for (int jj = 0; jj < ucell.atoms[T1].nw; jj++) + { + const int iw1_all = start1 + jj; + const int mu = ParaO.trace_loc_row[iw1_all]; + if(mu<0) continue; + for (int kk = 0; kk < ucell.atoms[T2].nw; kk++) + { + const int iw2_all = start2 + kk; + const int nu = ParaO.trace_loc_col[iw2_all]; + if(nu<0) continue; + + double nlm[3] = {0,0,0}; + + UOT.snap_psibeta( + nlm, 1, + tau1, T1, + atom1->iw2l[jj], // L2 + atom1->iw2m[jj], // m2 + atom1->iw2n[jj], // N2 + tau2, T2, + atom2->iw2l[kk], // L1 + atom2->iw2m[kk], // m1 + atom2->iw2n[kk], // n1 + tau0, it); + + double nlm1[3] = {0,0,0}; + + if(isstress) + { + UOT.snap_psibeta( + nlm1, 1, + tau2, T2, + atom2->iw2l[kk], // L2 + atom2->iw2m[kk], // m2 + atom2->iw2n[kk], // N2 + tau1, T1, + atom1->iw2l[jj], // L1 + atom1->iw2m[jj], // m1 + atom1->iw2n[jj], // n1 + tau0, it); + } + + const int index = mu * ParaO.ncol + nu; + + // dbeta is minus, that's consistent. + // only one projector for each atom force. + + double sum = 0.0; + for(int is=0; is &dm2d, + const bool isforce, + const bool isstress, + matrix& ftvnl_dphi, + matrix& stvnl_dphi) +{ + TITLE("Force_LCAO_gamma","cal_ftvnl_dphi"); + timer::tick("Force_LCAO_gamma","cal_ftvnl_dphi",'G'); + + for(int i=0; i= 0 && nu >= 0 ) + { + const int index = mu * ParaO.ncol + nu; + //contribution from deriv of AO's in T+VNL term + + double sum = 0.0; + for(int is=0; is &dm2d, + const bool isforce, + const bool isstress, + matrix& fvnl_dbeta, + matrix& svnl_dbeta) +{ + TITLE("Force_LCAO_gamma","cal_fvnl_dbeta"); + timer::tick("Force_LCAO_gamma","cal_fvnl_dbeta",'G'); + + for(int iat=0; iat tau0 = ucell.atoms[it].tau[ia]; + //find ajacent atom of atom ia + //GridD.Find_atom( ucell.atoms[it].tau[ia] ); + GridD.Find_atom( ucell.atoms[it].tau[ia] ,it, ia); + + //FOLLOWING ARE CONTRIBUTIONS FROM + //VNL DUE TO PROJECTOR'S DISPLACEMENT + for (int ad1 =0 ; ad1 < GridD.getAdjacentNum()+1; ad1++) + { + const int T1 = GridD.getType (ad1); + const Atom* atom1 = &ucell.atoms[T1]; + const int I1 = GridD.getNatom (ad1); + const int start1 = ucell.itiaiw2iwt(T1, I1, 0); + const Vector3 tau1 = GridD.getAdjacentTau (ad1); + + for (int ad2 =0 ; ad2 < GridD.getAdjacentNum()+1; ad2++) + { + const int T2 = GridD.getType (ad2); + const Atom* atom2 = &ucell.atoms[T2]; + const int I2 = GridD.getNatom (ad2); + const int start2 = ucell.itiaiw2iwt(T2, I2, 0); + const Vector3 tau2 = GridD.getAdjacentTau (ad2); + + const double Rcut_Beta = ORB.Beta[it].get_rcut_max(); + const double Rcut_AO1 = ORB.Phi[T1].getRcut(); + const double Rcut_AO2 = ORB.Phi[T2].getRcut(); + + const double dist1 = (tau1-tau0).norm() * ucell.lat0; + const double dist2 = (tau2-tau0).norm() * ucell.lat0; + double r0[3]; + double r1[3]; + if(isstress) + { + r1[0] = ( tau1.x - tau0.x) ; + r1[1] = ( tau1.y - tau0.y) ; + r1[2] = ( tau1.z - tau0.z) ; + r0[0] = ( tau2.x - tau0.x) ; + r0[1] = ( tau2.y - tau0.y) ; + r0[2] = ( tau2.z - tau0.z) ; + } + + if (dist1 > Rcut_Beta + Rcut_AO1 + || dist2 > Rcut_Beta + Rcut_AO2) + { + continue; + } + + for (int jj = 0; jj < ucell.atoms[T1].nw; jj++) + { + const int iw1_all = start1 + jj; + const int mu = ParaO.trace_loc_row[iw1_all]; + if(mu<0) continue; + for (int kk = 0; kk < ucell.atoms[T2].nw; kk++) + { + const int iw2_all = start2 + kk; + const int nu = ParaO.trace_loc_col[iw2_all]; + if(nu<0) continue; + + double nlm[3] = {0,0,0}; + + UOT.snap_psibeta( + nlm, 1, + tau1, T1, + atom1->iw2l[jj], // L2 + atom1->iw2m[jj], // m2 + atom1->iw2n[jj], // N2 + tau2, T2, + atom2->iw2l[kk], // L1 + atom2->iw2m[kk], // m1 + atom2->iw2n[kk], // n1 + tau0, it); + double nlm1[3] = {0,0,0}; + if(isstress) UOT.snap_psibeta( + nlm1, 1, + tau2, T2, + atom2->iw2l[kk], // L2 + atom2->iw2m[kk], // m2 + atom2->iw2n[kk], // N2 + tau1, T1, + atom1->iw2l[jj], // L1 + atom1->iw2m[jj], // m1 + atom1->iw2n[jj], // n1 + tau0, it); + + const int index = mu * ParaO.ncol + nu; + + // dbeta is minus, that's consistent. + // only one projector for each atom force. + + double sum = 0.0; + for(int is=0; is &dm2d, + const bool isforce, + const bool isstress, + matrix& fvl_dphi, + matrix& svl_dphi) +{ + TITLE("Force_LCAO_gamma","cal_fvl_dphi"); + timer::tick("Force_LCAO_gamma","cal_fvl_dphi",'G'); + + ZEROS (LM.DHloc_fixed_x, ParaO.nloc); + ZEROS (LM.DHloc_fixed_y, ParaO.nloc); + ZEROS (LM.DHloc_fixed_z, ParaO.nloc); + if(STRESS) + { + ZEROS (LM.DHloc_fixed_11, ParaO.nloc); + ZEROS (LM.DHloc_fixed_12, ParaO.nloc); + ZEROS (LM.DHloc_fixed_13, ParaO.nloc); + ZEROS (LM.DHloc_fixed_22, ParaO.nloc); + ZEROS (LM.DHloc_fixed_23, ParaO.nloc); + ZEROS (LM.DHloc_fixed_33, ParaO.nloc); + } + + + double* tmpDHx = new double[ParaO.nloc]; + double* tmpDHy = new double[ParaO.nloc]; + double* tmpDHz = new double[ParaO.nloc]; + ZEROS( tmpDHx, ParaO.nloc ); + ZEROS( tmpDHy, ParaO.nloc ); + ZEROS( tmpDHz, ParaO.nloc ); + for(int i=0; ical_foverlap_k(); + this->cal_foverlap_k(isforce, isstress, foverlap, soverlap); // calculate the density matrix double** dm2d = new double*[NSPIN]; for(int is=0; isset_EDM_k(dm2d, with_energy); - - /* - ofs_running << " Density Matrix" << endl; - for(int i=0; ical_ftvnl_dphi_k(dm2d); + + this->cal_ftvnl_dphi_k(dm2d, isforce, isstress, ftvnl_dphi, stvnl_dphi); //Quxin add for DFT+U on 20201029 if(INPUT.dft_plus_u) @@ -57,10 +59,10 @@ void Force_LCAO_k::ftable_k (void) // --------------------------------------- // doing on the real space grid. // --------------------------------------- - this->cal_fvl_dphi_k(dm2d); + this->cal_fvl_dphi_k(dm2d, isforce, isstress, fvl_dphi, svl_dphi); + + this->cal_fvnl_dbeta_k(dm2d, isforce, isstress, fvnl_dbeta, svnl_dbeta); - this->cal_fvnl_dbeta_k(dm2d); - for(int is=0; isfoverlap[iat], 3); - Parallel_Reduce::reduce_double_pool( this->ftvnl_dphi[iat], 3); - Parallel_Reduce::reduce_double_pool( this->fvnl_dbeta[iat], 3); - Parallel_Reduce::reduce_double_pool( this->fvl_dphi[iat], 3); - } - for (int ipol=0; ipol<3; ipol++) + if(isforce) + { + Parallel_Reduce::reduce_double_pool( foverlap.c, foverlap.nr * foverlap.nc); + Parallel_Reduce::reduce_double_pool( ftvnl_dphi.c, ftvnl_dphi.nr * ftvnl_dphi.nc); + Parallel_Reduce::reduce_double_pool( fvnl_dbeta.c, fvnl_dbeta.nr * fvnl_dbeta.nc); + Parallel_Reduce::reduce_double_pool( fvl_dphi.c, fvl_dphi.nr * fvl_dphi.nc); + } + if(isstress) { - Parallel_Reduce::reduce_double_pool( this->soverlap[ipol], 3); - Parallel_Reduce::reduce_double_pool( this->stvnl_dphi[ipol], 3); - Parallel_Reduce::reduce_double_pool( this->svnl_dbeta[ipol], 3); - Parallel_Reduce::reduce_double_pool( this->svl_dphi[ipol], 3); + Parallel_Reduce::reduce_double_pool( soverlap.c, soverlap.nr * soverlap.nc); + Parallel_Reduce::reduce_double_pool( stvnl_dphi.c, stvnl_dphi.nr * stvnl_dphi.nc); + Parallel_Reduce::reduce_double_pool( svnl_dbeta.c, svnl_dbeta.nr * svnl_dbeta.nc); + Parallel_Reduce::reduce_double_pool( svl_dphi.c, svl_dphi.nr * svl_dphi.nc); } // test the force. @@ -142,7 +144,7 @@ void Force_LCAO_k::allocate_k(void) //----------------------------- // tips: build_ST_new --> ParaO.set_force bool cal_deri = true; - UHM.UOM.build_ST_new ('S', cal_deri); + UHM.genH.build_ST_new ('S', cal_deri); //----------------------------------------- // (2) allocate for @@ -157,11 +159,11 @@ void Force_LCAO_k::allocate_k(void) // calculate dT= in LCAO // calculate T + VNL(P1) in LCAO basis - UHM.UOM.build_ST_new ('T', cal_deri); + UHM.genH.build_ST_new ('T', cal_deri); //test(LM.DHloc_fixedR_x,"LM.DHloc_fixedR_x T part"); // calculate dVnl= in LCAO - UHM.UOM.build_Nonlocal_mu (cal_deri); + UHM.genH.build_Nonlocal_mu (cal_deri); //test(LM.DHloc_fixedR_x,"LM.DHloc_fixedR_x Vnl part"); timer::tick("Force_LCAO_k","allocate"); @@ -190,7 +192,7 @@ void Force_LCAO_k::finish_k(void) } #include "record_adj.h" -#include "lcao_nnr.h" +#include "LCAO_nnr.h" void Force_LCAO_k::set_EDM_k(double** dm2d, const bool with_energy) { TITLE("Force_LCAO_k","set_EDM_k"); @@ -389,7 +391,11 @@ complex Force_LCAO_k::set_EDM_k_element( } -void Force_LCAO_k::cal_foverlap_k(void) +void Force_LCAO_k::cal_foverlap_k( + const bool isforce, + const bool isstress, + matrix& foverlap, + matrix& soverlap) { TITLE("Force_LCAO_k","cal_foverlap_k"); timer::tick("Force_LCAO_k","cal_foverlap_k",'G'); @@ -419,15 +425,6 @@ void Force_LCAO_k::cal_foverlap_k(void) Record_adj RA; RA.for_2d(); - for(int iat=0; iatsoverlap[ipol], 3); - } - int irr = 0; int iat = 0; for(int T1=0; T1foverlap[iat][0] -= edm2d2 * LM.DSloc_Rx[irr]; - this->foverlap[iat][1] -= edm2d2 * LM.DSloc_Ry[irr]; - this->foverlap[iat][2] -= edm2d2 * LM.DSloc_Rz[irr]; - if(STRESS) + if(isforce) + { + foverlap(iat,0) -= edm2d2 * LM.DSloc_Rx[irr]; + foverlap(iat,1) -= edm2d2 * LM.DSloc_Ry[irr]; + foverlap(iat,2) -= edm2d2 * LM.DSloc_Rz[irr]; + } + if(isstress) { - for(int ipol = 0;ipol<3;ipol++){ - this->soverlap[0][ipol] += edm2d[is][irr] * LM.DSloc_Rx[irr] * LM.DH_r[irr * 3 + ipol]; - this->soverlap[1][ipol] += edm2d[is][irr] * LM.DSloc_Ry[irr] * LM.DH_r[irr * 3 + ipol]; - this->soverlap[2][ipol] += edm2d[is][irr] * LM.DSloc_Rz[irr] * LM.DH_r[irr * 3 + ipol]; + for(int ipol = 0;ipol<3;ipol++) + { + soverlap(0,ipol) += edm2d[is][irr] * LM.DSloc_Rx[irr] * LM.DH_r[irr * 3 + ipol]; + soverlap(1,ipol) += edm2d[is][irr] * LM.DSloc_Ry[irr] * LM.DH_r[irr * 3 + ipol]; + soverlap(2,ipol) += edm2d[is][irr] * LM.DSloc_Rz[irr] * LM.DH_r[irr * 3 + ipol]; } } } @@ -500,12 +501,12 @@ void Force_LCAO_k::cal_foverlap_k(void) setw(15) << foverlap[iat][2]*fac << endl; } */ - if(STRESS){ + if(isstress){ for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { - this->soverlap[i][j] *= ucell.lat0 / ucell.omega; + soverlap(i,j) *= ucell.lat0 / ucell.omega; } } } @@ -523,12 +524,17 @@ void Force_LCAO_k::cal_foverlap_k(void) } delete[] edm2d; -RA.delete_grid();//xiaohui add 2015-02-04 + RA.delete_grid();//xiaohui add 2015-02-04 timer::tick("Force_LCAO_k","cal_foverlap_k",'G'); return; } -void Force_LCAO_k::cal_ftvnl_dphi_k(double** dm2d) +void Force_LCAO_k::cal_ftvnl_dphi_k( + double** dm2d, + const bool isforce, + const bool isstress, + matrix& ftvnl_dphi, + matrix& stvnl_dphi) { TITLE("Force_LCAO_k","cal_ftvnl_dphi"); timer::tick("Force_LCAO_k","cal_ftvnl_dphi",'G'); @@ -539,15 +545,6 @@ void Force_LCAO_k::cal_ftvnl_dphi_k(double** dm2d) Record_adj RA; RA.for_2d(); - for(int iat=0; iatftvnl_dphi[iat], 3); - } - for(int ipol=0; ipol<3; ++ipol) - { - ZEROS( this->stvnl_dphi[ipol], 3); - } - int irr = 0; for(int T1=0; T1ftvnl_dphi[iat][0] += dm2d2 * LM.DHloc_fixedR_x[irr]; - this->ftvnl_dphi[iat][1] += dm2d2 * LM.DHloc_fixedR_y[irr]; - this->ftvnl_dphi[iat][2] += dm2d2 * LM.DHloc_fixedR_z[irr]; - if(STRESS){ - this->stvnl_dphi[0][0] -= dm2d[is][irr] * LM.stvnl11[irr]; - this->stvnl_dphi[0][1] -= dm2d[is][irr] * LM.stvnl12[irr]; - this->stvnl_dphi[0][2] -= dm2d[is][irr] * LM.stvnl13[irr]; - this->stvnl_dphi[1][1] -= dm2d[is][irr] * LM.stvnl22[irr]; - this->stvnl_dphi[1][2] -= dm2d[is][irr] * LM.stvnl23[irr]; - this->stvnl_dphi[2][2] -= dm2d[is][irr] * LM.stvnl33[irr]; - + if(isforce) + { + ftvnl_dphi(iat,0) += dm2d2 * LM.DHloc_fixedR_x[irr]; + ftvnl_dphi(iat,1) += dm2d2 * LM.DHloc_fixedR_y[irr]; + ftvnl_dphi(iat,2) += dm2d2 * LM.DHloc_fixedR_z[irr]; + } + if(isstress) + { + stvnl_dphi(0,0) -= dm2d[is][irr] * LM.stvnl11[irr]; + stvnl_dphi(0,1) -= dm2d[is][irr] * LM.stvnl12[irr]; + stvnl_dphi(0,2) -= dm2d[is][irr] * LM.stvnl13[irr]; + stvnl_dphi(1,1) -= dm2d[is][irr] * LM.stvnl22[irr]; + stvnl_dphi(1,2) -= dm2d[is][irr] * LM.stvnl23[irr]; + stvnl_dphi(2,2) -= dm2d[is][irr] * LM.stvnl33[irr]; } } ++irr; @@ -606,33 +606,18 @@ void Force_LCAO_k::cal_ftvnl_dphi_k(double** dm2d) // test(LM.DSloc_Rx); // test(dm2d[0],"dm2d"); - if(STRESS){ + if(isstress){ for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { - if(istvnl_dphi[j][i] = this->stvnl_dphi[i][j]; - } - } - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->stvnl_dphi[i][j] *= ucell.lat0 / ucell.omega; + if(i force - //-------------------------------- -// for(int iat=0; iat tau1, tau2, dtau; - Vector3 tau0, dtau1, dtau2; - - for(int ipol=0; ipol<3; ++ipol) - { - ZEROS( this->svnl_dbeta[ipol], 3); - } + Vector3 tau1; + Vector3 tau2; + Vector3 dtau; + Vector3 tau0; + Vector3 dtau1; + Vector3 dtau2; double rcut; double distance; - double rcut1, rcut2; - double distance1, distance2; + double rcut1; + double rcut2; + double distance1; + double distance2; for (int T1 = 0; T1 < ucell.ntype; ++T1) { @@ -812,7 +803,8 @@ void Force_LCAO_k::cal_fvnl_dbeta_k(double** dm2d) distance2 = dtau2.norm() * ucell.lat0; rcut2 = ORB.Phi[T2].getRcut() + ORB.Beta[T0].get_rcut_max(); - double r0[3],r1[3]; + double r0[3]; + double r1[3]; r1[0] = ( tau1.x - tau0.x) ; r1[1] = ( tau1.y - tau0.y) ; r1[2] = ( tau1.z - tau0.z) ; @@ -841,8 +833,9 @@ void Force_LCAO_k::cal_fvnl_dbeta_k(double** dm2d) ); double nlm1[3]={0,0,0}; - if(STRESS){ - UOT.snap_psibeta( + if(isstress) + { + UOT.snap_psibeta( nlm1, 1, tau1, T1, @@ -861,16 +854,18 @@ void Force_LCAO_k::cal_fvnl_dbeta_k(double** dm2d) for(int is=0; isfvnl_dbeta[iat0][0] -= dm2d2 * nlm[0]; - this->fvnl_dbeta[iat0][1] -= dm2d2 * nlm[1]; - this->fvnl_dbeta[iat0][2] -= dm2d2 * nlm[2]; - - if(STRESS) + for(int jpol=0;jpol<3;jpol++) { - for(int ipol=0;ipol<3;ipol++){ - this->svnl_dbeta[0][ipol] += dm2d[is][iir] * (nlm[0] * r1[ipol] + nlm1[0] * r0[ipol]); - this->svnl_dbeta[1][ipol] += dm2d[is][iir] * (nlm[1] * r1[ipol] + nlm1[1] * r0[ipol]); - this->svnl_dbeta[2][ipol] += dm2d[is][iir] * (nlm[2] * r1[ipol] + nlm1[2] * r0[ipol]); + if(isforce) + { + fvnl_dbeta(iat0, jpol) -= dm2d2 * nlm[jpol]; + } + if(isstress) + { + for(int ipol=0;ipol<3;ipol++) + { + svnl_dbeta(jpol, ipol) += dm2d[is][iir] * (nlm[jpol] * r1[ipol] + nlm1[jpol] * r0[ipol]); + } } } } @@ -888,12 +883,12 @@ void Force_LCAO_k::cal_fvnl_dbeta_k(double** dm2d) assert( iir == LNNR.nnr ); - if(STRESS){ + if(isstress){ for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { - this->svnl_dbeta[i][j] *= ucell.lat0 / ucell.omega; + svnl_dbeta(i,j) *= ucell.lat0 / ucell.omega; } } } @@ -902,89 +897,27 @@ void Force_LCAO_k::cal_fvnl_dbeta_k(double** dm2d) return; } -void Force_LCAO_k::force_vna_k(void) -{ - TITLE("Force_LCAO_k","force_vna_k"); - timer::tick("Force_LCAO_k","force_vna_k",'h'); - - int istep=1; - bool delta_vh=0; - bool vna=1; - - // for test - bool test_G_vna = false; - - if(test_G_vna) - { - pot.init_pot(istep, delta_vh, vna); - for(int ir=0; ir - // fvl_dphi must be set to zero before. - //----------------------------------------------------- - if(STRESS) {UHM.GK.svna_k_RealSpace(gtf, this->fvl_dphi, this->svl_dphi);} - else {UHM.GK.fvna_k_RealSpace(gtf, this->fvl_dphi);} - - timer::tick("Force_LCAO_k","force_vna_k",'h'); - return; -} // calculate the force due to < phi | Vlocal | dphi > -void Force_LCAO_k::cal_fvl_dphi_k(double** dm2d) +void Force_LCAO_k::cal_fvl_dphi_k( + double** dm2d, + const bool isforce, + const bool isstress, + matrix& fvl_dphi, + matrix& svl_dphi) { TITLE("Force_LCAO_k","cal_fvl_dphi_k"); timer::tick("Force_LCAO_k","cal_fvl_dphi_k",'G'); + if(!isforce&&!isstress) return; assert(LM.DHloc_fixedR_x!=NULL); assert(LM.DHloc_fixedR_y!=NULL); assert(LM.DHloc_fixedR_z!=NULL); - for(int iat=0; iatsvl_dphi[ipol], 3); - } - int istep = 1; - if(VNA) - { - // calculate the force contribution from Vna. - for(int is=0; is= 0 && nu >= 0 ) - { - const int index = mu * ParaO.ncol + nu; - //contribution from deriv of AO's in T+VNL term - this->fvl_dphi[iat][0] -= 2.0 * dm2d[0][index] * LM.DHloc_fixed_x[index] ; - this->fvl_dphi[iat][1] -= 2.0 * dm2d[0][index] * LM.DHloc_fixed_y[index] ; - this->fvl_dphi[iat][2] -= 2.0 * dm2d[0][index] * LM.DHloc_fixed_z[index] ; - - cout << setw(5) << iat << setw(5) << iat2 - << setw(5) << mu << setw(5) << nu - << setw(15) << LM.DHloc_fixed_z[index] << endl; - } - } - } - */ - - /* - Record_adj RA; - RA.for_2d(); - - for(int iat=0; iatna; I1++) - { - const int iat = ucell.itia2iat(T1,I1); - const int start1 = ucell.itiaiw2iwt(T1,I1,0); - for (int cb = 0; cb < RA.na_each[iat]; cb++) - { - const int T2 = RA.info[iat][cb][3]; - const int I2 = RA.info[iat][cb][4]; - const int start2 = ucell.itiaiw2iwt(T2,I2,0); - Atom* atom2 = &ucell.atoms[T2]; - for(int jj=0; jjnw; jj++) - { - const int iw1_all = start1 + jj; - // HPSEPS's mu - const int mu = ParaO.trace_loc_row[iw1_all]; - if(mu<0)continue; - for(int kk=0; kknw; kk++) - { - const int iw2_all = start2 + kk; - // HPSEPS's nu - const int nu = ParaO.trace_loc_col[iw2_all]; - if(nu<0)continue; - //============================================================== - // here we use 'minus', but in GAMMA_ONLY_LOCAL we use 'plus', - // both are correct because the 'DSloc_Rx' is used in 'row' (-), - // however, the 'DSloc_x' is used in 'col' (+), - // mohan update 2011-06-16 - //============================================================== - for(int is=0; isfvl_dphi[iat][0] += 2.0 * dm2d[is][irr] * LM.DHloc_fixedR_x[irr]; -// this->fvl_dphi[iat][1] += 2.0 * dm2d[is][irr] * LM.DHloc_fixedR_y[irr]; -// this->fvl_dphi[iat][2] += 2.0 * dm2d[is][irr] * LM.DHloc_fixedR_z[irr]; - -// because dm2d has to be used in other places, so.... - this->fvl_dphi[iat][0] += 2.0 * LM.DHloc_fixedR_x[irr]; - this->fvl_dphi[iat][1] += 2.0 * LM.DHloc_fixedR_y[irr]; - this->fvl_dphi[iat][2] += 2.0 * LM.DHloc_fixedR_z[irr]; - } - ++irr; - }//end kk - }//end jj - }// end cb - } - } - assert(irr==LNNR.nnr); - */ - if(STRESS){ + if(isstress){ for(int ipol=0;ipol<3;ipol++){ for(int jpol=0;jpol<3;jpol++){ - if(ipol < jpol) svl_dphi[jpol][ipol] = svl_dphi[ipol][jpol]; - svl_dphi[ipol][jpol] /= ucell.omega; + if(ipol < jpol) svl_dphi(jpol, ipol) = svl_dphi(ipol, jpol); + svl_dphi(ipol, jpol) /= ucell.omega; } } } diff --git a/ABACUS.develop/source/src_lcao/FORCE_k.h b/ABACUS.develop/source/src_lcao/FORCE_k.h new file mode 100644 index 0000000000..0ccd9e8807 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/FORCE_k.h @@ -0,0 +1,63 @@ +#ifndef FORCE_LCAO_K_H +#define FORCE_LCAO_K_H + +#include "../src_pw/tools.h" +#include "LCAO_matrix.h" +#include "FORCE_gamma.h" + +class Force_LCAO_k : public Force_LCAO_gamma +{ + public : + + friend class Force_Stress_LCAO; + + Force_LCAO_k (); + ~Force_LCAO_k (); + + private: + + //orthonormal force + contribution from T and VNL + void ftable_k ( + const bool isforce, + const bool isstress, + matrix& foverlap, + matrix& ftvnl_dphi, + matrix& fvnl_dbeta, + matrix& fvl_dphi, + matrix& soverlap, + matrix& stvnl_dphi, + matrix& svnl_dbeta, + matrix& svl_dphi + ); + + // get the ds, dt, dvnl. + void allocate_k(void); + + void finish_k(void); + + void set_EDM_k(double** dm2d, const bool with_energy); + + // mohan add 2012-01-09 + complex set_EDM_k_element( + const complex &phase, + const bool with_energy, + complex &coef1, complex &coef2, + const double &ekb); + + // calculate the force due to < dphi | beta > < beta | phi > + void cal_ftvnl_dphi_k(double** dm2d, const bool isforce, const bool isstress, matrix& ftvnl_dphi, matrix& stvnl_dphi); + + // calculate the overlap force + void cal_foverlap_k(const bool isforce, const bool isstress, matrix& foverlap, matrix& soverlap); + + // calculate the force due to < phi | Vlocal | dphi > + void cal_fvl_dphi_k(double** dm2d, const bool isforce, const bool isstress, matrix& fvl_dphi, matrix& svl_dphi); + + // calculate the force due to < phi | dbeta > < beta | phi > + void cal_fvnl_dbeta_k(double** dm2d, const bool isforce, const bool isstress, matrix& fvnl_dbeta, matrix& svnl_dbeta); + + + void test(double* mm, const string &name); + +}; +#endif diff --git a/ABACUS.develop/source/src_lcao/LCAO_diago.cpp b/ABACUS.develop/source/src_lcao/LCAO_diago.cpp new file mode 100644 index 0000000000..d0118a203e --- /dev/null +++ b/ABACUS.develop/source/src_lcao/LCAO_diago.cpp @@ -0,0 +1,267 @@ +#include "LCAO_diago.h" +#include "../src_pw/global.h" +#include "../src_pdiag/pdiag_double.h" +#include "../src_io/write_HS.h" +//xiaohui modified 2013-03-23 +//#include "../src_develop/src_siao/selinv.h" + +Diago_LCAO_Matrix::Diago_LCAO_Matrix(){} +Diago_LCAO_Matrix::~Diago_LCAO_Matrix(){} + +void Diago_LCAO_Matrix::solve_complex_matrix( + const int &ik, + complex** wfc, + ComplexMatrix &wfc_2d)const +{ + TITLE("Diago_LCAO_Matrix","solve_complex_matrix"); + time_t time_start = time(NULL); + + if(KS_SOLVER=="lapack") + { + this->using_LAPACK_complex(ik, wfc); + } + else + { +#ifdef __MPI + this->using_HPSEPS_complex(ik, wfc, wfc_2d); +#else + WARNING_QUIT("Diago_LCAO_Matrix::solve_complex_matrix","only lapack is available!"); +#endif + } + + time_t time_end = time(NULL); + + OUT_TIME("diago(complex)", time_start, time_end); + + return; +} + + +void Diago_LCAO_Matrix::solve_double_matrix( + const int &ik, + double** wfc, + matrix &wfc_2d)const +{ + TITLE("Diago_LCAO_Matrix","solve_double_matrix"); + timer::tick("Diago_LCAO_Matrix","solve_double_matrix",'F'); + time_t time_start = time(NULL); + + + if(KS_SOLVER=="lapack") + { + this->using_LAPACK(ik, wfc); + } +#ifdef __MPI + else if(KS_SOLVER=="hpseps" || KS_SOLVER=="genelpa"|| KS_SOLVER=="scalapack_gvx") + { + this->using_HPSEPS_double(ik, wfc, wfc_2d); + } +#endif + else + { + cout << " Diago_LCAO_Matrix, diago_type = " << KS_SOLVER << endl; + WARNING_QUIT("Diago_LCAO_Matrix::init","Check KS_SOLVER."); + } + + time_t time_end = time(NULL); + + OUT_TIME("diago(double)",time_start, time_end); + + timer::tick("Diago_LCAO_Matrix","solve_double_matrix",'F'); + return; +} + +#ifdef __MPI +void Diago_LCAO_Matrix::using_HPSEPS_double(const int &ik, double**wfc, matrix &wfc_2d)const +{ + TITLE("Diago_LCAO_Matrix","using_HPSEPS_double"); + + // save H and S matrix to disk. + bool bit = false; + HS_Matrix::saving_HS(LM.Hloc, LM.Sloc, bit, ParaO.out_hs); + ofs_running << setprecision(6); + + // Distribution of matrix for + // prallel eigensolver. + ParaO.diago_double_begin(ik, wfc, wfc_2d, LM.Hloc, LM.Sloc, wf.ekb[ik]); + + return; +} + + +void Diago_LCAO_Matrix::using_HPSEPS_complex(const int &ik, complex** wfc, ComplexMatrix &wfc_2d)const +{ + TITLE("Diago_LCAO_Matrix","using_HPSEPS_complex"); + + //ParaO.out_hs=1;//zhengdy-soc-test + bool bit = false; //LiuXh, 2017-03-21 + //if set bit = true, there would be error in soc-multi-core calculation, noted by zhengdy-soc + HS_Matrix::saving_HS_complex(LM.Hloc2, LM.Sloc2, bit, ParaO.out_hs); //LiuXh, 2017-03-21 + ofs_running << setprecision(6); //LiuXh, 2017-03-21 + + ParaO.diago_complex_begin(ik, wfc, wfc_2d, LM.Hloc2, LM.Sloc2, wf.ekb[ik]); + + //added by zhengdy-soc, rearrange the WFC_K from [up,down,up,down...] to [up,up...down,down...], + if(NSPIN==4) + { + int row = GridT.lgd; + vector> tmp(row); + for(int ib=0; ib **wfc)const +{ + TITLE("Diago_LCAO_Matrix","using_LAPACK_complex"); + + assert(NPROC = 1); + + ComplexMatrix Htmp(NLOCAL,NLOCAL); + ComplexMatrix Stmp(NLOCAL,NLOCAL); + for(int i=0; i0); + + // save H and S matrix to disk. +// bool bit = false; + bool bit = true;//zhengdy-soc + HS_Matrix::saving_HS(LM.Hloc, LM.Sloc, bit, ParaO.out_hs); + + matrix Htmp(NLOCAL,NLOCAL); + matrix Stmp(NLOCAL,NLOCAL); + for(int i=0; i //fuxiang add 2016-10-28 @@ -25,7 +24,7 @@ void Evolve_LCAO_Matrix::evolve_complex_matrix(const int &ik, complex** this->using_LAPACK_complex(ik, cc, cc_init); #endif */ - this-> using_LAPACK_complex(ik, cc, cc_init); + this->using_LAPACK_complex(ik, cc, cc_init); } else { diff --git a/ABACUS.develop/source/src_lcao/evolve_lcao_matrix.h b/ABACUS.develop/source/src_lcao/LCAO_evolve.h similarity index 100% rename from ABACUS.develop/source/src_lcao/evolve_lcao_matrix.h rename to ABACUS.develop/source/src_lcao/LCAO_evolve.h diff --git a/ABACUS.develop/source/src_lcao/use_overlap_matrix.cpp b/ABACUS.develop/source/src_lcao/LCAO_gen_fixedH.cpp similarity index 88% rename from ABACUS.develop/source/src_lcao/use_overlap_matrix.cpp rename to ABACUS.develop/source/src_lcao/LCAO_gen_fixedH.cpp index 76e332d507..ae2b14d3fe 100644 --- a/ABACUS.develop/source/src_lcao/use_overlap_matrix.cpp +++ b/ABACUS.develop/source/src_lcao/LCAO_gen_fixedH.cpp @@ -1,19 +1,25 @@ -#include "use_overlap_matrix.h" +#include "LCAO_gen_fixedH.h" #include "../src_pw/global.h" #include "../src_pw/wavefunc.h" -//#include "../src_develop/src_wannier/manipulation.h" -#include "lcao_nnr.h" +#include "LCAO_nnr.h" +#include "global_fp.h" -Use_Overlap_Matrix::Use_Overlap_Matrix() +LCAO_gen_fixedH::LCAO_gen_fixedH() {} -Use_Overlap_Matrix::~Use_Overlap_Matrix() +LCAO_gen_fixedH::~LCAO_gen_fixedH() {} -void Use_Overlap_Matrix::calculate_NL_no(void) +void LCAO_gen_fixedH::calculate_NL_no(void) { - TITLE("Use_Overlap_Matrix","calculate_NL_no"); + TITLE("LCAO_gen_fixedH","calculate_NL_no"); + + // PLEASE rebuild the following two functions, + // 'build_Nonlocal_beta' and 'build_Nonlocal_mu', + // because the two functions are extremely time consuming + // for small systems, especially for multiple-k points + // mohan note 2021-03-23 if(GAMMA_ONLY_LOCAL) { @@ -33,27 +39,27 @@ void Use_Overlap_Matrix::calculate_NL_no(void) } -void Use_Overlap_Matrix::calculate_T_no(void) +void LCAO_gen_fixedH::calculate_T_no(void) { - TITLE("Use_Overlap_Matrix","calculate_T_no"); + TITLE("LCAO_gen_fixedH","calculate_T_no"); this->build_ST_new('T', false); return; } -void Use_Overlap_Matrix::calculate_S_no(void) +void LCAO_gen_fixedH::calculate_S_no(void) { - TITLE("Use_Overlap_Matrix", "calculate_S_no"); - timer::tick("Use_Overlap_Matrix","calculate_S_no"); + TITLE("LCAO_gen_fixedH", "calculate_S_no"); + timer::tick("LCAO_gen_fixedH","calculate_S_no"); this->build_ST_new('S', false); - timer::tick("Use_Overlap_Matrix","calculate_S_no"); + timer::tick("LCAO_gen_fixedH","calculate_S_no"); return; } //liaochen modify interface 2010-3-22 -void Use_Overlap_Matrix::build_ST_new(const char& dtype, const bool& calc_deri) +void LCAO_gen_fixedH::build_ST_new(const char& dtype, const bool& calc_deri) { - TITLE("Use_Overlap_Matrix","build_ST_new"); + TITLE("LCAO_gen_fixedH","build_ST_new"); //array to store data double olm[3]={0.0,0.0,0.0}; @@ -125,20 +131,12 @@ void Use_Overlap_Matrix::build_ST_new(const char& dtype, const bool& calc_deri) if(GAMMA_ONLY_LOCAL) { - if(BFIELD) - { - LM.set_HSk(iw1_all, iw2_all, complex(olm[0],0.0), dtype); - } - else - { - // mohan add 2010-06-29 - // set the value in Hloc and Sloc - // according to trace_loc_row and trace_loc_col - // the last paramete: 1 for Sloc, 2 for Hloc - // and 3 for Hloc_fixed. - LM.set_HSgamma(iw1_all, iw2_all, olm[0], dtype); - } - + // mohan add 2010-06-29 + // set the value in Hloc and Sloc + // according to trace_loc_row and trace_loc_col + // the last paramete: 1 for Sloc, 2 for Hloc + // and 3 for Hloc_fixed. + LM.set_HSgamma(iw1_all, iw2_all, olm[0], dtype); } else // k point algorithm { @@ -268,14 +266,14 @@ void Use_Overlap_Matrix::build_ST_new(const char& dtype, const bool& calc_deri) { cout << " nnr=" << nnr << " LNNR.nnr=" << LNNR.nnr << endl; ofs_running << " nnr=" << nnr << " LNNR.nnr=" << LNNR.nnr << endl; - WARNING_QUIT("Use_Overlap_Matrix::build_ST_new","nnr != LNNR.nnr"); + WARNING_QUIT("LCAO_gen_fixedH::build_ST_new","nnr != LNNR.nnr"); } } return; } -void Use_Overlap_Matrix::test_Nonlocal() +void LCAO_gen_fixedH::test_Nonlocal() { int nnr = 0; Vector3 tau1, tau2, dtau_12, tau0, dtau_10, dtau_20; @@ -402,10 +400,10 @@ void Use_Overlap_Matrix::test_Nonlocal() #include "record_adj.h" //mohan add 2012-07-06 -void Use_Overlap_Matrix::build_Nonlocal_mu(const bool &calc_deri) +void LCAO_gen_fixedH::build_Nonlocal_mu(const bool &calc_deri) { - TITLE("Use_Overlap_Matrix","build_Nonlocal_mu"); - timer::tick ("Use_Overlap_Matrix","build_Nonlocal_mu",'G'); + TITLE("LCAO_gen_fixedH","build_Nonlocal_mu"); + timer::tick ("LCAO_gen_fixedH","build_Nonlocal_mu",'G'); // < phi1 | beta > < beta | phi2 > // phi1 is within the unitcell. @@ -424,7 +422,6 @@ void Use_Overlap_Matrix::build_Nonlocal_mu(const bool &calc_deri) // RA.for_2d(); // psi1 -// double sum = 0.0; for (int T1 = 0; T1 < ucell.ntype; ++T1) { const Atom* atom1 = &ucell.atoms[T1]; @@ -556,15 +553,9 @@ void Use_Overlap_Matrix::build_Nonlocal_mu(const bool &calc_deri) // mohan add 2010-12-20 if( nlm[0]!=0.0 ) { - if(BFIELD) - { - LM.set_HSk(iw1_all,iw2_all,complex(nlm[0],0.0),'N'); - } - else - { - //ofs_running << setw(10) << iw1_all << setw(10) << iw2_all << setw(20) << nlm[0] << endl; - LM.set_HSgamma(iw1_all,iw2_all,nlm[0],'N');//N stands for nonlocal. - } + // ofs_running << setw(10) << iw1_all << setw(10) + // << iw2_all << setw(20) << nlm[0] << endl; + LM.set_HSgamma(iw1_all,iw2_all,nlm[0],'N');//N stands for nonlocal. } } else @@ -636,7 +627,6 @@ void Use_Overlap_Matrix::build_Nonlocal_mu(const bool &calc_deri) } // I1 } // T1 -// cout << " sum from build_Nonlocal_mu = " << sum << endl; if(!GAMMA_ONLY_LOCAL) { @@ -646,21 +636,21 @@ void Use_Overlap_Matrix::build_Nonlocal_mu(const bool &calc_deri) // ofs_running << " LNNR.nnr=" << LNNR.nnr << endl; if( nnr!=LNNR.nnr) { - WARNING_QUIT("Use_Overlap_Matrix::build_Nonlocal_mu","nnr!=LNNR.nnr"); + WARNING_QUIT("LCAO_gen_fixedH::build_Nonlocal_mu","nnr!=LNNR.nnr"); } } // cout << " build_Nonlocal_mu done" << endl; - timer::tick ("Use_Overlap_Matrix","build_Nonlocal_mu",'G'); + timer::tick ("LCAO_gen_fixedH","build_Nonlocal_mu",'G'); return; } -void Use_Overlap_Matrix::build_Nonlocal_beta(const bool& calc_deri) +void LCAO_gen_fixedH::build_Nonlocal_beta(const bool& calc_deri) { - TITLE("Use_Overlap_Matrix","build_Nonlocal_beta"); - timer::tick ("Use_Overlap_Matrix","build_Nonlocal_beta",'G'); + TITLE("LCAO_gen_fixedH","build_Nonlocal_beta"); + timer::tick ("LCAO_gen_fixedH","build_Nonlocal_beta",'G'); for (int T0 = 0; T0 < ucell.ntype; T0++) { @@ -734,18 +724,11 @@ void Use_Overlap_Matrix::build_Nonlocal_beta(const bool& calc_deri) if(GAMMA_ONLY_LOCAL) { - if(BFIELD) - { - LM.set_HSk(iw1_all,iw2_all,complex(nlm[0],0.0),'N'); - } - else - { - LM.set_HSgamma(iw1_all,iw2_all,nlm[0],'N');//N stands for nonlocal. - } + LM.set_HSgamma(iw1_all,iw2_all,nlm[0],'N');//N stands for nonlocal. } else { - WARNING_QUIT("Use_Overlap_Matrix::build_Nonlocal_beta","not consistent with k point algorithm."); + WARNING_QUIT("LCAO_gen_fixedH::build_Nonlocal_beta","not consistent with k point algorithm."); // assert( nnr < LNNR.nnr ); // LM.Hloc_fixedR[ nnr ] += nlm[0]; // ++nnr; @@ -772,7 +755,7 @@ void Use_Overlap_Matrix::build_Nonlocal_beta(const bool& calc_deri) } else { - WARNING_QUIT("Use_Overlap_Matrix::build_Nonlocal_beta","not consistent with k point algorithm."); + WARNING_QUIT("LCAO_gen_fixedH::build_Nonlocal_beta","not consistent with k point algorithm."); //LM.DHloc_fixedR_x[ nnr ] += nlm[0]; //LM.DHloc_fixedR_y[ nnr ] += nlm[1]; //LM.DHloc_fixedR_z[ nnr ] += nlm[2]; @@ -802,7 +785,7 @@ void Use_Overlap_Matrix::build_Nonlocal_beta(const bool& calc_deri) }// end I0 }// end T0 - timer::tick ("Use_Overlap_Matrix","build_Nonlocal_beta",'G'); + timer::tick ("LCAO_gen_fixedH","build_Nonlocal_beta",'G'); return; } diff --git a/ABACUS.develop/source/src_lcao/use_overlap_matrix.h b/ABACUS.develop/source/src_lcao/LCAO_gen_fixedH.h similarity index 72% rename from ABACUS.develop/source/src_lcao/use_overlap_matrix.h rename to ABACUS.develop/source/src_lcao/LCAO_gen_fixedH.h index ad9f314f2f..8f4bf94f25 100644 --- a/ABACUS.develop/source/src_lcao/use_overlap_matrix.h +++ b/ABACUS.develop/source/src_lcao/LCAO_gen_fixedH.h @@ -1,22 +1,24 @@ /************************************ //LiaoChen Modify on 2010-3-22 ***********************************/ -#ifndef USE_OVERLAP_MATRIX_H -#define USE_OVERLAP_MATRIX_H +#ifndef LCAO_gen_fixedH_H +#define LCAO_gen_fixedH_H #include "../src_pw/tools.h" -#include "use_overlap_table.h" -#include "sltk_grid_driver.h" +#include "ORB_gen_tables.h" +#include "../src_global/sltk_grid_driver.h" -class Use_Overlap_Matrix +class LCAO_gen_fixedH { friend class Force_LCAO_gamma; friend class Force_LCAO_k; friend class energy;//qifeng 2019/9/10 - friend class Mulliken_Charge;//qifeng 2019/9/10 + friend class Mulliken_Charge;//qifeng 2019/9/10 + public: - Use_Overlap_Matrix(); - ~Use_Overlap_Matrix(); + + LCAO_gen_fixedH(); + ~LCAO_gen_fixedH(); void calculate_NL_no(void); void calculate_T_no(void); diff --git a/ABACUS.develop/source/src_lcao/use_hamilt_matrix.cpp b/ABACUS.develop/source/src_lcao/LCAO_hamilt.cpp similarity index 70% rename from ABACUS.develop/source/src_lcao/use_hamilt_matrix.cpp rename to ABACUS.develop/source/src_lcao/LCAO_hamilt.cpp index 79383d0030..de53db4c50 100644 --- a/ABACUS.develop/source/src_lcao/use_hamilt_matrix.cpp +++ b/ABACUS.develop/source/src_lcao/LCAO_hamilt.cpp @@ -1,64 +1,42 @@ #include "../src_pw/global.h" -#include "use_hamilt_matrix.h" +#include "LCAO_hamilt.h" #include "build_st_pw.h" -#include "sltk_atom_arrange.h" -#include "bfield.h" -#include "lcao_vna.h" +#include "../src_global/sltk_atom_arrange.h" +#include "global_fp.h" // mohan add 2021-01-30 -Use_Hamilt_Matrix::Use_Hamilt_Matrix() +LCAO_Hamilt::LCAO_Hamilt() { init_s = false; } -Use_Hamilt_Matrix::~Use_Hamilt_Matrix() +LCAO_Hamilt::~LCAO_Hamilt() { if(test_deconstructor) { - cout << " ~Use_Hamilt_Matrix()" << endl; + cout << " ~LCAO_Hamilt()" << endl; } } -void Use_Hamilt_Matrix::set_ion(void) +//-------------------------------------------- +// 'calculate_STNR_gamma' or +// 'calculate_STNR_k' functions are called +//-------------------------------------------- +void LCAO_Hamilt::set_lcao_matrices(void) { - TITLE("Use_Hamilt_Matrix","set_ion"); - timer::tick("Use_Hamilt_Matrix","set_ion",'D'); + TITLE("LCAO_Hamilt","set_lcao_matrices"); + timer::tick("LCAO_Hamilt","set_lcao_matrices",'E'); + if(GAMMA_ONLY_LOCAL) { // mohan add 2012-03-29 - if(GRID_SPEED==1) - { - // calculate the grid integration of 'Vl' matrix for gamma algorithms. - this->GG.prepare(ucell.latvec, ucell.lat0); - } - else if(GRID_SPEED==2) - { - this->GG.prepare(ucell.latvec, ucell.lat0); - this->GS.prepare(ucell.latvec, ucell.lat0); - } - else - { - WARNING_QUIT("Use_Hamilt_Matrix::set_ion","GRID_SPEED should be 1 or 2"); - } + // calculate the grid integration of 'Vl' matrix for gamma algorithms. + this->GG.prepare(ucell.latvec, ucell.lat0); // calulate the 'S', 'T' and 'Vnl' matrix for gamma algorithms. - if(!BFIELD) - { - this->calculate_STNR_gamma(); - } - else - { - this->calculate_STNR_gamma_B(); - } + this->calculate_STNR_gamma(); - // vna only need to do once, you can check this in lcao_vna.cpp - if(VNA>=1) - { - LCAO_Vna lv; - const char matrix_type='T'; - lv.dense_vna(matrix_type); - } } - else + else // multiple k-points { // calculate the 'S', 'T' and 'Vnl' matrix for k-points algorithms. this->calculate_STNR_k(); @@ -66,18 +44,6 @@ void Use_Hamilt_Matrix::set_ion(void) // calculate the grid integration of 'Vl' matrix for l-points algorithms. this->GK.init(pw.nbx, pw.nby, pw.nbzp, pw.nbzp_start, pw.ncxyz); - // do real space grid integration. - if(VNA>=1) - { - LCAO_Vna lv; - const char matrix_type='T'; - lv.dense_vna(matrix_type); - } - else if(VNA==-1) - { - LCAO_Vna lv; - lv.two_center_vna(); - } } // initial the overlap matrix is done. @@ -85,24 +51,17 @@ void Use_Hamilt_Matrix::set_ion(void) //cout << " init_s=" << init_s << endl; //delete 2015-09-06, xiaohui // OUT(ofs_running,"init_s",init_s); - timer::tick("Use_Hamilt_Matrix","set_ion",'D'); + timer::tick("LCAO_Hamilt","set_lcao_matrices",'E'); return; } -void Use_Hamilt_Matrix::calculate_Hgamma(void) +void LCAO_Hamilt::calculate_Hgamma( const int &ik ) // Peize Lin add ik 2016-12-03 { - TITLE("Use_Hamilt_Matrix","calculate_Hgamma"); - timer::tick("Use_Hamilt_Matrix","cal_Hgamma",'F'); + TITLE("LCAO_Hamilt","calculate_Hgamma"); + timer::tick("LCAO_Hamilt","cal_Hgamma",'F'); // Set the matrix 'H' to zero. - if(BFIELD) - { - LM.zeros_HSk('H'); // 3 stands for Hloc. - } - else - { - LM.zeros_HSgamma('H'); // 3 stands for Hloc. - } + LM.zeros_HSgamma('H'); // 3 stands for Hloc. bool local_pw = false; @@ -121,32 +80,20 @@ void Use_Hamilt_Matrix::calculate_Hgamma(void) // calculate the 'Vl' matrix using gamma-algorithms. if(VL_IN_H) { - if(VNA==0) + this->GG.cal_vlocal(pot.vr_eff1); + + // Peize Lin add 2016-12-03 + if( 5==xcf.iexch_now && 0==xcf.igcx_now ) // HF { - if(GRID_SPEED==1) - { - this->GG.cal_vlocal(pot.vrs1); - } - else if(GRID_SPEED==2) - { - this->GS.cal_vlocal(pot.vrs1); - } + exx_lcao.add_Hexx(ik,1); } - else if(VNA>1) + else if( 6==xcf.iexch_now && 8==xcf.igcx_now ) // PBE0 { - //------------------------------------------------ - // calculate the Vna from dense grid integration. - //------------------------------------------------ - LCAO_Vna lv; - lv.smooth_vl2(); - //LCAO_Vna::real_space_vna(); + exx_lcao.add_Hexx(ik,exx_global.info.hybrid_alpha); } - else if(VNA==1) + else if( 9==xcf.iexch_now && 12==xcf.igcx_now ) // HSE { - //------------------------------------------------ - // calculat the Vna from normal real space grid. - //------------------------------------------------ - LCAO_Vna::smooth_vl1(); + exx_lcao.add_Hexx(ik,exx_global.info.hybrid_alpha); } } @@ -155,104 +102,41 @@ void Use_Hamilt_Matrix::calculate_Hgamma(void) } //add T+VNL+Vl matrix. - if(BFIELD) - { - LM.update_Hloc2(); - } - else - { - LM.update_Hloc(); - } + LM.update_Hloc(); + - //@@@@@@@ //test - //@@@@@@@ if(NURSE) { - if(BFIELD) - { - LM.print_HSk('S'); - LM.print_HSk('T'); - LM.print_HSk('H','R'); // - LM.print_HSk('H','I'); // - } - else - { - LM.print_HSgamma('S'); // S - LM.print_HSgamma('T'); - LM.print_HSgamma('H'); - } - // WARNING_QUIT("Use_Hamilt_Matrix::calculate_Hgamma","print the H,S matrix"); + LM.print_HSgamma('S'); // S + LM.print_HSgamma('T'); + LM.print_HSgamma('H'); + // WARNING_QUIT("LCAO_Hamilt::calculate_Hgamma","print the H,S matrix"); // QUIT(); } - timer::tick("Use_Hamilt_Matrix","cal_Hgamma",'F'); + timer::tick("LCAO_Hamilt","cal_Hgamma",'F'); return; } -void Use_Hamilt_Matrix::calculate_STNR_gamma_B(void) -{ - TITLE("Use_Hamilt_Matrix","calculate_STNR_gamma_B"); - - // s matrix - bfid.cal_A_of_Atom(); - bfid.make_table(); - LM.zeros_HSk('S'); - - // calculate overlap - this->GG.cal_S_T_AP('S', GridT); - //this->UOM.calculate_S_no(); -// LM.print_HSk('S','R'); - - LM.zeros_HSk('T'); - - //time_t time_vnl_start = time(NULL); - if(VNL_IN_H) - { - bfid.cal_A_of_Atom(); - // calculate A - this->GG.cal_S_T_AP('A', GridT); - // calculate nonlocal - bfid.calculate_NL_B(); - } - //time_t time_vnl_end = time(NULL); - - //time_t time_t_start = time(NULL); - if(T_IN_H) - { - // calculate T - if(T_IN_H==1) - { - UOM.calculate_T_no(); - } - else if(T_IN_H==2) - { - this->GG.cal_S_T_AP('T', GridT); - } -// LM.print_HSk('T','R'); - } - //time_t time_t_end = time(NULL); - return; -} - -void Use_Hamilt_Matrix::calculate_STNR_gamma(void) +void LCAO_Hamilt::calculate_STNR_gamma(void) { - TITLE("Use_Hamilt_Matrix","calculate_fixed"); + TITLE("LCAO_Hamilt","calculate_fixed"); OUT(ofs_running,"gamma_only_local",GAMMA_ONLY_LOCAL); - // must be done after "setup_this_ion_iter" // because some basic parameters should be initialized // in UHM.GG.init(); LM.zeros_HSgamma('S'); - this->UOM.calculate_S_no(); - //LM.print_HSgamma('S'); + this->genH.calculate_S_no(); + + //LM.print_HSgamma('S'); //------------------------------------- // test using plane wave calculations. @@ -271,7 +155,7 @@ void Use_Hamilt_Matrix::calculate_STNR_gamma(void) time_t time_vnl_start = time(NULL); if(VNL_IN_H) { - UOM.calculate_NL_no(); + genH.calculate_NL_no(); } time_t time_vnl_end = time(NULL); @@ -281,12 +165,12 @@ void Use_Hamilt_Matrix::calculate_STNR_gamma(void) time_t time_t_start = time(NULL); if(T_IN_H) { - UOM.calculate_T_no(); + genH.calculate_T_no(); // LM.print_HSgamma('T'); } time_t time_t_end = time(NULL); -// ofs_running << " T+Vnl matrix" << endl; + // ofs_running << " T+Vnl matrix" << endl; //LM.print_HSgamma('T'); OUT_TIME("kinetical matrix",time_t_start, time_t_end); @@ -295,12 +179,13 @@ void Use_Hamilt_Matrix::calculate_STNR_gamma(void) return; } -#include "lcao_nnr.h" -// be called in Local_Orbital_Elec::cal_bands(). -void Use_Hamilt_Matrix::calculate_Hk(const int &ik) + +#include "LCAO_nnr.h" +// be called in LOOP_elec::cal_bands(). +void LCAO_Hamilt::calculate_Hk(const int &ik) { - TITLE("Use_Hamilt_Matrix","calculate_Hk"); - timer::tick("Use_Hamilt_Matrix","calculate_Hk",'F'); + TITLE("LCAO_Hamilt","calculate_Hk"); + timer::tick("LCAO_Hamilt","calculate_Hk",'F'); // whether you want to calculate the local potential // or not, you need to set this matrix to 0. @@ -321,8 +206,29 @@ void Use_Hamilt_Matrix::calculate_Hk(const int &ik) // in LCAO basis. //-------------------------- LM.zeros_HSR('H', LNNR.nnr); - if(NSPIN!=4) this->GK.folding_vl_k(ik); - else this->GK.folding_vl_k_nc(ik); + + if(NSPIN!=4) + { + this->GK.folding_vl_k(ik); + } + else + { + this->GK.folding_vl_k_nc(ik); + } + + // Peize Lin add 2016-12-03 + if( 5==xcf.iexch_now && 0==xcf.igcx_now ) // HF + { + exx_lcao.add_Hexx(ik,1); + } + else if( 6==xcf.iexch_now && 8==xcf.igcx_now ) // PBE0 + { + exx_lcao.add_Hexx(ik,exx_global.info.hybrid_alpha); + } + else if( 9==xcf.iexch_now && 12==xcf.igcx_now ) // HSE + { + exx_lcao.add_Hexx(ik,exx_global.info.hybrid_alpha); + } } @@ -351,13 +257,13 @@ void Use_Hamilt_Matrix::calculate_Hk(const int &ik) } */ - timer::tick("Use_Hamilt_Matrix","calculate_Hk",'F'); + timer::tick("LCAO_Hamilt","calculate_Hk",'F'); return; } // only need to do the first time. // available for all k points. -void Use_Hamilt_Matrix::calculate_STNR_k(void) +void LCAO_Hamilt::calculate_STNR_k(void) { TITLE("Hamilt_Linear","calculate_STBR_k"); @@ -368,7 +274,7 @@ void Use_Hamilt_Matrix::calculate_STNR_k(void) // and store in LM.SlocR. //-------------------------------------------- LM.zeros_HSR('S', LNNR.nnr); - this->UOM.calculate_S_no(); + this->genH.calculate_S_no(); //------------------------------ // set T(R) and Vnl(R) to zero. @@ -381,13 +287,13 @@ void Use_Hamilt_Matrix::calculate_STNR_k(void) if(T_IN_H) { - this->UOM.calculate_T_no(); + this->genH.calculate_T_no(); } if(VNL_IN_H) { - this->UOM.calculate_NL_no(); + this->genH.calculate_NL_no(); } @@ -443,11 +349,11 @@ void Use_Hamilt_Matrix::calculate_STNR_k(void) // GAMMA_ONLY_LOCAL = true; // LM.allocate_HS_gamma(ParaO.nloc); // LM.zeros_HSgamma('H'); -// UHM.UOM.calculate_NL_no( nstart ); +// UHM.genH.calculate_NL_no( nstart ); // GAMMA_ONLY_LOCAL = false; // cout << " Correct LCAO Vnl " << endl; // LM.print_HSgamma('H'); -// UHM.UOM.calculate_NL_no( nstart ); +// UHM.genH.calculate_NL_no( nstart ); // GAMMA_ONLY_LOCAL = false; // cout << " Correct LCAO Vnl " << endl; // LM.print_HSgamma('H'); @@ -458,9 +364,9 @@ void Use_Hamilt_Matrix::calculate_STNR_k(void) } -void Use_Hamilt_Matrix::calculate_STN_R(void) +void LCAO_Hamilt::calculate_STN_R(void) { - TITLE("Use_Hamilt_Matrix","calculate_STN_R"); + TITLE("LCAO_Hamilt","calculate_STN_R"); //int iat = 0; int index = 0; diff --git a/ABACUS.develop/source/src_lcao/use_hamilt_matrix.h b/ABACUS.develop/source/src_lcao/LCAO_hamilt.h similarity index 60% rename from ABACUS.develop/source/src_lcao/use_hamilt_matrix.h rename to ABACUS.develop/source/src_lcao/LCAO_hamilt.h index e07348481a..ca7c694f68 100644 --- a/ABACUS.develop/source/src_lcao/use_hamilt_matrix.h +++ b/ABACUS.develop/source/src_lcao/LCAO_hamilt.h @@ -1,38 +1,36 @@ -#ifndef USE_HAMILT_MATRIX_H -#define USE_HAMILT_MATRIX_H +#ifndef LCAO_HAMILT_H +#define LCAO_HAMILT_H #include "../src_pw/tools.h" -#include "use_overlap_matrix.h" +#include "LCAO_gen_fixedH.h" #include "gint_gamma.h" -#include "gint_speed.h" //mohan add 2012-03-29 #include "gint_k.h" -#include "grid_integral.h" -class Use_Hamilt_Matrix +class LCAO_Hamilt { public: - Use_Hamilt_Matrix(); - ~Use_Hamilt_Matrix(); - void set_ion(void); + LCAO_Hamilt(); + ~LCAO_Hamilt(); + + void set_lcao_matrices(void); // used fro k-dependent Hamiltonian matrix. void calculate_Hk( const int &ik); // used for Gamma only Hamiltonian matrix. - void calculate_Hgamma(void); + void calculate_Hgamma( const int &ik ); // Peize Lin add ik 2016-12-03 + void calculate_STN_R(void); //LiuXh add 2019-07-15 // used for gamma only algorithms. Gint_Gamma GG; - // fast grid integration, mohan add 2012-03-29 - Gint_Speed GS; // used for k-dependent grid integration. Gint_k GK; - // use overlap matrix. - Use_Overlap_Matrix UOM; + // use overlap matrix to generate fixed Hamiltonian + LCAO_gen_fixedH genH; // init S (overlap matrix) flag. bool init_s; @@ -41,7 +39,9 @@ class Use_Hamilt_Matrix // used for gamma only algorithms. void calculate_STNR_gamma(void); + void calculate_STNR_gamma_B(void); //mohan add 2012-04-14 + void calculate_STNR_k(void); }; diff --git a/ABACUS.develop/source/src_lcao/lcao_matrix.cpp b/ABACUS.develop/source/src_lcao/LCAO_matrix.cpp similarity index 75% rename from ABACUS.develop/source/src_lcao/lcao_matrix.cpp rename to ABACUS.develop/source/src_lcao/LCAO_matrix.cpp index 8526a1fc22..2907f91fc1 100644 --- a/ABACUS.develop/source/src_lcao/lcao_matrix.cpp +++ b/ABACUS.develop/source/src_lcao/LCAO_matrix.cpp @@ -1,4 +1,4 @@ -#include "lcao_matrix.h" +#include "LCAO_matrix.h" #include "global_fp.h" LCAO_Matrix::LCAO_Matrix() @@ -31,71 +31,51 @@ LCAO_Matrix::~LCAO_Matrix() delete[] Sdiag2; } -void LCAO_Matrix::divide_HS_in_frag(void) + +void LCAO_Matrix::divide_HS_in_frag(const bool isGamma, Parallel_Orbitals &po) { TITLE("LCAO_Matrix","divide_HS_in_frag"); ofs_running << "\n SETUP THE DIVISION OF H/S MATRIX" << endl; // (1) calculate nrow, ncol, nloc. - //if (DIAGO_TYPE=="hpseps" || DIAGO_TYPE=="scalpack" || DIAGO_TYPE=="selinv") xiaohui modify 2013-09-02 - if (KS_SOLVER=="genelpa" || KS_SOLVER=="hpseps" || KS_SOLVER=="scalpack" || KS_SOLVER=="selinv" || KS_SOLVER=="scalapack_gvx") //xiaohui add 2013-09-02 + if (KS_SOLVER=="genelpa" || KS_SOLVER=="hpseps" || KS_SOLVER=="scalpack" + || KS_SOLVER=="selinv" || KS_SOLVER=="scalapack_gvx") { ofs_running << " divide the H&S matrix using 2D block algorithms." << endl; #ifdef __MPI - ParaO.divide_HS_2d(DIAG_WORLD); + // storage form of H and S matrices on each processor + // is determined in 'divide_HS_2d' subroutine + po.divide_HS_2d(DIAG_WORLD); #else - WARNING_QUIT("LCAO_Matrix::init","diago_type = 'HPSEPS' is not available for series version.\n You can use 'LAPACK' instead."); + WARNING_QUIT("LCAO_Matrix::init","diago method is not ready."); #endif } - //else if (DIAGO_TYPE == "canonical" - // || DIAGO_TYPE == "trace_resetting" - // || DIAGO_TYPE == "trace_correcting") xiaohui modify 2013-09-02 - else if(KS_SOLVER == "canonical" - || KS_SOLVER == "trace_resetting" - || KS_SOLVER == "trace_correcting") //xiaohui add 2013-09-02 - { - ofs_running << " divide the H&S matrix according to atoms." << endl; - // done nothing. - // the nloc is calculated in "ParaA.set_trace" - } else { - ParaO.nloc = NLOCAL * NLOCAL; + // the full matrix + po.nloc = NLOCAL * NLOCAL; } - - // (2) set the trace, then we - // can calculate the nnr. - // for 2d: calculate ParaO.nloc first, then trace_loc_row and trace_loc_col + // (2) set the trace, then we can calculate the nnr. + // for 2d: calculate po.nloc first, then trace_loc_row and trace_loc_col // for O(N): calculate the three together. - ParaO.set_trace(); - + po.set_trace(); - - // (3) allocate matrix. - if(GAMMA_ONLY_LOCAL) + // (3) allocate for S, H_fixed, H, and S_diag + if(isGamma) { - if(BFIELD) - { - // if b field is chosen, - // the hamiltonian is complex. - allocate_HS_k(ParaO.nloc); - } - else - { - allocate_HS_gamma(ParaO.nloc); - } + allocate_HS_gamma(po.nloc); } else { - allocate_HS_k(ParaO.nloc); + allocate_HS_k(po.nloc); } - return; } + void LCAO_Matrix::allocate_HS_gamma(const long &nloc) { TITLE("LCAO_Matrix","allocate_HS_gamma"); @@ -103,6 +83,9 @@ void LCAO_Matrix::allocate_HS_gamma(const long &nloc) OUT(ofs_running,"nloc",nloc); if(nloc==0) return; //mohan fix bug 2012-05-25 + // because we initilize in the constructor function + // with dimension '1', so here we reconstruct these + // matrices delete[] Sloc; delete[] Hloc_fixed; delete[] Hloc; @@ -116,6 +99,7 @@ void LCAO_Matrix::allocate_HS_gamma(const long &nloc) ZEROS(Sloc,nloc); ZEROS(Hloc_fixed,nloc); ZEROS(Hloc,nloc); + ZEROS(Sdiag,nloc); // mohan add 2021-01-30 return; } @@ -128,6 +112,9 @@ void LCAO_Matrix::allocate_HS_k(const long &nloc) OUT(ofs_running,"nloc",nloc); if(nloc==0) return; //mohan fix bug 2012-05-25 + // because we initilize in the constructor function + // with dimension '1', so here we reconstruct these + // matrices delete[] Sloc2; delete[] Hloc_fixed2; delete[] Hloc2; @@ -408,66 +395,83 @@ void LCAO_Matrix::zeros_HSR(const char &mtype, const int &nnr) return; } -void LCAO_Matrix::print_HSk(const char &mtype, const char &vtype, const double &accuracy) +// Peize Lin add vtype='A' 2018-11-30 +void LCAO_Matrix::print_HSk(const char &mtype, const char &vtype, const double &accuracy, ostream &os) { TITLE("LCAO_Matrix","print_HSk"); - if(mtype=='S') cout << "Sloc2 matrix" << endl; - else if(mtype=='T') cout << "Hloc_fixed2 matrix" << endl; - else if(mtype=='H') cout << "Hloc matrix" << endl; + if(mtype=='S') os << "Sloc2 matrix" << endl; + else if(mtype=='T') os << "Hloc_fixed2 matrix" << endl; + else if(mtype=='H') os << "Hloc2 matrix" << endl; else { WARNING_QUIT("LCAO_Matrix::print_HSk","Check input parameter: mtype."); } - if(vtype=='C') cout << " Output norm." << endl; - else if(vtype=='R') cout << " Output real part." << endl; - else if(vtype=='I') cout << " Output imag part." << endl; + if(vtype=='C') os << " Output norm." << endl; + else if(vtype=='R') os << " Output real part." << endl; + else if(vtype=='I') os << " Output imag part." << endl; + else if(vtype=='A') os << " Output complex." << endl; - cout << setprecision(8) << endl; + os << setprecision(8) << endl; for(int i=0; i accuracy ) - { - cout << setw(15) << v; + complex v; + if(mtype=='S') v = Sloc2[index]; + else if(mtype=='T') v = Hloc_fixed2[index]; + else if(mtype=='H') v = Hloc2[index]; + auto threshold = [accuracy]( const double v ){ return abs(v)>accuracy ? v : 0.0; }; + os << '(' << threshold(v.real()) << ',' << threshold(v.imag()) << "\t"; } else { - cout << setw(15) << "0"; + double v=-888.888;//wrong number + if(vtype=='R') + { + if(mtype=='S') v = Sloc2[index].real(); + else if(mtype=='T') v = Hloc_fixed2[index].real(); + else if(mtype=='H') v = Hloc2[index].real(); + } + else if(vtype=='C') + { + if(mtype=='S') v = sqrt( norm ( Sloc2[index] ) ); + else if(mtype=='T') v = sqrt( norm ( Hloc_fixed2[index] ) ); + else if(mtype=='H') v = sqrt( norm ( Hloc2[index] ) ); + } + else if(vtype=='I') + { + if(mtype=='S') v = Sloc2[index].imag(); + else if(mtype=='T') v = Hloc_fixed2[index].imag(); + else if(mtype=='H') v = Hloc2[index].imag(); + } + + if( abs(v) > accuracy ) + { + // os << setw(15) << v; + os << v << "\t"; + } + else + { + // os << setw(15) << "0"; + os << "0" << "\t"; + } } } - cout << endl; + os << endl; } - cout << endl; - cout << setprecision(6) << endl; + os << endl; + os << setprecision(6) << endl; return; } -void LCAO_Matrix::print_HSgamma(const char &mtype) +void LCAO_Matrix::print_HSgamma(const char &mtype, ostream &os) { TITLE("Parallel_Orbitals","print_HSgamma"); @@ -475,201 +479,67 @@ void LCAO_Matrix::print_HSgamma(const char &mtype) ofs_running << " nrow=" << ParaO.nrow << endl; ofs_running << " ncol=" << ParaO.ncol << endl; ofs_running << " element number = " << ParaO.ncol << endl; + if (mtype=='S') { - if(!BFIELD) - { - cout << setprecision(8); - cout << " print Sloc" << endl; - for(int i=0; i 1.0e-8) - { - cout << setw(15) << v; - } - else - { - cout << setw(15) << "0"; - } - }//end j - cout << endl; - }//end i - } - - /* - ofs_running << " " << setw(10) << "LocalRow" << setw(10) << "LocalCol" - << setw(10) << "GlobalRow" << setw(10) << "GloablCol" - << setw(10) << "Sloc" << endl; - for (int i=0; inrow; i++) - { - for (int j=0; jncol; j++) - { - if ( abs(Sloc[i * this->ncol + j]) > 1.0e-5 ) - ofs_running << " " << setw(10) << i << setw(10) << j - << setw(10) << MatrixInfo.row_set[i] << setw(10) << MatrixInfo.col_set[j] - << setw(10) << Sloc[i * this->ncol + j] << endl; - } - } - cout << "\n Smatrix" << endl; - //ofs_running << setprecision(5) << endl; - - for(int i=0; i 1.0e-3 ) + double v = Sloc[i*ParaO.ncol+j]; + if( abs(v) > 1.0e-8) { - // ofs_running << setw(5) << i+1 << setw(5) << j+1 << setw(12) << h << setw(12) << s << endl; - } - - - if( abs(s) > 1.0e-5 ) - { - ofs_running << setw(10) << s; - // ofs_running << setw(5) << i << setw(5) << j << setw(15) << s << endl; - + os << setw(15) << v; } else { - ofs_running << setw(10) << "0"; + os << setw(15) << "0"; } - } - ofs_running << endl; - } - */ + }//end j + os << endl; + }//end i } if (mtype=='T') { - - - /* - ofs_running << " " << setw(10) << "LocalRow" << setw(10) << "LocalCol" - << setw(10) << "GlobalRow" << setw(10) << "GloablCol" - << setw(10) << "Hloc_fixed" << endl; - for (int i=0; i 1.0e-5 ) - { - ofs_running << " " << setw(10) << i+1 << setw(10) << j+1; - - //mohan fix bug 2012-02-22 - if(ATOM_DISTRIBUTION!=1) - { - ofs_running << setw(10) << ParaO.MatrixInfo.row_set[i] << setw(10) << ParaO.MatrixInfo.col_set[j]; - } - else - { - ofs_running << setw(10) << "0" << setw(10) << "0"; - } - ofs_running << setw(10) << Hloc_fixed[i * ParaO.ncol + j] << endl; - } - } - } - for(int i=0; i 1.0e-5 ) + if( abs(v) > 1.0e-8) { - ofs_running << setw(15) << v; + os << setw(15) << v; } else { - ofs_running << setw(15) << "0"; + os << setw(15) << "0"; } - } - ofs_running << endl; - } - */ - - if(!BFIELD) - { - cout << " print Hloc_fixed" << endl; - for(int i=0; i 1.0e-8) - { - cout << setw(15) << v; - } - else - { - cout << setw(15) << "0"; - } - }//end j - cout << endl; - }//end i - } + }//end j + os << endl; + }//end i } if (mtype=='H') { - - if(!BFIELD) - { - cout << " print Hloc" << endl; - for(int i=0; i 1.0e-8) - { - cout << setw(15) << v; - } - else - { - cout << setw(15) << "0"; - } - }//end j - cout << endl; - }//end i - } - - /* - ofs_running << " " << setw(10) << "LocalRow" << setw(10) << "LocalCol" - << setw(10) << "GlobalRow" << setw(10) << "GloablCol" - << setw(10) << "Hloc" << endl; - - ofs_running << "\n Hmatrix" << endl; - ofs_running << setprecision(8) << endl; - for (int i=0; i 1.0e-5 ) + double v = Hloc[i*ParaO.ncol+j]; + if( abs(v) > 1.0e-8) { - // ofs_running << " " << setw(10) << i << setw(10) << j - // << setw(10) << ParaO.MatrixInfo.row_set[i] << setw(10) << ParaO.MatrixInfo.col_set[j] - // << setw(10) << a << endl; - - // - ofs_running << setw(15) << a; - //ofs_running << setw(5) << i << setw(5) << j << setw(15) << a << endl; - + os << setw(15) << v; } else { - // - ofs_running << setw(15) << "0"; + os << setw(15) << "0"; } - } - // - ofs_running << endl; - } - */ + }//end j + os << endl; + }//end i } return; diff --git a/ABACUS.develop/source/src_lcao/lcao_matrix.h b/ABACUS.develop/source/src_lcao/LCAO_matrix.h similarity index 91% rename from ABACUS.develop/source/src_lcao/lcao_matrix.h rename to ABACUS.develop/source/src_lcao/LCAO_matrix.h index afe110b3f5..6c50e854cc 100644 --- a/ABACUS.develop/source/src_lcao/lcao_matrix.h +++ b/ABACUS.develop/source/src_lcao/LCAO_matrix.h @@ -2,13 +2,28 @@ #define LCAO_MATRIX_H #include "../src_pw/tools.h" +#include "src_parallel/parallel_orbitals.h" class LCAO_Matrix { + friend class energy; + friend class Mulliken_Charge; + public: + LCAO_Matrix(); ~LCAO_Matrix(); + void divide_HS_in_frag(const bool isGamma, Parallel_Orbitals &po); + + private: + + void allocate_HS_gamma(const long &nloc); + + void allocate_HS_k(const long &nloc); + + + public: //------------------------------ // H, S, Hfixed // used in gamma only algorithm. @@ -123,28 +138,29 @@ class LCAO_Matrix double* DHloc_fixed_23; double* DHloc_fixed_33; - void divide_HS_in_frag(void); + void set_HSgamma(const int &iw1_all, const int &iw2_all, const double &v, const char &dtype); void set_HSk(const int &iw1_all, const int &iw2_all, const complex &v, const char &dtype, const int spin = 0); + void set_force (const int& iw1_all, const int& iw2_all, const double& vx, const double& vy, const double& vz, const char &dtype); void set_stress (const int& iw1_all, const int& iw2_all, const double& vx, const double& vy, const double& vz, const char &dtype, const Vector3 &dtau); + void set_HR_tr(const int &Rx, const int &Ry, const int &Rz, const int &iw1_all, const int &iw2_all, const double &v); - void set_HR_tr_soc(const int &Rx, const int &Ry, const int &Rz, const int &iw1_all, const int &iw2_all, const complex &v); //LiuXh add 2019-07-16 + void set_HR_tr_soc(const int &Rx, const int &Ry, const int &Rz, + const int &iw1_all, const int &iw2_all, const complex &v); //LiuXh add 2019-07-16 void zeros_HSgamma(const char &mtype); void zeros_HSk(const char &mtype); void zeros_HSR(const char &mtype, const int &nnr); - void print_HSgamma(const char &mtype); - void print_HSk(const char &mtype, const char &vtype = 'C', const double &accuracy = 1.0e-5); + void print_HSgamma(const char &mtype, ostream &os=cout); + void print_HSk(const char &mtype, const char &vtype = 'C', const double &accuracy = 1.0e-5, ostream &os=cout); void update_Hloc(void); void update_Hloc2(void); void allocate_HS_R(const int &nnr); - void allocate_HS_gamma(const long &nloc); - void allocate_HS_k(const long &nloc); void output_HSk(const char &mtype, string &fn); //LiuXh add 2019-07-15 diff --git a/ABACUS.develop/source/src_lcao/lcao_nnr.cpp b/ABACUS.develop/source/src_lcao/LCAO_nnr.cpp similarity index 98% rename from ABACUS.develop/source/src_lcao/lcao_nnr.cpp rename to ABACUS.develop/source/src_lcao/LCAO_nnr.cpp index 2805733b80..b52352411b 100644 --- a/ABACUS.develop/source/src_lcao/lcao_nnr.cpp +++ b/ABACUS.develop/source/src_lcao/LCAO_nnr.cpp @@ -1,4 +1,4 @@ -#include "lcao_nnr.h" +#include "LCAO_nnr.h" #include "../src_pw/global.h" #include "record_adj.h" //mohan add 2012-07-06 #include "dftu.h" //quxin add 2020-10-29 @@ -41,10 +41,11 @@ LCAO_nnr::~LCAO_nnr() } } -// be called in local_orbital_ions.cpp +// be called in LOOP_ions.cpp void LCAO_nnr::cal_nnr(void) { TITLE("LCAO_nnr","cal_nnr"); + delete[] nlocdim; delete[] nlocstart; nlocdim = new int[ucell.nat]; @@ -553,7 +554,7 @@ int LCAO_nnr::cal_RindexAtom(const int &u1, const int &u2, const int &u3, const } -// be called in Use_Hamilt_Matrix::calculate_Hk. +// be called in LCAO_Hamilt::calculate_Hk. void LCAO_nnr::folding_fixedH(const int &ik) { TITLE("LCAO_nnr","folding_fixedH"); @@ -564,7 +565,10 @@ void LCAO_nnr::folding_fixedH(const int &ik) // RA.for_2d(); //Quxin added for DFT+U calculation - if(INPUT.dft_plus_u) ZEROS( VECTOR_TO_PTR(dftu.Sm_k.at(ik)), ParaO.nloc); + if(INPUT.dft_plus_u) + { + ZEROS( VECTOR_TO_PTR(dftu.Sm_k.at(ik)), ParaO.nloc); + } int iat = 0; int index = 0; @@ -678,7 +682,8 @@ void LCAO_nnr::folding_fixedH(const int &ik) // Hloc_fixed2 is used to diagonalize (eliminate index R). //################################################################### - if(NSPIN!=4){ + if(NSPIN!=4) + { LM.Sloc2[iic] += LM.SlocR[index] * kphase; LM.Hloc_fixed2[iic] += LM.Hloc_fixedR[index] * kphase; @@ -691,7 +696,10 @@ void LCAO_nnr::folding_fixedH(const int &ik) LM.Hloc_fixed2[iic] += LM.Hloc_fixedR_soc[index] * kphase; //quxin added for DFT+U calculation - if(INPUT.dft_plus_u) dftu.Sm_k.at(ik).at(iic) += LM.SlocR_soc[index] * kphase; + if(INPUT.dft_plus_u) + { + dftu.Sm_k.at(ik).at(iic) += LM.SlocR_soc[index] * kphase; + } } ++index; diff --git a/ABACUS.develop/source/src_lcao/lcao_nnr.h b/ABACUS.develop/source/src_lcao/LCAO_nnr.h similarity index 96% rename from ABACUS.develop/source/src_lcao/lcao_nnr.h rename to ABACUS.develop/source/src_lcao/LCAO_nnr.h index a0d9012545..4760aab422 100644 --- a/ABACUS.develop/source/src_lcao/lcao_nnr.h +++ b/ABACUS.develop/source/src_lcao/LCAO_nnr.h @@ -1,11 +1,12 @@ -#ifndef LCAO_NNR -#define LCAO_NNR +#ifndef LCAO_NNR_H +#define LCAO_NNR_H #include "grid_technique.h" class LCAO_nnr { public: + LCAO_nnr(); ~LCAO_nnr(); diff --git a/ABACUS.develop/source/src_lcao/LOOP_cell.cpp b/ABACUS.develop/source/src_lcao/LOOP_cell.cpp new file mode 100644 index 0000000000..003b9eb7a3 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/LOOP_cell.cpp @@ -0,0 +1,66 @@ +#include "LOOP_cell.h" +#include "LOOP_ions.h" + +#include "src_lcao/dftu.h" //Quxin add for DFT+U on 20201029 + +// delete in near future +#include "src_pw/global.h" + +LOOP_cell::LOOP_cell(){} +LOOP_cell::~LOOP_cell(){} + +void LOOP_cell::opt_cell(void) +{ + TITLE("LOOP_cell","opt_cell"); + + // Initialize the local wave functions. + // npwx, eigenvalues, and weights + // npwx may change according to cell change + // this function belongs to cell LOOP + wf.allocate_ekb_wg(kv.nks); + + // Initialize the FFT. + // this function belongs to cell LOOP + UFFT.allocate(); + + // output is ppcell.vloc 3D local pseudopotentials + // this function belongs to cell LOOP + ppcell.init_vloc(pw.nggm, ppcell.vloc); + + // Initialize the sum of all local potentials. + // if ion_step==0, read in/initialize the potentials + // this function belongs to ions LOOP + int ion_step=0; + pot.init_pot(ion_step, pw.strucFac); + + + // Peize Lin 2016-12-03 + if (CALCULATION=="scf" || CALCULATION=="relax" || CALCULATION=="cell-relax") + { + switch(exx_global.info.hybrid_type) + { + case Exx_Global::Hybrid_Type::HF: + case Exx_Global::Hybrid_Type::PBE0: + case Exx_Global::Hybrid_Type::HSE: + exx_lcao.init(); + break; + case Exx_Global::Hybrid_Type::No: + case Exx_Global::Hybrid_Type::Generate_Matrix: + break; + default: + throw invalid_argument(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + } + } + + // Quxin added for DFT+U + if(INPUT.dft_plus_u) + { + dftu.init(ucell, ParaO); + } + + LOOP_ions ions; + ions.opt_ions(); + + return; +} + diff --git a/ABACUS.develop/source/src_lcao/LOOP_cell.h b/ABACUS.develop/source/src_lcao/LOOP_cell.h new file mode 100644 index 0000000000..4e8883deb8 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/LOOP_cell.h @@ -0,0 +1,15 @@ +#ifndef LOOP_CELL_H +#define LOOP_CELL_H + +class LOOP_cell +{ + public: + + LOOP_cell(); + ~LOOP_cell(); + + void opt_cell(void); + +}; + +#endif diff --git a/ABACUS.develop/source/src_lcao/LOOP_elec.cpp b/ABACUS.develop/source/src_lcao/LOOP_elec.cpp new file mode 100644 index 0000000000..bc22cd4735 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/LOOP_elec.cpp @@ -0,0 +1,238 @@ +#include "LOOP_elec.h" +#include "LCAO_diago.h" +#include "src_pw/global.h" +#include "src_pw/symmetry_rho.h" +#include "input_update.h" +#include "src_io/chi0_hilbert.h" +#include "LCAO_evolve.h" +#include "dftu.h" +// +#include "../src_global/sltk_atom_arrange.h" +#include "src_lcao/LCAO_nnr.h" +#include "../src_io/istate_charge.h" +#include "../src_io/istate_envelope.h" +#include "ELEC_scf.h" +#include "ELEC_nscf.h" +#include "ELEC_cbands_gamma.h" +#include "ELEC_cbands_k.h" +#include "ELEC_evolve.h" +// +#include "src_ri/exx_abfs.h" +#include "src_ri/exx_opt_orb.h" +#include "src_pw/vdwd2.h" + + +void LOOP_elec::solve_elec_stru(const int &istep) +{ + TITLE("LOOP_elec","solve_elec_stru"); + timer::tick("LOOP_elec","solve_elec_stru",'C'); + + // prepare HS matrices, prepare grid integral + this->set_matrix_grid(); + // density matrix extrapolation and prepare S,T,VNL matrices + this->before_solver(istep); + // do self-interaction calculations / nscf/ tddft, etc. + this->solver(istep); + + timer::tick("LOOP_elec","solve_elec_stru",'C'); + return; +} + + +void LOOP_elec::set_matrix_grid(void) +{ + TITLE("LOOP_elec","set_matrix_grid"); + timer::tick("LOOP_elec","set_matrix_grid",'D'); + + // (1) Find adjacent atoms for each atom. + atom_arrange::set_sr_NL(); + atom_arrange::search( SEARCH_RADIUS ); + //DONE(ofs_running,"SEARCH ADJACENT ATOMS"); + + // (3) Periodic condition search for each grid. + GridT.set_pbc_grid( + pw.ncx, pw.ncy, pw.ncz, + pw.bx, pw.by, pw.bz, + pw.nbx, pw.nby, pw.nbz, + pw.nbxx, pw.nbzp_start, pw.nbzp); + + // (2) If k point is used here, allocate HlocR after atom_arrange. + if(!GAMMA_ONLY_LOCAL) + { + // For each atom, calculate the adjacent atoms in different cells + // and allocate the space for H(R) and S(R). + LNNR.cal_nnr(); + LM.allocate_HS_R(LNNR.nnr); + + // need to first calculae lgd. + // using GridT.init. + LNNR.cal_nnrg(GridT); + } + + timer::tick("LOOP_elec","set_matrix_grid",'D'); + return; +} + + +void LOOP_elec::before_solver(const int &istep) +{ + TITLE("LOOP_elec","before_solver"); + timer::tick("LOOP_elec","before_solver",'D'); + + // set the augmented orbitals index. + // after ParaO and GridT, + // this information is used to calculate + // the force. + LOWF.set_trace_aug(GridT); + + // init density kernel and wave functions. + LOC.allocate_dm_wfc(GridT); + + //====================================== + // do the charge extrapolation before the density matrix is regenerated. + // mohan add 2011-04-08 + // because once atoms are moving out of this processor, + // the density matrix will not map the new atomic configuration, + //====================================== + // THIS IS A BUG, BECAUSE THE INDEX GridT.trace_lo + // HAS BEEN REGENERATED, SO WE NEED TO + // REALLOCATE DENSITY MATRIX FIRST, THEN READ IN DENSITY MATRIX, + // AND USE DENSITY MATRIX TO DO RHO CALCULATION.-- mohan 2013-03-31 + //====================================== + if(pot.extra_pot=="dm" && istep>1)//xiaohui modify 2015-02-01 + { + for(int is=0; isistep = 1; + int force_step = 1; + int stress_step = 1; + bool stop = false; + while(istep <= NSTEP && !stop) + { + time_t estart = time(NULL); + + // xiaohui add "m" option, 2015-09-16 + if(OUT_LEVEL=="ie" || OUT_LEVEL=="m") + { + cout << " ---------------------------------------------------------" << endl; + if(CALCULATION=="relax") + { + cout << " RELAX IONS : " << istep << endl; + } + else if(CALCULATION=="cell-relax") + { + cout << " RELAX CELL : " << stress_step << endl; + cout << " RELAX IONS : " << force_step << " (in total: " << istep << ")" << endl; + } + else if(CALCULATION=="scf") + { + cout << " SELF-CONSISTENT : " << endl; + } + cout << " ---------------------------------------------------------" << endl; + + ofs_running << " ---------------------------------------------------------" << endl; + if(CALCULATION=="relax") + { + ofs_running << " RELAX IONS : " << istep << endl; + ofs_running << " ---------------------------------------------------------" << endl; + } + else if(CALCULATION=="cell-relax") + { + ofs_running << " RELAX CELL : " << stress_step << endl; + ofs_running << " RELAX IONS : " << force_step << " (in total: " << istep << ")" << endl; + ofs_running << " ---------------------------------------------------------" << endl; + } + else if(CALCULATION=="scf") + { + ofs_running << " SELF-CONSISTENT" << endl; + ofs_running << " ---------------------------------------------------------" << endl; + } + } + + // solve electronic structures in terms of LCAO + // mohan add 2021-02-09 + LOE.solve_elec_stru(this->istep); + + + time_t eend = time(NULL); + + //xiaohui add 2014-07-07, for second-order extrapolation + int iat=0; + if(CALCULATION=="relax" || CALCULATION=="cell-relax") + { + for(int it = 0;it < ucell.ntype;it++) + { + Atom* atom = &ucell.atoms[it]; + for(int ia =0;ia< ucell.atoms[it].na;ia++) + { + CE.pos_old2[3*iat ] = CE.pos_old1[3*iat ]; + CE.pos_old2[3*iat+1] = CE.pos_old1[3*iat+1]; + CE.pos_old2[3*iat+2] = CE.pos_old1[3*iat+2]; + + CE.pos_old1[3*iat ] = CE.pos_now[3*iat ]; + CE.pos_old1[3*iat+1] = CE.pos_now[3*iat+1]; + CE.pos_old1[3*iat+2] = CE.pos_now[3*iat+2]; + + CE.pos_now[3*iat ] = atom->tau[ia].x*ucell.lat0; + CE.pos_now[3*iat+1] = atom->tau[ia].y*ucell.lat0; + CE.pos_now[3*iat+2] = atom->tau[ia].z*ucell.lat0; + + iat++; + } + } + } + + if(pot.out_potential == 2) + { + stringstream ssp; + stringstream ssp_ave; + ssp << global_out_dir << "ElecStaticPot"; + ssp_ave << global_out_dir << "ElecStaticPot_AVE"; + pot.write_elecstat_pot(ssp.str(), ssp_ave.str()); //output 'Hartree + local pseudopot' + } + + if(ParaO.out_hsR) + { + this->output_HS_R(); //LiuXh add 2019-07-15 + } + + time_t fstart = time(NULL); + if (CALCULATION=="scf" || CALCULATION=="relax" || CALCULATION=="cell-relax") + { + stop = this->force_stress(istep, force_step, stress_step); + } + time_t fend = time(NULL); + + + //xiaohui add 2014-07-07, for second-order extrapolation + iat=0; + if(FORCE) + { + for(int it = 0;it < ucell.ntype;it++) + { + Atom* atom = &ucell.atoms[it]; + for(int ia =0;ia< ucell.atoms[it].na;ia++) + { + CE.pos_next[3*iat ] = atom->tau[ia].x*ucell.lat0; + CE.pos_next[3*iat+1] = atom->tau[ia].y*ucell.lat0; + CE.pos_next[3*iat+2] = atom->tau[ia].z*ucell.lat0; + + iat++; + } + } + } + + if(OUT_LEVEL=="i") + { + double etime_min = difftime(eend, estart)/60.0; + double ftime_min = difftime(fend, fstart)/60.0; + stringstream ss; + ss << MOVE_IONS << istep; + + cout << setiosflags(ios::scientific) + << " " << setw(7) << ss.str() + << setw(5) << ELEC_scf::iter + << setw(18) << setprecision(6) << en.etot * Ry_to_eV; + + cout << setprecision(2) << setiosflags(ios::scientific) + << setw(10) << IMM.get_ediff() * Ry_to_eV * 1000 + << setw(10) << IMM.get_largest_grad() * Ry_to_eV / BOHR_TO_A; + //<< setw(12) << IMM.get_trust_radius(); + + cout << resetiosflags(ios::scientific) +// << setw(8) << IMM.get_update_iter() + << setprecision(2) << setw(10) << etime_min + ftime_min; + cout << endl; + } + +//#ifdef __MPI +// MPI_Barrier(MPI_COMM_WORLD); +// for (int i=0;i0. + //xiaohui modify 2014-08-09 + //CE.extrapolate_charge(); + +/*xiaohui modify 2014-08-09 + if(pot.extra_pot==4) + { + // done after grid technique. + } + else + { + pot.init_pot( istep ); + } +xiaohui modify 2014-08-09*/ + } + + static bool converged_force = false; + static bool converged_stress = false; + + if(!FORCE&&STRESS) + { + +#ifdef __MPI + atom_arrange::delete_vector( SEARCH_RADIUS ); +#endif + if(CALCULATION=="cell-relax") + { + LCM.cal_lattice_change(stress_step, scs, en.etot); + converged_stress = LCM.get_converged(); + if(converged_stress) + { + return 1; + } + else + { + Variable_Cell::init_after_vc(); + pot.init_pot(stress_step, pw.strucFac); + + ++stress_step; + return 0; + } + } + else + { + return 1; + } + } + + if(FORCE&&STRESS) + { + + atom_arrange::delete_vector( SEARCH_RADIUS ); + + if(CALCULATION=="relax" || CALCULATION=="cell-relax") + { + IMM.cal_movement(istep, force_step, fcs, en.etot); + + if(IMM.get_converged()) + { + force_step = 1; + + + if(CALCULATION=="cell-relax") + { + LCM.cal_lattice_change(stress_step, scs, en.etot); + converged_stress = LCM.get_converged(); + if(converged_stress) + { + return 1; + } + else + { + Variable_Cell::init_after_vc(); + pot.init_pot(stress_step, pw.strucFac); + + ++stress_step; + return 0; + } + } + else + { + return 1; + } + + } + else + { + CE.istep = force_step; + CE.extrapolate_charge(); + + if(pot.extra_pot=="dm") + { + } + else + { + pot.init_pot( istep, pw.strucFac ); + } + ++force_step; + return 0; + } + } + else + { + return 1; + } + } + + return 0; + + timer::tick("LOOP_ions","force_stress",'D'); +} + +void LOOP_ions::final_scf(void) +{ + TITLE("LOOP_ions","final_scf"); + + FINAL_SCF = true; + + Variable_Cell::final_calculation_after_vc(); + + + //------------------------------------------------------------------ + // THIS PART IS THE SAME AS LOOP_elec::set_matrix_grid + atom_arrange::set_sr_NL(); + + atom_arrange::search( SEARCH_RADIUS ); + + GridT.set_pbc_grid( + pw.ncx, pw.ncy, pw.ncz, + pw.bx, pw.by, pw.bz, + pw.nbx, pw.nby, pw.nbz, + pw.nbxx, pw.nbzp_start, pw.nbzp); + + // (2) If k point is used here, allocate HlocR after atom_arrange. + if(!GAMMA_ONLY_LOCAL) + { + // For each atom, calculate the adjacent atoms in different cells + // and allocate the space for H(R) and S(R). + LNNR.cal_nnr(); + LM.allocate_HS_R(LNNR.nnr); + + // need to first calculae lgd. + // using GridT.init. + LNNR.cal_nnrg(GridT); + } + //------------------------------------------------------------------ + + + + + //------------------------------------------------------------------ + // THIS PART IS THE SAME AS LOOP_elec::before_solver + // (4) set the augmented orbitals index. + // after ParaO and GridT, + // this information is used to calculate + // the force. + LOWF.set_trace_aug(GridT); + + LOC.allocate_dm_wfc(GridT); + + UHM.set_lcao_matrices(); + //------------------------------------------------------------------ + + + + + if(vdwd2_para.flag_vdwd2) //Peize Lin add 2014-04-04, update 2021-03-09 + { + Vdwd2 vdwd2(ucell,vdwd2_para); + vdwd2.cal_energy(); + en.evdw = vdwd2.get_energy(); + } + else if(vdwd3.vdwD3) //jiyy add 2019-05-18 + { + vdwd3.energy(); + en.evdw = vdwd3.energy_result; + } + + + + ELEC_scf es; + es.scf(0); + + if(CALCULATION=="scf" || CALCULATION=="relax" || CALCULATION=="cell-relax") + { + ofs_running << "\n\n --------------------------------------------" << endl; + ofs_running << setprecision(16); + ofs_running << " !FINAL_ETOT_IS " << en.etot * Ry_to_eV << " eV" << endl; + ofs_running << " --------------------------------------------\n\n" << endl; + } + + return; +} diff --git a/ABACUS.develop/source/src_lcao/LOOP_ions.h b/ABACUS.develop/source/src_lcao/LOOP_ions.h new file mode 100644 index 0000000000..cca164f460 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/LOOP_ions.h @@ -0,0 +1,48 @@ +#ifndef LOOP_IONS_H +#define LOOP_IONS_H + +#include "LOOP_elec.h" +#include "../src_ions/ions_move_methods.h" +#include "../src_pw/charge_extra.h" +#include "../src_ions/lattice_change_methods.h" + +class LOOP_ions +{ + + public: + + LOOP_ions(); + ~LOOP_ions(); + + LOOP_elec LOE; + + void opt_ions(void); + void output_HS_R(void); //LiuXh add 2019-07-15 + + private: + + Ions_Move_Methods IMM; + + Lattice_Change_Methods LCM; + + + // PLEASE move 'force_stress()' function to other places, such as FORCE_STRESS.cpp or + // you might think to create a new file, it is because 'force_stress' do not + // belong to 'LOOP_ions', 'pot.init_pot' also do not belong to force_stress() + // the renew of structure factors, etc. should be ran in other places + // the 'IMM' and 'LCM' objects should be passed to force_stress() via parameters list + // mohan note 2021-03-23 + bool force_stress(const int &istep, int &force_step, int &stress_step); + + int istep; + + // electron charge density extropolation method + Charge_Extra CE; + + // PLEASE move final_scf to other places, for example, now it can be put + // in 'src_ions/variable_cell.cpp' + // mohan note 2021-03-23 + void final_scf(void); +}; + +#endif diff --git a/ABACUS.develop/source/src_lcao/Mulliken_Charge.cpp b/ABACUS.develop/source/src_lcao/Mulliken_Charge.cpp deleted file mode 100644 index 5fcbbe078f..0000000000 --- a/ABACUS.develop/source/src_lcao/Mulliken_Charge.cpp +++ /dev/null @@ -1,485 +0,0 @@ -/********************************************************************** - Mulliken_Charge.cpp: - - Mulliken_Charge.cpp is a subrutine to calculate Mulliken charge. - - Log of Mulliken_Charge.cpp: - - 12/Oct/2018 Released by Feng Qi - -***********************************************************************/ - -//#include "../src_pw/global.h" -#include "Mulliken_Charge.h" -#include "../src_lcao/local_orbital_charge.h" -//#include "../src_lcao/sltk_grid_driver.h" -#include "use_overlap_matrix.h" -#include "../src_pw/global.h" -#include "../src_pw/wavefunc.h" -#include "../src_lcao/lcao_matrix.h" -#include "global_fp.h" -//#include "../src_develop/src_wannier/manipulation.h" -//#include "lcao_nnr.h" -#include "lcao_matrix.h" -#include "../src_lcao/global_fp.h" -#include "../src_lcao/wfc_dm_2d.h" -#include "../src_global/lapack_connector.h" -#include "../src_global/scalapack_connector.h" -#include "../src_global/matrix.h" -#include "../src_global/complexmatrix.h" -#include -#include -#include "../src_lcao/sltk_atom_arrange.h" -#include "../src_lcao/lcao_nnr.h" - - - - -Mulliken_Charge::Mulliken_Charge() -{ - M.init(); - if(GAMMA_ONLY_LOCAL) - { - for(int in=0;in [NLOCAL]; - - - DecMulP = new double* [NSPIN]; - for(int is=0; is mud; - mud.resize(1); - mud[0].create(ParaO.ncol,ParaO.nrow); - - - matrix Dwf = M.wfc_gamma[is]; - for (int i=0; i mud; - mud.resize(1); - mud[0].create(ParaO.ncol,ParaO.nrow); - atom_arrange::set_sr_NL(); - atom_arrange::search( SEARCH_RADIUS );//qifeng-2019-01-21 - hm.hon.set_orb_tables(); - LM.allocate_HS_R(LNNR.nnr); - LM.zeros_HSR('S', LNNR.nnr); - UHM.UOM.calculate_S_no(); - UHM.UOM.build_ST_new('S', false); - - - - for(int ik=0;iknw; ++j) - { - int k = ucell.itiaiw2iwt(t,a,j); - ADecMulP[is][i][j] = DecMulP[is][k]; - - } - } - - } - - }//is - - -} - -void Mulliken_Charge::stdout_mulliken(void) -{ this->cal_mulliken(); - if(MY_RANK == 0) - { - - TITLE("Dos","calculate_Mulliken"); - ofstream fout; - const char * fn= "mulliken.txt"; - fout.open(fn); - // ofstream fout; - // string wordqf="mulliken.txt"; - // wordqf += char(MY_RANK + 48); - // wordqf += ".txt"; - // fout.open(wordqf.c_str(),ios::app); - int num,l,m,mul; - double Tcharge; - double* sum_l = new double[2]; - double* sum_mul = new double[2]; - - - string Name_Angular[5][11]; - /* decomposed Mulliken charge */ - - Name_Angular[0][0] = "s "; - Name_Angular[1][0] = "px "; - Name_Angular[1][1] = "py "; - Name_Angular[1][2] = "pz "; - Name_Angular[2][0] = "d3z^2-r^2 "; - Name_Angular[2][1] = "dxy "; - Name_Angular[2][2] = "dxz "; - Name_Angular[2][3] = "dx^2-y^2 "; - Name_Angular[2][4] = "dyz "; - Name_Angular[3][0] = "f5z^2-3r^2 "; - Name_Angular[3][1] = "f5xz^2-xr^2"; - Name_Angular[3][2] = "f5yz^2-yr^2"; - Name_Angular[3][3] = "fzx^2-zy^2 "; - Name_Angular[3][4] = "fxyz "; - Name_Angular[3][5] = "fx^3-3*xy^2"; - Name_Angular[3][6] = "f3yx^2-y^3 "; - Name_Angular[4][0] = "g1 "; - Name_Angular[4][1] = "g2 "; - Name_Angular[4][2] = "g3 "; - Name_Angular[4][3] = "g4 "; - Name_Angular[4][4] = "g5 "; - Name_Angular[4][5] = "g6 "; - Name_Angular[4][6] = "g7 "; - Name_Angular[4][7] = "g8 "; - Name_Angular[4][8] = "g9 "; - fout << "\n CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << endl; - // calculate the total charge of the system. - double sch = 0.0; - fout << setprecision(8); - for(int is=0; isnw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - fout << Name_Angular[L1][m1] << " " << N1 << " " << ADecMulP[0][i][j] << " " << ADecMulP[0][i][j] << endl; - } - }*/ - for (int i=0; i -#include "../src_external/src_pdiag/pdiag_double.h" -#include "../src_external/src_pdiag/GenELPA.h" - - - -class Mulliken_Charge -{ -public: - - Mulliken_Charge(); - ~Mulliken_Charge(); - double** DecMulP ; - double** MecMulP ; - double*** ADecMulP ; - Wfc_Dm_2d M; - - - complex *mug ; - - - - - - - void cal_mulliken(void); - - void stdout_mulliken(void); - - -private: - -}; -#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_lcao/numerical_orbital.cpp b/ABACUS.develop/source/src_lcao/ORB_atomic.cpp similarity index 98% rename from ABACUS.develop/source/src_lcao/numerical_orbital.cpp rename to ABACUS.develop/source/src_lcao/ORB_atomic.cpp index 75c805d781..9d68cbfb44 100644 --- a/ABACUS.develop/source/src_lcao/numerical_orbital.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_atomic.cpp @@ -2,7 +2,7 @@ //AUTHOR : liaochen //DATE : 2008-11-12 //========================================================= -#include "numerical_orbital.h" +#include "ORB_atomic.h" Vector3 Numerical_Orbital::R1; Vector3 Numerical_Orbital::R2; diff --git a/ABACUS.develop/source/src_lcao/numerical_orbital.h b/ABACUS.develop/source/src_lcao/ORB_atomic.h similarity index 98% rename from ABACUS.develop/source/src_lcao/numerical_orbital.h rename to ABACUS.develop/source/src_lcao/ORB_atomic.h index ea64d84621..6f4e2defea 100644 --- a/ABACUS.develop/source/src_lcao/numerical_orbital.h +++ b/ABACUS.develop/source/src_lcao/ORB_atomic.h @@ -7,7 +7,7 @@ #define NUMERICAL_ORBITAL_H #include "../src_pw/tools.h" -#include "numerical_orbital_lm.h" +#include "ORB_atomic_lm.h" //========================================================= //CLASS Num_Orbital diff --git a/ABACUS.develop/source/src_lcao/numerical_orbital_lm.cpp b/ABACUS.develop/source/src_lcao/ORB_atomic_lm.cpp similarity index 97% rename from ABACUS.develop/source/src_lcao/numerical_orbital_lm.cpp rename to ABACUS.develop/source/src_lcao/ORB_atomic_lm.cpp index 1c75f98d47..7a6d724c19 100644 --- a/ABACUS.develop/source/src_lcao/numerical_orbital_lm.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_atomic_lm.cpp @@ -2,9 +2,10 @@ //AUTHOR : liaochen, mohan //DATE : 2008-11-12 //========================================================= -#include "numerical_orbital_lm.h" +#include "ORB_atomic_lm.h" #include "src_global/sph_bessel_recursive.h" #include "src_global/lapack_connector.h" +#include Numerical_Orbital_Lm::Numerical_Orbital_Lm() { @@ -216,9 +217,11 @@ void Numerical_Orbital_Lm::extra_uniform(const double &dr_uniform_in) this->psi_uniform.resize(nr_uniform,0); // do interpolation here to make grid more dense + #pragma omp parallel for schedule(static) for (int ir = 0; ir < this->nr_uniform; ir++) { - this->psi_uniform[ir] = Mathzone_Add1::Uni_RadialF(VECTOR_TO_PTR(this->psi), this->nr, this->rab[0], ir * dr_uniform); + const double psi_uniform_tmp = Mathzone_Add1::Uni_RadialF(VECTOR_TO_PTR(this->psi), this->nr, this->rab[0], ir * dr_uniform); + this->psi_uniform[ir] = psi_uniform_tmp; // this->psi_uniform[ir] = Mathzone::Polynomial_Interpolation(this->psi, this->nr, this->rab[0], ir * dr_uniform); } @@ -494,10 +497,12 @@ void Numerical_Orbital_Lm::cal_kradial_sbpool(void) for( int ir=1; ir!=nr-1; ++ir ) r_tmp[ir] *= (ir&1) ? four_three : two_three; + #pragma omp parallel for schedule(static) for (int ik = 0; ik < nk; ik++) { - this->psif[ik] = pref * LapackConnector::dot( this->nr, VECTOR_TO_PTR(r_tmp), 1, VECTOR_TO_PTR(jl[ik]), 1 ) ; - this->psik[ik] = this->psif[ik] * k_radial[ik]; + const double psi_f_tmp = pref * LapackConnector::dot( this->nr, VECTOR_TO_PTR(r_tmp), 1, VECTOR_TO_PTR(jl[ik]), 1 ) ; + this->psif[ik] = psi_f_tmp; + this->psik[ik] = psi_f_tmp * k_radial[ik]; this->psik2[ik] = this->psik[ik] * k_radial[ik]; } } diff --git a/ABACUS.develop/source/src_lcao/numerical_orbital_lm.h b/ABACUS.develop/source/src_lcao/ORB_atomic_lm.h similarity index 98% rename from ABACUS.develop/source/src_lcao/numerical_orbital_lm.h rename to ABACUS.develop/source/src_lcao/ORB_atomic_lm.h index 4374ac5950..cc1388aab8 100644 --- a/ABACUS.develop/source/src_lcao/numerical_orbital_lm.h +++ b/ABACUS.develop/source/src_lcao/ORB_atomic_lm.h @@ -22,7 +22,8 @@ class Numerical_Orbital_Lm { friend class Numerical_Orbital; -public: + public: + vector psi_uniform;// mohan add 2009-5-10 vector dpsi_uniform; //liaochen add 2010/5/11 @@ -30,8 +31,6 @@ class Numerical_Orbital_Lm double dr_uniform;// mohan add 2009-5-10 double zty; // the valus of psi at 0. -public: - Numerical_Orbital_Lm(); ~Numerical_Orbital_Lm(); @@ -39,7 +38,9 @@ class Numerical_Orbital_Lm // EXPLAIN : set information about Numerical_Orbital_Lm // MEMBER FUNCTION : //========================================================== - enum class Psi_Type{ Psi, Psif, Psik, Psik2 }; // Peize Lin add 2017-12-12 + // Peize Lin add 2017-12-12 + enum class Psi_Type{ Psi, Psif, Psik, Psik2 }; + void set_orbital_info ( const string &label_in, @@ -77,6 +78,7 @@ class Numerical_Orbital_Lm const int &nk_in, const double &dk_in, const double &dr_uniform_in); + void cal_kradial(void); void cal_kradial_sbpool(void); void cal_rradial_sbpool(void); diff --git a/ABACUS.develop/source/src_lcao/hamilt_linear.cpp b/ABACUS.develop/source/src_lcao/ORB_control.cpp similarity index 60% rename from ABACUS.develop/source/src_lcao/hamilt_linear.cpp rename to ABACUS.develop/source/src_lcao/ORB_control.cpp index 408ef12f4e..302e93083f 100644 --- a/ABACUS.develop/source/src_lcao/hamilt_linear.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_control.cpp @@ -1,34 +1,26 @@ #include "../src_pw/tools.h" #include "../src_pw/global.h" -#include "hamilt_linear.h" -#include "sltk_atom_arrange.h" -#include "use_overlap_table.h" -#include "grid_integral.h" +#include "ORB_control.h" +#include "src_global/sltk_atom_arrange.h" +#include "ORB_gen_tables.h" #include "build_st_pw.h" -Hamilt_Linear::Hamilt_Linear() +ORB_control::ORB_control() {} -Hamilt_Linear::~Hamilt_Linear() +ORB_control::~ORB_control() { if(test_deconstructor) { - cout << " ~Hamilt_Linear()" << endl; + cout << " ~ORB_control()" << endl; } } -void Hamilt_Linear::set_orb_tables(void) +void ORB_control::set_orb_tables(void) { - TITLE("Hamilt_Linear","set_orb_tables"); - timer::tick("Hamilt_Linear","set_orb_tables",'B'); + TITLE("ORB_control","set_orb_tables"); + timer::tick("ORB_control","set_orb_tables",'B'); - //xiaohui modify 2013-09-02 - //if(!LINEAR_SCALING) - //{ - // timer::tick("Hamilt_Linear","set_orb_tables",'B'); - // return; //mohan add 2009-12-22 - //} xiaohui modify 2013-09-02. Attention... - //============================================================================= // (1) FUNCTION : use 'info' to generate 'Numerical Orbital' // (1) RESULT : We have 'Numerical Orbital' for calculate S-table and T-table. @@ -37,7 +29,7 @@ void Hamilt_Linear::set_orb_tables(void) if(CALCULATION=="test") { - timer::tick("Hamilt_Linear","set_orb_tables",'B'); + timer::tick("ORB_control","set_orb_tables",'B'); return; } @@ -56,14 +48,18 @@ void Hamilt_Linear::set_orb_tables(void) UOT.set_unit(ucell.lat0); - timer::tick("Hamilt_Linear","set_orb_tables",'B'); + timer::tick("ORB_control","set_orb_tables",'B'); return; } -void Hamilt_Linear::clear_after_ions() +void ORB_control::clear_after_ions(void) { - TITLE("Hamilt_Linear","clear_after_ions"); + TITLE("ORB_control","clear_after_ions"); UOT.MOT.Destroy_Table(); - UOT.MOT.Destroy_Table_Beta(); + UOT.tbeta.Destroy_Table_Beta(); + //caoyu add 2021-03-18 + if (INPUT.out_descriptor && BASIS_TYPE == "lcao") { + UOT.talpha.Destroy_Table_Alpha(); + } return; } diff --git a/ABACUS.develop/source/src_lcao/ORB_control.h b/ABACUS.develop/source/src_lcao/ORB_control.h new file mode 100644 index 0000000000..c69397bc1d --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ORB_control.h @@ -0,0 +1,26 @@ +//========================================================== +// AUTHOR : mohan, ywcui +// Last Update: 2021-02-10 +//========================================================== +#ifndef ORB_CONTROL_H +#define ORB_CONTROL_H + +#include "../src_pw/tools.h" + +#include "ORB_gen_tables.h" +#include "../src_pdiag/pdiag_double.h" + +class ORB_control +{ + + public: + + ORB_control(); + ~ORB_control(); + + // Generate the S(overlap),T,NL matrix. + void set_orb_tables(); + void clear_after_ions(); + +}; +#endif diff --git a/ABACUS.develop/source/src_lcao/make_gaunt_table.cpp b/ABACUS.develop/source/src_lcao/ORB_gaunt_table.cpp similarity index 87% rename from ABACUS.develop/source/src_lcao/make_gaunt_table.cpp rename to ABACUS.develop/source/src_lcao/ORB_gaunt_table.cpp index ed6a1b65f4..b36b373ff0 100644 --- a/ABACUS.develop/source/src_lcao/make_gaunt_table.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_gaunt_table.cpp @@ -1,15 +1,15 @@ -#include "make_gaunt_table.h" +#include "ORB_gaunt_table.h" -Make_Gaunt_Table::Make_Gaunt_Table(){} -Make_Gaunt_Table::~Make_Gaunt_Table(){} +ORB_gaunt_table::ORB_gaunt_table(){} +ORB_gaunt_table::~ORB_gaunt_table(){} -void Make_Gaunt_Table::init_Gaunt(const int &lmax) +void ORB_gaunt_table::init_Gaunt(const int &lmax) { //---------------------------------------------------------- // EXPLAIN : make table of Gaunt Coefficients // --------------------------------------------------------- - TITLE("Make_Gaunt_Table", "init_Gaunt"); - timer::tick("Make_Gaunt_Table", "init_Gaunt",'D'); + TITLE("ORB_gaunt_table", "init_Gaunt"); + timer::tick("ORB_gaunt_table", "init_Gaunt",'D'); const int nlm = (lmax * 2 + 1) * (lmax * 2 + 1); this->Gaunt_Coefficients.create(nlm, nlm, nlm); @@ -84,11 +84,11 @@ void Make_Gaunt_Table::init_Gaunt(const int &lmax) } } - timer::tick("Make_Gaunt_Table", "init_Gaunt",'D'); + timer::tick("ORB_gaunt_table", "init_Gaunt",'D'); return; } -double Make_Gaunt_Table::Cal_Gaunt_single +double ORB_gaunt_table::Cal_Gaunt_single ( const int &L1, const int &m1, const int &L2, const int &m2, @@ -97,7 +97,7 @@ double Make_Gaunt_Table::Cal_Gaunt_single const double &s2, const double &e2 ) { - timer::tick("Make_Gaunt_Table", "Cal_Gaunt_single"); + timer::tick("ORB_gaunt_table", "Cal_Gaunt_single"); if ((L1 - L2 - L) % 2 != 0) { return 0.0; @@ -131,19 +131,19 @@ double Make_Gaunt_Table::Cal_Gaunt_single } result *= ((e1 - s1) / 2) * ((e2 - s2) / 2); - timer::tick("Make_Gaunt_Table", "Cal_Gaunt_single"); + timer::tick("ORB_gaunt_table", "Cal_Gaunt_single"); return result; } -void Make_Gaunt_Table::init_Ylm_Gaunt +void ORB_gaunt_table::init_Ylm_Gaunt ( const int &lmax, const double &s1, const double &e1, const double &s2, const double &e2 ) { - TITLE("Make_Gaunt_Table", "init_Ylm_Gaunt"); - timer::tick("Make_Gaunt_Table", "inite_Ylm_Gaunt"); + TITLE("ORB_gaunt_table", "init_Ylm_Gaunt"); + timer::tick("ORB_gaunt_table", "inite_Ylm_Gaunt"); const int nlm = (2*lmax+1) * (2*lmax+1); @@ -178,11 +178,11 @@ void Make_Gaunt_Table::init_Ylm_Gaunt Mathzone::Ylm_Real(nlm, 256, &g_gaunt[0], this->Ylm_Gaunt); - timer::tick("Make_Gaunt_Table", "init_Ylm_Gaunt"); + timer::tick("ORB_gaunt_table", "init_Ylm_Gaunt"); return; } -int Make_Gaunt_Table::get_lm_index(const int l, const int m) +int ORB_gaunt_table::get_lm_index(const int l, const int m) { return l*l+m; } @@ -192,19 +192,19 @@ int Make_Gaunt_Table::get_lm_index(const int l, const int m) ***********************/ //total pointers -int Make_Gaunt_Table::P_EL(const int& L) +int ORB_gaunt_table::P_EL(const int& L) { return (L+1) * (L+2) * (L+3) * (L+4) / 24; } //effective pointers -int Make_Gaunt_Table::EP_EL(const int& L) +int ORB_gaunt_table::EP_EL(const int& L) { if(L % 2 == 0) return (L+2) * (L+4) * (3*L*L+14*L+24) / 192; else return (L+1) * (L+3) * (L+5) * (3*L+5) / 192; } -int Make_Gaunt_Table::index_func +int ORB_gaunt_table::index_func ( const int& l1, const int& l2, @@ -219,10 +219,10 @@ int Make_Gaunt_Table::index_func return aux1 + aux2 + aux3 + m3; } -void Make_Gaunt_Table::init_Gaunt_CH(const int& Lmax) +void ORB_gaunt_table::init_Gaunt_CH(const int& Lmax) { - TITLE("Make_Gaunt_Table","init_Gaunt_CH"); - timer::tick("Make_Gaunt_Table","init_Gaunt_CH",'D'); + TITLE("ORB_gaunt_table","init_Gaunt_CH"); + timer::tick("ORB_gaunt_table","init_Gaunt_CH",'D'); // assert(Lmax <= 6); // Peize Lin delete 2016-08-26. why? @@ -233,7 +233,7 @@ void Make_Gaunt_Table::init_Gaunt_CH(const int& Lmax) int Eff_Np = this->EP_EL(L); - double mem = Memory::record("Make_Gaunt_Table","Gaunt_CH",Eff_Np * 30, "double"); + double mem = Memory::record("ORB_gaunt_table","Gaunt_CH",Eff_Np * 30, "double"); OUT(ofs_running,"Gaunt_CH (Memory, unit: MB)",mem); int ic1 = 0; @@ -277,12 +277,12 @@ void Make_Gaunt_Table::init_Gaunt_CH(const int& Lmax) } } - timer::tick("Make_Gaunt_Table","init_Gaunt_CH",'D'); + timer::tick("ORB_gaunt_table","init_Gaunt_CH",'D'); return; } //using wigner 3j expression -double Make_Gaunt_Table::Calc_Gaunt_CH +double ORB_gaunt_table::Calc_Gaunt_CH ( const int& l1, const int& m1, @@ -292,8 +292,8 @@ double Make_Gaunt_Table::Calc_Gaunt_CH const int& m3 ) { -// TITLE("Make_Gaunt_Table","Calc_Gaunt_CH"); - timer::tick("Make_Gaunt_Table","Calc_Gaunt_CH"); +// TITLE("ORB_gaunt_table","Calc_Gaunt_CH"); + timer::tick("ORB_gaunt_table","Calc_Gaunt_CH"); double fac = sqrt((2*l1+1) * (2*l2+1) * (2*l3+1) / FOUR_PI); @@ -321,10 +321,10 @@ double Make_Gaunt_Table::Calc_Gaunt_CH return fac * pow(-1.0, l1-l2-m3) * triangle_f * aux1 * aux2; - timer::tick("Make_Gaunt_Table","Calc_Gaunt_CH"); + timer::tick("ORB_gaunt_table","Calc_Gaunt_CH"); } -double Make_Gaunt_Table::Get_Gaunt_CH +double ORB_gaunt_table::Get_Gaunt_CH ( const int& l1, const int& m1, @@ -385,7 +385,7 @@ double Make_Gaunt_Table::Get_Gaunt_CH //Input value //m1, m2, m3 are restricted within 0 to 2l+1 //and should be transformed first -double Make_Gaunt_Table::Get_Gaunt_SH +double ORB_gaunt_table::Get_Gaunt_SH ( const int& l1, const int& mm1, @@ -395,8 +395,8 @@ double Make_Gaunt_Table::Get_Gaunt_SH const int& mm3 ) { -// TITLE("Make_Gaunt_Table","Get_Gaunt_SH"); - timer::tick("Make_Gaunt_Table","Get_Gaunt_SH"); +// TITLE("ORB_gaunt_table","Get_Gaunt_SH"); + timer::tick("ORB_gaunt_table","Get_Gaunt_SH"); //Tranform M index int m1 = Index_M(mm1); @@ -463,11 +463,11 @@ double Make_Gaunt_Table::Get_Gaunt_SH else return 0.0; } - timer::tick("Make_Gaunt_Table","Get_Gaunt_SH"); + timer::tick("ORB_gaunt_table","Get_Gaunt_SH"); } /* // Peize Lin delete 2016-08-26 -void Make_Gaunt_Table::ZEROS() +void ORB_gaunt_table::ZEROS() { for(int ir = 0; ir < 5000; ir++) { @@ -480,7 +480,7 @@ void Make_Gaunt_Table::ZEROS() } */ -double Make_Gaunt_Table::Fact(const int& n) +double ORB_gaunt_table::Fact(const int& n) { double val = 1.0; for(int i = 1; i <= n; i++) @@ -490,7 +490,7 @@ double Make_Gaunt_Table::Fact(const int& n) return val; } -void Make_Gaunt_Table::Swap(int& l1, int& m1, int& l2, int & m2) +void ORB_gaunt_table::Swap(int& l1, int& m1, int& l2, int & m2) { int tmp1, tmp2; if(l1 >= l2) return; @@ -508,7 +508,7 @@ void Make_Gaunt_Table::Swap(int& l1, int& m1, int& l2, int & m2) return; } -int Make_Gaunt_Table::Index_M(const int& m) +int ORB_gaunt_table::Index_M(const int& m) { if(m % 2 == 0) return (- m / 2); else return ((m+1) / 2); diff --git a/ABACUS.develop/source/src_lcao/make_gaunt_table.h b/ABACUS.develop/source/src_lcao/ORB_gaunt_table.h similarity index 95% rename from ABACUS.develop/source/src_lcao/make_gaunt_table.h rename to ABACUS.develop/source/src_lcao/ORB_gaunt_table.h index 46fb98d232..aa09f9c51e 100644 --- a/ABACUS.develop/source/src_lcao/make_gaunt_table.h +++ b/ABACUS.develop/source/src_lcao/ORB_gaunt_table.h @@ -2,18 +2,18 @@ //AUTHOR : Mohan //DATE : 2009-04-23 //========================================================= -#ifndef MAKE_GAUNT_TABLE_H -#define MAKE_GAUNT_TABLE_H +#ifndef ORB_GAUNT_TABLE_H +#define ORB_GAUNT_TABLE_H #include "../src_pw/tools.h" #include -class Make_Gaunt_Table +class ORB_gaunt_table { public: - Make_Gaunt_Table(); - ~Make_Gaunt_Table(); + ORB_gaunt_table(); + ~ORB_gaunt_table(); /*************************************** * Method 2 diff --git a/ABACUS.develop/source/src_lcao/use_overlap_table.cpp b/ABACUS.develop/source/src_lcao/ORB_gen_tables.cpp similarity index 65% rename from ABACUS.develop/source/src_lcao/use_overlap_table.cpp rename to ABACUS.develop/source/src_lcao/ORB_gen_tables.cpp index 08d5ec6a32..c9b2ff6a32 100644 --- a/ABACUS.develop/source/src_lcao/use_overlap_table.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_gen_tables.cpp @@ -1,18 +1,19 @@ -#include "use_overlap_table.h" -#include "ylm.h" -#include "lcao_orbitals.h" -#include "../src_pw/global.h" +#include "src_pw/global.h" +#include "ORB_read.h" +#include "ORB_gen_tables.h" +#include "src_global/ylm.h" -Use_Overlap_Table UOT; +// here is a member of ORB_gen_tables class +ORB_gen_tables UOT; -Use_Overlap_Table::Use_Overlap_Table(){} -Use_Overlap_Table::~Use_Overlap_Table(){} +ORB_gen_tables::ORB_gen_tables(){} +ORB_gen_tables::~ORB_gen_tables(){} // call in hamilt_linear::init_before_ions. -void Use_Overlap_Table::gen_tables( const int &job0 ) +void ORB_gen_tables::gen_tables( const int &job0 ) { - TITLE("Use_Overlap_Table","gen_tables"); - timer::tick("Use_Overlap_Table","gen_tables",'C'); + TITLE("ORB_gen_tables","gen_tables"); + timer::tick("ORB_gen_tables","gen_tables",'C'); ofs_running << "\n SETUP THE TWO-CENTER INTEGRATION TABLES" << endl; @@ -27,31 +28,40 @@ void Use_Overlap_Table::gen_tables( const int &job0 ) ORB.get_dR(),// delta R, for making radial table ORB.get_dk() ); // delta k, for integration in k space + tbeta.allocate( + ORB.get_ntype(),// number of atom types + ORB.get_lmax(),// max L used to calculate overlap + ORB.get_kmesh(), // kpoints, for integration in k space + ORB.get_Rmax(),// max value of radial table + ORB.get_dR(),// delta R, for making radial table + ORB.get_dk() ); // delta k, for integration in k space + + //caoyu add 2021-03-18 + if (INPUT.out_descriptor && BASIS_TYPE == "lcao") { + talpha.allocate( + ORB.get_ntype(),// number of atom types + ORB.get_lmax(),// max L used to calculate overlap + ORB.get_kmesh(), // kpoints, for integration in k space + ORB.get_Rmax(),// max value of radial table + ORB.get_dR(),// delta R, for making radial table + ORB.get_dk()); // delta k, for integration in k space + } + // OV: overlap MOT.init_OV_Tpair(); MOT.init_OV_Opair(); // NL: nonlocal - MOT.init_NL_Tpair(); - MOT.init_NL_Opair(); // add 2009-5-8 - - // if we decompose the VNA into projectors, - // we need to prepare for the vna table. - if(VNA==-1) - { - MVT.allocate( - ORB.get_ntype(),// number of atom types - ORB.get_lmax(),// max L used to calculate overlap - ORB.get_kmesh(), // kpoints, for integration in k space - ORB.get_Rmax(),// max value of radial table - ORB.get_dR(),// delta R, for making radial table - ORB.get_dk() ); // delta k, for integration in k space - - - + tbeta.init_NL_Tpair(); + tbeta.init_NL_Opair(); // add 2009-5-8 + + //caoyu add 2021-03-18 + // DS: Descriptor + if (INPUT.out_descriptor && BASIS_TYPE == "lcao") { + talpha.init_DS_Opair(); + talpha.init_DS_2Lplus1(); } - //========================================= // (2) init Ylm Coef //========================================= @@ -64,7 +74,13 @@ void Use_Overlap_Table::gen_tables( const int &job0 ) //calculate S(R) for interpolation MOT.init_Table(job0); - MOT.init_Table_Beta();// add 2009-5-8 + tbeta.init_Table_Beta( MOT.pSB );// add 2009-5-8 + + //caoyu add 2021-03-18 + if (INPUT.out_descriptor && BASIS_TYPE == "lcao") { + talpha.init_Table_Alpha(MOT.pSB); + talpha.print_Table_DSR(); + } //========================================= // (3) make Gaunt coefficients table @@ -78,11 +94,11 @@ void Use_Overlap_Table::gen_tables( const int &job0 ) - timer::tick("Use_Overlap_Table","gen_tables",'C'); + timer::tick("ORB_gen_tables","gen_tables",'C'); return; } -void Use_Overlap_Table::snap_psibeta( +void ORB_gen_tables::snap_psibeta( double nlm[], const int& job, const Vector3 &R1, @@ -100,11 +116,16 @@ void Use_Overlap_Table::snap_psibeta( complex *nlm1, const int is) const { - //TITLE ("Use_Overlap_Table","snap_psibeta"); - //timer::tick ("Use_Overlap_Table","snap_psibeta"); + //TITLE ("ORB_gen_tables","snap_psibeta"); //optimized by zhengdy-soc - if(NSPIN==4 && ORB.Beta[T0].get_count_soc(is)==0) return; + if(NSPIN==4 && ORB.Beta[T0].get_count_soc(is)==0) + { + return; + } + + timer::tick ("ORB_gen_tables","snap_psibeta",'X'); + bool has_so = 0; if(ORB.Beta[T0].get_count_soc(0)>0 ) has_so = 1; @@ -142,8 +163,8 @@ void Use_Overlap_Table::snap_psibeta( all_out = false; calproj[ip] = true; //length of table for interpolation - rmesh1[ip] = this->MOT.get_rmesh(Rcut1, Rcut0); - rmesh2[ip] = this->MOT.get_rmesh(Rcut2, Rcut0); + rmesh1[ip] = tbeta.get_rmesh(Rcut1, Rcut0); + rmesh2[ip] = tbeta.get_rmesh(Rcut2, Rcut0); } } @@ -152,6 +173,7 @@ void Use_Overlap_Table::snap_psibeta( delete[] calproj; delete[] rmesh1; delete[] rmesh2; + timer::tick ("ORB_gen_tables","snap_psibeta",'X'); return; } @@ -163,19 +185,7 @@ void Use_Overlap_Table::snap_psibeta( double x0a,x1a,x2a,x3a,x123a,x120a,x032a,x031a; double x0b,x1b,x2b,x3b,x123b,x120b,x032b,x031b; - /* - const double position = x / table_interval; - const int iq = static_cast(position); - assert(iq < table_length-4); - const double x0 = position - static_cast(iq); - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - - return x1*x2*(table[iq]*x3+table[iq+3]*x0)/6.0 - + x0*x3*(table[iq+1]*x2-table[iq+2]*x1)/2.0; - */ - psa = distance10 / MOT.dr; + psa = distance10 / tbeta.dr; iqa = static_cast(psa); x0a = psa - static_cast(iqa); x1a = 1.0 - x0a; @@ -186,7 +196,7 @@ void Use_Overlap_Table::snap_psibeta( x032a = x0a*x3a*x2a/2.0; x031a = x0a*x3a*x1a/2.0; - psb = distance20 / MOT.dr; + psb = distance20 / tbeta.dr; iqb = (int) psb; x0b = psb - (double)iqb ; x1b = 1.0 - x0b; @@ -212,6 +222,7 @@ void Use_Overlap_Table::snap_psibeta( //special case for R = 0; const double tiny1 = 1e-12; const double tiny2 = 1e-10; + if(distance10 < tiny1) distance10 += tiny1; if(distance20 < tiny1) distance20 += tiny1; @@ -220,10 +231,10 @@ void Use_Overlap_Table::snap_psibeta( // Notice!!! T1 must be orbital, // T0 must be nonlocal orbital // usage : pairs_nonlocal_type(T1 : orbital, T0 : projector); - const int Tpair1 = this->MOT.NL_Tpair(T1, T0); - const int Tpair2 = this->MOT.NL_Tpair(T2, T0); - const int T1_2Lplus1 = this->MOT.NL_L2plus1(T1, T0); - const int T2_2Lplus1 = this->MOT.NL_L2plus1(T2, T0); + const int Tpair1 = tbeta.NL_Tpair(T1, T0); + const int Tpair2 = tbeta.NL_Tpair(T2, T0); + const int T1_2Lplus1 = tbeta.NL_L2plus1(T1, T0); + const int T2_2Lplus1 = tbeta.NL_L2plus1(T2, T0); //gaunt index const int gindex1 = L1*L1+m1; @@ -235,8 +246,14 @@ void Use_Overlap_Table::snap_psibeta( vector> grlyb; Ylm::rl_sph_harm (T1_2Lplus1-1, dRa.x, dRa.y, dRa.z, rlya); - if (job == 0) Ylm::rl_sph_harm (T2_2Lplus1-1, dRb.x, dRb.y, dRb.z, rlyb); - else Ylm::grad_rl_sph_harm (T2_2Lplus1-1, dRb.x, dRb.y, dRb.z, rlyb, grlyb); + if (job == 0) + { + Ylm::rl_sph_harm (T2_2Lplus1-1, dRb.x, dRb.y, dRb.z, rlyb); + } + else + { + Ylm::grad_rl_sph_harm (T2_2Lplus1-1, dRb.x, dRb.y, dRb.z, rlyb, grlyb); + } //============================================================================== // Formula : T1 T0 T0 T2 // sum_{L0}sum_{m0} @@ -246,10 +263,15 @@ void Use_Overlap_Table::snap_psibeta( // mohan update 2011-03-07 int n_projection =1; - if(has_so) n_projection = ORB.Beta[T0].get_nproj_soc(); + if(has_so) + { + n_projection = ORB.Beta[T0].get_nproj_soc(); + } + vector> term_a_nc(n_projection,{0,0}); // Peize Lin change ptr to vector at 2020.01.31 vector> term_b_nc(n_projection,{0,0}); // Peize Lin change ptr to vector at 2020.01.31 int ip = -1; + for(int nb=0; nb - const int Opair1 = this->MOT.NL_Opair(Tpair1, L1, N1, nb); + const int Opair1 = tbeta.NL_Opair(Tpair1, L1, N1, nb); // - const int Opair2 = this->MOT.NL_Opair(Tpair2, L2, N2, nb); + const int Opair2 = tbeta.NL_Opair(Tpair2, L2, N2, nb); for(int m0=0; m0<2*L0+1; m0++) @@ -290,9 +319,7 @@ void Use_Overlap_Table::snap_psibeta( double Interp_Vnla = 0.0; if (distance10 > tiny2) { - //Interp_Vnla = i_exp * Mathzone::Polynomial_Interpolation( - //this->MOT.Table_NR[0][Tpair1][Opair1][L], rmesh1, this->MOT.dr, distance10); - curr = this->MOT.Table_NR[0][Tpair1][Opair1][L]; + curr = tbeta.Table_NR[0][Tpair1][Opair1][L]; if( iqa >= rmesh1[nb]-4) { Interp_Vnla = 0.0; @@ -305,7 +332,7 @@ void Use_Overlap_Table::snap_psibeta( } else { - Interp_Vnla = i_exp * this->MOT.Table_NR[0][Tpair1][Opair1][L][0]; + Interp_Vnla = i_exp * tbeta.Table_NR[0][Tpair1][Opair1][L][0]; } //------------------------------------------ @@ -320,37 +347,6 @@ void Use_Overlap_Table::snap_psibeta( } } //end L - - // for test - /* - if( abs(term_a)>1.0e-5 && NURSE) - { - if(R1.x==0 && R1.y==0 && R1.z==0) - { - // cout << endl; - // cout << " R1=" << R1.x << " " << R1.y << " " << R1.z << endl; - // cout << " R0=" << R0.x << " " << R0.y << " " << R0.z << endl; - stringstream label; - stringstream phi; - if(nb==0) label<<"s"< tiny2) { - //Interp_Vnlb = i_exp * Mathzone::Polynomial_Interpolation( - //this->MOT.Table_NR[0][Tpair2][Opair2][L], rmesh2, this->MOT.dr, distance20); - curr = this->MOT.Table_NR[0][Tpair2][Opair2][L]; + curr = tbeta.Table_NR[0][Tpair2][Opair2][L]; - if( iqb >= rmesh2[nb]-4) Interp_Vnlb = 0.0; - else Interp_Vnlb = i_exp * (x123b*curr[iqb]+x120b*curr[iqb+3]+x032b*curr[iqb+1]-curr[iqb+2]*x031b); + if( iqb >= rmesh2[nb]-4) + { + Interp_Vnlb = 0.0; + } + else + { + Interp_Vnlb = i_exp * (x123b*curr[iqb]+x120b*curr[iqb+3]+x032b*curr[iqb+1]-curr[iqb+2]*x031b); + } Interp_Vnlb /= rl2; } else { - Interp_Vnlb = i_exp * this->MOT.Table_NR[0][Tpair2][Opair2][L][0]; + Interp_Vnlb = i_exp * tbeta.Table_NR[0][Tpair2][Opair2][L][0]; } @@ -388,14 +388,16 @@ void Use_Overlap_Table::snap_psibeta( { if (distance20 > tiny2) { - //Interp_Vnlc = i_exp * Mathzone::Polynomial_Interpolation( - //this->MOT.Table_NR[1][Tpair2][Opair2][L], rmesh2, this->MOT.dr, distance20); - - curr = this->MOT.Table_NR[1][Tpair2][Opair2][L]; + curr = tbeta.Table_NR[1][Tpair2][Opair2][L]; - if( iqb >= rmesh2[nb]-4) Interp_Vnlc = 0.0; - else Interp_Vnlc = i_exp * (x123b*curr[iqb]+x120b*curr[iqb+3]+x032b*curr[iqb+1]-curr[iqb+2]*x031b); - + if( iqb >= rmesh2[nb]-4) + { + Interp_Vnlc = 0.0; + } + else + { + Interp_Vnlc = i_exp * (x123b*curr[iqb]+x120b*curr[iqb+3]+x032b*curr[iqb+1]-curr[iqb+2]*x031b); + } Interp_Vnlc = Interp_Vnlc / pow(distance20, L) - Interp_Vnlb * L / distance20; } else @@ -421,10 +423,13 @@ void Use_Overlap_Table::snap_psibeta( } case 1: // calculate the derivative part. { + double tt1 = tmpGaunt * Interp_Vnlc * rlyb[lm] / distance20; + double tt2 = tmpGaunt * Interp_Vnlb; + for(int ir = 0; ir < 3; ir++) { - term_c[ir] += tmpGaunt * (Interp_Vnlc * rlyb[lm] * unit_vec_dRb[ir] / distance20 - + Interp_Vnlb * grlyb[lm][ir]); + term_c[ir] += tt1 * unit_vec_dRb[ir] + + tt2 * grlyb[lm][ir]; } break; @@ -442,10 +447,6 @@ void Use_Overlap_Table::snap_psibeta( term_b_nc[ip] = term_b; } - - - - //=============================================== // THIRD PART: SUM THE VALUE FROM ALL PROJECTS. //=============================================== @@ -454,15 +455,10 @@ void Use_Overlap_Table::snap_psibeta( case 0://calculate the overlap part. { //nlm[0] += term_a * term_b * ORB.Beta[T0].getCoefficient_D(L0, L0);//LiuXh 2016-01-14 - if(!has_so) nlm[0] += term_a * term_b * ORB.Beta[T0].getCoefficient_D(nb, nb);//LiuXh 2016-01-14 -/* else if(nlm1!=NULL) + if(!has_so) { - + nlm[0] += term_a * term_b * ORB.Beta[T0].getCoefficient_D(nb, nb);//LiuXh 2016-01-14 } - else - { - WARNING_QUIT("Use_Overlap_Table::snap_psibeta","something wrong with snap_psibeta."); - }*/ break; } case 1: //calculate the derivative part. @@ -470,10 +466,9 @@ void Use_Overlap_Table::snap_psibeta( for(int jr = 0; jr < 3; jr++) { //nlm[jr] += term_c[jr] * term_a * ORB.Beta[T0].getCoefficient_D(L0, L0);//LiuXh 2016-01-14 - if(!has_so) nlm[jr] += term_c[jr] * term_a * ORB.Beta[T0].getCoefficient_D(nb, nb);//LiuXh 2016-01-14 - else + if(!has_so) { - + nlm[jr] += term_c[jr] * term_a * ORB.Beta[T0].getCoefficient_D(nb, nb);//LiuXh 2016-01-14 } } break; @@ -482,16 +477,10 @@ void Use_Overlap_Table::snap_psibeta( } }//!m0 }//!L0 + //zhengdy-soc, calculate non-local term if(has_so) { - /*for(int p1=0;p1 *olm1)const { - //TITLE("Use_Overlap_Table","snap_psipsi"); - //timer::tick ("Use_Overlap_Table", "snap_psipsi"); + //TITLE("ORB_gen_tables","snap_psipsi"); + //timer::tick ("ORB_gen_tables", "snap_psipsi"); if(job != 0 && job != 1) { - WARNING_QUIT("Use_Overlap_Table::snap_psipsi","job must be equal to 0 or 1!"); + WARNING_QUIT("ORB_gen_tables::snap_psipsi","job must be equal to 0 or 1!"); } Numerical_Orbital::set_position(R1, R2); @@ -695,7 +690,7 @@ void Use_Overlap_Table::snap_psipsi( } else { - WARNING_QUIT("Use_Overlap_Table::snap_psipsi","something wrong!"); + WARNING_QUIT("ORB_gen_tables::snap_psipsi","something wrong!"); } @@ -786,7 +781,7 @@ void Use_Overlap_Table::snap_psipsi( } else { - WARNING_QUIT("Use_Overlap_Table::snap_psipsi","something wrong in T."); + WARNING_QUIT("ORB_gen_tables::snap_psipsi","something wrong in T."); } break; } @@ -805,53 +800,204 @@ void Use_Overlap_Table::snap_psipsi( }// end T: : break; } -// timer::tick ("Use_Overlap_Table", "snap_psipsi"); +// timer::tick ("ORB_gen_tables", "snap_psipsi"); return; } -double Use_Overlap_Table::get_distance( const Vector3 &R1, const Vector3 &R2)const +double ORB_gen_tables::get_distance( const Vector3 &R1, const Vector3 &R2)const { assert( this->lat0 > 0.0); Vector3 dR = R1 - R2; return dR.norm() * this->lat0; } -void Use_Overlap_Table::snap_phiVna( - double VnaMat[], +//caoyu add 2021-03-17 +void ORB_gen_tables::snap_psialpha( + double olm[], const int& job, - const Vector3 &Rv, - const int& itv, - const int& l1, + const Vector3& R1, + const int& T1, + const int& L1, const int& m1, - const int& n1, - const Vector3 &Ru, - const int& itu, - const int& l2, + const int& N1, + const Vector3& R2, + const int& T2, + const int& L2, const int& m2, - const int& n2, - const Vector3 &Rvna, - const int& itvna) const + const int& N2, + complex* olm1, + const int is) const { - cout << " snap phiVna " << endl; + if (job != 0 && job != 1) + { + WARNING_QUIT("ORB_gen_tables::snap_psialpha", "job must be equal to 0 or 1!"); + } + + Numerical_Orbital::set_position(R1, R2); + assert(this->lat0 > 0.0); + + // (1) get distance between R1 and R2 (a.u.) + // judge if there exist overlap + double distance = Numerical_Orbital::get_distance() * this->lat0; + + const double Rcut1 = ORB.Phi[T1].getRcut(); + const double Rcut2 = ORB.Alpha[0].getRcut(); + + if (job == 0) ZEROS(olm, 1); + else if (job == 1) ZEROS(olm, 3); + + if (distance > (Rcut1 + Rcut2)) return; + + //if distance == 0 + //\int psi(r) psi(r-R) dr independent of R if R == 0 + //distance += tiny1 avoid overflow during calculation + const double tiny1 = 1e-12; + const double tiny2 = 1e-10; + if (distance < tiny1) distance += tiny1; + + // (2) if there exist overlap, calculate the mesh number + // between two atoms + const int rmesh = this->talpha.get_rmesh(Rcut1, Rcut2); + + // (3) Find three dimension of 'Table_DS' + // dim1 : type pairs, equal to T1 here + // dim2 : radial orbital pairs, + // dim3 : find lmax between T1 and T2, and get lmax*2+1 + const int dim1 = T1; + int dim2 = this->talpha.DS_Opair(dim1, L1, L2, N1, N2); + int dim3 = this->talpha.DS_2Lplus1[T1]; + + //Gaunt Index + const int gindex1 = L1 * L1 + m1; + const int gindex2 = L2 * L2 + m2; + + // Peize Lin change rly, grly 2016-08-26 + vector rly; + vector> grly; + + double arr_dR[3]; + arr_dR[0] = Numerical_Orbital::getX() * this->lat0; + arr_dR[1] = Numerical_Orbital::getY() * this->lat0; + arr_dR[2] = Numerical_Orbital::getZ() * this->lat0; + + //double xdr = arr_dR[0] / distance; + //double ydr = arr_dR[1] / distance; + //double zdr = arr_dR[2] / distance; + //======================= + // *r**l*Ylm_real + // include its derivations + //======================= + if (job == 0) + { + Ylm::rl_sph_harm(dim3 - 1, arr_dR[0], arr_dR[1], arr_dR[2], rly); + } + else + { + Ylm::grad_rl_sph_harm(dim3 - 1, arr_dR[0], arr_dR[1], arr_dR[2], rly, grly); + } - int lmax = 2; - int nzeta = 1; - for(int L0=0; L0<=lmax; ++L0) + for (int L = 0; L < dim3; L++) //maxL = dim3-1 { - for(int m0=0; m0<2*L0+1; ++m0) + //=========================================================== + // triangle rule for L and sum of L, L1, L2 should be even + //=========================================================== + int AL = L1 + L2; + int SL = abs(L1 - L2); + + if ((L > AL) || (L < SL) || ((L - SL) % 2 == 1)) continue; + + double Interp_Slm = 0.0; + double Interp_dSlm = 0.0; + double tmpOlm0 = 0.0; + double tmpOlm1 = 0.0; + + // prefactor + double i_exp = pow(-1.0, (L1 - L2 - L) / 2); + double rl = pow(distance, L); + + if (distance > tiny2) + { + Interp_Slm = i_exp * Mathzone::Polynomial_Interpolation( + talpha.Table_DSR[0][dim1][dim2][L], rmesh, MOT.dr, distance); + Interp_Slm /= rl; + } + else // distance = 0.0; { - for(int N0=0; N0 tiny2) { - - - - - } + Interp_dSlm = i_exp * Mathzone::Polynomial_Interpolation( + talpha.Table_DSR[1][dim1][dim2][L], rmesh, MOT.dr, distance); + Interp_dSlm = Interp_dSlm / pow(distance, L) - Interp_Slm * L / distance; + } + else + { + Interp_dSlm = 0.0; + } } + + for (int m = 0; m < 2 * L + 1; m++) + { + int gindex = L * L + m; + // double tmpGaunt1 = MGT.Get_Gaunt_SH(L1, m1, L2, m2, L, m); + double tmpGaunt = MGT.Gaunt_Coefficients(gindex1, gindex2, gindex); + + tmpOlm0 = Interp_Slm * tmpGaunt; + + if (job == 1) + { + tmpOlm1 = Interp_dSlm * tmpGaunt; + } + + switch (job) + { + case 0: // calculate overlap. + { + if (NSPIN != 4) olm[0] += tmpOlm0 * rly[MGT.get_lm_index(L, m)]; + else if (olm1 != NULL) + { + olm1[0] += tmpOlm0 * rly[MGT.get_lm_index(L, m)]; + olm1[1] += 0;//tmpOlm0 * (tmp(0,0)+tmp(0,1)); + olm1[2] += 0;//tmpOlm0 * (tmp(1,0)+tmp(1,1)); + olm1[3] += tmpOlm0 * rly[MGT.get_lm_index(L, m)]; + + } + else + { + WARNING_QUIT("ORB_gen_tables::snap_psialpha", "something wrong!"); + + } + + /* + if( abs ( tmpOlm0 * rly[ MGT.get_lm_index(L, m) ] ) > 1.0e-3 ) + { + cout << " L=" << L << " m=" << m << " tmpOlm0=" << tmpOlm0 + << " rly=" << rly[ MGT.get_lm_index(L, m) ] + << " r=" << olm[0] + << endl; + } + */ + break; + } + case 1: // calculate gradient. + { + for (int ir = 0; ir < 3; ir++) + { + olm[ir] += tmpOlm0 * grly[MGT.get_lm_index(L, m)][ir] + + tmpOlm1 * rly[MGT.get_lm_index(L, m)] * arr_dR[ir] / distance; + } + break; + } + default: break; + } + }//!m } - WARNING_QUIT("Use_Overlap_Table::snap_phiVna","not ready yet"); + return; } - diff --git a/ABACUS.develop/source/src_lcao/use_overlap_table.h b/ABACUS.develop/source/src_lcao/ORB_gen_tables.h similarity index 57% rename from ABACUS.develop/source/src_lcao/use_overlap_table.h rename to ABACUS.develop/source/src_lcao/ORB_gen_tables.h index d448f604ac..487cf48ead 100644 --- a/ABACUS.develop/source/src_lcao/use_overlap_table.h +++ b/ABACUS.develop/source/src_lcao/ORB_gen_tables.h @@ -5,21 +5,25 @@ #ifndef USE_OVERLAP_TABLE_H #define USE_OVERLAP_TABLE_H -#include "../src_pw/tools.h" -#include "make_overlap_table.h" -#include "make_vna_table.h" -#include "make_gaunt_table.h" -#include "ylm.h" +#include "src_pw/tools.h" +#include "ORB_gaunt_table.h" +#include "src_global/ylm.h" +#include "ORB_table_beta.h" +#include "ORB_table_phi.h" +#include "ORB_table_alpha.h" //caoyu add 2020-3-18 -class Use_Overlap_Table +//------------------------------------ +// used to be 'Use_Overlap_Table', +// now the name is 'ORB_gen_tables' +//------------------------------------ +class ORB_gen_tables { public: - friend class Use_Vna_Table; - friend class Hamilt_Linear; + friend class ORB_control; - Use_Overlap_Table(); - ~Use_Overlap_Table(); + ORB_gen_tables(); + ~ORB_gen_tables(); void gen_tables( const int &job0 ); void set_unit( const double &v ){lat0=v;} @@ -60,34 +64,38 @@ class Use_Overlap_Table complex *nlm1=NULL, const int is=0)const; - //------------------------------------------------------ - // snap_phiVna : Get Matrix Element of - //------------------------------------------------------ - void snap_phiVna( - double VnaMat[], - const int &job, - const Vector3 &Rv, - const int &itv, - const int &l1, - const int &m1, - const int &n1, - const Vector3 &Ru, - const int &itu, - const int &l2, - const int &m2, - const int &n2, - const Vector3 &Rvna, - const int &itvna) const; + //caoyu add 2021-03-17 + //job = 0 for vnl matrix elements + //job = 1 for its derivatives + void snap_psialpha( + double olm[], + const int& job, + const Vector3& R1, + const int& I1, + const int& l1, + const int& m1, + const int& n1, + const Vector3& R2, + const int& I2, + const int& l2, + const int& m2, + const int& n2, + complex* olm1 = NULL, + const int is = 0)const; - Make_Overlap_Table MOT; - Make_Vna_Table MVT; // set as public because in hamilt_linear, // we need to destroy the tables: SR,TR,NR // after ionic optimization is done. + ORB_table_phi MOT; + ORB_table_beta tbeta; + + // if we want to add table for descriptors, + // we should consider here -- mohan 2021-02-09 + ORB_table_alpha talpha; //caoyu add 2021-03-17 private: - Make_Gaunt_Table MGT; + ORB_gaunt_table MGT; double get_distance(const Vector3 &R1, const Vector3 &R2)const; @@ -95,6 +103,6 @@ class Use_Overlap_Table }; -extern Use_Overlap_Table UOT; +extern ORB_gen_tables UOT; #endif diff --git a/ABACUS.develop/source/src_lcao/numerical_nonlocal.cpp b/ABACUS.develop/source/src_lcao/ORB_nonlocal.cpp similarity index 89% rename from ABACUS.develop/source/src_lcao/numerical_nonlocal.cpp rename to ABACUS.develop/source/src_lcao/ORB_nonlocal.cpp index ed2c8c3556..bf60401f0e 100644 --- a/ABACUS.develop/source/src_lcao/numerical_nonlocal.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_nonlocal.cpp @@ -2,7 +2,7 @@ //AUTHOR : liaochen //DATE : 2008-03-04 //========================================================= -#include "numerical_nonlocal.h" +#include "ORB_nonlocal.h" Numerical_Nonlocal::Numerical_Nonlocal() { @@ -87,9 +87,11 @@ void Numerical_Nonlocal::set_type_info ZEROS(this->non_zero_count_soc, 4); if(lmax_in > -1) //LiuXh add 20180328, fix bug of Hydrogen element with single projector pseudopot { //LiuXh add 20180328 - for (int L1 = 0; L1 < nproj + 1; L1++) +// for (int L1 = 0; L1 < nproj + 1; L1++) + for (int L1 = 0; L1 < min(this->Coefficient_D.nr, Coefficient_D_in.nr); L1++) { - for (int L2 = 0; L2 < nproj + 1; L2++) +// for (int L2 = 0; L2 < nproj + 1; L2++) + for (int L2 = 0; L2 < min(this->Coefficient_D.nc, Coefficient_D_in.nc); L2++) { this->Coefficient_D(L1, L2) = Coefficient_D_in(L1, L2); } @@ -122,7 +124,8 @@ void Numerical_Nonlocal::set_type_info for (int L2 = 0; L2 < nproj_soc; L2++) { this->Coefficient_D_so(is, L1, L2) = Coefficient_D_in_so(L1 + nproj_soc*is1, L2 + nproj_soc*is2); - if(fabs(this->Coefficient_D_so(is, L1, L2).real())>eps8 || fabs(this->Coefficient_D_so(is, L1, L2).imag())>eps8) + if(fabs(this->Coefficient_D_so(is, L1, L2).real())>1.0e-8 || + fabs(this->Coefficient_D_so(is, L1, L2).imag())>1.0e-8 ) { this->index1_soc[is][non_zero_count_soc[is]] = L1; this->index2_soc[is][non_zero_count_soc[is]] = L2; @@ -148,7 +151,8 @@ void Numerical_Nonlocal::set_type_info { if(is==1||is==2) this->Coefficient_D_so(is, L1, L2) = ZERO; else this->Coefficient_D_so(is, L1, L2) = Coefficient_D_in_so(L1 + nproj_soc*is1, L2 + nproj_soc*is2); - if(abs(this->Coefficient_D_so(is, L1, L2).real())>eps8 || abs(this->Coefficient_D_so(is, L1, L2).imag())>eps8) + if(abs(this->Coefficient_D_so(is, L1, L2).real())>1.0e-8 + || abs(this->Coefficient_D_so(is, L1, L2).imag())>1.0e-8) { this->index1_soc[is][non_zero_count_soc[is]] = L1; this->index2_soc[is][non_zero_count_soc[is]] = L2; diff --git a/ABACUS.develop/source/src_lcao/numerical_nonlocal.h b/ABACUS.develop/source/src_lcao/ORB_nonlocal.h similarity index 98% rename from ABACUS.develop/source/src_lcao/numerical_nonlocal.h rename to ABACUS.develop/source/src_lcao/ORB_nonlocal.h index 012036c61a..308fa52ee8 100644 --- a/ABACUS.develop/source/src_lcao/numerical_nonlocal.h +++ b/ABACUS.develop/source/src_lcao/ORB_nonlocal.h @@ -6,7 +6,7 @@ #define NUMERICAL_NONLOCAL_H #include "../src_pw/tools.h" -#include "numerical_nonlocal_lm.h" +#include "ORB_nonlocal_lm.h" //========================================================= //CLASS Numerical_Nonlocal //Note : contain nonlocal ps(:pseudopotential) information diff --git a/ABACUS.develop/source/src_lcao/numerical_nonlocal_lm.cpp b/ABACUS.develop/source/src_lcao/ORB_nonlocal_lm.cpp similarity index 99% rename from ABACUS.develop/source/src_lcao/numerical_nonlocal_lm.cpp rename to ABACUS.develop/source/src_lcao/ORB_nonlocal_lm.cpp index 52283bd3fd..d693f7a6da 100644 --- a/ABACUS.develop/source/src_lcao/numerical_nonlocal_lm.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_nonlocal_lm.cpp @@ -2,7 +2,7 @@ //AUTHOR : liaochen //DATE : 2008-03-04 //========================================================= -#include "numerical_nonlocal_lm.h" +#include "ORB_nonlocal_lm.h" #include "../src_pw/global.h" Numerical_Nonlocal_Lm::Numerical_Nonlocal_Lm() diff --git a/ABACUS.develop/source/src_lcao/numerical_nonlocal_lm.h b/ABACUS.develop/source/src_lcao/ORB_nonlocal_lm.h similarity index 98% rename from ABACUS.develop/source/src_lcao/numerical_nonlocal_lm.h rename to ABACUS.develop/source/src_lcao/ORB_nonlocal_lm.h index 5718d0a43a..4f3eaf42f5 100644 --- a/ABACUS.develop/source/src_lcao/numerical_nonlocal_lm.h +++ b/ABACUS.develop/source/src_lcao/ORB_nonlocal_lm.h @@ -15,13 +15,14 @@ class Numerical_Nonlocal_Lm { -public: + public: + double* beta_uniform; double* dbeta_uniform; int nr_uniform; double dr_uniform; -public: + public: Numerical_Nonlocal_Lm(); ~Numerical_Nonlocal_Lm(); @@ -57,7 +58,7 @@ class Numerical_Nonlocal_Lm void plot()const; -private: + private: void freemem(void); void renew(void); diff --git a/ABACUS.develop/source/src_lcao/lcao_orbitals.cpp b/ABACUS.develop/source/src_lcao/ORB_read.cpp similarity index 76% rename from ABACUS.develop/source/src_lcao/lcao_orbitals.cpp rename to ABACUS.develop/source/src_lcao/ORB_read.cpp index 305ca5ad27..bd85939faa 100644 --- a/ABACUS.develop/source/src_lcao/lcao_orbitals.cpp +++ b/ABACUS.develop/source/src_lcao/ORB_read.cpp @@ -1,10 +1,12 @@ -#include "lcao_orbitals.h" +#include "ORB_read.h" #include "../src_pw/global.h" // only use ucell.atoms[it] #include // Peize Lin fix bug about strcmp 2016-08-02 //============================== -// Define a object here! +// Define an object here! //============================== +// PLEASE avoid using 'ORB' as global variable +// mohan note 2021-03-23 LCAO_Orbitals ORB; LCAO_Orbitals::LCAO_Orbitals() @@ -12,7 +14,7 @@ LCAO_Orbitals::LCAO_Orbitals() this->nchimax = 0;// this initialzied must specified this->Phi = new Numerical_Orbital[1]; this->Beta = new Numerical_Nonlocal[1]; - this->Vna = new Neutral_Pot[1]; + this->Alpha = new Numerical_Orbital[1]; this->nproj = new int[1]; this->nprojmax = 0; @@ -20,6 +22,7 @@ LCAO_Orbitals::LCAO_Orbitals() this->dr_uniform = 0.001; } + LCAO_Orbitals::~LCAO_Orbitals() { if(test_deconstructor) @@ -28,7 +31,7 @@ LCAO_Orbitals::~LCAO_Orbitals() } delete[] Phi; delete[] Beta; - delete[] Vna; + delete[] Alpha; delete[] nproj; } @@ -55,6 +58,8 @@ void LCAO_Orbitals::bcast_files(void) string ofile; string nfile; +// PLEASE avoid using 'MY_RANK' as global variable +// mohan note 2021-03-23 if(MY_RANK==0) { ofile = orbital_file[it]; @@ -65,6 +70,8 @@ void LCAO_Orbitals::bcast_files(void) // nfile = nonlocal_file[it]; } +// PLEASE avoid using 'bcast_string' as global variable +// mohan note 2021-03-23 Parallel_Common::bcast_string(ofile); //----------------------------------- // Turn off the read in NONLOCAL file @@ -89,6 +96,7 @@ void LCAO_Orbitals::bcast_files(void) } #endif + void LCAO_Orbitals::Read_Orbitals(void) { TITLE("LCAO_Orbitals", "Read_Orbitals"); @@ -108,8 +116,6 @@ void LCAO_Orbitals::Read_Orbitals(void) ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl; ofs_running << "\n\n\n\n"; - - //-------------------------- //(1) check dk, dR, Rmax. //-------------------------- @@ -141,7 +147,6 @@ void LCAO_Orbitals::Read_Orbitals(void) OUT(ofs_running,"atom label",ucell.atoms[i].label); } - //------------------------------------------------- //(2) set the kmesh according to ecutwfc and dk. //------------------------------------------------- @@ -160,6 +165,8 @@ void LCAO_Orbitals::Read_Orbitals(void) this->kmesh = static_cast( sqrt(ecutwfc) / dk ) + 4; } +// PLEASE avoid using 'INPUT.' as global variable +// mohan note 2021-03-23 // jingan add for calculate r(R) matrix if(INPUT.out_r_matrix) kmesh = kmesh * 4; @@ -169,36 +176,21 @@ void LCAO_Orbitals::Read_Orbitals(void) //----------------------------------------------------------------- - - - - - - - - - //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //~~~~~~~~~~~~~~~~~~~~~~ 1 ~~~~~~~~~~~~~~~~~~~~~~~~~ // Read in numerical atomic orbitals for each atom type. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> delete[] this->Phi; +// PLEASE avoid using 'ucell' as global variable +// if 'ntype' is really needed, the variable should be initialized +// as a parameter of this class +// mohan note 2021-03-23 this->Phi = new Numerical_Orbital[ucell.ntype]; for(int it=0; itRead_PAO(it); } - - - - - - - - - - //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //~~~~~~~~~~~~~~~~~~~~~~ 2 ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -238,44 +230,25 @@ void LCAO_Orbitals::Read_Orbitals(void) this->set_nl_index(); ofs_running << " max number of nonlocal projetors among all species is " << nprojmax << endl; - - - - - - - - + //caoyu add 2021-3-16 //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //~~~~~~~~~~~~~~~~~~~~~~ 3 ~~~~~~~~~~~~~~~~~~~~~~~~~ - // Setup one dimensional neutral potential for each - // element. Vna = Vl_pseudo + Vh_atomic + // Read in numerical basis for descriptor. //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - delete[] this->Vna; - this->Vna = new Neutral_Pot[ucell.ntype]; - - for(int it=0; itPhi[it], dr_uniform ); - } - } - - - - - - - + + delete[] this->Alpha; + this->Alpha = new Numerical_Orbital[1]; //not related to atom type -- remain to be discussed + this->Read_Descriptor(); + } timer::tick("LCAO_Orbitals","Read_Orbitals",'C'); return; @@ -294,6 +267,10 @@ void LCAO_Orbitals::Set_NonLocal(const int &it, int &n_projectors) // get the number of non-local projectors n_projectors = atom->nbeta; + + +// PLEASE avoid using capital letters for local variables +// mohan note 2021-03-23 const int N_PROJECTORS = atom->nh;//zhengdy-soc //cout << " number of projectros " << N_PROJECTORS << endl; // cout << " number of projectros " << n_projectors << endl; @@ -352,8 +329,19 @@ void LCAO_Orbitals::Set_NonLocal(const int &it, int &n_projectors) } - WARNING("LCAO_Orbitals::Set_NonLocal","bug in line "+TO_STRING(__LINE__)+", matrix ic>=nc"); // Peize Lin add 2019-01-23 - this->Beta[it].set_type_info(it, atom->label, atom->pp_type, atom->lmax, Coefficient_D_in, Coefficient_D_in_so, n_projectors, 0, atom->lll, tmpBeta_lm, 0);//LiuXh 2016-01-14, 2016-07-19 + WARNING("LCAO_Orbitals::Set_NonLocal","bug in line "+TO_STRING(__LINE__)+", matrix ic>=nc"); + // Peize Lin add 2019-01-23 + this->Beta[it].set_type_info(it, + atom->label, + atom->pp_type, + atom->lmax, + Coefficient_D_in, + Coefficient_D_in_so, + n_projectors, + 0, + atom->lll, + tmpBeta_lm, + 0);//LiuXh 2016-01-14, 2016-07-19 } else//added by zhengdy-soc { @@ -362,8 +350,10 @@ void LCAO_Orbitals::Set_NonLocal(const int &it, int &n_projectors) { lmaxkb = max( lmaxkb, ucell.atoms[it].lll[ibeta]); } + soc.rot_ylm(lmaxkb); soc.fcoef.create(ucell.ntype, ucell.atoms[it].nh, ucell.atoms[it].nh); + int ip1=0; for(int p1 = 0; p1Beta[it].set_type_info(it, atom->label, atom->pp_type, atom->lmax, Coefficient_D_in, Coefficient_D_in_so, n_projectors, N_PROJECTORS, atom->lll, tmpBeta_lm, 1);//zhengdy-soc 2018-09-10 + + this->Beta[it].set_type_info( + it, + atom->label, + atom->pp_type, + atom->lmax, + Coefficient_D_in, + Coefficient_D_in_so, + n_projectors, + N_PROJECTORS, + atom->lll, + tmpBeta_lm, + 1);//zhengdy-soc 2018-09-10 + }//end if delete[] tmpBeta_lm; cout << " Set NonLocal Pseudopotential Projectors " << endl; - - return; } @@ -697,7 +699,7 @@ void LCAO_Orbitals::Read_PAO(const int& it) TITLE("LCAO_Orbitals","Read_PAO"); int lmaxt = ucell.atoms[it].nwl; -// OUT(ofs_running,"Lmax for this type",lmaxt); + // OUT(ofs_running,"Lmax for this type",lmaxt); // allocate space // number of chi for each L. @@ -714,7 +716,7 @@ void LCAO_Orbitals::Read_PAO(const int& it) { total_nchi += nchi[l]; } -// OUT(ofs_running,"Total number of chi(l,n)",total_nchi); + // OUT(ofs_running,"Total number of chi(l,n)",total_nchi); delete[] Phi[it].phiLN; this->Phi[it].phiLN = new Numerical_Orbital_Lm[total_nchi]; @@ -764,14 +766,14 @@ void LCAO_Orbitals::Read_PAO(const int& it) int meshr_read; if(MY_RANK==0) //pengfei 2014-10-13 { - while (in.good()) - { - in >> word; - if (std::strcmp(word , "END") == 0) // Peize Lin fix bug about strcmp 2016-08-02 - { - break; - } - } + while (in.good()) + { + in >> word; + if (std::strcmp(word , "END") == 0) // Peize Lin fix bug about strcmp 2016-08-02 + { + break; + } + } CHECK_NAME(in, "Mesh"); in >> meshr; @@ -1009,3 +1011,262 @@ void LCAO_Orbitals::set_nl_index(void) return; } + +//caoyu add 2021-3-16 +void LCAO_Orbitals::Read_Descriptor(void) //read descriptor basis +{ + TITLE("LCAO_Orbitals", "Read_Descriptor"); + + ifstream in; + ofs_running << " " << setw(12) << "DESCRIPTOR" << setw(3) << "L" + << setw(3) << "N" << setw(8) << "nr" << setw(8) << "dr" + << setw(8) << "RCUT" << setw(12) << "CHECK_UNIT" + << setw(12) << "NEW_UNIT" << endl; + + // check if the descriptor file exists. + bool open = false; + if (MY_RANK == 0) + { + in.open(this->descriptor_file.c_str()); + if (in) + { + open = true; + } + } +#ifdef __MPI + Parallel_Common::bcast_bool(open); +#endif + if (!open) + { + ofs_warning << " Orbital file : " << this->descriptor_file << endl; + WARNING_QUIT("LCAO_Orbitals::Read_Descriptor", "Couldn't find orbital files for descriptor"); + } + + //read lmax and nchi[l] + int lmax = 0; + int nchimax = 0; + int nchi[10]={0}; + char word[80]; + if (MY_RANK == 0) + { + while (in.good()) + { + in >> word; + if (std::strcmp(word, "Lmax") == 0) + { + in >> lmax; + break; + } + } + // allocate space + // number of chi for each L. + for (int l = 0; l <= lmax; l++) + { + in >> word >> word >> word >> nchi[l]; + nchimax = std::max(nchimax, nchi[l]); + } + } + +#ifdef __MPI + Parallel_Common::bcast_int(lmax); + Parallel_Common::bcast_int(nchimax); + Parallel_Common::bcast_int(nchi, lmax + 1); +#endif + this->lmax_d = lmax; + this->nchimax_d = nchimax; + // calculate total number of chi + int total_nchi = 0; + for (int l = 0; l <= lmax; l++) + { + total_nchi += nchi[l]; + } + //OUT(ofs_running,"Total number of chi(l,n)",total_nchi); + this->Alpha[0].phiLN = new Numerical_Orbital_Lm[total_nchi]; + + int meshr; // number of mesh points + int meshr_read; + double dr; + + if (MY_RANK == 0) + { + while (in.good()) + { + in >> word; + if (std::strcmp(word, "END") == 0) // Peize Lin fix bug about strcmp 2016-08-02 + { + break; + } + } + CHECK_NAME(in, "Mesh"); + in >> meshr; + meshr_read = meshr; + if (meshr % 2 == 0) + { + ++meshr; + } + CHECK_NAME(in, "dr"); + in >> dr; + } + +#ifdef __MPI + Parallel_Common::bcast_int(meshr); + Parallel_Common::bcast_int(meshr_read); + Parallel_Common::bcast_double(dr); +#endif + + int count = 0; + string name1, name2; + int tmp_l, tmp_n; + + for (int L = 0; L <= lmax; L++) + { + for (int N = 0; N < nchi[L]; N++) + { + ofs_running << " " << setw(12) << count + 1 << setw(3) << L << setw(3) << N; + + double* radial; // radial mesh + double* psi; // radial local orbital + double* psir;// psi * r + double* rab;// dr + + // set the number of mesh and the interval distance. + ofs_running << setw(8) << meshr << setw(8) << dr; + + radial = new double[meshr]; + psi = new double[meshr]; + psir = new double[meshr]; + rab = new double[meshr]; + + ZEROS(radial, meshr); + ZEROS(psi, meshr); + ZEROS(psir, meshr); + ZEROS(rab, meshr); + + for (int ir = 0; ir < meshr; ir++) + { + rab[ir] = dr; + // plus one because we can't read in r = 0 term now. + // change ir+1 to ir, because we need psi(r==0) information. + radial[ir] = ir * dr; //mohan 2010-04-19 + } + + // set the length of orbital + ofs_running << setw(8) << radial[meshr - 1]; + + // mohan update 2010-09-07 + bool find = false; + if (MY_RANK == 0) + { + while (!find) + { + if (in.eof()) + { + ofs_warning << " Can't find l=" + << L << " n=" << N << " orbital." << endl; + break; + } + + in >> name1 >> name2; + in >> tmp_l >> tmp_n; + if (L == tmp_l && N == tmp_n) + { + // meshr_read is different from meshr if meshr is even number. + for (int ir = 0; ir < meshr_read; ir++) + { + in >> psi[ir]; + /* + double rl = pow (ir*dr, l); + psi[ir] *= rl; + */ + psir[ir] = psi[ir] * radial[ir]; + } + find = true; + } + else + { + double no_use; + for (int ir = 0; ir < meshr_read; ir++) + { + in >> no_use; + } + } + }//end find + } + +#ifdef __MPI + Parallel_Common::bcast_bool(find); +#endif + if (!find) + { + WARNING_QUIT("LCAO_Orbitals::Read_Descriptor", "Can't find descriptor orbitals."); + } + +#ifdef __MPI + Parallel_Common::bcast_double(psi, meshr_read); + Parallel_Common::bcast_double(psir, meshr_read); +#endif + + // renormalize radial wave functions + double* inner = new double[meshr]; + for (int ir = 0; ir < meshr; ir++) + { + inner[ir] = psir[ir] * psir[ir]; + } + double unit = 0.0; + +// PLEASE make Simpson_Integral as input parameters? +// mohan note 2021-03-23 + Mathzone::Simpson_Integral(meshr, inner, rab, unit); + + // check unit: \sum ( psi[r] * r )^2 = 1 + ofs_running << setprecision(3) << setw(12) << unit; + + for (int ir = 0; ir < meshr; ir++) + { + psi[ir] /= sqrt(unit); + psir[ir] /= sqrt(unit); + } + + for (int ir = 0; ir < meshr; ir++) + { + inner[ir] = psir[ir] * psir[ir]; + } + Mathzone::Simpson_Integral(meshr, inner, rab, unit); + delete[] inner; + ofs_running << setw(12) << unit << endl; + + this->Alpha[0].phiLN[count].set_orbital_info( + "H", //any type + 1, //any type + L, //angular momentum L + N, // number of orbitals of this L + meshr, // number of radial mesh + rab, + radial,// radial mesh value(a.u.) + Numerical_Orbital_Lm::Psi_Type::Psi,// psi type next + psi, // radial wave function + this->kmesh, + this->dk, + this->dr_uniform, + true, + true); // delta k mesh in reciprocal space + + delete[] radial; + delete[] rab; + delete[] psir; + delete[] psi; + + ++count; + } + } + + in.close(); + + this->Alpha[0].set_orbital_info( + 1, // any type + "H", // any label + lmax, + nchi, + total_nchi); //copy twice ! + return; +} diff --git a/ABACUS.develop/source/src_lcao/lcao_orbitals.h b/ABACUS.develop/source/src_lcao/ORB_read.h similarity index 58% rename from ABACUS.develop/source/src_lcao/lcao_orbitals.h rename to ABACUS.develop/source/src_lcao/ORB_read.h index 4e62eddc00..3010dc1efc 100644 --- a/ABACUS.develop/source/src_lcao/lcao_orbitals.h +++ b/ABACUS.develop/source/src_lcao/ORB_read.h @@ -1,31 +1,44 @@ //========================================================= //AUTHOR : mohan //DATE : 2009-04-23 -//Last Update : 2009-04-23 +//Last Update : 2021-02-11 //========================================================= #ifndef LCAO_ORBITALS_H #define LCAO_ORBITALS_H #include "../src_pw/tools.h" -#include "numerical_orbital.h" -#include "numerical_orbital_lm.h" -#include "numerical_nonlocal.h" -#include "neutral_pot.h" +#include "ORB_atomic.h" +#include "ORB_atomic_lm.h" +#include "ORB_nonlocal.h" + +//--------------------------------------------------------------------- +// advices for reconstructions: +// each set of orbitals should have: lmax, dr, dk, rmax, lmax, etc. +// the orbitals include : NAO, non-local projectors, descriptors, etc. +// mohan note 2021-02-13 +//--------------------------------------------------------------------- class LCAO_Orbitals { public: + LCAO_Orbitals(); ~LCAO_Orbitals(); void Read_Orbitals(void); + void Read_PAO(const int& it); // in order to get rid of the .NONLOCAL file. void Set_NonLocal(const int &it, int &n_projectors); + // read in the NONLOCAL projector from file. void Read_NonLocal(const int& it, int &n_projectors); + void set_nl_index(void); + + void Read_Descriptor(void); //caoyu add 2020-3-16 + #ifdef __MPI void bcast_files(void); #endif @@ -36,15 +49,23 @@ class LCAO_Orbitals const double& get_dR(void) const {return dR;} const double& get_Rmax(void) const {return Rmax;} const int& get_lmax(void) const {return lmax;} + const int& get_lmax_d(void) const { return lmax_d; } //lmax of descriptor basis //caoyu add 2021-03-17 const int& get_nchimax(void) const {return nchimax;} + const int& get_nchimax_d(void) const { return nchimax_d; } //nchimax of descriptor basis //caoyu add 2021-03-17 const int& get_ntype(void) const {return ntype;} const double& get_dr_uniform(void) const {return dr_uniform;} + // numerical atomic orbitals Numerical_Orbital* Phi; + + // nonlocal projectors (1-dimension array) Numerical_Nonlocal* Beta; - Neutral_Pot* Vna; - // init in input.cpp + //caoyu add 2021-3-10 + // descriptor bases, saved as one-type atom orbital + Numerical_Orbital* Alpha; + + // initialized in input.cpp double ecutwfc; double dk; double dR; @@ -57,20 +78,25 @@ class LCAO_Orbitals double dr_uniform; - // init in unitcell_pseudo + // initalized in unitcell_pseudo // assume ntype < 20. bool read_in_flag; std::vector orbital_file; std::vector nonlocal_file; + string descriptor_file; //caoyu add 2020-3-16 private: int kmesh; int lmax; int nchimax; + int lmax_d; //caoyu add 2021-03-17 + int nchimax_d; //caoyu add 2021-03-17 int ntype; }; +// PLEASE avoid using 'ORB' as global variable +// mohan note 2021-03-23 extern LCAO_Orbitals ORB; #endif diff --git a/ABACUS.develop/source/src_lcao/ORB_table_alpha.cpp b/ABACUS.develop/source/src_lcao/ORB_table_alpha.cpp new file mode 100644 index 0000000000..d0f639d28d --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ORB_table_alpha.cpp @@ -0,0 +1,468 @@ +//caoyu add 2021-03-17 + +#include "ORB_table_alpha.h" +#include "ORB_read.h" +#include "../src_pw/global.h" +#include +#include "../src_ri/exx_abfs.h" +#include "../src_io/winput.h" + +double ORB_table_alpha::dr = -1.0; + +ORB_table_alpha::ORB_table_alpha() +{ + destroy_nr = false; + + ntype = 0; + lmax = 0; + kmesh = 0; + Rmax = 0.0; + dr = 0.0; + dk = 0.0; + + nlm = 0; + Rmesh = 0; + + kpoint = new double[1]; + r = new double[1]; + rab = new double[1]; + kab = new double[1]; + DS_2Lplus1 = new int[1]; +} + +ORB_table_alpha::~ORB_table_alpha() +{ + delete[] kpoint; + delete[] r; + delete[] rab; + delete[] kab; + delete[] DS_2Lplus1; +} + +void ORB_table_alpha::allocate +( + const int& ntype_in, + const int& lmax_in, + const int& kmesh_in, + const double& Rmax_in, + const double& dr_in, + const double& dk_in +) +{ + TITLE("ORB_table_alpha", "allocate"); + + this->ntype = ntype_in;// type of elements. + this->lmax = lmax_in; + this->kmesh = kmesh_in; + this->Rmax = Rmax_in; + this->dr = dr_in; + this->dk = dk_in; + + assert(ntype > 0); + assert(lmax >= 0); + assert(kmesh > 0.0); + assert(Rmax >= 0.0); + assert(dr > 0.0); + assert(dk > 0.0); + + // calculated from input parameters + this->nlm = (2 * lmax + 1) * (2 * lmax + 1); + this->Rmesh = static_cast(Rmax / dr) + 4; + if (Rmesh % 2 == 0) + { + ++Rmesh; + } + + // OUT(ofs_running,"lmax",lmax); + // OUT(ofs_running,"Rmax (Bohr)",Rmax); + // OUT(ofs_running,"dr (Bohr)",dr); + // OUT(ofs_running,"dk",dk); + // OUT(ofs_running,"nlm",nlm); + // OUT(ofs_running,"kmesh",kmesh); + + delete[] kpoint; + delete[] r; + kpoint = new double[kmesh]; + r = new double[Rmesh]; + + delete[] rab; + delete[] kab; + kab = new double[kmesh]; + rab = new double[Rmesh]; + + for (int ik = 0; ik < kmesh; ik++) + { + kpoint[ik] = ik * dk_in; + kab[ik] = dk_in; + } + + for (int ir = 0; ir < Rmesh; ir++) + { + r[ir] = ir * dr; + rab[ir] = dr; + } + + // OUT(ofs_running,"allocate kpoint, r, rab, kab","Done"); + return; +} + + +int ORB_table_alpha::get_rmesh(const double& R1, const double& R2) +{ + int rmesh = static_cast((R1 + R2) / ORB_table_alpha::dr) + 5; + //mohan update 2009-09-08 +1 ==> +5 + //considering interpolation or so on... + if (rmesh % 2 == 0) rmesh++; + + if (rmesh <= 0) + { + ofs_warning << "\n R1 = " << R1 << " R2 = " << R2; + ofs_warning << "\n rmesh = " << rmesh; + WARNING_QUIT("ORB_table_alpha::get_rmesh", "rmesh <= 0"); + } + return rmesh; +} + + + +void ORB_table_alpha::cal_S_PhiAlpha_R( + Sph_Bessel_Recursive::D2* pSB, // mohan add 2021-03-06 + const int& l, + const Numerical_Orbital_Lm& n1, + const Numerical_Orbital_Lm& n2, + const int& rmesh, + double* rs, + double* drs) +{ + timer::tick("ORB_table_alpha", "S_PhiAlpha_R"); + + assert(kmesh > 0); + + //start calc + double* k1_dot_k2 = new double[kmesh]; + + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); + } + + //previous version + double* integrated_func = new double[kmesh]; + + const vector>& jlm1 = pSB->get_jlx()[l - 1]; + const vector>& jl = pSB->get_jlx()[l]; + const vector>& jlp1 = pSB->get_jlx()[l + 1]; + for (int ir = 0; ir < rmesh; ir++) + { + ZEROS(integrated_func, kmesh); + double temp = 0.0; + + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = jl[ir][ik] * k1_dot_k2[ik]; + } + // Call simpson integration + Mathzone::Simpson_Integral(kmesh, integrated_func, kab, temp); + rs[ir] = temp * FOUR_PI; + + //drs + double temp1, temp2; + + if (l > 0) + { + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = jlm1[ir][ik] * k1_dot_k2[ik] * kpoint[ik]; + } + + Mathzone::Simpson_Integral(kmesh, integrated_func, kab, temp1); + } + + + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = jlp1[ir][ik] * k1_dot_k2[ik] * kpoint[ik]; + } + + Mathzone::Simpson_Integral(kmesh, integrated_func, kab, temp2); + + if (l == 0) + { + drs[ir] = -FOUR_PI * temp2; + } + else + { + drs[ir] = FOUR_PI * (temp1 * l - (l + 1) * temp2) / (2.0 * l + 1); + } + } + + //liaochen modify on 2010/4/22 + //special case for R=0 + //we store Slm(R) / R**l at the fisrt point, rather than Slm(R) + if (l > 0) + { + ZEROS(integrated_func, kmesh); + double temp = 0.0; + + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = k1_dot_k2[ik] * pow(kpoint[ik], l); + } + + // Call simpson integration + Mathzone::Simpson_Integral(kmesh, integrated_func, kab, temp); + rs[0] = FOUR_PI / Mathzone_Add1::dualfac(2 * l + 1) * temp; + } + + delete[] integrated_func; + + + delete[] k1_dot_k2; + timer::tick("ORB_table_alpha", "S_PhiAlpha_R"); + return; +} + + +void ORB_table_alpha::init_Table_Alpha(Sph_Bessel_Recursive::D2* pSB) +{ + TITLE("ORB_table_alpha", "init_Table_Alpha"); + timer::tick("ORB_table_alpha", "init_Table_Alpha", 'D'); + + // (1) allocate 1st dimension ( overlap, derivative) + this->Table_DSR = new double**** [2]; + // (2) allocate 2nd dimension ( overlap, derivative) + this->Table_DSR[0] = new double*** [this->ntype]; + this->Table_DSR[1] = new double*** [this->ntype]; + + // <1Phi|2Alpha> + for (int T1 = 0; T1 < ntype; T1++) // type 1 is orbital + { + const int Lmax1 = ORB.Phi[T1].getLmax(); + const int Lmax2 = ORB.Alpha[0].getLmax(); + const int lmax_now = std::max(Lmax1, Lmax2); + int L2plus1 = 2 * lmax_now + 1; + //------------------------------------------------------------- + // how many + // here we count all possible psi with (L,N) index for type T1. + //------------------------------------------------------------- + const int pairs_chi = ORB.Phi[T1].getTotal_nchi() * ORB.Alpha[0].getTotal_nchi(); + + if (pairs_chi == 0)continue; + + // init 2nd dimension + this->Table_DSR[0][T1] = new double** [pairs_chi]; + this->Table_DSR[1][T1] = new double** [pairs_chi]; + + const double Rcut1 = ORB.Phi[T1].getRcut(); + for (int L1 = 0; L1 < Lmax1 + 1; L1++) + { + for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); N1++) + { + for (int L2 = 0; L2 < Lmax2 + 1; L2++) + { + for (int N2 = 0; N2 < ORB.Alpha[0].getNchi(L2); N2++) + { + // get the second index. + const int Opair = this->DS_Opair(T1, L1, L2, N1, N2); + + // init 3rd dimension + this->Table_DSR[0][T1][Opair] = new double* [L2plus1]; + this->Table_DSR[1][T1][Opair] = new double* [L2plus1]; + + const double Rcut1 = ORB.Phi[T1].getRcut(); + const double Rcut2 = ORB.Alpha[0].getRcut(); + assert(Rcut1 > 0.0 && Rcut1 < 100); + assert(Rcut2 > 0.0 && Rcut2 < 100); + + const int rmesh = this->get_rmesh(Rcut1, Rcut2); + assert(rmesh < this->Rmesh); + + //L=|L1-L2|,|L1-L2|+2,...,L1+L2 + const int SL = abs(L1 - L2); + const int AL = L1 + L2; + + for (int L = 0; L < L2plus1; L++) + { + //Allocation + this->Table_DSR[0][T1][Opair][L] = new double[rmesh]; + this->Table_DSR[1][T1][Opair][L] = new double[rmesh]; + + Memory::record("ORB_table_alpha", "Table_DSR", + 2 * this->ntype * pairs_chi * rmesh, "double"); + + //for those L whose Gaunt Coefficients = 0, we + //assign every element in Table_DSR as zero + if ((L > AL) || (L < SL) || ((L - SL) % 2 == 1)) + { + ZEROS(Table_DSR[0][T1][Opair][L], rmesh); + ZEROS(Table_DSR[1][T1][Opair][L], rmesh); + + continue; + } + + this->cal_S_PhiAlpha_R( + pSB, // mohan add 2021-03-06 + L, + ORB.Phi[T1].PhiLN(L1, N1), + ORB.Alpha[0].PhiLN(L2, N2), // mohan update 2011-03-07 + rmesh, + this->Table_DSR[0][T1][Opair][L], + this->Table_DSR[1][T1][Opair][L]); + }// end L2plus1 + }// end N2 + }// end L2 + }// end N1 + }// end L1 + }// end T1 + destroy_nr = true; + + + // OUT(ofs_running,"allocate non-local potential matrix","Done"); + timer::tick("ORB_table_alpha", "init_Table_Alpha", 'D'); + return; +} + + +void ORB_table_alpha::Destroy_Table_Alpha(void) +{ + if (!destroy_nr) return; + + const int ntype = ORB.get_ntype(); + for (int ir = 0; ir < 2; ir++) + { + for (int T1 = 0; T1 < ntype; T1++) + { + const int Lmax1 = ORB.Phi[T1].getLmax(); + const int Lmax2 = ORB.Alpha[0].getLmax(); + const int lmax_now = std::max(Lmax1, Lmax2); + const int pairs = ORB.Phi[T1].getTotal_nchi() * ORB.Alpha[0].getTotal_nchi(); + + // mohan fix bug 2011-03-30 + if (pairs == 0) continue; + for (int dim2 = 0; dim2 < pairs; dim2++) + { + for (int L = 0; L < 2*lmax_now + 1; L++) + { + delete[] Table_DSR[ir][T1][dim2][L]; + } + delete[] Table_DSR[ir][T1][dim2]; + } + delete[] Table_DSR[ir][T1]; + } + delete[] Table_DSR[ir]; + } + delete[] Table_DSR; + return; +} + +void ORB_table_alpha::init_DS_2Lplus1(void) +{ + TITLE("Make_Overlap_Table", "init_DS_2Lplus1"); + assert(this->ntype > 0); + delete[] DS_2Lplus1; + DS_2Lplus1=new int[ntype]; // 2Lmax+1 for each T1 + + int index = 0; + for (int T1 = 0; T1 < ntype; T1++) + { + this->DS_2Lplus1[T1] = max(ORB.Phi[T1].getLmax(), ORB.Alpha[0].getLmax()) * 2 + 1; + } + return; +} + +void ORB_table_alpha::init_DS_Opair(void) +{ + const int lmax = ORB.get_lmax(); + const int nchimax = ORB.get_nchimax(); + const int lmax_d = ORB.get_lmax_d(); + const int nchimax_d = ORB.get_nchimax_d(); + assert(lmax + 1 > 0); + assert(lmax_d + 1 > 0); + assert(nchimax > 0); + assert(nchimax_d > 0); + + this->DS_Opair.create(this->ntype, lmax+1, lmax_d+1, nchimax, nchimax_d); + + // <1psi|2beta> + // 1. orbital + for (int T1 = 0; T1 < ntype; T1++) //alpha is not related to atom type ! + { + int index = 0; + for (int L1 = 0; L1 < ORB.Phi[T1].getLmax() + 1; L1++) + { + for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); N1++) + { + for (int L2 = 0; L2 < ORB.Alpha[0].getLmax() + 1; L2++) + { + for (int N2 = 0; N2 < ORB.Alpha[0].getNchi(L2); N2++) + { + this->DS_Opair(T1, L1, L2, N1, N2) = index; + ++index; + } + } + } + } + } + return; +} + +//caoyu add 2021-03-20 +void ORB_table_alpha::print_Table_DSR(void) +{ + TITLE("ORB_table_alpha", "print_Table_DSR"); + NEW_PART("Overlap table S between lcao orbital and descriptor basis : S_{I_mu_alpha}"); + + ofstream ofs; + stringstream ss; + // the parameter 'winput::spillage_outdir' is read from INPUTw. + ss << winput::spillage_outdir << "/" << "S_I_mu_alpha.dat"; + if (MY_RANK == 0) + { + ofs.open(ss.str().c_str()); + } + + for (int T1 = 0; T1 < this->ntype; T1++) //T1 + { + const int Lmax1 = ORB.Phi[T1].getLmax(); + const int Lmax2 = ORB.Alpha[0].getLmax(); + for (int L1 = 0; L1 < Lmax1 + 1; L1++) + { + for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); N1++) + { + for (int L2 = 0; L2 < Lmax2 + 1; L2++) + { + for (int N2 = 0; N2 < ORB.Alpha[0].getNchi(L2); N2++) + { + const int Opair = this->DS_Opair(T1, L1, L2, N1, N2); //Opair + ofs < +#include "../src_ri/exx_abfs.h" + +double ORB_table_beta::dr = -1.0; + +ORB_table_beta::ORB_table_beta() +{ + destroy_nr = false; + + ntype = 0; + lmax = 0; + kmesh = 0; + Rmax = 0.0; + dr = 0.0; + dk = 0.0; + + nlm = 0; + Rmesh = 0; + + kpoint = new double[1]; + r=new double[1]; + rab=new double[1]; + kab=new double[1]; +} + +ORB_table_beta::~ORB_table_beta() +{ + delete[] kpoint; + delete[] r; + delete[] rab; + delete[] kab; +} + +void ORB_table_beta::allocate +( + const int &ntype_in, + const int &lmax_in, + const int &kmesh_in, + const double &Rmax_in, + const double &dr_in, + const double &dk_in +) +{ + TITLE("ORB_table_beta", "allocate"); + + this->ntype = ntype_in;// type of elements. + this->lmax = lmax_in; + this->kmesh = kmesh_in; + this->Rmax = Rmax_in; + this->dr = dr_in; + this->dk = dk_in; + + assert(ntype > 0); + assert(lmax >= 0); + assert(kmesh > 0.0); + assert(Rmax >= 0.0); + assert(dr>0.0); + assert(dk>0.0); + + // calculated from input parameters + this->nlm = (2*lmax+1) * (2*lmax+1); + this->Rmesh = static_cast( Rmax/dr ) + 4; + if(Rmesh%2==0) + { + ++Rmesh; + } + +// OUT(ofs_running,"lmax",lmax); +// OUT(ofs_running,"Rmax (Bohr)",Rmax); +// OUT(ofs_running,"dr (Bohr)",dr); +// OUT(ofs_running,"dk",dk); +// OUT(ofs_running,"nlm",nlm); +// OUT(ofs_running,"kmesh",kmesh); + + delete[] kpoint; + delete[] r; + kpoint = new double[kmesh]; + r = new double[Rmesh]; + + delete[] rab; + delete[] kab; + kab = new double[kmesh]; + rab = new double[Rmesh]; + + for (int ik = 0; ik < kmesh; ik++) + { + kpoint[ik] = ik * dk_in; + kab[ik] = dk_in; + } + + for (int ir = 0; ir < Rmesh; ir++) + { + r[ir] = ir * dr; + rab[ir] = dr; + } + +// OUT(ofs_running,"allocate kpoint, r, rab, kab","Done"); + return; +} + + +int ORB_table_beta::get_rmesh(const double &R1, const double &R2) +{ + int rmesh = static_cast((R1+R2)/ ORB_table_beta::dr) + 5; + //mohan update 2009-09-08 +1 ==> +5 + //considering interpolation or so on... + if (rmesh % 2 == 0) rmesh ++; + + if(rmesh <= 0) + { + ofs_warning << "\n R1 = " << R1 << " R2 = " << R2; + ofs_warning << "\n rmesh = " << rmesh; + WARNING_QUIT("ORB_table_beta::get_rmesh", "rmesh <= 0"); + } + return rmesh; +} + + + +void ORB_table_beta::cal_VNL_PhiBeta_R( + Sph_Bessel_Recursive::D2 *pSB, // mohan add 2021-03-06 + const int &l, + const Numerical_Orbital_Lm &n1, + const Numerical_Nonlocal_Lm &n2, + const int &rmesh, + double *rs, + double *drs) +{ + timer::tick ("ORB_table_beta", "VNL_PhiBeta_R"); + + assert(kmesh > 0); + + //start calc + double *k1_dot_k2 = new double[kmesh]; + + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getBeta_k(ik); + } + + //previous version + double* integrated_func = new double[kmesh]; + + const vector> &jlm1 = pSB->get_jlx()[l-1]; + const vector> &jl = pSB->get_jlx()[l]; + const vector> &jlp1 = pSB->get_jlx()[l+1]; + for (int ir = 0; ir < rmesh; ir++) + { + ZEROS(integrated_func,kmesh); + double temp = 0.0; + + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = jl[ir][ik] * k1_dot_k2[ik]; + } + // Call simpson integration + Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); + rs[ir] = temp * FOUR_PI; + + //drs + double temp1, temp2; + + if (l > 0) + { + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = jlm1[ir][ik] * k1_dot_k2[ik] * kpoint[ik]; + } + + Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp1); + } + + + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = jlp1[ir][ik] * k1_dot_k2[ik] * kpoint[ik]; + } + + Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp2); + + if (l == 0) + { + drs[ir] = -FOUR_PI*temp2; + } + else + { + drs[ir] = FOUR_PI*(temp1*l-(l+1)*temp2)/(2.0*l+1); + } + } + + //liaochen modify on 2010/4/22 + //special case for R=0 + //we store Slm(R) / R**l at the fisrt point, rather than Slm(R) + if (l > 0) + { + ZEROS(integrated_func,kmesh); + double temp = 0.0; + + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); + } + + // Call simpson integration + Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); + rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; + } + + delete [] integrated_func; + + + delete[] k1_dot_k2; + timer::tick ("ORB_table_beta", "VNL_PhiBeta_R"); + return; +} + + +void ORB_table_beta::init_Table_Beta(Sph_Bessel_Recursive::D2 *pSB) +{ + TITLE("ORB_table_beta", "init_Table_Beta"); + timer::tick("ORB_table_beta", "init_Table_Beta",'D'); + + // (1) allocate 1st dimension ( overlap, derivative) + this->Table_NR = new double****[2]; + // (2) allocate 2nd dimension ( overlap, derivative) + this->Table_NR[0] = new double*** [this->NL_nTpairs]; + this->Table_NR[1] = new double*** [this->NL_nTpairs]; + + + // <1Phi|2Beta> + for (int T1 = 0; T1 < ntype ; T1++) // type 1 is orbital + { + for (int T2 = 0 ; T2 < ntype ; T2++)// type 2 is non-local projector + { + // Tpair: type pair. + const int Tpair=this->NL_Tpair(T1,T2); + const int Lmax1 = ORB.Phi[T1].getLmax(); + + const int NBeta = ORB.nproj[T2]; + + //------------------------------------------------------------- + // how many + // here we count all possible psi with (L,N) index for type T1. + //------------------------------------------------------------- + const int pairs_chi = ORB.Phi[T1].getTotal_nchi() * NBeta; + + // CAUTION!!! + // no matter nchi = 0 or NBeta = 0, + // means the Tpair in this table is never used! + if(pairs_chi == 0)continue; + + // init 2nd dimension + this->Table_NR[0][Tpair] = new double** [ pairs_chi ]; + this->Table_NR[1][Tpair] = new double** [ pairs_chi ]; + + const int T12_2Lplus1 = this->NL_L2plus1(T1,T2); + + const double Rcut1 = ORB.Phi[T1].getRcut(); + for (int L1 = 0; L1 < Lmax1 + 1; L1++) + { + for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); N1++) + { + + // number of projectors. + for (int nb = 0; nb < NBeta; nb ++) + { + const int L2 = ORB.Beta[T2].getL_Beta(nb); + + const double Rcut2 = ORB.Beta[T2].Proj[nb].getRcut(); + + const int Opair = this->NL_Opair(Tpair,L1,N1,nb); + assert( Opair < pairs_chi ); + + // init 3rd dimension + this->Table_NR[0][ Tpair ][ Opair ] = new double *[T12_2Lplus1]; + this->Table_NR[1][ Tpair ][ Opair ] = new double *[T12_2Lplus1]; + + const int rmesh = this->get_rmesh( Rcut1, Rcut2); + assert( rmesh < this->Rmesh ); + + //not all L in T12_2Lplus1 would function + const int SL = abs(L1-L2); + const int AL = L1+L2; + + for (int L=0; L < T12_2Lplus1 ; L++) + { + //Allocation + this->Table_NR[0][Tpair][Opair][L] = new double[rmesh]; + this->Table_NR[1][Tpair][Opair][L] = new double[rmesh]; + + Memory::record("ORB_table_beta","Table_NR", + 2*NL_nTpairs*pairs_chi*rmesh,"double"); + + //for those L whose Gaunt Coefficients = 0, we + //assign every element in Table_NR as zero + if ((L > AL) || (L < SL) || ((L-SL) % 2 == 1)) + { + ZEROS (Table_NR[0][Tpair][Opair][L], rmesh); + ZEROS (Table_NR[1][Tpair][Opair][L], rmesh); + + continue; + } + + assert(nb < ORB.nproj[T2]); + this->cal_VNL_PhiBeta_R( + pSB, // mohan add 2021-03-06 + L, + ORB.Phi[T1].PhiLN(L1,N1), + ORB.Beta[T2].Proj[nb], // mohan update 2011-03-07 + rmesh, + this->Table_NR[0][Tpair][Opair][L], + this->Table_NR[1][Tpair][Opair][L]); + }// end T12_2Lplus1 + }// end L2 + }// end N1 + }// end L1 + }// end T2 + }// end T1 + destroy_nr = true; + + +// OUT(ofs_running,"allocate non-local potential matrix","Done"); + timer::tick("ORB_table_beta", "init_Table_Beta",'D'); + return; +} + + +void ORB_table_beta::Destroy_Table_Beta(void) +{ + if(!destroy_nr) return; + + const int ntype = ORB.get_ntype(); + for(int ir = 0; ir < 2; ir ++) + { + for(int T1=0; T1NL_Tpair(T1,T2); + const int L2plus1 = this->NL_L2plus1(T1,T2); + const int pairs = ORB.Phi[T1].getTotal_nchi() * ORB.nproj[T2]; + + // mohan fix bug 2011-03-30 + if(pairs ==0) continue; + for(int dim2=0; dim20); + this->NL_nTpairs = this->ntype * this->ntype; + this->NL_Tpair.create( this->ntype, this->ntype); + this->NL_L2plus1.create( this->ntype, this->ntype); // mohan fix bug 2011-03-14 + +// OUT(ofs_running,"Number of Nonlocal Pairs",NL_nTpairs); + + int index = 0; + for (int T1 = 0; T1 < ntype ; T1++) + { + for (int T0 = 0 ; T0 < ntype ; T0++) + { + this->NL_Tpair(T1,T0) = index; + ++index; + + // the pair < psi | beta > + // be careful! This is not a symmetry matrix. + this->NL_L2plus1(T1,T0) = std::max(ORB.Phi[T1].getLmax(), ORB.Beta[T0].getLmax() )*2+1; + + // there are special situations: + // for example, two H atom without projector. + // if we use s orbital, + // Phi.getLmax = 0, + // Beta.getLmax < 0, + // so the value is 1. + // however, there are no projectors. + if(NL_L2plus1(T1,T0) <= 0) + { + WARNING_QUIT("ORB_table_beta::init_paris_nonlocal_type","NL_L2plus1<=0"); + } + } + } + return; +} + + + +void ORB_table_beta::init_NL_Opair(void) +{ + const int lmax = ORB.get_lmax(); + const int nchimax = ORB.get_nchimax(); + const int nprojmax = ORB.nprojmax; + + // may have bug if we use all H! + if( nprojmax == 0) + { + WARNING("ORB_table_beta","nproj for nonlocal pseudopotetials are zero, it must be all H atoms"); + return; + } + assert( NL_nTpairs > 0); + + this->NL_Opair.create( this->NL_nTpairs, lmax+1, nchimax, nprojmax); + + // <1psi|2beta> + // 1. orbital + for(int T1=0; T1NL_Tpair(T1, T0); + int index = 0; + for(int L1=0; L1NL_Opair(nlpair, L1, N1, ip) = index; + ++index; + } + } + } + } + } + + return; +} diff --git a/ABACUS.develop/source/src_lcao/ORB_table_beta.h b/ABACUS.develop/source/src_lcao/ORB_table_beta.h new file mode 100644 index 0000000000..17488fe18e --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ORB_table_beta.h @@ -0,0 +1,74 @@ +#ifndef ORB_TABLE_BETA_H +#define ORB_TABLE_BETA_H + +#include "src_pw/tools.h" +#include "ORB_atomic.h" +#include "ORB_atomic_lm.h" +#include "ORB_nonlocal.h" +#include "ORB_nonlocal_lm.h" +#include "ORB_gaunt_table.h" +#include "src_global/sph_bessel_recursive.h" + +class ORB_table_beta +{ + public: + + ORB_table_beta(); + ~ORB_table_beta(); + + void allocate ( + const int &ntype, + const int &lmax_in, + const int &kmesh_in, + const double &Rmax_in, + const double &dR_in, + const double &dk_in); + + double***** Table_NR; + bool destroy_nr; + + //------------------------- + // NL stands for 'nonlocal' + // T stands for atom type. + // O stands for orbitals. + //------------------------- + void init_NL_Tpair(void); + void init_NL_Opair(void); + int NL_nTpairs; + IntArray NL_Tpair; + IntArray NL_Opair; + IntArray NL_L2plus1; + + void init_Table_Beta(Sph_Bessel_Recursive::D2 *pSB); + + void Destroy_Table_Beta(void); + + static int get_rmesh( const double &R1, const double &R2); + + static double dr; + int Rmesh; + + private: + + void cal_VNL_PhiBeta_R( + Sph_Bessel_Recursive::D2 *pSB, // mohan add 2021-03-06 + const int &l, + const Numerical_Orbital_Lm &n1, + const Numerical_Nonlocal_Lm &n2, + const int &rmesh, + double *rs, + double *drs); + + // variables + int ntype; + int lmax; + double Rmax; + double dk; + int nlm; + int kmesh; + double *kpoint; + double *r; + double *rab; + double *kab; +}; +#endif diff --git a/ABACUS.develop/source/src_lcao/ORB_table_phi.cpp b/ABACUS.develop/source/src_lcao/ORB_table_phi.cpp new file mode 100644 index 0000000000..a55f78d433 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/ORB_table_phi.cpp @@ -0,0 +1,905 @@ +#include "ORB_table_phi.h" +#include "ORB_read.h" +#include +#include "../src_ri/exx_abfs.h" + +double ORB_table_phi::dr = -1.0; + +ORB_table_phi::ORB_table_phi() +{ + destroy_sr = false; + destroy_tr = false; + + ntype = 0; + lmax = 0; + kmesh = 0; + Rmax = 0.0; + dr = 0.0; + dk = 0.0; + + nlm = 0; + Rmesh = 0; + + kpoint = new double[1]; + r=new double[1]; + rab=new double[1]; + kab=new double[1]; +} + +ORB_table_phi::~ORB_table_phi() +{ + delete[] kpoint; + delete[] r; + delete[] rab; + delete[] kab; +} + +void ORB_table_phi::allocate +( + const int &ntype_in, + const int &lmax_in, + const int &kmesh_in, + const double &Rmax_in, + const double &dr_in, + const double &dk_in +) +{ + TITLE("ORB_table_phi", "allocate"); + + this->ntype = ntype_in;// type of elements. + this->lmax = lmax_in; + this->kmesh = kmesh_in; + this->Rmax = Rmax_in; + this->dr = dr_in; + this->dk = dk_in; + + assert(ntype > 0); + assert(lmax >= 0); + assert(kmesh > 0.0); + assert(Rmax >= 0.0); + assert(dr>0.0); + assert(dk>0.0); + + // calculated from input parameters + this->nlm = (2*lmax+1) * (2*lmax+1); + this->Rmesh = static_cast( Rmax/dr ) + 4; + if(Rmesh%2==0) + { + ++Rmesh; + } + +// OUT(ofs_running,"lmax",lmax); +// OUT(ofs_running,"Rmax (Bohr)",Rmax); +// OUT(ofs_running,"dr (Bohr)",dr); +// OUT(ofs_running,"dk",dk); +// OUT(ofs_running,"nlm",nlm); +// OUT(ofs_running,"kmesh",kmesh); + + delete[] kpoint; + delete[] r; + kpoint = new double[kmesh]; + r = new double[Rmesh]; + + delete[] rab; + delete[] kab; + kab = new double[kmesh]; + rab = new double[Rmesh]; + + for (int ik = 0; ik < kmesh; ik++) + { + kpoint[ik] = ik * dk_in; + kab[ik] = dk_in; + } + + for (int ir = 0; ir < Rmesh; ir++) + { + r[ir] = ir * dr; + rab[ir] = dr; + } + +// OUT(ofs_running,"allocate kpoint, r, rab, kab","Done"); + return; +} + +int ORB_table_phi::get_rmesh(const double &R1, const double &R2) +{ + int rmesh = static_cast((R1+R2)/ ORB_table_phi::dr) + 5; + //mohan update 2009-09-08 +1 ==> +5 + //considering interpolation or so on... + if (rmesh % 2 == 0) rmesh ++; + + if(rmesh <= 0) + { + ofs_warning << "\n R1 = " << R1 << " R2 = " << R2; + ofs_warning << "\n rmesh = " << rmesh; + WARNING_QUIT("ORB_table_phi::get_rmesh", "rmesh <= 0"); + } + return rmesh; +} + +// Peize Lin accelerate 2017-10-02 +void ORB_table_phi::cal_ST_Phi12_R +( + const int &job, + const int &l, + const Numerical_Orbital_Lm &n1, + const Numerical_Orbital_Lm &n2, + const int &rmesh, + double* rs, + double* drs +) const +{ + timer::tick("ORB_table_phi", "cal_ST_Phi12_R"); + + double* k1_dot_k2 = new double[kmesh]; + double* k1_dot_k2_dot_kpoint = new double[kmesh]; + + // Peize Lin change 2017-12-12 + switch(job) + { + case 1: // calculate overlap + if( !n1.get_psif().empty() && !n2.get_psi_k2().empty() ) + { + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsif(ik) * n2.getPsi_k2(ik); + } + } + else if( !n1.get_psi_k().empty() && !n2.get_psi_k().empty() ) + { + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); + } + } + else if( !n1.get_psi_k2().empty() && !n2.get_psif().empty() ) + { + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsif(ik); + } + } + break; + + case 2: // calculate kinetic energy + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsi_k2(ik); + } + break; + } + + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2_dot_kpoint[ik] = k1_dot_k2[ik] * this->kpoint[ik]; + } + + //Drs + //djl = (l*j(l-1) - (l+1)j(l+1))/(2l+1) + + //previous version + + double* integrated_func = new double[kmesh]; + + const vector> &jlm1 = pSB->get_jlx()[l-1]; + const vector> &jl = pSB->get_jlx()[l]; + const vector> &jlp1 = pSB->get_jlx()[l+1]; + + for (int ir = 0; ir < rmesh; ir++) + { + const vector &jl_r = jl[ir]; + for (int ik=0; ik &jlm1_r = jlm1[ir]; + const vector &jlp1_r = jlp1[ir]; + const double fac = l/(l+1.0); + if( l==0 ) + { + for (int ik=0; ik 0) + { + ZEROS(integrated_func,kmesh); + double temp = 0.0; + + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); + } + + // PLEASE try to make Simpson_Integral as input parameters + // mohan note 2021-03-23 + Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); + rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; + } + + delete [] integrated_func; + delete [] k1_dot_k2; + delete [] k1_dot_k2_dot_kpoint; + + timer::tick("ORB_table_phi", "cal_ST_Phi12_R"); + + return; +} + + +// Peize Lin add 2017-10-27 +void ORB_table_phi::cal_ST_Phi12_R +( + const int &job, + const int &l, + const Numerical_Orbital_Lm &n1, + const Numerical_Orbital_Lm &n2, + const set &radials, + double* rs, + double* drs +) const +{ +// TITLE("ORB_table_phi","cal_ST_Phi12_R"); + timer::tick("ORB_table_phi", "cal_ST_Phi12_R"); + + vector k1_dot_k2(kmesh); + switch(job) + { + case 1: // calculate overlap + if( !n1.get_psif().empty() && !n2.get_psi_k2().empty() ) + { + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsif(ik) * n2.getPsi_k2(ik); + } + } + else if( !n1.get_psi_k().empty() && !n2.get_psi_k().empty() ) + { + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); + } + } + else if( !n1.get_psi_k2().empty() && !n2.get_psif().empty() ) + { + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsif(ik); + } + } + break; + + case 2: // calculate kinetic energy + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsi_k2(ik); + } + break; + } + + vector k1_dot_k2_dot_kpoint(kmesh); + for (int ik = 0; ik < kmesh; ik++) + { + k1_dot_k2_dot_kpoint[ik] = k1_dot_k2[ik] * this->kpoint[ik]; + } + + vector integrated_func(kmesh); + + const vector> &jlm1 = pSB->get_jlx()[l-1]; + const vector> &jl = pSB->get_jlx()[l]; + const vector> &jlp1 = pSB->get_jlx()[l+1]; + + for( const size_t &ir : radials ) + { + // if(rs[ir]) => rs[ir] has been calculated + // if(drs[ir]) => drs[ir] has been calculated + // Actually, if(ir[ir]||dr[ir]) is enough. Double insurance for the sake of avoiding numerical errors + if( rs[ir] && drs[ir] ) continue; + + const vector &jl_r = jl[ir]; + for (int ik=0; ik &jlm1_r = jlm1[ir]; + const vector &jlp1_r = jlp1[ir]; + const double fac = l/(l+1.0); + if( l==0 ) + { + for (int ik=0; ik 0) + { + if( radials.find(0)!=radials.end() ) + { + for (int ik = 0; ik < kmesh; ik++) + { + integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); + } + double temp = 0.0; + // Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); + // PLEASE try to make Simpson_Integral as input parameters + // mohan note 2021-03-23 + Mathzone::Simpson_Integral(kmesh,VECTOR_TO_PTR(integrated_func),dk,temp); + // PLEASE try to make dualfac function as input parameters + // mohan note 2021-03-23 + rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; + } + } + + timer::tick("ORB_table_phi", "cal_ST_Phi12_R"); + + return; +} + + + +void ORB_table_phi::init_Table( const int &job0 ) +{ + TITLE("ORB_table_phi", "init_Table"); + timer::tick("ORB_table_phi", "init_Table",'D'); + const int ntype = ORB.get_ntype(); + assert( ORB_table_phi::dr > 0.0); + assert( OV_nTpairs>0); + + // init 1st dimension + switch( job0 ) + { + case 1: + // the second dimension stands for S(R) and dS(R)/dR + this->Table_SR = new double****[2]; + for(int ir = 0; ir < 2; ir++) + { + this->Table_SR[ir] = new double***[ this->OV_nTpairs ]; + } + break; + + case 2: + this->Table_TR = new double****[2]; + for(int ir = 0; ir < 2; ir++) + { + this->Table_TR[ir] = new double***[ this->OV_nTpairs ]; + } + break; + + case 3: + this->Table_SR = new double****[2]; + this->Table_TR = new double****[2]; + for(int ir = 0; ir < 2; ir++) + { + this->Table_SR[ir] = new double***[ this->OV_nTpairs ]; + this->Table_TR[ir] = new double***[ this->OV_nTpairs ]; + } + break; + } + + for (int T1 = 0; T1 < ntype ; T1++) + { + // Notice !! T2 start from T1 + // means that T2 >= T1 + for (int T2 = T1 ; T2 < ntype ; T2++) + { + // get the bigger lmax between two types + const int Tpair=this->OV_Tpair(T1,T2); + const int Lmax1 = ORB.Phi[T1].getLmax(); + const int Lmax2 = ORB.Phi[T2].getLmax(); + + //L2plus1 could be reduced by considering Gaunt Coefficient + //remain to be modified + //?????? + const int lmax_now = std::max( Lmax1, Lmax2 ); + + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // mohan add 2011-03-07 + // I think the lmax_now should be judged from two + // orbitals, not atom type!!!!!!!!!!!!! + // there are space that can imporve the efficiency. + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + const int L2plus1 = 2*lmax_now + 1; + + const int nchi1 = ORB.Phi[T1].getTotal_nchi(); + const int nchi2 = ORB.Phi[T2].getTotal_nchi(); + const int pairs_chi = nchi1 * nchi2; + + // init 2nd dimension + switch( job0 ) + { + case 1: + this->Table_SR[0][ Tpair ] = new double**[pairs_chi]; + this->Table_SR[1][ Tpair ] = new double**[pairs_chi]; + break; + + case 2: + this->Table_TR[0][ Tpair ] = new double**[pairs_chi]; + this->Table_TR[1][ Tpair ] = new double**[pairs_chi]; + break; + + case 3: + for(int ir = 0; ir < 2; ir++) + { + this->Table_SR[ir][ Tpair ] = new double**[pairs_chi]; + this->Table_TR[ir][ Tpair ] = new double**[pairs_chi]; + } + break; + } + + const double Rcut1 = ORB.Phi[T1].getRcut(); + const double Rcut2 = ORB.Phi[T2].getRcut(); + assert(Rcut1>0.0 && Rcut1<100); + assert(Rcut2>0.0 && Rcut2<100); + + const int rmesh = this->get_rmesh( Rcut1, Rcut2); + assert( rmesh < this->Rmesh ); + + for (int L1 = 0; L1 < Lmax1 + 1; L1++) + { + for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); N1++) + { + for (int L2 = 0; L2 < Lmax2 + 1; L2 ++) + { + for (int N2 = 0; N2 < ORB.Phi[T2].getNchi(L2); N2++) + { + // get the second index. + const int Opair = this->OV_Opair(Tpair,L1,L2,N1,N2); + + // init 3rd dimension + switch( job0 ) + { + case 1: + this->Table_SR[0][ Tpair ][ Opair ] = new double *[L2plus1]; + this->Table_SR[1][ Tpair ][ Opair ] = new double *[L2plus1]; + break; + + case 2: + this->Table_TR[0][ Tpair ][ Opair ] = new double *[L2plus1]; + this->Table_TR[1][ Tpair ][ Opair ] = new double *[L2plus1]; + + case 3: + for(int ir = 0; ir < 2; ir++) + { + this->Table_SR[ir][ Tpair ][ Opair ] = new double *[L2plus1]; + this->Table_TR[ir][ Tpair ][ Opair ] = new double *[L2plus1]; + } + } + + + //L=|L1-L2|,|L1-L2|+2,...,L1+L2 + const int SL = abs(L1-L2); + const int AL = L1+L2; + + for (int L=0; L < L2plus1 ; L++) + { + //Allocation + switch ( job0 ) + { + case 1: + Table_SR[0][Tpair][Opair][L] = new double[rmesh]; + Table_SR[1][Tpair][Opair][L] = new double[rmesh]; + + Memory::record("ORB_table_phi","Table_SR", + 2*OV_nTpairs*pairs_chi*rmesh,"double"); + break; + + case 2: + Table_TR[0][Tpair][Opair][L] = new double[rmesh]; + Table_TR[1][Tpair][Opair][L] = new double[rmesh]; + + Memory::record("ORB_table_phi","Table_TR", + 2*OV_nTpairs*pairs_chi*rmesh,"double"); + break; + + case 3: + Table_SR[0][Tpair][Opair][L] = new double[rmesh]; + Table_SR[1][Tpair][Opair][L] = new double[rmesh]; + Table_TR[0][Tpair][Opair][L] = new double[rmesh]; + Table_TR[1][Tpair][Opair][L] = new double[rmesh]; + + Memory::record("ORB_table_phi","Table_SR&TR", + 2*2*OV_nTpairs*pairs_chi*rmesh,"double"); + break; + } + + //for those L whose Gaunt Coefficients = 0, we + //assign every element in Table_SR or Table_TR as zero + if ((L > AL) || (L < SL) || ((L-SL) % 2 == 1)) + { + switch ( job0 ) + { + case 1: + ZEROS (Table_SR[0][Tpair][Opair][L], rmesh); + ZEROS (Table_SR[1][Tpair][Opair][L], rmesh); + break; + + case 2: + ZEROS (Table_TR[0][Tpair][Opair][L], rmesh); + ZEROS (Table_TR[1][Tpair][Opair][L], rmesh); + break; + + case 3: + ZEROS (Table_SR[0][Tpair][Opair][L], rmesh); + ZEROS (Table_SR[1][Tpair][Opair][L], rmesh); + ZEROS (Table_TR[0][Tpair][Opair][L], rmesh); + ZEROS (Table_TR[1][Tpair][Opair][L], rmesh); + break; + } + + continue; + } + + switch( job0 ) + { + case 1: + { + this->cal_ST_Phi12_R(1,L, + ORB.Phi[T1].PhiLN(L1,N1), + ORB.Phi[T2].PhiLN(L2,N2), + rmesh, + Table_SR[0][Tpair][Opair][L], + Table_SR[1][Tpair][Opair][L]); + break; + } + case 2: + { + + this->cal_ST_Phi12_R(2,L, + ORB.Phi[T1].PhiLN(L1,N1), + ORB.Phi[T2].PhiLN(L2,N2), + rmesh, + Table_TR[0][Tpair][Opair][L], + Table_TR[1][Tpair][Opair][L]); + break; + } + case 3: + { + this->cal_ST_Phi12_R(1,L, + ORB.Phi[T1].PhiLN(L1,N1), + ORB.Phi[T2].PhiLN(L2,N2), + rmesh, + Table_SR[0][Tpair][Opair][L], + Table_SR[1][Tpair][Opair][L]); + + this->cal_ST_Phi12_R(2,L, + ORB.Phi[T1].PhiLN(L1,N1), + ORB.Phi[T2].PhiLN(L2,N2), + rmesh, + Table_TR[0][Tpair][Opair][L], + Table_TR[1][Tpair][Opair][L]); + break; + } + } + }//end m + } + }//end jl + } + }// end il + }// end jt + }// end it + + switch( job0 ) + { + case 1: + destroy_sr = true; + break; + + case 2: + destroy_tr = true; + break; + + case 3: + destroy_sr = true; + destroy_tr = true; + break; + } + + timer::tick("ORB_table_phi", "init_Table",'D'); + return; +} + + +void ORB_table_phi::Destroy_Table(void) +{ + if(!destroy_sr && !destroy_tr) return; + + const int ntype = ORB.get_ntype(); + int dim1 = 0; + for (int ir = 0; ir < 2; ir++) + { + for (int T1 = 0; T1 < ntype; T1++) + { + // Notice !! T2 start from T1 + // means that T2 >= T1 + for (int T2 = T1; T2 < ntype; T2++) + { + const int Lmax1 = ORB.Phi[T1].getLmax(); + const int Lmax2 = ORB.Phi[T2].getLmax(); + const int lmax_now = std::max(Lmax1, Lmax2); + const int pairs = ORB.Phi[T1].getTotal_nchi() * ORB.Phi[T2].getTotal_nchi(); + + for (int dim2 = 0; dim2 < pairs; dim2++) + { + for (int L = 0; L < 2*lmax_now + 1; L++) + { + if(destroy_sr) delete [] Table_SR[ir][dim1][dim2][L]; + if(destroy_tr) delete [] Table_TR[ir][dim1][dim2][L]; + } + if(destroy_sr) delete [] Table_SR[ir][dim1][dim2]; + if(destroy_tr) delete [] Table_TR[ir][dim1][dim2]; + } + if(destroy_sr) delete [] Table_SR[ir][dim1]; + if(destroy_tr) delete [] Table_TR[ir][dim1]; + dim1++; + + } + } + + dim1 = 0; + if(destroy_sr) delete [] Table_SR[ir]; + if(destroy_tr) delete [] Table_TR[ir]; + } + + if(destroy_sr) delete[] Table_SR; + if(destroy_tr) delete[] Table_TR; + + return; +} + + + +void ORB_table_phi::init_OV_Tpair(void) +{ + TITLE("ORB_table_phi","init_OV_Tpair"); + assert(ntype>0); + + this->OV_nTpairs = this->ntype * (this->ntype + 1) / 2; + this->OV_Tpair.create(ntype, ntype); + this->OV_L2plus1.create(ntype, ntype); // mohan fix bug 2011-03-14 + + int index = 0; + for (int T1 = 0; T1 < ntype ; T1++) + { + // Notice !! T2 start from T1 + // means that T2 >= T1 + for (int T2 = T1 ; T2 < ntype ; T2++) + { + // (1) pairs about atom types + //liaochen modify 2010/8/4 + //index for T1>T2 is also needed + this->OV_Tpair(T2, T1) = index; + this->OV_Tpair(T1, T2) = this->OV_Tpair(T2, T1); + + ++index; + // (2) pairs about lmax + this->OV_L2plus1(T1,T2) = max(ORB.Phi[T1].getLmax(), ORB.Phi[T2].getLmax() )*2+1; + this->OV_L2plus1(T2,T1) = this->OV_L2plus1(T1,T2); + } + } + return; +} + + + +void ORB_table_phi::init_OV_Opair(void) +{ + const int lmax = ORB.get_lmax(); + const int nchimax = ORB.get_nchimax(); + assert(lmax+1 > 0); + assert(nchimax > 0); + assert(OV_nTpairs > 0); + + this->OV_Opair.create(OV_nTpairs, lmax+1, lmax+1, nchimax, nchimax); + + for(int T1=0; T1= T1 + for(int T2=T1; T2OV_Tpair(T1,T2); + int index=0; + for(int L1=0; L1OV_Opair(dim1, L1, L2, N1, N2) = index; + ++index; + } + } + } + } + } + } + return; +} + +// Peize Lin update 2016-01-26 +void ORB_table_phi::init_Lmax (const int orb_num, const int mode, int &Lmax_used, int &Lmax) const +{ + auto cal_Lmax_Phi = [](int &Lmax) + { + //obtain maxL of all type + const int ntype = ORB.get_ntype(); + for (int it = 0; it < ntype; it++) + { + Lmax = std::max(Lmax, ORB.Phi[it].getLmax()); + } + }; + + auto cal_Lmax_Beta = [](int &Lmax) + { + // fix bug. + // mohan add the nonlocal part. + // 2011-03-07 + const int ntype = ORB.get_ntype(); + for(int it=0; it< ntype; it++) + { + Lmax = std::max(Lmax, ORB.Beta[it].getLmax()); + } + }; + + Lmax = -1; + + switch( orb_num ) + { + case 2: + switch( mode ) + { + case 1: // used in or + cal_Lmax_Phi(Lmax); + cal_Lmax_Beta(Lmax); + //use 2lmax+1 in dS + Lmax_used = 2*Lmax + 1; + break; + case 2: // used in or + Lmax = max(Lmax, Exx_Abfs::Lmax); + Lmax_used = 2*Lmax + 1; + break; + case 3: // used in berryphase by jingan + cal_Lmax_Phi(Lmax); + Lmax++; + Lmax_used = 2*Lmax + 1; + break; + default: + throw invalid_argument("ORB_table_phi::init_Lmax orb_num=2, mode error"); + break; + } + break; + case 3: + switch( mode ) + { + case 1: // used in or + cal_Lmax_Phi(Lmax); + Lmax_used = 2*Lmax + 1; + Lmax = max(Lmax, Exx_Abfs::Lmax); + Lmax_used += Exx_Abfs::Lmax; + break; + default: + throw invalid_argument("ORB_table_phi::init_Lmax orb_num=3, mode error"); + break; + } + break; + case 4: + switch( mode ) + { + case 1: // used in + cal_Lmax_Phi(Lmax); + Lmax_used = 2*( 2*Lmax + 1 ); + break; + default: + throw invalid_argument("ORB_table_phi::init_Lmax orb_num=4, mode error"); + break; + } + break; + default: + throw invalid_argument("ORB_table_phi::init_Lmax orb_num error"); + break; + } + + assert(Lmax_used >= 1); +} + +// Peize Lin update 2016-01-26 +void ORB_table_phi::init_Table_Spherical_Bessel (const int orb_num, const int mode, int &Lmax_used, int &Lmax) +{ + TITLE("ORB_table_phi", "init_Table_Spherical_Bessel"); + + this->init_Lmax (orb_num,mode,Lmax_used,Lmax); // Peize Lin add 2016-01-26 + + for( auto & sb : Sph_Bessel_Recursive_Pool::D2::sb_pool ) + { + if( this->dr * this->dk == sb.get_dx() ) + { + pSB = &sb; + break; + } + } + + if(!pSB) + { + Sph_Bessel_Recursive_Pool::D2::sb_pool.push_back({}); + pSB = &Sph_Bessel_Recursive_Pool::D2::sb_pool.back(); + } + + pSB->set_dx( this->dr * this->dk ); + pSB->cal_jlx( Lmax_used, this->Rmesh, this->kmesh ); + +/* +// some data: +//L x Jl(x)old Jl(x)web(correct) +//0 4 -0.189201 -0.18920062383 +//1 11.7663 -0.0643896 -0.064389590588 +//3 1.5048 0.028574 0.028573980746 +//5 12.8544 -0.00829602 -0.0082960169277 +//6 12.8544 -0.0776037 -0.077603690549 +//7 12.8544 -0.0560009 -0.070186679825 +//7 12 -0.0198184 -0.024838740722 + int lll; + int ir; + int ik; + cout << " INPUT L: " ; cin >> lll; + cout << " INPUT ir: " ; cin >> ir; + cout << " INPUT ik: " ; cin >> ik; + double kr = r[ir] * kpoint[ik]; + cout << " L=" << lll << " kr=" << kr << " J=" << jlx[lll][ir][ik] << endl; + goto once_again; +*/ + + OUT(ofs_running,"lmax used to generate Jlq",Lmax_used); +// OUT(ofs_running,"kmesh",kmesh); +// OUT(ofs_running,"Rmesh",Rmesh); + Memory::record ("ORB_table_phi", "Jl(x)", (Lmax_used+1) * this->kmesh * this->Rmesh, "double"); +} diff --git a/ABACUS.develop/source/src_lcao/make_overlap_table.h b/ABACUS.develop/source/src_lcao/ORB_table_phi.h similarity index 66% rename from ABACUS.develop/source/src_lcao/make_overlap_table.h rename to ABACUS.develop/source/src_lcao/ORB_table_phi.h index 3d6477f599..416a51075a 100644 --- a/ABACUS.develop/source/src_lcao/make_overlap_table.h +++ b/ABACUS.develop/source/src_lcao/ORB_table_phi.h @@ -1,27 +1,20 @@ -//========================================================= -//AUTHOR : Mohan -//DATE : 2009-04-22 -//========================================================= -#ifndef MAKE_OVERLAP_TABLE_H -#define MAKE_OVERLAP_TABLE_H +#ifndef ORB_TABLE_PHI_H +#define ORB_TABLE_PHI_H #include "src_pw/tools.h" -#include "src_lcao/numerical_orbital.h" -#include "src_lcao/numerical_orbital_lm.h" -#include "src_lcao/numerical_nonlocal.h" -#include "src_lcao/numerical_nonlocal_lm.h" -#include "src_lcao/make_gaunt_table.h" -#include "src_lcao/center2_orb.h" +#include "ORB_atomic.h" +#include "ORB_atomic_lm.h" +#include "ORB_gaunt_table.h" +#include "center2_orb.h" #include "src_global/sph_bessel_recursive.h" - #include -class Make_Overlap_Table +class ORB_table_phi { public: - Make_Overlap_Table(); - ~Make_Overlap_Table(); + ORB_table_phi(); + ~ORB_table_phi(); void allocate ( const int &ntype, @@ -32,9 +25,7 @@ class Make_Overlap_Table const double &dk_in); void init_Table(const int &job); - void init_Table_Beta(void); void Destroy_Table(void); - void Destroy_Table_Beta(void); // Five dimension: // (1) 0: normal (S(R)) ; 1: derivative( dS/dR ) @@ -44,11 +35,9 @@ class Make_Overlap_Table // (5) Distance between atoms: R. double***** Table_SR; double***** Table_TR; - double***** Table_NR; bool destroy_sr; bool destroy_tr; - bool destroy_nr; //================================================= //make table of Spherical bessel @@ -59,13 +48,13 @@ class Make_Overlap_Table void init_Lmax (const int orb_num, const int mode, int &Lmax_used, int &Lmax) const; void init_Table_Spherical_Bessel (const int orb_num, const int mode, int &Lmax_used, int &Lmax); - Sph_Bessel_Recursive::D2* pSB = nullptr; // Peize Lin add 2017-04-24, and change all jlx in this class + // Peize Lin add 2017-04-24, and change all jlx in this class + Sph_Bessel_Recursive::D2* pSB = nullptr; //============================================== // make the index, in order to get the element // from Table_SR and Table_TR quickly. //============================================== - //------------------------- // OV stands for 'overlap' @@ -79,18 +68,6 @@ class Make_Overlap_Table IntArray OV_Opair; IntArray OV_L2plus1; - //------------------------- - // NL stands for 'nonlocal' - // T stands for atom type. - // O stands for orbitals. - //------------------------- - void init_NL_Tpair(void); - void init_NL_Opair(void); - int NL_nTpairs; - IntArray NL_Tpair; - IntArray NL_Opair; - IntArray NL_L2plus1; - //======================================================== // Small function //======================================================== @@ -109,6 +86,7 @@ class Make_Overlap_Table const int &rmesh, double *rs, double *drs) const; + // Peize Lin add 2017-10-13 void cal_ST_Phi12_R( const int &job, @@ -119,14 +97,6 @@ class Make_Overlap_Table double *rs, double *drs) const; - void cal_VNL_PhiBeta_R( - const int &l, - const Numerical_Orbital_Lm &n1, - const Numerical_Nonlocal_Lm &n2, - const int &rmesh, - double *rs, - double *drs); - // variables int ntype; int lmax; diff --git a/ABACUS.develop/source/src_lcao/bfield.cpp b/ABACUS.develop/source/src_lcao/bfield.cpp deleted file mode 100644 index 5065138eb7..0000000000 --- a/ABACUS.develop/source/src_lcao/bfield.cpp +++ /dev/null @@ -1,392 +0,0 @@ -#include "bfield.h" -#include "../src_pw/tools.h" -#include "../src_pw/global.h" -#include "global_fp.h" - -Bfield bfid; - -Bfield::Bfield() -{ - tesla_x = 0.0; - tesla_y = 0.0; - tesla_z = 0.0; - Rydberg_x=0.0; - Rydberg_y=0.0; - Rydberg_z=0.0; //sun zhiyuan updated at 2011-12-26// - Gauge_Origin_x=0.0; - Gauge_Origin_y=0.0; - Gauge_Origin_z=0.0; //sun zhiyuan updated at 2011-12-26// - allocate_tab = false; - nlocal=0; - fac=3.0083e-6; - bohr_mag=1.414213562; - Ready_A_of_Atom=0; - fac_of_phase = 1.414213562/1.0;//'1.0' need to be updated to 'c'. sun zhiyuan added at 2011-12-31// - c=1.0;//137.036*2.0; -} - -Bfield::~Bfield() -{ - - for(int iat=0; iat chec = this->cal_phase(A,r,1); -// cout<<"======"< trial = complex(0,1)*1.0;//complex(1,1); -// cout<<"==========trial==="<Rydberg_x=tesla_x*this->fac; - this->Rydberg_y=tesla_y*this->fac; - this->Rydberg_z=tesla_z*this->fac; -} - - -void Bfield::cal_A(double A[3],double r[3]) //sun zhiyuan updated at 2011-12-26// -{ - double B[3],rtmp[3],DoublA[3]={0,0,0}; - B[0]=Rydberg_x; - B[1]=Rydberg_y; - B[2]=Rydberg_z; - rtmp[0]=r[0]-Gauge_Origin_x; - rtmp[1]=r[1]-Gauge_Origin_y; - rtmp[2]=r[2]-Gauge_Origin_z; - a_x_b(B,rtmp,DoublA); - A[0]=DoublA[0]*0.500; - A[1]=DoublA[1]*0.500; - A[2]=DoublA[2]*0.500; - return; -} -void Bfield::cal_A_of_Atom(void) //Zhiyuan add at 2011-12-24. Former version:cal_RxB// -{ - TITLE("Bfield","cal_A_of_Atom"); - - cout << " begin to prepare for bfield calculations using local orbitals." << endl; - - this->A_of_Atom = new double*[ucell.nat]; - for(int iat=0; iatA_of_Atom[iat] = new double[3]; - ZEROS(A_of_Atom[iat], 3); - } - - double R[3]; - int iat=0; - for(int it=0; ittau[ia].x*ucell.lat0; - R[1] = atom->tau[ia].y*ucell.lat0; - R[2] = atom->tau[ia].z*ucell.lat0; - this->cal_A(A_of_Atom[iat],R); - ++iat; - } - } - this->Ready_A_of_Atom=1; - return; -} - -// exp[(+ or -) i (sqrt(2)/c)*(A dot r)],Zhiyuan add 2011-12-31// -complex Bfield::cal_phase(double A[3],double r[3], int sign) -{ - assert(sign == 1 || sign == -1); - double A_dot_r = A[0]*r[0]+A[1]*r[1]+A[2]*r[2]; //this->a_dot_b(A,r); - double whole = A_dot_r*this->fac_of_phase; - if(sign == -1) - { - whole = - whole; - } - double e1 = std::cos(whole); - double e2 = std::sin(whole); - return complex(e1, e2); -} - -void Bfield::a_x_b(const double* a, const double* b, double *c) -{ - // write a program to calculate a * b, return c - c[0] = a[1] * b[2] - a[2] * b[1]; - c[1] = a[2] * b[0] - a[0] * b[2]; - c[2] = a[0] * b[1] - a[1] * b[0]; -} - -double Bfield::a_dot_b(const double* a, const double* b) -{ - return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]; -} - -double Bfield::a_dot_b(const Vector3 &a, const double* b) -{ - return a.x*b[0]+a.y*b[1]+a.z*b[2]; -} - -void Bfield::get_nlocal(void) -{ - this->trace=new int [NLOCAL]; - for(int i=0;i=0|| ParaO.trace_loc_col[iw_all]>=0) - { - trace[iw_all]=nlocal; - nlocal++; - } - } - } - cout<<"============basis in this processor"<get_nlocal(); - int nkb = ORB.nkb; - - cout << " the dimension of table is (atom, l1, n1, m1) * (atom, l, m) = " - << NLOCAL << " * " << nkb << endl; - assert( nkb >= 0); //in case of all Hydrogen atom, nkb=0// - - this->Tab = new complex*[nlocal]; - if(nkb>0) - { - for(int i=0; i[nkb]; - ZEROS(Tab[i], nkb); - } - Memory::record("Bfield","table",nlocal*nkb,"double"); - - UHM.GG.cal_vnl_B(Tab); - } - - this->allocate_tab = true; - - -/* - cout << " Grid integration: table of " << endl; - for(int i=0; i 0.001 ) - { - cout << setw(15) << Tab[i][j].real(); - ofs_running< nlm=ZERO; - this->snap_psibeta(nlm,indexi,indexj); - LM.set_HSk(i,j,nlm,'N'); - } - } - } - */ - - - -void Bfield::calculate_NL_B(void) -{ - TITLE("Bfield","calculate_NL_B"); - - assert(allocate_tab); - - for (int T1 = 0; T1 < ucell.ntype; T1++) - { - const Atom* atom1 = &ucell.atoms[T1]; - for (int I1 =0; I1< atom1->na; I1++) - { - //GridD.Find_atom( atom1->tau[I1] ); - GridD.Find_atom( atom1->tau[I1] ,T1, I1); - const int iat1 = ucell.itia2iat(T1, I1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - const Vector3 tau1 = atom1->tau[I1]; - - for (int ad2=0; ad2 tau2 = ucell.atoms[T2].tau[I2]; - - // < psi1 | all projectors | psi2 > - for (int j=0; jnw; j++) - { - const int iw1_all = start1 + j; - const int mu = ParaO.trace_loc_row[iw1_all]; - if(mu < 0)continue; - - // fix a serious bug: atom2[T2] -> atom2 - // mohan 2010-12-20 - for (int k=0; knw; k++) - { - const int iw2_all = start2 + k; - const int nu = ParaO.trace_loc_col[iw2_all]; - if(nu < 0)continue; - //(3) run over all projectors in nonlocal pseudopotential. - for (int ad0=0; ad0 < ucell.nat; ad0++) - { - const int T0 = ucell.iat2it[ad0]; - const int I0 = ucell.iat2ia[ad0]; - - // mohan add 2010-12-19 - // if( ORB.nproj[T0] == 0) continue; - - const int start0 = ucell.itiaiw2iwt(T0, I0, 0); - const Vector3 tau0 = ucell.atoms[T0].tau[I0]; - - complex nlm=ZERO; - this->snap_psibeta( - nlm, 0, - tau1, T1, iw1_all, - tau2, T2, iw2_all, - tau0, T0, I0); - LM.set_HSk(iw1_all,iw2_all,nlm,'N'); - } // ad0 - }// k - } // j - //---------------------------------------------------------------------------------- - } // ad2 - } // I1 - } // T1 - - delete [] trace; - - return; -} - -void Bfield::snap_psibeta( - complex &nlm, - const int& job, - const Vector3 &R1, - const int &T1, - const int &iw1_all, - const Vector3 &R2, - const int &T2, - const int &iw2_all, - const Vector3 &R0,// The projector. - const int &T0, - const int &I0) const -{ - const int nproj = ORB.nproj[T0]; - Numerical_Orbital::set_position(R1, R2); - - // (1) get distance between R1 and R2 (a.u.) - // judge if there exist overlap - double distance = Numerical_Orbital::get_distance()*ucell.lat0; - - const double Rcut1 = ORB.Phi[T1].getRcut(); - const double Rcut2 = ORB.Phi[T2].getRcut(); - - nlm = ZERO; - - if( distance > (Rcut1 + Rcut2) ) return; - - int indexi=trace[iw1_all]; - int indexj=trace[iw2_all]; //sun zhiyuan add// - - int ib_start = ORB.itiaib2ib_all(T0,I0,0); - for(int nb=0; nb -#include "../src_global/vector3.h" -using namespace std; - -class Bfield -{ - public: - Bfield(); - ~Bfield(); - - double tesla_x; - double tesla_y; - double tesla_z; - double Rydberg_x; - double Rydberg_y; - double Rydberg_z; //sun zhiyuan added at 2011-12-26// - double Gauge_Origin_x; - double Gauge_Origin_y; - double Gauge_Origin_z; //sun zhiyuan added at 2011-12-26// - double fac_of_phase; //sun zhiyuan added at 2011-12-31// - double bohr_mag; //sun zhiyuan added at 2012-02-17// - bool Ready_A_of_Atom; //judge whether A_of_Atom has been done, 2012-01-05// - - double fac; //transform from IU to Rydberg// - double c; //speed of light in Rydberg unit// - - int nlocal; //nlocal is the number of local basis this processor includes// - int *trace; //trace[NLOCAL] this array gives the index of a basis among the bases in this processor according to its index among the whole bases// - - double** A_of_Atom; //nAtom*3, Zhiyuan add at 2011-12-24, former version:RxB// - complex** Tab; - - void check(); //Zhiyuan add 2011-12-27 in order to check the input// - void convert(); //Convert bfield to Rydberg unit, sun zhiyuan added at 2011-12-26// - void cal_A_of_Atom(void); - void make_table(void); - bool allocate_tab; - - complex cal_phase(double A[3], double r[3], int sign); //Zhiyuan add 2011-12-31// - void cal_A(double A[3],double r[3]); //sun zhiyuan add at 2011-08-07// - static void a_x_b(const double* a, const double* b, double*c); - static double a_dot_b(const double* a, const double* b); - static double a_dot_b(const Vector3 &a, const double *b); - - void calculate_NL_B(void); - - void snap_psibeta(complex &nlm, const int& job, - const Vector3 &R1, - const int &T1, - const int &iw1_all, - const Vector3 &R2, - const int &T2, - const int &iw2_all, - const Vector3 &R0,// The projector. - const int &T0, - const int &I0 - ) const; - void get_nlocal(void); //sun zhiyuan add at 2011-08-22, for the dimension of table// - - void add_zeeman(); - - - -}; - -extern Bfield bfid; - -#endif diff --git a/ABACUS.develop/source/src_lcao/build_st_pw.cpp b/ABACUS.develop/source/src_lcao/build_st_pw.cpp index f3688ca5ee..ac6467bfc1 100644 --- a/ABACUS.develop/source/src_lcao/build_st_pw.cpp +++ b/ABACUS.develop/source/src_lcao/build_st_pw.cpp @@ -1,6 +1,8 @@ #include "build_st_pw.h" #include "../src_pw/global.h" +#include "../src_lcao/global_fp.h" // mohan add 2021-01-30 + Build_ST_pw::Build_ST_pw() { @@ -11,7 +13,7 @@ Build_ST_pw::~Build_ST_pw() } -// be called in Use_Hamilt_Matrix::calculate_STNR_k() +// be called in LCAO_Hamilt::calculate_STNR_k() // FUNCTION: calculate the overlap and kinetic matrix // in localized basis (expanded in plane wave basis). void Build_ST_pw::set_ST(const int &ik, const char& dtype) @@ -130,49 +132,50 @@ void Build_ST_pw::set_local(const int &ik) for(int i=0; i v = ZERO; for(int ig=0; ig v = ZERO; + for(int ig=0; ig* psi_down = new complex [npw]; @@ -187,8 +190,8 @@ void Build_ST_pw::set_local(const int &ik) psi_down[ig] = wf.wanf2[ik](i, ig+ wf.npwx); } - ZEROS( psic, pw.nrxxs); - ZEROS( psic1, pw.nrxxs); + ZEROS( psic, pw.nrxx); + ZEROS( psic1, pw.nrxx); // (1) set value for (int ig=0; ig< npw; ig++) { @@ -202,10 +205,10 @@ void Build_ST_pw::set_local(const int &ik) complex sup,sdown; for (int ir=0; ir< pw.nrxx; ir++) { - sup = psic[ir] * (pot.vrs(0,ir) + pot.vrs(3,ir)) + - psic1[ir] * (pot.vrs(1,ir) - complex(0.0,1.0) * pot.vrs(2,ir)); - sdown = psic1[ir] * (pot.vrs(0,ir) - pot.vrs(3,ir)) + - psic[ir] * (pot.vrs(1,ir) + complex(0.0,1.0) * pot.vrs(2,ir)); + sup = psic[ir] * (pot.vr_eff(0,ir) + pot.vr_eff(3,ir)) + + psic1[ir] * (pot.vr_eff(1,ir) - complex(0.0,1.0) * pot.vr_eff(2,ir)); + sdown = psic1[ir] * (pot.vr_eff(0,ir) - pot.vr_eff(3,ir)) + + psic[ir] * (pot.vr_eff(1,ir) + complex(0.0,1.0) * pot.vr_eff(2,ir)); psic[ir] = sup; psic1[ir] = sdown; diff --git a/ABACUS.develop/source/src_lcao/center2_orb-orb11.cpp b/ABACUS.develop/source/src_lcao/center2_orb-orb11.cpp index d849886bd9..85cbf93408 100644 --- a/ABACUS.develop/source/src_lcao/center2_orb-orb11.cpp +++ b/ABACUS.develop/source/src_lcao/center2_orb-orb11.cpp @@ -6,15 +6,15 @@ #include "center2_orb-orb11.h" #include "src_global/constants.h" -#include "src_lcao/ylm.h" +#include "src_global/ylm.h" #include Center2_Orb::Orb11::Orb11( const Numerical_Orbital_Lm &nA_in, const Numerical_Orbital_Lm &nB_in, - const Make_Overlap_Table &MOT_in, - const Make_Gaunt_Table &MGT_in + const ORB_table_phi &MOT_in, + const ORB_gaunt_table &MGT_in ) :nA(nA_in), nB(nB_in), @@ -22,14 +22,16 @@ Center2_Orb::Orb11::Orb11( MGT(MGT_in) {} -void Center2_Orb::Orb11::init_radial_table() +void Center2_Orb::Orb11::init_radial_table(void) { const int LA = nA.getL(); const int LB = nB.getL(); for( int LAB = std::abs(LA-LB); LAB<=LA+LB; ++LAB) { if( (LAB-std::abs(LA-LB))%2==1 ) // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 + { continue; + } const int rmesh = MOT.get_rmesh(nA.getRcut(),nB.getRcut()) ; @@ -45,6 +47,7 @@ void Center2_Orb::Orb11::init_radial_table() VECTOR_TO_PTR(Table_r[LAB]), VECTOR_TO_PTR(Table_dr[LAB])); } + return; } void Center2_Orb::Orb11::init_radial_table( const set &radials ) @@ -146,4 +149,4 @@ double Center2_Orb::Orb11::cal_overlap( } return overlap; -} \ No newline at end of file +} diff --git a/ABACUS.develop/source/src_lcao/center2_orb-orb11.h b/ABACUS.develop/source/src_lcao/center2_orb-orb11.h index e48db6b7f8..40c7529c32 100644 --- a/ABACUS.develop/source/src_lcao/center2_orb-orb11.h +++ b/ABACUS.develop/source/src_lcao/center2_orb-orb11.h @@ -15,31 +15,36 @@ using std::set; #include "center2_orb.h" -#include "src_lcao/make_overlap_table.h" -#include "src_lcao/make_gaunt_table.h" -#include "src_lcao/numerical_orbital_lm.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/ORB_atomic_lm.h" #include "src_global/vector3.h" class Center2_Orb::Orb11 { -public: + public: + Orb11( const Numerical_Orbital_Lm &nA_in, const Numerical_Orbital_Lm &nB_in, - const Make_Overlap_Table &MOT_in, - const Make_Gaunt_Table &MGT_in ); - void init_radial_table(); + const ORB_table_phi &MOT_in, + const ORB_gaunt_table &MGT_in ); + + void init_radial_table(void); + void init_radial_table( const set &radials ); // unit: Bohr/MOT.dr + double cal_overlap( const Vector3 &RA, const Vector3 &RB, // unit: Bohr const int &mA, const int &mB) const; -private: + private: + const Numerical_Orbital_Lm &nA; const Numerical_Orbital_Lm &nB; - const Make_Overlap_Table &MOT; - const Make_Gaunt_Table &MGT; + const ORB_table_phi &MOT; + const ORB_gaunt_table &MGT; map> Table_r; // unit: Bohr/MOT.dr map> Table_dr; @@ -47,4 +52,4 @@ class Center2_Orb::Orb11 // this->Table_r[LAB][ir] -#endif // CENTER2_ORB_ORB11_H \ No newline at end of file +#endif // CENTER2_ORB_ORB11_H diff --git a/ABACUS.develop/source/src_lcao/center2_orb-orb21.cpp b/ABACUS.develop/source/src_lcao/center2_orb-orb21.cpp index abc33a0e79..708ae463a7 100644 --- a/ABACUS.develop/source/src_lcao/center2_orb-orb21.cpp +++ b/ABACUS.develop/source/src_lcao/center2_orb-orb21.cpp @@ -6,7 +6,7 @@ #include "center2_orb-orb21.h" #include "src_global/constants.h" -#include "src_lcao/ylm.h" +#include "src_global/ylm.h" #include @@ -14,8 +14,8 @@ Center2_Orb::Orb21::Orb21( const Numerical_Orbital_Lm &nA1_in, const Numerical_Orbital_Lm &nA2_in, const Numerical_Orbital_Lm &nB_in, - const Make_Overlap_Table &MOT_in, - const Make_Gaunt_Table &MGT_in + const ORB_table_phi &MOT_in, + const ORB_gaunt_table &MGT_in ) :nA1(nA1_in), nA2(nA2_in), @@ -132,4 +132,4 @@ double Center2_Orb::Orb21::cal_overlap( } return overlap; -} \ No newline at end of file +} diff --git a/ABACUS.develop/source/src_lcao/center2_orb-orb21.h b/ABACUS.develop/source/src_lcao/center2_orb-orb21.h index c60d388a15..ad21824748 100644 --- a/ABACUS.develop/source/src_lcao/center2_orb-orb21.h +++ b/ABACUS.develop/source/src_lcao/center2_orb-orb21.h @@ -16,33 +16,39 @@ using std::set; #include "center2_orb.h" #include "center2_orb-orb11.h" -#include "src_lcao/make_overlap_table.h" -#include "src_lcao/make_gaunt_table.h" -#include "src_lcao/numerical_orbital_lm.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/ORB_atomic_lm.h" #include "src_global/vector3.h" class Center2_Orb::Orb21 { -public: + + public: + Orb21( const Numerical_Orbital_Lm &nA1_in, const Numerical_Orbital_Lm &nA2_in, const Numerical_Orbital_Lm &nB_in, - const Make_Overlap_Table &MOT_in, - const Make_Gaunt_Table &MGT_in ); + const ORB_table_phi &MOT_in, + const ORB_gaunt_table &MGT_in ); + void init_radial_table(); + void init_radial_table( const set &radials ); // unit: Bohr/MOT.dr + double cal_overlap( const Vector3 &RA, const Vector3 &RB, // unit: Bohr const int &mA1, const int &mA2, const int &mB ) const; -private: + private: + const Numerical_Orbital_Lm &nA1; const Numerical_Orbital_Lm &nA2; const Numerical_Orbital_Lm &nB; - const Make_Overlap_Table &MOT; - const Make_Gaunt_Table &MGT; + const ORB_table_phi &MOT; + const ORB_gaunt_table &MGT; map nA; map orb11s; @@ -50,4 +56,4 @@ class Center2_Orb::Orb21 // this->orb11s[LA].Table_r[LAB][ir] -#endif // CENTER2_ORB_ORB21_H \ No newline at end of file +#endif // CENTER2_ORB_ORB21_H diff --git a/ABACUS.develop/source/src_lcao/center2_orb-orb22.cpp b/ABACUS.develop/source/src_lcao/center2_orb-orb22.cpp index 91d71383d9..f4839f27eb 100644 --- a/ABACUS.develop/source/src_lcao/center2_orb-orb22.cpp +++ b/ABACUS.develop/source/src_lcao/center2_orb-orb22.cpp @@ -10,8 +10,8 @@ Center2_Orb::Orb22::Orb22( const Numerical_Orbital_Lm &nA2_in, const Numerical_Orbital_Lm &nB1_in, const Numerical_Orbital_Lm &nB2_in, - const Make_Overlap_Table &MOT_in, - const Make_Gaunt_Table &MGT_in + const ORB_table_phi &MOT_in, + const ORB_gaunt_table &MGT_in ) :nA1(nA1_in), nA2(nA2_in), @@ -22,8 +22,6 @@ Center2_Orb::Orb22::Orb22( void Center2_Orb::Orb22::init_radial_table() { - TITLE("Center2_Orb::Orb22::init_radial_table"); - const Numerical_Orbital_Lm & nB_short = (nB1.getNr()<=nB2.getNr()) ? nB1 : nB2; vector nB_tmp(nB_short.getNr()); @@ -31,7 +29,7 @@ void Center2_Orb::Orb22::init_radial_table() { nB_tmp[ir] = nB1.getPsi(ir) * nB2.getPsi(ir); } - + const int LB1 = nB1.getL(); const int LB2 = nB2.getL(); for( int LB = abs(LB1-LB2); LB<=LB1+LB2; ++LB) @@ -63,8 +61,6 @@ void Center2_Orb::Orb22::init_radial_table() void Center2_Orb::Orb22::init_radial_table( const set &radials ) { - TITLE("Center2_Orb::Orb22::init_radial_table"); - const Numerical_Orbital_Lm & nB_short = (nB1.getNr()<=nB2.getNr()) ? nB1 : nB2; vector nB_tmp(nB_short.getNr()); @@ -106,8 +102,6 @@ double Center2_Orb::Orb22::cal_overlap( const Vector3 &RA, const Vector3 &RB, const int &mA1, const int &mA2, const int &mB1, const int &mB2) const { - TITLE("Center2_Orb::Orb22::cal_overlap"); - const int LB1 = nB1.getL(); const int LB2 = nB2.getL(); diff --git a/ABACUS.develop/source/src_lcao/center2_orb-orb22.h b/ABACUS.develop/source/src_lcao/center2_orb-orb22.h index 646b3876fc..49e9bdbbdb 100644 --- a/ABACUS.develop/source/src_lcao/center2_orb-orb22.h +++ b/ABACUS.develop/source/src_lcao/center2_orb-orb22.h @@ -16,9 +16,9 @@ using std::set; #include "center2_orb.h" #include "center2_orb-orb21.h" -#include "src_lcao/make_overlap_table.h" -#include "src_lcao/make_gaunt_table.h" -#include "src_lcao/numerical_orbital_lm.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/ORB_atomic_lm.h" #include "src_global/vector3.h" class Center2_Orb::Orb22 @@ -29,8 +29,8 @@ class Center2_Orb::Orb22 const Numerical_Orbital_Lm &nA2_in, const Numerical_Orbital_Lm &nB1_in, const Numerical_Orbital_Lm &nB2_in, - const Make_Overlap_Table &MOT_in, - const Make_Gaunt_Table &MGT_in ); + const ORB_table_phi &MOT_in, + const ORB_gaunt_table &MGT_in ); void init_radial_table(); void init_radial_table( const set &radials ); // unit: Bohr/MOT.dr double cal_overlap( @@ -43,8 +43,8 @@ class Center2_Orb::Orb22 const Numerical_Orbital_Lm &nB1; const Numerical_Orbital_Lm &nB2; - const Make_Overlap_Table &MOT; - const Make_Gaunt_Table &MGT; + const ORB_table_phi &MOT; + const ORB_gaunt_table &MGT; map nB; map orb21s; @@ -52,4 +52,4 @@ class Center2_Orb::Orb22 // this->orb21s[L34].psi2_center2[L12].Table_r[L1234][ir] -#endif // CENTER2_ORB_ORB22_H \ No newline at end of file +#endif // CENTER2_ORB_ORB22_H diff --git a/ABACUS.develop/source/src_lcao/center2_orb-orb22_ccp.cpp b/ABACUS.develop/source/src_lcao/center2_orb-orb22_ccp.cpp new file mode 100644 index 0000000000..f80f0cfa4f --- /dev/null +++ b/ABACUS.develop/source/src_lcao/center2_orb-orb22_ccp.cpp @@ -0,0 +1,48 @@ +#include "center2_orb-orb22_ccp.h" +#include "conv_coulomb_pot.h" +#include "conv_coulomb_pot-inl.h" + +void Center2_Orb::Orb22_Ccp::init_radial_table() +{ + vector nB_tmp(nB1.getNr()); + for( size_t ir=0; ir!=nB_tmp.size(); ++ir) + { + nB_tmp[ir] = nB1.getPsi(ir) * nB2.getPsi(ir); + } + const int LB1 = nB1.getL(); + const int LB2 = nB2.getL(); + for( int LB = abs(LB1-LB2); LB<=LB1+LB2; ++LB) + { + if( (LB-std::abs(LB1-LB2))%2==1 ) // if LA+LB-LAB == odd, then Gaunt_Coefficients = 0 + continue; + +//cout<<"LB\t"< #include "dftu.h" -#include "../input.h" #include "../src_global/constants.h" #include "../src_pw/global.h" #include "global_fp.h" #include "../src_global/global_function.h" #include "../src_global/scalapack_connector.h" #include "../src_global/lapack_connector.h" -#include "../src_pw/inverse_matrix.h" -#include "local_orbital_ions.h" -#include "lcao_matrix.h" +#include "../src_global/inverse_matrix.h" +#include "LOOP_ions.h" +#include "LCAO_matrix.h" #include "../src_pw/magnetism.h" -#include "use_overlap_table.h" +#include "ORB_gen_tables.h" #include "../src_pw/charge.h" - -extern "C" -{ - void sphbsl_(int *n, double *r, double *A, double *val); - void sphhnk_(int *n, double *r, double *A, double *val); -} - - DFTU dftu; DFTU::DFTU(){} @@ -42,22 +33,36 @@ DFTU::DFTU(){} DFTU::~DFTU(){} -void DFTU::init() +void DFTU::init( + UnitCell_pseudo &cell, // unitcell class + Parallel_Orbitals &po // parallel orbitals parameters +) { - TITLE("DFTU", "init()"); + TITLE("DFTU", "init"); + + // please, do not use 'INPUT' directly in the class! + // needs reconstructions in future + // global parameters, need to be removed in future + const int npol = NPOL; // number of polarization directions + const int nlocal = NLOCAL; // number of total local orbitals + const int nks = kv.nks; // number of k-points + const int nspin = NSPIN; // number of spins + const int dftu_type = INPUT.dftu_type; + const int double_counting = INPUT.double_counting; + - if(INPUT.dftu_type==1 && INPUT.double_counting==1) cal_type = 1; - else if(INPUT.dftu_type==1 && INPUT.double_counting==2) cal_type = 2; - else if(INPUT.dftu_type==2 && INPUT.double_counting==1) cal_type = 3; - else if(INPUT.dftu_type==2 && INPUT.double_counting==2) cal_type = 4; + if(dftu_type==1 && double_counting==1) cal_type = 1; + else if(dftu_type==1 && double_counting==2) cal_type = 2; + else if(dftu_type==2 && double_counting==1) cal_type = 3; + else if(dftu_type==2 && double_counting==2) cal_type = 4; else WARNING_QUIT("DFT+U", "Wrong parameter"); this->EU = 0.0; if(FORCE) { - this->force_dftu.resize(ucell.nat); - for(int ia=0; iaforce_dftu.resize(cell.nat); + for(int ia=0; iaforce_dftu.at(ia).resize(3, 0.0); } @@ -74,36 +79,37 @@ void DFTU::init() if(GAMMA_ONLY_LOCAL) { - this->pot_eff_gamma.resize(kv.nks); - for(int ik=0; ikpot_eff_gamma.resize(nks); + for(int ik=0; ikpot_eff_gamma.at(ik).resize(ParaO.nloc, 0.0); + this->pot_eff_gamma.at(ik).resize(po.nloc, 0.0); } } else { - this->Sm_k.resize(kv.nks); - this->pot_eff_k.resize(kv.nks); + this->Sm_k.resize(nks); + this->pot_eff_k.resize(nks); - for(int ik=0; ikSm_k.at(ik).resize(ParaO.nloc, ZERO); - this->pot_eff_k.at(ik).resize(ParaO.nloc, ZERO); + this->Sm_k.at(ik).resize(po.nloc, ZERO); + this->pot_eff_k.at(ik).resize(po.nloc, ZERO); } } - this->locale.resize(ucell.nat); - this->locale_save.resize(ucell.nat); - - this->iatlnmipol2iwt.resize(ucell.nat); - this->iat2it.resize(ucell.nat); - this->iwt2it.resize(NLOCAL); - this->iwt2iat.resize(NLOCAL); - this->iwt2l.resize(NLOCAL); - this->iwt2n.resize(NLOCAL); - this->iwt2m.resize(NLOCAL); - this->iwt2ipol.resize(NLOCAL); - for(int i=0; ilocale.resize(cell.nat); + this->locale_save.resize(cell.nat); + + this->iatlnmipol2iwt.resize(cell.nat); + this->iat2it.resize(cell.nat); + this->iwt2it.resize(nlocal); + this->iwt2iat.resize(nlocal); + this->iwt2l.resize(nlocal); + this->iwt2n.resize(nlocal); + this->iwt2m.resize(nlocal); + this->iwt2ipol.resize(nlocal); + + for(int i=0; iiwt2it.at(i) = -1; this->iwt2iat.at(i) = -1; @@ -113,61 +119,72 @@ void DFTU::init() this->iwt2ipol.at(i) = -1; } - for(int it=0; itiat2it.at(iat) = it; - locale.at(iat).resize(ucell.atoms[it].nwl+1); - locale_save.at(iat).resize(ucell.atoms[it].nwl+1); + locale.at(iat).resize(cell.atoms[it].nwl+1); + locale_save.at(iat).resize(cell.atoms[it].nwl+1); - for(int l=0; l<=ucell.atoms[it].nwl; l++) + for(int l=0; l<=cell.atoms[it].nwl; l++) { - const int N = ucell.atoms[it].l_nchi[l]; + const int N = cell.atoms[it].l_nchi[l]; locale.at(iat).at(l).resize(N); locale_save.at(iat).at(l).resize(N); for(int n=0; niatlnmipol2iwt.at(iat).resize(ucell.atoms[it].nwl+1); - for(int L=0; L<=ucell.atoms[it].nwl; L++) + this->iatlnmipol2iwt.at(iat).resize(cell.atoms[it].nwl+1); + for(int L=0; L<=cell.atoms[it].nwl; L++) { - this->iatlnmipol2iwt.at(iat).at(L).resize(ucell.atoms[it].l_nchi[L]); + this->iatlnmipol2iwt.at(iat).at(L).resize(cell.atoms[it].l_nchi[L]); - for(int n=0; niatlnmipol2iwt.at(iat).at(L).at(n).resize(2*L+1); for(int m=0; m<2*L+1; m++) { - this->iatlnmipol2iwt.at(iat).at(L).at(n).at(m).resize(NPOL); + this->iatlnmipol2iwt.at(iat).at(L).at(n).at(m).resize(npol); } } } - for(int iw=0; iwiatlnmipol2iwt.at(iat).at(l).at(n).at(m).at(ipol) = iwt; this->iwt2it.at(iwt) = it; @@ -183,14 +200,14 @@ void DFTU::init() this->Yukawa = INPUT.yukawa_potential; if(Yukawa) { - this->Fk.resize(INPUT.ntype); + this->Fk.resize(cell.ntype); - this->U_Yukawa.resize(INPUT.ntype); - this->J_Yukawa.resize(INPUT.ntype); + this->U_Yukawa.resize(cell.ntype); + this->J_Yukawa.resize(cell.ntype); - for(int it=0; itFk.at(it).resize(NL); this->U_Yukawa.at(it).resize(NL); @@ -198,7 +215,7 @@ void DFTU::init() for(int l=0; lFk.at(it).at(l).resize(N); for(int n=0; n loc_occup_m; vector loc_occup_m_tmp; - if(NSPIN==1) + if(NSPIN==1 || NSPIN==4) { loc_occup_m.resize(1); loc_occup_m_tmp.resize(1); @@ -372,7 +403,7 @@ void DFTU::cal_occup_m_k(const int iter) loc_occup_m.at(0).create((2*l+1)*NPOL, (2*l+1)*NPOL); loc_occup_m_tmp.at(0).create((2*l+1)*NPOL, (2*l+1)*NPOL); } - else if(NSPIN==2 || NSPIN==4) + else if(NSPIN==2) { loc_occup_m.resize(2); loc_occup_m_tmp.resize(2); @@ -404,54 +435,26 @@ void DFTU::cal_occup_m_k(const int iter) const int irc = nu*ParaO.nrow + mu; const int irc_prime = mu_prime*ParaO.nrow + nu_prime; - // const int m0_all = m0 + ipol0*(2*l+1); - // const int m1_all = m1 + ipol1*(2*l+1); + const int m0_all = m0 + ipol0*(2*l+1); + const int m1_all = m1 + ipol1*(2*l+1); if( (nu>=0) && (mu>=0) ) { - if(NSPIN==1 || NSPIN==2) + for(int ik=0; ik=0) && (mu_prime>=0) ) { - if(NSPIN==1 || NSPIN==2) - { - for(int ik=0; ik> zeta; ifdftu.ignore(150, '\n'); - for(int is=0; is<2; is++) + if(NSPIN==1 || NSPIN==2) + { + for(int is=0; is<2; is++) + { + ifdftu >> word; + if(strcmp("spin", word) == 0) + { + ifdftu >> spin; + ifdftu.ignore(150, '\n'); + + double value = 0.0; + for(int m0=0; m0<2*L+1; m0++) + { + for(int m1=0; m1<2*L+1; m1++) + { + ifdftu >> value; + locale.at(iat).at(L).at(zeta).at(spin)(m0, m1) = value; + } + ifdftu.ignore(150, '\n'); + } + } + else + { + cout << "WRONG IN READING LOCAL OCCUPATION NUMBER MATRIX FROM DFTU FILE" << endl; + exit(0); + } + } + } + else if(NSPIN==4) //SOC { - ifdftu >> word; - if(strcmp("spin", word) == 0) - { - ifdftu >> spin; - ifdftu.ignore(150, '\n'); - - double value = 0.0; - for(int m0=0; m0<2*L+1; m0++) + double value = 0.0; + for(int m0=0; m0<2*L+1; m0++) + { + for(int ipol0=0; ipol0> value; - locale.at(iat).at(L).at(zeta).at(spin)(m0, m1) = value; + { + for(int ipol1=0; ipol1> value; + locale.at(iat).at(L).at(zeta).at(0)(m0_all, m1_all) = value; + } } - ifdftu.ignore(150, '\n'); - } + ifdftu.ignore(150, '\n'); + } } - else - { - cout << "WRONG IN READING LOCAL OCCUPATION NUMBER MATRIX FROM DFTU FILE" << endl; - exit(0); - } } } else @@ -1054,15 +1114,38 @@ void DFTU::local_occup_bcast() // if(!Yukawa && n!=0) continue; if(n!=0) continue; - for(int spin=0; spin<2; spin++) + if(NSPIN==1 || NSPIN==2) { - for(int m0=0; m0<2*l+1; m0++) - { - for(int m1=0; m1<2*l+1; m1++) + for(int spin=0; spin<2; spin++) + { + for(int m0=0; m0<2*l+1; m0++) { - MPI_Bcast(&locale.at(iat).at(l).at(n).at(spin)(m0, m1), 1, MPI_DOUBLE, 0, MPI_COMM_WORLD); + for(int m1=0; m1<2*l+1; m1++) + { + MPI_Bcast(&locale.at(iat).at(l).at(n).at(spin)(m0, m1), 1, MPI_DOUBLE, 0, MPI_COMM_WORLD); + } } - } + } + } + else if(NSPIN==4) //SOC + { + for(int m0=0; m0<2*L+1; m0++) + { + for(int ipol0=0; ipol0locale.at(iat).at(l).at(n).at(spin)(m0, m0); + for(int m1=0; m1<2*l+1; m1++) + { + nm2_trace += this->locale.at(iat).at(l).at(n).at(spin)(m0,m1)*this->locale.at(iat).at(l).at(n).at(spin)(m1,m0); + } + } + if(Yukawa) this->EU += 0.5*(this->U_Yukawa.at(T).at(l).at(n) - this->J_Yukawa.at(T).at(l).at(n))*(nm_trace - nm2_trace); + else this->EU += 0.5*(this->U[T] - this->J[T])*(nm_trace - nm2_trace); + } + } + else if(NSPIN==4) //SOC { double nm_trace = 0.0; double nm2_trace = 0.0; for(int m0=0; m0<2*l+1; m0++) { - nm_trace += this->locale.at(iat).at(l).at(n).at(spin)(m0, m0); - for(int m1=0; m1<2*l+1; m1++) + for(int ipol0=0; ipol0locale.at(iat).at(l).at(n).at(spin)(m0,m1)*this->locale.at(iat).at(l).at(n).at(spin)(m1,m0); + const int m0_all = m0 + (2*l+1)*ipol0; + nm_trace += this->locale.at(iat).at(l).at(n).at(0)(m0_all, m0_all); + + for(int m1=0; m1<2*l+1; m1++) + { + for(int ipol1=0; ipol1locale.at(iat).at(l).at(n).at(0)(m0_all,m1_all)*this->locale.at(iat).at(l).at(n).at(0)(m1_all, m0_all); + } + } } } if(Yukawa) this->EU += 0.5*(this->U_Yukawa.at(T).at(l).at(n) - this->J_Yukawa.at(T).at(l).at(n))*(nm_trace - nm2_trace); - else this->EU += 0.5*(this->U[T] - this->J[T])*(nm_trace - nm2_trace); + else this->EU += 0.5*(this->U[T] - this->J[T])*(nm_trace - nm2_trace); } } @@ -1146,16 +1258,34 @@ void DFTU::cal_energy_correction(const int istep) //calculate the double counting term included in eband for(int m1=0; m1<2*l+1; m1++) - { - for(int m2=0; m2<2*l+1; m2++) - { - for(int is=0; is<2; is++) - { - double VU = 0.0; - VU = get_onebody_eff_pot(T, iat, l, n, is, m1, m2, cal_type, 0); - EU_dc += VU*this->locale.at(iat).at(l).at(n).at(is)(m1,m2); - } - } + { + for(int ipol1=0; ipol1locale.at(iat).at(l).at(n).at(is)(m1_all,m2_all); + } + } + else if(NSPIN==4) //SOC + { + double VU = 0.0; + VU = get_onebody_eff_pot(T, iat, l, n, 0, m1_all, m2_all, cal_type, 0); + EU_dc += VU*this->locale.at(iat).at(l).at(n).at(0)(m1_all,m2_all); + } + } + } + } } }//end n }//end L @@ -1194,6 +1324,8 @@ void DFTU::cal_eff_pot_mat(const int ik, const int istep) if((CALCULATION=="scf" || CALCULATION=="relax" || CALCULATION=="cell-relax") && (!INPUT.omc) && istep==0 && this->iter_dftu==1) return; + int spin = kv.isk[ik]; + if(GAMMA_ONLY_LOCAL) ZEROS(VECTOR_TO_PTR(this->pot_eff_gamma.at(kv.isk[ik])), ParaO.nloc); else ZEROS(VECTOR_TO_PTR(this->pot_eff_k.at(ik)), ParaO.nloc); @@ -1322,21 +1454,12 @@ void DFTU::cal_eff_pot_mat(const int ik, const int istep) // if(m1==m2 && iwt1==iwt2) delta.at(irc) = 1.0; - if(NSPIN==1 || NSPIN==2) - { - int spin = kv.isk[ik]; - double val = get_onebody_eff_pot(T1, iat1, L1, n1, spin, m1, m2, cal_type, 1); - VU.at(irc) = complex(val, 0.0); - } - else if(NSPIN==4) //SOC - { - if(ipol1==ipol2) - { - int spin = ipol1; - double val = get_onebody_eff_pot(T1, iat1, L1, n1, spin, m1, m2, cal_type, 1); - VU.at(irc) = complex(val, 0.0); - } - } + int m1_all = m1 + (2*L1+1)*ipol1; + int m2_all = m2 + (2*L2+1)*ipol2; + + double val = get_onebody_eff_pot(T1, iat1, L1, n1, spin, m1_all, m2_all, cal_type, 1); + + VU.at(irc) = complex(val, 0.0); } } vector> potm_tmp(ParaO.nloc, complex(0.0, 0.0)); @@ -1419,1432 +1542,69 @@ void DFTU::cal_eff_pot_mat(const int ik, const int istep) } -double DFTU::get_onebody_eff_pot -( - const int T, const int iat, - const int L, const int N, const int spin, - const int m0, const int m1, - const int type, const bool newlocale -) +void DFTU::output() { - TITLE("DFTU","get_onebody_eff_pot"); - - double VU = 0.0; - - //if(!Yukawa && N!=0) return 0.0; - - switch(type) - { - case 1: //rotationally invarient formalism and FLL double counting; Not available at present - - - break; + TITLE("DFTU", "output"); + + ofs_running << "//=========================L(S)DA+U===========================//" << endl; - case 2: //rotationally invarient formalism and AMF double counting; Not available at present - - break; + for(int T=0; TU_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*( 0.5 - this->locale.at(iat).at(L).at(N).at(spin)(m0,m1) ); - else VU = -(this->U_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*this->locale.at(iat).at(L).at(N).at(spin)(m0,m1); - } - else - { - if(m0==m1) VU = (this->U[T]-this->J[T])*( 0.5 - this->locale.at(iat).at(L).at(N).at(spin)(m0,m1) ); - else VU = -(this->U[T]-this->J[T])*this->locale.at(iat).at(L).at(N).at(spin)(m0,m1); - } - } - else - { - if(Yukawa) - { - if(m0==m1) VU = (this->U_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*( 0.5 - this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1) ); - else VU = -(this->U_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1); - } - else - { - if(m0==m1) VU = (this->U[T]-this->J[T])*( 0.5 - this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1) ); - else VU = -(this->U[T]-this->J[T])*this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1); - } - } - - break; - - case 4: //simplified formalism and AMF double counting; ot available at present - - break; - } - - return VU; -} - - -void DFTU::force_stress() -{ - TITLE("DFTU", "force_stress"); + const int N = ucell.atoms[T].l_nchi[L]; - if(FORCE) - { - for(int iat=0; iat=INPUT.orbital_corr[T] && INPUT.orbital_corr[T]!=-1) { - this->force_dftu.at(iat).at(dim) = 0.0; + if(L!=INPUT.orbital_corr[T]) continue; + + if(!Yukawa) + { + ofs_running << "atom_type=" << T << " L=" << L << " chi=" << 0 << " U=" << this->U[T]*Ry_to_eV + << "ev J=" << this->J[T]*Ry_to_eV << "ev" << endl; + } + else + { + for(int n=0; nU_Yukawa.at(T).at(L).at(n) - this->J_Yukawa.at(T).at(L).at(n))*Ry_to_eV; + ofs_running << "atom_type=" << T << " L=" << L << " chi=" << n << " U=" << this->U_Yukawa.at(T).at(L).at(n)*Ry_to_eV << "ev " << "J=" << this->J_Yukawa.at(T).at(L).at(n)*Ry_to_eV + << "ev" << endl; + } + } } } } - if(STRESS) - { - for(int dim=0; dim<3; dim++) - { - this->stress_dftu.at(dim).at(0) = 0.0; - this->stress_dftu.at(dim).at(1) = 0.0; - this->stress_dftu.at(dim).at(2) = 0.0; - } - } - - this->allocate_force_stress(); - - //======================================================= - // intialize single particel effective potential matrix - //======================================================= - vector>> VU_k; - vector> VU_gamma; - if(FORCE || STRESS) + ofs_running << "Local occupation matrices" << endl; + for(int T=0; Tfolding_dSm_soverlap(); - - if(GAMMA_ONLY_LOCAL) - { - VU_gamma.resize(NSPIN); - for(int is=0; is(0.0,0.0)); - } - else if(NSPIN==2 || NSPIN==4) - { - VU_k.resize(2); - for(int is=0; is<2; is++) - { - VU_k.at(is).resize(ParaO.nloc, complex(0.0,0.0)); - } - } - } + if(INPUT.orbital_corr[T]==-1) continue; + const int NL = ucell.atoms[T].nwl+1; + const int LC = INPUT.orbital_corr[T]; - for(int ir=0; iriwt2it.at(iwt1); - const int iat1 = this->iwt2iat.at(iwt1); - const int L1 = this->iwt2l.at(iwt1); - const int n1 = this->iwt2n.at(iwt1); - const int m1 = this->iwt2m.at(iwt1); - const int ipol1 = this->iwt2ipol.at(iwt1); + const int iat = ucell.itia2iat(T, I); + ofs_running << "atoms" << " " << iat ; - for(int ic=0; iciwt2it.at(iwt2); - const int iat2 = this->iwt2iat.at(iwt2); - const int L2 = this->iwt2l.at(iwt2); - const int n2 = this->iwt2n.at(iwt2); - const int m2 = this->iwt2m.at(iwt2); - const int ipol2 = this->iwt2ipol.at(iwt2); - - int irc = ic*ParaO.nrow + ir; - - if(INPUT.orbital_corr[T1]==-1 || INPUT.orbital_corr[T2]==-1) continue; - - if(iat1!=iat2) continue; - // if(Yukawa) // { - // if(L1(val, 0.0); - } - else if(NSPIN==2) - { - for(int is=0; is(val, 0.0); - } - } - else if(NSPIN==4)//SOC - { - if(ipol1==ipol2) - { - int is = ipol1; - double val = get_onebody_eff_pot(T1, iat1, L1, n1, is, m1, m2, cal_type, false); - VU_k.at(is).at(irc) = complex(val, 0.0); - } - } - } - - }//end ic - }//end ir - } - - //======================================================= - // calculate force - //======================================================= - if(FORCE) - { - if(GAMMA_ONLY_LOCAL) cal_force_gamma(VU_gamma); - else cal_force_k(VU_k); - } - - if(STRESS) - { - if(GAMMA_ONLY_LOCAL) cal_stress_gamma(VU_gamma); - else cal_stress_k(VU_k); - } - - return; -} - - -void DFTU::cal_force_k(vector>> &VU) -{ - TITLE("DFTU", "cal_force_k"); - - const char transN = 'N', transT = 'T'; - const int one_int = 1; - const double alpha = 1.0, beta = 0.0; - - vector>> ftmp(ucell.nat); - for(int ia=0; ia(0.0,0.0)); //three dimension - } - - vector>> dm_VU_dSm(3); - for(int dim=0; dim<3; dim++) - { - dm_VU_dSm.at(dim).resize(ParaO.nloc, complex(0.0, 0.0)); - } - - for(int ik=0; ik> mat_tmp(ParaO.nloc, complex(0.0, 0.0)); - vector> force_tmp(ParaO.nloc, complex(0.0, 0.0)); - - if(dim==0) //dim=1,2 are same as dim=0 - { - ZEROS(VECTOR_TO_PTR(mat_tmp), ParaO.nloc); - - pzgemm_(&transT, &transN, - &NLOCAL, &NLOCAL, &NLOCAL, - &alpha, - LOC.wfc_dm_2d.dm_k.at(ik).c, &one_int, &one_int, ParaO.desc, - VECTOR_TO_PTR(VU.at(spin)), &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc); - } - - pzgemm_(&transN, &transN, - &NLOCAL, &NLOCAL, &NLOCAL, - &alpha, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, - this->dSm_k[ik][dim], &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(force_tmp), &one_int, &one_int, ParaO.desc); - - for(int irc=0; ircdSm_k[ik][dim], &one_int, &one_int, ParaO.desc, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(force_tmp), &one_int, &one_int, ParaO.desc); - - for(int irc=0; irciwt2iat.at(iwt1); - - for(int ic=0; iciwt2iat.at(iwt2); - - const int irc = ic*ParaO.nrow + ir; - - if(iat1==iat2 && iwt1==iwt2) - { - ftmp.at(iat1).at(dim) += dm_VU_dSm.at(dim).at(irc); - } - }//end ic - }//end ir - - for(int iat=0; iat val = ftmp.at(iat).at(dim); - MPI_Allreduce(&val, &ftmp.at(iat).at(dim), 1, MPI_DOUBLE_COMPLEX, MPI_SUM, MPI_COMM_WORLD); - - this->force_dftu.at(iat).at(dim) = ftmp.at(iat).at(dim).real(); - } - } - - /* - if(MY_RANK==0) - { - ofstream of_fdftu("force_dftu.dat", ios_base::app); - for(int iat=0; iat>> &VU) -{ - TITLE("DFTU", "cal_stress_k"); - - const char transN = 'N', transT = 'T'; - const int one_int = 1; - const double alpha = 1.0, beta = 0.0; - - int count = 0; - for(int dim1=0; dim1<3; dim1++) - { - for(int dim2=dim1; dim2<3; dim2++) - { - vector> dm_VU_sover(ParaO.nloc, complex(0.0, 0.0)); - - for(int ik=0; ik> stress_tmp(ParaO.nloc, complex(0.0, 0.0)); - - //Calculate mat_tmp=dm*VU - vector> mat_tmp(ParaO.nloc, complex(0.0, 0.0)); - - pzgemm_(&transT, &transN, - &NLOCAL, &NLOCAL, &NLOCAL, - &alpha, - LOC.wfc_dm_2d.dm_k.at(ik).c, &one_int, &one_int, ParaO.desc, - VECTOR_TO_PTR(VU.at(spin)), &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc); - - pzgemm_(&transN, &transN, - &NLOCAL, &NLOCAL, &NLOCAL, - &alpha, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, - this->soverlap_k[ik][count], &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); - - for(int irc=0; ircsoverlap_k[ik][count], &one_int, &one_int, ParaO.desc, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); - - for(int irc=0; irc stmp(0.0, 0.0); - for(int ir=0; ir tmp; - MPI_Allreduce(&stmp, &tmp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); - - /* - if(MY_RANK==0) - { - ofstream of_s("stress_test.dat", ios_base::app); - - of_s << "(" << fixed << setprecision(9) << setw(12) << tmp.real() << " i" << fixed << setprecision(9) << setw(12) << tmp.imag() << ") "; - - of_s << endl; - } - */ - - - count++; - }//end dim2 - - }//end dim1 - - for(int i=0; i<3; i++) - { - for(int j=0; j<3; j++) - { - if(i>j) this->stress_dftu.at(i).at(j) = stress_dftu.at(j).at(i); - } - } - - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->stress_dftu.at(i).at(j) *= ucell.lat0 / ucell.omega; - } - } - - /* - if(MY_RANK==0) - { - ofstream of_sdftu("stress_dftu.dat", ios_base::app); - for(int dim1=0; dim1<3; dim1++) - { - for(int dim2=0; dim2<3; dim2++) - { - of_sdftu << fixed << setprecision(9) << setw(12) << this->stress_dftu.at(dim1).at(dim2) << " "; - } - of_sdftu << endl; - } - of_sdftu << endl; - } - */ - - return; -} - - -void DFTU::cal_force_gamma(vector> &VU) -{ - TITLE("DFTU", "cal_force_gamma"); - - const char transN = 'N', transT = 'T'; - const int one_int = 1; - const double alpha = 1.0, beta = 0.0; - - vector> dm_VU_dSm; - dm_VU_dSm.resize(3); - for(int dim=0; dim<3; dim++) - { - dm_VU_dSm.at(dim).resize(ParaO.nloc, 0.0); - } - - vector force_tmp(ParaO.nloc, 0.0); - //Calculate mat_tmp=dm*VU - vector mat_tmp(ParaO.nloc, 0.0); - - for(int ik=0; ik> ftmp; - ftmp.resize(ucell.nat); - for(int iat=0; iatiwt2iat.at(iwt1); - - for(int ic=0; iciwt2iat.at(iwt2); - - const int irc = ic*ParaO.nrow + ir; - - if(iat1==iat2 && iwt1==iwt2) - { - ftmp.at(iat1).at(dim) += dm_VU_dSm.at(dim).at(irc); - } - }//end ic - }//end ir - }//end dim - - - for(int iat=0; iatforce_dftu.at(iat).at(dim) = tmp; - } - - /* - if(MY_RANK==0) - { - ofstream of_fdftu("force_dftu.dat"); - for(int iat=0; iat dm_VU_sover(ParaO.nloc, 0.0); - - for(int ik=0; ik stress_tmp(ParaO.nloc, 0.0); - - //Calculate mat_tmp=dm*VU - vector mat_tmp(ParaO.nloc, 0.0); - - pdgemm_(&transT, &transN, - &NLOCAL, &NLOCAL, &NLOCAL, - &alpha, - LOC.wfc_dm_2d.dm_gamma.at(spin).c, &one_int, &one_int, ParaO.desc, - VECTOR_TO_PTR(VU.at(spin)), &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc); - - pdgemm_(&transN, &transN, - &NLOCAL, &NLOCAL, &NLOCAL, - &alpha, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, - this->soverlap_gamma[count], &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); - - for(int irc=0; ircsoverlap_gamma[count], &one_int, &one_int, ParaO.desc, - VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, - &beta, - VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); - - for(int irc=0; ircj) this->stress_dftu.at(i).at(j) = stress_dftu.at(j).at(i); - } - } - - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->stress_dftu.at(i).at(j) *= ucell.lat0 / ucell.omega; - } - } - - /* - if(MY_RANK==0) - { - ofstream of_fdftu("force_dftu.dat"); - for(int iat=0; iatforce_dftu.at(iat).at(0) - << " force_y=" << fixed << setprecision(9) << setw(12) << this->force_dftu.at(iat).at(1) - << " force_z=" << fixed << setprecision(9) << setw(12) << this->force_dftu.at(iat).at(2) << endl; - } - - if(STRESS) - { - ofstream of_sdftu("stress_dftu.dat"); - for(int dim0=0; dim0<3; dim0++) - { - for(int dim1=0; dim1<3; dim1++) - { - of_sdftu << fixed << setprecision(9) << setw(12) << this->stress_dftu.at(dim0).at(dim1) << " "; - } - of_sdftu << endl; - } - } - } - */ - - return; -} - - -void DFTU::folding_dSm_soverlap() -{ - TITLE("DFTU", "folding_dSm_soverlap"); - - int nnr = 0; - - if(GAMMA_ONLY_LOCAL) - { - if(STRESS) - { - for(int i=0; i<6; i++) - { - ZEROS(soverlap_gamma[i], ParaO.nloc); - } - } - } - else - { - for(int ik=0; ik tau1, tau2, dtau; - Vector3 dtau1, dtau2, tau0; - for(int T1=0; T1na; ++I1) - { - tau1 = atom1->tau[I1]; - - GridD.Find_atom(tau1, T1, I1); - for(int ad=0; adnw*NPOL; ++jj) - { - const int jj0 = jj/NPOL; - const int L1 = atom1->iw2l[jj0]; - const int N1 = atom1->iw2n[jj0]; - const int m1 = atom1->iw2m[jj0]; - int iw2_all = ucell.itiaiw2iwt( T2, I2, 0); - - for(int kk=0; kknw*NPOL; ++kk) - { - const int kk0 = kk/NPOL; - const int L2 = atom2->iw2l[kk0]; - const int N2 = atom2->iw2n[kk0]; - const int m2 = atom2->iw2m[kk0]; - - if ( !ParaO.in_this_processor(iw1_all,iw2_all) ) - { - ++iw2_all; - continue; - } - - int mu = ParaO.trace_loc_row[iw1_all]; - int nu = ParaO.trace_loc_col[iw2_all]; - int irc = nu*ParaO.nrow + mu; - - if(GAMMA_ONLY_LOCAL) - { - if(STRESS) - { - this->soverlap_gamma[0][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+0]; - this->soverlap_gamma[1][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+1]; - this->soverlap_gamma[2][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+2]; - this->soverlap_gamma[3][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+1]; - this->soverlap_gamma[4][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+2]; - this->soverlap_gamma[5][irc] += LM.DSloc_Rz[nnr]*LM.DH_r[nnr*3+2]; - } - } - else - { - Vector3 dR(GridD.getBox(ad).x, GridD.getBox(ad).y, GridD.getBox(ad).z); - - for(int ik=0; ik kphase = complex ( cos(arg), sin(arg) ); - - this->dSm_k[ik][0][irc] += LM.DSloc_Rx[nnr]*kphase; - this->dSm_k[ik][1][irc] += LM.DSloc_Ry[nnr]*kphase; - this->dSm_k[ik][2][irc] += LM.DSloc_Rz[nnr]*kphase; - - if(STRESS) - { - this->soverlap_k[ik][0][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+0]*kphase; - this->soverlap_k[ik][1][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+1]*kphase; - this->soverlap_k[ik][2][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+2]*kphase; - this->soverlap_k[ik][3][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+1]*kphase; - this->soverlap_k[ik][4][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+2]*kphase; - this->soverlap_k[ik][5][irc] += LM.DSloc_Rz[nnr]*LM.DH_r[nnr*3+2]*kphase; - } - } - } - - ++nnr; - ++iw2_all; - }// nw2 - - ++iw1_all; - - }// nw1 - }// distance - else if(distance>=rcut) - { - int start1 = ucell.itiaiw2iwt( T1, I1, 0); - int start2 = ucell.itiaiw2iwt( T2, I2, 0); - bool is_adj = false; - for (int ad0=0; ad0nw * NPOL; ++jj) - { - const int mu = ParaO.trace_loc_row[start1+jj]; - if(mu<0)continue; - - for(int kk=0; kknw * NPOL; ++kk) - { - const int nu = ParaO.trace_loc_col[start2+kk]; - if(nu<0)continue; - - ++nnr; - }//kk - }//jj - } - }//distance - }// ad - }// I1 - }// T1 - - return; -} - - -void DFTU::allocate_force_stress() -{ - TITLE("DFTU","allocate_force_stress"); - - if(GAMMA_ONLY_LOCAL) - { - if(STRESS) - { - // this->soverlap_gamma.resize(6); //xx, xy, xz, yy, yz, zz - // for(int i=0; i<6; i++) - // { - // this->soverlap_gamma.at(i).resize(ParaO.nloc, 0.0); - // } - soverlap_gamma = new double* [6]; - for(int i=0; i<6; i++) - { - soverlap_gamma[i] = new double [ParaO.nloc]; - } - } - } - else - { - dSm_k = new complex** [kv.nks]; - //this->dSm_k.resize(kv.nks); - - for(int ik=0; ikdSm_k.at(ik).resize(3); - dSm_k[ik] = new complex* [3]; - for(int dim=0; dim<3; dim++) - { - //this->dSm_k.at(ik).at(dim).resize(ParaO.nloc, ZERO); - dSm_k[ik][dim] = new complex[ParaO.nloc]; - } - } - - if(STRESS) - { - //this->soverlap_k.resize(kv.nks); - soverlap_k = new complex** [kv.nks]; - - for(int ik=0; iksoverlap_k.at(ik).resize(6); //xx, xy, xz, yy, yz, zz - soverlap_k[ik] = new complex* [6]; - for(int i=0; i<6; i++) - { - //this->soverlap_k.at(ik).at(i).resize(ParaO.nloc, ZERO); - soverlap_k[ik][i] = new complex [ParaO.nloc]; - } - } - } - } - - return; -} - - -void DFTU::erase_force_stress() -{ - TITLE("DFTU","erase_force_stress"); - - if(GAMMA_ONLY_LOCAL) - { - if(STRESS) - { - //this->soverlap_gamma.resize(6); //xx, xy, xz, yy, yz, zz - for(int i=0; i<6; i++) - { - //this->soverlap_gamma.at(i).resize(1, 0.0); - delete [] soverlap_gamma[i]; - } - delete [] soverlap_gamma; - - } - } - else - { - //this->dSm_k.resize(kv.nks); - - for(int ik=0; ikdSm_k.at(ik).resize(3); - for(int dim=0; dim<3; dim++) - { - //this->dSm_k.at(ik).at(dim).resize(1, ZERO); - delete [] dSm_k[ik][dim]; - } - delete [] dSm_k[ik]; - } - delete [] dSm_k; - - if(STRESS) - { - //this->soverlap_k.resize(kv.nks); - - for(int ik=0; iksoverlap_k.at(ik).resize(6); //xx, xy, xz, yy, yz, zz - for(int i=0; i<6; i++) - { - //this->soverlap_k.at(ik).at(i).resize(1, ZERO); - delete [] soverlap_k[ik][i]; - } - delete [] soverlap_k[ik]; - } - delete [] soverlap_k; - } - } - - return; -} - - -void DFTU::cal_yukawa_lambda() -{ - TITLE("DFTU", "cal_yukawa_lambda"); - - double sum_rho = 0.0; - double sum_rho_lambda = 0.0; - for(int is=0; islambda = val2/val1; - - double lambda1 = this->lambda; - - - //rescaling - this->lambda /= 1.6; - - /* - double Nval = 0.0; - double ele_cor = 0.0; - for(int T=0; Tlocale.at(iat).at(L).at(n).at(is)(m,m); - } - } - } - } - } - */ - - double rho_remain = (Nval-Nc)/ucell.omega; - double lambda2 = 2*pow(3*rho_remain/PI, (double)1.0/6.0); - - /* - if(MY_RANK==0) - { - ofstream ofs_lambda("lambda.dat", ios_base::app); - - ofs_lambda << "All valence electrons. lambda=" << fixed << setw(8) << setprecision(4) << lambda1 << endl; - ofs_lambda << "Subtracting correltaed electrons from valence electrons. lambda=" << fixed << setw(8) << setprecision(4) << lambda2 << endl; - ofs_lambda << endl; - } - */ - - - return; -} - - -void DFTU::cal_slater_Fk(const int L, const int T) -{ - TITLE("DFTU","cal_slater_Fk"); - - if(Yukawa) - { - //this->lambda = INPUT.yukawa_lambda; - - for(int chi=0; chiFk.at(T).at(L).at(chi).at(k) -= (4*k+1)*lambda*pow(R_L0,2)*bslval*hnkval*pow(R_L1,2)*pow(r0,2)*pow(r1,2)*rab0*rab1; - } - } - // this->Fk.at(T).at(chi).at(k) /= pow(norm,2); - } - } - } - - return; -} - - -void DFTU::cal_slater_UJ(const int istep, const int iter) -{ - TITLE("DFTU", "cal_slater_UJ"); - if(!Yukawa) return; - - this->cal_yukawa_lambda(); - - for(int it=0; itFk.at(it).at(l).at(n)), l+1); - } - } - } - - for(int T=0; T=INPUT.orbital_corr[T] && INPUT.orbital_corr[T]!=-1) - { - if(L!=INPUT.orbital_corr[T]) continue; - - this->cal_slater_Fk(L, T); - - for(int n=0; nU_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(0); - this->J_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(1)/5.0; - } - else - { - // if(n!=0) continue; - - this->Fk.at(T).at(L).at(n).at(0) = this->U[T]; - this->Fk.at(T).at(L).at(n).at(1) = 5.0*this->J[T]; - } - break; - - case 2: //d electrons - if(Yukawa) - { - this->U_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(0); - this->J_Yukawa.at(T).at(L).at(n) = (this->Fk.at(T).at(L).at(n).at(1)+this->Fk.at(T).at(L).at(n).at(2))/14.0; - } - else - { - // if(n!=0) continue; - - this->Fk.at(T).at(L).at(n).at(0) = this->U[T]; - this->Fk.at(T).at(L).at(n).at(1) = 14.0*this->J[T]/(1.0+0.625); - this->Fk.at(T).at(L).at(n).at(2) = 0.625*this->Fk.at(T).at(L).at(n).at(1); - } - break; - - case 3: //f electrons - if(Yukawa) - { - this->U_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(0); - this->J_Yukawa.at(T).at(L).at(n) = (286.0*this->Fk.at(T).at(L).at(n).at(1) + - 195.0*this->Fk.at(T).at(L).at(n).at(2)+250.0*this->Fk.at(T).at(L).at(n).at(3))/6435.0; - } - else - { - // if(n!=0) continue; - - this->Fk.at(T).at(L).at(n).at(0) = this->U[T]; - this->Fk.at(T).at(L).at(n).at(1) = 6435.0*this->J[T]/(286.0+195.0*0.668+250.0*0.494); - this->Fk.at(T).at(L).at(n).at(2) = 0.668*this->Fk.at(T).at(L).at(n).at(1); - this->Fk.at(T).at(L).at(n).at(3) = 0.494*this->Fk.at(T).at(L).at(n).at(1); - } - break; - } - - //Hartree to Rydeberg - this->U_Yukawa.at(T).at(L).at(n) *= 2.0; - this->J_Yukawa.at(T).at(L).at(n) *= 2.0; - }//end n - - }//end if - - }//end L - }// end T - - /* - if(MY_RANK==0 && Yukawa) - { - ofstream of_UJ("Yukawa_UJ.dat", ios_base::app); - of_UJ << "ISTEP= " << istep << " ITER= " << iter << endl; - of_UJ << "Lambda= " << this->lambda << endl; - - for(int T=0; T=INPUT.orbital_corr[T] && INPUT.orbital_corr[T]!=-1) - { - if(L!=INPUT.orbital_corr[T]) continue; - for(int n=0; nU_Yukawa.at(T).at(L).at(n) - this->J_Yukawa.at(T).at(L).at(n))*Ry_to_eV; - of_UJ << "atom type=" << T << " L=" << L << " chi=" << n << endl; - of_UJ << "U[" << n << "]=" << this->U_Yukawa.at(T).at(L).at(n)*Ry_to_eV << " " << "J[" << n << "]=" << this->J_Yukawa.at(T).at(L).at(n)*Ry_to_eV - << " Ueff[" << n << "]=" << Ueff << endl; - of_UJ << endl; - } - } - } - } - } - */ - - return; -} - - -void DFTU::output() -{ - TITLE("DFTU", "output"); - - ofs_running << "//=========================L(S)DA+U===========================//" << endl; - - for(int T=0; T=INPUT.orbital_corr[T] && INPUT.orbital_corr[T]!=-1) - { - if(L!=INPUT.orbital_corr[T]) continue; - - if(!Yukawa) - { - ofs_running << "atom_type=" << T << " L=" << L << " chi=" << 0 << " U=" << this->U[T]*Ry_to_eV - << "ev J=" << this->J[T]*Ry_to_eV << "ev" << endl; - } - else - { - for(int n=0; nU_Yukawa.at(T).at(L).at(n) - this->J_Yukawa.at(T).at(L).at(n))*Ry_to_eV; - ofs_running << "atom_type=" << T << " L=" << L << " chi=" << n << " U=" << this->U_Yukawa.at(T).at(L).at(n)*Ry_to_eV << "ev " << "J=" << this->J_Yukawa.at(T).at(L).at(n)*Ry_to_eV - << "ev" << endl; - } - } - } - } - } - - ofs_running << "Local occupation matrices" << endl; - for(int T=0; TNc = tot_elec; - ofs_dftu << "Total number of electrons (" << L << "," << n << ") " << tot_elec << endl; - } - - ofs_dftu << endl; -// ofs_pot << endl; - - return; -} - - -void DFTU::cal_unscreened_slater_Fk(const int L, const int T) -{ - TITLE("DFTU","cal_slater_Fk"); - - for(int chi=0; chiFk.at(T).at(chi).at(k) += (numerator/denominator)*pow(R_L0,2)*pow(R_L1,2)*pow(r0,2)*pow(r1,2)*rab0*rab1; - } - } - } - - - } - - this->cal_slater_UJ(T, L); - - return; -} - -void DFTU::cal_slater_Vsc(const int T, const int L) -{ - TITLE("DFTU", "cal_slater_Vsc"); - - for(int N=0; NVsc.at(T).at(N)(M0, M1) += FOUR_PI*gaunt1*gaunt2*Fk.at(T).at(N).at(l)/(2.0*k+1.0); - } - } - } - } - } - } - } - return; -} -*/ diff --git a/ABACUS.develop/source/src_lcao/dftu.h b/ABACUS.develop/source/src_lcao/dftu.h index 2e9323f051..88a06a92e8 100644 --- a/ABACUS.develop/source/src_lcao/dftu.h +++ b/ABACUS.develop/source/src_lcao/dftu.h @@ -7,8 +7,11 @@ #include -#include "../src_global/complexmatrix.h" #include "../src_pw/charge_broyden.h" +#include "dftu_relax.h" + +#include "src_pw/unitcell_pseudo.h" +#include "src_parallel/parallel_orbitals.h" using namespace std; @@ -16,16 +19,19 @@ using namespace std; // CLASS : // NAME : DTFU (DFT+U) //========================================================== -class DFTU +class DFTU : public DFTU_RELAX { + public: + DFTU(); // constructor ~DFTU(); // deconstructor - //called at Run_Frag::frag_LCAO_line(void) - void init(); // initialize the input terms of U, J, double_counting etc + // initialize the input terms of U, J, double_counting etc + void init(UnitCell_pseudo &cell, // unitcell class + Parallel_Orbitals &po // parallel orbitals parameters + ); - //called at Local_Orbital_Elec::scf(const int &istep) //calculate the local occupation number matrix void cal_occup_m_k(const int iter); void cal_occup_m_gamma(const int iter); @@ -40,98 +46,27 @@ class DFTU //calculate the effective potential void cal_eff_pot_mat(const int ik, const int istep); - double get_onebody_eff_pot - ( - const int T, const int iat, - const int L, const int N, const int spin, - const int m0, - const int m1, - const int type, const bool newlocale - ); - - - //calculate force and stress - void cal_force_stress_gamma(); - void force_stress(); - void folding_dSm_soverlap(); - void allocate_force_stress(); - void erase_force_stress(); - void cal_force_k(vector>> &VU); - void cal_force_gamma(vector> &VU); - void cal_stress_k(vector>> &VU); - void cal_stress_gamma(vector> &VU); - - //LSCC - void cal_slater_Fk(const int L, const int T); //L:angular momnet, T:atom type - void cal_unscreened_slater_Fk(const int L, const int T); //L:angular momnet, T:atom type - void cal_yukawa_lambda(); - void cal_slater_UJ(const int istep, const int iter); - void cal_slater_Vsc(const int T, const int L); - // void print(const int T, const int iat, const int L, const int N, const int iter); + void print(const int T, const int iat, const int L, const int N, const int iter); void output(); + + void out_orbitals(); //Sm_k[ik][irc]: for k_points algorithm, calculated at LCAO_nnr::folding_fixedH(const int &ik) vector>> Sm_k; - // effective potential matrix for k algorithm: pot_eff_k[ik][irc] // effective potential matrix for gamma only algorithm: pot_eff_gamma[is][irc] vector>> pot_eff_k; vector> pot_eff_gamma; - - double EU; int iter_dftu; - - //force and stress - vector> force_dftu; //force_dftu[iat][dim] - vector> stress_dftu; - - -private: - - int cal_type; //1:dftu_tpye=1, dc=1; 2:dftu_type=1, dc=2; 3:dftu_tpye=2, dc=1; 4:dftu_tpye=2, dc=2; - int dc; //dc (type of double_counting) - bool Yukawa; //1:use Yukawa potential; 0: do not use Yukawa potential - double lambda; //the parameter in Yukawa potential - - double *U; //J (Hund parameter J) - double *J; //J (Hund parameter J) - double Nval; //Total nmuber of valence electrons of the system - double Nc; //Total nmuber of correlated electrons of the system - - vector> Vsc; //Vsc[T][N](i,j) - vector>>> Fk; //slater integral:Fk[T][L][N][k] - vector>> U_Yukawa; //U_Yukawa[T][L][N] - vector>> J_Yukawa; //J_Yukawa[T]{L][N] - - //transform between iwt index and it, ia, L, N and m index - vector>>>> iatlnmipol2iwt; //iatlnm2iwt[iat][l][n][m][ipol] - vector iwt2it; //iwt2it[iwt] - vector iwt2iat; //iwt2iat[iwt] - vector iwt2l; //iwt2l[iwt] - vector iwt2n; //iwt2n[iwt] - vector iwt2m; //iwt2m[iwt] - vector iwt2ipol; //iwt2ipol[iwt] - vector iat2it; - - //local occupancy matrix of the correlated subspace - //locale: the out put local occupation number matrix of correlated electrons in the current electronic step - //locale_save: the input local occupation number matrix of correlated electrons in the current electronic step - //locale_save2: the input local occupation number matrix of correlated electrons in the last electronic step - vector>>> locale; // locale[iat][l][n][spin](m1,m2) - vector>>> locale_save; // locale_save[iat][l][n][spin](m1,m2) - - complex ***dSm_k; //dSm_k[ik][dim][irc] - complex ***soverlap_k; //soverlap_k[ik][xy][irc] - double **soverlap_gamma; //soverlap_gamma[xy][irc] }; extern DFTU dftu; -#endif \ No newline at end of file +#endif diff --git a/ABACUS.develop/source/src_lcao/dftu_relax.cpp b/ABACUS.develop/source/src_lcao/dftu_relax.cpp new file mode 100644 index 0000000000..9051fd32a1 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/dftu_relax.cpp @@ -0,0 +1,1097 @@ +//========================================================== +// Author:Xin Qu +// DATE : 2019-12-10 +//========================================================== +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dftu_relax.h" +#include "../src_global/constants.h" +#include "../src_pw/global.h" +#include "global_fp.h" +#include "../src_global/global_function.h" +#include "../src_global/scalapack_connector.h" +#include "../src_global/lapack_connector.h" +#include "../src_global/inverse_matrix.h" +#include "LOOP_ions.h" +#include "LCAO_matrix.h" +#include "../src_pw/magnetism.h" +#include "ORB_gen_tables.h" +#include "../src_pw/charge.h" + + +DFTU_RELAX::DFTU_RELAX(){} + + +DFTU_RELAX::~DFTU_RELAX(){} + + +void DFTU_RELAX::force_stress() +{ + TITLE("DFTU_RELAX", "force_stress"); + + if(FORCE) + { + for(int iat=0; iatforce_dftu.at(iat).at(dim) = 0.0; + } + } + } + + if(STRESS) + { + for(int dim=0; dim<3; dim++) + { + this->stress_dftu.at(dim).at(0) = 0.0; + this->stress_dftu.at(dim).at(1) = 0.0; + this->stress_dftu.at(dim).at(2) = 0.0; + } + } + + this->allocate_force_stress(); + + //======================================================= + // intialize single particel effective potential matrix + //======================================================= + vector>> VU_k; + vector> VU_gamma; + if(FORCE || STRESS) + { + this->folding_dSm_soverlap(); + + if(GAMMA_ONLY_LOCAL) + { + VU_gamma.resize(NSPIN); + for(int is=0; is(0.0,0.0)); + } + else if(NSPIN==2 || NSPIN==4) + { + VU_k.resize(2); + for(int is=0; is<2; is++) + { + VU_k.at(is).resize(ParaO.nloc, complex(0.0,0.0)); + } + } + } + + for(int ir=0; iriwt2it.at(iwt1); + const int iat1 = this->iwt2iat.at(iwt1); + const int L1 = this->iwt2l.at(iwt1); + const int n1 = this->iwt2n.at(iwt1); + const int m1 = this->iwt2m.at(iwt1); + const int ipol1 = this->iwt2ipol.at(iwt1); + + for(int ic=0; iciwt2it.at(iwt2); + const int iat2 = this->iwt2iat.at(iwt2); + const int L2 = this->iwt2l.at(iwt2); + const int n2 = this->iwt2n.at(iwt2); + const int m2 = this->iwt2m.at(iwt2); + const int ipol2 = this->iwt2ipol.at(iwt2); + + int irc = ic*ParaO.nrow + ir; + + if(INPUT.orbital_corr[T1]==-1 || INPUT.orbital_corr[T2]==-1) continue; + + if(iat1!=iat2) continue; + + // if(Yukawa) + // { + // if(L1(val, 0.0); + } + else if(NSPIN==2) + { + for(int is=0; is(val, 0.0); + } + } + else if(NSPIN==4)//SOC + { + if(ipol1==ipol2) + { + int is = ipol1; + double val = get_onebody_eff_pot(T1, iat1, L1, n1, is, m1, m2, cal_type, false); + VU_k.at(is).at(irc) = complex(val, 0.0); + } + } + } + + }//end ic + }//end ir + } + + //======================================================= + // calculate force + //======================================================= + if(FORCE) + { + if(GAMMA_ONLY_LOCAL) cal_force_gamma(VU_gamma); + else cal_force_k(VU_k); + } + + if(STRESS) + { + if(GAMMA_ONLY_LOCAL) cal_stress_gamma(VU_gamma); + else cal_stress_k(VU_k); + } + + return; +} + + +void DFTU_RELAX::cal_force_k(vector>> &VU) +{ + TITLE("DFTU_RELAX", "cal_force_k"); + + const char transN = 'N', transT = 'T'; + const int one_int = 1; + const double alpha = 1.0, beta = 0.0; + + vector>> ftmp(ucell.nat); + for(int ia=0; ia(0.0,0.0)); //three dimension + } + + vector>> dm_VU_dSm(3); + for(int dim=0; dim<3; dim++) + { + dm_VU_dSm.at(dim).resize(ParaO.nloc, complex(0.0, 0.0)); + } + + for(int ik=0; ik> mat_tmp(ParaO.nloc, complex(0.0, 0.0)); + vector> force_tmp(ParaO.nloc, complex(0.0, 0.0)); + + if(dim==0) //dim=1,2 are same as dim=0 + { + ZEROS(VECTOR_TO_PTR(mat_tmp), ParaO.nloc); + + pzgemm_(&transT, &transN, + &NLOCAL, &NLOCAL, &NLOCAL, + &alpha, + LOC.wfc_dm_2d.dm_k.at(ik).c, &one_int, &one_int, ParaO.desc, + VECTOR_TO_PTR(VU.at(spin)), &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc); + } + + pzgemm_(&transN, &transN, + &NLOCAL, &NLOCAL, &NLOCAL, + &alpha, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, + this->dSm_k[ik][dim], &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(force_tmp), &one_int, &one_int, ParaO.desc); + + for(int irc=0; ircdSm_k[ik][dim], &one_int, &one_int, ParaO.desc, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(force_tmp), &one_int, &one_int, ParaO.desc); + + for(int irc=0; irciwt2iat.at(iwt1); + + for(int ic=0; iciwt2iat.at(iwt2); + + const int irc = ic*ParaO.nrow + ir; + + if(iat1==iat2 && iwt1==iwt2) + { + ftmp.at(iat1).at(dim) += dm_VU_dSm.at(dim).at(irc); + } + }//end ic + }//end ir + + for(int iat=0; iat val = ftmp.at(iat).at(dim); + MPI_Allreduce(&val, &ftmp.at(iat).at(dim), 1, MPI_DOUBLE_COMPLEX, MPI_SUM, MPI_COMM_WORLD); + + this->force_dftu.at(iat).at(dim) = ftmp.at(iat).at(dim).real(); + } + } + + + return; +} + + +void DFTU_RELAX::cal_stress_k(vector>> &VU) +{ + TITLE("DFTU_RELAX", "cal_stress_k"); + + const char transN = 'N', transT = 'T'; + const int one_int = 1; + const double alpha = 1.0, beta = 0.0; + + int count = 0; + for(int dim1=0; dim1<3; dim1++) + { + for(int dim2=dim1; dim2<3; dim2++) + { + vector> dm_VU_sover(ParaO.nloc, complex(0.0, 0.0)); + + for(int ik=0; ik> stress_tmp(ParaO.nloc, complex(0.0, 0.0)); + + //Calculate mat_tmp=dm*VU + vector> mat_tmp(ParaO.nloc, complex(0.0, 0.0)); + + pzgemm_(&transT, &transN, + &NLOCAL, &NLOCAL, &NLOCAL, + &alpha, + LOC.wfc_dm_2d.dm_k.at(ik).c, &one_int, &one_int, ParaO.desc, + VECTOR_TO_PTR(VU.at(spin)), &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc); + + pzgemm_(&transN, &transN, + &NLOCAL, &NLOCAL, &NLOCAL, + &alpha, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, + this->soverlap_k[ik][count], &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); + + for(int irc=0; ircsoverlap_k[ik][count], &one_int, &one_int, ParaO.desc, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); + + for(int irc=0; irc stmp(0.0, 0.0); + for(int ir=0; ir tmp; + MPI_Allreduce(&stmp, &tmp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + + count++; + }//end dim2 + + }//end dim1 + + for(int i=0; i<3; i++) + { + for(int j=0; j<3; j++) + { + if(i>j) this->stress_dftu.at(i).at(j) = stress_dftu.at(j).at(i); + } + } + + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + { + this->stress_dftu.at(i).at(j) *= ucell.lat0 / ucell.omega; + } + } + + return; +} + + +void DFTU_RELAX::cal_force_gamma(vector> &VU) +{ + TITLE("DFTU_RELAX", "cal_force_gamma"); + + const char transN = 'N', transT = 'T'; + const int one_int = 1; + const double alpha = 1.0, beta = 0.0; + + vector> dm_VU_dSm; + dm_VU_dSm.resize(3); + for(int dim=0; dim<3; dim++) + { + dm_VU_dSm.at(dim).resize(ParaO.nloc, 0.0); + } + + vector force_tmp(ParaO.nloc, 0.0); + //Calculate mat_tmp=dm*VU + vector mat_tmp(ParaO.nloc, 0.0); + + for(int ik=0; ik> ftmp; + ftmp.resize(ucell.nat); + for(int iat=0; iatiwt2iat.at(iwt1); + + for(int ic=0; iciwt2iat.at(iwt2); + + const int irc = ic*ParaO.nrow + ir; + + if(iat1==iat2 && iwt1==iwt2) + { + ftmp.at(iat1).at(dim) += dm_VU_dSm.at(dim).at(irc); + } + }//end ic + }//end ir + }//end dim + + + for(int iat=0; iatforce_dftu.at(iat).at(dim) = tmp; + } + + } + + return; +} + + +void DFTU_RELAX::cal_stress_gamma(vector> &VU) +{ + TITLE("DFTU_RELAX", "cal_stress_gamma"); + + const char transN = 'N', transT = 'T'; + const int one_int = 1; + const double alpha = 1.0, beta = 0.0; + + int count = 0; + for(int dim1=0; dim1<3; dim1++) + { + for(int dim2=dim1; dim2<3; dim2++) + { + vector dm_VU_sover(ParaO.nloc, 0.0); + + for(int ik=0; ik stress_tmp(ParaO.nloc, 0.0); + + //Calculate mat_tmp=dm*VU + vector mat_tmp(ParaO.nloc, 0.0); + + pdgemm_(&transT, &transN, + &NLOCAL, &NLOCAL, &NLOCAL, + &alpha, + LOC.wfc_dm_2d.dm_gamma.at(spin).c, &one_int, &one_int, ParaO.desc, + VECTOR_TO_PTR(VU.at(spin)), &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc); + + pdgemm_(&transN, &transN, + &NLOCAL, &NLOCAL, &NLOCAL, + &alpha, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, + this->soverlap_gamma[count], &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); + + for(int irc=0; ircsoverlap_gamma[count], &one_int, &one_int, ParaO.desc, + VECTOR_TO_PTR(mat_tmp), &one_int, &one_int, ParaO.desc, + &beta, + VECTOR_TO_PTR(stress_tmp), &one_int, &one_int, ParaO.desc); + + for(int irc=0; ircj) this->stress_dftu.at(i).at(j) = stress_dftu.at(j).at(i); + } + } + + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + { + this->stress_dftu.at(i).at(j) *= ucell.lat0 / ucell.omega; + } + } + + return; +} + + +void DFTU_RELAX::folding_dSm_soverlap() +{ + TITLE("DFTU_RELAX", "folding_dSm_soverlap"); + + int nnr = 0; + + if(GAMMA_ONLY_LOCAL) + { + if(STRESS) + { + for(int i=0; i<6; i++) + { + ZEROS(soverlap_gamma[i], ParaO.nloc); + } + } + } + else + { + for(int ik=0; ik tau1, tau2, dtau; + Vector3 dtau1, dtau2, tau0; + for(int T1=0; T1na; ++I1) + { + tau1 = atom1->tau[I1]; + + GridD.Find_atom(tau1, T1, I1); + for(int ad=0; adnw*NPOL; ++jj) + { + const int jj0 = jj/NPOL; + const int L1 = atom1->iw2l[jj0]; + const int N1 = atom1->iw2n[jj0]; + const int m1 = atom1->iw2m[jj0]; + int iw2_all = ucell.itiaiw2iwt( T2, I2, 0); + + for(int kk=0; kknw*NPOL; ++kk) + { + const int kk0 = kk/NPOL; + const int L2 = atom2->iw2l[kk0]; + const int N2 = atom2->iw2n[kk0]; + const int m2 = atom2->iw2m[kk0]; + + if ( !ParaO.in_this_processor(iw1_all,iw2_all) ) + { + ++iw2_all; + continue; + } + + int mu = ParaO.trace_loc_row[iw1_all]; + int nu = ParaO.trace_loc_col[iw2_all]; + int irc = nu*ParaO.nrow + mu; + + if(GAMMA_ONLY_LOCAL) + { + if(STRESS) + { + this->soverlap_gamma[0][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+0]; + this->soverlap_gamma[1][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+1]; + this->soverlap_gamma[2][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+2]; + this->soverlap_gamma[3][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+1]; + this->soverlap_gamma[4][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+2]; + this->soverlap_gamma[5][irc] += LM.DSloc_Rz[nnr]*LM.DH_r[nnr*3+2]; + } + } + else + { + Vector3 dR(GridD.getBox(ad).x, GridD.getBox(ad).y, GridD.getBox(ad).z); + + for(int ik=0; ik kphase = complex ( cos(arg), sin(arg) ); + + this->dSm_k[ik][0][irc] += LM.DSloc_Rx[nnr]*kphase; + this->dSm_k[ik][1][irc] += LM.DSloc_Ry[nnr]*kphase; + this->dSm_k[ik][2][irc] += LM.DSloc_Rz[nnr]*kphase; + + if(STRESS) + { + this->soverlap_k[ik][0][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+0]*kphase; + this->soverlap_k[ik][1][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+1]*kphase; + this->soverlap_k[ik][2][irc] += LM.DSloc_Rx[nnr]*LM.DH_r[nnr*3+2]*kphase; + this->soverlap_k[ik][3][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+1]*kphase; + this->soverlap_k[ik][4][irc] += LM.DSloc_Ry[nnr]*LM.DH_r[nnr*3+2]*kphase; + this->soverlap_k[ik][5][irc] += LM.DSloc_Rz[nnr]*LM.DH_r[nnr*3+2]*kphase; + } + } + } + + ++nnr; + ++iw2_all; + }// nw2 + + ++iw1_all; + + }// nw1 + }// distance + else if(distance>=rcut) + { + int start1 = ucell.itiaiw2iwt( T1, I1, 0); + int start2 = ucell.itiaiw2iwt( T2, I2, 0); + bool is_adj = false; + for (int ad0=0; ad0nw * NPOL; ++jj) + { + const int mu = ParaO.trace_loc_row[start1+jj]; + if(mu<0)continue; + + for(int kk=0; kknw * NPOL; ++kk) + { + const int nu = ParaO.trace_loc_col[start2+kk]; + if(nu<0)continue; + + ++nnr; + }//kk + }//jj + } + }//distance + }// ad + }// I1 + }// T1 + + return; +} + + +void DFTU_RELAX::allocate_force_stress() +{ + TITLE("DFTU_RELAX","allocate_force_stress"); + + if(GAMMA_ONLY_LOCAL) + { + if(STRESS) + { + // this->soverlap_gamma.resize(6); //xx, xy, xz, yy, yz, zz + // for(int i=0; i<6; i++) + // { + // this->soverlap_gamma.at(i).resize(ParaO.nloc, 0.0); + // } + soverlap_gamma = new double* [6]; + for(int i=0; i<6; i++) + { + soverlap_gamma[i] = new double [ParaO.nloc]; + } + } + } + else + { + dSm_k = new complex** [kv.nks]; + //this->dSm_k.resize(kv.nks); + + for(int ik=0; ikdSm_k.at(ik).resize(3); + dSm_k[ik] = new complex* [3]; + for(int dim=0; dim<3; dim++) + { + //this->dSm_k.at(ik).at(dim).resize(ParaO.nloc, ZERO); + dSm_k[ik][dim] = new complex[ParaO.nloc]; + } + } + + if(STRESS) + { + //this->soverlap_k.resize(kv.nks); + soverlap_k = new complex** [kv.nks]; + + for(int ik=0; iksoverlap_k.at(ik).resize(6); //xx, xy, xz, yy, yz, zz + soverlap_k[ik] = new complex* [6]; + for(int i=0; i<6; i++) + { + //this->soverlap_k.at(ik).at(i).resize(ParaO.nloc, ZERO); + soverlap_k[ik][i] = new complex [ParaO.nloc]; + } + } + } + } + + return; +} + + +void DFTU_RELAX::erase_force_stress() +{ + TITLE("DFTU_RELAX","erase_force_stress"); + + if(GAMMA_ONLY_LOCAL) + { + if(STRESS) + { + //this->soverlap_gamma.resize(6); //xx, xy, xz, yy, yz, zz + for(int i=0; i<6; i++) + { + //this->soverlap_gamma.at(i).resize(1, 0.0); + delete [] soverlap_gamma[i]; + } + delete [] soverlap_gamma; + + } + } + else + { + //this->dSm_k.resize(kv.nks); + + for(int ik=0; ikdSm_k.at(ik).resize(3); + for(int dim=0; dim<3; dim++) + { + //this->dSm_k.at(ik).at(dim).resize(1, ZERO); + delete [] dSm_k[ik][dim]; + } + delete [] dSm_k[ik]; + } + delete [] dSm_k; + + if(STRESS) + { + //this->soverlap_k.resize(kv.nks); + + for(int ik=0; iksoverlap_k.at(ik).resize(6); //xx, xy, xz, yy, yz, zz + for(int i=0; i<6; i++) + { + //this->soverlap_k.at(ik).at(i).resize(1, ZERO); + delete [] soverlap_k[ik][i]; + } + delete [] soverlap_k[ik]; + } + delete [] soverlap_k; + } + } + + return; +} + + +double DFTU_RELAX::get_onebody_eff_pot +( + const int T, const int iat, + const int L, const int N, const int spin, + const int m0, const int m1, + const int type, const bool newlocale +) +{ + TITLE("DFTU_RELAX","get_onebody_eff_pot"); + + double VU = 0.0; + + //if(!Yukawa && N!=0) return 0.0; + + switch(type) + { + case 1: //rotationally invarient formalism and FLL double counting + /* + const int spin_oppsite = 1 - spin; + int nelec_tot = 0; + int nelec_spin = 0; + + for(int is=0; is<2; is++) + { + for(int i=0; i<2*L+1; i++) + { + if(newlocale) + { + nelec_tot += locale.at(iat).at(L).at(N).at(is)(i,i); + if(is==spin) nelec_spin += locale.at(iat).at(L).at(N).at(is)(i,i); + } + else + { + nelec_tot += locale_save.at(iat).at(L).at(N).at(is)(i,i); + if(is==spin) nelec_spin += locale_save.at(iat).at(L).at(N).at(is)(i,i); + } + + } + } + + for(int m2=0; m2<2*L+1; m2++) + { + for(int m3=0; m3<2*L+1; m3++) + { + int M0_prime = m2*(2*L+1) + m3; + + int M1 = m0*(2*L+1) + m3; + int M1_prime = m2*(2*L+1) + m1; + + if(newlocale) + { + VU += Vsc.at(T).at(N)(M0,M0_prime)*locale.at(iat).at(L).at(N).at(spin_oppsite)(m2,m3) + + (Vsc.at(T).at(N)(M0,M0_prime)- Vsc.at(T).at(N)(M1,M1_prime))*locale.at(iat).at(L).at(N).at(spin)(m2,m3); + } + else + { + VU += Vsc.at(T).at(N)(M0, M0_prime)*locale_save.at(iat).at(L).at(N).at(spin_oppsite)(m2,m3) + + (Vsc.at(T).at(N)(M0, M0_prime)- Vsc.at(T).at(N)(M1,M1_prime))*locale_save.at(iat).at(L).at(N).at(spin)(m2,m3); + } + } + } + + //if(Yukawa) VU += -U_Yukawa.at(T).at(N)*(nelec_tot-0.5) + J_Yukawa.at(T).at(N)*(nelec_spin-0.5); + //else VU += -U[T]*(nelec_tot-0.5) + J[T]*(nelec_spin-0.5); + VU += -U[T]*(nelec_tot-0.5) + J[T]*(nelec_spin-0.5); + */ + + break; + + case 2: //rotationally invarient formalism and AMF double counting + + break; + + case 3: //simplified formalism and FLL double counting + if(newlocale) + { + if(Yukawa) + { + if(m0==m1) VU = (this->U_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*( 0.5 - this->locale.at(iat).at(L).at(N).at(spin)(m0,m1) ); + else VU = -(this->U_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*this->locale.at(iat).at(L).at(N).at(spin)(m0,m1); + } + else + { + if(m0==m1) VU = (this->U[T]-this->J[T])*( 0.5 - this->locale.at(iat).at(L).at(N).at(spin)(m0,m1) ); + else VU = -(this->U[T]-this->J[T])*this->locale.at(iat).at(L).at(N).at(spin)(m0,m1); + } + } + else + { + if(Yukawa) + { + if(m0==m1) VU = (this->U_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*( 0.5 - this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1) ); + else VU = -(this->U_Yukawa.at(T).at(L).at(N)-this->J_Yukawa.at(T).at(L).at(N))*this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1); + } + else + { + if(m0==m1) VU = (this->U[T]-this->J[T])*( 0.5 - this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1) ); + else VU = -(this->U[T]-this->J[T])*this->locale_save.at(iat).at(L).at(N).at(spin)(m0,m1); + } + } + + break; + + case 4: //simplified formalism and AMF double counting + + break; + } + + return VU; +} diff --git a/ABACUS.develop/source/src_lcao/dftu_relax.h b/ABACUS.develop/source/src_lcao/dftu_relax.h new file mode 100644 index 0000000000..9908c7478d --- /dev/null +++ b/ABACUS.develop/source/src_lcao/dftu_relax.h @@ -0,0 +1,73 @@ +//========================================================== +// Author: Xin Qu +// DATE : 2019-12-10 +//========================================================== +#ifndef DFTU_RELAX_H +#define DFTU_RELAX_H + +#include +#include "dftu_yukawa.h" +#include "../src_global/complexmatrix.h" + +using namespace std; + +//========================================================== +// CLASS : +// NAME : DFTU_RELAX +//========================================================== +class DFTU_RELAX : public DFTU_Yukawa +{ + +public: + + DFTU_RELAX(); + ~DFTU_RELAX(); + + void force_stress(); + void folding_dSm_soverlap(); + void allocate_force_stress(); + void erase_force_stress(); + void cal_force_k(vector>> &VU); + void cal_force_gamma(vector> &VU); + void cal_stress_k(vector>> &VU); + void cal_stress_gamma(vector> &VU); + + double get_onebody_eff_pot + ( + const int T, const int iat, + const int L, const int N, const int spin, + const int m0, + const int m1, + const int type, const bool newlocale + ); + + //forces and stress + vector> force_dftu; //force_dftu[iat][dim] + vector> stress_dftu; + + //vector>>> dSm_k; //dSm_k[ik][dim][irc] + complex ***dSm_k; //dSm_k[ik][dim][irc] + //vector>>> soverlap_k; //soverlap_k[ik][xy][irc] + complex ***soverlap_k; //soverlap_k[ik][xy][irc] + //vector> soverlap_gamma; //soverlap_gamma[xy][irc] + double **soverlap_gamma; //soverlap_gamma[xy][irc] + + //transform between iwt index and it, ia, L, N and m index + vector>>>> iatlnmipol2iwt; //iatlnm2iwt[iat][l][n][m][ipol] + vector iwt2it; //iwt2it[iwt] + vector iwt2iat; //iwt2iat[iwt] + vector iwt2l; //iwt2l[iwt] + vector iwt2n; //iwt2n[iwt] + vector iwt2m; //iwt2m[iwt] + vector iwt2ipol; //iwt2ipol[iwt] + vector iat2it; + + //local occupancy matrix of the correlated subspace + //locale: the out put local occupation number matrix of correlated electrons in the current electronic step + //locale_save: the input local occupation number matrix of correlated electrons in the current electronic step + vector>>> locale; // locale[iat][l][n][spin](m1,m2) + vector>>> locale_save; // locale_save[iat][l][n][spin](m1,m2) + +}; + +#endif diff --git a/ABACUS.develop/source/src_lcao/dftu_yukawa.cpp b/ABACUS.develop/source/src_lcao/dftu_yukawa.cpp new file mode 100644 index 0000000000..f789958888 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/dftu_yukawa.cpp @@ -0,0 +1,317 @@ +//========================================================== +// Author:Xin Qu +// DATE : 2019-12-10 +//========================================================== +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dftu_yukawa.h" +#include "../src_global/constants.h" +#include "../src_pw/global.h" +#include "global_fp.h" +#include "../src_global/global_function.h" +#include "LOOP_ions.h" +#include "LCAO_matrix.h" + + +extern "C" +{ + void sphbsl_(int *n, double *r, double *A, double *val); + void sphhnk_(int *n, double *r, double *A, double *val); +} + +DFTU_Yukawa::DFTU_Yukawa(){} + +DFTU_Yukawa::~DFTU_Yukawa(){} + + +void DFTU_Yukawa::cal_yukawa_lambda() +{ + TITLE("DFTU_Yukawa", "cal_yukawa_lambda"); + + double sum_rho = 0.0; + double sum_rho_lambda = 0.0; + for(int is=0; islambda = val2/val1; + + //rescaling + this->lambda /= 1.6; + + return; +} + + +void DFTU_Yukawa::cal_slater_Fk(const int L, const int T) +{ + TITLE("DFTU_Yukawa","cal_slater_Fk"); + + if(Yukawa) + { + //this->lambda = INPUT.yukawa_lambda; + + for(int chi=0; chiFk.at(T).at(L).at(chi).at(k) -= (4*k+1)*lambda*pow(R_L0,2)*bslval*hnkval*pow(R_L1,2)*pow(r0,2)*pow(r1,2)*rab0*rab1; + } + } + // this->Fk.at(T).at(chi).at(k) /= pow(norm,2); + } + } + } + + return; +} + + +void DFTU_Yukawa::cal_slater_UJ(const int istep, const int iter) +{ + TITLE("DFTU_Yukawa", "cal_slater_UJ"); + if(!Yukawa) return; + + this->cal_yukawa_lambda(); + + for(int it=0; itFk.at(it).at(l).at(n)), l+1); + } + } + } + + for(int T=0; T=INPUT.orbital_corr[T] && INPUT.orbital_corr[T]!=-1) + { + if(L!=INPUT.orbital_corr[T]) continue; + + this->cal_slater_Fk(L, T); + + for(int n=0; nU_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(0); + this->J_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(1)/5.0; + } + else + { + // if(n!=0) continue; + + this->Fk.at(T).at(L).at(n).at(0) = this->U[T]; + this->Fk.at(T).at(L).at(n).at(1) = 5.0*this->J[T]; + } + break; + + case 2: //d electrons + if(Yukawa) + { + this->U_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(0); + this->J_Yukawa.at(T).at(L).at(n) = (this->Fk.at(T).at(L).at(n).at(1)+this->Fk.at(T).at(L).at(n).at(2))/14.0; + } + else + { + // if(n!=0) continue; + + this->Fk.at(T).at(L).at(n).at(0) = this->U[T]; + this->Fk.at(T).at(L).at(n).at(1) = 14.0*this->J[T]/(1.0+0.625); + this->Fk.at(T).at(L).at(n).at(2) = 0.625*this->Fk.at(T).at(L).at(n).at(1); + } + break; + + case 3: //f electrons + if(Yukawa) + { + this->U_Yukawa.at(T).at(L).at(n) = this->Fk.at(T).at(L).at(n).at(0); + this->J_Yukawa.at(T).at(L).at(n) = (286.0*this->Fk.at(T).at(L).at(n).at(1) + + 195.0*this->Fk.at(T).at(L).at(n).at(2)+250.0*this->Fk.at(T).at(L).at(n).at(3))/6435.0; + } + else + { + // if(n!=0) continue; + + this->Fk.at(T).at(L).at(n).at(0) = this->U[T]; + this->Fk.at(T).at(L).at(n).at(1) = 6435.0*this->J[T]/(286.0+195.0*0.668+250.0*0.494); + this->Fk.at(T).at(L).at(n).at(2) = 0.668*this->Fk.at(T).at(L).at(n).at(1); + this->Fk.at(T).at(L).at(n).at(3) = 0.494*this->Fk.at(T).at(L).at(n).at(1); + } + break; + } + + //Hartree to Rydeberg + this->U_Yukawa.at(T).at(L).at(n) *= 2.0; + this->J_Yukawa.at(T).at(L).at(n) *= 2.0; + }//end n + + }//end if + + }//end L + }// end T + + return; +} + +/* +void DFTU::cal_unscreened_slater_Fk(const int L, const int T) +{ + TITLE("DFTU","cal_slater_Fk"); + + for(int chi=0; chiFk.at(T).at(chi).at(k) += (numerator/denominator)*pow(R_L0,2)*pow(R_L1,2)*pow(r0,2)*pow(r1,2)*rab0*rab1; + } + } + } + + + } + + this->cal_slater_UJ(T, L); + + return; +} + +void DFTU::cal_slater_Vsc(const int T, const int L) +{ + TITLE("DFTU", "cal_slater_Vsc"); + + for(int N=0; NVsc.at(T).at(N)(M0, M1) += FOUR_PI*gaunt1*gaunt2*Fk.at(T).at(N).at(l)/(2.0*k+1.0); + } + } + } + } + } + } + } + + return; +} +*/ diff --git a/ABACUS.develop/source/src_lcao/dftu_yukawa.h b/ABACUS.develop/source/src_lcao/dftu_yukawa.h new file mode 100644 index 0000000000..8ed5791cd2 --- /dev/null +++ b/ABACUS.develop/source/src_lcao/dftu_yukawa.h @@ -0,0 +1,46 @@ +//========================================================== +// Author: Xin Qu +// DATE : 2019-12-10 +//========================================================== +#ifndef DFTU_Yukawa_H +#define DFTU_Yukawa_H + +#include + +using namespace std; + +//========================================================== +// CLASS : +// NAME : DFTU_Yukawa +//========================================================== +class DFTU_Yukawa +{ +public: + DFTU_Yukawa(); // constructor + ~DFTU_Yukawa(); // deconstructor + + void cal_slater_Fk(const int L, const int T); //L:angular momnet, T:atom type + void cal_yukawa_lambda(); + void cal_slater_UJ(const int istep, const int iter); + + //void cal_unscreened_slater_Fk(const int L, const int T); //L:angular momnet, T:atom type + //void cal_slater_Vsc(const int T, const int L); + + bool Yukawa; //1:use Yukawa potential; 0: do not use Yukawa potential + double lambda; //the parameter in Yukawa potential + int cal_type; //1:dftu_tpye=1, dc=1; 2:dftu_type=1, dc=2; 3:dftu_tpye=2, dc=1; 4:dftu_tpye=2, dc=2; + int dc; //dc (type of double_counting) + double *U; //J (Hund parameter J) + double *J; //J (Hund parameter J) + + //vector> Vsc; //Vsc[T][N](i,j) + vector>>> Fk; //slater integral:Fk[T][L][N][k] + vector>> U_Yukawa; //U_Yukawa[T][L][N] + vector>> J_Yukawa; //J_Yukawa[T]{L][N] + + double Nval; //Total nmuber of valence electrons of the system + double Nc; //Total nmuber of correlated electrons of the system + +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_lcao/diago_lcao_matrix.cpp b/ABACUS.develop/source/src_lcao/diago_lcao_matrix.cpp deleted file mode 100644 index 917453d597..0000000000 --- a/ABACUS.develop/source/src_lcao/diago_lcao_matrix.cpp +++ /dev/null @@ -1,490 +0,0 @@ -#include "diago_lcao_matrix.h" -#include "../src_pw/algorithms.h" -#include "../src_pw/global.h" -#include "../src_external/src_pdiag/pdiag_double.h" -#include "../src_lcao/hs_matrix.h" -//xiaohui modified 2013-03-23 -//#include "../src_develop/src_siao/selinv.h" - -Diago_LCAO_Matrix::Diago_LCAO_Matrix(){} -Diago_LCAO_Matrix::~Diago_LCAO_Matrix(){} - -void Diago_LCAO_Matrix::solve_complex_matrix(const int &ik, complex** wfc, ComplexMatrix &wfc_2d)const -{ - TITLE("Diago_LCAO_Matrix","solve_complex_matrix"); - time_t time_start = time(NULL); -// ofs_running << " Start Time : " << ctime(&time_start); -// - - //if(DIAGO_TYPE=="lapack") xiaohui modify 2013-09-02 - if(KS_SOLVER=="lapack") //xiaohui add 2013-09-02 - { - this->using_LAPACK_complex(ik, wfc); - } - else - { -#ifdef __MPI - this->using_HPSEPS_complex(ik, wfc, wfc_2d); -#else - WARNING_QUIT("Diago_LCAO_Matrix::solve_complex_matrix","only lapack is available!"); -#endif - } - - time_t time_end = time(NULL); -// ofs_running << " End Time : " << ctime(&time_end); -// ofs_running << " FINAL Time : " << difftime(time_end, time_start) << " (SEC)" << endl; - - OUT_TIME("diago(complex)", time_start, time_end); - - return; -} - -void Diago_LCAO_Matrix::solve_double_matrix(const int &ik, double** wfc, matrix &wfc_2d)const -{ - TITLE("Diago_LCAO_Matrix","solve_double_matrix"); - timer::tick("Diago_LCAO_Matrix","solve_double_matrix",'F'); - time_t time_start = time(NULL); -// ofs_running << " Start Time : " << ctime(&time_start); - - // mohan test the combination of hpseps and cg. - - - //DIAGO_TYPE="hpseps"; - /* - static int count = 1; - if(count < 2) - { - cout << " first step is hpseps! " << endl; - DIAGO_TYPE="hpseps"; - } - else - { - DIAGO_TYPE="cg"; - } - ++count; - */ - - //if(DIAGO_TYPE=="lapack") xiaohui modify 2013-09-02 - if(KS_SOLVER=="lapack") //xiaohui add 2013-09-02 - { - this->using_LAPACK(ik, wfc); - } -/* -#ifdef __SELINV - //xiaohui modified 2013-03-23 - else if(DIAGO_TYPE=="selinv") //mohan add 2011-09 - { - Selinv SV; - // job=1: density matrix for charge density. - // job=2: density matrix for force. - // job=3: energy density matrix for force. - int job = 1; - SV.using_SELINV(ik, job, LM.Hloc, LM.Sloc); - } -#endif - else if(DIAGO_TYPE=="cg") - { - this->using_CG(ik, wfc); - } -*/ -#ifdef __MPI - //else if(DIAGO_TYPE=="hpseps") xiaohui modify 2013-09-02 - else if(KS_SOLVER=="hpseps" || KS_SOLVER=="genelpa"|| KS_SOLVER=="scalapack_gvx") //yshen add 7/15/2016 - { - this->using_HPSEPS_double(ik, wfc, wfc_2d); - } -#endif - else - { - //cout << " Diago_LCAO_Matrix, diago_type = " << DIAGO_TYPE << endl; xiaohui modify 2013-09-02 - cout << " Diago_LCAO_Matrix, diago_type = " << KS_SOLVER << endl; //xiaohui add 2013-09-02 - //WARNING_QUIT("Diago_LCAO_Matrix::init","Check DIAGO_TYPE."); xiaohui modify 2013-09-02 - WARNING_QUIT("Diago_LCAO_Matrix::init","Check KS_SOLVER."); //xiaohui add 2013-09-02 - } - time_t time_end = time(NULL); -// ofs_running << " End Time : " << ctime(&time_end); -// ofs_running << " FINAL Time : " << difftime(time_end, time_start) << " (SEC)" << endl; - - OUT_TIME("diago(double)",time_start, time_end); - - /* - ofs_running << "\n Output c:" << endl; - for(int i=0; i 1.0e-5 ) - { - ofs_running << setw(20) << c[i][j]; - } - else - { - ofs_running << setw(20) << "0"; - } - } - ofs_running << endl; - } - */ - - timer::tick("Diago_LCAO_Matrix","solve_double_matrix",'F'); - return; -} - -#ifdef __MPI -void Diago_LCAO_Matrix::using_HPSEPS_double(const int &ik, double**wfc, matrix &wfc_2d)const -{ - TITLE("Diago_LCAO_Matrix","using_HPSEPS_double"); - - // save H and S matrix to disk. - bool bit = false; - HS_Matrix::saving_HS(LM.Hloc, LM.Sloc, bit, ParaO.out_hs); - ofs_running << setprecision(6); - - // Distribution of matrix for - // prallel eigensolver. - ParaO.diago_double_begin(ik, wfc, wfc_2d, LM.Hloc, LM.Sloc, wf.ekb[ik]); - - /* - string fh = "/home/mohan/3_my_program/1_DAPE/data/data-H32"; - string fs = "/home/mohan/3_my_program/1_DAPE/data/data-S32"; - double* eigen = new double[32]; - double* eigvr = new double[32*32]; - PD.readin(fh, fs, 32, eigen, eigvr); - */ - - return; -} - - -void Diago_LCAO_Matrix::using_HPSEPS_complex(const int &ik, complex** wfc, ComplexMatrix &wfc_2d)const -{ - TITLE("Diago_LCAO_Matrix","using_HPSEPS_complex"); - - //ParaO.out_hs=1;//zhengdy-soc-test - bool bit = false; //LiuXh, 2017-03-21 - //if set bit = true, there would be error in soc-multi-core calculation, noted by zhengdy-soc - HS_Matrix::saving_HS_complex(LM.Hloc2, LM.Sloc2, bit, ParaO.out_hs); //LiuXh, 2017-03-21 - ofs_running << setprecision(6); //LiuXh, 2017-03-21 - - ParaO.diago_complex_begin(ik, wfc, wfc_2d, LM.Hloc2, LM.Sloc2, wf.ekb[ik]); - //added by zhengdy-soc, rearrange the WFC_K from [up,down,up,down...] to [up,up...down,down...], - if(NSPIN==4) - { - int row = GridT.lgd; - vector> tmp(row); - for(int ib=0; ib **wfc)const -{ - TITLE("Diago_LCAO_Matrix","using_LAPACK_complex"); - - assert(NPROC = 1); - - ComplexMatrix Htmp(NLOCAL,NLOCAL); - ComplexMatrix Stmp(NLOCAL,NLOCAL); - for(int i=0; i0); - - // save H and S matrix to disk. -// bool bit = false; - bool bit = true;//zhengdy-soc - HS_Matrix::saving_HS(LM.Hloc, LM.Sloc, bit, ParaO.out_hs); - - matrix Htmp(NLOCAL,NLOCAL); - matrix Stmp(NLOCAL,NLOCAL); - for(int i=0; iCij, 1.0e-5); - // ZEROS(en, NBANDS); - -// cout << " ParaA.nlocal=" << ParaA.nlocal << endl; -// cout << " ParaO.nrow=" << ParaO.nrow << endl; - - double *precon = new double[ParaA.nlocal]; - assert(ParaA.nlocal == ParaO.nrow); - CG_precon::select_precondition(DIAGO_CG_PREC, precon); - - - bool reorder = true; - //bool reorder = false; - if(ATOM_DISTRIBUTION) - { - // 'c' is the wave functions after parallized. - // because c is adapted to grid integration, - // and used to generate density matrix, - // however, ccg is here is divided by atoms and adapted - // to the CG algorithm. - double** ccg = new double*[NBANDS]; - for(int ib=0; ib=0) - { - buffer[iw] = c[ib][nu]; - } - } - Parallel_Reduce::reduce_double_all(buffer,NLOCAL); - - // collect the trace_lo; - ZEROS(countb, NLOCAL); - for(int iw=0; iw=0) - { - countb[iw]=1; - } - } - // collect countb - Parallel_Reduce::reduce_int_all(countb, NLOCAL); - // and then get the correct final wave functions - for(int iw=0; iw0); - buffer[iw] /= (double)countb[iw]; - } - - // transfer wave functions from 'c' to ccg - for(int iw=0; iw=0 ) - { - ccg[ib][mu] = buffer[iw]; - } - } - } - delete[] countb; - - CG_LCAO CGL; - CGL.diag( ccg, wf.ekb[ik], ParaA.nlocal, NBANDS, precon, ETHR, DIAGO_CG_MAXITER, reorder, notconv, cg_iter); - - for(int ib=0; ib= 0 ) - { - buffer[iw] = ccg[ib][mu]; - } - } - // reduce the wave functions. - Parallel_Reduce::reduce_double_all(buffer, NLOCAL); - - // put the wave functions back to LOWF.WFC_GAMMA - for(int iw=0; iw= 0) - { - c[ib][mu] = buffer[iw]; - } - - - const int mu2 = LOWF.trace_aug[iw]; - if(GAMMA_ONLY_LOCAL) - { - if(mu2 >= 0) - { - LOWF.WFC_GAMMA_aug[CURRENT_SPIN][ib][mu2] = buffer[iw]; - } - } - else - { - WARNING_QUIT("using_CG","how to update augmented wave functions."); - } - } - } - - delete[] buffer; - - for(int ib=0; ibCij, 1.0e-5); - // out.printr1_d("en",en,NBANDS); - - timer::tick("Diago_LCAO_Matrix","using_CG",'i'); - return; -} -*/ diff --git a/ABACUS.develop/source/src_lcao/force_lcao.cpp b/ABACUS.develop/source/src_lcao/force_lcao.cpp deleted file mode 100644 index ddd764553f..0000000000 --- a/ABACUS.develop/source/src_lcao/force_lcao.cpp +++ /dev/null @@ -1,937 +0,0 @@ -#include "force_lcao.h" -#include "../src_pw/global.h" -#include "dftu.h" //Quxin add for DFT+U on 20201029 - -double Force_LCAO::force_invalid_threshold_ev = 0.00; - -Force_LCAO::Force_LCAO () -{ - allocate_flag = false; - output_acc = 1.0e-8; -} - -Force_LCAO::~Force_LCAO () -{ - this->destroy(); -} - -void Force_LCAO::destroy (void) -{ - if (allocate_flag) - { - for (int iat = 0; iat < ucell.nat; iat++) - { - //------------------------------- - // use energy density matrix - //------------------------------- - delete [] foverlap[iat]; - //------------------------------- - // use density matrix - //------------------------------- - delete [] ftvnl_dphi[iat]; - delete [] fvnl_dbeta[iat]; - //------------------------------- - // use grid integration - //------------------------------- - delete [] fvl_dphi[iat]; - //------------------------------- - // use plane wave - //------------------------------- - delete [] fvl_dvl[iat]; - delete [] fewalds[iat]; - delete [] fcc[iat]; - delete [] fscc[iat]; - } - - delete [] foverlap; - delete [] ftvnl_dphi; - delete [] fvnl_dbeta; - delete [] fvl_dphi; - delete [] fvl_dvl; - delete [] fewalds; - delete [] fcc; - delete [] fscc; - - allocate_flag = false; - } -} - -void Force_LCAO::allocate(void) -{ - TITLE("Force_LCAO","init"); - - // reduce memory occupy by vlocal - delete[] ParaO.sender_local_index; - delete[] ParaO.sender_size_process; - delete[] ParaO.sender_displacement_process; - delete[] ParaO.receiver_global_index; - delete[] ParaO.receiver_size_process; - delete[] ParaO.receiver_displacement_process; - - ParaO.sender_local_index = new int[1]; - ParaO.sender_size_process = new int[1]; - ParaO.sender_displacement_process = new int[1]; - ParaO.receiver_global_index = new int[1]; - ParaO.receiver_size_process = new int[1]; - ParaO.receiver_displacement_process = new int[1]; - - if (allocate_flag) - { - this->destroy(); - } - - const int nat = ucell.nat; - - this->fcs.create (nat, 3); - - // part of total force - foverlap = new double*[nat]; - ftvnl_dphi = new double*[nat]; - fvnl_dbeta = new double*[nat]; - fvl_dphi = new double*[nat]; - fvl_dvl = new double*[nat]; - fewalds = new double*[nat]; - fcc = new double*[nat]; - fscc = new double*[nat]; - - for (int iat = 0; iat < nat; iat++) - { - foverlap[iat] = new double[3]; - ftvnl_dphi[iat] = new double[3]; - fvnl_dbeta[iat] = new double[3]; - fvl_dphi[iat] = new double[3]; - fvl_dvl[iat] = new double[3]; - fewalds[iat] = new double[3]; - fcc[iat] = new double[3]; - fscc[iat] = new double[3]; - - ZEROS (foverlap[iat], 3); - ZEROS (ftvnl_dphi[iat], 3); - ZEROS (fvnl_dbeta[iat], 3); - ZEROS (fvl_dphi[iat],3); - ZEROS (fvl_dvl[iat],3); - ZEROS (fewalds[iat], 3); - ZEROS (fcc[iat], 3); - ZEROS (fscc[iat],3); - } - - allocate_flag = true; - - Memory::record("Force_LCAO","Paremeters",nat*3*8,"double"); - return; -} - -#include "../src_pw/efield.h" -#include "../src_pw/forces.h" -// be called in : Local_Orbital_Ions::force_stress -void Force_LCAO::start_force(void) -{ - TITLE("Force_LCAO","start_force"); - timer::tick("Force_LCAO","start_force",'E'); - - - //-------------------------------------------------------- - // local pseudopotential force: - // use charge density; plane wave; local pseudopotential; - //-------------------------------------------------------- - this->cal_force_loc (); - - //-------------------------------------------------------- - // ewald force: use plane wave only. - //-------------------------------------------------------- - this->cal_force_ew (); //remain problem - - - //-------------------------------------------------------- - // force due to core correlation. - //-------------------------------------------------------- - this->cal_force_cc(); - - //-------------------------------------------------------- - // force due to self-consistent charge. - //-------------------------------------------------------- - this->cal_force_scc(); - - //-------------------------------------------------------- - // need to move atom positions here. - //-------------------------------------------------------- - if(GAMMA_ONLY_LOCAL) - { - this->ftable_gamma(); - } - else - { - this->ftable_k(); - } - - // clear the data. - this->fcs.zero_out(); - - stress_vdw.create(3,3);//zhengdy added in 2018-10-29 - if(vdwd2.vdwD2) //Peize Lin add 2014-04-04, update 2019-04-26 - { - vdwd2.force(stress_vdw, STRESS); - } - if(vdwd3.vdwD3) //jiyy add 2019-05-18 - { - vdwd3.force(stress_vdw, STRESS); - } - - - matrix fefield; - if(EFIELD) - { - fefield.create(ucell.nat, 3); - Efield::compute_force(fefield); - } - - for(int i=0; i<3; i++) - { - double sum = 0.0; - - for (int iat = 0; iat < ucell.nat; iat++) - { - fcs(iat, i) += foverlap[iat][i] - + ftvnl_dphi[iat][i] - + fvnl_dbeta[iat][i] - + fvl_dphi[iat][i] - + fvl_dvl[iat][i] // derivative of local potential force (pw) - + fewalds[iat][i] // ewald force (pw) - + fcc[iat][i] //nonlinear core correction force (pw) - + fscc[iat][i];//self consistent corretion force (pw) - - if(INPUT.dft_plus_u) fcs(iat, i) += dftu.force_dftu.at(iat).at(i); //Force contribution from DFT+U, Quxin add on 20201029 - - if(vdwd2.vdwD2) //Peize Lin add 2014-04-04, update 2019-04-26 - { - switch(i) - { - case 0: fcs(iat,i) += vdwd2.force_result[iat].x; break; - case 1: fcs(iat,i) += vdwd2.force_result[iat].y; break; - case 2: fcs(iat,i) += vdwd2.force_result[iat].z; break; - } - - } - if(vdwd3.vdwD3) //jiyy add 2019-05-18 - { - switch(i) - { - case 0: fcs(iat,i) += vdwd3.force_result[iat][0]; break; - case 1: fcs(iat,i) += vdwd3.force_result[iat][1]; break; - case 2: fcs(iat,i) += vdwd3.force_result[iat][2]; break; - } - - } - - if(EFIELD) - { - fcs(iat, i) = fcs(iat, i) + fefield(iat, i); - } - - sum += fcs(iat, i); - } - - for(int iat=0; iatprint_force("OVERLAP FORCE",foverlap,TEST_FORCE,ry); - // this->print_force("TVNL_DPHI force",ftvnl_dphi,TEST_FORCE); - // this->print_force("VNL_DBETA force",fvnl_dbeta,TEST_FORCE); - this->print_force("T_VNL FORCE",ftvnl,TEST_FORCE,ry); - - this->print_force("VL_dPHI FORCE",fvl_dphi,TEST_FORCE,ry); - this->print_force("VL_dVL FORCE",fvl_dvl,TEST_FORCE,ry); - // this->print_force("VLOCAL FORCE",fvlocal,TEST_FORCE); - - this->print_force("EWALD FORCE",fewalds,TEST_FORCE,ry); - this->print_force("NLCC FORCE",fcc,TEST_FORCE,ry); - this->print_force("SCC FORCE",fscc,TEST_FORCE,ry); - } - - // mohan fix bug 2012-03-22 - for(int iat=0; iatprintforce_total(ry); - - ofs_running << resetiosflags(ios::showpos); - - if(TEST_FORCE) - { - ofs_running << "\n FORCE INVALID TABLE." << endl; - ofs_running << " " << setw(8) << "atom" << setw(5) << "x" << setw(5) << "y" << setw(5) << "z" << endl; - for(int iat=0; iatoutput_acc) ofs_running << setw(15) << f[iat][0]*fac; - else ofs_running << setw(15) << "0"; - if( abs(f[iat][1]) >output_acc) ofs_running << setw(15) << f[iat][1]*fac; - else ofs_running << setw(15) << "0"; - if( abs(f[iat][2]) >output_acc) ofs_running << setw(15) << f[iat][2]*fac; - else ofs_running << setw(15) << "0"; - ofs_running << endl; - - if(screen) - { - cout << " " << setw(8) << ss.str(); - if( abs(f[iat][0]) >output_acc) cout << setw(15) << f[iat][0]*fac; - else cout << setw(15) << "0"; - if( abs(f[iat][1]) >output_acc) cout << setw(15) << f[iat][1]*fac; - else cout << setw(15) << "0"; - if( abs(f[iat][2]) >output_acc) cout << setw(15) << f[iat][2]*fac; - else cout << setw(15) << "0"; - cout << endl; - } - - iat++; - } - } - - - cout << resetiosflags(ios::showpos); - - return; -} - -void Force_LCAO::printforce_total (bool ry) -{ -// mohan update 2011-03-15 - double unit_transform = 1; - - if(!ry) - { - unit_transform = Ry_to_eV / 0.529177; - } -// cout.setf(ios::fixed); - - int iat=0; - - //ofs_running << setiosflags(ios::right); - ofs_running << setprecision(6) << setiosflags(ios::showpos) << setiosflags(ios::fixed) << endl; - NEW_PART("TOTAL-FORCE (eV/Angstrom)"); - - if(INPUT.force_set == 1) - { - ofstream ofs("FORCE.dat"); - if(!ofs) - { - cout << "open FORCE.dat error !" < *aux = new complex[pw.nrxx]; - ZEROS(aux, pw.nrxx); - - // now, in all pools , the charge are the same, - // so, the force calculated by each pool is equal. - - for (int is=0; is( chr.rho[is][ir], 0.0 ); - } - } - - pw.FFT_chg.FFT3D(aux, -1); - - int gstart_here = pw.gstart; - if (pw.ggs[0] != 0) gstart_here = 0; - - int iat = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - fvl_dvl[iat][0]=0.0; - fvl_dvl[iat][1]=0.0; - fvl_dvl[iat][2]=0.0; - - for (int ig = gstart_here; ig < pw.ngmc; ig++) - { - const double phase = TWO_PI * (pw.gcar[ig] * ucell.atoms[it].tau[ia]); - const double factor = ppcell.vloc(it, pw.ig2ngg[ig]) * - ( cos(phase) * aux[ pw.ig2fftc[ig] ].imag() - + sin(phase) * aux[ pw.ig2fftc[ig] ].real()); - - fvl_dvl[iat][0] += pw.gcar[ig].x * factor; - fvl_dvl[iat][1] += pw.gcar[ig].y * factor; - fvl_dvl[iat][2] += pw.gcar[ig].z * factor; - } - for (int ipol = 0; ipol < 3; ipol++) - { - this->fvl_dvl[iat][ipol] *= (ucell.tpiba * ucell.omega); - } - ++iat; - - } - } - - //this->print(ofs_running, "local forces", forcelc); - for (int iat = 0; iat < ucell.nat; iat++) - { - Parallel_Reduce::reduce_double_pool(this->fvl_dvl[iat], 3); - } - - delete[] aux; - - timer::tick("Force_LCAO","cal_force_loc"); - return; -} - - -void Force_LCAO::cal_force_ew(void) -{ - timer::tick("Force_lo","cal_force_ew",'E'); - - double fact = 2.0; - complex *aux = new complex [pw.ngmc]; - ZEROS(aux, pw.ngmc); - - int gstart = pw.gstart; - - if (pw.ggs[0] != 0) gstart = 0; - - for (int it = 0; it < ucell.ntype; it++) - { - for (int ig = gstart; ig < pw.ngmc; ig++) - { - aux[ig] += static_cast(ucell.atoms[it].zv) * conj(pw.strucFac(it, ig)); - } - } - - for (int ig = gstart; ig < pw.ngmc; ig++) - { - aux[ig] *= exp(-1.0 * pw.gg[ig] * ucell.tpiba2 / en.alpha / 4.0) / (pw.gg[ig] * ucell.tpiba2); - } - - int iat = 0; - for (int it = 0; it < ucell.ntype; it++) - { - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - ZEROS(fewalds[iat],3); - for (int ig = gstart; ig < pw.ngmc; ig++) - { - const double arg = TWO_PI * (pw.gcar[ig] * ucell.atoms[it].tau[ia]); - double sumnb = -cos(arg) * aux[ig].imag() + sin(arg) * aux[ig].real(); - fewalds[iat][0] += pw.gcar[ig].x * sumnb; - fewalds[iat][1] += pw.gcar[ig].y * sumnb; - fewalds[iat][2] += pw.gcar[ig].z * sumnb; - } - for (int ipol = 0; ipol < 3; ipol++) - { - fewalds[iat][ipol] *= ucell.atoms[it].zv * e2 * ucell.tpiba * TWO_PI / ucell.omega * fact; - } - iat++; - } - } - delete [] aux; - - for (int iat = 0; iat < ucell.nat; iat++) - { - Parallel_Reduce::reduce_double_pool(this->fewalds[iat], 3); - } - - // mohan fix bug 2010-07-15 - // means that the processor contains G=0 term. - if (gstart == 1) - { - double rmax = 5.0 / (sqrt(en.alpha) * ucell.lat0); - int nrm = 0; - - //output of rgen: the number of vectors in the sphere - const int mxr = 50; - // the maximum number of R vectors included in r - Vector3 *r = new Vector3[mxr]; - double *r2 = new double[mxr]; - int *irr = new int[mxr]; - ZEROS(r2, mxr); - ZEROS(irr, mxr); - // the square modulus of R_j-tau_s-tau_s' - - int iat1 = 0; - for (int it1 = 0; it1 < ucell.ntype; it1++) - { - for (int ia1 = 0; ia1 < ucell.atoms[it1].na; ia1++) - { - int iat2 = 0; // mohan fix serious bug 2011-06-07 - for (int it2 = 0; it2 < ucell.ntype; it2++) - { - for (int ia2 = 0; ia2 < ucell.atoms[it2].na; ia2++) - { - if (iat1 != iat2) - { - Vector3 d_tau = ucell.atoms[it1].tau[ia1] - ucell.atoms[it2].tau[ia2]; - en.rgen(d_tau, rmax, irr, ucell.latvec, ucell.G, r, r2, nrm); - // return r2[n], r(n, ipol) -// cout << "nrm = " << nrm << endl; - - for (int n = 0; n < nrm; n++) - { - assert (en.alpha >= 0.0); - - const double rr = sqrt(r2[n]) * ucell.lat0; - double factor = ucell.atoms[it1].zv * ucell.atoms[it2].zv * e2 / (rr * rr) - * (erfc(sqrt(en.alpha) * rr) / rr - + sqrt(8.0 * en.alpha / TWO_PI) * exp(-1.0 * en.alpha * rr * rr)) * ucell.lat0; - - //remian problem - //fix bug iat -> iat1 - fewalds[iat1][0] -= factor * r[n].x; - fewalds[iat1][1] -= factor * r[n].y; - fewalds[iat1][2] -= factor * r[n].z; - } - } - iat2++; - }//ia2 - }//atom b - iat1++; - }//ia1 - }//atom a - - delete[] r; - delete[] r2; - delete[] irr; - }//gstart - -#ifdef __MPI - // (1) only used force to do BFGS in processor 0. - // or (2) ewalds bcast from processor 0, which is - // happen to be gstart=1. - for (int iat = 0; iat < ucell.nat; iat++) - { - Parallel_Common::bcast_double(this->fewalds[iat], 3); - } -#endif - - // this->print(ofs_running, "ewald forces", forceion); - timer::tick("Force_lo","cal_force_ew"); - - return; -} - -void Force_LCAO::cal_force_cc(void) -{ - timer::tick("Force_LCAO","cal_force_cc",'E'); - // recalculate the exchange-correlation potential. - matrix vxc(NSPIN, pw.nrxx); - pot.v_xc(chr.rho, en.etxc, en.vtxc, vxc); - - complex * psiv = new complex [pw.nrxx]; - ZEROS(psiv, pw.nrxx); - if (NSPIN == 1 || NSPIN == 4) - { - for (int ir = 0;ir < pw.nrxx;ir++) - { - psiv[ir] = complex(vxc(0, ir), 0.0); - } - } - else - { - for (int ir = 0;ir < pw.nrxx;ir++) - { - psiv[ir] = 0.5 * (vxc(0 ,ir) + vxc(1, ir)); - } - } - - // to G space - pw.FFT_chg.FFT3D(psiv, -1); - - //psiv contains now Vxc(G) - double * rhocg = new double [pw.nggm]; - ZEROS(rhocg, pw.nggm); - - for (int T1 = 0;T1 < ucell.ntype;T1++) - { - if (ucell.atoms[T1].nlcc) - { - //call drhoc - chr.non_linear_core_correction( - ppcell.numeric, - ucell.atoms[T1].msh, - ucell.atoms[T1].r, - ucell.atoms[T1].rab, - ucell.atoms[T1].rho_atc, - rhocg); - int iat = 0; - - - complex ipol0, ipol1, ipol2; - for (int T2 = 0;T2 < ucell.ntype;T2++) - { - for (int I2 = 0;I2 < ucell.atoms[T2].na;I2++) - { - if (T2 == T1) - { - for (int ig = pw.gstart; ig < pw.ngmc; ig++) - { - const double arg = TWO_PI * (pw.gcar[ig].x * ucell.atoms[T2].tau[I2].x - + pw.gcar[ig].y * ucell.atoms[T2].tau[I2].y - + pw.gcar[ig].z * ucell.atoms[T2].tau[I2].z); - - ipol0 = ucell.tpiba * ucell.omega * rhocg[pw.ig2ngg[ig]] - * pw.gcar[ig].x * conj(psiv[pw.ig2fftc[ig]]) - * complex(sin(arg), cos(arg)) ; - this->fcc[iat][0] += ipol0.real(); - - ipol1 = ucell.tpiba * ucell.omega * rhocg[pw.ig2ngg[ig]] - * pw.gcar[ig].y * conj(psiv[pw.ig2fftc[ig]]) - * complex(sin(arg), cos(arg)) ; - this->fcc[iat][1] += ipol1.real(); - - ipol2 = ucell.tpiba * ucell.omega * rhocg[pw.ig2ngg[ig]] - * pw.gcar[ig].z * conj(psiv[pw.ig2fftc[ig]]) - * complex(sin(arg), cos(arg)) ; - - this->fcc[iat][2] += ipol2.real(); - } - ++iat; - } - } - } - } - } - delete [] rhocg; - delete [] psiv; // mohan fix bug 2012-03-22 - - // need to be improved here, otherwise the calling time is - // to many! - for(int iat=0; iatfcc[iat], 3); - } - timer::tick("Force_LCAO","cal_force_cc",'E'); - return; -} - - -void Force_LCAO::cal_force_scc(void) -{ - TITLE ("Force_LCAO", "cal_force_scc"); - timer::tick ("Force_LCAO", "cal_force_scc",'E'); - -// cout << " calculate scc force" << endl; - - complex* psic = new complex [pw.nrxx]; - ZEROS(psic, pw.nrxx); - - if (NSPIN == 1 || NSPIN == 4) - { - for (int i = 0; i < pw.nrxx; i++) - { - psic[i] = pot.vnew(0,i); - } - } - else - { - int isup = 0; - int isdw = 1; - for (int i = 0; i < pw.nrxx; i++) - { - psic[i] = (pot.vnew(isup, i) + pot.vnew(isdw, i)) * 0.5; - } - } - - int ndm = 0; - for (int it = 0; it < ucell.ntype; it++) - { - if (ndm < ucell.atoms[it].msh) - { - ndm = ucell.atoms[it].msh; - } - } - - //work space - double* aux = new double[ndm]; - ZEROS(aux, ndm); - - double* rhocgnt = new double[pw.nggm]; - ZEROS(rhocgnt, pw.nggm); - - pw.FFT_chg.FFT3D(psic, -1); - - double fact = 2.0; - for (int nt = 0; nt < ucell.ntype; nt++) - { -// Here we compute the G.ne.0 term - const int mesh = ucell.atoms[nt].msh; - for (int ig = pw.gstart; ig < pw.nggm; ig++) - { - const double gx = sqrt(pw.ggs[ig]) * ucell.tpiba; - for (int ir = 0; ir < mesh; ir++) - { - if (ucell.atoms[nt].r[ir] < 1.0e-8) - { - aux[ir] = ucell.atoms[nt].rho_at[ir]; - } - else - { - const double gxx = gx * ucell.atoms[nt].r[ir]; - aux[ir] = ucell.atoms[nt].rho_at[ir] * sin(gxx) / gxx; - } - } - Mathzone::Simpson_Integral(mesh , aux, ucell.atoms[nt].rab , rhocgnt [ig]); - } - - int iat = 0; - for (int it = 0; it < ucell.ntype; it++) - { - Atom* atom = &ucell.atoms[it]; - for (int ia = 0; ia < ucell.atoms[it].na; ia++) - { - if (nt == it) - { - for (int ig = pw.gstart; ig < pw.ngmc; ig++) - { - const double arg = TWO_PI * (pw.gcar[ig].x * atom->tau[ia].x - + pw.gcar[ig].y * atom->tau[ia].y - + pw.gcar[ig].z * atom->tau[ia].z); - - const complex cpm = complex(sin(arg), cos(arg)) * conj(psic[pw.ig2fftc[ig] ]); - - fscc[iat][0] += fact * rhocgnt [pw.ig2ngg[ig] ] * ucell.tpiba * pw.gcar[ig].x * cpm.real(); - fscc[iat][1] += fact * rhocgnt [pw.ig2ngg[ig] ] * ucell.tpiba * pw.gcar[ig].y * cpm.real(); - fscc[iat][2] += fact * rhocgnt [pw.ig2ngg[ig] ] * ucell.tpiba * pw.gcar[ig].z * cpm.real(); - } - } - // cout << " fscc=" << fscc[iat][0] << " " << fscc[iat][1] << " " << fscc[iat][2] << endl; - iat++; - } - } - } - - for (int iat = 0; iat < ucell.nat; iat++) - { - Parallel_Reduce::reduce_double_pool(this->fscc[iat], 3); - } - - delete[] psic; // mohan fix bug 2012-03-22 - delete[] aux; // mohan fix bug 2012-03-22 - delete[] rhocgnt; // mohan fix bug 2012-03-22 - timer::tick ("Force_LCAO", "cal_force_scc",'E'); - return; -} - - -void Force_LCAO::cal_stress(matrix &stress) -{ - Stress_LCAO SS; - SS.allocate(); - SS.start_stress(this->soverlap, this->stvnl_dphi, this->svnl_dbeta, this->svl_dphi, this->stress_vdw); - - double unit_transform = 0.0; - unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * eps8; - double external_stress[3] = {PRESS1,PRESS2,PRESS3}; - - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - stress(i,j) = SS.scs[i][j]; - - //quxin added for DFT+U; stress contribution from DFT+U - if(INPUT.dft_plus_u) if(i!=j) stress(i,j) += dftu.stress_dftu.at(i).at(j); - } - stress(i,i) = SS.scs[i][i] - external_stress[i]/unit_transform; - - if(INPUT.dft_plus_u) stress(i,i) += dftu.stress_dftu.at(i).at(i); - } - PRESSURE = (SS.scs[0][0]+SS.scs[1][1]+SS.scs[2][2])/3; - - if(INPUT.dft_plus_u) PRESSURE += (dftu.stress_dftu.at(0).at(0) + dftu.stress_dftu.at(1).at(1) + dftu.stress_dftu.at(2).at(2))/3.0; - - return; -} diff --git a/ABACUS.develop/source/src_lcao/force_lcao.h b/ABACUS.develop/source/src_lcao/force_lcao.h deleted file mode 100644 index eeb6fcbfda..0000000000 --- a/ABACUS.develop/source/src_lcao/force_lcao.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef FORCE_LCAO_H -#define FORCE_LCAO_H - -#include "../src_pw/tools.h" -#include "force_lcao_k.h" -#include "stress_lcao.h" - -class Force_LCAO : private Force_LCAO_k -{ - public : - - Force_LCAO (); - ~Force_LCAO (); - - void allocate (void); - void destroy (void); - - void cal_force_loc (void); - void cal_force_ew (void); - void cal_force_scc (void); - void cal_force_cc (void); - - void print_force(const string &name, double** f, const bool screen, bool ry)const; - void printforce_total (bool ry); - - void start_force(void); - - void cal_stress(matrix &stress); - - // total force - matrix fcs; - static double force_invalid_threshold_ev; // mohan add 2011-04-17 - - matrix stress_vdw;//zhengdy added for vdw-stress-part - - private: - - //each part of force - double** fvl_dvl; - double** fewalds; - double** fcc; - double** fscc; - - bool allocate_flag; - double output_acc; // control the accuracy -}; -#endif diff --git a/ABACUS.develop/source/src_lcao/force_lcao_gamma.cpp b/ABACUS.develop/source/src_lcao/force_lcao_gamma.cpp deleted file mode 100644 index 9ef589d1dd..0000000000 --- a/ABACUS.develop/source/src_lcao/force_lcao_gamma.cpp +++ /dev/null @@ -1,1853 +0,0 @@ -#include "force_lcao_gamma.h" -#include "../src_pw/global.h" -#include "dftu.h" //Quxin add for DFT+U on 20201029 - -Force_LCAO_gamma::Force_LCAO_gamma () -{ -} - -Force_LCAO_gamma::~Force_LCAO_gamma () -{ -} - -// be called in force_lo.cpp -void Force_LCAO_gamma::ftable_gamma (void) -{ - TITLE("Force_LCAO_gamma", "ftable"); - timer::tick("Force_LCAO_gamma","ftable_gamma",'F'); - - // allocate DSloc_x, DSloc_y, DSloc_z - // allocate DHloc_fixed_x, DHloc_fixed_y, DHloc_fixed_z - this->allocate_gamma(); - - // calculate the 'energy density matrix' here. - this->cal_foverlap(); - - if(NEW_DM>0) - { - this->cal_ftvnl_dphi(LOC.wfc_dm_2d.dm_gamma); - this->cal_fvnl_dbeta(LOC.wfc_dm_2d.dm_gamma); - this->cal_fvl_dphi(LOC.wfc_dm_2d.dm_gamma); - - //quxin added for DFT+U - if(INPUT.dft_plus_u) - { - dftu.force_stress(); - dftu.erase_force_stress(); - } - } - else - { - timer::tick("Force_LCAO_gamma","cal_dm_grid",'G'); - // calculate the 'density matrix' here. - double** dm2d = new double*[NSPIN]; - for(int is=0; isset_EDM_gamma(dm2d[is], with_energy, is); - } - timer::tick("Force_LCAO_gamma","cal_dm_grid",'G'); - - this->cal_ftvnl_dphi(dm2d); - this->cal_fvnl_dbeta(dm2d); - - //quxin added for DFT+U - if(INPUT.dft_plus_u) - { - dftu.force_stress(); - dftu.erase_force_stress(); - } - - // calculate < dphi | V | phi > on real space grid. - this->cal_fvl_dphi(dm2d); - - for(int is=0; isfoverlap[iat], 3); - Parallel_Reduce::reduce_double_pool( this->ftvnl_dphi[iat], 3); - Parallel_Reduce::reduce_double_pool( this->fvnl_dbeta[iat], 3); - Parallel_Reduce::reduce_double_pool( this->fvl_dphi[iat], 3); - } - if(STRESS)for (int ipol=0; ipol<3; ipol++) - { - Parallel_Reduce::reduce_double_pool( this->soverlap[ipol], 3); - Parallel_Reduce::reduce_double_pool( this->stvnl_dphi[ipol], 3); - Parallel_Reduce::reduce_double_pool( this->svnl_dbeta[ipol], 3); - Parallel_Reduce::reduce_double_pool( this->svl_dphi[ipol], 3); - } - - // delete DSloc_x, DSloc_y, DSloc_z - // delete DHloc_fixed_x, DHloc_fixed_y, DHloc_fixed_z - this->finish_ftable_gamma(); - - timer::tick("Force_LCAO_gamma","ftable_gamma",'F'); - return; -} - -void Force_LCAO_gamma::allocate_gamma(void) -{ - TITLE("Force_LCAO_gamma","allocate_gamma"); - timer::tick("Force_LCAO_gamma","allocate_gamma",'G'); - - // need to calculate the derivative in build_ST_new - bool cal_deri = true; - - //calculate dS in LCAO - //liaochen add on 2010/7/12 - //save the results in dense matrix by now. - //ParaO.nloc: number of H elements in this proc. - LM.DSloc_x = new double [ParaO.nloc]; - LM.DSloc_y = new double [ParaO.nloc]; - LM.DSloc_z = new double [ParaO.nloc]; - ZEROS(LM.DSloc_x, ParaO.nloc); - ZEROS(LM.DSloc_y, ParaO.nloc); - ZEROS(LM.DSloc_z, ParaO.nloc); - //allocate stress part in gamma_only-line, added by zhengdy-stress - if(STRESS) - { - LM.DSloc_11 = new double [ParaO.nloc]; - LM.DSloc_12 = new double [ParaO.nloc]; - LM.DSloc_13 = new double [ParaO.nloc]; - LM.DSloc_22 = new double [ParaO.nloc]; - LM.DSloc_23 = new double [ParaO.nloc]; - LM.DSloc_33 = new double [ParaO.nloc]; - ZEROS(LM.DSloc_11, ParaO.nloc); - ZEROS(LM.DSloc_12, ParaO.nloc); - ZEROS(LM.DSloc_13, ParaO.nloc); - ZEROS(LM.DSloc_22, ParaO.nloc); - ZEROS(LM.DSloc_23, ParaO.nloc); - ZEROS(LM.DSloc_33, ParaO.nloc); - LM.DHloc_fixed_11 = new double [ParaO.nloc]; - LM.DHloc_fixed_12 = new double [ParaO.nloc]; - LM.DHloc_fixed_13 = new double [ParaO.nloc]; - LM.DHloc_fixed_22 = new double [ParaO.nloc]; - LM.DHloc_fixed_23 = new double [ParaO.nloc]; - LM.DHloc_fixed_33 = new double [ParaO.nloc]; - ZEROS (LM.DHloc_fixed_11, ParaO.nloc); - ZEROS (LM.DHloc_fixed_12, ParaO.nloc); - ZEROS (LM.DHloc_fixed_13, ParaO.nloc); - ZEROS (LM.DHloc_fixed_22, ParaO.nloc); - ZEROS (LM.DHloc_fixed_23, ParaO.nloc); - ZEROS (LM.DHloc_fixed_33, ParaO.nloc); - } - //calculate dS in LCAO basis - // tips: build_ST_new --> ParaO.set_force - //timer::tick("Force_LCAO_gamma","build_S_new",'H'); - UHM.UOM.build_ST_new ('S', cal_deri); - //timer::tick("Force_LCAO_gamma","build_S_new",'H'); - - Memory::record("force_lo", "dS", ParaO.nloc*3, "double"); - - //calculate dT in LCAP - //allocation dt - //liaochen add on 2010/7/12 - LM.DHloc_fixed_x = new double [ParaO.nloc]; - LM.DHloc_fixed_y = new double [ParaO.nloc]; - LM.DHloc_fixed_z = new double [ParaO.nloc]; - ZEROS (LM.DHloc_fixed_x, ParaO.nloc); - ZEROS (LM.DHloc_fixed_y, ParaO.nloc); - ZEROS (LM.DHloc_fixed_z, ParaO.nloc); - - //calculate dT - //calculate T + VNL(P1) in LCAO basis - //timer::tick("Force_LCAO_gamma","build_T_new",'H'); - UHM.UOM.build_ST_new ('T', cal_deri); - //timer::tick("Force_LCAO_gamma","build_T_new",'H'); - //test_gamma(LM.DHloc_fixed_x, "dHloc_fixed_x T part"); - - //UHM.UOM.build_Nonlocal_beta (cal_deri); - //timer::tick("Force_LCAO_gamma","build_Nonlocal_mu",'H'); - UHM.UOM.build_Nonlocal_mu (cal_deri); - //timer::tick("Force_LCAO_gamma","build_Nonlocal_mu",'H'); - //test_gamma(LM.DHloc_fixed_x, "dHloc_fixed_x Vnl part"); - - Memory::record("force_lo", "dTVNL", ParaO.nloc*3, "double"); - - timer::tick("Force_LCAO_gamma","allocate_gamma",'G'); - return; -} - -void Force_LCAO_gamma::finish_ftable_gamma(void) -{ - delete [] LM.DSloc_x; - delete [] LM.DSloc_y; - delete [] LM.DSloc_z; - delete [] LM.DHloc_fixed_x; - delete [] LM.DHloc_fixed_y; - delete [] LM.DHloc_fixed_z; - if(STRESS)//added by zhengdy-stress - { - delete [] LM.DSloc_11; - delete [] LM.DSloc_12; - delete [] LM.DSloc_13; - delete [] LM.DHloc_fixed_11; - delete [] LM.DHloc_fixed_12; - delete [] LM.DHloc_fixed_13; - delete [] LM.DSloc_22; - delete [] LM.DSloc_23; - delete [] LM.DSloc_33; - delete [] LM.DHloc_fixed_22; - delete [] LM.DHloc_fixed_23; - delete [] LM.DHloc_fixed_33; - } - return; -} - -double Force_LCAO_gamma::set_EDM_element( - const int &ii, const int &jj, - const bool with_energy, - double*** coef1, double*** coef2, const int &is) -{ - double ene = 0.0; - for (int ib = 0; ib < NBANDS; ib++) - { - const double w1 = wf.wg(is,ib); - if(w1>0.0) - { - if(with_energy) - { - ene += w1 * wf.ekb[is][ib] * coef1[is][ib][ii] * coef2[is][ib][jj]; - } - else - { - ene += w1 * coef1[is][ib][ii] * coef2[is][ib][jj]; - } - } - } - return ene; -} - -//#include "../src_develop/src_siao/selinv.h" -void Force_LCAO_gamma::set_EDM_gamma(double* dm, bool with_energy, const int &ispin)//ispin is the spin index. -{ - TITLE("Force_LCAO_gamma","set_EDM_gamma"); - timer::tick("Force_LCAO_gamma","set_EDM"); - -#ifdef __SELINV -//xiaohui modified 2013-03-23, adding "/*" -/* if(DIAGO_TYPE=="selinv") - { -// cout << " set_EDM_gamma()" << endl; -// cout << " fill dm with density matrix or energy density matrix here." << endl; - - //-------------------------------------------------- - // job=1: density matrix for charge density (grid). - // job=2: density matrix for force (dm2d). - // job=3: energy density matrix for force (dm2d). - //-------------------------------------------------- - const int ik = 0; - int job = 0; - if(with_energy) - { - job=3; - } - else - { - job=2; - } - Selinv::dm_ptr = dm; - Selinv::using_SELINV(ik, job, LM.Hloc, LM.Sloc); - - return; - } -*/ -#endif - //xiaohui add 2015-03-24, like density matrix calculation -#ifdef __MPI //2015-09-06, xiaohui - int nprocs,myid; - MPI_Status status; - MPI_Comm_size(DIAG_HPSEPS_WORLD,&nprocs); - MPI_Comm_rank(DIAG_HPSEPS_WORLD,&myid); - - int local_band=NBANDS/DSIZE; - if (DRANK= NBANDS) - { - lastband_in_proc = i; - lastband_number = NBANDS - (count_bands - local_bands[i]); - break; - } - } - - double** w1; - w1 = new double*[NSPIN]; - for(int is=0; is= 1) - { - double** ZW_300; - ZW_300 = new double*[NSPIN]; - for(int is=0; is= 0 && col_nu >= 0) - { - int index = row_mu * ParaO.ncol + col_nu; - //dm[index] = rho_300[ispin][i_col + i_row*300]; - dm[index] = rho_300[ispin][i_row + i_col*300]; - } - } - } - } - for(int is=0; is= 0 && col_nu >= 0) - { - int index = row_mu * ParaO.ncol + col_nu; - //dm[index] = rho_300_remain[ispin][i_col + i_row*col_remain]; - dm[index] = rho_300_remain[ispin][i_row + i_col*300]; - } - } - } - } - for(int is=0; is= 0 && col_nu >= 0) - { - int index = row_mu * ParaO.ncol + col_nu; - dm[index] = rho_remain_300[ispin][i_row + i_col*row_remain]; - } - } - } - } - for(int is=0; is= 0 && col_nu >= 0) - { - int index = row_mu * ParaO.ncol + col_nu; - dm[index] = rho_remain_remain[ispin][i_row + i_col*row_remain]; - } - } - } - } - for(int is=0; is= 0 && col_nu >= 0) - { - int index = row_mu * ParaO.ncol + col_nu; - dm[index] = rho_NLOCAL_NLOCAL[ispin][i_col + i_row*NLOCAL]; - } - } - } - } - for(int is=0; is=0 && jj>=0) - { - ene = this->set_EDM_element(ii, jj, with_energy, LOWF.WFC_GAMMA, LOWF.WFC_GAMMA, ispin); - } - - // (2) - else if(ii>=0 && jj<0) - { - const int a4 = LOWF.trace_aug[j]; - assert(a4>=0); - ene = this->set_EDM_element(ii, a4, with_energy, LOWF.WFC_GAMMA, LOWF.WFC_GAMMA_aug, ispin); - } - else if(ii<0 && jj>=0) - { - const int a3 = LOWF.trace_aug[i]; - assert(a3>=0); - // mohan fix serious bug 2011-07-01 (ii, a3) -> (a3, jj) !!!!!!!!!!!! - ene = this->set_EDM_element(a3, jj, with_energy, LOWF.WFC_GAMMA_aug, LOWF.WFC_GAMMA, ispin); - } - else if(ii<0 && jj<0) - { - const int a3 = LOWF.trace_aug[i]; - const int a4 = LOWF.trace_aug[j]; - assert(a3>=0); - assert(a4>=0); - ene = this->set_EDM_element(a3, a4, with_energy, LOWF.WFC_GAMMA_aug, LOWF.WFC_GAMMA_aug, ispin); - } - - dm[index] = ene; - //dm[index] = 1.0;// mohan tmp - }// end j - }// end i -#endif //2015-09-06, xiaohui - timer::tick("Force_LCAO_gamma","set_EDM"); - return; -} - - -void Force_LCAO_gamma::DerivT_PW(void) -{ - WARNING_QUIT("Force_LCAO_gamma::DerivT_PW","no use for a long time."); - /* - //------------------------------------------ - //TEST OUTPUT OF S Deriv Matrix in PW - //------------------------------------------ - //test under pw basis - hm.hon.UOM.ForcedT = new matrix[3]; - this->dt = hm.hon.UOM.ForcedT; - for (int i = 0; i < 3; i++) this->dt[i].create (NLOCAL, NLOCAL); - - hm.hon.UOM.build_ST (1, 'T', true); - - cout << "\n===========================================================================" << endl; - out.printrm("Force_LCAO_gamma, X Directional Derivatives of T Matrix in PW", this->dt[0]); - cout << "\n===========================================================================" << endl; - - for (int i = 0; i < 3; i++) this->dt[i].freemem (); - delete[] this->dt; - */ - return; -} - -// force due to the overlap matrix. -// need energy density matrix here. -void Force_LCAO_gamma::cal_foverlap(void) -{ - TITLE("Force_LCAO_gamma","cal_foverlap"); - timer::tick("Force_LCAO_gamma","cal_foverlap",'G'); - - // set the force arrays. - for(int iat=0; iatsoverlap[ipol], 3); - } - - // set energy density matrix. - if(NEW_DM>0) - { - timer::tick("Force_LCAO_gamma","cal_edm_2d",'H'); - - matrix wgEkb; - wgEkb.create(NSPIN, NBANDS); - - for(int is=0; is=0 && nu>=0) - { - const int index = mu * ParaO.ncol + nu; - double sum = 0.0; - for(int is=0; isfoverlap[iat][0] += sum * LM.DSloc_x[index]; - this->foverlap[iat][1] += sum * LM.DSloc_y[index]; - this->foverlap[iat][2] += sum * LM.DSloc_z[index]; - - if(STRESS) - { - this->soverlap[0][0] += sum/2.0 * LM.DSloc_11[index]; - this->soverlap[0][1] += sum/2.0 * LM.DSloc_12[index]; - this->soverlap[0][2] += sum/2.0 * LM.DSloc_13[index]; - this->soverlap[1][1] += sum/2.0 * LM.DSloc_22[index]; - this->soverlap[1][2] += sum/2.0 * LM.DSloc_23[index]; - this->soverlap[2][2] += sum/2.0 * LM.DSloc_33[index]; - } - } - - } - } - } - else - { - timer::tick("Force_LCAO_gamma","cal_edm_grid",'H'); - double** edm2d = new double*[NSPIN]; - for(int is=0; isset_EDM_gamma(edm2d[is], with_energy,is); - //stringstream ss; - //ss<<"EDM_"<= 0 && nu >= 0 ) - { - const int index = mu * ParaO.ncol + nu; - - //================================================================ - // here is the normal order, the force of each atom is calculated - // according to each 'column' in DSloc_x, y, z - // because the DSloc_x,y,z are anti-symmetry matrix. - //================================================================ - - double sum = 0.0; - for(int is=0; isfoverlap[iat][0] += sum * LM.DSloc_x[index]; - this->foverlap[iat][1] += sum * LM.DSloc_y[index]; - this->foverlap[iat][2] += sum * LM.DSloc_z[index]; - if(STRESS) - { - this->soverlap[0][0] += sum/2.0 * LM.DSloc_11[index]; - this->soverlap[0][1] += sum/2.0 * LM.DSloc_12[index]; - this->soverlap[0][2] += sum/2.0 * LM.DSloc_13[index]; - this->soverlap[1][1] += sum/2.0 * LM.DSloc_22[index]; - this->soverlap[1][2] += sum/2.0 * LM.DSloc_23[index]; - this->soverlap[2][2] += sum/2.0 * LM.DSloc_33[index]; - } - } - } - } - - for(int is=0; issoverlap[j][i] = this->soverlap[i][j]; - } - } - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->soverlap[i][j] *= ucell.lat0 / ucell.omega; - } - } - } - timer::tick("Force_LCAO_gamma","cal_foverlap",'G'); - return; -} - -void Force_LCAO_gamma::cal_ftvnl_dphi(double** dm2d) -{ - TITLE("Force_LCAO_gamma","cal_ftvnl_dphi"); - timer::tick("Force_LCAO_gamma","cal_ftvnl_dphi",'G'); - if(STRESS)for(int ipol=0; ipol<3; ++ipol) - { - ZEROS( this->stvnl_dphi[ipol], 3); - } - for(int i=0; i= 0 && nu >= 0 ) - { - const int index = mu * ParaO.ncol + nu; - //contribution from deriv of AO's in T+VNL term - - double sum = 0.0; - for(int is=0; isftvnl_dphi[iat][0] += sum * LM.DHloc_fixed_x[index]; - this->ftvnl_dphi[iat][1] += sum * LM.DHloc_fixed_y[index]; - this->ftvnl_dphi[iat][2] += sum * LM.DHloc_fixed_z[index]; - if(STRESS) - { - this->stvnl_dphi[0][0] += sum/2.0 * LM.DHloc_fixed_11[index]; - this->stvnl_dphi[0][1] += sum/2.0 * LM.DHloc_fixed_12[index]; - this->stvnl_dphi[0][2] += sum/2.0 * LM.DHloc_fixed_13[index]; - this->stvnl_dphi[1][1] += sum/2.0 * LM.DHloc_fixed_22[index]; - this->stvnl_dphi[1][2] += sum/2.0 * LM.DHloc_fixed_23[index]; - this->stvnl_dphi[2][2] += sum/2.0 * LM.DHloc_fixed_33[index]; - } - } - } - } - if(STRESS){ - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - if(istvnl_dphi[j][i] = this->stvnl_dphi[i][j]; - } - } - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->stvnl_dphi[i][j] *= ucell.lat0 / ucell.omega; - } - } - } - timer::tick("Force_LCAO_gamma","cal_ftvnl_dphi",'G'); - return; -} - -void Force_LCAO_gamma::test_gamma(double* mm, const string &name) -{ - cout << "\n PRINT " << name << endl; - cout << setprecision(6) << endl; - for(int i=0; i1.0e-5) - { - cout << setw(12) << mm[i*NLOCAL+j]; - } - else - { - cout << setw(12) << "0"; - } - } - cout << endl; - } - return; -} - -void Force_LCAO_gamma::cal_fvna(LCAO_Matrix &LM) -{ - TITLE("Force_LCAO_gamma","cal_fvna"); - timer::tick("Force_LCAO_gamma","cal_fvna",'H'); - int istep=1; - bool delta_vh = 0; - bool vna = 1; // tmp by mohan - - int dense = VNA; - OUT(ofs_running,"dense grid for VNA force",dense); - Grid_Technique gtf; - gtf.set_pbc_grid( - pw.ncx*dense,pw.ncy*dense,pw.ncz*dense, - pw.bx*dense,pw.by*dense,pw.bz*dense, - pw.nbx,pw.nby,pw.nbz, - pw.nbxx,pw.nbzp_start,pw.nbzp, - vna); - -//-------------------------------------------------------- -// The neutral potential can be only used when vna = 1, -// then to be used to check if the real space neutral -// potential is correct -//-------------------------------------------------------- -// pot.init_pot(istep, delta_vh, vna); -// for(int ir=0; irsvl_dphi[ipol], 3); - } - } - - //xiaohui add 'OUT_LEVEL', 2015-09-16 - if(OUT_LEVEL != "m") OUT(ofs_running,"VNA",VNA); - - //=================================== - // the neutral potential part. - //=================================== - if(VNA) - { - this->cal_fvna(LM); - } - - double* tmpDHx = new double[ParaO.nloc]; - double* tmpDHy = new double[ParaO.nloc]; - double* tmpDHz = new double[ParaO.nloc]; - ZEROS( tmpDHx, ParaO.nloc ); - ZEROS( tmpDHy, ParaO.nloc ); - ZEROS( tmpDHz, ParaO.nloc ); - for(int i=0; isvl_dphi[j][i] = this->svl_dphi[i][j]; - } - } - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->svl_dphi[i][j] /= ucell.omega; - } - } - } - - delete[] tmpDHx; - delete[] tmpDHy; - delete[] tmpDHz; - - - timer::tick("Force_LCAO_gamma","cal_fvl_dphi",'G'); - return; -} - - -void Force_LCAO_gamma::cal_fvnl_dbeta(double** dm2d) -{ - TITLE("Force_LCAO_gamma","cal_fvnl_dbeta"); - timer::tick("Force_LCAO_gamma","cal_fvnl_dbeta",'G'); - if(STRESS)for(int ipol=0; ipol<3; ++ipol) - { - ZEROS( this->svnl_dbeta[ipol], 3); - } - for(int iat=0; iat tau0 = ucell.atoms[it].tau[ia]; - //find ajacent atom of atom ia - //GridD.Find_atom( ucell.atoms[it].tau[ia] ); - GridD.Find_atom( ucell.atoms[it].tau[ia] ,it, ia); - - //FOLLOWING ARE CONTRIBUTIONS FROM - //VNL DUE TO PROJECTOR'S DISPLACEMENT - for (int ad1 =0 ; ad1 < GridD.getAdjacentNum()+1; ad1++) - { - const int T1 = GridD.getType (ad1); - const Atom* atom1 = &ucell.atoms[T1]; - const int I1 = GridD.getNatom (ad1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - const Vector3 tau1 = GridD.getAdjacentTau (ad1); - - for (int ad2 =0 ; ad2 < GridD.getAdjacentNum()+1; ad2++) - { - const int T2 = GridD.getType (ad2); - const Atom* atom2 = &ucell.atoms[T2]; - const int I2 = GridD.getNatom (ad2); - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - const Vector3 tau2 = GridD.getAdjacentTau (ad2); - - const double Rcut_Beta = ORB.Beta[it].get_rcut_max(); - const double Rcut_AO1 = ORB.Phi[T1].getRcut(); - const double Rcut_AO2 = ORB.Phi[T2].getRcut(); - - const double dist1 = (tau1-tau0).norm() * ucell.lat0; - const double dist2 = (tau2-tau0).norm() * ucell.lat0; - double r0[3],r1[3]; - if(STRESS) - { - r1[0] = ( tau1.x - tau0.x) ; - r1[1] = ( tau1.y - tau0.y) ; - r1[2] = ( tau1.z - tau0.z) ; - r0[0] = ( tau2.x - tau0.x) ; - r0[1] = ( tau2.y - tau0.y) ; - r0[2] = ( tau2.z - tau0.z) ; - } - - if (dist1 > Rcut_Beta + Rcut_AO1 - || dist2 > Rcut_Beta + Rcut_AO2) - { - continue; - } - - for (int jj = 0; jj < ucell.atoms[T1].nw; jj++) - { - const int iw1_all = start1 + jj; - const int mu = ParaO.trace_loc_row[iw1_all]; - if(mu<0) continue; - for (int kk = 0; kk < ucell.atoms[T2].nw; kk++) - { - const int iw2_all = start2 + kk; - const int nu = ParaO.trace_loc_col[iw2_all]; - if(nu<0) continue; - - double nlm[3] = {0,0,0}; - - UOT.snap_psibeta( - nlm, 1, - tau1, T1, - atom1->iw2l[jj], // L2 - atom1->iw2m[jj], // m2 - atom1->iw2n[jj], // N2 - tau2, T2, - atom2->iw2l[kk], // L1 - atom2->iw2m[kk], // m1 - atom2->iw2n[kk], // n1 - tau0, it); - double nlm1[3] = {0,0,0}; - if(STRESS) UOT.snap_psibeta( - nlm1, 1, - tau2, T2, - atom2->iw2l[kk], // L2 - atom2->iw2m[kk], // m2 - atom2->iw2n[kk], // N2 - tau1, T1, - atom1->iw2l[jj], // L1 - atom1->iw2m[jj], // m1 - atom1->iw2n[jj], // n1 - tau0, it); - - const int index = mu * ParaO.ncol + nu; - - // dbeta is minus, that's consistent. - // only one projector for each atom force. - - double sum = 0.0; - for(int is=0; isfvnl_dbeta[iat][0] -= sum * nlm[0]; - this->fvnl_dbeta[iat][1] -= sum * nlm[1]; - this->fvnl_dbeta[iat][2] -= sum * nlm[2]; - - if(STRESS) - { - for(int ipol=0;ipol<3;ipol++){ - this->svnl_dbeta[0][ipol] -= sum/2.0 * (nlm[0] * r0[ipol] + nlm1[0] * r1[ipol])* -1; - this->svnl_dbeta[1][ipol] -= sum/2.0 * (nlm[1] * r0[ipol] + nlm1[1] * r1[ipol])* -1; - this->svnl_dbeta[2][ipol] -= sum/2.0 * (nlm[2] * r0[ipol] + nlm1[2] * r1[ipol])* -1; - } - } - }//!kk - }//!ad2 - }//!jj - }//!ad1 - }//!iat - if(STRESS) - { - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->svnl_dbeta[i][j] *= ucell.lat0 / ucell.omega; - } - } - } - timer::tick("Force_LCAO_gamma","cal_fvnl_dbeta",'G'); - return; -} - -void Force_LCAO_gamma::DerivS_PW (void) -{ - WARNING_QUIT("Force_LCAO_gamma::DerivT_PW","no use for a long time."); - // no use for a long time. - // mohan 2010-08-10 - /* - //----------------------------------------- - //TEST OUTPUT OF S Deriv Matrix in PW - //----------------------------------------- - //test under pw basis - hm.hon.UOM.ForcedS = new matrix[3]; - this->ds = hm.hon.UOM.ForcedS; - for (int i = 0; i < 3; i++) this->ds[i].create (NLOCAL, NLOCAL); - - hm.hon.UOM.build_ST (1, 'S', true); - - // cout << "\n===========================================================================" << endl; - // out.printrm("Force_LCAO_gamma, X Directional Derivatives of S Matrix in PW", this->ds[2]); - // cout << "\n===========================================================================" << endl; - - for (int i = 0; i < 3; i++) this->ds[i].freemem (); - delete[] this->ds; - */ - return; -} - -void Force_LCAO_gamma::cal_ftvnl_dphi(const std::vector &dm2d) -{ - TITLE("Force_LCAO_gamma","cal_ftvnl_dphi"); - timer::tick("Force_LCAO_gamma","cal_ftvnl_dphi",'G'); - - if(STRESS)for(int ipol=0; ipol<3; ++ipol) - { - ZEROS( this->stvnl_dphi[ipol], 3); - } - - for(int i=0; i= 0 && nu >= 0 ) - { - const int index = mu * ParaO.ncol + nu; - //contribution from deriv of AO's in T+VNL term - - double sum = 0.0; - for(int is=0; isftvnl_dphi[iat][0] += sum * LM.DHloc_fixed_x[index]; - this->ftvnl_dphi[iat][1] += sum * LM.DHloc_fixed_y[index]; - this->ftvnl_dphi[iat][2] += sum * LM.DHloc_fixed_z[index]; - if(STRESS) - { - this->stvnl_dphi[0][0] += sum/2.0 * LM.DHloc_fixed_11[index]; - this->stvnl_dphi[0][1] += sum/2.0 * LM.DHloc_fixed_12[index]; - this->stvnl_dphi[0][2] += sum/2.0 * LM.DHloc_fixed_13[index]; - this->stvnl_dphi[1][1] += sum/2.0 * LM.DHloc_fixed_22[index]; - this->stvnl_dphi[1][2] += sum/2.0 * LM.DHloc_fixed_23[index]; - this->stvnl_dphi[2][2] += sum/2.0 * LM.DHloc_fixed_33[index]; - } - } - } - } - if(STRESS) - { - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - if(istvnl_dphi[j][i] = this->stvnl_dphi[i][j]; - } - } - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->stvnl_dphi[i][j] *= ucell.lat0 / ucell.omega; - } - } - } - timer::tick("Force_LCAO_gamma","cal_ftvnl_dphi",'G'); - return; -} - -void Force_LCAO_gamma::cal_fvl_dphi(const std::vector &dm2d) -{ - TITLE("Force_LCAO_gamma","cal_fvl_dphi"); - timer::tick("Force_LCAO_gamma","cal_fvl_dphi",'G'); - - ZEROS (LM.DHloc_fixed_x, ParaO.nloc); - ZEROS (LM.DHloc_fixed_y, ParaO.nloc); - ZEROS (LM.DHloc_fixed_z, ParaO.nloc); - if(STRESS) - { - ZEROS (LM.DHloc_fixed_11, ParaO.nloc); - ZEROS (LM.DHloc_fixed_12, ParaO.nloc); - ZEROS (LM.DHloc_fixed_13, ParaO.nloc); - ZEROS (LM.DHloc_fixed_22, ParaO.nloc); - ZEROS (LM.DHloc_fixed_23, ParaO.nloc); - ZEROS (LM.DHloc_fixed_33, ParaO.nloc); - for(int ipol=0; ipol<3; ++ipol) - { - ZEROS( this->svl_dphi[ipol], 3); - } - } - - if(OUT_LEVEL != "m") OUT(ofs_running,"VNA",VNA); - - //=================================== - // the neutral potential part. - //=================================== - if(VNA) - { - this->cal_fvna(LM); - } - - double* tmpDHx = new double[ParaO.nloc]; - double* tmpDHy = new double[ParaO.nloc]; - double* tmpDHz = new double[ParaO.nloc]; - ZEROS( tmpDHx, ParaO.nloc ); - ZEROS( tmpDHy, ParaO.nloc ); - ZEROS( tmpDHz, ParaO.nloc ); - for(int i=0; isvl_dphi[j][i] = this->svl_dphi[i][j]; - } - } - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->svl_dphi[i][j] /= ucell.omega; - } - } - } - - delete[] tmpDHx; - delete[] tmpDHy; - delete[] tmpDHz; - - timer::tick("Force_LCAO_gamma","cal_fvl_dphi",'G'); - return; -} - -void Force_LCAO_gamma::cal_fvnl_dbeta(const std::vector &dm2d) -{ - TITLE("Force_LCAO_gamma","cal_fvnl_dbeta"); - timer::tick("Force_LCAO_gamma","cal_fvnl_dbeta",'G'); - if(STRESS)for(int ipol=0; ipol<3; ++ipol) - { - ZEROS( this->svnl_dbeta[ipol], 3); - } - for(int iat=0; iat tau0 = ucell.atoms[it].tau[ia]; - //find ajacent atom of atom ia - //GridD.Find_atom( ucell.atoms[it].tau[ia] ); - GridD.Find_atom( ucell.atoms[it].tau[ia] ,it, ia); - - //FOLLOWING ARE CONTRIBUTIONS FROM - //VNL DUE TO PROJECTOR'S DISPLACEMENT - for (int ad1 =0 ; ad1 < GridD.getAdjacentNum()+1; ad1++) - { - const int T1 = GridD.getType (ad1); - const Atom* atom1 = &ucell.atoms[T1]; - const int I1 = GridD.getNatom (ad1); - const int start1 = ucell.itiaiw2iwt(T1, I1, 0); - const Vector3 tau1 = GridD.getAdjacentTau (ad1); - - for (int ad2 =0 ; ad2 < GridD.getAdjacentNum()+1; ad2++) - { - const int T2 = GridD.getType (ad2); - const Atom* atom2 = &ucell.atoms[T2]; - const int I2 = GridD.getNatom (ad2); - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - const Vector3 tau2 = GridD.getAdjacentTau (ad2); - - const double Rcut_Beta = ORB.Beta[it].get_rcut_max(); - const double Rcut_AO1 = ORB.Phi[T1].getRcut(); - const double Rcut_AO2 = ORB.Phi[T2].getRcut(); - - const double dist1 = (tau1-tau0).norm() * ucell.lat0; - const double dist2 = (tau2-tau0).norm() * ucell.lat0; - double r0[3],r1[3]; - if(STRESS) - { - r1[0] = ( tau1.x - tau0.x) ; - r1[1] = ( tau1.y - tau0.y) ; - r1[2] = ( tau1.z - tau0.z) ; - r0[0] = ( tau2.x - tau0.x) ; - r0[1] = ( tau2.y - tau0.y) ; - r0[2] = ( tau2.z - tau0.z) ; - } - - if (dist1 > Rcut_Beta + Rcut_AO1 - || dist2 > Rcut_Beta + Rcut_AO2) - { - continue; - } - - for (int jj = 0; jj < ucell.atoms[T1].nw; jj++) - { - const int iw1_all = start1 + jj; - const int mu = ParaO.trace_loc_row[iw1_all]; - if(mu<0) continue; - for (int kk = 0; kk < ucell.atoms[T2].nw; kk++) - { - const int iw2_all = start2 + kk; - const int nu = ParaO.trace_loc_col[iw2_all]; - if(nu<0) continue; - - double nlm[3] = {0,0,0}; - - UOT.snap_psibeta( - nlm, 1, - tau1, T1, - atom1->iw2l[jj], // L2 - atom1->iw2m[jj], // m2 - atom1->iw2n[jj], // N2 - tau2, T2, - atom2->iw2l[kk], // L1 - atom2->iw2m[kk], // m1 - atom2->iw2n[kk], // n1 - tau0, it); - double nlm1[3] = {0,0,0}; - if(STRESS) UOT.snap_psibeta( - nlm1, 1, - tau2, T2, - atom2->iw2l[kk], // L2 - atom2->iw2m[kk], // m2 - atom2->iw2n[kk], // N2 - tau1, T1, - atom1->iw2l[jj], // L1 - atom1->iw2m[jj], // m1 - atom1->iw2n[jj], // n1 - tau0, it); - - const int index = mu * ParaO.ncol + nu; - - // dbeta is minus, that's consistent. - // only one projector for each atom force. - - double sum = 0.0; - for(int is=0; isfvnl_dbeta[iat][0] -= sum * nlm[0]; - this->fvnl_dbeta[iat][1] -= sum * nlm[1]; - this->fvnl_dbeta[iat][2] -= sum * nlm[2]; - - if(STRESS) - { - for(int ipol=0;ipol<3;ipol++) - { - this->svnl_dbeta[0][ipol] -= sum/2.0 * (nlm[0] * r0[ipol] + nlm1[0] * r1[ipol])* -1; - this->svnl_dbeta[1][ipol] -= sum/2.0 * (nlm[1] * r0[ipol] + nlm1[1] * r1[ipol])* -1; - this->svnl_dbeta[2][ipol] -= sum/2.0 * (nlm[2] * r0[ipol] + nlm1[2] * r1[ipol])* -1; - } - } - }//!kk - }//!ad2 - }//!jj - }//!ad1 - }//!iat - if(STRESS) - { - for(int i=0;i<3;i++) - { - for(int j=0;j<3;j++) - { - this->svnl_dbeta[i][j] *= ucell.lat0 / ucell.omega; - } - } - } - timer::tick("Force_LCAO_gamma","cal_fvnl_dbeta",'G'); - return; -} diff --git a/ABACUS.develop/source/src_lcao/force_lcao_gamma.h b/ABACUS.develop/source/src_lcao/force_lcao_gamma.h deleted file mode 100644 index 72dac4c123..0000000000 --- a/ABACUS.develop/source/src_lcao/force_lcao_gamma.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef FORCE_LCAO_GAMMA_H -#define FORCE_LCAO_GAMMA_H - -#include "../src_pw/tools.h" -#include "lcao_matrix.h" - -class Force_LCAO_gamma -{ - public : - - Force_LCAO_gamma (); - ~Force_LCAO_gamma (); - - protected: - - //orthonormal force + contribution from T and VNL - void ftable_gamma (void); - - //each part of force - double** foverlap; - double** ftvnl_dphi; - double** fvnl_dbeta; - double** fvl_dphi; - - public: - //each part of stress - double soverlap[3][3]; - double stvnl_dphi[3][3]; - double svnl_dbeta[3][3]; - double svl_dphi[3][3]; - - private: - - // get the ds, dt, dvnl. - void allocate_gamma(void); - void finish_ftable_gamma(void); - void set_EDM_gamma(double* dm, bool with_energy, const int &is); - - // mohan fix bug 2011-06-15 - double set_EDM_element(const int &ii, const int &jj, const bool with_energy, - double*** coef1, double*** coef2, const int &is); - - void cal_foverlap(void); - void cal_ftvnl_dphi(double** dm2d); - void cal_fvnl_dbeta(double** dm2d); - void cal_fvl_dphi(double** dm2d); - - void cal_ftvnl_dphi(const std::vector &dm2d); - void cal_fvnl_dbeta(const std::vector &dm2d); - void cal_fvl_dphi(const std::vector &dm2d); - - void DerivS_PW (void); - void DerivT_PW (void); - - void average_force(double* fm); - void cal_fvna(LCAO_Matrix &LM); // mohan add 2011-05-23 - - void test_gamma(double* mm, const string &name); - -}; -#endif diff --git a/ABACUS.develop/source/src_lcao/force_lcao_k.h b/ABACUS.develop/source/src_lcao/force_lcao_k.h deleted file mode 100644 index 23228a8a8d..0000000000 --- a/ABACUS.develop/source/src_lcao/force_lcao_k.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef FORCE_LCAO_K_H -#define FORCE_LCAO_K_H - -#include "../src_pw/tools.h" -#include "lcao_matrix.h" -#include "force_lcao_gamma.h" - -class Force_LCAO_k : public Force_LCAO_gamma -{ - public : - - Force_LCAO_k (); - ~Force_LCAO_k (); - - protected: - - //orthonormal force + contribution from T and VNL - void ftable_k (void); - - private: - - // get the ds, dt, dvnl. - void allocate_k(void); - - - void finish_k(void); - - - void set_EDM_k(double **dmR, const bool with_energy); - - - // mohan add 2012-01-09 - complex set_EDM_k_element( - const complex &phase, - const bool with_energy, - complex &coef1, complex &coef2, - const double &ekb); - - - // calculate the force due to < dphi | beta > < beta | phi > - void cal_ftvnl_dphi_k(double **dmR); - - - // calculate the force due to < phi | Vlocal | dphi > - void cal_fvl_dphi_k(double **dmR); - - - // calculate the overlap force - void cal_foverlap_k(void); - - - // calculate the force due to < phi | dbeta > < beta | phi > - void cal_fvnl_dbeta_k(double** dmR); - - - void test(double* mm, const string &name); - - - // calculate the force due to < dphi_0i | Vna | phi_0j > - void force_vna_k(void); - -}; -#endif diff --git a/ABACUS.develop/source/src_lcao/gint_gamma.cpp b/ABACUS.develop/source/src_lcao/gint_gamma.cpp index 0816d4ed84..166454977e 100644 --- a/ABACUS.develop/source/src_lcao/gint_gamma.cpp +++ b/ABACUS.develop/source/src_lcao/gint_gamma.cpp @@ -1,7 +1,7 @@ #include "gint_gamma.h" -#include "../src_pw/global.h" -#include "ylm.h" -#include "sltk_atom_arrange.h" +#include "src_pw/global.h" +#include "src_global/ylm.h" +#include "src_global/sltk_atom_arrange.h" Gint_Gamma::Gint_Gamma() { @@ -76,5 +76,3 @@ void Gint_Gamma::save_atoms_on_grid(const Grid_Technique >) return; } - - diff --git a/ABACUS.develop/source/src_lcao/gint_gamma.h b/ABACUS.develop/source/src_lcao/gint_gamma.h index 5036307a06..e9633b9971 100644 --- a/ABACUS.develop/source/src_lcao/gint_gamma.h +++ b/ABACUS.develop/source/src_lcao/gint_gamma.h @@ -8,18 +8,39 @@ #include "../src_pw/tools.h" #include "grid_base_beta.h" #include "grid_technique.h" -#include "lcao_matrix.h" +#include "LCAO_matrix.h" #include + //========================================================= -//CLASS Grid_Integral_Beta -//Note : Integral On 3D Grids, different from Grid_Integral -//Feature : Matrix Elements Of Local Potential For -//Numerical Orbitals +// Integral On 3D Grids, different from Grid_Integral +// Feature : Matrix Elements Of Local Potential For +// Numerical Orbitals //========================================================= class Gint_Gamma : public Grid_Base_Beta { -private: + public: + + Gint_Gamma(); + ~Gint_Gamma(); + + // (1) calculate the H matrix in terms of effective potentials + void cal_vlocal( const double* vlocal_in); + + // (2) calculate charge density + double cal_rho(void); + + // (3) calcualte the forces related to grid + void cal_force( const double* vlocal_in); + + // (4) calcualte the envelope function + void cal_env(const double* wfc, double* rho); + + // (5) calculate the Mulliken charge + void cal_mulliken(double** mulliken); + + + private: double* transformer; double psiv1; @@ -40,110 +61,46 @@ class Gint_Gamma : public Grid_Base_Beta double* x12; double* x03; int *iq; -omp_lock_t lock; - - void save_atoms_on_grid(const Grid_Technique >); - - - // for calculation of < phi_i | Vna | phi_j > - // on normal real space FFT grid. - void gamma_vna(void); + // peize add, I guess, mohan add 2021-01-31 + omp_lock_t lock; - // for calculation of < phi_i | Vna | phi_j > - // on dense real space FFT grid. - void gamma_vna_d(const Grid_Technique >, const char &matrix_type);// d stands for 'dense' + void save_atoms_on_grid(const Grid_Technique >); // for calculation of < phi_i | Vlocal | phi_j > void gamma_vlocal(void); - - // for calculation of pVp under B field. - void gamma_vlocal_B(void); - - // for calculation of charege double gamma_charge(void); - - // for calculatin of charge under B field - double gamma_charge_B(void); //mohan add 2012-04-19 - - // for calculation of Mulliken charge. void gamma_mulliken(double** mulliken); - // for calculation of envelope functions. void gamma_envelope(const double* wfc, double* rho);// mohan add 2011-07-01 - // for calculation of < beta_i | phi_j> under magnetic B field. - void grid_integration_vnl(complex **Tab); - - // for calculatin of < dphi_i | Vlocal | phi_j > for foce calculation // on regular FFT real space grid. void gamma_force(void); - // for calculation of < dphi_i | Vlocal | phi_j> for force calculation - // on dense FFT grid. - void gamma_force_vna(const Grid_Technique >, LCAO_Matrix &lm); - - - // for claculation of terms under B field, - void gamma_S_T_AP(char type, const Grid_Technique >);// sun zhiyuan add 2012-01-03// - - - //To be used in cal_S_T_AP(), zhiyuan add 2011-01-06// - complex Add_S(complex phase, double psi1, double psi2); - - complex Add_T(complex phase, double A1[3], double A2[3], - double dphi1x,double dphi1y,double dphi1z, - double dphi2x,double dphi2y,double dphi2z, - double psi1, double psi2); - - complex Add_AP(complex phase, double Aldr3[3],double A2[3], - double dphi2x,double dphi2y,double dphi2z, - double psi1, double psi2); - - complex Add_AA(complex phase, double AAdr, - double psi1, double psi2); - -void cal_meshball_vlocal(int size, int LD_pool, int* block_iw, int* bsize, int* colidx, + void cal_meshball_vlocal(int size, int LD_pool, int* block_iw, int* bsize, int* colidx, int** cal_flag, double* vldr3, double** psir_ylm, double** psir_vlbr3, int* vindex, int lgd_now, double** GridVlocal); -void cal_band_rho(int size, int LD_pool, int* block_iw, int* bsize, int* colidx, + + void cal_band_rho(int size, int LD_pool, int* block_iw, int* bsize, int* colidx, int** cal_flag, double ** psir_ylm, double **psir_DM, double* psir_DM_pool, int* vindex); -void setVindex(const int ncyz, const int ibx, const int jby, const int kbz, int* vindex) const; -void cal_psir_ylm_rho(int size, int grid_index, double delta_r, + + void setVindex(const int ncyz, const int ibx, const int jby, const int kbz, int* vindex) const; + + void cal_psir_ylm_rho(int size, int grid_index, double delta_r, double** distance, double* ylma, int* at, int* block_index, int* block_iw, int* block_size, int** cal_flag, double** psir_ylm); -public: - - Gint_Gamma(); - ~Gint_Gamma(); - - double cal_rho(void); - void cal_mulliken(double** mulliken); - void cal_env(const double* wfc, double* rho); - void cal_vna( const double* vlocal_in); - void cal_vna_d( const Grid_Technique >, const double* vlocal_in, const char &matrix_type);// d stands for 'dense' - void cal_vlocal( const double* vlocal_in); - void cal_force( const double* vlocal_in); - void cal_force_vna( const double* vlocal_in, const Grid_Technique >, LCAO_Matrix &lm ); - void cal_vnl_B(complex **Tab); // mohan add 2011-04-08 - - - - // needed while for gauge-invarient B-field. - void cal_S_T_AP(char type, const Grid_Technique >);//for calculating S,T,and A*P. sun zhiyuan add 2012-01-03 - }; diff --git a/ABACUS.develop/source/src_lcao/gint_gamma_bfield.cpp b/ABACUS.develop/source/src_lcao/gint_gamma_bfield.cpp deleted file mode 100644 index 6c3e7d6b9b..0000000000 --- a/ABACUS.develop/source/src_lcao/gint_gamma_bfield.cpp +++ /dev/null @@ -1,388 +0,0 @@ -#include "gint_gamma.h" -#include "grid_technique.h" -#include "lcao_orbitals.h" -#include "../src_pw/global.h" -#include "bfield.h" - -void Gint_Gamma::cal_vnl_B(complex **Tab) -{ - TITLE("Gint_Gamma","cal_vnl_B"); - timer::tick("Gint_Gamma","cal_vnl_B"); - - this->job = cal_vnlb; - this->save_atoms_on_grid(GridT); - this->grid_integration_vnl(Tab); - - timer::tick("Gint_Gamma","cal_vnl_B"); - return; -} - -void Gint_Gamma::grid_integration_vnl(complex **Tab) -{ - TITLE("Grid_Integral","grid_integration_vnl"); - cout << " grid integration for vnl() " << endl; - cout << " vfactor=" << vfactor << endl; - // it's a uniform grid to save orbital values, so the delta_r is a constant. - - const int lgd_now= GridT.lgd; - const int lgd_beta=GridT.lgbeta; - - complex **table; - if(lgd_now > 0 && lgd_beta > 0) - { - table = new complex*[lgd_now]; - for (int i=0; i [lgd_beta]; - ZEROS(table[i], lgd_beta); - } - } - - const double delta_r = ORB.dr_uniform; - const Numerical_Orbital_Lm* pa; - const Numerical_Nonlocal_Lm* pb; - - int nnnmax=0; - int nhmax=0;//mohan add 2012-04-13 - for(int T=0; T= pb->nr_uniform"); - } - - tmp = c1*pb->beta_uniform[ip]+c2*pb->dbeta_uniform[ip] - + c3*pb->beta_uniform[ip+1] + c4*pb->dbeta_uniform[ip+1]; - } - - const int L = pb->getL(); - for(int m=0; m<2*L+1; m++) - { - assert( nnn[it] > ORB.ib2_ylm(it,ibm) ); - betar_ylm[ib][id][ibm] = tmp * ylma[ ORB.ib2_ylm(it,ibm) ]; - ++ibm; - } - }// end iproj - }// end ib - }// end id - - - // PHASE - int index=0; - double rA[3]={0,0,0}; - for(int ii=0; ii phase=ZERO;// PHASE - phase=bfid.cal_phase(A2_ms_A1,Rbxyz[ib],-1);// PHASE - for (int iw=0; iw< atom1->nw; iw++) - { - complex v1 = phase*psi1[iw]*vfactor;//PHASE - - //double phase = Bfield::a_dot_b( this->dr[ia2], bfid.RxB[iat2] ); - //double e1 = std::cos(phase); - //double e2 = std::sin(phase); - //complex v1e = v1 * complex(e1, e2); - int iproj_all = start2; - const int iw1_lo = GridT.trace_lo[iw_all]; - for (int iproj=0; iproj< atom2->nh; iproj++) - { - assert(iw_all=0); - table[iw1_lo][iw2_lo] += v1 * beta2[iproj]; - - //cout << " Tab=" << Tab[iw_all][ib_all] << " betar_ylm=" << betar_ylm[ia2][ib] << endl; - // int ok; cin >> ok; - ++iproj_all; - }//iw2 - ++iw_all; - }//iw - }//end cal_flag - }// end ib - }// ia2 - }// ia1 - }// k - }// j - }// i - - delete[] vindex; - delete[] ylma; - delete[] vldr3; - - if(max_size!=0) - { - for(int i=0; i *tmp=new complex [nkb]; - for(int i=0;i=0) - { - for(int j=0;j=0) - { - tmp[j]=table[mu][nu]; - } - } - } - Parallel_Reduce::reduce_complex_double_pool( tmp, nkb); //need to be updated// - if(ParaO.trace_loc_row[i]>=0|| ParaO.trace_loc_col[i]>=0) - { - for(int j=0;j &rly, vector> &grly, // Peize Lin change rly, grly 2016-08-26 - const Numerical_Orbital_Lm* pointer, - int* block_index, int* block_iw, int* block_size, bool** cal_flag, - double** psir_ylm, double** dphix, double** dphiy, double** dphiz, - realArray& drr) +inline void cal_psir_ylm_dphi( + int size, + int grid_index, + double delta_r, + vector &rly, + vector> &grly, // Peize Lin change rly, grly 2016-08-26 + const Numerical_Orbital_Lm* pointer, + int* block_index, + int* block_iw, + int* block_size, + bool** cal_flag, + double** psir_ylm, + double** dphix, + double** dphiy, + double** dphiz, + realArray& drr) { block_index[0]=0; double mt[3]={0,0,0}; @@ -69,6 +83,7 @@ inline void cal_psir_ylm_dphi(int size, int grid_index, double delta_r, vector ORB.Phi[it].getRcut()) { ZEROS(p_psir_ylm, block_size[id]); @@ -94,6 +114,7 @@ inline void cal_psir_ylm_dphi(int size, int grid_index, double delta_r, vector>> the old method // ylma[id] = new double[nnn[it]]; // liaochen found this bug 2010/03/29 @@ -129,21 +150,6 @@ inline void cal_psir_ylm_dphi(int size, int grid_index, double delta_r, vectoriq[id] = static_cast(position); - //this->x0[id] = position - iq[id]; - //this->x1[id] = 1.0 - x0[id]; - //this->x2[id] = 2.0 - x0[id]; - //this->x3[id] = 3.0 - x0[id]; - //this->x12[id] = x1[id]*x2[id] / 6; - //this->x03[id] = x0[id]*x3[id] / 2; - // iq[id] = static_cast(position); - // x0[id] = position - iq[id]; - // x1[id] = 1.0 - x0[id]; - // x2[id] = 2.0 - x0[id]; - // x3[id] = 3.0 - x0[id]; - // x12[id] = x1[id]*x2[id] / 6; - // x03[id] = x0[id]*x3[id] / 2; - iq = static_cast(position); x0 = position - iq; @@ -190,15 +196,6 @@ inline void cal_psir_ylm_dphi(int size, int grid_index, double delta_r, vectorpsi_uniform[iq[id]]*x3[id] - // +pointer->psi_uniform[iq[id]+3]*x0[id]) - // + x03[id]*(pointer->psi_uniform[iq[id]+1]*x2[id] - // -pointer->psi_uniform[iq[id]+2]*x1[id]); - - // dtmp = x12[id]*(pointer->dpsi_uniform[iq[id]]*x3[id] - // +pointer->dpsi_uniform[iq[id]+3]*x0[id]) - // + x03[id]*(pointer->dpsi_uniform[iq[id]+1]*x2[id] - // -pointer->dpsi_uniform[iq[id]+2]*x1[id]); tmp = x12*(pointer->psi_uniform[iq]*x3 +pointer->psi_uniform[iq+3]*x0) @@ -270,13 +267,20 @@ inline void cal_psir_ylm_dphi(int size, int grid_index, double delta_r, vectorgrid_index = (k-GridT.nbzp_start) + j * GridT.nbzp + i * GridT.nby * GridT.nbzp; const int size = GridT.how_many_atoms[ this->grid_index ]; if(size==0)continue; - //timer::tick("Gint_Gamma","vindex",'J'); setVindex(ncyz, ibx, jby, kbz, vindex); for(int ib=0; ibvlocal[vindex[ib]] * this->vfactor; } - //timer::tick("Gint_Gamma","vindex",'J'); - // OUT(ofs_running, "k was setted as", k); - //inline void cal_psir_ylm_dphi(int size, int grid_index, double delta_r, double rly, double grly, - // const Numerical_Orbital_Lm* pointer, - // int* block_index, int* block_iw, int* block_size, - // double** psir_ylm, double** dphix, double** dphiy, double** dphiz) - - //OUT(ofs_running,"Start cal_psir_ylm_dphi"); - //timer::tick("Gint_Gamma","dphi",'J'); cal_psir_ylm_dphi(size, grid_index, delta_r, rly, grly, pointer, block_index, block_iw, block_size, cal_flag, psir_ylm, dphix, dphiy, dphiz, drr); - //timer::tick("Gint_Gamma","dphi",'J'); - - //inline void cal_meshball_DGridV(int size, int GridT.lgd, int LD_pool, int* block_index, int* block_iw, int* block_size, double* vldr3, - // double** psir_ylm, double** psir_vlbr3, double** dphix, double** dphiy, double** dphiz, - // double** DGridV_x, double** DGridV_y, double** DGridV_z) - // OUT(ofs_running,"Start cal_meshball_DGridV"); - //timer::tick("Gint_Gamma","dpvp",'J'); cal_meshball_DGridV(size, GridT.lgd, LD_pool, block_index, block_iw, block_size, cal_flag, vldr3, psir_ylm, psir_vlbr3, dphix, dphiy, dphiz, DGridV_x, DGridV_y, DGridV_z, DGridV_11, DGridV_12, DGridV_13, DGridV_22, DGridV_23, DGridV_33, drr); - //timer::tick("Gint_Gamma","dpvp",'J'); - // OUT(ofs_running,"cal_meshball_DGridV was done"); }// k }// j }// i @@ -700,7 +687,9 @@ void Gint_Gamma::gamma_force(void) delete[] block_iw; delete[] block_size; for(int ib=0; ibvlocal = vlocal_in; - this->save_atoms_on_grid(gt); - this->gamma_force_vna(gt, lm); - timer::tick("Gint_Gamma","cal_force_vna",'I'); -} - - -//------------------------------------------------------------- -// Because this part calculat -// so there are many reasons make this part very expensive. -// (1) Dense grid. (dx*2,dy*2,dz*2) 8 times at least -// (2) All the matrix are needed, it's non-symmetric. 2 times at least -// (3) Need to calculate three components of force: Fx,Fy,Fz -// However, 3 times may be -// 8*2*3=48 (20) -// we must know, -// once we have the lattice structure and the atom positions, -// and of course the local orbitals. -// we can do the neutral potential force right away, -// why should we bother so many processors to do at the same -// time after the charge density is converged. -// we can begin to do it in another set of processors!! -// -// The same principle applys to the -//------------------------------------------------------------- -void Gint_Gamma::gamma_force_vna(const Grid_Technique >, LCAO_Matrix &lm) -{ - TITLE("Grid_Integral","gamma_force_vna"); - timer::tick("Gint_Gamma","gamma_force_vna",'J'); - // gt.lgd: local grid dimension (sub-FFT-mesh). - double** DGridV = new double*[gt.lgd]; - double** DGridV_s; - if(STRESS) DGridV_s = new double*[gt.lgd]; - for (int i=0; i rly; - vector> grly; - - double mt[3]={0,0,0}; - double *vldr3 = new double[bxyz]; - ZEROS(vldr3, bxyz); - - double* vna3d = new double[bxyz]; - ZEROS(vna3d, bxyz); - - - int* nww = new int[max_size]; - int* iw0_all = new int[max_size]; - ZEROS(nww,max_size); - ZEROS(iw0_all,max_size); - -// ofstream ofs_x("vna_x.dat"); -// ofstream ofs_y("vna_y.dat"); -// ofstream ofs_z("vna_z.dat"); - - const int nbx = gt.nbx; - const int nby = gt.nby; - const int nbz_start = gt.nbzp_start; - const int nbz = gt.nbzp; - - - // needed in the inner circle. - double vv; - double* psi1; - double* dphi2; - double* dpvp; - double* dpvpr; - double* dphi3; - double* phi2_end; - int iw1_lo; - - for (int i=0; igrid_index = (k-nbz_start) + j * nbz + i * nby * nbz; - const int size = gt.how_many_atoms[ this->grid_index ]; - if(size==0)continue; // tmp by mohan - - ZEROS(vna3d, bxyz);//vna - - for (int id=0; id ORB.Vna[it].rcut && - distance[ib][id] > ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=false; - continue; - } - - Ylm::grad_rl_sph_harm(ucell.atoms[it].nwl, dr[ib][id][0], - dr[ib][id][1], dr[ib][id][2], rly, grly); - - // 1E-7 is necessary in case of R is just on one grid - const double position = distance[ib][id] / delta_r; - this->iq[id] = static_cast(position); - this->x0[id] = position - static_cast(iq[id]); - this->x1[id] = 1.0 - x0[id]; - this->x2[id] = 2.0 - x0[id]; - this->x3[id] = 3.0 - x0[id]; - this->x12[id] = x1[id]*x2[id] / 6.0; - this->x03[id] = x0[id]*x3[id] / 2.0; - - - // vna - if(distance[ib][id] <= ORB.Vna[it].rcut) - { - double ccc = (x12[id]*(ORB.Vna[it].vna_u[iq[id]]*x3[id] - +ORB.Vna[it].vna_u[iq[id]+3]*x0[id]) - + x03[id]*(ORB.Vna[it].vna_u[iq[id]+1]*x2[id] - -ORB.Vna[it].vna_u[iq[id]+2]*x1[id])); - - vna3d[ib] += ccc; - -// cout << " size=" << size << " distance=" << distance[ib][id] << " ccc=" << ccc << endl; - -// vna3d[ib] += (x12[id]*(ORB.Vna[it].vna_u[iq[id]]*x3[id] -// +ORB.Vna[it].vna_u[iq[id]+3]*x0[id]) -// + x03[id]*(ORB.Vna[it].vna_u[iq[id]+1]*x2[id] -// -ORB.Vna[it].vna_u[iq[id]+2]*x1[id]));/// sqrt(FOUR_PI); - } - - - if(distance[ib][id] <= ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=true; - } - else - { - cal_flag[ib][id]=false; - continue; - } - - - - double tmp, dtmp; - for (int iw=0; iw< atom->nw; iw++) - { - if ( atom->iw2_new[iw] ) - { - pointer = &ORB.Phi[it].PhiLN( - atom->iw2l[iw], - atom->iw2n[iw]); - - if ( iq[id] >= pointer->nr_uniform-4) - { - tmp = dtmp = 0.0; - } - else - { - tmp = x12[id]*(pointer->psi_uniform[iq[id]]*x3[id] - +pointer->psi_uniform[iq[id]+3]*x0[id]) - + x03[id]*(pointer->psi_uniform[iq[id]+1]*x2[id] - -pointer->psi_uniform[iq[id]+2]*x1[id]); - - dtmp = x12[id]*(pointer->dpsi_uniform[iq[id]]*x3[id] - +pointer->dpsi_uniform[iq[id]+3]*x0[id]) - + x03[id]*(pointer->dpsi_uniform[iq[id]+1]*x2[id] - -pointer->dpsi_uniform[iq[id]+2]*x1[id]); - } - }//new l is used. - - int ll = atom->iw2l[iw]; - int idx_lm = atom->iw2_ylm[iw]; - - //special case for distance[id] -> 0 - //Problems Remained - //You have to add this two lines - double rr = distance[ib][id]; - if (rr < 1e-9) - { - if (ll == 0) - { - psir_ylm[ib][id][iw] = tmp * rly[idx_lm]; - dphi[ib][id][3*iw] = dphi[ib][id][3*iw+1] = dphi[ib][id][3*iw+2] = 0.0; - } - else - { - pointer = &ORB.Phi[it]. - PhiLN(atom->iw2l[iw], atom->iw2n[iw]); - - double Zty = pointer->zty; - psir_ylm[ib][id][iw] = Zty * rly[idx_lm]; - - const int iww = 3*iw; - dphi[ib][id][iww] = Zty * grly[idx_lm][0]; - dphi[ib][id][iww+1] = Zty * grly[idx_lm][1]; - dphi[ib][id][iww+2] = Zty * grly[idx_lm][2]; - } - } - else - { - double rl; - if(ll==0) - { - rl = 1.0; - } - else if(ll==1) - { - rl = rr; - } - else - { - rl = pow(rr, ll); - } - - psir_ylm[ib][id][iw] = tmp * rly[idx_lm] / rl; - - double tmpdphi_rly = (dtmp - tmp * ll / rr) / rl * rly[idx_lm] / rr; - double tmprl = tmp/rl; - - dphi[ib][id][iw*3] = tmpdphi_rly * dr[ib][id][0] + tmprl * grly[idx_lm][0]; - dphi[ib][id][iw*3+1] = tmpdphi_rly * dr[ib][id][1] + tmprl * grly[idx_lm][1]; - dphi[ib][id][iw*3+2] = tmpdphi_rly * dr[ib][id][2] + tmprl * grly[idx_lm][2]; - } - } - }// ib - }//!id //finish loop of calc pre-info for each adjacent atom - - int bindex = 0; - // z is the fastest, - for(int ii=0; iivfactor; - vldr3[bindex] = vna3d[bindex] * this->vfactor; - ++bindex; - } - } - } - - - - for(int ia1=0; ia1=0 and nu>=0 in previous version. - if(mu >=0) - { - for (int j=0; j=0) - { - tmp[3*j] = DGridV[mu][3*nu]; - tmp[3*j+1] = DGridV[mu][3*nu+1]; - tmp[3*j+2] = DGridV[mu][3*nu+2]; - if(STRESS) - { - tmpr[6*j] = DGridV_s[mu][6*nu]; - tmpr[6*j+1] = DGridV_s[mu][6*nu+1]; - tmpr[6*j+2] = DGridV_s[mu][6*nu+2]; - tmpr[6*j+3] = DGridV_s[mu][6*nu+3]; - tmpr[6*j+4] = DGridV_s[mu][6*nu+4]; - tmpr[6*j+5] = DGridV_s[mu][6*nu+5]; - } - } - } - } - - Parallel_Reduce::reduce_double_pool( tmp, 3*NLOCAL ); - if(STRESS) Parallel_Reduce::reduce_double_pool( tmpr, 6*NLOCAL ); - const int i2d = ParaO.trace_loc_row[i]; - if(i2d<0) continue; - for (int j=0; j -//inline void setVindex(const int ncyz, const int ibx, const int jby, const int kbz, int* vindex) +#include "global_fp.h" // mohan add 2021-01-30 + void Gint_Gamma::setVindex(const int ncyz, const int ibx, const int jby, const int kbz, int* vindex) const { int bindex = 0; @@ -25,11 +26,18 @@ void Gint_Gamma::setVindex(const int ncyz, const int ibx, const int jby, const i } } -//inline void cal_psir_ylm(int size, int grid_index, double delta_r, -void Gint_Gamma::cal_psir_ylm_rho(int size, int grid_index, double delta_r, - double** distance, double* ylma, - int* at, int* block_index, int* block_iw, int* block_size, - int** cal_flag, double** psir_ylm) +void Gint_Gamma::cal_psir_ylm_rho( + int size, // number of atoms on this grid + int grid_index, + double delta_r, // delta_r of uniform grid + double** distance, + double* ylma, + int* at, + int* block_index, + int* block_iw, + int* block_size, + int** cal_flag, + double** psir_ylm) { const Numerical_Orbital_Lm *pointer; double mt[3]; @@ -120,14 +128,23 @@ void Gint_Gamma::cal_psir_ylm_rho(int size, int grid_index, double delta_r, } // end iw }// end ib }// end id + return; } // can be done by GPU -//inline void cal_band_rho(int size, int LD_pool, int* block_iw, int* bsize, int* colidx, -void Gint_Gamma::cal_band_rho(int size, int LD_pool, int* block_iw, int* bsize, int* colidx, - int** cal_flag, double ** psir_ylm, double **psir_DM, - double* psir_DM_pool, int* vindex) +void Gint_Gamma::cal_band_rho( + int size, + int LD_pool, + int* block_iw, + int* bsize, + int* colidx, + int** cal_flag, + double ** psir_ylm, + double **psir_DM, + double* psir_DM_pool, + int* vindex) { + //parameters for dsymm, dgemm and ddot char side='L', uplo='U'; char transa='N', transb='N'; @@ -137,14 +154,12 @@ void Gint_Gamma::cal_band_rho(int size, int LD_pool, int* block_iw, int* bsize, for(int is=0; is0) { - // dsymm_(&side, &uplo, &bsize[ia1], &k, - // &alpha_symm, &LOC.DM[is][iw1_lo][iw1_lo], &GridT.lgd, - // &psir_ylm[ib][colidx[ia1]], &LD_pool, - // &beta, &psir_DM[ib][colidx[ia1]], &LD_pool); dsymv_(&uplo, &bsize[ia1], &alpha_symm, &LOC.DM[is][iw1_lo][iw1_lo], &GridT.lgd, &psir_ylm[ib][colidx[ia1]], &inc, @@ -236,15 +247,10 @@ void Gint_Gamma::cal_band_rho(int size, int LD_pool, int* block_iw, int* bsize, } else { - // int k=1; for(int ib=first_ib; ib0 && cal_flag[ib][ia2]>0) { - // dgemm_(&transa, &transb, &bsize[ia2], &k, &bsize[ia1], - // &alpha_gemm, &LOC.DM[is][iw1_lo][iw2_lo], &GridT.lgd, - // &psir_ylm[ib][colidx[ia1]], &LD_pool, - // &beta, &psir_DM[ib][colidx[ia2]], &LD_pool); dgemv_(&transa, &bsize[ia2], &bsize[ia1], &alpha_gemm, &LOC.DM[is][iw1_lo][iw2_lo], &GridT.lgd, &psir_ylm[ib][colidx[ia1]], &inc, @@ -255,23 +261,16 @@ void Gint_Gamma::cal_band_rho(int size, int LD_pool, int* block_iw, int* bsize, //OUT(ofs_running, "upper triangle part of psir_DM done, atom2", ia2); }// ia2 } // ia1 - //xiaohui move 2015-09-25, fix lcao+k bug; - //timer::tick("Gint_Gamma","cal_band_psir",'J'); - // calculate rho - //xiaohui move 2015-09-25, fix lcao+k bug; - //timer::tick("Gint_Gamma","cal_band_rho",'J'); - double *rhop = chr.rho[is]; + double *rhop = CHR.rho[is]; for(int ib=0; ibsave_atoms_on_grid(GridT); double ne = 0.0; -omp_init_lock(&lock); - if(BFIELD) - { - this->gamma_charge_B(); - } - else - { - ne = this->gamma_charge(); - } -omp_destroy_lock(&lock); - timer::tick("Gint_Gamma","cal_rho",'F'); - return ne; -} - -#include "bfield.h" -double Gint_Gamma::gamma_charge_B(void) -{ - TITLE("Grid_Integral","gamma_charge_B"); - timer::tick("Gint_Gamma","gamma_charge_B",'I'); - - //get cartesian lattice vectors, in bohr, zhiyuan add 2012-01-13// - double latvec1[3],latvec2[3],latvec3[3]; - latvec1[0]=ucell.latvec.e11*ucell.lat0; - latvec1[1]=ucell.latvec.e12*ucell.lat0; - latvec1[2]=ucell.latvec.e13*ucell.lat0; - latvec2[0]=ucell.latvec.e21*ucell.lat0; - latvec2[1]=ucell.latvec.e22*ucell.lat0; - latvec2[2]=ucell.latvec.e23*ucell.lat0; - latvec3[0]=ucell.latvec.e31*ucell.lat0; - latvec3[1]=ucell.latvec.e32*ucell.lat0; - latvec3[2]=ucell.latvec.e33*ucell.lat0; - - //This is to store the position of grids, zhiyuan add 2012-01-13// - double **Rbxyz = new double *[pw.bxyz]; // bxyz*3// - for(int i=0;igrid_index = (k-nbz_start) + j * nbz + i * nby * nbz; - - // get the value: how many atoms has orbital value on this grid. - const int size = GridT.how_many_atoms[ this->grid_index ]; - if(size==0) continue; - - // (1) initialized the phi * Ylm. - for (int id=0; id GridT.orbital_rmax) continue; - // Ylm::get_ylm_real(this->nnn[it], this->dr[id], ylma); - if (distance[ib][id] < 1.0E-9) distance[ib][id] += 1.0E-9; - - Ylm::sph_harm ( ucell.atoms[it].nwl, - dr[ib][id][0] / distance[ib][id], - dr[ib][id][1] / distance[ib][id], - dr[ib][id][2] / distance[ib][id], - ylma); - // these parameters are about interpolation - // because once we know the distance from atom to grid point, - // we can get the parameters we need to do interpolation and - // store them first!! these can save a lot of effort. - const double position = distance[ib][id] / delta_r; - /* - this->iq[id] = static_cast(position); - this->x0[id] = position - static_cast(iq[id]); - this->x1[id] = 1.0 - x0[id]; - this->x2[id] = 2.0 - x0[id]; - this->x3[id] = 3.0 - x0[id]; - this->x12[id] = x1[id]*x2[id] / 6.0; - this->x03[id] = x0[id]*x3[id] / 2.0; - */ - int ip; - double dx, dx2, dx3; - double c1, c2, c3, c4; - - - ip = static_cast(position); - dx = position - ip; - dx2 = dx * dx; - dx3 = dx2 * dx; - - c3 = 3.0*dx2-2.0*dx3; - c1 = 1.0-c3; - c2 = (dx-2.0*dx2+dx3)*delta_r; - c4 = (dx3-dx2)*delta_r; - - // int ip = this->iq[id]; - // double A = ip+1.0-position/delta_r; - // double B = 1.0-A; - // double coef1 = (A*A*A-A)/6.0*delta_r*delta_r; - // double coef2 = (B*B*B-B)/6.0*delta_r*delta_r; - - Atom* atom1 = &ucell.atoms[it]; - for (int iw=0; iw< atom1->nw; iw++) - { - if ( atom1->iw2_new[iw] ) - { - pointer = &ORB.Phi[it].PhiLN( - atom1->iw2l[iw], - atom1->iw2n[iw]); - phi = c1*pointer->psi_uniform[ip]+c2*pointer->dpsi_uniform[ip] - + c3*pointer->psi_uniform[ip+1] + c4*pointer->dpsi_uniform[ip+1]; - } - psir_ylm[ib][id][iw] = phi * ylma[atom1->iw2_ylm[iw]]; - //psir_ylm[ib][id][iw] = 1;//for test - } - }// end ib - }// end id - - this->setVindex(ncyz, ibx, jby, kbz, vindex); - /* - int bindex = 0; - // z is the fastest, - for(int ii=0; ii ORB.Phi[T1].getRcut())continue; - - //for(int ia2=ia1; ia2 T1, we done all elements, for T2 == T1, - // we done about half. - if (T2 >= T1) - { - for(int is=0; is phase=0; - phase=bfid.cal_phase(A2_ms_A1,Rbxyz[ib],-1); - int iw1_lo = GridT.trace_lo[start1]; - double* psi1 = psir_ylm[ib][ia1]; - double* psi2 = psir_ylm[ib][ia2]; - double tmp = 0.0; - - // how many orbitals in this type: SZ or DZP or TZP... - for (int iw=0; iw< atom1->nw; iw++, ++iw1_lo) - { - v1=psi1[iw]+psi1[iw]; - int iw2_lo = GridT.trace_lo[start2]; - - //zhiyuan add 2012-01-03// - complex *DMp_B; - DMp_B= &LOC.DM_B[is][iw1_lo][iw2_lo]; - - double *psi2p = psi2; - double *psi2p_end = psi2 + atom2->nw; - - for (; psi2p < psi2p_end; - ++iw2_lo, ++psi2p, ++DMp_B) - { - if ( iw1_lo > iw2_lo) - { - // ++iw2_lo; - continue; - } - // for diago part, the charge density be accumulated once. - // for off-diago part, the charge density be accumulated twice. - // (easy to understand, right? because we only calculate half - // of the matrix). - - // double tmp = v1*psir_ylm[ib][ia2][iw2]*DMp[0]; - double tmp1=(phase*DMp_B[0]).real(); - double tmp2=tmp1*v1*psi2p[0]; - - if (iw1_logamma_charge(); + omp_destroy_lock(&lock); + timer::tick("Gint_Gamma","cal_rho",'F'); return ne; } -// this subroutine lies in the heart of LCAO algorithms. -// so it should be done very efficiently, very carefully. -// I might repeat again to emphasize this: need to optimize -// this code very efficiently, very carefully. double Gint_Gamma::gamma_charge(void) // Peize Lin update OpenMP 2020.09.28 { TITLE("Gint_Gamma","gamma_charge"); timer::tick("Gint_Gamma","gamma_charge",'I'); double sum = 0.0;//LiuXh 2016-01-10 + if(max_size) { const int mkl_threads = mkl_get_max_threads(); - mkl_set_num_threads(1); + mkl_set_num_threads(std::max(1,mkl_threads/GridT.nbx)); // Peize Lin update 2021.01.20 #pragma omp parallel { - //ofstream ofs("gint_gamma_rho_"+TO_STRING(MY_RANK)+"_"+TO_STRING(omp_get_thread_num())); - //ofs<<"@/t"<<__LINE__<grid_index = (k-nbz_start) + j * nbz + i * nby * nbz; const int grid_index_thread = (k-nbz_start) + j * nbz + i * nby * nbz; // get the value: how many atoms has orbital value on this grid. @@ -795,20 +393,14 @@ double Gint_Gamma::gamma_charge(void) // Peize Lin update OpenMP 2020.09.28 const int size = GridT.how_many_atoms[ grid_index_thread ]; if(size==0) continue; this->setVindex(ncyz, ibx, jby, kbz, vindex); - // cal_psir_ylm(size, this->grid_index, delta_r, phi, mt, dr, distance, pointer, ylma, colidx, block_iw, bsize, psir_ylm); - timer::tick("Gint_Gamma","rho_psir_ylm",'J'); - //cal_psir_ylm(size, this->grid_index, delta_r, distance, ylma, this->cal_psir_ylm_rho(size, grid_index_thread, delta_r, distance, ylma, at, block_index, block_iw, block_size, cal_flag, psir_ylm); - timer::tick("Gint_Gamma","rho_psir_ylm",'J'); - // cal_band_rho(size, LD_pool, block_iw, block_size, block_index, psir_ylm, psir_DM, psir_DM_pool, vindex); - timer::tick("Gint_Gamma","cal_band_rho",'J'); + cal_band_rho(size, LD_pool, block_iw, block_size, block_index, cal_flag, psir_ylm, psir_DM, psir_DM_pool, vindex); - timer::tick("Gint_Gamma","cal_band_rho",'J'); }// k }// j }// i @@ -835,14 +427,17 @@ double Gint_Gamma::gamma_charge(void) // Peize Lin update OpenMP 2020.09.28 } // end of #pragma omp parallel for(int is=0; issave_atoms_on_grid(gt); - assert(bfid.Ready_A_of_Atom==1); - this->gamma_S_T_AP(type, gt); -} - -// this subroutine lies in the heart of LCAO algorithms. -// so it should be done very efficiently, very carefully. -// I might repeat again to emphasize this: need to optimize -// this code very efficiently, very carefully. -void Gint_Gamma::gamma_S_T_AP(char type, const Grid_Technique >) -{ - TITLE("Grid_Integral","gamma_S_T_AP"); - timer::tick("Gint_Gamma","gamma_S_T_AP"); - - cout << " calculate " << type << endl; - - //get cartesian lattice vectors, in bohr// - double latvec1[3],latvec2[3],latvec3[3]; - latvec1[0]=ucell.latvec.e11*ucell.lat0; - latvec1[1]=ucell.latvec.e12*ucell.lat0; - latvec1[2]=ucell.latvec.e13*ucell.lat0; - latvec2[0]=ucell.latvec.e21*ucell.lat0; - latvec2[1]=ucell.latvec.e22*ucell.lat0; - latvec2[2]=ucell.latvec.e23*ucell.lat0; - latvec3[0]=ucell.latvec.e31*ucell.lat0; - latvec3[1]=ucell.latvec.e32*ucell.lat0; - latvec3[2]=ucell.latvec.e33*ucell.lat0; - - // it's a uniform grid to save orbital values, so the delta_r is a constant. - const double delta_r = ORB.dr_uniform; - const Numerical_Orbital_Lm* pointer; - double mt[3]={0,0,0}; - double A_atom1[3]={0,0,0}; - double A_atom2[3]={0,0,0}; - double A2_ms_A1[3]={0,0,0}; //used to store A2-A1// - //----------------------------------------------------------- - //temporary matrixes of S, T, A*P and A*A. lgd is the number of related orbitals// - complex ** GridS; //for S matrix// - complex ** Grid_T; //for T matrix// - complex ** GridAP; //for A*P matrix// - complex ** GridAA; //for A*A matrix// - bool perform_gint = true; - const int lgd_now = gt.lgd; - if(lgd_now > 0) - { - GridS = new complex* [lgd_now]; - Grid_T = new complex* [lgd_now]; - GridAP = new complex* [lgd_now]; - GridAA = new complex* [lgd_now]; - for (int i=0; i [lgd_now]; - Grid_T[i] = new complex [lgd_now]; - GridAP[i] = new complex [lgd_now]; - GridAA[i] = new complex [lgd_now]; - ZEROS(GridS[i], lgd_now); - ZEROS(Grid_T[i], lgd_now); - ZEROS(GridAP[i], lgd_now); - ZEROS(GridAA[i], lgd_now); - } - Memory::record("Gint_Gamma","Grid_STAP",4*2*lgd_now*lgd_now,"double"); - } - else if(lgd_now <= 0) - { - perform_gint = false; - } - //----------------------------------------------------------- - - //some arrays// - double*** dr; // vectors between atom and grid: [bxyz, maxsize, 3] - double** distance; // distance between atom and grid: [bxyz, maxsize] - double*** psir_ylm; //value of wave functions// - double*** dphix; //derivatives of wave functions// - double*** dphiy; - double*** dphiz; - bool** cal_flag; //use this to decide whether the distance is larger than cutoff// - - if(max_size!=0) - { - dr = new double**[pw.bxyz]; - distance = new double*[pw.bxyz]; - psir_ylm = new double**[pw.bxyz]; - dphix = new double**[pw.bxyz]; - dphiy = new double**[pw.bxyz]; - dphiz = new double**[pw.bxyz]; - cal_flag = new bool*[pw.bxyz]; - for(int i=0; i rly; - vector> grly; - - //arrays to store the vector potential A and position r, updated at 2012-01-05// - double **Aldr3 = new double *[pw.bxyz]; // bxyz*3// - double **Rbxyz = new double *[pw.bxyz]; // bxyz*3// - double *AAdr = new double [pw.bxyz]; // bxyz// - ZEROS(AAdr, pw.bxyz); - for(int i=0;igrid_index = (k-nbz_start) + j * nbz + i * nby * nbz; - const int size = gt.how_many_atoms[ this->grid_index ]; - if(size==0)continue; - - //get pre-information about adjacent atoms// - for (int id=0; idiq[id] = static_cast(position); - this->x0[id] = position - static_cast(iq[id]); - this->x1[id] = 1.0 - x0[id]; - this->x2[id] = 2.0 - x0[id]; - this->x3[id] = 3.0 - x0[id]; - this->x12[id] = x1[id]*x2[id] / 6.0; - this->x03[id] = x0[id]*x3[id] / 2.0; - - double tmp, dtmp; - for (int iw=0; iw< atom->nw; iw++) - { - if ( atom->iw2_new[iw] ) - { - pointer = &ORB.Phi[it].PhiLN( - atom->iw2l[iw], - atom->iw2n[iw]); - - if ( iq[id] >= pointer->nr_uniform-4) - { - tmp = dtmp = 0.0; - } - else - { - tmp = x12[id]*(pointer->psi_uniform[iq[id]]*x3[id] - +pointer->psi_uniform[iq[id]+3]*x0[id]) - + x03[id]*(pointer->psi_uniform[iq[id]+1]*x2[id] - -pointer->psi_uniform[iq[id]+2]*x1[id]); - - dtmp = x12[id]*(pointer->dpsi_uniform[iq[id]]*x3[id] - +pointer->dpsi_uniform[iq[id]+3]*x0[id]) - + x03[id]*(pointer->dpsi_uniform[iq[id]+1]*x2[id] - -pointer->dpsi_uniform[iq[id]+2]*x1[id]); - - } - }//new l is used. - - int ll = atom->iw2l[iw]; - int idx_lm = atom->iw2_ylm[iw]; - - //special case for distance[id] -> 0 - //Problems Remained - //You have to add this two lines - double rr = distance[ib][id]; - if (rr < 1e-9) - { - if (ll == 0) - { - psir_ylm[ib][id][iw] = tmp * rly[idx_lm]; - dphix[ib][id][iw] = dphiy[ib][id][iw] = dphiz[ib][id][iw] = 0.0; - } - else - { - pointer = &ORB.Phi[it]. - PhiLN(atom->iw2l[iw], atom->iw2n[iw]); - - double Zty = pointer->zty; - psir_ylm[ib][id][iw] = Zty * rly[idx_lm]; - dphix[ib][id][iw] = Zty * grly[idx_lm][0]; - dphiy[ib][id][iw] = Zty * grly[idx_lm][1]; - dphiz[ib][id][iw] = Zty * grly[idx_lm][2]; - } - } - else - { - double rl; - if(ll==0) - { - rl = 1.0; - } - else if(ll==1) - { - rl = rr; - } - else - { - rl = pow(rr, ll); - } - - psir_ylm[ib][id][iw] = tmp * rly[idx_lm] / rl; - - double tmpdphi_rly = (dtmp - tmp * ll / rr) / rl * rly[idx_lm] / rr; - double tmprl = tmp/rl; - - dphix[ib][id][iw] = tmpdphi_rly * dr[ib][id][0] + tmprl * grly[idx_lm][0]; - dphiy[ib][id][iw] = tmpdphi_rly * dr[ib][id][1] + tmprl * grly[idx_lm][1]; - dphiz[ib][id][iw] = tmpdphi_rly * dr[ib][id][2] + tmprl * grly[idx_lm][2]; - } - } - }// ib - }//!id //finish loop of calc pre-info for each adjacent atom - - //get information about the vector potential A, and position r// - int index=0; - double rA[3]={0,0,0}; - for(int ii=0; ii phase=0; //the phase for overlap// - phase=bfid.cal_phase(A2_ms_A1,Rbxyz[ib],-1); - - int iw1_lo = gt.trace_lo[start1]; - - //cycle for the orbitals of atom1// - for (int iw=0; iw< atom1->nw; ++iw, ++psi1, - ++dphi1x,++dphi1y,++dphi1z) - { - complex* pS = &GridS[iw1_lo][iw2_lo]; - complex* pT = &Grid_T[iw1_lo][iw2_lo]; - complex* pAP = &GridAP[iw1_lo][iw2_lo]; - complex* pAA = &GridAA[iw1_lo][iw2_lo]; - - double* psi2= &psir_ylm[ib][ia2][0]; - double* dphi2x = dphix[ib][ia2]; - double* dphi2y = dphiy[ib][ia2]; - double* dphi2z = dphiz[ib][ia2]; - - double* phi2_end = psi2 + atom2->nw; - - //cycle for the orbitals of atom2// - for (; psi2 *tmpS = new complex[NLOCAL]; - complex *tmpT = new complex[NLOCAL]; - complex *tmpAP = new complex[NLOCAL]; - complex *tmpAA = new complex[NLOCAL]; - - const int mu = gt.trace_lo[i]; - if(mu >=0) - { - for (int j=0; j=0) - { - tmpS[j] = GridS[mu][nu]; - tmpT[j] = Grid_T[mu][nu]; - tmpAP[j] = GridAP[mu][nu]; - tmpAA[j] = GridAA[mu][nu]; - } - } - } - - Parallel_Reduce::reduce_complex_double_pool( tmpS, NLOCAL); - Parallel_Reduce::reduce_complex_double_pool( tmpT, NLOCAL); - Parallel_Reduce::reduce_complex_double_pool( tmpAP, NLOCAL); - Parallel_Reduce::reduce_complex_double_pool( tmpAA, NLOCAL); - - for (int j=0; j SS=tmpS[j]; - complex TT=tmpT[j]; - complex AP=tmpAP[j]; - complex AA=tmpAA[j]; - - if(type=='S') - { - LM.set_HSk(i,j,SS,'S'); - } - else if(type=='T') - { - LM.set_HSk(i,j,TT,'T'); - } - else if(type=='A') - { - LM.set_HSk(i,j,AP,'T'); - LM.set_HSk(i,j,AA,'T'); - } - } - - delete[] tmpS; - delete[] tmpT; - delete[] tmpAP; - delete[] tmpAA; - } - - //delete GridS, Grid_T, GridAP, GridAA// - if(gt.lgd>0) - { - for(int i=0; i Gint_Gamma::Add_S(complex phase, double psi1, double psi2) -{ - return (phase*psi1*psi2*this->vfactor); -} - -//sub-function for calculating T// -complex Gint_Gamma::Add_T(complex phase, double A1[3], double A2[3], - double dphi1x,double dphi1y,double dphi1z, - double dphi2x,double dphi2y,double dphi2z, - double psi1, double psi2) -{ - double part1 = 2.0/bfid.c/bfid.c*(A1[0]*A2[0]+A1[1]*A2[1]+A1[2]*A2[2])*psi1*psi2; - double part2 = dphi1x*dphi2x+dphi1y*dphi2y+dphi1z*dphi2z; - double part3 = -1.414213562/bfid.c*(A2[0]*dphi1x+A2[1]*dphi1y+A2[2]*dphi1z)*psi2; - double part4 = 1.414213562/bfid.c*(A1[0]*dphi2x+A1[1]*dphi2y+A1[2]*dphi2z)*psi1; - complex sum1= complex ((part1+part2),(part3+part4)); - complex sum = phase*sum1*this->vfactor; - return(sum); -} - -//sub-function for calculating A*P// -complex Gint_Gamma::Add_AP(complex phase, double Aldr3[3], double A2[3], - double dphi2x,double dphi2y,double dphi2z, - double psi1, double psi2) -{ - double part1 = (Aldr3[0]*dphi2x+Aldr3[1]*dphi2y+Aldr3[2]*dphi2z); - double part2 = -1.414213562/bfid.c*(Aldr3[0]*A2[0]+Aldr3[1]*A2[1]+Aldr3[2]*A2[2])*psi2; - complex sum1 = complex (part1,part2); - complex sum2 = -2.0*1.414213562/bfid.c*phase*sum1*psi1*this->vfactor; - complex sum = (complex (0,1.0))*sum2; - return(sum); -} - -//sub-function for calculating A*A// -complex Gint_Gamma::Add_AA(complex phase, double AAdr, - double psi1, double psi2) -{ - return (phase*AAdr*2.0/bfid.c/bfid.c*psi1*psi2*this->vfactor); -} diff --git a/ABACUS.develop/source/src_lcao/gint_gamma_vl.cpp b/ABACUS.develop/source/src_lcao/gint_gamma_vl.cpp index 2819827719..207aa636bb 100644 --- a/ABACUS.develop/source/src_lcao/gint_gamma_vl.cpp +++ b/ABACUS.develop/source/src_lcao/gint_gamma_vl.cpp @@ -1,9 +1,11 @@ #include "gint_gamma.h" #include "grid_technique.h" -#include "lcao_orbitals.h" +#include "ORB_read.h" #include "../src_pw/global.h" #include "src_global/blas_connector.h" #include + +#include "global_fp.h" // mohan add 2021-01-30 //#include extern "C" @@ -13,16 +15,24 @@ extern "C" void Cblacs_pcoord(int icontxt, int pnum, int *prow, int *pcol); } -inline void setVindex(const int ncyz, const int ibx, const int jby, const int kbz, - int* vindex) +// here vindex refers to local potentials +inline void setVindex + (const int ncyz, + const int ibx, + const int jby, + const int kbz, + int* vindex) { int bindex=0; // z is the fastest, + + // ipart can be obtained by using a previously stored array for(int ii=0; iinw; + colidx[id+1]=colidx[id]+atom->nw; + // meshball_positions should be the bigcell position in meshball // to the center of meshball. // calculated in cartesian coordinates @@ -67,6 +94,7 @@ inline void cal_psir_ylm(int size, int grid_index, double delta_r, double phi, mt[1]=GridT.meshball_positions[imcell][1] - GridT.tau_in_bigcell[iat][1]; mt[2]=GridT.meshball_positions[imcell][2] - GridT.tau_in_bigcell[iat][2]; + // number of grids in each big cell (bxyz) for(int ib=0; ib ORB.Phi[it].getRcut()) if(distance[ib][id] > (ORB.Phi[it].getRcut()- 1.0e-15)) { @@ -95,10 +126,10 @@ inline void cal_psir_ylm(int size, int grid_index, double delta_r, double phi, dr[ib][id][1] / distance[ib][id], dr[ib][id][2] / distance[ib][id], ylma); - // these parameters are about interpolation - // because once we know the distance from atom to grid point, - // we can get the parameters we need to do interpolation and - // store them first!! these can save a lot of effort. + // these parameters are related to interpolation + // because once the distance from atom to grid point is known, + // we can obtain the parameters for interpolation and + // store them first! these operations save lots of efforts. const double position=distance[ib][id] / delta_r; int ip; double dx, dx2, dx3; @@ -241,61 +272,92 @@ inline int localIndex(int globalIndex, int nblk, int nprocs, int& myproc) return int(globalIndex/(nblk*nprocs))*nblk+globalIndex%nblk; } -inline int setBufferParameter(MPI_Comm comm_2D, int blacs_ctxt, int nblk, - int& sender_index_size, int*& sender_local_index, - int*& sender_size_process, int*& sender_displacement_process, - int& sender_size, double*& sender_buffer, - int& receiver_index_size, int*& receiver_global_index, - int*& receiver_size_process, int*& receiver_displacement_process, - int& receiver_size, double*& receiver_buffer) + +//------------------------------------------------------------------ +// mohan add notes: 2021-03-11 +// this subroutine is used to transform data from grid integrals +// to 2D-block distribution +// s stands for 'sender' and r stands for 'receiver' +//------------------------------------------------------------------ +inline int setBufferParameter( + MPI_Comm comm_2D, + int blacs_ctxt, + int nblk, + int& s_index_siz, + int*& s_local_index, + int*& s_siz_pro, + int*& s_dis_pro, + int& s_siz, + double*& s_buffer, + int& r_index_siz, + int*& r_global_index, + int*& r_siz_pro, + int*& r_dis_pro, + int& r_siz, + double*& r_buffer) { + //----------------------------------------- // setup blacs parameters + //----------------------------------------- int nprows, npcols, nprocs; int myprow, mypcol, myproc; + Cblacs_gridinfo(blacs_ctxt, &nprows, &npcols, &myprow, &mypcol); + + //----------------------------------------- + // set index of current proor: myproc + // set number of total proors: nprocs + //----------------------------------------- Cblacs_pinfo(&myproc, &nprocs); - // init data arrays - delete[] sender_size_process; - sender_size_process=new int[nprocs]; - delete[] sender_displacement_process; - sender_displacement_process=new int[nprocs]; - - delete[] receiver_size_process; - receiver_size_process=new int[nprocs]; - delete[] receiver_displacement_process; - receiver_displacement_process=new int[nprocs]; - - // build the local index to be sent to other process (sender_local_index), - // the global index to be received from other process (receiver_global_index), - // the send/receive size/displacement for data exchange by MPI_Alltoall - sender_index_size=GridT.lgd*GridT.lgd*2; - delete[] sender_local_index; - sender_local_index=new int[sender_index_size]; - - int *sender_global_index=new int[sender_index_size]; + // initialize data arrays + delete[] s_siz_pro; + delete[] s_dis_pro; + delete[] r_siz_pro; + delete[] r_dis_pro; + + s_siz_pro=new int[nprocs]; + s_dis_pro=new int[nprocs]; + r_siz_pro=new int[nprocs]; + r_dis_pro=new int[nprocs]; + + //--------------------------------------------------------------------- + // build the local index to be sent to other pro (s_local_index), + // the global index to be received from other pro (r_global_index), + // the send/receive siz/dis for data exchange by MPI_Alltoall + //--------------------------------------------------------------------- + s_index_siz=GridT.lgd*GridT.lgd*2; + + delete[] s_local_index; + s_local_index=new int[s_index_siz]; + + int *s_global_index=new int[s_index_siz]; int pos=0; - sender_size_process[0]=0; + s_siz_pro[0]=0; for(int iproc=0; iproc= NLOCAL) continue; + for(int icol=0, gcol=0; gcol= NLOCAL) continue; - // if(pos<0 || pos >= current_sender_index_size) + // if(pos<0 || pos >= current_s_index_siz) // { // OUT(ofs_running, "pos error, pos:", pos); // OUT(ofs_running, "irow:", irow); @@ -305,58 +367,61 @@ inline int setBufferParameter(MPI_Comm comm_2D, int blacs_ctxt, int nblk, // OUT(ofs_running, "lrow:", grow); // OUT(ofs_running, "lcol:", gcol); // } - sender_global_index[pos]=grow; - sender_global_index[pos+1]=gcol; - sender_local_index[pos]=lrow; - sender_local_index[pos+1]=lcol; + s_global_index[pos]=grow; + s_global_index[pos+1]=gcol; + s_local_index[pos]=lrow; + s_local_index[pos+1]=lcol; pos+=2; } } - sender_size_process[iproc]=pos-sender_displacement_process[iproc]; + s_siz_pro[iproc]=pos-s_dis_pro[iproc]; } - MPI_Alltoall(sender_size_process, 1, MPI_INT, - receiver_size_process, 1, MPI_INT, comm_2D); + MPI_Alltoall(s_siz_pro, 1, MPI_INT, + r_siz_pro, 1, MPI_INT, comm_2D); - receiver_index_size=receiver_size_process[0]; - receiver_displacement_process[0]=0; + r_index_siz=r_siz_pro[0]; + r_dis_pro[0]=0; for(int i=1; ijob=cal_local; this->vlocal=vlocal_in; this->save_atoms_on_grid(GridT); - if(BFIELD) - { - this->gamma_vlocal_B(); - } - else - { - this->gamma_vlocal(); - } + + this->gamma_vlocal(); omp_destroy_lock(&lock); @@ -383,483 +442,15 @@ void Gint_Gamma::cal_vlocal( return; } -#include "bfield.h" -void Gint_Gamma::gamma_vlocal_B(void) -{ - TITLE("Grid_Integral","gamma_vlocal_B"); - - //get cartesian lattice vectors, in bohr// - double latvec1[3],latvec2[3],latvec3[3]; - latvec1[0]=ucell.latvec.e11*ucell.lat0; - latvec1[1]=ucell.latvec.e12*ucell.lat0; - latvec1[2]=ucell.latvec.e13*ucell.lat0; - latvec2[0]=ucell.latvec.e21*ucell.lat0; - latvec2[1]=ucell.latvec.e22*ucell.lat0; - latvec2[2]=ucell.latvec.e23*ucell.lat0; - latvec3[0]=ucell.latvec.e31*ucell.lat0; - latvec3[1]=ucell.latvec.e32*ucell.lat0; - latvec3[2]=ucell.latvec.e33*ucell.lat0; - - - complex** GridVlocal = nullptr; - bool perform_gint=true; - - const int lgd_now=GridT.lgd; - if(lgd_now > 0) - { - GridVlocal=new complex*[lgd_now]; - for (int i=0; i[lgd_now]; - ZEROS(GridVlocal[i], lgd_now); - } - Memory::record("Gint_Gamma","GridVlocal",2*lgd_now*lgd_now,"double"); - } - else if(lgd_now <= 0) - { - perform_gint=false; - } - // it's a uniform grid to save orbital values, so the delta_r is a constant. - const double delta_r=ORB.dr_uniform; - const Numerical_Orbital_Lm* pointer = nullptr; - - // allocate 1 - int nnnmax=0; - for(int T=0; Tgrid_index=(k-nbz_start) + j * nbz + i * nby * nbz; - - // get the value: how many atoms has orbital value on this grid. - const int size=GridT.how_many_atoms[ this->grid_index ]; - if(size==0) continue; - - // (1) initialized the phi * Ylm. - for (int id=0; id GridT.orbital_rmax) continue; - // Ylm::get_ylm_real(this->nnn[it], this->dr[id], ylma); - if (distance[ib][id] < 1.0E-9) distance[ib][id] += 1.0E-9; - - Ylm::sph_harm ( ucell.atoms[it].nwl, - dr[ib][id][0] / distance[ib][id], - dr[ib][id][1] / distance[ib][id], - dr[ib][id][2] / distance[ib][id], - ylma); - // these parameters are about interpolation - // because once we know the distance from atom to grid point, - // we can get the parameters we need to do interpolation and - // store them first!! these can save a lot of effort. - const double position=distance[ib][id] / delta_r; - /* - this->iq[id]=static_cast(position); - this->x0[id]=position - static_cast(iq[id]); - this->x1[id]=1.0 - x0[id]; - this->x2[id]=2.0 - x0[id]; - this->x3[id]=3.0 - x0[id]; - this->x12[id]=x1[id]*x2[id] / 6.0; - this->x03[id]=x0[id]*x3[id] / 2.0; - */ - int ip; - double dx, dx2, dx3; - double c1, c2, c3, c4; - - ip=static_cast(position); - dx=position - ip; - dx2=dx * dx; - dx3=dx2 * dx; - - c3=3.0*dx2-2.0*dx3; - c1=1.0-c3; - c2=(dx-2.0*dx2+dx3)*delta_r; - c4=(dx3-dx2)*delta_r; - - // int ip=this->iq[id]; - // double A=ip+1.0-position/delta_r; - // double B=1.0-A; - // double coef1=(A*A*A-A)/6.0*delta_r*delta_r; - // double coef2=(B*B*B-B)/6.0*delta_r*delta_r; - Atom* atom1=&ucell.atoms[it]; - for (int iw=0; iw< atom1->nw; iw++) - { - if ( atom1->iw2_new[iw] ) - { - pointer=&ORB.Phi[it].PhiLN( - atom1->iw2l[iw], - atom1->iw2n[iw]); - phi=c1*pointer->psi_uniform[ip]+c2*pointer->dpsi_uniform[ip] - + c3*pointer->psi_uniform[ip+1] + c4*pointer->dpsi_uniform[ip+1]; - } - psir_ylm[ib][id][iw]=phi * ylma[atom1->iw2_ylm[iw]]; - //psir_ylm[ib][id][iw]=1;//for test - } - }// end ib - }// end id - - - int bindex=0; - // z is the fastest, - for(int ii=0; iivlocal[vindex[ib]] * this->vfactor; - // vldr3[ib]=1.0e-5; // for test - // vldr3[bindex]=this->vfactor; // for checking overlap S - } - - //get the information about position r of grid// - int index=0; - double rA[3]={0,0,0}; - for(int ii=0; iinnn[T1], this->dr[ia1], this->ylm1); - - // attention! assume all rcut are same for this atom type now. - //if (distance[ia1] > ORB.Phi[T1].getRcut())continue; - - //for(int ia2=ia1; ia2 T1, we done all elements, for T2 == T1, - // we done about half. - if (T2 >= T1) - { - Atom *atom2=&ucell.atoms[T2]; - const int I2=ucell.iat2ia[ GridT.which_atom[mcell_index2]]; - const int start2=ucell.itiaiw2iwt(T2, I2, 0); - - for (int ib=0; ib phase=0; //the phase for overlap// - phase=bfid.cal_phase(A2_ms_A1,Rbxyz[ib],-1); - - // how many orbitals in this type: SZ or DZP or TZP... - for (int iw=0; iw< atom1->nw; iw++, ++iw1_lo) - { - v1=psi1[iw] * vldr3[ib]; - int iw2_lo=GridT.trace_lo[start2]; - complex* result=&GridVlocal[iw1_lo][iw2_lo]; - double* psi2p=psi2; - double* psi2p_end=psi2p + atom2->nw; - for (;psi2p iw2_lo) - { - continue; - } - result[0] += phase*v1*psi2p[0]; - - // note 1 - // why I increase both iw2_lo and iw2_all: - // Because iw2_lo is used to save element. - // And iw2_all is used to judge if we need - // to calculate the element according to - // "iw1_all > iw2_all" condition. - // note 2 - // in fact we don't need to do this. - // because GridVlocal is a symmetry matrix. - // whatever the division is , the order - // is same between iw2_lo,iw1_lo and - // iw2_all, iw1_all - }//iw2 - }//iw - }// cal_flag - }//ib - }//T - }// ia2 - }// ia1 - - }// k - }// j - }// i - - delete[] vindex; - delete[] ylma; - delete[] vldr3; - - if(max_size!=0) - { - for(int i=0; i* tmp=new complex[NLOCAL]; - for (int i=0; i= 0) - { - for (int j=0; j=0) - { - if (mu <= nu) - { - tmp[j]=GridVlocal[mu][nu]; - } - else - { - //------------------------------- - // origin: - // tmp[i]=GridVlocal[nu][mu]; - // mohan fix bug - // 2011-01-13 - //------------------------------- - tmp[j] =conj(GridVlocal[nu][mu]); - //zhiyuan changed 2012-01-13, the v local matrix is Hermite// - } - } - } - } - Parallel_Reduce::reduce_complex_double_pool( tmp, NLOCAL); - for (int j=0; j0) - { - for(int i=0; i0 && lgd_now>0) { + //------------------------------------------------------ + // + //------------------------------------------------------ double *GridVlocal_pool=new double [lgd_now*lgd_now]; ZEROS(GridVlocal_pool, lgd_now*lgd_now); + double **GridVlocal_thread=new double*[lgd_now]; for (int i=0; igrid_index=(k-nbz_start) + j * nbz + i * nby * nbz; int grid_index_thread=(k-nbz_start) + j * nbz + i * nby * nbz; - // get the value: how many atoms has orbital value on this grid. - //const int size=GridT.how_many_atoms[ this->grid_index ]; + //------------------------------------------------------------------ + // get the value: how many atoms are involved in this grid (big cell) + //------------------------------------------------------------------ const int size=GridT.how_many_atoms[ grid_index_thread ]; + if(size==0) continue; + + //------------------------------------------------------------------ + // kbz can be obtained using a previously stored array + //------------------------------------------------------------------ const int kbz=k*pw.bz-pw.nczp_start; + + //------------------------------------------------------------------ + // set the index for obtaining local potentials + //------------------------------------------------------------------ setVindex(ncyz, ibx, jby, kbz, vindex); - //OUT(ofs_running, "vindex was set"); + + //------------------------------------------------------------------ // extract the local potentials. + //------------------------------------------------------------------ for(int ib=0; ibvlocal[vindex[ib]] * this->vfactor; } - //OUT(ofs_running, "vldr3 was inited"); - //timer::tick("Gint_Gamma","cal_vlocal_psir",'J'); - //cal_psir_ylm(size, this->grid_index, delta_r, phi, mt, dr, distance, pointer, ylma, colidx, block_iw, bsize, psir_ylm, cal_flag); - cal_psir_ylm(size, grid_index_thread, delta_r, phi, mt, dr, distance, pointer, ylma, colidx, block_iw, bsize, psir_ylm, cal_flag); - //cal_psir_ylm(size, this->grid_index, delta_r, phi, mt, dr, distance, pointer, ylma, colidx, block_iw, bsize, psir_ylm, i, j, k); - //timer::tick("Gint_Gamma","cal_vlocal_psir",'J'); - //OUT(ofs_running, "psir_ylm was calculated"); - //timer::tick("Gint_Gamma","cal_meshball_vlocal",'J'); - //cal_meshball_vlocal(size, LD_pool, block_iw, bsize, colidx, vldr3, psir_ylm, psir_vlbr3, vindex, lgd_now, GridVlocal); - cal_meshball_vlocal(size, LD_pool, block_iw, bsize, colidx, cal_flag, vldr3, psir_ylm, psir_vlbr3, vindex, lgd_now, GridVlocal_thread); - //timer::tick("Gint_Gamma","cal_meshball_vlocal",'J'); - //OUT(ofs_running, "GridVlocal was calculated"); + //------------------------------------------------------------------ + // compute atomic basis phi(r) with both radial and angular parts + //------------------------------------------------------------------ + cal_psir_ylm(size, grid_index_thread, delta_r, phi, mt, dr, + distance, pointer, ylma, colidx, block_iw, bsize, psir_ylm, cal_flag); + + //------------------------------------------------------------------ + // calculate + //------------------------------------------------------------------ + cal_meshball_vlocal(size, LD_pool, block_iw, bsize, colidx, cal_flag, + vldr3, psir_ylm, psir_vlbr3, vindex, lgd_now, GridVlocal_thread); }// k }// j }// i @@ -995,8 +637,12 @@ void Gint_Gamma::gamma_vlocal(void) // Peize Lin update OpenMP 2020.09.27 #pragma omp critical(cal_vl) { for (int i=0; i=NLOCAL||g_row<0 || g_row>=NLOCAL) @@ -1099,13 +744,14 @@ void Gint_Gamma::gamma_vlocal(void) // Peize Lin update OpenMP 2020.09.27 // } LM.set_HSgamma(g_row,g_col,ParaO.receiver_buffer[i/2],'L'); } - // OUT(ofs_running, "received vlocal data are put in to H") + timer::tick("Gint_Gamma","distri_vl_value",'K'); timer::tick("Gint_Gamma","distri_vl",'K'); - //OUT(ofs_running, "reduce all vlocal ok,"); for (int i=0; ijob = cal_local; - this->vlocal = vlocal_in; - this->save_atoms_on_grid(GridT); - this->gamma_vna(); - - timer::tick("Gint_Gamma","cal_vna"); - return; -} - -void Gint_Gamma::gamma_vna(void) -{ - TITLE("Grid_Integral","gamma_vna"); - - double** GridVlocal; - bool perform_gint = true; - - const int lgd_now = GridT.lgd; - if(lgd_now > 0) - { - GridVlocal = new double*[lgd_now]; - for (int i=0; igrid_index = (k-nbz_start) + j * nbz + i * nby * nbz; - - // get the value: how many atoms has orbital value on this grid. - const int size = GridT.how_many_atoms[ this->grid_index ]; - if(size==0) continue; - - ZEROS(vna3d, pw.bxyz); - - // (1) initialized the phi * Ylm. - for (int id=0; id ORB.Vna[it].rcut && - distance[ib][id] > ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=false; - continue; - } - - //if(distance[id] > GridT.orbital_rmax) continue; - // Ylm::get_ylm_real(this->nnn[it], this->dr[id], ylma); - if (distance[ib][id] < 1.0E-9) distance[ib][id] += 1.0E-9; - - Ylm::sph_harm ( ucell.atoms[it].nwl, - dr[ib][id][0] / distance[ib][id], - dr[ib][id][1] / distance[ib][id], - dr[ib][id][2] / distance[ib][id], - ylma); - // these parameters are about interpolation - // because once we know the distance from atom to grid point, - // we can get the parameters we need to do interpolation and - // store them first!! these can save a lot of effort. - const double position = distance[ib][id] / delta_r; - this->iq[id] = static_cast(position); - this->x0[id] = position - static_cast(iq[id]); - this->x1[id] = 1.0 - x0[id]; - this->x2[id] = 2.0 - x0[id]; - this->x3[id] = 3.0 - x0[id]; - this->x12[id] = x1[id]*x2[id] / 6.0; - this->x03[id] = x0[id]*x3[id] / 2.0; - - int ip; - double dx, dx2, dx3; - double c1, c2, c3, c4; - - ip = static_cast(position); - dx = position - ip; - dx2 = dx * dx; - dx3 = dx2 * dx; - - c3 = 3.0*dx2-2.0*dx3; - c1 = 1.0-c3; - c2 = (dx-2.0*dx2+dx3)*delta_r; - c4 = (dx3-dx2)*delta_r; - - double ccc; - if(distance[ib][id] <= ORB.Vna[it].rcut) - { - ccc = (x12[id]*(ORB.Vna[it].vna_u[iq[id]]*x3[id] - +ORB.Vna[it].vna_u[iq[id]+3]*x0[id]) - + x03[id]*(ORB.Vna[it].vna_u[iq[id]+1]*x2[id] - -ORB.Vna[it].vna_u[iq[id]+2]*x1[id])); - // cout << " ccc=" << ccc << endl; - // int ok; cin >> ok; - vna3d[ib] += ccc; - } - -// if(i==0 && j==7 &&k==13 && ib==6) -// { -// ofs << " dis=" << distance[ib][id] << " ccc=" << ccc << endl; -// ofs << " 1=" << ORB.Vna[it].vna_u[iq[id]] << endl; -// ofs << " 2=" << ORB.Vna[it].vna_u[iq[id]+1] << endl; -// ofs << " 3=" << ORB.Vna[it].vna_u[iq[id]+2] << endl; -// ofs << " 4=" << ORB.Vna[it].vna_u[iq[id]+3] << endl; -// } - - // int ip = this->iq[id]; - // double A = ip+1.0-position/delta_r; - // double B = 1.0-A; - // double coef1 = (A*A*A-A)/6.0*delta_r*delta_r; - // double coef2 = (B*B*B-B)/6.0*delta_r*delta_r; - - - if(distance[ib][id] <= ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=true; - } - else - { - cal_flag[ib][id]=false; - continue; - } - - - Atom* atom1 = &ucell.atoms[it]; - for (int iw=0; iw< atom1->nw; iw++) - { - if ( atom1->iw2_new[iw] ) - { - pointer = &ORB.Phi[it].PhiLN( - atom1->iw2l[iw], - atom1->iw2n[iw]); - phi = c1*pointer->psi_uniform[ip]+c2*pointer->dpsi_uniform[ip] - + c3*pointer->psi_uniform[ip+1]+c4*pointer->dpsi_uniform[ip+1]; - } - psir_ylm[ib][id][iw] = phi * ylma[atom1->iw2_ylm[iw]]; - //psir_ylm[ib][id][iw] = 1;//for test - } - }// end ib - }// end id - - - int bindex = 0; - // z is the fastest, - for(int ii=0; iivlocal[vindex[ib]] * this->vfactor; - //vna3d[ib] = ib; // tmp by mohan - vldr3[ib] = vna3d[ib] * this->vfactor; - -// if(i==0 && j==7 &&k==13 &&ib==6) -// { -// ofs << " i=" << i << " j=" << j << " k=" << k << " ib=" << ib << " vna3d=" << vna3d[ib] << endl; -// for(int id=0; idvfactor; // for checking overlap S - } - - for (int ia1=0; ia1nnn[T1], this->dr[ia1], this->ylm1); - - // attention! assume all rcut are same for this atom type now. - //if (distance[ia1] > ORB.Phi[T1].getRcut())continue; - - //for(int ia2=ia1; ia2 T1, we done all elements, for T2 == T1, - // we done about half. - if (T2 >= T1) - { - Atom *atom2 = &ucell.atoms[T2]; - const int I2 = ucell.iat2ia[ GridT.which_atom[mcell_index2]]; - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - for (int ib=0; ibnw; iw++, ++iw1_lo) - { - v1=psi1[iw] * vldr3[ib]; - int iw2_lo = GridT.trace_lo[start2]; - double* result = &GridVlocal[iw1_lo][iw2_lo]; - double* psi2p = psi2; - double* psi2p_end = psi2p + atom2->nw; - for (;psi2p iw2_lo) - { - continue; - } - - result[0] += v1 * psi2p[0]; - - // note 1 - // why I increase both iw2_lo and iw2_all: - // Because iw2_lo is used to save element. - // And iw2_all is used to judge if we need - // to calculate the element according to - // "iw1_all > iw2_all" condition. - // note 2 - // in fact we don't need to do this. - // because GridVlocal is a symmetry matrix. - // whatever the division is , the order - // is same between iw2_lo,iw1_lo and - // iw2_all, iw1_all - }//iw2 - }//iw - }// cal_flag - }//ib - }//T - }// ia2 - }// ia1 - - }// k - }// j - }// i - - delete[] vindex; - delete[] ylma; - delete[] vldr3; - delete[] vna3d; - - if(max_size!=0) - { - for(int i=0; i= 0) - { - for (int j=0; j=0) - { - if (mu <= nu) - { - tmp[j] = GridVlocal[mu][nu]; - } - else - { - //------------------------------- - // origin: - // tmp[i] = GridVlocal[nu][mu]; - // mohan fix bug - // 2011-01-13 - //------------------------------- - tmp[j] = GridVlocal[nu][mu]; - } - } - } - } - Parallel_Reduce::reduce_double_pool( tmp, NLOCAL ); - for (int j=0; j(tmp[j],0.0),'L'); - } - else - { - LM.set_HSgamma(i,j,tmp[j],'L'); - } - } - delete[] tmp; - } - } - - // mohan update 2010-09-07 - if(GridT.lgd>0) - { - for(int i=0; isave_atoms_on_grid(gt); - this->gamma_vna_d(gt, matrix_type); - - timer::tick("Gint_Gamma","cal_vna_d"); - return; -} - -void Gint_Gamma::gamma_vna_d(const Grid_Technique >, const char &matrix_type) -{ - TITLE("Grid_Integral","gamma_vna_d"); -// cout << " gamma_vna_d ()" << endl; - - double** GridVlocal; - bool perform_gint = true; - - const int lgd_now = gt.lgd; - if(lgd_now > 0) - { - GridVlocal = new double*[lgd_now]; - for (int i=0; igrid_index = (k-nbz_start) + j * nbz + i * nby * nbz; - - // get the value: how many atoms has orbital value on this grid. - const int size = gt.how_many_atoms[ this->grid_index ]; - if(size==0) continue; - - ZEROS(vna3d, bxyz); - - // (1) initialized the phi * Ylm. - for (int id=0; id ORB.Vna[it].rcut && - distance[ib][id] > ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=false; - continue; - } - - //if(distance[id] > gt.orbital_rmax) continue; - // Ylm::get_ylm_real(this->nnn[it], this->dr[id], ylma); - if (distance[ib][id] < 1.0E-9) distance[ib][id] += 1.0E-9; - - Ylm::sph_harm ( ucell.atoms[it].nwl, - dr[ib][id][0] / distance[ib][id], - dr[ib][id][1] / distance[ib][id], - dr[ib][id][2] / distance[ib][id], - ylma); - // these parameters are about interpolation - // because once we know the distance from atom to grid point, - // we can get the parameters we need to do interpolation and - // store them first!! these can save a lot of effort. - const double position = distance[ib][id] / delta_r; - this->iq[id] = static_cast(position); - this->x0[id] = position - static_cast(iq[id]); - this->x1[id] = 1.0 - x0[id]; - this->x2[id] = 2.0 - x0[id]; - this->x3[id] = 3.0 - x0[id]; - this->x12[id] = x1[id]*x2[id] / 6.0; - this->x03[id] = x0[id]*x3[id] / 2.0; - - int ip; - double dx, dx2, dx3; - double c1, c2, c3, c4; - - ip = static_cast(position); - dx = position - ip; - dx2 = dx * dx; - dx3 = dx2 * dx; - - c3 = 3.0*dx2-2.0*dx3; - c1 = 1.0-c3; - c2 = (dx-2.0*dx2+dx3)*delta_r; - c4 = (dx3-dx2)*delta_r; - - double ccc; - if(distance[ib][id] <= ORB.Vna[it].rcut) - { - ccc = (x12[id]*(ORB.Vna[it].vna_u[iq[id]]*x3[id] - +ORB.Vna[it].vna_u[iq[id]+3]*x0[id]) - + x03[id]*(ORB.Vna[it].vna_u[iq[id]+1]*x2[id] - -ORB.Vna[it].vna_u[iq[id]+2]*x1[id])); - // cout << " ccc=" << ccc << endl; - // int ok; cin >> ok; - vna3d[ib] += ccc; - } - -// if(i==0 && j==7 &&k==13 && ib==6) -// { -// ofs << " dis=" << distance[ib][id] << " ccc=" << ccc << endl; -// ofs << " 1=" << ORB.Vna[it].vna_u[iq[id]] << endl; -// ofs << " 2=" << ORB.Vna[it].vna_u[iq[id]+1] << endl; -// ofs << " 3=" << ORB.Vna[it].vna_u[iq[id]+2] << endl; -// ofs << " 4=" << ORB.Vna[it].vna_u[iq[id]+3] << endl; -// } - - // int ip = this->iq[id]; - // double A = ip+1.0-position/delta_r; - // double B = 1.0-A; - // double coef1 = (A*A*A-A)/6.0*delta_r*delta_r; - // double coef2 = (B*B*B-B)/6.0*delta_r*delta_r; - - - if(distance[ib][id] <= ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=true; - } - else - { - cal_flag[ib][id]=false; - continue; - } - - - Atom* atom1 = &ucell.atoms[it]; - for (int iw=0; iw< atom1->nw; iw++) - { - if ( atom1->iw2_new[iw] ) - { - pointer = &ORB.Phi[it].PhiLN( - atom1->iw2l[iw], - atom1->iw2n[iw]); - phi = c1*pointer->psi_uniform[ip]+c2*pointer->dpsi_uniform[ip] - + c3*pointer->psi_uniform[ip+1]+c4*pointer->dpsi_uniform[ip+1]; - } - psir_ylm[ib][id][iw] = phi * ylma[atom1->iw2_ylm[iw]]; - //psir_ylm[ib][id][iw] = 1;//for test - } - }// end ib - }// end id - - - // extract the local potentials. - for(int ib=0; ibvfactor; - -// if(i==0 && j==7 &&k==13 && ib==6) -// { -// ofs << " i=" << i << " j=" << j << " k=" << k << " ib=" << ib << " vna3d=" << vna3d[ib] << endl; -// for(int id=0; idvfactor; // for checking overlap S - } - - for (int ia1=0; ia1nnn[T1], this->dr[ia1], this->ylm1); - - // attention! assume all rcut are same for this atom type now. - //if (distance[ia1] > ORB.Phi[T1].getRcut())continue; - - //for(int ia2=ia1; ia2 T1, we done all elements, for T2 == T1, - // we done about half. - if (T2 >= T1) - { - Atom *atom2 = &ucell.atoms[T2]; - const int I2 = ucell.iat2ia[ gt.which_atom[mcell_index2]]; - const int start2 = ucell.itiaiw2iwt(T2, I2, 0); - - for (int ib=0; ibnw; iw++, ++iw1_lo) - { - v1=psi1[iw] * vldr3[ib]; - int iw2_lo = gt.trace_lo[start2]; - double* result = &GridVlocal[iw1_lo][iw2_lo]; - double* psi2p = psi2; - double* psi2p_end = psi2p + atom2->nw; - for (;psi2p iw2_lo) - { - continue; - } - - result[0] += v1 * psi2p[0]; - - // note 1 - // why I increase both iw2_lo and iw2_all: - // Because iw2_lo is used to save element. - // And iw2_all is used to judge if we need - // to calculate the element according to - // "iw1_all > iw2_all" condition. - // note 2 - // in fact we don't need to do this. - // because GridVlocal is a symmetry matrix. - // whatever the division is , the order - // is same between iw2_lo,iw1_lo and - // iw2_all, iw1_all - }//iw2 - }//iw - }// cal_flag - }//ib - }//T - }// ia2 - }// ia1 - - }// k - }// j - }// i - - delete[] ylma; - delete[] vldr3; - delete[] vna3d; - - if(max_size!=0) - { - for(int i=0; i= 0) - { - for (int j=0; j=0) - { - if (mu <= nu) - { - tmp[j] = GridVlocal[mu][nu]; - } - else - { - //------------------------------- - // origin: - // tmp[i] = GridVlocal[nu][mu]; - // mohan fix bug - // 2011-01-13 - //------------------------------- - tmp[j] = GridVlocal[nu][mu]; - } - } - } - } - Parallel_Reduce::reduce_double_pool( tmp, NLOCAL ); - for (int j=0; j(tmp[j],0.0),matrix_type); - } - else - { - //change L to T, which is two different matrix. - // L : local - // T : T, Vnl, Vna - LM.set_HSgamma(i,j,tmp[j],matrix_type); - } - } - delete[] tmp; - } - } - - // mohan update 2010-09-07 - if(gt.lgd>0) - { - for(int i=0; i0 ); - - if(this->pvnapR_alloc_flag) - { - WARNING_QUIT("Gint_k::allocate_pvnapR","pvnapR has been allocated!"); - } - - assert(LNNR.nnrg!=0); //mohan update 2012-07-01 - this->pvnapR_reduced = new double[LNNR.nnrg]; - ZEROS( pvnapR_reduced, LNNR.nnrg); - - double mem = Memory::record("allocate_pvpR", "pvnapR_reduced", LNNR.nnrg , "double"); - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") ofs_running << " Memory of pvnapR : " << mem << " MB" << endl; - if( mem > 800 ) - { - ofs_warning << " memory for pvnapR = " << mem << endl; - ofs_warning << " which is larger than 800 MB ! " << endl; - WARNING_QUIT("Gint_k","allocate_pvpR"); - } - - this->pvnapR_alloc_flag = true; - - return; -} - - void Gint_k::allocate_pvpR(void) { @@ -88,9 +52,14 @@ void Gint_k::allocate_pvpR(void) this->pvpR_reduced[is] = new double[LNNR.nnrg]; ZEROS( pvpR_reduced[is], LNNR.nnrg); } + double mem = Memory::record("allocate_pvpR", "pvpR_reduced", LNNR.nnrg * NSPIN , "double"); - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") ofs_running << " Memory of pvpR : " << mem << " MB" << endl; + + if(OUT_LEVEL != "m") + { + ofs_running << " Memory of pvpR : " << mem << " MB" << endl; + } + if( mem > 800 ) { ofs_warning << " memory for pvpR = " << mem << endl; @@ -103,8 +72,12 @@ void Gint_k::allocate_pvpR(void) { double mem = Memory::record("allocate_pvpR", "pvpR", GridT.lgd * GridT.nutot * GridT.lgd * GridT.nutot , "double"); - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") ofs_running << " Memory of pvpR : " << mem << " MB" << endl; + + if(OUT_LEVEL != "m") + { + ofs_running << " Memory of pvpR : " << mem << " MB" << endl; + } + if( mem > 800 ) { ofs_warning << " memory for pvpR = " << mem << endl; @@ -112,10 +85,6 @@ void Gint_k::allocate_pvpR(void) WARNING_QUIT("Gint_k","allocate_pvpR"); } - // output information - //cout << " MEMORY OF pvpR : " << Memory::record("allocate_pvpR", "pvpR", GridT.lgd * GridT.nutot - //* GridT.lgd * GridT.nutot , "cdouble") << " MB" << endl; - //---------------------------------------------- // allocate the complex matrix !! // nutot : total number of unitcells involved. @@ -123,8 +92,10 @@ void Gint_k::allocate_pvpR(void) // 3*3*3 = 27. //---------------------------------------------- const int LDIM=GridT.lgd*GridT.nutot; + this->pvpR_pool = new double[LDIM*LDIM]; ZEROS(pvpR_pool, LDIM*LDIM); + this->pvpR = new double*[LDIM]; for(int i=0; i matrix has not been allocated yet!"); - } - - delete[] pvnapR_reduced; - - this->pvnapR_alloc_flag = false; - return; -} - - - void Gint_k::destroy_pvpR(void) { @@ -185,7 +139,7 @@ void Gint_k::destroy_pvpR(void) // fold the * DM(R) to // calculate the force. -void Gint_k::folding_force(double** fvl_dphi, +void Gint_k::folding_force(matrix& fvl_dphi, double* pvdpx, double* pvdpy, double* pvdpz) { TITLE("Gint_k","folding_force"); @@ -328,9 +282,9 @@ void Gint_k::folding_force(double** fvl_dphi, } const int iat = ucell.iwt2iat[i]; const int index = 3*j; - fvl_dphi[iat][0] += 2.0*tmp[index]; - fvl_dphi[iat][1] += 2.0*tmp[index+1]; - fvl_dphi[iat][2] += 2.0*tmp[index+2]; + fvl_dphi(iat,0) += 2.0*tmp[index]; + fvl_dphi(iat,1) += 2.0*tmp[index+1]; + fvl_dphi(iat,2) += 2.0*tmp[index+2]; } } delete[] tmp; @@ -357,7 +311,7 @@ void Gint_k::folding_force(double** fvl_dphi, // fold the * DM(R) to // calculate the stress. -void Gint_k::folding_stress(double** fvl_dphi, double svl_dphi[][3], +void Gint_k::folding_stress(matrix& fvl_dphi, matrix& svl_dphi, double* pvdpx, double* pvdpy, double* pvdpz, double* pvdp11, double* pvdp22, double* pvdp33,double* pvdp12, double* pvdp13, double* pvdp23) { @@ -557,16 +511,16 @@ void Gint_k::folding_stress(double** fvl_dphi, double svl_dphi[][3], const int iat = ucell.iwt2iat[i]; const int index = 3*j; const int index1 = 6*j; - fvl_dphi[iat][0] += 2.0*tmp[index]; - fvl_dphi[iat][1] += 2.0*tmp[index+1]; - fvl_dphi[iat][2] += 2.0*tmp[index+2]; - - svl_dphi[0][0] -= 2.0*tmp1[index1]; - svl_dphi[1][1] -= 2.0*tmp1[index1+1]; - svl_dphi[2][2] -= 2.0*tmp1[index1+2]; - svl_dphi[0][1] -= 2.0*tmp1[index1+3]; - svl_dphi[0][2] -= 2.0*tmp1[index1+4]; - svl_dphi[1][2] -= 2.0*tmp1[index1+5]; + fvl_dphi(iat,0) += 2.0*tmp[index]; + fvl_dphi(iat,1) += 2.0*tmp[index+1]; + fvl_dphi(iat,2) += 2.0*tmp[index+2]; + + svl_dphi(0,0) -= 2.0*tmp1[index1]; + svl_dphi(1,1) -= 2.0*tmp1[index1+1]; + svl_dphi(2,2) -= 2.0*tmp1[index1+2]; + svl_dphi(0,1) -= 2.0*tmp1[index1+3]; + svl_dphi(0,2) -= 2.0*tmp1[index1+4]; + svl_dphi(1,2) -= 2.0*tmp1[index1+5]; } } delete[] tmp; @@ -623,13 +577,12 @@ void Gint_k::folding_vl_k(const int &ik) // // 2. why the folding of vlocal is different from folding of // < phi_0i | T+Vnl | phi_Rj > ? - // Because the (i,j) is different for T+Vna and Vlocal+Vna + // Because the (i,j) is different for T+Vnl and Vlocal // The first part is due to 2D division of H and S matrix, // The second part is due to real space division. // // here we construct a temporary matrix to store the - // matrix element < phi_0 | Vlocal+Vna | phi_R > - // Vna appears when we use it. + // matrix element < phi_0 | Vlocal | phi_R > //################################################################# this->ik_now = ik; this->pvp = new complex*[GridT.lgd]; @@ -749,25 +702,12 @@ void Gint_k::folding_vl_k(const int &ik) int* iw2_lo = &GridT.trace_lo[start2]; int* iw2_end = iw2_lo + atom2->nw; - if(VNA) + // get the (R) Hamiltonian. + double *vijR = &pvpR_reduced[0][ixxx]; + // complex *vijR_soc = &pvpR_reduced_soc[ixxx]; + for(; iw2_lo(R) Hamiltonian. - double *vijR = &pvpR_reduced[0][ixxx]; - double *vijR2 = &pvnapR_reduced[ixxx]; - for(; iw2_lo(R) Hamiltonian. - double *vijR = &pvpR_reduced[0][ixxx]; -// complex *vijR_soc = &pvpR_reduced_soc[ixxx]; - for(; iw2_lonw; ++lgd; @@ -888,21 +828,6 @@ void Gint_k::folding_vl_k_nc(const int &ik) WARNING_QUIT("Gint_k::destroy_pvpR","pvpR hasnot been allocated yet!"); } - //####################### EXPLAIN ################################# - // 1. what is GridT.lgd ? - // GridT.lgd is the number of orbitals in each processor according - // to the division of real space FFT grid. - // - // 2. why the folding of vlocal is different from folding of - // < phi_0i | T+Vnl | phi_Rj > ? - // Because the (i,j) is different for T+Vna and Vlocal+Vna - // The first part is due to 2D division of H and S matrix, - // The second part is due to real space division. - // - // here we construct a temporary matrix to store the - // matrix element < phi_0 | Vlocal+Vna | phi_R > - // Vna appears when we use it. - //################################################################# this->ik_now = ik; // complex** pvp_nc[4]; for(int spin=0;spin<4;spin++) @@ -1027,28 +952,20 @@ void Gint_k::folding_vl_k_nc(const int &ik) int iw2_lo = GridT.trace_lo[start2]/NPOL; int iw2_end = iw2_lo + atom2->nw; - if(VNA) + // get the (R) Hamiltonian. +// complex *vijR_soc = &pvpR_reduced_soc[ixxx]; + double *vijR[4]; + for(int spin = 0;spin<4;spin++) { - // get the (R) Hamiltonian. - double *vijR = &pvpR_reduced[0][ixxx]; - double *vijR2 = &pvnapR_reduced[ixxx]; - for(; iw2_lo(R) Hamiltonian. -// complex *vijR_soc = &pvpR_reduced_soc[ixxx]; - double *vijR[4]; - for(int spin = 0;spin<4;spin++) vijR[spin] = &pvpR_reduced[spin][ixxx]; - for(; iw2_lonw; ++lgd; @@ -1314,360 +1231,7 @@ void Gint_k::set_ijk_atom(const int &grid_index, const int &size, } -void Gint_k::set_ijk_atom_vna(const int &grid_index, const int &size, - double*** psir_ylm, double*** dr, bool** cal_flag, - double** distance, double* ylma, const double &delta_r, - const Grid_Technique >, double* vna3d) -{ - const Numerical_Orbital_Lm* pointer; - double mt[3]; - for (int id=0; id= - if(distance[ib][id] >= ORB.Vna[it].rcut && - distance[ib][id] >= ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=false; -// ofs_running << " ibbb=" << ib << " iddd=" << id << " cal_flag=" << cal_flag[ib][id] << endl; - continue; - } - - if (distance[ib][id] < 1.0E-9) distance[ib][id] += 1.0E-9; - - - - // these parameters are about interpolation - // because once we know the distance from atom to grid point, - // we can get the parameters we need to do interpolation and - // store them first!! these can save a lot of effort. - const double position = distance[ib][id] / delta_r; - - const int iq = static_cast(position); - const double x0 = position - static_cast(iq); - const double x1 = 1.0 - x0; - const double x2 = 2.0 - x0; - const double x3 = 3.0 - x0; - const double x12 = x1*x2/6.0; - const double x03 = x0*x3/2.0; - - - - // mohan add 2012-06-13 - double ccc; - if(distance[ib][id] <= ORB.Vna[it].rcut) - { - ccc = (x12*(ORB.Vna[it].vna_u[iq]*x3 - +ORB.Vna[it].vna_u[iq+3]*x0) - + x03*(ORB.Vna[it].vna_u[iq+1]*x2 - -ORB.Vna[it].vna_u[iq+2]*x1)); - vna3d[ib] += ccc; - } - - - //if(distance[ib][id] <= ORB.Phi[it].getRcut()) - // mohan fix bug 2012-06-27 - // if use '<=', there may be atoms out of plan. - if(distance[ib][id] < ORB.Phi[it].getRcut()) - { - cal_flag[ib][id]=true; -// ofs_running << " ibbb=" << ib << " iddd=" << id << " cal_flag=" << cal_flag[ib][id] << endl; - } - else - { - cal_flag[ib][id]=false; -// ofs_running << " ibbb=" << ib << " iddd=" << id << " cal_flag=" << cal_flag[ib][id] << endl; - continue; - } - - - - Ylm::sph_harm ( ucell.atoms[it].nwl, - dr[ib][id][0] / distance[ib][id], - dr[ib][id][1] / distance[ib][id], - dr[ib][id][2] / distance[ib][id], - ylma); - - - - - - const int ip = static_cast(position); - - const double dx = position - ip; - const double dx2 = dx * dx; - const double dx3 = dx2 * dx; - - const double c3 = 3.0*dx2-2.0*dx3; - const double c1 = 1.0-c3; - const double c2 = (dx-2.0*dx2+dx3)*delta_r; - const double c4 = (dx3-dx2)*delta_r; - - - - - - - - Atom* atom1 = &ucell.atoms[it]; - double tmp=0.0;//mohan fix bug 2011-05-04 - for (int iw=0; iw< atom1->nw; iw++) - { - if ( atom1->iw2_new[iw] ) - { - pointer = &ORB.Phi[it].PhiLN( - atom1->iw2l[iw], - atom1->iw2n[iw]); - - // Efficient!! to get the orbital value at this point. - tmp = c1*pointer->psi_uniform[ip] - + c2*pointer->dpsi_uniform[ip] - + c3*pointer->psi_uniform[ip+1] - + c4*pointer->dpsi_uniform[ip+1]; - } - psir_ylm[ib][id][iw] = tmp * ylma[atom1->iw2_ylm[iw]]; -// psir_ylm[ib][id][iw] = 1.0; - }// end iw. - }//end ib - }// int id - - - - /* - if(grid_index==0) - { - for(int id=0; id matrix element. - void allocate_pvnapR(void); - + // reset the spin. + void reset_spin(const int &spin_now); - // destroy the temporary matrix element. - void destroy_pvnapR(void); + // get the spin. + int get_spin(void)const{return spin_now;} - //>>>>>>>>>>>>>>>>>>>> - // drive routine - //>>>>>>>>>>>>>>>>>>>> + //------------------------------------------------------ + // in gint_k_vl.cpp + //------------------------------------------------------ // calculate the matrix elements of Hamiltonian matrix, // < phi_0 | Vl + Vh + Vxc | phi_R> or if the Vna is used, // < phi_0 | delta_Vh + Vxc | phi_R>. void cal_vlocal_k(const double* vrs1, const Grid_Technique >, const int spin=0); + //------------------------------------------------------ + // in gint_k.cpp + //------------------------------------------------------ void cal_vlocal_R(const int current_spin); //LiuXh add 2019-07-15 - //>>>>>>>>>>>>>>>>>>>> - // drive routine - //>>>>>>>>>>>>>>>>>>>> - // calculate < phi_0i | Vna | phi_Rj > on regular FFT grid. - void cal_vna(const double* vrs1, const Grid_Technique >); - - - //>>>>>>>>>>>>>>>>>>>> - // drive routine - //>>>>>>>>>>>>>>>>>>>> - // calculate < phi_0i | Vna | phi_Rj > on dense grid. - void cal_vna_d(const Grid_Technique >, const double* vrs1, const char &matrix_type); - - // folding the < phi_0 | V | phi_R> matrix to // // V is (Vl + Vh + Vxc) if no Vna is used, @@ -63,136 +51,81 @@ class Gint_k : public Gint_k_init void folding_vl_k(const int &ik); void folding_vl_k_nc(const int &ik);//zhengdy-soc - // folding the < dphi_0 | V | phi_R> matrix to // < dphi_0i | V | phi_0j> - void folding_force(double** fvl_dphi, + void folding_force(matrix& fvl_dphi, double* pvdpx, double* pvdpy, double* pvdpz);//mohan add 2012-1-6 // folding the < dphi_0 | V * R_beta | phi_R> matrix // < dphi_0i | V | phi_0j> - void folding_stress(double** fvl_dphi, double svl_dphi[][3], + void folding_stress(matrix& fvl_dphi, matrix& svl_dphi, double* pvdpx, double* pvdpy, double* pvdpz, - double* pvdp11, double* pvdp22, double* pvdp33, double* pvdp12, double* pvdp13, double* pvdp23);//zhengdy add 2016-10-18 - + double* pvdp11, double* pvdp22, double* pvdp33, + double* pvdp12, double* pvdp13, double* pvdp23);//zhengdy add 2016-10-18 - //>>>>>>>>>>>>>>>>>>>> - // drive routine - //>>>>>>>>>>>>>>>>>>>> + //------------------------------------------------------ + // in gint_k_rho.cpp + //------------------------------------------------------ // calculate the charge density. void calculate_charge(void); - - //>>>>>>>>>>>>>>>>>>>> - // drive routine - //>>>>>>>>>>>>>>>>>>>> + //------------------------------------------------------ + // in gint_k_fvl.cpp + //------------------------------------------------------ // calculate the force (many k-points). - void fvl_k_RealSpace(double** fvl_dphi, const double* vl);//mohan add 2011-06-19 - void svl_k_RealSpace(double** fvl_dphi, double svl_dphi[][3], const double* vl);//zhengdy add 2016-10-18 - - - //>>>>>>>>>>>>>>>>>>>> - // drive routine - //>>>>>>>>>>>>>>>>>>>> - // calculate the force due to Vna (neutral potential), - // The Vna is in 1D numerical form. - void fvna_k_RealSpace(const Grid_Technique >, double** fvna_dphi); - void svna_k_RealSpace(const Grid_Technique >, double** fvna_dphi, double svna_dphi[][3]); - - - // reset the spin. - void reset_spin(const int &spin_now); - - - // get the spin. - int get_spin(void)const{return spin_now;} - + void fvl_k_RealSpace(matrix& fvl_dphi, const double* vl);//mohan add 2011-06-19 + void svl_k_RealSpace(matrix& fvl_dphi, matrix& svl_dphi, const double* vl);//zhengdy add 2016-10-18 private: - - //============================ + //------------------------------------------------------ + // in gint_k.cpp + //------------------------------------------------------ // set the orbital info - //============================ // set the orbital/Ylm information on each real space grid. void set_ijk_atom(const int &grid_index, const int &size, double*** psir_ylm, double*** dr, bool** cal_flag, double** distance, double* ylma, const double &delta_r); - - //============================ - // set the orbital info - //============================ - // set the orbital/Ylm/Vna information on each real space grid. - void set_ijk_atom_vna(const int &grid_index, const int &size, - double*** psir_ylm, double*** dr, bool** cal_flag, - double** distance, double* ylma, const double &delta_r, - const Grid_Technique >, double* vna3d); - - - //============================ - // set the orbital info - //============================ - // set the derivative/Ylm information on each real space grid. - void set_ijk_atom_force(const int &grid_index, const int &size, - double*** psir_ylm, double*** dr, bool** cal_flag, - double** distance, double* ylma, const double &delta_r, - double*** dphi_x, double ***dphi_y, double*** dphi_z); - - - //============================ - // set the orbital info - //============================ - // set the derivative information on dense real space grid. - void set_ijk_atom_fvna(const int &grid_index, const int &size, - double*** psir_ylm, double*** dr, bool** cal_flag, - double** distance, double* ylma, const double &delta_r, - double*** dphi_x, double*** dphi_y, double*** dphi_z, - const Grid_Technique >, double* vna3d); - - - //---------------------------- - // detail grid integration: - //---------------------------- + //------------------------------------------------------ + // in gint_k_vl.cpp + //------------------------------------------------------ // evaluate the matrix element < phi0 | V | phiR> and store them in // a full H matrix. void evaluate_pvpR_full(const int &grid_index, const int &size, double*** psir_ylm, bool** cal_flag, double* vldr3); - - //---------------------------- - // detail grid integration: - //---------------------------- - // reduced means the H storage take the advance of adjacent atoms. - void evaluate_pvpR_reduced(double* pvpR, const int &grid_index, const int &size, const int &i, const int &j, const int &k, - double*** psir_ylm, bool** cal_flag, double* vldr3, double** distance, const Grid_Technique >); - - - //---------------------------- - // detail grid integration: - //---------------------------- // reduced means the H storage take the advance of adjacent atoms. - void evaluate_pvnapR_reduced(const int &grid_index, const int &size, const int &i, const int &j, const int &k, - double*** psir_ylm, bool** cal_flag, double* vldr3, double** distance); - - - //---------------------------- - // detail grid integration: - //---------------------------- + void evaluate_pvpR_reduced(double* pvpR, const int &grid_index, + const int &size, const int &i, const int &j, const int &k, + double*** psir_ylm, bool** cal_flag, double* vldr3, + double** distance, const Grid_Technique >); + + //------------------------------------------------------ + // in gint_k_rho.cpp + //------------------------------------------------------ // evaluate the to get the charge density. void evaluate_pDMp(const int &grid_index, const int &size, bool** cal_flag, double*** psir_ylm, int* vindex); + //------------------------------------------------------ + // in gint_k_fvl.cpp + //------------------------------------------------------ + // set the orbital info + // set the derivative/Ylm information on each real space grid. + void set_ijk_atom_force(const int &grid_index, const int &size, + double*** psir_ylm, double*** dr, bool** cal_flag, + double** distance, double* ylma, const double &delta_r, + double*** dphi_x, double ***dphi_y, double*** dphi_z); - //---------------------------- - // detail grid integration: - //---------------------------- // evaluate the force due to local potential. void evaluate_vl_force(const int &grid_index, const int &size, const int &i, const int &j, const int &k, double*** psir_ylm, bool** cal_flag, double* vldr3, double** distance, double*** dphi_x, double*** dphi_y, double*** dphi_z, double* pvdpx, double* pvdpy, double* pvdpz, const Grid_Technique >); + + // evaluate the stresses due to local potential void evaluate_vl_stress(const int &grid_index, const int &size, const int &i, const int &j, const int &k, double*** psir_ylm, bool** cal_flag, double* vldr3, double** distance, double*** dphi_x, double*** dphi_y, double*** dphi_z, @@ -220,15 +153,6 @@ class Gint_k : public Gint_k_init // save the < phi_0i | V | phi_Rj > in sparse H matrix. double** pvpR_reduced; - - //---------------------------- - // key variable - //---------------------------- - // dimension: [LNNR.nnrg] - // save the < phi_0i | V | phi_Rj > in sparse H matrix. - double* pvnapR_reduced; - - //---------------------------- // key variable //---------------------------- @@ -243,7 +167,6 @@ class Gint_k : public Gint_k_init // just pointer. bool pvpR_alloc_flag; - bool pvnapR_alloc_flag; bool reduced; }; diff --git a/ABACUS.develop/source/src_lcao/gint_k_fvl.cpp b/ABACUS.develop/source/src_lcao/gint_k_fvl.cpp index b6478c4d40..110f8da139 100644 --- a/ABACUS.develop/source/src_lcao/gint_k_fvl.cpp +++ b/ABACUS.develop/source/src_lcao/gint_k_fvl.cpp @@ -1,8 +1,10 @@ #include "gint_k.h" #include "../src_pw/global.h" -#include "lcao_nnr.h" +#include "LCAO_nnr.h" -void Gint_k::fvl_k_RealSpace(double** fvl_dphi, const double *vl) +#include "global_fp.h" // mohan add 2021-01-30 + +void Gint_k::fvl_k_RealSpace(matrix& fvl_dphi, const double *vl) { TITLE("Gint_k","cal_force"); timer::tick("Gint_k","cal_force"); @@ -197,7 +199,7 @@ void Gint_k::fvl_k_RealSpace(double** fvl_dphi, const double *vl) return; } -void Gint_k::svl_k_RealSpace(double** fvl_dphi, double svl_dphi[][3], const double *vl) +void Gint_k::svl_k_RealSpace(matrix& fvl_dphi, matrix& svl_dphi, const double *vl) { TITLE("Gint_k","cal_stress"); timer::tick("Gint_k","cal_stress"); @@ -593,12 +595,12 @@ void Gint_k::evaluate_vl_stress(const int &grid_index, const int &size, const in vpsir1 = iw1px[0] * vldr3[ib]; vpsir2 = iw1py[0] * vldr3[ib]; vpsir3 = iw1pz[0] * vldr3[ib]; - vpsir11 = iw1px[0] * vldr3[ib] * dr[ib][ia1][0]; - vpsir22 = iw1py[0] * vldr3[ib] * dr[ib][ia1][1]; - vpsir33 = iw1pz[0] * vldr3[ib] * dr[ib][ia1][2]; - vpsir12 = iw1px[0] * vldr3[ib] * dr[ib][ia1][1]; - vpsir13 = iw1px[0] * vldr3[ib] * dr[ib][ia1][2]; - vpsir23 = iw1py[0] * vldr3[ib] * dr[ib][ia1][2]; + vpsir11 = iw1px[0] * vldr3[ib] * dr[ib][ia1][0]; + vpsir22 = iw1py[0] * vldr3[ib] * dr[ib][ia1][1]; + vpsir33 = iw1pz[0] * vldr3[ib] * dr[ib][ia1][2]; + vpsir12 = iw1px[0] * vldr3[ib] * dr[ib][ia1][1]; + vpsir13 = iw1px[0] * vldr3[ib] * dr[ib][ia1][2]; + vpsir23 = iw1py[0] * vldr3[ib] * dr[ib][ia1][2]; ++iw1px; ++iw1py; ++iw1pz; @@ -624,12 +626,12 @@ void Gint_k::evaluate_vl_stress(const int &grid_index, const int &size, const in pvp2 = &pvdpy[iww]; pvp3 = &pvdpz[iww]; - pvp11 = &pvdp11[iww]; //zhengdy add 2017/3/28 - pvp22 = &pvdp22[iww]; - pvp33 = &pvdp33[iww]; - pvp12 = &pvdp12[iww]; - pvp13 = &pvdp13[iww]; - pvp23 = &pvdp23[iww]; + pvp11 = &pvdp11[iww]; //zhengdy add 2017/3/28 + pvp22 = &pvdp22[iww]; + pvp33 = &pvdp33[iww]; + pvp12 = &pvdp12[iww]; + pvp13 = &pvdp13[iww]; + pvp23 = &pvdp23[iww]; //------------------------------------ // circle for wave functions of atom 2. //------------------------------------ @@ -655,15 +657,15 @@ void Gint_k::evaluate_vl_stress(const int &grid_index, const int &size, const in // bug here!!!!!!!!!!!!!!!!!!!!!!!!!!! // DM(R) * psi1(r) * v(r) * psi2_R(r) - pvp1[0] += dmR2[0] * vpsir1 * iw2p[0]; - pvp2[0] += dmR2[0] * vpsir2 * iw2p[0]; - pvp3[0] += dmR2[0] * vpsir3 * iw2p[0]; - pvp11[0] += dmR2[0] * vpsir11 * iw2p[0] ; - pvp22[0] += dmR2[0] * vpsir22 * iw2p[0] ; - pvp33[0] += dmR2[0] * vpsir33 * iw2p[0] ; - pvp12[0] += dmR2[0] * vpsir12 * iw2p[0] ; - pvp13[0] += dmR2[0] * vpsir13 * iw2p[0] ; - pvp23[0] += dmR2[0] * vpsir23 * iw2p[0] ; + pvp1[0] += dmR2[0] * vpsir1 * iw2p[0]; + pvp2[0] += dmR2[0] * vpsir2 * iw2p[0]; + pvp3[0] += dmR2[0] * vpsir3 * iw2p[0]; + pvp11[0] += dmR2[0] * vpsir11 * iw2p[0] ; + pvp22[0] += dmR2[0] * vpsir22 * iw2p[0] ; + pvp33[0] += dmR2[0] * vpsir33 * iw2p[0] ; + pvp12[0] += dmR2[0] * vpsir12 * iw2p[0] ; + pvp13[0] += dmR2[0] * vpsir13 * iw2p[0] ; + pvp23[0] += dmR2[0] * vpsir23 * iw2p[0] ; // pvp1[0] += vpsir1 * iw2p[0]; // pvp2[0] += vpsir2 * iw2p[0]; // pvp3[0] += vpsir3 * iw2p[0]; @@ -677,12 +679,12 @@ void Gint_k::evaluate_vl_stress(const int &grid_index, const int &size, const in ++pvp1; ++pvp2; ++pvp3; - ++pvp11; - ++pvp22; - ++pvp33; - ++pvp12; - ++pvp13; - ++pvp23; + ++pvp11; + ++pvp22; + ++pvp33; + ++pvp12; + ++pvp13; + ++pvp23; //density matrix ++dmR2; } diff --git a/ABACUS.develop/source/src_lcao/gint_k_fvna.cpp b/ABACUS.develop/source/src_lcao/gint_k_fvna.cpp deleted file mode 100644 index 86450042c8..0000000000 --- a/ABACUS.develop/source/src_lcao/gint_k_fvna.cpp +++ /dev/null @@ -1,512 +0,0 @@ -#include "gint_k.h" -#include "gint_gamma.h" -#include "grid_technique.h" -#include "lcao_orbitals.h" -#include "../src_pw/global.h" -#include "lcao_nnr.h" - -void Gint_k::fvna_k_RealSpace(const Grid_Technique >, double** fvna_dphi) -{ - TITLE("Gint_k","fvna_k_RealSpace"); - timer::tick("Gint_k","fvna_k_RealSpace",'i'); - - - if(!this->reduced) - { - WARNING_QUIT("Gint_k::fvna_k_RealSpace","The force with k can only with reduced H."); - } - - - int nnrg = LNNR.nnrg; - ofs_running << " LNNR.nnrg in fvna_k_RealSpace = " << LNNR.nnrg << endl; - assert(nnrg>=0); - - // just because to make thea arrys meaningful. - if(LNNR.nnrg == 0) - { - nnrg = 1; - } - - - // to store < phi | vlocal | dphi> - double* pvdpx = new double[nnrg]; - double* pvdpy = new double[nnrg]; - double* pvdpz = new double[nnrg]; - ZEROS(pvdpx, nnrg); - ZEROS(pvdpy, nnrg); - ZEROS(pvdpz, nnrg); - - - - // it's a uniform grid to save orbital values, so the delta_r is a constant. - double delta_r = ORB.dr_uniform; - // possible max atom number in real space grid. - const int max_size = gt.max_atom; - // how many meshcells in bigcell. - - const int bxyz = gt.bxyz; - const int bx = gt.bx; - const int by = gt.by; - const int bz = gt.bz; - - - double*** dr;// vectors between atom and grid: [bxyz, maxsize, 3] - double** distance; // distance between atom and grid: [bxyz, maxsize] - double*** psir_ylm; // psi(r-R) * Ylm(r-R) - bool** cal_flag; - double* ylma; - - double*** dphi_x; - double*** dphi_y; - double*** dphi_z; - - - - if(max_size!=0) - { - // save the small box information for a big box. - dr = new double**[bxyz]; - distance = new double*[bxyz]; - psir_ylm = new double**[bxyz]; - cal_flag = new bool*[bxyz]; - dphi_x = new double**[bxyz]; - dphi_y = new double**[bxyz]; - dphi_z = new double**[bxyz]; - - - // mohan fix bug 2011-05-02 - // possible number of atom configureation (l,m) - int nn = 0; - for(int it=0; it0) - { - ncxyz = pw.ncxyz * VNA * VNA * VNA; - } - else if(VNA==0) - { - ncxyz = pw.ncxyz; - } - const double dv = ucell.omega/(double)ncxyz; - - int vl_index=0; - - // array to store local potential for each small box in - // a big box. - double* vldr3 = new double[bxyz]; - double* vna3d = new double[bxyz]; - ZEROS(vldr3, bxyz); - - - - - for(int i=0; iset_ijk_atom_fvna(grid_index, size, - psir_ylm, dr, cal_flag, - distance, ylma, delta_r, - dphi_x, dphi_y, dphi_z, - gt, vna3d); - - - // for test, use original vl(G)->vl(r), - // remember to turn on the potential in force_lcao_k.cpp - -/* - int bindex = 0; - // z is the fastest, - for(int ii=0; iireduced) - { - this->evaluate_vl_force(grid_index, size,i,j,k, - psir_ylm, cal_flag, vldr3, distance, - dphi_x, dphi_y, dphi_z, - pvdpx, pvdpy, pvdpz, gt); - } - - }// int k - }// int j - } // int i - - delete[] vldr3; - delete[] vna3d; - - - if(max_size!=0) - { - for(int i=0; ifolding_force(fvna_dphi,pvdpx, pvdpy, pvdpz); - - - delete[] pvdpx; - delete[] pvdpy; - delete[] pvdpz; - - timer::tick("Gint_k","fvna_k_RealSpace",'i'); - return; -} - - - -void Gint_k::svna_k_RealSpace(const Grid_Technique >, double** fvna_dphi, double svna_dphi[][3]) -{ - TITLE("Gint_k","svna_k_RealSpace"); - timer::tick("Gint_k","svna_k_RealSpace",'i'); - - - if(!this->reduced) - { - WARNING_QUIT("Gint_k::svna_k_RealSpace","The stress with k can only with reduced H."); - } - - - int nnrg = LNNR.nnrg; - ofs_running << " LNNR.nnrg in svna_k_RealSpace = " << LNNR.nnrg << endl; - assert(nnrg>=0); - - // just because to make thea arrys meaningful. - if(LNNR.nnrg == 0) - { - nnrg = 1; - } - - - // to store < phi | vlocal | dphi> - double* pvdpx = new double[nnrg]; - double* pvdpy = new double[nnrg]; - double* pvdpz = new double[nnrg]; - ZEROS(pvdpx, nnrg); - ZEROS(pvdpy, nnrg); - ZEROS(pvdpz, nnrg); - double* pvdp11 = new double[nnrg]; - double* pvdp22 = new double[nnrg]; - double* pvdp33 = new double[nnrg]; - ZEROS(pvdp11, nnrg); - ZEROS(pvdp22, nnrg); - ZEROS(pvdp33, nnrg); - double* pvdp12 = new double[nnrg]; - double* pvdp13 = new double[nnrg]; - double* pvdp23 = new double[nnrg]; - ZEROS(pvdp12, nnrg); - ZEROS(pvdp13, nnrg); - ZEROS(pvdp23, nnrg); - - - // it's a uniform grid to save orbital values, so the delta_r is a constant. - double delta_r = ORB.dr_uniform; - // possible max atom number in real space grid. - const int max_size = gt.max_atom; - // how many meshcells in bigcell. - - const int bxyz = gt.bxyz; - const int bx = gt.bx; - const int by = gt.by; - const int bz = gt.bz; - - - double*** dr;// vectors between atom and grid: [bxyz, maxsize, 3] - double** distance; // distance between atom and grid: [bxyz, maxsize] - double*** psir_ylm; // psi(r-R) * Ylm(r-R) - bool** cal_flag; - double* ylma; - - double*** dphi_x; - double*** dphi_y; - double*** dphi_z; - - - - if(max_size!=0) - { - // save the small box information for a big box. - dr = new double**[bxyz]; - distance = new double*[bxyz]; - psir_ylm = new double**[bxyz]; - cal_flag = new bool*[bxyz]; - dphi_x = new double**[bxyz]; - dphi_y = new double**[bxyz]; - dphi_z = new double**[bxyz]; - - - // mohan fix bug 2011-05-02 - // possible number of atom configureation (l,m) - int nn = 0; - for(int it=0; it0) - { - ncxyz = pw.ncxyz * VNA * VNA * VNA; - } - else if(VNA==0) - { - ncxyz = pw.ncxyz; - } - const double dv = ucell.omega/(double)ncxyz; - - int vl_index=0; - - // array to store local potential for each small box in - // a big box. - double* vldr3 = new double[bxyz]; - double* vna3d = new double[bxyz]; - ZEROS(vldr3, bxyz); - - - - - for(int i=0; iset_ijk_atom_fvna(grid_index, size, - psir_ylm, dr, cal_flag, - distance, ylma, delta_r, - dphi_x, dphi_y, dphi_z, - gt, vna3d); - - - // for test, use original vl(G)->vl(r), - // remember to turn on the potential in force_lcao_k.cpp - -/* - int bindex = 0; - // z is the fastest, - for(int ii=0; iireduced) - { - this->evaluate_vl_stress(grid_index, size,i,j,k, - psir_ylm, cal_flag, vldr3, distance, - dphi_x, dphi_y, dphi_z, - pvdpx, pvdpy, pvdpz, - pvdp11, pvdp22, pvdp33,pvdp12, pvdp13, pvdp23, dr, gt); - } - - }// int k - }// int j - } // int i - - delete[] vldr3; - delete[] vna3d; - - - if(max_size!=0) - { - for(int i=0; ifolding_stress(fvna_dphi, svna_dphi, pvdpx, pvdpy, pvdpz, - pvdp11, pvdp22, pvdp33, pvdp12, pvdp13, pvdp23); - - - delete[] pvdpx; - delete[] pvdpy; - delete[] pvdpz; - delete[] pvdp11; - delete[] pvdp22; - delete[] pvdp33; - delete[] pvdp12; - delete[] pvdp13; - delete[] pvdp23; - - timer::tick("Gint_k","svna_k_RealSpace",'i'); - return; -} - - - diff --git a/ABACUS.develop/source/src_lcao/gint_k_rho.cpp b/ABACUS.develop/source/src_lcao/gint_k_rho.cpp index ffca043a7d..79915507a7 100644 --- a/ABACUS.develop/source/src_lcao/gint_k_rho.cpp +++ b/ABACUS.develop/source/src_lcao/gint_k_rho.cpp @@ -1,11 +1,12 @@ -#include "../src_pw/tools.h" +#include "src_pw/tools.h" #include "gint_k.h" -#include "lcao_nnr.h" -#include "lcao_orbitals.h" +#include "LCAO_nnr.h" +#include "ORB_read.h" #include "grid_technique.h" -#include "ylm.h" -#include "../src_pw/global.h" +#include "src_global/ylm.h" +#include "src_pw/global.h" #include "src_global/blas_connector.h" +#include "global_fp.h" // mohan add 2021-01-30 inline void setVindex(const int ncyz, const int ibx, const int jby, const int kbz, int* vindex) { @@ -354,7 +355,7 @@ inline void cal_band_rho(const int size, const int grid_index, const int LD_pool } // ia1 // calculate rho - double *rhop = chr.rho[is]; + double *rhop = CHR.rho[is]; for(int ib=0; ib diff --git a/ABACUS.develop/source/src_lcao/gint_k_vna.cpp b/ABACUS.develop/source/src_lcao/gint_k_vna.cpp deleted file mode 100644 index 86de21341e..0000000000 --- a/ABACUS.develop/source/src_lcao/gint_k_vna.cpp +++ /dev/null @@ -1,345 +0,0 @@ -#include "gint_gamma.h" -#include "grid_technique.h" -#include "lcao_orbitals.h" -#include "../src_pw/global.h" -#include "lcao_nnr.h" - -void Gint_k::cal_vna(const double* vrs1, const Grid_Technique >) -{ - - TITLE("Gint_k","cal_vna"); - - if(!pvnapR_alloc_flag) - { - WARNING_QUIT("Gint_k::destroy_pvpR","pvnapR has not been allocated yet!"); - } - else - { - // reduce the dimension of array, which - // is used to save - if(this->reduced) - { - ZEROS(this->pvnapR_reduced, LNNR.nnrg); - } - } - - timer::tick("Gint_k","cal_vna"); - - // it's a uniform grid to save orbital values, so the delta_r is a constant. - double delta_r = ORB.dr_uniform; - // possible max atom number in real space grid. - const int max_size = gt.max_atom; - // how many meshcells in bigcell. - const int bxyz = pw.bxyz; - - double*** dr;// vectors between atom and grid: [bxyz, maxsize, 3] - double** distance; // distance between atom and grid: [bxyz, maxsize] - double*** psir_ylm; // psi(r-R) * Ylm(r-R) - bool** cal_flag; - double* ylma; - - if(max_size!=0) - { - // save the small box information for a big box. - dr = new double**[bxyz]; - distance = new double*[bxyz]; - psir_ylm = new double**[bxyz]; - cal_flag = new bool*[bxyz]; - - // mohan fix bug 2011-05-02 - // possible number of atom configureation (l,m) - int nn = 0; - for(int it=0; it0) - { - ncxyz = pw.ncxyz * VNA * VNA * VNA; - } - else if(VNA==0) - { - ncxyz = pw.ncxyz; - } - const double dv = ucell.omega/(double)ncxyz; - int vl_index=0; - - // array to store local potential for each small box in - // a big box. - double* vldr3 = new double[bxyz]; - ZEROS(vldr3, bxyz); - - for(int i=0; iset_ijk_atom(grid_index, size, - psir_ylm, dr, cal_flag, - distance, ylma, delta_r); - - int bindex = 0; - // z is the fastest, - for(int ii=0; iireduced) - { - this->evaluate_pvpR_reduced(this->pvnapR_reduced,grid_index, size,i,j,k, - psir_ylm, cal_flag, vldr3, distance, gt); - } - - }// int k - }// int j - } // int i - - delete[] vldr3; - if(max_size!=0) - { - for(int i=0; i - if(this->reduced) - { - ZEROS(this->pvnapR_reduced, LNNR.nnrg); - } - } - - timer::tick("Gint_k","cal_vna_d",'F'); - - // it's a uniform grid to save orbital values, so the delta_r is a constant. - double delta_r = ORB.dr_uniform; - // possible max atom number in real space grid. - const int max_size = gt.max_atom; - // how many meshcells in bigcell. - - const int bxyz = gt.bxyz; - const int bx = gt.bx; - const int by = gt.by; - const int bz = gt.bz; - -/* - cout << " bxyz=" << bxyz << endl; - cout << " bx=" << bx << endl; - cout << " by=" << by << endl; - cout << " bz=" << bz << endl; - */ - - double*** dr;// vectors between atom and grid: [bxyz, maxsize, 3] - double** distance; // distance between atom and grid: [bxyz, maxsize] - double*** psir_ylm; // psi(r-R) * Ylm(r-R) - bool** cal_flag; - double* ylma; - - if(max_size!=0) - { - // save the small box information for a big box. - dr = new double**[bxyz]; - distance = new double*[bxyz]; - psir_ylm = new double**[bxyz]; - cal_flag = new bool*[bxyz]; - - // mohan fix bug 2011-05-02 - // possible number of atom configureation (l,m) - int nn = 0; - for(int it=0; it0) - { - ncxyz = pw.ncxyz * VNA * VNA * VNA; - } - else if(VNA==0) - { - ncxyz = pw.ncxyz; - } - - - const double dv = ucell.omega/(double)ncxyz; - int vl_index=0; - - // array to store local potential for each small box in - // a big box. - double* vldr3 = new double[bxyz]; - double* vna3d = new double[bxyz]; - ZEROS(vldr3, bxyz); - - for(int i=0; iset_ijk_atom_vna(grid_index, size, - psir_ylm, dr, cal_flag, - distance, ylma, delta_r, gt, vna3d); - - // for test - // remember to turn on the potential in lcao_vna.cpp - /* - int bindex = 0; - // z is the fastest, - for(int ii=0; ii - -Gint_Speed::Gint_Speed() -{ - nov = 0; -} -Gint_Speed::~Gint_Speed(){} - -void Gint_Speed::cal_vlocal( - const double* vlocal_in) -{ - TITLE("Gint_Speed","cal_vlocal"); - timer::tick("Gint_Speed","cal_vlocal",'J'); - - if(Local_Orbital_Elec::iter==1) - { - save_phi(); - } - - this->job = cal_local; - this->vlocal = vlocal_in; - this->max_size = GridT.max_atom; - - assert(GridT.ncxyz>0); - this->vfactor = std::abs(this->latvec0.Det())/GridT.ncxyz; - - // call function - this->gamma_vlocal(); - - timer::tick("Gint_Speed","cal_vlocal",'J'); - - // Peize Lin add 2016-12-03 - if(5==xcf.iexch_now) - throw logic_error("Exx unfinished in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); - else if(6==xcf.iexch_now) - throw logic_error("Exx unfinished in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); - - return; -} - - -// evaluate the -void Gint_Speed::gamma_vlocal(void) -{ - TITLE("Gint_Speed","gamma_vlocal"); - timer::tick("Gint_Speed","gamma_vlocal",'K'); - - const int nwmax = ucell.nwmax; - const int nat = ucell.nat; - - bool perform_gint = true; - - - //-------------------------------------------- - // allocate the matrix - //-------------------------------------------- - double** GridVlocal; - const int lgd_now = GridT.lgd; - if(lgd_now > 0) - { - GridVlocal = new double*[lgd_now]; - for (int i=0; i= 0) - { - for (int j=0; j=0) - { - if (mu <= nu) - { - tmp[j] = GridVlocal[mu][nu]; - } - else - { - //------------------------------- - // origin: - // tmp[i] = GridVlocal[nu][mu]; - // mohan fix bug - // 2011-01-13 - //------------------------------- - tmp[j] = GridVlocal[nu][mu]; - } - } - } - } - Parallel_Reduce::reduce_double_grid( tmp, NLOCAL ); - Parallel_Reduce::reduce_double_diag( tmp, NLOCAL ); - for (int j=0; j(tmp[j],0.0),'L'); - } - else - { - LM.set_HSgamma(i,j,tmp[j],'L'); - } - } - delete[] tmp; - } - } - - - /* - cout << "GridVlocal" << endl; - for(int i=0; i0) - { - for(int i=0; igrid_index = (k-nbz_start) + j * nbz + i * nby * nbz; - const int size = GridT.how_many_atoms[ this->grid_index ]; - - if(size==0) continue; - - int ir_now = ir_bigbox; - for(int ib=0; ib(position); - dx = position - ip; - dx2 = dx * dx; - dx3 = dx2 * dx; - - c3 = 3.0*dx2-2.0*dx3; - c1 = 1.0-c3; - c2 = (dx-2.0*dx2+dx3)*delta_r; - c4 = (dx3-dx2)*delta_r; - Atom* atom1 = &ucell.atoms[it]; - for (int iw=0; iw< atom1->nw; iw++) - { - double phi; - if ( atom1->iw2_new[iw] ) - { - pointer = &ORB.Phi[it].PhiLN( - atom1->iw2l[iw], - atom1->iw2n[iw]); - phi = c1*pointer->psi_uniform[ip]+c2*pointer->dpsi_uniform[ip] - + c3*pointer->psi_uniform[ip+1] + c4*pointer->dpsi_uniform[ip+1]; - } - phiylm[iat][iw][nr2[iat]] = phi * ylma[atom1->iw2_ylm[iw]]; - } - - // recall the global index of each grid for each orbital - // ir_bigbox = global index(i, j, k) - - //----------------------------------------------------- - // (1) - // Be careful about one special case! - // if grid_label[iat][nr_now] == grid_label[iat][nr_now+1], - // means, there are at least two 'identical' atoms - // have non-zero wave functios on this grid. - // (2) - // Because we are now circleing for ir_bigbox, so if - // there appears same 'iat', - // nr2[iat] is blind between 'different atom (same iat) on same grid' - // and 'same atom on different grid' - //----------------------------------------------------- - //assert(nr[iat]>0); - grid_label[iat][nr2[iat]] = ir_now; - ++nr2[iat]; - }//end size - ++ir_now; - }//end ibxyz - - - ir_now = ir_bigbox; - for(int ii=0; iinov=0; - for(int iat=0; iatnr[iat]; - if(nr_now == 0) continue; - - const int it = ucell.iat2it[ iat ]; - const int ia = ucell.iat2ia[ iat ]; - const int start1 = ucell.itiaiw2iwt(it, ia, 0); - const int iw_lo = GridT.trace_lo[start1]; - if(iw_lo<0)continue; - for(int iat2=iat; iat2nr[iat2]; - if(nr2_now == 0) continue; - - const int it2 = ucell.iat2it[ iat2 ]; - const int ia2 = ucell.iat2ia[ iat2 ]; - const int start2 = ucell.itiaiw2iwt(it2, ia2, 0); - const int iw2_lo = GridT.trace_lo[start2]; - if(iw2_lo<0)continue; - - - - // for example - // the positive number is the grid point. - // positive number is always increasing. - // psi1: 1 3 3 5 7 - // psi2: 2 3 3 5 9 - int is=0; - int is_rec=0; - int ir2_start=0;//start ir for atom2 - int ee=0; //count the overlap grid number. - bool same=false; - - - // searching in the range of atom 1. - for(int ir=0; ir< nr_now; ++ir) - { - if( ir>0 ) - { - //--------------------------------------- - // means 'idential' atoms have at least - // twice phi on this grid. - //--------------------------------------- - if( grid_label[iat][ir] == grid_label[iat][ir-1] ) - { - // it's the same grid. - same = true; - // again, searching begins from the previous one. - // for example, the second 3 in atom 1, - // must search from the previous one. - ir2_start = is_rec; - } - else - { - // start from the bigger one, when - // grid_label[iat2][j] > grid_label[iat][i] - same = false; - ir2_start = is; - } - } - - // is_rec: - // stop to begin record how many 'identical' - // atoms have Phi on this grid. - is_rec = ir2_start; - - //------------------------------------------ - // (1) compare betwen different atoms! - // (2) ee++ when iat and iat2 are on the same grid. - // (3) can't miss any grid_label - //------------------------------------------ - for(int jr=ir2_start; jr grid_label[iat][ir] ) - { - is=jr; - break; - } - else if( grid_label[iat2][jr] == grid_label[iat][ir]) - { - ++ee; - } - }// j - }// i -// ofs_running << "iat=" << iat << " iat2=" << iat2 << " ee=" << ee << endl; - this->nov = std::max(nov, ee); - }//iat2 - }//iat - - - ofs_running << " nov=" << nov << " nrxx=" << pw.nrxx << endl; -// cout << " nov=" << nov << " nrxx=" << pw.nrxx << endl; - -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - timer::tick("Gint_Speed","save_phi",'k'); - return; -} - diff --git a/ABACUS.develop/source/src_lcao/gint_speed_rho.cpp b/ABACUS.develop/source/src_lcao/gint_speed_rho.cpp deleted file mode 100644 index d3c2067a37..0000000000 --- a/ABACUS.develop/source/src_lcao/gint_speed_rho.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include "gint_speed.h" -#include "grid_technique.h" -#include "lcao_orbitals.h" -#include "../src_pw/global.h" -#include "local_orbital_elec.h" //mohan add 2012-03-29 - - -double Gint_Speed::cal_rho(void) -{ - TITLE("Gint_Speed","cal_rho"); - timer::tick("Gint_Speed","cal_rho",'J'); - - this->job = cal_charge; - - assert(GridT.ncxyz>0); - this->vfactor = std::abs(this->latvec0.Det())/GridT.ncxyz; - - // call function - double ne = this->gamma_charge(); - - timer::tick("Gint_Speed","cal_rho",'J'); - return ne; - -} - - -double Gint_Speed::gamma_charge(void) -{ - TITLE("Gint_Speed","gamma_charge"); - timer::tick("Gint_Speed","gamma_charge",'K'); - -// cout << " gamma_charge" << endl; - - - const int nwmax = ucell.nwmax; - const int nat = ucell.nat; - - // PART3: evaluate the - assert(allocate_phiylm); - assert(nov>=0); - - - if(nov > 0) - { - int incx=1; - int incy=1; - double **p1 = new double*[nwmax]; - double **p2 = new double*[nwmax]; - for(int iw=0; iwnov]; - for(int iw=0; iwnov]; - - for(int iat=0; iat0 - - - double sum = 0.0; - for(int is=0; is epsr ) THEN - ! - grho2(1) = grho(1,k,1)**2 + grho(2,k,1)**2 + grho(3,k,1)**2 - ! - IF ( grho2(1) > epsg ) THEN - ! - segno = SIGN( 1.D0, rhoout(k,1) ) - ! - CALL gcxc( arho, grho2(1), sx, sc, v1x, v2x, v1c, v2c ) - ! - ! ... first term of the gradient correction : D(rho*Exc)/D(rho) - ! - v(k,1) = v(k,1) + e2 * ( v1x + v1c ) - ! - ! ... h contains : - ! - ! ... D(rho*Exc) / D(|grad rho|) * (grad rho) / |grad rho| - ! - h(:,k,1) = e2 * ( v2x + v2c ) * grho(:,k,1) - ! - vtxcgc = vtxcgc+e2*( v1x + v1c ) * ( rhoout(k,1) - rho_core(k) ) - etxcgc = etxcgc+e2*( sx + sc ) * segno - ! - ELSE - h(:,k,1)=0.D0 - END IF - ! - ELSE - ! - h(:,k,1) = 0.D0 - ! - END IF - ! - END DO - ! - ELSE - ! - ! ... spin-polarised case - ! -!$omp parallel do private( rh, grho2, sx, v1xup, v1xdw, v2xup, v2xdw, rup, rdw, & -!$omp grhoup, grhodw, grhoud, sc, v1cup, v1cdw, v2cup, v2cdw, v2cud, & -!$omp zeta, grh2, v2c, grup, grdw ), & -!$omp reduction(+:etxcgc,vtxcgc) - DO k = 1, nrxx - ! - rh = rhoout(k,1) + rhoout(k,2) - ! - grho2(:) = grho(1,k,:)**2 + grho(2,k,:)**2 + grho(3,k,:)**2 - ! - CALL gcx_spin( rhoout(k,1), rhoout(k,2), grho2(1), & - grho2(2), sx, v1xup, v1xdw, v2xup, v2xdw ) - ! - IF ( rh > epsr ) THEN - ! - IF ( igcc_is_lyp ) THEN - ! - rup = rhoout(k,1) - rdw = rhoout(k,2) - ! - grhoup = grho(1,k,1)**2 + grho(2,k,1)**2 + grho(3,k,1)**2 - grhodw = grho(1,k,2)**2 + grho(2,k,2)**2 + grho(3,k,2)**2 - ! - grhoud = grho(1,k,1) * grho(1,k,2) + & - grho(2,k,1) * grho(2,k,2) + & - grho(3,k,1) * grho(3,k,2) - ! - CALL gcc_spin_more( rup, rdw, grhoup, grhodw, grhoud, & - sc, v1cup, v1cdw, v2cup, v2cdw, v2cud ) - ! - ELSE - ! - zeta = ( rhoout(k,1) - rhoout(k,2) ) / rh - if (nspin.eq.4.and.domag) zeta=abs(zeta)*segni(k) - ! - grh2 = ( grho(1,k,1) + grho(1,k,2) )**2 + & - ( grho(2,k,1) + grho(2,k,2) )**2 + & - ( grho(3,k,1) + grho(3,k,2) )**2 - ! - CALL gcc_spin( rh, zeta, grh2, sc, v1cup, v1cdw, v2c ) - ! - v2cup = v2c - v2cdw = v2c - v2cud = v2c - ! - END IF - ! - ELSE - ! - sc = 0.D0 - v1cup = 0.D0 - v1cdw = 0.D0 - v2c = 0.D0 - v2cup = 0.D0 - v2cdw = 0.D0 - v2cud = 0.D0 - ! - ENDIF - ! - ! ... first term of the gradient correction : D(rho*Exc)/D(rho) - ! - v(k,1) = v(k,1) + e2 * ( v1xup + v1cup ) - v(k,2) = v(k,2) + e2 * ( v1xdw + v1cdw ) - ! - ! ... h contains D(rho*Exc)/D(|grad rho|) * (grad rho) / |grad rho| - ! - DO ipol = 1, 3 - ! - grup = grho(ipol,k,1) - grdw = grho(ipol,k,2) - h(ipol,k,1) = e2 * ( ( v2xup + v2cup ) * grup + v2cud * grdw ) - h(ipol,k,2) = e2 * ( ( v2xdw + v2cdw ) * grdw + v2cud * grup ) - ! - END DO - ! - vtxcgc = vtxcgc + & - e2 * ( v1xup + v1cup ) * ( rhoout(k,1) - rho_core(k) * fac ) - vtxcgc = vtxcgc + & - e2 * ( v1xdw + v1cdw ) * ( rhoout(k,2) - rho_core(k) * fac ) - etxcgc = etxcgc + e2 * ( sx + sc ) - ! - END DO -!$omp end parallel do - ! - END IF - ! - DO is = 1, nspin0 - ! - rhoout(:,is) = rhoout(:,is) - fac * rho_core(:) - ! - END DO - ! - DEALLOCATE( grho ) - ! - ALLOCATE( dh( nrxx ) ) - ! - ! ... second term of the gradient correction : - ! ... \sum_alpha (D / D r_alpha) ( D(rho*Exc)/D(grad_alpha rho) ) - ! - DO is = 1, nspin0 - ! - CALL grad_dot( nrx1, nrx2, nrx3, nr1, nr2, nr3, & - nrxx, h(1,1,is), ngm, g, nl, alat, dh ) - ! - v(:,is) = v(:,is) - dh(:) - ! - vtxcgc = vtxcgc - SUM( dh(:) * rhoout(:,is) ) - ! - END DO - ! - vtxc = vtxc + omega * vtxcgc / ( nr1 * nr2 * nr3 ) - etxc = etxc + omega * etxcgc / ( nr1 * nr2 * nr3 ) - - ! - DEALLOCATE( dh ) - DEALLOCATE( h ) - DEALLOCATE( rhoout ) - ! - RETURN - ! -END SUBROUTINE gradcorr diff --git a/ABACUS.develop/source/src_lcao/grid_base.cpp b/ABACUS.develop/source/src_lcao/grid_base.cpp index 7a58edd5f5..12c1264e2f 100644 --- a/ABACUS.develop/source/src_lcao/grid_base.cpp +++ b/ABACUS.develop/source/src_lcao/grid_base.cpp @@ -1,7 +1,8 @@ -#include "grid_integral.h" -#include "../src_pw/global.h" -#include "ylm.h" -#include "lcao_orbitals.h" +#include "src_pw/global.h" +#include "src_global/ylm.h" +#include "ORB_read.h" +#include "grid_base.h" +#include "global_fp.h" // mohan add 2021-01-30 Grid_Base::Grid_Base() { diff --git a/ABACUS.develop/source/src_lcao/grid_base.h b/ABACUS.develop/source/src_lcao/grid_base.h index 9fdeaee558..dd81eb1266 100644 --- a/ABACUS.develop/source/src_lcao/grid_base.h +++ b/ABACUS.develop/source/src_lcao/grid_base.h @@ -6,7 +6,7 @@ #define GRID_BASE_H #include "../src_pw/tools.h" -#include "numerical_orbital_lm.h" +#include "ORB_atomic_lm.h" class Grid_Base { @@ -29,7 +29,6 @@ class Grid_Base // MEMBER FUNCTION : //=========================================================== // define pointer - SparseMatrix* SM; // about vlocal const double* vlocal; void get_rcut_max(void); diff --git a/ABACUS.develop/source/src_lcao/grid_base_beta.cpp b/ABACUS.develop/source/src_lcao/grid_base_beta.cpp index f9b92d7dfe..b385e4a6af 100644 --- a/ABACUS.develop/source/src_lcao/grid_base_beta.cpp +++ b/ABACUS.develop/source/src_lcao/grid_base_beta.cpp @@ -1,6 +1,6 @@ -#include "grid_integral.h" -#include "../src_pw/global.h" -#include "ylm.h" +#include "src_pw/global.h" +#include "src_global/ylm.h" +#include "global_fp.h" // mohan add 2021-01-30 Grid_Base_Beta::Grid_Base_Beta() { diff --git a/ABACUS.develop/source/src_lcao/grid_base_beta.h b/ABACUS.develop/source/src_lcao/grid_base_beta.h index d1566feebb..3e5c8cc2c5 100644 --- a/ABACUS.develop/source/src_lcao/grid_base_beta.h +++ b/ABACUS.develop/source/src_lcao/grid_base_beta.h @@ -6,7 +6,7 @@ #define GRID_BASE_BETA_H #include "../src_pw/tools.h" -#include "numerical_orbital_lm.h" +#include "ORB_atomic_lm.h" // this class is inherited by Grid_Integral_Beta.h // this class provides basic Grid operation and the diff --git a/ABACUS.develop/source/src_lcao/grid_bigcell.cpp b/ABACUS.develop/source/src_lcao/grid_bigcell.cpp index adde245d0d..e9c7685e33 100644 --- a/ABACUS.develop/source/src_lcao/grid_bigcell.cpp +++ b/ABACUS.develop/source/src_lcao/grid_bigcell.cpp @@ -1,6 +1,8 @@ #include "grid_bigcell.h" #include "../src_pw/global.h" +#include "global_fp.h" // mohan add 2021-01-30 + Grid_BigCell::Grid_BigCell() { this->flag_tib = false; @@ -101,7 +103,7 @@ void Grid_BigCell::init_big_latvec(void) } -void Grid_BigCell::init_grid_expansion(const bool vna) +void Grid_BigCell::init_grid_expansion(void) { TITLE("Grid_BigCell","init_grid_expansion"); @@ -110,11 +112,6 @@ void Grid_BigCell::init_grid_expansion(const bool vna) for(int T=0; Torbital_rmax = std::max( ORB.Phi[T].getRcut(), this->orbital_rmax); - // mohan add 2011-05-23 - if(vna) - { - this->orbital_rmax = std::max( ORB.Vna[T].rcut,this->orbital_rmax); - } } if(test_gridt)OUT(ofs_running,"rmax of periodic grid (bohr)",orbital_rmax); diff --git a/ABACUS.develop/source/src_lcao/grid_bigcell.h b/ABACUS.develop/source/src_lcao/grid_bigcell.h index 0df0d05168..fa951fc136 100644 --- a/ABACUS.develop/source/src_lcao/grid_bigcell.h +++ b/ABACUS.develop/source/src_lcao/grid_bigcell.h @@ -29,7 +29,7 @@ class Grid_BigCell: public Grid_MeshCell //--------------------------------- - void init_grid_expansion(const bool vna); + void init_grid_expansion(void); // get the max radius of all orbitals. // which will use to generate grid expansion, diff --git a/ABACUS.develop/source/src_lcao/grid_integral.cpp b/ABACUS.develop/source/src_lcao/grid_integral.cpp deleted file mode 100644 index bdd4fb0707..0000000000 --- a/ABACUS.develop/source/src_lcao/grid_integral.cpp +++ /dev/null @@ -1,311 +0,0 @@ -#include "grid_integral.h" -#include "../src_pw/global.h" -#include "ylm.h" -#include "lcao_orbitals.h" - - -// use density kernel(density matrix) to calcualte the density -// on real space grid. -void Grid_Integral::cal_rho(void) -{ - if(test>0)TITLE("Grid_Integral","cal_rho"); - timer::tick("Grid_Integral","cal_rho"); - - // there are two job available: cal_charge or cal_local. - this->job = cal_charge; - - //========================================= - // calculte chrge density from local basis - //========================================= - this->deal_region_atoms(); - - timer::tick("Grid_Integral","cal_rho"); - return; -} - -void Grid_Integral::cal_vlocal( - const double* vlocal_in, - SparseMatrix &SM_in) -{ - if(test>0)TITLE("Grid_Integral","cal_vlocal"); - timer::tick("Grid_Integral","cal_vlocal"); - this->test = 0; - this->job = cal_local; - - // a pointer point to the sparse matrix. - this->SM = &SM_in; - - // a pointer point to the real space grid vlocal. - this->vlocal = vlocal_in; - - //================================================= - // calculte vlocal grid integral from local basis - //================================================= - this->deal_region_atoms(); - timer::tick("Grid_Integral","cal_vlocal"); - return; -} - -// be called by : Grid_Integral::cal_rho & Grid_Integral::cal_vlocal -// this program is in the core of the whole LCAO program. -// it's very important to make this part efficient. -void Grid_Integral::deal_region_atoms(void) -{ -// if(test>0)TITLE("Grid_Integral","cal_region_alpha"); - for(int T1=0; T11)!"); - } - - if( min_direct_coordinate.z > max_direct_coordinate.z ) - { - ofs_warning << "\n min_direct_z=" << min_direct_coordinate.z; - ofs_warning << "\n max_direct_z=" << max_direct_coordinate.z; - WARNING_QUIT("Grid_Base::constrain_grid","min_direct_coordinate.z > max_direct_coordinate.z"); - } - - this->lmax1 = ucell.atoms[T1].nwl + 1; - this->lmax2 = ucell.atoms[T2].nwl + 1; - this->n1 = lmax1 * lmax1; - this->n2 = lmax2 * lmax2; - - // (4) 8 Edge Points In Which Includes the Two Orbitals in Direct Coordinates - this->edge_grid_points( R1*this->lat0, R2*this->lat0, max_direct_coordinate, min_direct_coordinate ); - this->iw1_all = ucell.itiaiw2iwt(T1, I1, 0); - - //cout << "\n T1=" << T1 << " I1=" << I1 << " T2=" << T2 << " I2=" << I2; - this->deal_region_orbitals( - R1, //atomic position of the first atom - T1, - I1, - R2, //atomic position of the second atom - T2, - I2); - } - } - } - } - return; -} - -// be called by cal_region_atoms -// FUNCTION : deal things happen between two atoms. -void Grid_Integral::deal_region_orbitals -( - const Vector3 &R1, //atomic position of the first atom - const int &T1, - const int &I1, - const Vector3 &R2, //atomic position of the second atom - const int &T2, - const int &I2 -) -{ - this->Rcut1 = ORB.Phi[T1].getRcut(); - this->Rcut2 = ORB.Phi[T2].getRcut(); - for (int L1 = 0; L1 < ucell.atoms[T1].nwl + 1; L1++) - { - for (int N1 = 0; N1 < ucell.atoms[T1].l_nchi[L1]; N1++) - { - for (int m1 = 0; m1 < 2*L1 + 1; m1++) - { - // calculate iw2_all and index1 - this->iw2_all = ucell.itiaiw2iwt(T2, I2, 0); - this->index1 = L1*L1+m1; - - for (int L2 = 0; L2 < ucell.atoms[T2].nwl+1; L2++) - { - for (int N2 = 0; N2 < ucell.atoms[T2].l_nchi[L2]; N2++) - { - for (int m2 = 0; m2 < 2*L2 + 1; m2++) - { - - if( iw1_all > iw2_all) - { - ++iw2_all; - continue; - } - - this->index2 = L2*L2+m2; - this->pointer1 = &ORB.Phi[T1].PhiLN(L1, N1); - this->pointer2 = &ORB.Phi[T2].PhiLN(L2, N2); - - switch( job ) - { - case cal_local: - this->vlocal_in_small_box(); - break; - - case cal_charge: - this->rho_in_small_box(); - break; - - default: - WARNING_QUIT("Grid_Integral::cal_region","check job!"); - } - ++iw2_all; - }// m2 - }// N2 - }// L2 - ++iw1_all; - }// m1 - }// N1 - }// L1 - return; -} - - -void Grid_Integral::rho_in_small_box(void) -{ - int count = 0; - - double factor; - if(iw1_all == iw2_all) factor=1; - else factor = 2; - - double* yy1_lm = this->yy1[index1]; - double* yy2_lm = this->yy2[index2]; - double dk = LOC.DM[0][iw1_all][iw2_all]; - -// double sum = 0.0; - for (int i = this->edge_min.x; i < this->edge_max.x; i++) - { - for (int j = this->edge_min.y; j < this->edge_max.y; j++) - { - for (int k = this->edge_min.z; k < this->edge_max.z; k++) - { - if ( this->norm1[count] < this->Rcut1 && this->norm2[count] < this->Rcut2) - { - chr.rho[0][ ijk_index[count] ] += factor * - Mathzone::Polynomial_Interpolation( - pointer1->getPsiuniform(), // Peize Lin update 2016-05-14 - pointer1->getNruniform(), - pointer1->getDruniform(), - norm1[count]) - * - Mathzone::Polynomial_Interpolation( - pointer2->getPsiuniform(), // Peize Lin update 2016-05-14 - pointer2->getNruniform(), - pointer2->getDruniform(), - norm2[count]) - * - yy1_lm[count] - * - yy2_lm[count] - * - dk; - -// sum += psi1 * yy1( this->index1, count)* psi2 * yy2( this->index2, count); - } - count++; - - } - } - } -// if( sum > 1.0e-5 ) -// cout << "\n" << " iw1_all = " << iw1_all << " iw2_all = " << iw2_all << " sum = " << sum * pw.omega / pw.ncxyz; - return; -} - -void Grid_Integral::vlocal_in_small_box(void) -{ - double v = 0.0; - int count=0; - - double* yy1_lm = this->yy1[index1]; - double* yy2_lm = this->yy2[index2]; - - for (int i = this->edge_min.x; i < this->edge_max.x; i++) - { - for (int j = this->edge_min.y; j < this->edge_max.y; j++) - { - for (int k = this->edge_min.z; k < this->edge_max.z; k++) - { - //timer::tick("Grid_Integral","interpo"); - - if ( this->norm1[count] < this->Rcut1 && this->norm2[count] < this->Rcut2) - { - - v += Mathzone::Polynomial_Interpolation( - pointer1->getPsiuniform(), // Peize Lin update 2016-05-14 - pointer1->getNruniform(), - pointer1->getDruniform(), - norm1[count]) - * - Mathzone::Polynomial_Interpolation( - pointer2->getPsiuniform(), // Peize Lin update 2016-05-14 - pointer2->getNruniform(), - pointer2->getDruniform(), - norm2[count]) - * - yy1_lm[count] - * - yy2_lm[count] - * - this->vlocal[ ijk_index[count] ]; - } - count++; - } - } - } - // unit : (a.u.) - SM->set_add(iw1_all, iw2_all, v * latvec0.Det() / nxyz ); - - if(iw1_all!=iw2_all) - { - SM->reset( iw2_all, iw1_all, SM[0](iw1_all,iw2_all) ); - } - - return; -} - - - diff --git a/ABACUS.develop/source/src_lcao/grid_integral.h b/ABACUS.develop/source/src_lcao/grid_integral.h deleted file mode 100644 index 58964b89dd..0000000000 --- a/ABACUS.develop/source/src_lcao/grid_integral.h +++ /dev/null @@ -1,49 +0,0 @@ -//========================================================= -//AUTHOR : liaochen, mohan -//DATE : 2008-03-28 -//========================================================= -#ifndef GRID_INTEGRAL_H -#define GRID_INTEGRAL_H - -#include "../src_pw/tools.h" -#include "grid_base.h" -//========================================================= -//CLASS Grid_Integral -//Note : Integral On 3D Grids -//Feature : Matrix Elements Of Local Potential For -//Numerical Orbitals -//========================================================= - -class Grid_Integral : public Grid_Base -{ -public: - - Grid_Integral(){}; - ~Grid_Integral(){}; - - void cal_rho(void); - - void cal_vlocal( const double* vlocal_in, - SparseMatrix &SM_in); - -private: - - void deal_region_atoms(void); - - void deal_region_orbitals - ( - const Vector3 &R1, //atomic position of the first atom - const int &T1, - const int &I1, - const Vector3 &R2, //atomic position of the second atom - const int &T2, - const int &I2 - ); - - void vlocal_in_small_box(void); - void rho_in_small_box(void); - - -}; - -#endif diff --git a/ABACUS.develop/source/src_lcao/grid_meshball.cpp b/ABACUS.develop/source/src_lcao/grid_meshball.cpp index 1e7f72d00f..aac2855dd3 100644 --- a/ABACUS.develop/source/src_lcao/grid_meshball.cpp +++ b/ABACUS.develop/source/src_lcao/grid_meshball.cpp @@ -154,7 +154,6 @@ double Grid_MeshBall::deal_with_atom_spillage(const double *pos) } //LiuXh add 2018-12-14 -///* void Grid_MeshBall::delete_meshball_positions(void) { TITLE("Grid_MeshBall","delete_meshball_positions"); @@ -169,4 +168,3 @@ void Grid_MeshBall::delete_meshball_positions(void) } return; } -//*/ diff --git a/ABACUS.develop/source/src_lcao/grid_meshball.h b/ABACUS.develop/source/src_lcao/grid_meshball.h index ebd1bb4357..67dd4b3cb4 100644 --- a/ABACUS.develop/source/src_lcao/grid_meshball.h +++ b/ABACUS.develop/source/src_lcao/grid_meshball.h @@ -16,9 +16,11 @@ class Grid_MeshBall : public Grid_BigCell // cartesian coordinates of meshball. double** meshball_positions; + bool flag_mp; protected: + Grid_MeshBall(); ~Grid_MeshBall(); @@ -35,8 +37,4 @@ class Grid_MeshBall : public Grid_BigCell double deal_with_atom_spillage(const double* pos); }; - #endif - - - diff --git a/ABACUS.develop/source/src_lcao/grid_technique.cpp b/ABACUS.develop/source/src_lcao/grid_technique.cpp index 06bb3c88f8..6fddc38f0d 100644 --- a/ABACUS.develop/source/src_lcao/grid_technique.cpp +++ b/ABACUS.develop/source/src_lcao/grid_technique.cpp @@ -1,6 +1,8 @@ #include "grid_technique.h" #include "../src_pw/global.h" +#include "global_fp.h" // mohan add 2021-01-30 + Grid_Technique GridT; Grid_Technique::Grid_Technique() @@ -31,7 +33,7 @@ Grid_Technique::~Grid_Technique() } -// This function is called in local_orbital_ions.cpp +// This function is called in LOOP_ions.cpp // after the orbital information has been read, // this function control the routinue to generate // grid technique parameters. @@ -47,39 +49,46 @@ void Grid_Technique::set_pbc_grid( const int &nbz_in, const int &nbxx_in, const int &nbzp_start_in, - const int &nbzp_in, - const bool vna) + const int &nbzp_in) { TITLE("Grid_Technique","init"); timer::tick("Grid_Technique","init",'D'); - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") ofs_running << "\n SETUP EXTENDED REAL SPACE GRID FOR GRID INTEGRATION" << endl; - if(OUT_LEVEL != "m") OUT(ofs_running,"vna",vna); + if(OUT_LEVEL != "m") + { + ofs_running << "\n SETUP EXTENDED REAL SPACE GRID FOR GRID INTEGRATION" << endl; + } // (1) init_meshcell cell and big cell. - this->set_grid_dim(ncx_in,ncy_in,ncz_in, - bx_in,by_in,bz_in,nbx_in,nby_in,nbz_in, - nbxx_in,nbzp_start_in,nbzp_in); + this->set_grid_dim( + ncx_in,ncy_in,ncz_in, + bx_in,by_in,bz_in, + nbx_in,nby_in,nbz_in, + nbxx_in,nbzp_start_in,nbzp_in); this->init_latvec(); + this->init_big_latvec(); + this->init_meshcell_pos(); + // (2) expand the grid - this->init_grid_expansion(vna); + this->init_grid_expansion(); + // (3) calculate the extended grid. this->cal_extended_cell(this->dxe, this->dye, this->dze); + this->init_tau_in_bigcell(); + // init meshball this->delete_meshball_positions(); //LiuXh add 2018-12-14 + this->init_meshball(); + this->init_atoms_on_grid(); this->cal_trace_lo(); - if(BFIELD) - { - this->cal_trace_beta();//add by sunzhiyuan - } + timer::tick("Grid_Technique","init",'D'); return; } @@ -445,9 +454,12 @@ void Grid_Technique::cal_trace_lo(void) // ofs_running << " i=" << i+1 << " trace_lo=" << trace_lo[i] << endl; // } - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") OUT(ofs_running,"Atom number in sub-FFT-grid",lnat); - if(OUT_LEVEL != "m") OUT(ofs_running,"Local orbitals number in sub-FFT-grid",lgd); + if(OUT_LEVEL != "m") + { + OUT(ofs_running,"Atom number in sub-FFT-grid",lnat); + OUT(ofs_running,"Local orbitals number in sub-FFT-grid",lgd); + } + assert(iw_local == lgd); assert(iw_all == NLOCAL); return; diff --git a/ABACUS.develop/source/src_lcao/grid_technique.h b/ABACUS.develop/source/src_lcao/grid_technique.h index 597df6bf81..a5dba02873 100644 --- a/ABACUS.develop/source/src_lcao/grid_technique.h +++ b/ABACUS.develop/source/src_lcao/grid_technique.h @@ -67,8 +67,7 @@ class Grid_Technique : public Grid_MeshBall const int &nbz_in, const int &nbxx_in, const int &nbzp_start_in, - const int &nbzp_in, - const bool vna = false); + const int &nbzp_in); private: diff --git a/ABACUS.develop/source/src_lcao/hamilt_linear.h b/ABACUS.develop/source/src_lcao/hamilt_linear.h deleted file mode 100644 index d3a3fda2a2..0000000000 --- a/ABACUS.develop/source/src_lcao/hamilt_linear.h +++ /dev/null @@ -1,49 +0,0 @@ -//========================================================== -// AUTHOR : mohan, ywcui -// Last Update: 2009-4-22 -//========================================================== -#ifndef HAMILT_LINEAR_H -#define HAMILT_LINEAR_H - -#include "../src_pw/tools.h" -#include "../src_pw/algorithms.h" - -#include "use_overlap_table.h" // (2) -#include "local_orbital_pairs.h" // (5) pairs basis -#include "../src_external/src_pdiag/pdiag_double.h" - -class Hamilt_Linear -{ -public: - Hamilt_Linear(); - ~Hamilt_Linear(); - - // Generate the S(overlap),T,NL matrix. - void set_orb_tables(); - void clear_after_ions(); - - // For test - void solve_using_lapack - ( - const int ik, - const ComplexMatrix &lpsi,// localized psi - const int nstart, - const int nbands, - ComplexMatrix &evc,// wave functions - double *en// band energy - ); - - // Main routine - void solve_using_cg - ( - const int ik, - const ComplexMatrix &lpsi,// localized psi - const int nstart, - const int nbands, - ComplexMatrix &evc,// wave functions - double *en// band energy - ); - - Local_Orbital_Pairs pairs; -}; -#endif diff --git a/ABACUS.develop/source/src_lcao/interpol_3d.cpp b/ABACUS.develop/source/src_lcao/interpol_3d.cpp deleted file mode 100644 index 0ef4ab625f..0000000000 --- a/ABACUS.develop/source/src_lcao/interpol_3d.cpp +++ /dev/null @@ -1,604 +0,0 @@ -#include "Interpolation_3D.h" -#include "../src_pw/tools.h" -#include "random_def.h" -IPL_3D :: IPL_3D(): psi(NULL), result(NULL), pos(NULL) -{ - cout << " 3D_Interpolation " << endl; - - this->test = 3; - this->flag = 0; - - if (flag) - { - if (test > 0) - { - cout << "Prepare Interpolation Infomation and write them to the hard disk!" << endl; - } - - write(); - } - else - { - if (test > 0) - { - cout << "Read Interpolation Information from hard disk and ready for Interpolate!" << endl; - } - - read(); - } -} - -IPL_3D :: ~IPL_3D() -{ -// delete[] psi; -// delete[] pos; -}; - -void IPL_3D :: write() -{ - this -> init(); - - this -> Cal_Coord(); - - this -> QSort_Indata(psi, pos, 0, psi_num - 1); - - if (test > 1) - { - cout << "Correctness of Sort Function" << endl; - - for (int i = 0; i < psi_num; i++) - { - Vector3 temp = Get_Index(pos[i], v_min, cell_length); - cout << "pos = " << pos[i].x << setw(5) << pos[i].y << setw(5) << pos[i].z << setw(5); - cout << "index = (" << temp.x << ", " << temp.y << ", " << temp.z << ")" << endl; - int key = temp.x * length.y * length.z + temp.y * length.z + temp.z; - cout << " key = " << key << " i = " << i << endl; - } - } - - ofstream outf("IPL_3D.dat"); - - if (outf) - { - outf << IPL_nbnd << endl; - outf << psi_num << endl; - outf << old_lat0 << endl; - outf << setw(12) << v_min.x - << setw(12) << v_min.y - << setw(12) << v_min.z << endl; - outf << setw(12) << v_max.x - << setw(12) << v_max.y - << setw(12) << v_max.z << endl; - outf << setw(12) << length.x - << setw(12) << length.y - << setw(12) << length.z << endl; - outf << setw(12) << cell_length.x - << setw(12) << cell_length.y - << setw(12) << cell_length.z << endl; - - for (int i = 0; i < IPL_nbnd; i++) - { - for (int j = 0; j < psi_num;j++) - { - outf << setw(12) << psi[i][j].real() << setw(12) << psi[i][j].imag() << endl; - } - } - - for (int i = 0; i < psi_num; i++) - { - outf << setw(12) << pos[i].x - << setw(12) << pos[i].y - << setw(12) << pos[i].z << endl; - } - - outf << setw(12) << old_latvec.e11 << setw(12) << old_latvec.e12 << setw(12) << old_latvec.e13 << endl - - << setw(12) << old_latvec.e21 << setw(12) << old_latvec.e22 << setw(12) << old_latvec.e23 << endl - << setw(12) << old_latvec.e31 << setw(12) << old_latvec.e32 << setw(12) << old_latvec.e33 << endl; - } - else - { - cout << "Cannot open file IPL_3D!!" << endl; - exit(0); - } - - outf.close(); - - if (test > 0) - cout << "Finish the write process!" << endl; -} - -void IPL_3D :: read() -{ - ifstream input("IPL_3D.dat"); - - if (!input) - { - cout << "IPL_3D has not been saved yet!!" << endl; - exit(0); - } - - input >> IPL_nbnd; - - input >> this->psi_num; - input >> this->old_lat0; - input >> this->v_min.x >> this->v_min.y >> this->v_min.z; - input >> this->v_max.x >> this->v_max.y >> this->v_max.z; - input >> this->length.x >> this->length.y >> this->length.z; - input >> this->cell_length.x >> this->cell_length.y >> this->cell_length.z; - - this->psi = new complex* [IPL_nbnd](); - - for (int i = 0; i < IPL_nbnd; i++) - this->psi[i] = new complex [psi_num]; - - for (int i = 0; i < nbnd; i++) - { - for (int j = 0; j < psi_num; j++) - { - double real, img; - input >> real >> img; - psi[i][j] = complex (real, img); - } - } - - - this->pos = new Vector3 [psi_num]; - - for (int i = 0; i < psi_num; i++) - { - input >> this->pos[i].x >> this->pos[i].y >> this->pos[i].z; - } - - input >> this->old_latvec.e11 >> this->old_latvec.e12 >> this->old_latvec.e13 - - >> this->old_latvec.e21 >> this->old_latvec.e22 >> this->old_latvec.e23 - >> this->old_latvec.e31 >> this->old_latvec.e32 >> this->old_latvec.e33; - input.close(); - - if (test > 0) - { - cout << "Finish Reading!" << endl; - } - -// this->Cal_Result(); -} - -void IPL_3D::init() -{ - if (test > 0) - { - cout << "\n init " << endl; - - cout << "\n kv.nks = " << kv.nks << endl; - cout << "\n st.kgxyz = " << st.kgxyz << endl; - cout << "\n st.qtot = " << st.qtot << endl; - } - - this->length.x = st.kg[0]; - - this->length.y = st.kg[1]; - this->length.z = st.kg[2]; - this->psi_num = st.kgxyz; - this->old_latvec = pw.latvec; - this->old_lat0 = pw.lat0; - - if (nbnd > pw.natomwfc) - { - IPL_nbnd = nbnd; - } - else IPL_nbnd = pw.natomwfc; - - this->psi = new complex* [IPL_nbnd]; - - for (int i = 0; i < IPL_nbnd; i++) - this->psi[i] = new complex [psi_num]; - - for (int iw = 0;iw < IPL_nbnd; iw++) - { - int iq = 0; - - for (int ik = 0;ik < kv.nks; ik++) - { - for (int ig = 0;ig < kv.ngk[ik];ig++) - { - const int num = st.kg2fftw[iq]; - psi[iw][num] = wf.evc[ik](iw, ig); - /* if(test > 1) - { - cout<<"psi["< 0) - cout << "\n Cal_Coord : " << endl; - - this->pos = new Vector3 [psi_num]; - - this->v_min = Vector3(0, 0, 0); - - this->v_max = Vector3(0, 0, 0); - - int x = st.kg[0]; - - int y = st.kg[1]; - - int z = st.kg[2]; - - this->length = Vector3(x, y, z); - - int xy = x * y; - - int xz = x * z; - - int yz = y * z; - - int x2 = x / 2; - - int y2 = y / 2; - - int z2 = z / 2; - - for (int i = 0;i < st.kgxyz; i++) - { - Vector3 temp; - temp.x = i / xy; - temp.y = i / x - temp.x * z; - temp.z = i - temp.y * y - temp.x * yz; - - if (test > 1) - { - cout << "\ntemp = ( " << temp.x - << ", " << temp.y << ", " << temp.z - << ")" << setw(5); - } - - const int num = static_cast(temp.x * yz + temp .y * z + temp.z); - - if (temp.x > x2) temp.x -= x; - - if (temp.y > y2) temp.y -= y; - - if (temp.z > z2) temp.z -= z; - - pos[num] = temp; - - if (test > 1) - { - cout << "pos[ " << num << "] = ( " << pos[num].x - << ", " << pos[num].y << ", " << pos[num].z - << ")" << endl; - } - - if (pos[num].x < v_min.x) v_min.x = pos[num].x; - - if (pos[num].y < v_min.y) v_min.y = pos[num].y; - - if (pos[num].z < v_min.z) v_min.z = pos[num].z; - - if (pos[num].x > v_max.x) v_max.x = pos[num].x; - - if (pos[num].y > v_max.y) v_max.y = pos[num].y; - - if (pos[num].x > v_max.z) v_max.z = pos[num].z; - - } - - cell_length.x = (v_max.x - v_min.x) / (length.x - 1); - - cell_length.y = (v_max.y - v_min.y) / (length.y - 1); - cell_length.z = (v_max.z - v_min.z) / (length.z - 1); - - if (test > 0) - { - cout << "\nv_min = ( " << v_min.x << " , " << v_min.y << " , " << v_min.z << " )\n" - << "v_max = ( " << v_max.x << " , " << v_max.y << " , " << v_max.z << " )\n" - << "\nlength.x = " << length.x - << "\nlength.y = " << length.y - << "\nlength.z = " << length.z - << "\ncell_length.x = " << cell_length.x - << "\ncell_length.y = " << cell_length.y - << "\ncell_length.z = " << cell_length.z << endl; - } -} - -Vector3 IPL_3D :: Get_Index(Vector3 pos, Vector3 Origin, Vector3 length) -{ - Vector3 Index; - Index.x = static_cast(std::floor((pos.x - Origin.x) / length.x)); - Index.y = static_cast(std::floor((pos.y - Origin.y) / length.y)); - Index.z = static_cast(std::floor((pos.z - Origin.z) / length.z)); - return Index; -} - -int IPL_3D :: Sort_Partition(complex **val, Vector3 *pos, int low, int high) -{ - if (test > 1) - cout << "Begin Sort_Partition." << endl; - - Vector3 temp_pos = pos[low]; - - complex * temp_psi ; - - temp_psi = new complex [IPL_nbnd]; - - for (int i = 0;i < IPL_nbnd; i++) - { - temp_psi[i] = val[i][low]; - } - - Vector3 low_index = Get_Index(pos[low], v_min, cell_length); - - Vector3 high_index = Get_Index(pos[high], v_min, cell_length); - - int low_key = low_index.x * length.y * length.z + low_index.y * length.z + low_index.z; - int pivotkey = low_key; - int high_key = high_index.x * length.y * length.z + high_index.y * length.z + high_index.z; - int times = 0; - - while (low < high) - { - if (test > 2) - { - cout << "Loop times: " << times << endl; - cout << "Low = " << low << endl; - cout << "high = " << high << endl; - cout << "low_key = " << low_key << endl; - cout << "high_key = " << high_key << endl; - cout << "pivotkey = " << pivotkey << endl; - cout << "pos[low] = (" << pos[low].x - << " ," << pos[low].y - << " ," << pos[low].z << ")" << endl; - cout << "pos[high] = (" << pos[high].x - << " ," << pos[high].y - << " ," << pos[high].z << ")" << endl; - } - - times++; - - while (low < high && high_key >= pivotkey) - { - --high; - high_index = Get_Index(pos[high], v_min, cell_length); - high_key = high_index.x * length.y * length.z + high_index.y * length.z + high_index.z; - } - - pos[low] = pos[high]; - - for (int i = 0; i < IPL_nbnd; i++) - { - val[i][low] = val[i][high]; - } - - if (test > 2) - { - cout << "pos[low] = (" << pos[low].x - << " ," << pos[low].y - << " ," << pos[low].z << ")" << endl; - cout << "low_key = " << low_key << endl; - } - - low_index = Get_Index(pos[low], v_min, cell_length); - - low_key = low_index.x * length.y * length.z + low_index.y * length.z + low_index.z; - - while (low < high && low_key <= pivotkey) - { - ++low; - low_index = Get_Index(pos[low], v_min, cell_length); - low_key = low_index.x * length.y * length.z + low_index.y * length.z + low_index.z; - } - - pos[high] = pos[low]; - - for (int i = 0; i < IPL_nbnd; i++) - { - val[i][high] = val[i][low]; - } - - high_index = Get_Index(pos[high], v_min, cell_length); - - high_key = high_index.x * length.y * length.z + high_index.y * length.z + high_index.z; - } - - if (test > 1) - cout << "Loop times: " << times << endl; - - pos[low] = temp_pos; - - for (int i = 0; i < IPL_nbnd; i++) - { - val[i][low] = temp_psi[i]; - } - - return low; -} - -int IPL_3D::count = 0; -void IPL_3D::QSort_Indata(complex **val, Vector3 *pos, int low, int high) -{ - if (test > 1) - { - cout << "\n<==========================Ready for the " << count - << " times Qsort=============================" << endl; - - if (test > 2) - { - for (int i = 0; i < psi_num; i++) - { - Vector3 temp = Get_Index(pos[i], v_min, cell_length); - cout << "pos = (" << pos[i].x << setw(5) << pos[i].y << setw(5) << pos[i].z << ") " << setw(5); - cout << "index = (" << temp.x << ", " << temp.y << ", " << temp.z << ")" << endl; - int key = temp.x * length.y * length.z + temp.y * length.z + temp.z; - cout << " key = " << key << " i = " << i << endl; - } - } - - cout << "\nlength of the Sqlist" << high - low + 1 << endl; - } - - if (low < high) - { - if (test > 1) - cout << "Iterate Time = " << count << endl; - - count++; - - int pivotloc = this->Sort_Partition(val, pos, low, high); - - if (test > 1) - cout << "pivotloc = " << pivotloc << endl; - -// if(count == 1)exit(0); - QSort_Indata(val, pos, low, pivotloc - 1); - - QSort_Indata(val, pos, pivotloc + 1, high); - } -} - -complex IPL_3D::Interpolation_3D(complex **psi, const double &x, const double &y, const double &z, const int seq) -{ -// transform the coordinate - Vector3 cor = Vector3(x, y, z); - cor = cor * this->old_latvec; - cor = (old_lat0 / pw.lat0) * cor; - cor = cor * pw.GT; - - if (test > 1) - { - cout << "band number = " << seq << endl; - cout << "Direct Coordinate in old Coordinates: (" - << cor.x << ", " << cor.y << ", " << cor.z << ")" << endl; - } - - Vector3 index = Get_Index(cor, v_min, cell_length); - - if (test > 1) - { - cout << "index in the old system: (" << index.x << ", " << index.y << ", " << index.z << ")" << endl; - cout << length.x << setw(5) << length.y << setw(5) << length.z << endl; - } - - if (index.x > length.x || index.y > length.y || index.z > length.z) - { - cout << "Input Coordinates of is beyond the bound of the box!!" << endl; - exit(0); - } - - int pos = index.x * length.y * length.z + index.y * length.z + index.z; - - complex V_000 = psi[seq][pos]; - - pos = index.x * length.y * length.z + index.y * length.z + index.z + 1; - complex V_001 = psi[seq][pos]; - - pos = index.x * length.y * length.z + (index.y + 1) * length.z + index.z; - complex V_010 = psi[seq][pos]; - - pos = index.x * length.y * length.z + (index.y + 1) * length.z + index.z + 1; - complex V_011 = psi[seq][pos]; - - pos = (index.x + 1) * length.y * length.z + index.y * length.z + index.z; - complex V_100 = psi[seq][pos]; - - pos = (index.x + 1) * length.y * length.z + index.y * length.z + index.z + 1; - complex V_101 = psi[seq][pos]; - - pos = (index.x + 1) * length.y * length.z + (index.y + 1) * length.z + index.z; - complex V_110 = psi[seq][pos]; - - pos = (index.x + 1) * length.y * length.z + (index.y + 1) * length.z + index.z + 1; - complex V_111 = psi[seq][pos]; - - complex V_IPL; - V_IPL = (1 - cor.x) * (1 - cor.y) * (1 - cor.z) * V_000 + - cor.x * (1 - cor.y) * (1 - cor.z) * V_100 + - (1 - cor.x) * cor.y * (1 - cor.z) * V_010 + - (1 - cor.x) * (1 - cor.y) * cor.z * V_001 + - cor.x * (1 - cor.y) * cor.z * V_101 + - (1 - cor.x) * cor.y * cor.z * V_011 + - cor.x * cor.y * (1 - cor.z) * V_110 + - cor.x * cor.y * cor.z * V_111 ; - - if (test > 1) - { - cout << "Interpolation Result: (" << V_IPL.real() << ", " << - V_IPL.imag() << ")" << endl; - } - - return V_IPL; -} - -void IPL_3D :: Cal_Result() -{ - if (test > 0) - cout << "Cai_Result" << endl; - - int x = st.kg[0]; - - int y = st.kg[1]; - - int z = st.kg[2]; - - int xy = x * y; - - int xz = x * z; - - int yz = y * z; - - int x2 = x / 2; - - int y2 = y / 2; - - int z2 = z / 2; - - this->result = new complex* [IPL_nbnd]; - - for (int i = 0; i < IPL_nbnd; i++) - { - this->result[i] = new complex [st.kgxyz](); - } - - for (int i = 0; i < IPL_nbnd; i++) - { - for (int j = 0;j < st.kgxyz; j++) - { - Vector3 temp; - temp.x = j / xy; - temp.y = j / x - temp.x * z; - temp.z = j - temp.y * y - temp.x * yz; - const int num = static_cast(temp.x * yz + temp .y * z + temp.z); - - if (temp.x > x2) temp.x -= x; - - if (temp.y > y2) temp.y -= y; - - if (temp.z > z2) temp.z -= z; - - - if (test > 1) - { - cout << "Direct Coordinate in new Coordinates: (" - << temp.x << ", " << temp.y << ", " << temp.z << ")" << endl; - } - - result[i][num] = this->Interpolation_3D(psi, temp.x, temp.y, temp.z, i); - - } - } - - return; -} diff --git a/ABACUS.develop/source/src_lcao/interpol_3d.h b/ABACUS.develop/source/src_lcao/interpol_3d.h deleted file mode 100644 index 54d3617c6b..0000000000 --- a/ABACUS.develop/source/src_lcao/interpol_3d.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef INCLUDE_IPL_3D -#define INCLUDE_IPL_3D - -#include "../src_pw/global.h" -#include "../src_pw/tools.h" - -class IPL_3D -{ -public: - IPL_3D(); - ~IPL_3D(); - - complex **psi; - int psi_num; - Vector3 *pos; - complex **result; -private: - static int count ;//count iterater time in the Sort function - Vector3 v_min;//origin of the box - Vector3 v_max;//farthest points of the box - Vector3 length;//number of cells on each dim - Vector3 cell_length;// distance between two adjacent points in each dim - Matrix3 old_latvec; - double old_lat0; - int IPL_nbnd; - int test;//switch of output information - bool flag;//"0" for read,"1"for write -public: - void write();//Prepare information for Interpolation,write to the hard disk - void read();//read information from file and conduct interpolation - void init(void);//initial psi - void Cal_Coord();//initial pos,and other parameters - Vector3 Get_Index(Vector3 pos, Vector3 Origin, Vector3 length); - int Sort_Partition(complex **val, Vector3 *pos, int low, int high); - void QSort_Indata(complex **val, Vector3 *pos, int low, int high); - complex Interpolation_3D(complex **psi, const double &x, const double &y, const double &z, const int seq); - void Cal_Result(); -}; - -#endif diff --git a/ABACUS.develop/source/src_lcao/lcao_vna.cpp b/ABACUS.develop/source/src_lcao/lcao_vna.cpp deleted file mode 100644 index b39fe2fdc9..0000000000 --- a/ABACUS.develop/source/src_lcao/lcao_vna.cpp +++ /dev/null @@ -1,206 +0,0 @@ -#include "lcao_vna.h" -#include "../src_pw/global.h" - -LCAO_Vna::LCAO_Vna() -{} - -LCAO_Vna::~LCAO_Vna() -{} - -void LCAO_Vna::two_center_vna(void) -{ - cout << " two center integration for vna" << endl; - - WARNING_QUIT("LCAO_Vna::two_center_vna","not ready yet"); - return; -} - - -// be called in Use_Hamilt_Matrix::set_ion -void LCAO_Vna::dense_vna(const char &matrix_type) -{ - TITLE("LCAO_Vna","dense_vna"); - timer::tick("LCAO_Vna","dense_vna",'E'); - - ofs_running << "\n SETUP VNA." << endl; - - const int istep = 1; - const int delta_vh = 0; - const int cal_vna = 1; // tmp by mohan - - const int dense = VNA; - - //-------------------------------------- - // set up a dense grid for doing dense - // grid integration - // note that for Si the length of Vna - // may be as long as 10.0 Bohr, so if - // cal_vna is turned on, the data in - // Grid_Technique will be different. - - // for example, bx=2, by=2, bz=2 - // nbx, nby, nbz stay as unchanged. - //-------------------------------------- - Grid_Technique gtf; - gtf.set_pbc_grid( - pw.ncx*dense,pw.ncy*dense,pw.ncz*dense, - pw.bx*dense,pw.by*dense,pw.bz*dense, - pw.nbx,pw.nby,pw.nbz, - pw.nbxx,pw.nbzp_start,pw.nbzp, - cal_vna); - //0); - - //--------------------------------------------- - // delta_vh = 0 means don't need to calculate - // delta Vhartree. - // but calculate the neutral potential - //--------------------------------------------- - - //-------------------------------------------------------- - // The neutral potential can be only used when vna = 1, - // then to be used to check if the real space neutral - // potential is correct - //-------------------------------------------------------- - - // for test - bool test_G_vl = false; - - // TEST ! - if(test_G_vl) - { - pot.init_pot(istep, delta_vh, cal_vna); - for(int ir=0; ir1, do the local part except the Vna. -void LCAO_Vna::smooth_vl2(void) -{ - TITLE("LCAO_Vna","smooth_vl2"); - timer::tick("LCAO_Vna","smooth_vl2",'I'); - - - //cout << " calculate the " << endl; - const int istep = 1; - // calculate the (delta_Vh + Vxc + Vefield) - bool delta_vh = 1; - bool vna = 0; - //-------------------------------------------- - // NOTE1 : istep must set to 1, otherwise the - // charge density may be changed! - // NOTE2 : the Vna should include the efield - // contribution. The unsymmetry potential - // due to efield can be only evaluated - // using grid integration. - //-------------------------------------------- - pot.init_pot(istep, delta_vh, vna); - - for(int ir=0; irdense_vna(matrix_type); - - //------------------------------------- - // very important step! - // turn back the full local potential. - //------------------------------------- - pot.init_pot(istep); - - - timer::tick("LCAO_Vna","smooth_vl2",'I'); - return; -} - - - -void LCAO_Vna::smooth_vl1(void) -{ - TITLE("LCAO_Vna","smooth_vl1"); - - //cout << " calculate the " << endl; - const int istep=1; - // calculate the (delta_Vh + Vxc) - bool delta_vh = 1; - bool vna = 0; - // istep must set to 1, otherwise the charge - // density may be changed! - pot.init_pot(istep, delta_vh, vna); - - for(int ir=0; ir" << endl; - /* - delta_vh = 0; - vna = 1; - pot.init_pot(istep, delta_vh, vna); - - for(int ir=0; irinit_DM_R = false; - out_dm = 0; + + // whether to printout density matrix + this->out_dm = 0; + //xiaohui add 2014-06-19 //band_local = nullptr; //Z_wg = nullptr; @@ -42,35 +45,22 @@ Local_Orbital_Charge::~Local_Orbital_Charge() { // with gamma point only if (this->init_DM) - { - if(BFIELD) - { - for (int is=0; isinit_DM_R) @@ -81,382 +71,28 @@ Local_Orbital_Charge::~Local_Orbital_Charge() } delete[] DM_R; } - - //xiaohui add 2014-06-19 - //delete[] loc_bands; - //delete[] Z_wg; - //delete[] Z_LOC; -/* - //xiaohui add 2014-06-20 - for (int is=0; isnnrg_now = LNNR.nnrg; - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") OUT(ofs_running,"nnrg_last",nnrg_last); - if(OUT_LEVEL != "m") OUT(ofs_running,"nnrg_now",nnrg_now); - - if(this->init_DM_R) - { - assert(nnrg_last > 0); - for(int is=0; is0) - { - this->DM_R = new double*[NSPIN]; - for(int is=0; isDM_R[is] = new double[nnrg_now]; - ZEROS(DM_R[is], nnrg_now); - } - this->nnrg_last = nnrg_now; - this->init_DM_R = true; - Memory::record("LocalOrbital_Charge","Density_Matrix",NSPIN*nnrg_now,"double"); - } - else if(nnrg_now==0) - { - this->init_DM_R = false; - } - else - { - WARNING_QUIT("Local_Orbital_Charge::allocate_k","check init_DM_R."); - } - - wfc_dm_2d.init(); // Peize Lin test 2019-01-16 - return; -} - -// setup buffer parameters for tranforming 2D block-cyclic distributed DM matrix -inline int globalIndex(int localIndex, int nblk, int nprocs, int myproc) -{ - int iblock, gIndex; - iblock=localIndex/nblk; - gIndex=(iblock*nprocs+myproc)*nblk+localIndex%nblk; - return gIndex; - //return (localIndex/nblk*nprocs+myproc)*nblk+localIndex%nblk; -} - -inline int localIndex(int globalIndex, int nblk, int nprocs, int& myproc) -{ - myproc=int((globalIndex%(nblk*nprocs))/nblk); - return int(globalIndex/(nblk*nprocs))*nblk+globalIndex%nblk; } -int Local_Orbital_Charge::setAlltoallvParameter(MPI_Comm comm_2D, int blacs_ctxt, int nblk) +void Local_Orbital_Charge::allocate_dm_wfc(const Grid_Technique >) { - OUT(ofs_running,"enter setAlltoallvParameter, nblk", nblk); - timer::tick("LCAO_Charge","newDM_index",'F'); - // setup blacs parameters - int nprows, npcols, nprocs; - int myprow, mypcol, myproc; - Cblacs_gridinfo(blacs_ctxt, &nprows, &npcols, &myprow, &mypcol); - Cblacs_pinfo(&myproc, &nprocs); - // OUT(ofs_running,"nprocs",nprocs); - // init data arrays - delete[] sender_size_process; - sender_size_process=new int[nprocs]; - delete[] sender_displacement_process; - sender_displacement_process=new int[nprocs]; - - // OUT(ofs_running,"lgd_now",lgd_now); - - receiver_size=lgd_now*lgd_now; - receiver_size_process=new int[nprocs]; - delete[] receiver_displacement_process; - receiver_displacement_process=new int[nprocs]; - delete[] receiver_local_index; - receiver_local_index=new int[receiver_size]; - delete[] receiver_buffer; - receiver_buffer=new double[receiver_size]; - - int *trace_2D_row=new int[lgd_now]; - int *trace_2D_col=new int[lgd_now]; - int *trace_2D_prow=new int[lgd_now]; - int *trace_2D_pcol=new int[lgd_now]; - //int *trace_global=new int[lgd_now]; - - int *nRow_in_proc=new int[nprows]; - int *nCol_in_proc=new int[npcols]; - - // OUT(ofs_running,"nprows",nprows); - // OUT(ofs_running,"npcols",npcols); - - for(int i=0; i=0) - { - //trace_global[iLocalGrid]=iGlobal; - int p; - trace_2D_row[iLocalGrid]=localIndex(iGlobal, nblk, nprows, p); - trace_2D_prow[iLocalGrid]=p; - nRow_in_proc[trace_2D_prow[iLocalGrid]]++; - trace_2D_col[iLocalGrid]=localIndex(iGlobal, nblk, npcols, p); - trace_2D_pcol[iLocalGrid]=p; - nCol_in_proc[trace_2D_pcol[iLocalGrid]]++; - } - } - // OUT(ofs_running,"NLOCAL",NLOCAL); - receiver_displacement_process[0]=0; - // OUT(ofs_running,"receiver_displacement_process[0]",receiver_displacement_process[0]); - for(int pnum=0; pnum1) - { - OUT(ofs_running,"pnum",pnum); - OUT(ofs_running,"prow",prow); - OUT(ofs_running,"pcol",pcol); - OUT(ofs_running,"nRow_in_proc",nRow_in_proc[prow]); - OUT(ofs_running,"nCol_in_proc",nCol_in_proc[pcol]); - } - if(pnum>0) - { - receiver_displacement_process[pnum]=receiver_displacement_process[pnum-1]+receiver_size_process[pnum-1]; - } - } - // OUT(ofs_running,"last receiver_size_process",receiver_size_process[nprocs-1]); - - // build the index to be received - int* pos=new int[nprocs]; - int *receiver_2D_index=new int[receiver_size]; - for(int i=0; iallocate_gamma(gt); + } + else + { + LOWF.allocate_k(gt); + this->allocate_DM_k(); + } - if(NEW_DM>1) - { - ofs_running<<"receiver_size is "<init_DM) - //{ - // this->DM = new double**[NSPIN]; - // for(int is=0; isDM[is] = new double*[NLOCAL]; - - // for (int i=0; iinit_DM = true; - // Memory::record("LocalOrbital_Charge","Density_Kernal",NSPIN*NLOCAL*NLOCAL,"double"); - // } - //} - - //for (int i=0; iDM[is][NLOCAL], NLOCAL); - //} - //} - - //xiaohui modify 2014-06-18 - - // mohan fix serious bug 2010-09-06 - this->lgd_now = gt.lgd; - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") OUT(ofs_running,"lgd_last",lgd_last); - if(OUT_LEVEL != "m") OUT(ofs_running,"lgd_now",lgd_now); - - // mohan add 2010-07-01 - if(this->init_DM) - { - if(BFIELD) - { - assert(lgd_last > 0); - for (int is=0; is 0); - for (int is=0; is 0) - { - if(BFIELD) - { - this->DM_B = new complex **[NSPIN]; - this->DM_B_pool = new complex *[NSPIN]; - for(int is=0; isDM_B_pool[is]=new complex [lgd_now*lgd_now]; - ZEROS(DM_B_pool[is], lgd_now*lgd_now); - this->DM_B[is] = new complex*[lgd_now]; - - for (int i=0; i"); - } - } - else - { - this->DM = new double**[NSPIN]; - this->DM_pool = new double *[NSPIN]; - for(int is=0; isDM_pool[is]=new double [lgd_now*lgd_now]; - ZEROS(DM_pool[is], lgd_now*lgd_now); - this->DM[is] = new double*[lgd_now]; - - for (int i=0; iinit_DM = true; - this->lgd_last = lgd_now; - //xiaohui add 'OUT_LEVEL', 2015-09-16 - if(OUT_LEVEL != "m") ofs_running << " allocate DM , the dimension is " << lgd_now << endl; - } - else if(lgd_now == 0) - { - this->init_DM = false; - } - else - { - WARNING_QUIT("Local_Orbital_Charge::allocate","lgd<0!Something Wrong!"); - } - - if(!BFIELD) setAlltoallvParameter(ParaO.comm_2D, ParaO.blacs_ctxt, ParaO.nb); - wfc_dm_2d.init(); // Peize Lin test 2019-01-16 - return; -} void Local_Orbital_Charge::sum_bands(void) { @@ -464,35 +100,6 @@ void Local_Orbital_Charge::sum_bands(void) timer::tick("Local_Orbital_Cha","sum_bands",'E'); en.eband = 0.0; - //xiaohui modify 2013-09-02 - //if(LINEAR_SCALING == 2) - //{ - // //en.eband = ON.eband; - //} - //else if(LINEAR_SCALING == 1) - //{ - // //xiaohui modified 2013-07-22 - // //if(DIAGO_TYPE=="selinv") - // //{ - // // en.eband = Selinv::eband; - // //} - // //else - // //{ - // // ofs_running << " calculate eband " << endl; - // for(int ik=0; ikcal_dk_gamma();//calculate the density matrix. - // } - // // @@@@@@@ - // // test - // // @@@@@@@ - // /* - // cout << " Density Matrix:"; - // double sum = 0.0; - // for(int i=0; ical_dk_k( GridT ); - // } - //} xiaohui modify 2013-09-02. Attention... + } //xiaohui add 2013-09-02 if(GAMMA_ONLY_LOCAL) @@ -578,12 +139,14 @@ void Local_Orbital_Charge::sum_bands(void) NOTE("Calculate the density matrix!"); this->cal_dk_k( GridT ); if(KS_SOLVER=="genelpa" || KS_SOLVER=="scalapack_gvx") // Peize Lin test 2019-05-15 + { wfc_dm_2d.cal_dm(wf.wg); - } //xiaohui add 2013-09-02. Attention... + } + } for(int is=0; is fac, Record_adj RA, - const int ia1, const int iw1_lo, const int nw1, const int gstart, - complex *WFC_PHASE, complex **DM_ATOM) -{ - const char transa='N', transb='T'; - const complex alpha=1, beta=1; - - for(int ik=0; ik **wfc = LOWF.WFC_K[ik]; - const int ispin = kv.isk[ik]; - int atom2start=0; - - for (int ia2 = 0; ia2 < RA.na_each[ia1]; ++ia2) - { - complex *DM=&DM_ATOM[ispin][atom2start]; - const int T2 = RA.info[ia1][ia2][3]; - const int I2 = RA.info[ia1][ia2][4]; - Atom* atom2 = &ucell.atoms[T2]; - const int start2 = ucell.itiaiw2iwt(T2,I2,0); - const int iw2_lo=gt.trace_lo[start2]; - const int nw2=atom2->nw; - complex exp_R= exp( fac * ( - kv.kvec_d[ik].x * RA.info[ia1][ia2][0] + - kv.kvec_d[ik].y * RA.info[ia1][ia2][1] + - kv.kvec_d[ik].z * RA.info[ia1][ia2][2] - ) ); - - //ZEROS(WFC_PHASE, NBANDS*nw1); - int ibStart=0; - int nRow=0; - for(int ib=0; ib0) - { - if(nRow==0) ibStart=ib; - const int iline=nRow*nw1; - complex phase=exp_R*wg_local; - for(int iw1=0; iw1 fac, Record_adj RA, - const int ia1, const int iw1_lo, const int nw1, const int gstart, - complex *WFC_PHASE, complex **DM_ATOM) -{ - if(NSPIN !=4 ) WARNING_QUIT("Local_Orbital_Charge","NSPIN not match!"); - const char transa='N', transb='T'; - const complex alpha=1, beta=1; - int ispin=0; - - for(int is1=0;is1<2;is1++) - { - for(int is2=0;is2<2;is2++) - { - for(int ik=0; ik **wfc = LOWF.WFC_K[ik]; - int atom2start=0; - - for (int ia2 = 0; ia2 < RA.na_each[ia1]; ++ia2) - { - complex *DM=&DM_ATOM[ispin][atom2start]; - const int T2 = RA.info[ia1][ia2][3]; - const int I2 = RA.info[ia1][ia2][4]; - Atom* atom2 = &ucell.atoms[T2]; - const int start2 = ucell.itiaiw2iwt(T2,I2,0); - const int iw2_lo=gt.trace_lo[start2]/NPOL + gt.lgd/NPOL*is2; - const int nw2=atom2->nw; - complex exp_R= exp( fac * ( - kv.kvec_d[ik].x * RA.info[ia1][ia2][0] + - kv.kvec_d[ik].y * RA.info[ia1][ia2][1] + - kv.kvec_d[ik].z * RA.info[ia1][ia2][2] - ) ); - - //ZEROS(WFC_PHASE, NBANDS*nw1); - int ibStart=0; - int nRow=0; - for(int ib=0; ib0) - { - if(nRow==0) ibStart=ib; - const int iline=nRow*nw1; - complex phase=exp_R*w1; - for(int iw1=0; iw1 tau1, dtau; - - Record_adj RA; - RA.for_grid(gt); - - int ca = 0; - complex fac = TWO_PI * IMAG_UNIT; - - complex *WFC_PHASE=new complex[NLOCAL*ucell.nwmax]; - - int DM_ATOM_SIZE=1; - complex **DM_ATOM=new complex *[NSPIN]; - for(int is=0; is[DM_ATOM_SIZE]; - ZEROS(DM_ATOM[is], DM_ATOM_SIZE); - } - for(int T1=0; T1na; I1++) - { - const int iat = ucell.itia2iat(T1,I1); - if(gt.in_this_processor[iat]) - { - const int start1 = ucell.itiaiw2iwt(T1,I1,0); - const int gstart = LNNR.nlocstartg[iat]; - const int ng = LNNR.nlocdimg[iat]; - const int iw1_lo=gt.trace_lo[start1]/NPOL; - const int nw1=atom1->nw; - - if(DM_ATOM_SIZE[DM_ATOM_SIZE]; - } - for(int is=0; isDM_R[is][gstart+iv]=DM_ATOM[is][iv].real(); - } - } - } - else - {//zhengdy-soc - for(int iv=0; ivDM_R[0][gstart+iv]=DM_ATOM[0][iv].real() + DM_ATOM[3][iv].real(); - if(NONCOLIN){//DOMAG - this->DM_R[1][gstart+iv]=DM_ATOM[1][iv].real() + DM_ATOM[2][iv].real(); - this->DM_R[2][gstart+iv]=DM_ATOM[1][iv].imag() - DM_ATOM[2][iv].imag(); - this->DM_R[3][gstart+iv]=DM_ATOM[0][iv].real() - DM_ATOM[3][iv].real(); - } - else if(!NONCOLIN)//DOMAG_Z - { - this->DM_R[1][gstart+iv]= 0.0; - this->DM_R[1][gstart+iv]= 0.0; - this->DM_R[3][gstart+iv]=DM_ATOM[0][iv].real() - DM_ATOM[3][iv].real(); - } - else//soc with no mag - { - this->DM_R[1][gstart+iv]= 0.0; - this->DM_R[2][gstart+iv]= 0.0; - this->DM_R[3][gstart+iv]= 0.0; - } - } - } - } // if gt.in_this_processor - }// I1 - }// T1 - - - //------------ - // for test - //------------ -/* cout << setprecision(3); - for(int i=0; iDM[is] -void Local_Orbital_Charge::cal_dk_gamma_from_2D(void) -{ - //timer::tick("LCAO_Charge","newDM",'F'); - timer::tick("LCAO_Charge","dm_2dTOgrid",'F'); - OUT(ofs_running,"cal_dk_gamma_from_2D, NSPIN", NSPIN); - for(int is=0; is1) - // outputDM( ParaO.blacs_ctxt, ParaO.nb); - { - // int myid; - // MPI_Comm_rank(MPI_COMM_WORLD, &myid); - // if(myid==0) - // { - // ofs_running<<"DM[0][0:1][0:1] before send:"<1) - { - OUT(ofs_running,"number of non-zero elements in sender_buffer",nNONZERO); - OUT(ofs_running,"sender_size",sender_size); - OUT(ofs_running,"last sender_buffer",sender_buffer[sender_size-1]); - } - // transform data via MPI_Alltoallv - MPI_Alltoallv(sender_buffer, sender_size_process, sender_displacement_process, MPI_DOUBLE, - receiver_buffer, receiver_size_process, receiver_displacement_process, MPI_DOUBLE, ParaO.comm_2D); - // put data from receiver buffer to this->DM[is] - nNONZERO=0; - // init DM[is] - /*for(int i=0; i1) - { - OUT(ofs_running,"number of non-zero elements in receiver_buffer",nNONZERO); - OUT(ofs_running,"receiver_size",receiver_size); - OUT(ofs_running,"last receiver_buffer",receiver_buffer[receiver_size-1]); - // ofs_running<<"DM[0][0:1][0:1] after receiver:"<=0) - // { - // ofs_running<<"DM(0,0)"<=0 && idx1>=0) - // { - // ofs_running<<"DM(0,1)"<=0) - // { - // ofs_running<<"DM(1,1)"<DM_B[is][i], lgd_now); - } - } - for(int is=0; is= 0) - { - // set a pointer. - complex *alpha = this->DM_B[is][mu_local]; - for (int j=i; j= 0) - { - for (int ib=0; ib0) - { - // dm = \sum ( wg * c[ib][mu] * c[ib][nu] ) - // dm saved accordint to sub-FFT box. - alpha[nu_local] += wg_local * (conj(LOWF.WFC_GAMMA_B[is][ib][mu_local]) * LOWF.WFC_GAMMA_B[is][ib][nu_local]).real(); - } - } - } - } - } - } - } - } -#ifdef __MPI //2015-09-06, xiaohui - else // Peize Lin update 2018-07-02 - { - for( int is=0; isDM[is][i], lgd_now); - - int nprocs,myid; - //MPI_Status status; - MPI_Comm_size(DIAG_HPSEPS_WORLD,&nprocs); - MPI_Comm_rank(DIAG_HPSEPS_WORLD,&myid); - - vector bands_local(DSIZE); - for (int id=0; id= NBANDS) - { - lastband_in_proc = id; - break; - } - } - - matrix wg_local(NSPIN,band_local); - for(int id=0, Total_Bands=0; id <= lastband_in_proc; ++id) - { - if(myid == id) - for(int is=0; isDM[is][row_mu][col_nu] = rho_row_col(i_row,i_col); - } - } - } - } // end for col_count - } // end for row_count - ofs_running<<"DM[0][0:1][0:1] in cal_dk_gamma:"<=0) - { - ofs_running<<"DM(0,0)"<=0 && idx1>=0) - { - ofs_running<<"DM(0,1)"<=0) - { - ofs_running<<"DM(1,1)"<DM[is][i], lgd_now); - for(int is=0; istaud[ia].x - << " " << atom->taud[ia].y - << " " << atom->taud[ia].z << endl; - } - } - - ofs << "\n " << NSPIN; - if(NSPIN==1||NSPIN==4) - { - ofs << "\n " << en.ef << " (fermi energy)"; - } - else if(NSPIN==2) - { - if(is==0)ofs << "\n " << en.ef_up << " (fermi energy for spin=1)"; - else if(is==1)ofs << "\n " << en.ef_dw << " (fermi energy for spin=2)"; - } - else - { - WARNING_QUIT("write_rho","check nspin!"); - } - - - ofs << "\n " << NLOCAL << " " << NLOCAL << endl; - - ofs << setprecision(precision); - ofs << scientific; - - } - - //ofs << "\n " << GAMMA_ONLY_LOCAL << " (GAMMA ONLY LOCAL)" << endl; -#ifndef __MPI - if(GAMMA_ONLY_LOCAL) - { - for(int i=0; iDM[is][i][j]; - } - } - } - else - { - WARNING_QUIT("write_dm","not ready yet"); - ofs << " " << LNNR.nnrg << " (nnrg)" << endl; - for(int i=0; iDM_R[is][i]; - } - } -#else - if(GAMMA_ONLY_LOCAL) - { - //xiaohui modify 2014-06-18 - - double* tmp = new double[NLOCAL]; - int* count = new int[NLOCAL]; - for (int i=0; i= 0) - { - for (int j=0; j= 0) - { - count[j]=1; - } - } - } - Parallel_Reduce::reduce_int_all( count, NLOCAL ); - - // reduce the density matrix for 'i' line. - ZEROS(tmp, NLOCAL); - if (mu >= 0) - { - for (int j=0; j=0) - { - tmp[j] = DM[is][mu][nu]; - //ofs_running << " dmi=" << i << " j=" << j << " " << DM[is][mu][nu] << endl; - } - } - } - Parallel_Reduce::reduce_double_all( tmp, NLOCAL ); - - if(MY_RANK==0) - { - for (int j=0; j0) - { - ofs << " " << tmp[j]/(double)count[j]; - } - else - { - ofs << " 0"; - } - } - } - } - delete[] tmp; - delete[] count; - - //xiaohui add 2014-06-18 - //for(int i=0; iDM[is][i][j]; - // } - //} - - } - else - { - ofs << " " << LNNR.nnrg << " (nnrg)" << endl; - WARNING_QUIT("local_orbital_charge","not ready to output DM_R"); - } -#endif - if(MY_RANK==0) - { - end = time(NULL); - OUT_TIME("write_rho",start,end); - ofs.close(); - } - timer::tick("Local_Orbital_Charge","write_dm"); - - return; -} - - -void Local_Orbital_Charge::read_dm(const int &is, const string &fn) -{ - TITLE("Local_Orbital_Charge","read_dm"); - timer::tick("Local_Orbital_Charge","read_dm"); - - ofs_running << "\n processor 0 is reading density matrix from file < " << fn << " > " << endl; - //xiaohui modify 2015-03-25 - //bool quit_mesia = false; - bool quit_abacus = false; - - ifstream ifs; - if(MY_RANK==0) - { - ifs.open(fn.c_str()); - if (!ifs) - { - //xiaohui modify 2015-03-25 - //quit_mesia = true; - quit_abacus = true; - } - else - { - // if the number is not match, - // quit the program or not. - bool quit=false; - - string name; - ifs >> name; - - // check lattice constant, unit is Angstrom - CHECK_DOUBLE(ifs,ucell.lat0 * BOHR_TO_A,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e11,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e12,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e13,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e21,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e22,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e23,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e31,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e32,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e33,quit); - - for(int it=0; it> coordinate; - - for(int it=0; it> DM[is][i][j]; - } - } - } - else - { - WARNING_QUIT("Local_Orbital_Charge::read_dm","The nnrg should not be update"); - CHECK_INT(ifs,LNNR.nnrg); - - for(int i=0; i> DM_R[is][i]; - } - } -#else - - // distribution of necessary data - //xiaohui modify 2015-03-25 - //Parallel_Common::bcast_bool(quit_mesia); - Parallel_Common::bcast_bool(quit_abacus); - //xiaohui modify 2015-03-25 - //if(quit_mesia) - if(quit_abacus) - { - WARNING_QUIT("Local_Orbital_Charge::read_dm","Can not find the density matrix file."); - } - - - if(NSPIN==1||NSPIN==4) - { - Parallel_Common::bcast_double(en.ef); - } - else if(NSPIN==2) - { - Parallel_Common::bcast_double(en.ef_up); - Parallel_Common::bcast_double(en.ef_dw); - } - - - if(GAMMA_ONLY_LOCAL) - { - //ofs_running << " NLOCAL=" << NLOCAL << endl; - //ofs_running << " lgd_now=" << lgd_now << endl; - //ofs_running << " GridT.lgd=" << GridT.lgd << endl; - - double *tmp = new double[NLOCAL]; - for(int i=0; i*** DM_B; //density matrix in B field, Zhiyuan add 2012-01-13// double** DM_R; - void write_dm(const int &is, const int &iter, const string &fn, const int &precision); + // whether to printout density matrix int out_dm; // output density matrix or not. + + void write_dm(const int &is, const int &iter, const string &fn, const int &precision); + void read_dm(const int &is, const string &fn); Wfc_Dm_2d wfc_dm_2d; // Peize Lin test 2019-01-16 private: + // whether the DM array has been allocated bool init_DM; + // whether the DM(R) array has been allocated bool init_DM_R; void cal_dk_gamma(void); + void cal_dk_k(const Grid_Technique >); - int test; // mohan add 2010-09-06 int lgd_last;// sub-FFT-mesh orbitals number in previous step. int lgd_now;// sub-FFT-mesh orbitals number in this step. @@ -47,9 +64,9 @@ class Local_Orbital_Charge int nnrg_now; // sub-FFT-mesh orbitals number in this step, with k. // add by yshen on 9/22/2014 - // these variables are memory pool for DM series matrixes, so that these matrixes will be storaged continuously in the memory. + // these variables are memory pool for DM series matrixes, + // so that these matrixes will be storaged continuously in the memory. double **DM_pool; - complex **DM_B_pool; // Buffer parameters for tranforming 2D block-cyclic distributed DM matrix // to grid distributed DM matrix @@ -66,6 +83,7 @@ class Local_Orbital_Charge double* receiver_buffer; int setAlltoallvParameter(MPI_Comm comm_2D, int blacs_ctxt, int nblk); + void cal_dk_gamma_from_2D(void); }; diff --git a/ABACUS.develop/source/src_lcao/local_orbital_elec.cpp b/ABACUS.develop/source/src_lcao/local_orbital_elec.cpp deleted file mode 100644 index 39e38597c1..0000000000 --- a/ABACUS.develop/source/src_lcao/local_orbital_elec.cpp +++ /dev/null @@ -1,973 +0,0 @@ -#include "local_orbital_elec.h" -#include "diago_lcao_matrix.h" -#include "src_pw/global.h" -#include "src_pw/symmetry_rho.h" -// mohan add on test 2010-01-13 -//#include "../src_develop/src_onscaling/on_tests.h" -#include "update_input.h" -#include "src_pw/chi0_hilbert.h" -#include "lcao_vna.h" -#include "evolve_lcao_matrix.h" -#include "../src_pw/berryphase.h" -#include "../src_pw/toWannier90.h" -#include "dftu.h" //Quxin add for DFT+U on 202011029 - -int Local_Orbital_Elec::iter = 0; -double Local_Orbital_Elec::avg_iter = 0.0; -int Local_Orbital_Elec::istep = 0; - -void Local_Orbital_Elec::scf(const int &istep) -{ - TITLE("Local_Orbtial_Elec","scf"); - timer::tick("Local_Orbital_Elec","scf",'D'); - -// ofs_running << " Local_Orbital_Electrons_relaxation begin :"<update_ethr(iter); - if(FINAL_SCF && iter==1) - { - init_mixstep_final_scf(); - //chr.irstep=0; - //chr.idstep=0; - //chr.totstep=0; - } - - // mohan update 2012-06-05 - en.calculate_harris(1); - - // mohan move it outside 2011-01-13 - // first need to calculate the weight according to - // electrons number. - // mohan add iter > 1 on 2011-04-02 - // because the en.ekb has not value now. - // so the smearing can not be done. - if(iter>1)Occupy::calculate_weights(); - - if(wf.start_wfc == "file") - { - if(iter==1) - { - cout << " WAVEFUN -> CHARGE " << endl; - - // The occupation should be read in together. - // Occupy::calculate_weights(); //mohan add 2012-02-15 - - // calculate the density matrix using read in wave functions - // and the ncalculate the charge density on grid. - LOC.sum_bands(); - // calculate the local potential(rho) again. - // the grid integration will do in later grid integration. - - - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // a puzzle remains here. - // if I don't renew potential, - // The dr2 is very small. - // OneElectron, Hartree and - // Exc energy are all correct - // except the band energy. - // - // solved by mohan 2010-09-10 - // there are there rho here: - // rho1: formed by read in orbitals. - // rho2: atomic rho, used to construct H - // rho3: generated by after diagonalize - // here converged because rho3 and rho1 - // are very close. - // so be careful here, make sure - // rho1 and rho2 are the same rho. - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - pot.v_of_rho(chr.rho, en.ehart, en.etxc, en.vtxc, pot.vr); - en.delta_escf(); - if (vext == 0) pot.set_vrs(pw.doublegrid); - else pot.set_vrs_tddft(pw.doublegrid, istep); - } - } - - //fuxiang add 2016-11-1 - - if(tddft==1 && iter == 1) - { - this->WFC_init = new complex**[kv.nks]; - for(int ik=0; ikWFC_init[ik] = new complex*[NBANDS]; - } - for(int ik=0; ikWFC_init[ik][ib] = new complex[NLOCAL]; - } - } - if(istep>=1) - { - for (int ik=0; ik(0.0,0.0); - } - } - } - } - } - - if(INPUT.dft_plus_u) dftu.cal_slater_UJ(istep, iter); // Calculate U and J if Yukawa potential is used - // (1) calculate the bands. - cal_bands(istep); - -// for(int ib=0; ibLOWF.init_Cij( 0 ); // check the orthogonality of local orbital. - //chr.sum_band(); use local orbital in plane wave basis to calculate bands. - // but must has evc first! - //------------------------------------------------------------------------- - - // (7) calculate delta energy - en.deband = en.delta_e(); - - // (8) Mix charge density - chr.mix_rho(dr2,0,DRHO2,iter,conv_elec); - - // Peize Lin add 2020.04.04 - if(restart.info_save.save_charge) - for(int is=0; is*** WFC_init; - this->WFC_init = new complex**[kv.nks]; - for(int ik=0; ikWFC_init[ik] = new complex*[NBANDS]; - } - for(int ik=0; ikWFC_init[ik][ib] = new complex[NLOCAL]; - } - } - - for (int ik=0; ik(0.0,0.0); - } - } - } - -// cal_bands(istep, WFC_init); - cal_bands(istep); - time_t time_finish=std::time(NULL); - OUT_TIME("cal_bands",time_start, time_finish); - - ofs_running << " end of band structure calculation " << endl; - ofs_running << " band eigenvalue in this processor (eV) :" << endl; - - for (int ik = 0; ik < kv.nks; ik++) - { - if (NSPIN==2) - { - if (ik == 0) ofs_running << " spin up :" << endl; - if (ik == ( kv.nks / 2)) ofs_running << " spin down :" << endl; - } - //out.printV3(ofs_running, kv.kvec_c[ik]); - - ofs_running << " k-points" << ik+1 << "(" << kv.nkstot << "): " << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y << " " << kv.kvec_c[ik].z << endl; - - for (int ib = 0; ib < NBANDS; ib++) - { - ofs_running << " spin" << kv.isk[ik]+1 << "final_state " << ib+1 << " " << wf.ekb[ik][ib] * Ry_to_eV << " " << wf.wg(ik, ib)*kv.nks << endl; - // cout << " spin" << kv.isk[ik]+1 << "final_state " << ib+1 << " " << wf.ekb[ik][ib] * Ry_to_eV << " " << wf.wg(ik, ib)*kv.nks << endl; - } - ofs_running << endl; - } - - // add by jingan in 2018.11.7 - if(CALCULATION == "nscf" && INPUT.towannier90) - { - toWannier90 myWannier(kv.nkstot,ucell.G); - myWannier.init_wannier(); - } - - // add by jingan - if (BERRY_PHASE && SYMMETRY == 0) - { - berryphase bp; - bp.Macroscopic_polarization(); - } - - return; -} - -#include "../src_parallel/subgrid_oper.h" -void Local_Orbital_Elec::cal_bands(const int &istep) -{ - TITLE("Local_Orbital_Elec","cal_bands"); - timer::tick("Local_Orbital_Elec","cal_bands",'E'); - - if(GAMMA_ONLY_LOCAL) - { - assert(NSPIN == kv.nks); - } - else - { - int start_spin = -1; - UHM.GK.reset_spin(start_spin); - UHM.GK.allocate_pvpR(); - } - - //ofs_running << " " <1) - { - LCAO_Vna lv; - lv.smooth_vl2(); - } - else if(VNA==1) - { - LCAO_Vna::smooth_vl1(); - } - } - } - } - - - // some preparation - //clock_t start=clock(); -// cout << " init s matrix = " << UHM.init_s << endl; - if(!UHM.init_s) - { - WARNING_QUIT("Hamilt_Linear::solve_using_cg","Need init S matrix firstly"); - } - - clock_t start_nscf=clock(); - - //-------------------------------------------- - // (3) folding matrix, - // and diagonalize the H matrix (T+Vl+Vnl). - //-------------------------------------------- - if(GAMMA_ONLY_LOCAL) - { - UHM.calculate_Hgamma(); - - // Effective potential of DFT+U is added to total Hamiltonian here; Quxin adds on 20201029 - if(INPUT.dft_plus_u) - { - dftu.cal_eff_pot_mat(ik, istep); - - const int spin = kv.isk[ik]; - for(int irc=0; irc= 1) diago = false; - if(diago) - { - timer::tick("Efficience","diago_k"); - Diago_LCAO_Matrix DLM; - DLM.solve_complex_matrix(ik, LOWF.WFC_K[ik], LOC.wfc_dm_2d.wfc_k[ik]); - timer::tick("Efficience","diago_k"); - } - else - { - timer::tick("Efficience","evolve_k"); - Evolve_LCAO_Matrix ELM; - ELM.evolve_complex_matrix(ik, LOWF.WFC_K[ik], WFC_init[ik]); - timer::tick("Efficience","evolve_k"); - } - timer::tick("Efficience","each_k"); - } - - -// cout << " In Local_Orbital_Elec" << endl; -// for(int ie=0; ieLOWF.c, - NBANDS, // row of op( Cij ), if 'T' or 'C', in fact this means the column number - wf.wanf2[0], - NLOCAL, // row of op( wf.wanf2[0] ) - ZERO, // see formula - wf.evc[0], - NBANDS // first dimension of evc - ); - } - else - { - wf.evc[0] = this->LOWF.c * wf.wanf2[0]; - } - */ - - clock_t finish_nscf=clock(); - const double duration = static_cast(finish_nscf - start_nscf) / CLOCKS_PER_SEC; - - - //ofs_running << setw(8) << ik+1 << setw(15) << duration << endl; - -// ofs_running << " TIME FOR K=" << ik << ": " << duration << endl; - } - - // delete at last time. - /*LiuXh modify 2019-07-15 - if(!GAMMA_ONLY_LOCAL) - { - UHM.GK.destroy_pvpR(); - } - LiuXh modify 2019-07-15*/ - if(!GAMMA_ONLY_LOCAL) - { - if(!ParaO.out_hsR) - { - UHM.GK.destroy_pvpR(); - } - } - timer::tick("Local_Orbital_Elec","cal_bands",'E'); - return; -} - -void Local_Orbital_Elec::init_mixstep_final_scf(void) -{ - TITLE("Local_Orbital_Elec","init_mixstep_final_scf"); - - chr.irstep=0; - chr.idstep=0; - chr.totstep=0; - - return; -} diff --git a/ABACUS.develop/source/src_lcao/local_orbital_elec.h b/ABACUS.develop/source/src_lcao/local_orbital_elec.h deleted file mode 100644 index f66b42bfa7..0000000000 --- a/ABACUS.develop/source/src_lcao/local_orbital_elec.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef LOCAL_ORBTIAL_ELEC -#define LOCAL_ORBITAL_ELEC - -#include "../src_pw/tools.h" -#include "../src_pw/threshold_elec.h" - -class Local_Orbital_Elec: private Threshold_Elec -{ -public: - Local_Orbital_Elec(){}; - ~Local_Orbital_Elec(){}; - - void scf(const int &istep); - void nscf(void); - - static int iter; - static double avg_iter; - - complex*** WFC_init; -protected: - static int istep; - -private: - void cal_bands(const int &istep); - void init_mixstep_final_scf(void); - - -}; - -#endif diff --git a/ABACUS.develop/source/src_lcao/local_orbital_ions.cpp b/ABACUS.develop/source/src_lcao/local_orbital_ions.cpp deleted file mode 100644 index e6d7f8d662..0000000000 --- a/ABACUS.develop/source/src_lcao/local_orbital_ions.cpp +++ /dev/null @@ -1,914 +0,0 @@ -#include "local_orbital_ions.h" -#include "src_pw/global.h" -#include "src_parallel/parallel_orbitals.h" -#include "src_lcao/sltk_atom_arrange.h" -#include "src_external/src_pdiag/pdiag_double.h" -#include "src_lcao/lcao_nnr.h" -#include "src_lcao/force_lcao.h" -#include "src_lcao/stress_lcao.h" -#include "src_lcao/istate_charge.h" -#include "src_lcao/istate_envelope.h" -#include "../src_lcao/hs_matrix.h" -#include "src_lcao/cal_r_overlap_R.h" -//#include "../src_siao/selinv.h" //mohan add 2012-05-13 - -Local_Orbital_Ions::Local_Orbital_Ions() -{} - -Local_Orbital_Ions::~Local_Orbital_Ions() -{} - -void Local_Orbital_Ions::opt_ions(void) -{ - TITLE("Local_Orbital_Ions","opt_ions"); - timer::tick("Local_Orbital_Ions","opt_ions",'C'); - - if(OUT_LEVEL=="i") - { - cout << setprecision(12); - cout<< " " << setw(7)<< "ISTEP" - <istep = 1; - int force_step = 1; - int stress_step = 1; - bool stop = false; - while(istep <= NSTEP && !stop) - { - time_t estart = time(NULL); - if(OUT_LEVEL=="ie" || OUT_LEVEL=="m") //xiaohui add "m" option, 2015-09-16 - { - //add 2015-09-06, xiaohui - //cout << " -------------------------------------------" << endl; - cout << " ---------------------------------------------------------" << endl; - if(CALCULATION=="relax") - { - cout << " RELAX IONS : " << istep << endl; - //cout << " ---------------------------------------------------------" << endl; - } - else if(CALCULATION=="cell-relax") - { - cout << " RELAX CELL : " << stress_step << endl; - cout << " RELAX IONS : " << force_step << " (in total: " << istep << ")" << endl; - //cout << " ---------------------------------------------------------" << endl; - } - else if(CALCULATION=="scf") - { - cout << " SELF-CONSISTENT : " << endl; - //cout << " ---------------------------------------------------------" << endl; - } - else if(CALCULATION=="md") //xiaohui add 2015-09-15 - { - if(mdtype==1||mdtype==2) - { - cout<<" Molecular Dynamics (NVT) STEP "<< MDNVT.step_rst + istep<0) - { - UHM.GK.allocate_pvnapR(); - } - } - - // (4) set the augmented orbitals index. - // after ParaO and GridT, - // this information is used to calculate - // the force. - LOWF.set_trace_aug(GridT); - - // (5) init density kernel - // (6) init wave functions. - if(GAMMA_ONLY_LOCAL) - { - // here we reset the density matrix dimension. - LOC.allocate_gamma(GridT); - LOWF.aloc_gamma_wfc(GridT); - } - else - { - LOWF.allocate_k(GridT); - LOC.allocate_DM_k(); - } - - //====================================== - // do the charge extrapolation before - // the density matrix is regenerated. - // mohan add 2011-04-08 - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // once the atom is move out of this processor, - // the density matrix will not map - // the 'moved' atom configuration, - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - //====================================== - // HOWEVER, I ACTUALLY FOUND THIS IS - // A BUG, BECAUSE THE INDEX GridT.trace_lo - // HAS BEEN REGENERATED, SO WE NEED TO - // REALLOCATE THE DENSITY MATRIX FIRST, - // THEN WE CAN READ IN DENSITY MATRIX, - // AND USE DENSITY MATRIX TO DO - // RHO CALCULATION. - // -- mohan 2013-03-31 - //====================================== - //if(pot.extra_pot==4 && istep>1) - if(pot.extra_pot=="dm" && istep>1)//xiaohui modify 2015-02-01 - { - for(int is=0; istau[ia].x*ucell.lat0; - CE.pos_now[3*iat+1] = atom->tau[ia].y*ucell.lat0; - CE.pos_now[3*iat+2] = atom->tau[ia].z*ucell.lat0; - - iat++; - } - } - } - - //2014-07-07, xiaohui - //cout<<"CALCULATION:"<output_HS_R(); //LiuXh add 2019-07-15 - - time_t fstart = time(NULL); - if (CALCULATION=="scf" || CALCULATION=="relax" || CALCULATION=="cell-relax") - { - //stop = this->force_stress(); - stop = this->force_stress(istep, force_step, stress_step); - } - time_t fend = time(NULL); - - //xiaohui add 2014-07-07, for second-order extrapolation - iat=0; - if(FORCE || CALCULATION=="md" ) - { - for(int it = 0;it < ucell.ntype;it++) - { - Atom* atom = &ucell.atoms[it]; - for(int ia =0;ia< ucell.atoms[it].na;ia++) - { - CE.pos_next[3*iat ] = atom->tau[ia].x*ucell.lat0; - CE.pos_next[3*iat+1] = atom->tau[ia].y*ucell.lat0; - CE.pos_next[3*iat+2] = atom->tau[ia].z*ucell.lat0; - - iat++; - } - } - } -///*LiuXh modify, 20180626 - //if(FORCE || CALCULATION=="md" ) - if(CALCULATION=="md" ) - { - //xiaohui add CE.istep = istep 2014-07-07 - CE.istep = istep; - - // charge extrapolation if istep>0. - CE.extrapolate_charge(); - - //if(pot.extra_pot==4) - if(pot.extra_pot=="dm")//xiaohui modify 2015-02-01 - { - // done after grid technique. - } - else - { - pot.init_pot( istep ); - } - } -//*/ - - - - // need to destroy the matrix. - if(!GAMMA_ONLY_LOCAL) - { - //mohan add 2012-06-12 - if(VNA>0) - { - UHM.GK.destroy_pvnapR(); - } - } - - if(OUT_LEVEL=="i") - { - double etime_min = difftime(eend, estart)/60.0; - double ftime_min = difftime(fend, fstart)/60.0; - stringstream ss; - ss << MOVE_IONS << istep; - - cout << setiosflags(ios::scientific) - << " " << setw(7) << ss.str() - << setw(5) << LOE.iter - << setw(18) << setprecision(6) << en.etot * Ry_to_eV; - - cout << setprecision(2) << setiosflags(ios::scientific) - << setw(10) << IMM.get_ediff() * Ry_to_eV * 1000 - << setw(10) << IMM.get_largest_grad() * Ry_to_eV / BOHR_TO_A; - //<< setw(12) << IMM.get_trust_radius(); - - cout << resetiosflags(ios::scientific) -// << setw(8) << IMM.get_update_iter() - << setprecision(2) << setw(10) << etime_min + ftime_min; - cout << endl; - } - //xiaohui modifed 2013-07-22, adding "//" before ... - //if(DIAGO_TYPE=="selinv") - //{ - // cout << " number of selected inversion: " << Selinv::niter_ion << endl; - // Selinv::niter_ion = 0; - //} - -//#ifdef __MPI //2015-09-06, xiaohui - //2015-05-07, 2015-10-01 - //atom_arrange::delete_vector( SEARCH_RADIUS ); -//#endif //2015-09-06, xiaohui - -//2015-09-16 -//#ifdef __MPI -// MPI_Barrier(MPI_COMM_WORLD); -// for (int i=0;i0) - { - UHM.GK.allocate_pvnapR(); - } - } - - // (4) set the augmented orbitals index. - // after ParaO and GridT, - // this information is used to calculate - // the force. - LOWF.set_trace_aug(GridT); - - // (5) init density kernel - // (6) init wave functions. - if(GAMMA_ONLY_LOCAL) - { - // here we reset the density matrix dimension. - LOC.allocate_gamma(GridT); - LOWF.aloc_gamma_wfc(GridT); - } - else - { - LOWF.allocate_k(GridT); - LOC.allocate_DM_k(); - } - - UHM.set_ion(); - - if(vdwd2.vdwD2) //Peize Lin add 2014-04-04, update 2019-04-26 - { - vdwd2.energy(); - } - if(vdwd3.vdwD3) //jiyy add 2019-05-18 - { - vdwd3.energy(); - } - LOE.scf(0); - - if(CALCULATION=="scf" || CALCULATION=="relax") - { - ofs_running << "\n\n --------------------------------------------" << endl; - ofs_running << setprecision(16); - ofs_running << " !FINAL_ETOT_IS " << en.etot * Ry_to_eV << " eV" << endl; - ofs_running << " --------------------------------------------\n\n" << endl; - } -*/ - } - - hm.hon.clear_after_ions(); - - - timer::tick("Local_Orbital_Ions","opt_ions",'C'); - return; -} - -//bool Local_Orbital_Ions::force_stress(void) -bool Local_Orbital_Ions::force_stress(const int &istep, int &force_step, int &stress_step) -{ - TITLE("Local_Orbital_Ions","force_stress"); - if(!FORCE && !STRESS) - { - return 1; - } - timer::tick("Local_Orbital_Ions","force_stress",'D'); - - //return 0; - - //if(FORCE) - if(FORCE && !STRESS) - { - //force_lo - Force_LCAO FL; // init the class. - FL.allocate (); - FL.start_force(); - - // (2) move the ions according to - // the algorithms of molecular dynamics. - //if(CALCULATION=="md") - //{ - // md.init_md(istep, FL.fcs); - //} - // move the atoms according to CG or BFGS - // methods. - //else - //{ - //---------- for test --------------------- - //FL.fcs.zero_out(); // mohan test - //ofstream ofs("tmp_force.txt"); - //ifstream ifs("tmp_force.txt"); - //for(int i=0; i> FL.fcs.c[i]; - //} - //ofs.close(); - //ifs.close(); - //----------------------------------------- - -#ifdef __MPI //2015-10-01, xiaohui - atom_arrange::delete_vector( SEARCH_RADIUS ); -#endif //2015-10-01, xiaohui - - //xiaohui add CALCULATION==relax 2015-09-30 - //if(CALCULATION=="relax") IMM.cal_movement(istep, FL.fcs, en.etot); - if(CALCULATION=="relax") - { - IMM.cal_movement(istep, istep, FL.fcs, en.etot); - - if(IMM.get_converged() || (istep==NSTEP)) - { - return 1; - } - else - { - CE.istep = istep; - CE.extrapolate_charge(); - - if(pot.extra_pot=="dm")//xiaohui modify 2015-02-01 - { - // done after grid technique. - } - else - { - pot.init_pot( istep ); - } - } - - return 0; - } - else - { - return 1; - } - - // mohan update 2013-04-11 - // setup the structure factor - // and do the density extraploation. - // for both ionic iteratoin and - // force calculations. - - //xiaohui modify 2014-08-09 - //pw.setup_structure_factor(); - - // charge extrapolation if istep>0. - //xiaohui modify 2014-08-09 - //CE.extrapolate_charge(); - -/*xiaohui modify 2014-08-09 - if(pot.extra_pot==4) - { - // done after grid technique. - } - else - { - pot.init_pot( istep ); - } -xiaohui modify 2014-08-09*/ - } - - static bool converged_force = false; - static bool converged_stress = false; - - if(!FORCE&&STRESS) - { - Force_LCAO FL; // init the class. - matrix stress_lcao;//this is the stress matrix same as src_pw/ion.cpp - stress_lcao.create(3,3); - FL.cal_stress(stress_lcao); - -#ifdef __MPI - atom_arrange::delete_vector( SEARCH_RADIUS ); -#endif - if(CALCULATION=="cell-relax") - { - LCM.cal_lattice_change(stress_step, stress_lcao, en.etot); - converged_stress = LCM.get_converged(); - if(converged_stress) - { - return 1; - } - else - { - Run_Frag::frag_init_after_vc(); - pot.init_pot(stress_step); - - ++stress_step; - return 0; - } - } - else - { - return 1; - } - } - - if(FORCE&&STRESS) - { - Force_LCAO FL; // init the class. - FL.allocate (); - FL.start_force(); - -//#ifdef __MPI - atom_arrange::delete_vector( SEARCH_RADIUS ); -//#endif - - //if(CALCULATION=="relax") IMM.cal_movement(istep, FL.fcs, en.etot); - if(CALCULATION=="relax" || CALCULATION=="cell-relax") - { - IMM.cal_movement(istep, force_step, FL.fcs, en.etot); - - if(IMM.get_converged()) - { - force_step = 1; - - matrix stress_lcao;//this is the stress matrix same as src_pw/ion.cpp - stress_lcao.create(3,3); - FL.cal_stress(stress_lcao); - - if(CALCULATION=="cell-relax") - { - LCM.cal_lattice_change(stress_step, stress_lcao, en.etot); - converged_stress = LCM.get_converged(); - if(converged_stress) - { - return 1; - } - else - { - Run_Frag::frag_init_after_vc(); - pot.init_pot(stress_step); - - ++stress_step; - return 0; - } - } - else - { - return 1; - } - -#ifdef __MPI - //atom_arrange::delete_vector( SEARCH_RADIUS ); -#endif - } - else - { -#ifdef __MPI - //atom_arrange::delete_vector( SEARCH_RADIUS ); -#endif - //CE.istep = istep; - CE.istep = force_step; - CE.extrapolate_charge(); - - if(pot.extra_pot=="dm")//xiaohui modify 2015-02-01 - { - // done after grid technique. - } - else - { - pot.init_pot( istep ); - } - ++force_step; - return 0; - } - } - else - { - matrix stress_lcao;//this is the stress matrix same as src_pw/ion.cpp - stress_lcao.create(3,3); - FL.cal_stress(stress_lcao); - - return 1; - } - } - - return 0; - - timer::tick("Local_Orbital_Ions","force_stress",'D'); -} - -void Local_Orbital_Ions::final_scf(void) -{ - TITLE("Local_Orbital_Ions","final_scf"); - - FINAL_SCF = true; - Run_Frag::final_calculation_after_vc(); - atom_arrange::set_sr_NL(); - atom_arrange::search( SEARCH_RADIUS ); - GridT.set_pbc_grid( - pw.ncx, pw.ncy, pw.ncz, - pw.bx, pw.by, pw.bz, - pw.nbx, pw.nby, pw.nbz, - pw.nbxx, pw.nbzp_start, pw.nbzp, VNA); - - // (2) If k point is used here, allocate HlocR after atom_arrange. - if(!GAMMA_ONLY_LOCAL) - { - // For each atom, calculate the adjacent atoms in different cells - // and allocate the space for H(R) and S(R). - LNNR.cal_nnr(); - LM.allocate_HS_R(LNNR.nnr); - } - if(!GAMMA_ONLY_LOCAL) - { - // need to first calculae lgd. - // using GridT.init. - LNNR.cal_nnrg(GridT); - //mohan add 2012-06-12 - //the pvnapR need nnrg. - if(VNA>0) - { - UHM.GK.allocate_pvnapR(); - } - } - - // (4) set the augmented orbitals index. - // after ParaO and GridT, - // this information is used to calculate - // the force. - LOWF.set_trace_aug(GridT); - - // (5) init density kernel - // (6) init wave functions. - if(GAMMA_ONLY_LOCAL) - { - // here we reset the density matrix dimension. - LOC.allocate_gamma(GridT); - LOWF.aloc_gamma_wfc(GridT); - } - else - { - LOWF.allocate_k(GridT); - LOC.allocate_DM_k(); - } - - UHM.set_ion(); - - if(vdwd2.vdwD2) //Peize Lin add 2014-04-04, update 2019-04-26 - { - vdwd2.energy(); - } - if(vdwd3.vdwD3) //jiyy add 2019-05-18 - { - vdwd3.energy(); - } - LOE.scf(0); - - if(CALCULATION=="scf" || CALCULATION=="relax") - { - ofs_running << "\n\n --------------------------------------------" << endl; - ofs_running << setprecision(16); - ofs_running << " !FINAL_ETOT_IS " << en.etot * Ry_to_eV << " eV" << endl; - ofs_running << " --------------------------------------------\n\n" << endl; - } - - return; -} - -void Local_Orbital_Ions::output_HS_R(void) -{ - TITLE("Local_Orbital_Ions","output_HS_R"); - timer::tick("Local_Orbital_Ions","output_HS_R",'D'); - - // add by jingan for out r_R matrix 2019.8.14 - if(INPUT.out_r_matrix) - { - cal_r_overlap_R r_matrix; - r_matrix.init(); - r_matrix.out_r_overlap_R(NSPIN); - } - - if(NSPIN==1||NSPIN==4) - { - UHM.calculate_STN_R(); - UHM.GK.cal_vlocal_R(0); - UHM.GK.distribute_pvpR_tr(); - HS_Matrix::save_HSR_tr(0); - } - ///* - else if(NSPIN==2) - { - UHM.calculate_STN_R(); - for(int ik=0; iknaux = 0; - for(int it=0; it=L0) - { - for(int N1=0; N1WFC_GAMMA_B[is][i]; - } - delete[] this->WFC_GAMMA_B[is]; - } - delete[] this->WFC_GAMMA_B; - } - else - { - for(int is=0; isWFC_GAMMA[is][i]; - } - delete[] this->WFC_GAMMA[is]; - } - delete[] this->WFC_GAMMA; - } - } - // used for force if(allocate_aug_flag) { @@ -187,203 +159,6 @@ void Local_Orbital_wfc::allocate_k(const Grid_Technique >) return; } -//================================================================ -// FUNCTION: -// wave functions must be distributed. -// wave functions are used to construct the new charge density. -//================================================================ -void Local_Orbital_wfc::aloc_gamma_wfc(const Grid_Technique >) -{ - TITLE("Local_Orbital_wfc","aloc_gamma_wfc"); - -// if(DIAGO_TYPE=="selinv") return; //mohan add 2011-10-23 - - if(NLOCAL < NBANDS) - { - WARNING_QUIT("Local_Orbital_wfc::allocate","NLOCALWFC_GAMMA_B[is][ib]; - } - } - } - else - { - for(int is=0; isWFC_GAMMA[is][ib]; - } - } - } - allocate_flag = false; - } - - // mohan fix bug 2011-03-15 - static bool first = true; - if(first) - { - if(BFIELD) - { - this->WFC_GAMMA_B = new complex**[NSPIN]; - for(int is=0; isWFC_GAMMA_B[is] = new complex*[NBANDS]; - } - } - else - { - this->WFC_GAMMA = new double**[NSPIN]; - for(int is=0; isWFC_GAMMA[is] = new double*[NBANDS]; - } - } - first=false; - } - - // mohan add 2010-09-06 - if( gt.lgd != 0) - { - // Create wave functions(Coefficients) in local basis. - // Same as evc in plane wave basis. - if(BFIELD) - { - for(int is=0; isWFC_GAMMA_B[is][ib] = new complex[gt.lgd]; - ZEROS(this->WFC_GAMMA_B[is][ib],gt.lgd); - } - Memory::record("LocalOrbital_Coef","WFC_GAMMA_B",NSPIN*NBANDS*NLOCAL,"cdouble"); - allocate_flag = true; - } - } - else - { - for(int is=0; isWFC_GAMMA[is][ib] = new double[gt.lgd]; - ZEROS(this->WFC_GAMMA[is][ib],gt.lgd); - } - Memory::record("LocalOrbital_Coef","WFC_GAMMA",NSPIN*NBANDS*NLOCAL,"double"); - allocate_flag = true; - } - } - } - - OUT(ofs_running,"start_wfc",wf.start_wfc); - if(wf.start_wfc == "atomic" ) - { - // Bfield - if(BFIELD) - { - for(int is=0; is=0) - { - // be careful! std::rand must be translated to double! - // c[i][j] = static_cast( std::rand() ) / RAND_MAX ; - - // mohan modify 2010-07-02 - this->WFC_GAMMA_B[is][i][mu] = complex(1.0, 0.0); - } - } - }// j - }// i - }// is - } - // no Bfield - else - { - for(int is=0; is=0) - { - // be careful! std::rand must be translated to double! -// this->WFC_GAMMA[is][i][mu] = static_cast( std::rand() ) / RAND_MAX ; - - // mohan modify 2010-07-02 - this->WFC_GAMMA[is][i][mu] = 1.0; - } - } - }// j - }// i - }// is - } -// cout << " set LCAO wave fuctions to unit." << endl; - } - else if(wf.start_wfc == "file") - { - int error; - if(BFIELD) - { - cout << " not implemented read_lowf for B field yet." << endl; - WARNING_QUIT("Local_Orbital_wfc::aloc_gamma_wfc","not implement yet"); - } - else - { - for(int is=0; isWFC_GAMMA[is] ); - } - } -#ifdef __MPI - Parallel_Common::bcast_int(error); -#endif - ofs_running << " Error=" << error << endl; - if(error==1) - { - WARNING_QUIT("Local_Orbital_wfc","Can't find the wave function file: LOWF.dat"); - } - else if(error==2) - { - WARNING_QUIT("Local_Orbital_wfc","In wave function file, band number doesn't match"); - } - else if(error==3) - { - WARNING_QUIT("Local_Orbital_wfc","In wave function file, nlocal doesn't match"); - } - } - else - { - WARNING_QUIT("Local_Orbital_wfc","check the parameter: start_wfc"); - } - - - return; -} void Local_Orbital_wfc::set_trace_aug(const Grid_Technique >) { @@ -392,8 +167,10 @@ void Local_Orbital_wfc::set_trace_aug(const Grid_Technique >) // this function must be called after ParaO.trace_loc_row // , ParaO.trace_loc_col and GridT.trace_lo have been called. - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") ofs_running << "\n SETUP ARRAY FOR EXTRA WAVE FUNCTIONS" << endl; + if(OUT_LEVEL != "m") + { + ofs_running << "\n SETUP ARRAY FOR EXTRA WAVE FUNCTIONS" << endl; + } bool* occ2d = new bool[NLOCAL]; for(int i=0; itrace_aug[i] = daug; -// ofs_running << " report daug " << setw(5) << i << setw(5) << daug << endl; ++daug; } } @@ -442,10 +218,6 @@ void Local_Orbital_wfc::set_trace_aug(const Grid_Technique >) //--------------------------------- //second part: prepare for c_aug. //--------------------------------- - // mohan add 2010-09-26 - //OUT(ofs_running,"allocate_aug_flag",allocate_aug_flag); - - // mohan fix bug 2011-03-03 static bool first = true; if(first) { @@ -480,7 +252,7 @@ void Local_Orbital_wfc::set_trace_aug(const Grid_Technique >) } } } - else //mohan add 2012-01-08 + else { for(int ik=0; ikWFC_GAMMA[is][m][j]; - // if(j%8==0) ofs_running << endl; - // ofs_running << setw(15) << psi[j]; - } - - //ofs_running << endl; - - // calculate S|psi> - //hm.s_1psi_real(NLOCAL, psi, sc); - - // calculate - double norm = 0.0; - for(int j=0; j 0.0 ); - norm = sqrt( norm ); - - ofs_running << " " << setw(8) << m+1 << setw(20) << norm; - // if we want to make sure the c orthogonal, - // we need =delta_{ij} - if(change_c) - { - // normalize using . - for(int j=0; jWFC_GAMMA[is][m][j] = psi[j]; - } - - // check the norm again. - //hm.s_1psi_real(NLOCAL, psi, sc); // sphi = S|psi(m)> - - norm = 0.0; - for(int j=0; j 0.0 ); - norm = sqrt( norm ); - ofs_running << setw(20) << norm << endl; - - } - } - } - - if(!change_c) return; - - for(int is=0; ischeck_orthogonal(psi, sc, is); - - if(which_band == -1) - { - OUT(ofs_running,"all bands orthogonal", "true"); - } - else - { - OUT(ofs_running,"not orthogonal band",which_band); - BLOCK_HERE("orthogonal"); - } - } - - delete[] psi; - delete[] sc; - timer::tick("Local_Orbital_wfc","init_Cij"); - return; -} - -/* xiaohui modified 2013-04-24 -int Local_Orbital_wfc::check_orthogonal(double *psi, double *sc, const int &is) -{ - Diago_CG_Real::reduce_type = 1; - - // make cij orthogonal - double *tmpc = new double[NLOCAL]; - for(int m=0; m*** WFC_GAMMA_B; // WFC_GAMMA for B field calculation. - // used to generate density matrix: LOC.DM_R, // which is used to calculate the charge density. // which is got after the diagonalization of @@ -33,7 +31,6 @@ class Local_Orbital_wfc int daug; void allocate_k(const Grid_Technique >); - void aloc_gamma_wfc(const Grid_Technique >); void set_trace_aug(const Grid_Technique >); bool get_allocate_aug_flag(void)const{return allocate_aug_flag;} @@ -42,7 +39,7 @@ class Local_Orbital_wfc // (1) Unit // (2) Orthogonal = \delta{ij} //========================================= - void init_Cij(const bool change_c = 1); + // void init_Cij(const bool change_c = 1); bool get_allocate_flag(void)const{return allocate_flag;} private: @@ -51,7 +48,6 @@ class Local_Orbital_wfc bool complex_flag; bool allocate_flag; bool allocate_aug_flag; - int check_orthogonal(double *psi, double *sc, const int &is); }; diff --git a/ABACUS.develop/source/src_lcao/make_overlap_table.cpp b/ABACUS.develop/source/src_lcao/make_overlap_table.cpp deleted file mode 100644 index 1b344e61c1..0000000000 --- a/ABACUS.develop/source/src_lcao/make_overlap_table.cpp +++ /dev/null @@ -1,1465 +0,0 @@ -#include "make_overlap_table.h" -#include "lcao_orbitals.h" -#include "../src_global/sph_bessel.h" - -#include -double Make_Overlap_Table::dr = -1.0; - -Make_Overlap_Table::Make_Overlap_Table() -{ -// cout << " \n Make_Overlap_Table::Make_Overlap_Table" << endl; - destroy_sr = false; - destroy_tr = false; - destroy_nr = false; - - ntype = 0; - lmax = 0; - kmesh = 0; - Rmax = 0.0; - dr = 0.0; - dk = 0.0; - - nlm = 0; - Rmesh = 0; - - kpoint = new double[1]; - r=new double[1]; - rab=new double[1]; - kab=new double[1]; -} - -Make_Overlap_Table::~Make_Overlap_Table() -{ - delete[] kpoint; - delete[] r; - delete[] rab; - delete[] kab; -} - -void Make_Overlap_Table::allocate -( - const int &ntype_in, - const int &lmax_in, - const int &kmesh_in, - const double &Rmax_in, - const double &dr_in, - const double &dk_in -) -{ - TITLE("Make_Overlap_Table", "allocate"); - - this->ntype = ntype_in;// type of elements. - this->lmax = lmax_in; - this->kmesh = kmesh_in; - this->Rmax = Rmax_in; - this->dr = dr_in; - this->dk = dk_in; - - assert(ntype > 0); - assert(lmax >= 0); - assert(kmesh > 0.0); - assert(Rmax >= 0.0); - assert(dr>0.0); - assert(dk>0.0); - - // calculated from input parameters - this->nlm = (2*lmax+1) * (2*lmax+1); - this->Rmesh = static_cast( Rmax/dr ) + 4; - if(Rmesh%2==0) - { - ++Rmesh; - } - -// OUT(ofs_running,"lmax",lmax); -// OUT(ofs_running,"Rmax (Bohr)",Rmax); -// OUT(ofs_running,"dr (Bohr)",dr); -// OUT(ofs_running,"dk",dk); -// OUT(ofs_running,"nlm",nlm); -// OUT(ofs_running,"kmesh",kmesh); - - delete[] kpoint; - delete[] r; - kpoint = new double[kmesh]; - r = new double[Rmesh]; - - delete[] rab; - delete[] kab; - kab = new double[kmesh]; - rab = new double[Rmesh]; - - for (int ik = 0; ik < kmesh; ik++) - { - kpoint[ik] = ik * dk_in; - kab[ik] = dk_in; - } - - for (int ir = 0; ir < Rmesh; ir++) - { - r[ir] = ir * dr; - rab[ir] = dr; - } - -// OUT(ofs_running,"allocate kpoint, r, rab, kab","Done"); - return; -} - -int Make_Overlap_Table::get_rmesh(const double &R1, const double &R2) -{ - int rmesh = static_cast((R1+R2)/ Make_Overlap_Table::dr) + 5; - //mohan update 2009-09-08 +1 ==> +5 - //considering interpolation or so on... - if (rmesh % 2 == 0) rmesh ++; - - if(rmesh <= 0) - { - ofs_warning << "\n R1 = " << R1 << " R2 = " << R2; - ofs_warning << "\n rmesh = " << rmesh; - WARNING_QUIT("Make_Overlap_Table::get_rmesh", "rmesh <= 0"); - } - return rmesh; -} - -// Peize Lin accelerate 2017-10-02 -void Make_Overlap_Table::cal_ST_Phi12_R -( - const int &job, - const int &l, - const Numerical_Orbital_Lm &n1, - const Numerical_Orbital_Lm &n2, - const int &rmesh, - double* rs, - double* drs -) const -{ -// TITLE("Make_Overlap_Table","cal_ST_Phi12_R"); - timer::tick("Make_Overlap_Table", "cal_ST_Phi12_R"); - - double* k1_dot_k2 = new double[kmesh]; - double* k1_dot_k2_dot_kpoint = new double[kmesh]; - - // Peize Lin change 2017-12-12 - switch(job) - { - case 1: // calculate overlap - if( !n1.get_psif().empty() && !n2.get_psi_k2().empty() ) - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsif(ik) * n2.getPsi_k2(ik); - else if( !n1.get_psi_k().empty() && !n2.get_psi_k().empty() ) - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); - else if( !n1.get_psi_k2().empty() && !n2.get_psif().empty() ) - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsif(ik); - break; - case 2: // calculate kinetic energy - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsi_k2(ik); - break; - } - - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2_dot_kpoint[ik] = k1_dot_k2[ik] * this->kpoint[ik]; - -// Mathzone_Add1::Sbt_new (3, l, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 2, rs); -// for (int ir = 0; ir < rmesh; ir++) rs[ir] *= FOUR_PI; - - //test -// double tmporg = Mathzone_Add1::uni_simpson (k1_dot_k2, kmesh, dk); -// tmporg *= FOUR_PI; - - //liaochen modify on 2010/4/21 - //for origin - - //Drs - //djl = (l*j(l-1) - (l+1)j(l+1))/(2l+1) - /* - if (l == 0) - { - double* tmp1 = new double[rmesh]; - ZEROS (tmp1, rmesh); - Mathzone_Add1::Sbt_new (3, 1, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 1, tmp1); - for (int ir = 0; ir < rmesh; ir++) drs[ir] = -FOUR_PI*tmp1[ir]; - delete[] tmp1; - } - else - { - double* tmp1 = new double[rmesh]; - double* tmp2 = new double[rmesh]; - ZEROS (tmp1, rmesh); - ZEROS (tmp2, rmesh); - Mathzone_Add1::Sbt_new (3, l-1, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 1, tmp1); - Mathzone_Add1::Sbt_new (3, l+1, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 1, tmp2); - for (int ir = 0; ir < rmesh; ir++) drs[ir] = FOUR_PI*(l*tmp1[ir]-(l+1)*tmp2[ir])/(2.0*l+1); - delete[] tmp1; - delete[] tmp2; - } - */ - - //previous version - - double* integrated_func = new double[kmesh]; - -// double* jl = new double[kmesh]; - - const vector> &jlm1 = pSB->get_jlx()[l-1]; - const vector> &jl = pSB->get_jlx()[l]; - const vector> &jlp1 = pSB->get_jlx()[l+1]; - - for (int ir = 0; ir < rmesh; ir++) - { -// ZEROS(integrated_func,kmesh); -// ZEROS(jl,kmesh); - // Generate Spherical Bessel Function -// Mathzone::Spherical_Bessel(this->kmesh,this->kpoint,this->r[ir], l, jl); - - const vector &jl_r = jl[ir]; - for (int ik=0; ik 0) - { - // ZEROS(jl,kmesh); - // Mathzone::Spherical_Bessel(this->kmesh,this->kpoint,this->r[ir], l-1, jl); - - const vector &jlm1_r = jlm1[ir]; - for (int ik=0; ikkmesh,this->kpoint,this->r[ir], l+1, jl); - - const vector &jlp1_r = jlp1[ir]; - for (int ik=0; ik &jlm1_r = jlm1[ir]; - const vector &jlp1_r = jlp1[ir]; - const double fac = l/(l+1.0); - if( l==0 ) - for (int ik=0; ik 0) - { - ZEROS(integrated_func,kmesh); - double temp = 0.0; - - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); - } - - // Call simpson integration - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); - rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; - } - -// delete [] jl; - delete [] integrated_func; - delete [] k1_dot_k2; - delete [] k1_dot_k2_dot_kpoint; - - /* - double* integrated_func1 = new double[kmesh]; - double* integrated_func2 = new double[kmesh]; - - for (int ir = 0; ir < rmesh; ir++) - { - ZEROS(integrated_func1, kmesh); - ZEROS(integrated_func2, kmesh); -// ZEROS(jl, kmesh); -// ZEROS(djldr, kmesh); - - // Generate Spherical Bessel Function -// Mathzone::Spherical_Bessel(this->kmesh,this->kpoint,this->r[ir], l, jl, djldr); - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func1[ik] = this->jlx[ik][ir][l] * k1_dot_k2[ik]; - integrated_func2[ik] = this->djlx[ik][ir][l] * k1_dot_k2[ik] * this->kpoint[ik]; - } - // Call simpson integration - Mathzone::Simpson_Integral(kmesh,integrated_func1,kab,rs[ir]); - Mathzone::Simpson_Integral(kmesh,integrated_func2,kab,drs[ir]); - - rs[ir] *= FOUR_PI; - drs[ir] *= FOUR_PI; - } - - - delete[] integrated_func1; - delete[] integrated_func2; -// delete[] jl; - */ - - timer::tick("Make_Overlap_Table", "cal_ST_Phi12_R"); - - return; -} - -/* -// Peize Lin add 2017-10-13 -void Make_Overlap_Table::cal_ST_Phi12_R -( - const int &job, - const int &l, - const Numerical_Orbital_Lm &n1, - const Numerical_Orbital_Lm &n2, - const set &radials, - double* rs, - double* drs -) const -{ -// TITLE("Make_Overlap_Table","cal_ST_Phi12_R"); - timer::tick("Make_Overlap_Table", "cal_ST_Phi12_R"); - - vector k1_dot_k2(kmesh); - switch(job) - { - case 1: // calculate overlap - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); - break; - - case 2: // calculate kinetic energy - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik) * this->kpoint[ik] * this->kpoint[ik]; - break; - } - - vector k1_dot_k2_dot_kpoint(kmesh); - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2_dot_kpoint[ik] = k1_dot_k2[ik] * this->kpoint[ik]; - - - vector integrated_func(kmesh); - - const vector> &jlm1 = pSB->get_jlx()[l-1]; - const vector> &jl = pSB->get_jlx()[l]; - const vector> &jlp1 = pSB->get_jlx()[l+1]; - - for( const size_t &ir : radials ) - { - // if(rs[ir]) => rs[ir] has been calculated - // if(drs[ir]) => drs[ir] has been calculated - // Actually, if(ir[ir]||dr[ir]) is enough. Double insurance for the sake of avoiding numerical errors - if( rs[ir] && drs[ir] ) continue; - - const vector &jl_r = jl[ir]; - for (int ik=0; ik &jlm1_r = jlm1[ir]; - const vector &jlp1_r = jlp1[ir]; - const double fac = l/(l+1.0); - if( l==0 ) - for (int ik=0; ik 0) - { - if( radials.find(0)!=radials.end() ) - { - for (int ik = 0; ik < kmesh; ik++) - integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); - double temp = 0.0; - // Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); - Mathzone::Simpson_Integral(kmesh,VECTOR_TO_PTR(integrated_func),dk,temp); - rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; - } - } - - timer::tick("Make_Overlap_Table", "cal_ST_Phi12_R"); - - return; -} -*/ - -// Peize Lin add 2017-10-27 -void Make_Overlap_Table::cal_ST_Phi12_R -( - const int &job, - const int &l, - const Numerical_Orbital_Lm &n1, - const Numerical_Orbital_Lm &n2, - const set &radials, - double* rs, - double* drs -) const -{ -// TITLE("Make_Overlap_Table","cal_ST_Phi12_R"); - timer::tick("Make_Overlap_Table", "cal_ST_Phi12_R"); - - vector k1_dot_k2(kmesh); - switch(job) - { - case 1: // calculate overlap - if( !n1.get_psif().empty() && !n2.get_psi_k2().empty() ) - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsif(ik) * n2.getPsi_k2(ik); - else if( !n1.get_psi_k().empty() && !n2.get_psi_k().empty() ) - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getPsi_k(ik); - else if( !n1.get_psi_k2().empty() && !n2.get_psif().empty() ) - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsif(ik); - break; - case 2: // calculate kinetic energy - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2[ik] = n1.getPsi_k2(ik) * n2.getPsi_k2(ik); - break; - } - - vector k1_dot_k2_dot_kpoint(kmesh); - for (int ik = 0; ik < kmesh; ik++) - k1_dot_k2_dot_kpoint[ik] = k1_dot_k2[ik] * this->kpoint[ik]; - - - vector integrated_func(kmesh); - - const vector> &jlm1 = pSB->get_jlx()[l-1]; - const vector> &jl = pSB->get_jlx()[l]; - const vector> &jlp1 = pSB->get_jlx()[l+1]; - - for( const size_t &ir : radials ) - { - // if(rs[ir]) => rs[ir] has been calculated - // if(drs[ir]) => drs[ir] has been calculated - // Actually, if(ir[ir]||dr[ir]) is enough. Double insurance for the sake of avoiding numerical errors - if( rs[ir] && drs[ir] ) continue; - - const vector &jl_r = jl[ir]; - for (int ik=0; ik &jlm1_r = jlm1[ir]; - const vector &jlp1_r = jlp1[ir]; - const double fac = l/(l+1.0); - if( l==0 ) - for (int ik=0; ik 0) - { - if( radials.find(0)!=radials.end() ) - { - for (int ik = 0; ik < kmesh; ik++) - integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); - double temp = 0.0; - // Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); - Mathzone::Simpson_Integral(kmesh,VECTOR_TO_PTR(integrated_func),dk,temp); - rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; - } - } - - timer::tick("Make_Overlap_Table", "cal_ST_Phi12_R"); - - return; -} - - -void Make_Overlap_Table::cal_VNL_PhiBeta_R( - const int &l, - const Numerical_Orbital_Lm &n1, - const Numerical_Nonlocal_Lm &n2, - const int &rmesh, - double *rs, - double *drs) -{ - timer::tick ("Make_Overlap_Table", "VNL_PhiBeta_R"); - - assert(kmesh > 0); - - //start calc - double *k1_dot_k2 = new double[kmesh]; - - for (int ik = 0; ik < kmesh; ik++) - { - k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getBeta_k(ik); - } - -// Mathzone_Add1::Sbt_new (3, l, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 2, rs); -// for (int ir = 0; ir < rmesh; ir++) rs[ir] *= FOUR_PI; - - - //Drs - //djl = (l*j(l-1) - (l+1)j(l+1))/(2l+1) - /* - if (l == 0) - { - double* tmp1 = new double[rmesh]; - ZEROS (tmp1, rmesh); - Mathzone_Add1::Sbt_new (3, 1, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 1, tmp1); - for (int ir = 0; ir < rmesh; ir++) drs[ir] = -FOUR_PI*tmp1[ir]; - delete[] tmp1; - } - else - { - double* tmp1 = new double[rmesh]; - double* tmp2 = new double[rmesh]; - ZEROS (tmp1, rmesh); - ZEROS (tmp2, rmesh); - Mathzone_Add1::Sbt_new (3, l-1, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 1, tmp1); - Mathzone_Add1::Sbt_new (3, l+1, r, dr, rmesh, kpoint, dk, kmesh, k1_dot_k2, 1, tmp2); - for (int ir = 0; ir < rmesh; ir++) drs[ir] = FOUR_PI*(l*tmp1[ir]-(l+1)*tmp2[ir])/(2.0*l+1); - delete[] tmp1; - delete[] tmp2; - } - */ - - //previous version - double* integrated_func = new double[kmesh]; -// double* jl = new double[kmesh]; - - const vector> &jlm1 = pSB->get_jlx()[l-1]; - const vector> &jl = pSB->get_jlx()[l]; - const vector> &jlp1 = pSB->get_jlx()[l+1]; - for (int ir = 0; ir < rmesh; ir++) - { - ZEROS(integrated_func,kmesh); -// ZEROS(jl,kmesh); - double temp = 0.0; - // Generate Spherical Bessel Function -// Mathzone::Spherical_Bessel(this->kmesh,this->kpoint,this->r[ir], l, jl); - - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = jl[ir][ik] * k1_dot_k2[ik]; - } - // Call simpson integration - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); - rs[ir] = temp * FOUR_PI; - - //drs - double temp1, temp2; - - if (l > 0) - { -// ZEROS(jl,kmesh); -// Mathzone::Spherical_Bessel(this->kmesh,this->kpoint,this->r[ir], l-1, jl); - - for (int ik = 0; ik < kmesh; ik++) - integrated_func[ik] = jlm1[ir][ik] * k1_dot_k2[ik] * kpoint[ik]; - - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp1); - } - -// ZEROS(jl,kmesh); -// Mathzone::Spherical_Bessel(this->kmesh,this->kpoint,this->r[ir], l+1, jl); - - for (int ik = 0; ik < kmesh; ik++) - integrated_func[ik] = jlp1[ir][ik] * k1_dot_k2[ik] * kpoint[ik]; - - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp2); - - if (l == 0) - { - drs[ir] = -FOUR_PI*temp2; - } - else - { - drs[ir] = FOUR_PI*(temp1*l-(l+1)*temp2)/(2.0*l+1); - } - } - - //liaochen modify on 2010/4/22 - //special case for R=0 - //we store Slm(R) / R**l at the fisrt point, rather than Slm(R) - if (l > 0) - { - ZEROS(integrated_func,kmesh); - double temp = 0.0; - - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); - } - - // Call simpson integration - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); - rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; - } - - delete [] integrated_func; -// delete [] jl; - - /* - double* integrated_func1 = new double[kmesh]; - double* integrated_func2 = new double[kmesh]; - - for (int ir = 0; ir < rmesh; ir++) - { - ZEROS(integrated_func1, kmesh); - ZEROS(integrated_func2, kmesh); -// ZEROS(jl, kmesh); -// ZEROS(djldr, kmesh); - - // Generate Spherical Bessel Function -// Mathzone::Spherical_Bessel(this->kmesh,this->kpoint,this->r[ir], l, jl, djldr); - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func1[ik] = this->jlx[ik][ir][l] * k1_dot_k2[ik]; - integrated_func2[ik] = this->djlx[ik][ir][l] * k1_dot_k2[ik] * this->kpoint[ik]; - } - // Call simpson integration - Mathzone::Simpson_Integral(kmesh,integrated_func1,kab,rs[ir]); - Mathzone::Simpson_Integral(kmesh,integrated_func2,kab,drs[ir]); - - rs[ir] *= FOUR_PI; - drs[ir] *= FOUR_PI; - } - - delete [] integrated_func1; - delete [] integrated_func2; - */ - - delete[] k1_dot_k2; - timer::tick ("Make_Overlap_Table", "VNL_PhiBeta_R"); - return; -} - -void Make_Overlap_Table::init_Table( const int &job0 ) -{ - TITLE("Make_Overlap_Table", "init_Table"); - timer::tick("Make_Overlap_Table", "init_Table",'D'); - const int ntype = ORB.get_ntype(); - assert( Make_Overlap_Table::dr > 0.0); - assert( OV_nTpairs>0); - - // init 1st dimension - switch( job0 ) - { - case 1: - // the second dimension stands for S(R) and dS(R)/dR - this->Table_SR = new double****[2]; - for(int ir = 0; ir < 2; ir++) - { - this->Table_SR[ir] = new double***[ this->OV_nTpairs ]; - } - break; - - case 2: - this->Table_TR = new double****[2]; - for(int ir = 0; ir < 2; ir++) - { - this->Table_TR[ir] = new double***[ this->OV_nTpairs ]; - } - break; - - case 3: - this->Table_SR = new double****[2]; - this->Table_TR = new double****[2]; - for(int ir = 0; ir < 2; ir++) - { - this->Table_SR[ir] = new double***[ this->OV_nTpairs ]; - this->Table_TR[ir] = new double***[ this->OV_nTpairs ]; - } - break; - } - - for (int T1 = 0; T1 < ntype ; T1++) - { - // Notice !! T2 start from T1 - // means that T2 >= T1 - for (int T2 = T1 ; T2 < ntype ; T2++) - { - // get the bigger lmax between two types - const int Tpair=this->OV_Tpair(T1,T2); - const int Lmax1 = ORB.Phi[T1].getLmax(); - const int Lmax2 = ORB.Phi[T2].getLmax(); - - //L2plus1 could be reduced by considering Gaunt Coefficient - //remain to be modified - //?????? - const int lmax_now = std::max( Lmax1, Lmax2 ); - - - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // mohan add 2011-03-07 - // I think the lmax_now should be judged from two - // orbitals, not atom type!!!!!!!!!!!!! - // there are space that can imporve the efficiency. - //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - const int L2plus1 = 2*lmax_now + 1; - - const int nchi1 = ORB.Phi[T1].getTotal_nchi(); - const int nchi2 = ORB.Phi[T2].getTotal_nchi(); - const int pairs_chi = nchi1 * nchi2; - - // init 2nd dimension - switch( job0 ) - { - case 1: - this->Table_SR[0][ Tpair ] = new double**[pairs_chi]; - this->Table_SR[1][ Tpair ] = new double**[pairs_chi]; - break; - - case 2: - this->Table_TR[0][ Tpair ] = new double**[pairs_chi]; - this->Table_TR[1][ Tpair ] = new double**[pairs_chi]; - break; - - case 3: - for(int ir = 0; ir < 2; ir++) - { - this->Table_SR[ir][ Tpair ] = new double**[pairs_chi]; - this->Table_TR[ir][ Tpair ] = new double**[pairs_chi]; - } - break; - } - - const double Rcut1 = ORB.Phi[T1].getRcut(); - const double Rcut2 = ORB.Phi[T2].getRcut(); - assert(Rcut1>0.0 && Rcut1<100); - assert(Rcut2>0.0 && Rcut2<100); - - const int rmesh = this->get_rmesh( Rcut1, Rcut2); - assert( rmesh < this->Rmesh ); - - for (int L1 = 0; L1 < Lmax1 + 1; L1++) - { - for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); N1++) - { - for (int L2 = 0; L2 < Lmax2 + 1; L2 ++) - { - for (int N2 = 0; N2 < ORB.Phi[T2].getNchi(L2); N2++) - { - // get the second index. - const int Opair = this->OV_Opair(Tpair,L1,L2,N1,N2); - - // init 3rd dimension - switch( job0 ) - { - case 1: - this->Table_SR[0][ Tpair ][ Opair ] = new double *[L2plus1]; - this->Table_SR[1][ Tpair ][ Opair ] = new double *[L2plus1]; - break; - - case 2: - this->Table_TR[0][ Tpair ][ Opair ] = new double *[L2plus1]; - this->Table_TR[1][ Tpair ][ Opair ] = new double *[L2plus1]; - - case 3: - for(int ir = 0; ir < 2; ir++) - { - this->Table_SR[ir][ Tpair ][ Opair ] = new double *[L2plus1]; - this->Table_TR[ir][ Tpair ][ Opair ] = new double *[L2plus1]; - } - } - - - //L=|L1-L2|,|L1-L2|+2,...,L1+L2 - const int SL = abs(L1-L2); - const int AL = L1+L2; - - for (int L=0; L < L2plus1 ; L++) - { - //Allocation - switch ( job0 ) - { - case 1: - Table_SR[0][Tpair][Opair][L] = new double[rmesh]; - Table_SR[1][Tpair][Opair][L] = new double[rmesh]; - - Memory::record("Make_Overlap_Table","Table_SR", - 2*OV_nTpairs*pairs_chi*rmesh,"double"); - break; - - case 2: - Table_TR[0][Tpair][Opair][L] = new double[rmesh]; - Table_TR[1][Tpair][Opair][L] = new double[rmesh]; - - Memory::record("Make_Overlap_Table","Table_TR", - 2*OV_nTpairs*pairs_chi*rmesh,"double"); - break; - - case 3: - Table_SR[0][Tpair][Opair][L] = new double[rmesh]; - Table_SR[1][Tpair][Opair][L] = new double[rmesh]; - Table_TR[0][Tpair][Opair][L] = new double[rmesh]; - Table_TR[1][Tpair][Opair][L] = new double[rmesh]; - - Memory::record("Make_Overlap_Table","Table_SR&TR", - 2*2*OV_nTpairs*pairs_chi*rmesh,"double"); - break; - } - - //for those L whose Gaunt Coefficients = 0, we - //assign every element in Table_SR or Table_TR as zero - if ((L > AL) || (L < SL) || ((L-SL) % 2 == 1)) - { - switch ( job0 ) - { - case 1: - ZEROS (Table_SR[0][Tpair][Opair][L], rmesh); - ZEROS (Table_SR[1][Tpair][Opair][L], rmesh); - break; - - case 2: - ZEROS (Table_TR[0][Tpair][Opair][L], rmesh); - ZEROS (Table_TR[1][Tpair][Opair][L], rmesh); - break; - - case 3: - ZEROS (Table_SR[0][Tpair][Opair][L], rmesh); - ZEROS (Table_SR[1][Tpair][Opair][L], rmesh); - ZEROS (Table_TR[0][Tpair][Opair][L], rmesh); - ZEROS (Table_TR[1][Tpair][Opair][L], rmesh); - break; - } - - continue; - } - - switch( job0 ) - { - case 1: - { - this->cal_ST_Phi12_R(1,L, - ORB.Phi[T1].PhiLN(L1,N1), - ORB.Phi[T2].PhiLN(L2,N2), - rmesh, - Table_SR[0][Tpair][Opair][L], - Table_SR[1][Tpair][Opair][L]); - break; - } - case 2: - { - - this->cal_ST_Phi12_R(2,L, - ORB.Phi[T1].PhiLN(L1,N1), - ORB.Phi[T2].PhiLN(L2,N2), - rmesh, - Table_TR[0][Tpair][Opair][L], - Table_TR[1][Tpair][Opair][L]); - break; - } - case 3: - { - this->cal_ST_Phi12_R(1,L, - ORB.Phi[T1].PhiLN(L1,N1), - ORB.Phi[T2].PhiLN(L2,N2), - rmesh, - Table_SR[0][Tpair][Opair][L], - Table_SR[1][Tpair][Opair][L]); - - this->cal_ST_Phi12_R(2,L, - ORB.Phi[T1].PhiLN(L1,N1), - ORB.Phi[T2].PhiLN(L2,N2), - rmesh, - Table_TR[0][Tpair][Opair][L], - Table_TR[1][Tpair][Opair][L]); - break; - } - } - }//end m - } - }//end jl - } - }// end il - }// end jt - }// end it - - switch( job0 ) - { - case 1: - destroy_sr = true; - break; - - case 2: - destroy_tr = true; - break; - - case 3: - destroy_sr = true; - destroy_tr = true; - break; - } - - timer::tick("Make_Overlap_Table", "init_Table",'D'); - return; -} - -void Make_Overlap_Table::init_Table_Beta(void) -{ - TITLE("Make_Overlap_Table", "init_Table_Beta"); - timer::tick("Make_Overlap_Table", "init_Table_Beta",'D'); - - // (1) allocate 1st dimension ( overlap, derivative) - this->Table_NR = new double****[2]; - // (2) allocate 2nd dimension ( overlap, derivative) - this->Table_NR[0] = new double*** [this->NL_nTpairs]; - this->Table_NR[1] = new double*** [this->NL_nTpairs]; - - - // <1Phi|2Beta> - for (int T1 = 0; T1 < ntype ; T1++) // type 1 is orbital - { - for (int T2 = 0 ; T2 < ntype ; T2++)// type 2 is non-local projector - { - // Tpair: type pair. - const int Tpair=this->NL_Tpair(T1,T2); - const int Lmax1 = ORB.Phi[T1].getLmax(); - - const int NBeta = ORB.nproj[T2]; - - //------------------------------------------------------------- - // how many - // here we count all possible psi with (L,N) index for type T1. - //------------------------------------------------------------- - const int pairs_chi = ORB.Phi[T1].getTotal_nchi() * NBeta; - - // CAUTION!!! - // no matter nchi = 0 or NBeta = 0, - // means the Tpair in this table is never used! - if(pairs_chi == 0)continue; - - // init 2nd dimension - this->Table_NR[0][Tpair] = new double** [ pairs_chi ]; - this->Table_NR[1][Tpair] = new double** [ pairs_chi ]; - - const int T12_2Lplus1 = this->NL_L2plus1(T1,T2); - - const double Rcut1 = ORB.Phi[T1].getRcut(); - for (int L1 = 0; L1 < Lmax1 + 1; L1++) - { - for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); N1++) - { - - // number of projectors. - for (int nb = 0; nb < NBeta; nb ++) - { - const int L2 = ORB.Beta[T2].getL_Beta(nb); - - const double Rcut2 = ORB.Beta[T2].Proj[nb].getRcut(); - - const int Opair = this->NL_Opair(Tpair,L1,N1,nb); - assert( Opair < pairs_chi ); - - // init 3rd dimension - this->Table_NR[0][ Tpair ][ Opair ] = new double *[T12_2Lplus1]; - this->Table_NR[1][ Tpair ][ Opair ] = new double *[T12_2Lplus1]; - - const int rmesh = this->get_rmesh( Rcut1, Rcut2); - assert( rmesh < this->Rmesh ); - - //not all L in T12_2Lplus1 would function - const int SL = abs(L1-L2); - const int AL = L1+L2; - - for (int L=0; L < T12_2Lplus1 ; L++) - { - //Allocation - this->Table_NR[0][Tpair][Opair][L] = new double[rmesh]; - this->Table_NR[1][Tpair][Opair][L] = new double[rmesh]; - - Memory::record("Make_Overlap_Table","Table_NR", - 2*NL_nTpairs*pairs_chi*rmesh,"double"); - - //for those L whose Gaunt Coefficients = 0, we - //assign every element in Table_NR as zero - if ((L > AL) || (L < SL) || ((L-SL) % 2 == 1)) - { - ZEROS (Table_NR[0][Tpair][Opair][L], rmesh); - ZEROS (Table_NR[1][Tpair][Opair][L], rmesh); - - continue; - } - - assert(nb < ORB.nproj[T2]); - this->cal_VNL_PhiBeta_R(L, - ORB.Phi[T1].PhiLN(L1,N1), - ORB.Beta[T2].Proj[nb], // mohan update 2011-03-07 - rmesh, - this->Table_NR[0][Tpair][Opair][L], - this->Table_NR[1][Tpair][Opair][L]); - }// end T12_2Lplus1 - }// end L2 - }// end N1 - }// end L1 - }// end T2 - }// end T1 - destroy_nr = true; - - -// OUT(ofs_running,"allocate non-local potential matrix","Done"); - timer::tick("Make_Overlap_Table", "init_Table_Beta",'D'); - return; -} - - -void Make_Overlap_Table::Destroy_Table(void) -{ - if(!destroy_sr && !destroy_tr) return; - - const int ntype = ORB.get_ntype(); - int dim1 = 0; - for (int ir = 0; ir < 2; ir++) - { - for (int T1 = 0; T1 < ntype; T1++) - { - // Notice !! T2 start from T1 - // means that T2 >= T1 - for (int T2 = T1; T2 < ntype; T2++) - { - const int Lmax1 = ORB.Phi[T1].getLmax(); - const int Lmax2 = ORB.Phi[T2].getLmax(); - const int lmax_now = std::max(Lmax1, Lmax2); - const int pairs = ORB.Phi[T1].getTotal_nchi() * ORB.Phi[T2].getTotal_nchi(); - - for (int dim2 = 0; dim2 < pairs; dim2++) - { - for (int L = 0; L < 2*lmax_now + 1; L++) - { - if(destroy_sr) delete [] Table_SR[ir][dim1][dim2][L]; - if(destroy_tr) delete [] Table_TR[ir][dim1][dim2][L]; - } - if(destroy_sr) delete [] Table_SR[ir][dim1][dim2]; - if(destroy_tr) delete [] Table_TR[ir][dim1][dim2]; - } - if(destroy_sr) delete [] Table_SR[ir][dim1]; - if(destroy_tr) delete [] Table_TR[ir][dim1]; - dim1++; - - } - } - - dim1 = 0; - if(destroy_sr) delete [] Table_SR[ir]; - if(destroy_tr) delete [] Table_TR[ir]; - } - - if(destroy_sr) delete[] Table_SR; - if(destroy_tr) delete[] Table_TR; - - return; -} - -void Make_Overlap_Table::Destroy_Table_Beta(void) -{ - if(!destroy_nr) return; - - const int ntype = ORB.get_ntype(); - for(int ir = 0; ir < 2; ir ++) - { - for(int T1=0; T1NL_Tpair(T1,T2); - const int L2plus1 = this->NL_L2plus1(T1,T2); - const int pairs = ORB.Phi[T1].getTotal_nchi() * ORB.nproj[T2]; - - // mohan fix bug 2011-03-30 - if(pairs ==0) continue; - for(int dim2=0; dim20); - - this->OV_nTpairs = this->ntype * (this->ntype + 1) / 2; - this->OV_Tpair.create(ntype, ntype); - this->OV_L2plus1.create(ntype, ntype); // mohan fix bug 2011-03-14 - -// OUT(ofs_running,"Number of type pairs",this->OV_nTpairs); - - int index = 0; - for (int T1 = 0; T1 < ntype ; T1++) - { - // Notice !! T2 start from T1 - // means that T2 >= T1 - for (int T2 = T1 ; T2 < ntype ; T2++) - { - // (1) pairs about atom types - //liaochen modify 2010/8/4 - //index for T1>T2 is also needed - this->OV_Tpair(T2, T1) = index; - this->OV_Tpair(T1, T2) = this->OV_Tpair(T2, T1); - - ++index; - // (2) pairs about lmax - this->OV_L2plus1(T1,T2) = max(ORB.Phi[T1].getLmax(), ORB.Phi[T2].getLmax() )*2+1; - this->OV_L2plus1(T2,T1) = this->OV_L2plus1(T1,T2); - } - } - return; -} - - -void Make_Overlap_Table::init_NL_Tpair(void) -{ - TITLE("Make_Overlap_Table","init_NL_index"); - assert(ntype>0); - this->NL_nTpairs = this->ntype * this->ntype; - this->NL_Tpair.create( this->ntype, this->ntype); - this->NL_L2plus1.create( this->ntype, this->ntype); // mohan fix bug 2011-03-14 - -// OUT(ofs_running,"Number of Nonlocal Pairs",NL_nTpairs); - - int index = 0; - for (int T1 = 0; T1 < ntype ; T1++) - { - for (int T0 = 0 ; T0 < ntype ; T0++) - { - this->NL_Tpair(T1,T0) = index; - ++index; - - // the pair < psi | beta > - // be careful! This is not a symmetry matrix. - this->NL_L2plus1(T1,T0) = std::max(ORB.Phi[T1].getLmax(), ORB.Beta[T0].getLmax() )*2+1; - - // there are special situations: - // for example, two H atom without projector. - // if we use s orbital, - // Phi.getLmax = 0, - // Beta.getLmax < 0, - // so the value is 1. - // however, there are no projectors. - if(NL_L2plus1(T1,T0) <= 0) - { - WARNING_QUIT("Make_Overlap_Table::init_paris_nonlocal_type","NL_L2plus1<=0"); - } - } - } - return; -} - - -void Make_Overlap_Table::init_OV_Opair(void) -{ - const int lmax = ORB.get_lmax(); - const int nchimax = ORB.get_nchimax(); - assert(lmax+1 > 0); - assert(nchimax > 0); - assert(OV_nTpairs > 0); - - this->OV_Opair.create(OV_nTpairs, lmax+1, lmax+1, nchimax, nchimax); - - for(int T1=0; T1= T1 - for(int T2=T1; T2OV_Tpair(T1,T2); - int index=0; - for(int L1=0; L1OV_Opair(dim1, L1, L2, N1, N2) = index; - ++index; - } - } - } - } - } - } - return; -} - -void Make_Overlap_Table::init_NL_Opair(void) -{ - const int lmax = ORB.get_lmax(); - const int nchimax = ORB.get_nchimax(); - const int nprojmax = ORB.nprojmax; - - // may have bug if we use all H! - if( nprojmax == 0) - { - WARNING("Make_Overlap_Table","nproj for nonlocal pseudopotetials are zero, it must be all H atoms"); - return; - } - assert( NL_nTpairs > 0); - - this->NL_Opair.create( this->NL_nTpairs, lmax+1, nchimax, nprojmax); - - // <1psi|2beta> - // 1. orbital - for(int T1=0; T1NL_Tpair(T1, T0); - int index = 0; - for(int L1=0; L1NL_Opair(nlpair, L1, N1, ip) = index; - ++index; - } - } - } - } - } - - return; -} - -// Peize Lin update 2016-01-26 -void Make_Overlap_Table::init_Lmax (const int orb_num, const int mode, int &Lmax_used, int &Lmax) const -{ - auto cal_Lmax_Phi = [](int &Lmax) - { - //obtain maxL of all type - const int ntype = ORB.get_ntype(); - for (int it = 0; it < ntype; it++) - { - Lmax = std::max(Lmax, ORB.Phi[it].getLmax()); - } - }; - - auto cal_Lmax_Beta = [](int &Lmax) - { - // fix bug. - // mohan add the nonlocal part. - // 2011-03-07 - const int ntype = ORB.get_ntype(); - for(int it=0; it< ntype; it++) - { - Lmax = std::max(Lmax, ORB.Beta[it].getLmax()); - } - }; - - Lmax = -1; - - switch( orb_num ) - { - case 2: - switch( mode ) - { - case 1: // used in or - cal_Lmax_Phi(Lmax); - cal_Lmax_Beta(Lmax); - //use 2lmax+1 in dS - Lmax_used = 2*Lmax + 1; - break; -// case 2: // used in or -// Lmax = max(Lmax, Exx_Abfs::Lmax); -// Lmax_used = 2*Lmax + 1; -// break; - case 3: // used in berryphase by jingan - cal_Lmax_Phi(Lmax); - Lmax++; - Lmax_used = 2*Lmax + 1; - break; - default: - throw invalid_argument("Make_Overlap_Table::init_Lmax orb_num=2, mode error"); - break; - } - break; - case 3: - switch( mode ) - { -// case 1: // used in or -// cal_Lmax_Phi(Lmax); -// Lmax_used = 2*Lmax + 1; -// Lmax = max(Lmax, Exx_Abfs::Lmax); -// Lmax_used += Exx_Abfs::Lmax; -// break; - default: - throw invalid_argument("Make_Overlap_Table::init_Lmax orb_num=3, mode error"); - break; - } - break; - case 4: - switch( mode ) - { - case 1: // used in - cal_Lmax_Phi(Lmax); - Lmax_used = 2*( 2*Lmax + 1 ); - break; - default: - throw invalid_argument("Make_Overlap_Table::init_Lmax orb_num=4, mode error"); - break; - } - break; - default: - throw invalid_argument("Make_Overlap_Table::init_Lmax orb_num error"); - break; - } - -/* if( mode==1 || mode==2) - { - //obtain maxL of all type - - const int ntype = ORB.get_ntype(); - for (int it = 0; it < ntype; it++) - { - const int Lmax_now = ORB.Phi[it].getLmax (); - Lmax = max(Lmax, Lmax_now); - } - - if(mode==1) - { - // fix bug. - // mohan add the nonlocal part. - // 2011-03-07 - for(int it=0; it< ntype; it++) - { - const int Lmax_now = ORB.Beta[it].getLmax(); - Lmax = max(Lmax, Lmax_now); - } - } - - //use 2lmax+1 in dS - Lmax_used = 2*Lmax + 1; - - // Peize Lin add 2016-01-26 - if(mode==2) - { - Lmax = max(Lmax, Use_Psi3_Center2::exx_ri_lmax); - Lmax_used += Use_Psi3_Center2::exx_ri_lmax; - } - } - else if( mode==3 ) - { - Lmax = Use_Psi3_Center2::exx_ri_lmax; - Lmax_used = 2*Lmax + 1; - }*/ - - assert(Lmax_used >= 1); -} - -// Peize Lin update 2016-01-26 -void Make_Overlap_Table::init_Table_Spherical_Bessel (const int orb_num, const int mode, int &Lmax_used, int &Lmax) -{ - TITLE("Make_Overlap_Table", "init_Table_Spherical_Bessel"); - - this->init_Lmax (orb_num,mode,Lmax_used,Lmax); // Peize Lin add 2016-01-26 - - for( auto & sb : Sph_Bessel_Recursive_Pool::D2::sb_pool ) - if( this->dr * this->dk == sb.get_dx() ) - { - pSB = &sb; - break; - } - if(!pSB) - { - Sph_Bessel_Recursive_Pool::D2::sb_pool.push_back({}); - pSB = &Sph_Bessel_Recursive_Pool::D2::sb_pool.back(); - } - - pSB->set_dx( this->dr * this->dk ); - pSB->cal_jlx( Lmax_used, this->Rmesh, this->kmesh ); - -/* -// some data: -//L x Jl(x)old Jl(x)web(correct) -//0 4 -0.189201 -0.18920062383 -//1 11.7663 -0.0643896 -0.064389590588 -//3 1.5048 0.028574 0.028573980746 -//5 12.8544 -0.00829602 -0.0082960169277 -//6 12.8544 -0.0776037 -0.077603690549 -//7 12.8544 -0.0560009 -0.070186679825 -//7 12 -0.0198184 -0.024838740722 - int lll; - int ir; - int ik; - cout << " INPUT L: " ; cin >> lll; - cout << " INPUT ir: " ; cin >> ir; - cout << " INPUT ik: " ; cin >> ik; - double kr = r[ir] * kpoint[ik]; - cout << " L=" << lll << " kr=" << kr << " J=" << jlx[lll][ir][ik] << endl; - goto once_again; -*/ - - OUT(ofs_running,"lmax used to generate Jlq",Lmax_used); -// OUT(ofs_running,"kmesh",kmesh); -// OUT(ofs_running,"Rmesh",Rmesh); - Memory::record ("Make_Overlap_Table", "Jl(x)", (Lmax_used+1) * this->kmesh * this->Rmesh, "double"); -} diff --git a/ABACUS.develop/source/src_lcao/make_vna_table.cpp b/ABACUS.develop/source/src_lcao/make_vna_table.cpp deleted file mode 100644 index e1796c84af..0000000000 --- a/ABACUS.develop/source/src_lcao/make_vna_table.cpp +++ /dev/null @@ -1,355 +0,0 @@ -#include "make_vna_table.h" -#include "../src_pw/tools.h" -#include "ylm.h" -#include "lcao_orbitals.h" - -double Make_Vna_Table::dr = -1.0; - -Make_Vna_Table::Make_Vna_Table() -{ - ntype = 0; - lmax = 0; - kmesh = 0; - Rmax = 0.0; - dr = 0.0; - dk = 0.0; - - nlm = 0; - Rmesh = 0; - - kpoint = new double[1]; - r=new double[1]; - rab=new double[1]; - kab=new double[1]; -} - -Make_Vna_Table::~Make_Vna_Table() -{ - delete[] kpoint; - delete[] r; - delete[] rab; - delete[] kab; - -} - -void Make_Vna_Table::allocate ( - const int &ntype_in, - const int &lmax_in, - const int &kmesh_in, - const double &Rmax_in, - const double &dr_in, - const double &dk_in) -{ - TITLE("Make_Vna_Table", "allocate"); - - this->ntype = ntype_in;// type of elements. - this->lmax = lmax_in; - this->kmesh = kmesh_in; - this->Rmax = Rmax_in; - this->dr = dr_in; - this->dk = dk_in; - - assert(ntype > 0); - assert(lmax >= 0); - assert(kmesh > 0.0); - assert(Rmax >= 0.0); - assert(dr>0.0); - assert(dk>0.0); - - // calculated from input parameters - this->nlm = (2*lmax+1) * (2*lmax+1); - this->Rmesh = static_cast( Rmax/dr ) + 4; - if(Rmesh%2==0) - { - ++Rmesh; - } - - // rnew the arrays - delete[] kpoint; - delete[] r; - kpoint = new double[kmesh]; - r = new double[Rmesh]; - - delete[] rab; - delete[] kab; - kab = new double[kmesh]; - rab = new double[Rmesh]; - - // set the array values - for (int ik = 0; ik < kmesh; ik++) - { - this->kpoint[ik] = ik * dk_in; - this->kab[ik] = dk_in; - } - - for (int ir = 0; ir < Rmesh; ir++) - { - this->r[ir] = ir * dr; - this->rab[ir] = dr; - } - return; -} - - -int Make_Vna_Table::get_rmesh(const double &R1, const double &R2) -{ - int rmesh = static_cast((R1+R2)/ Make_Vna_Table::dr) + 5; - //mohan update 2009-09-08 +1 ==> +5 - //considering interpolation or so on... - if (rmesh % 2 == 0) rmesh ++; - - if(rmesh <= 0) - { - ofs_warning << "\n R1 = " << R1 << " R2 = " << R2; - ofs_warning << "\n rmesh = " << rmesh; - WARNING_QUIT("Make_Vna_Table::get_rmesh", "rmesh <= 0"); - } - return rmesh; -} - - -void Make_Vna_Table::init_Vna_Tpair(void) -{ - TITLE("Make_Vna_Table","init_Vna_Tpair"); - - this->Vna_nTpairs = this->ntype * this->ntype; - this->Vna_Tpair.create( this->ntype, this->ntype); - this->Vna_L2plus1.create( this->ntype, this->ntype); - - int index = 0; - for (int T1 = 0; T1 < ntype ; T1++) - { - for (int T0 = 0 ; T0 < ntype ; T0++) - { - this->Vna_Tpair(T1,T0) = index; - ++index; - - // the pair < psi | beta > - // be careful! This is not a symmetry matrix. - this->Vna_L2plus1(T1,T0) = std::max(ORB.Phi[T1].getLmax(), ORB.Beta[T0].getLmax() )*2+1; - - // there are special situations: - // for example, two H atom without projector. - // if we use s orbital, - // Phi.getLmax = 0, - // Beta.getLmax < 0, - // so the value is 1. - // however, there are no projectors. - if(Vna_L2plus1(T1,T0) <= 0) - { - WARNING_QUIT("Make_Vna_Table::init_paris_nonlocal_type","NL_L2plus1<=0"); - } - } - } - return; -} - - -void Make_Vna_Table::init_Table_Chi(void) -{ - TITLE("Make_Vna_Table", "init_Table_Chi"); - timer::tick("Make_Vna_Table", "init_Table_Chi",'D'); - - // (1) allocate 1st dimension ( overlap, derivative) - this->Table_VnaR = new double****[2]; - // (2) allocate 2nd dimension ( overlap, derivative) - this->Table_VnaR[0] = new double*** [this->Vna_nTpairs]; - this->Table_VnaR[1] = new double*** [this->Vna_nTpairs]; - - // <1Phi|2Chi> - for (int T1 = 0; T1 < ntype ; ++T1) // type 1 is orbital - { - const int Lmax1 = ORB.Phi[T1].getLmax(); - for (int T2 = 0 ; T2 < ntype ; ++T2)// type 2 is non-local projector - { - const int Lmax2 = ORB.Vna[T2].getLmax(); - - // Tpair: type pair. - const int Tpair=this->Vna_Tpair(T1,T2); - const int nchi1 = ORB.Phi[T1].getTotal_nchi(); - - const int nchi2 = ORB.Vna[T2].getTotal_nchi(); - const int pairs_chi = nchi1 * nchi2; - - if(pairs_chi == 0)continue; - - // init 2nd dimension - this->Table_VnaR[0][Tpair] = new double** [ pairs_chi ]; - this->Table_VnaR[1][Tpair] = new double** [ pairs_chi ]; - - const int T12_2Lplus1 = this->Vna_L2plus1(T1,T2); - const double Rcut1 = ORB.Phi[T1].getRcut(); - - for (int L1 = 0; L1 <= Lmax1; ++L1) - { - for (int N1 = 0; N1 < ORB.Phi[T1].getNchi(L1); ++N1) - { - for(int L2 = 0; L2 <= Lmax2; ++L2) - { - for(int N2 = 0; N2 < ORB.Vna[T2].getNchi(L2); ++N2) - { - const double Rcut2 = ORB.Vna[T2].rcut; - const int Opair = this->Vna_Opair(Tpair,L1,N1,L2,N2); - assert( Opair < pairs_chi ); - - // init 3rd dimension - this->Table_VnaR[0][ Tpair ][ Opair ] = new double *[T12_2Lplus1]; - this->Table_VnaR[1][ Tpair ][ Opair ] = new double *[T12_2Lplus1]; - - const int rmesh = this->get_rmesh( Rcut1, Rcut2); - assert( rmesh < this->Rmesh ); - - //not all L in T12_2Lplus1 would function - //const int SL = abs(L1-L2); - //const int AL = L1+L2; - - for (int L=0; L < T12_2Lplus1 ; L++) - { - //Allocation - this->Table_VnaR[0][Tpair][Opair][L] = new double[rmesh]; - this->Table_VnaR[1][Tpair][Opair][L] = new double[rmesh]; - - } - } - } - } - } - }//end T2 - }//end T1 - - - return; -} - - - - - -// phi is the atomic orbital, chi is the projector of Vna -void Make_Vna_Table::init_Vna_Opair(void) -{ - const int lmax = ORB.get_lmax(); - const int nchimax = ORB.get_nchimax(); - assert(lmax+1 > 0); - assert(nchimax > 0); - assert(Vna_nTpairs > 0); - - this->Vna_Opair.create( this->Vna_nTpairs, lmax+1, lmax+1, nchimax, nchimax); - - for(int T1=0; T1Vna_Tpair(T1,T2); - int index=0; - for(int L1=0; L1Vna_Opair(dim1, L1, L2, N1, N2) = index; - ++index; - } - } - } - } - } - } - return; -} - - -void Make_Vna_Table::cal_Vna_PhiChi_R( - const int &l, - const Numerical_Orbital_Lm &n1, - const Neutral_Pot &n2, - const int &rmesh, - double* rs, - double* drs) -{ - timer::tick("Make_Vna_Table","cal_Vna_PhiChi_R"); - - /* - assert(kmesh > 0); - double *k1_dot_k2 = new double[kmesh]; - for (int ik = 0; ik < kmesh; ik++) - { - // k1_dot_k2[ik] = n1.getPsi_k(ik) * n2.getChi_k(ik); - } - - double* integrated_func = new double[kmesh]; - double* jl; - - for (int ir = 0; ir < rmesh; ir++) - { - ZEROS(integrated_func,kmesh); - double temp = 0.0; - jl = this->jlx[l][ir]; - - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = jl[ik] * k1_dot_k2[ik]; - } - // Call simpson integration - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); - rs[ir] = temp * FOUR_PI; - - //drs - double temp1, temp2; - - if (l > 0) - { - jl = this->jlx[l-1][ir]; - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = jl[ik] * k1_dot_k2[ik] * kpoint[ik]; - } - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp1); - } - - jl = this->jlx[l+1][ir]; - - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = jl[ik] * k1_dot_k2[ik] * kpoint[ik]; - } - - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp2); - - if (l == 0) - { - drs[ir] = -FOUR_PI*temp2; - } - else - { - drs[ir] = FOUR_PI*(temp1*l-(l+1)*temp2)/(2.0*l+1); - } - } - - - //special case for R=0 - //we store Slm(R) / R**l at the fisrt point, rather than Slm(R) - if (l > 0) - { - ZEROS(integrated_func,kmesh); - double temp = 0.0; - - for (int ik = 0; ik < kmesh; ik++) - { - integrated_func[ik] = k1_dot_k2[ik] * pow (kpoint[ik], l); - } - - // Call simpson integration - Mathzone::Simpson_Integral(kmesh,integrated_func,kab,temp); - rs[0] = FOUR_PI / Mathzone_Add1::dualfac (2*l+1) * temp; - } - - delete[] integrated_func; - delete[] k1_dot_k2; - */ - timer::tick("Make_Vna_Table","cal_Vna_PhiChi_R"); - return; -} diff --git a/ABACUS.develop/source/src_lcao/make_vna_table.h b/ABACUS.develop/source/src_lcao/make_vna_table.h deleted file mode 100644 index f4b85bbdfb..0000000000 --- a/ABACUS.develop/source/src_lcao/make_vna_table.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef MAKE_VNA_TABLE_H -#define MAKE_VNA_TABLE_H - -#include "../src_pw/tools.h" -#include "neutral_pot.h" -#include "numerical_orbital_lm.h" - -class Make_Vna_Table -{ - public: - - Make_Vna_Table(); - ~Make_Vna_Table(); - - void allocate ( - const int &ntype, - const int &lmax_in, - const int &kmesh_in, - const double &Rmax_in, - const double &dR_in, - const double &dk_in); - - - static double dr; - int Rmesh; - - static int get_rmesh( const double &R1, const double &R2); - - void init_Table_Chi(void); - void Destroy_Table_Chi(void); - - - // Five dimension: - // (1) 0: normal (S(R)) ; 1: derivative( dS/dR ) - // (2) pairs type number. - // (3) pairs chi. - // (4) Max angular momentum: L. - // (5) Distance between atoms: R. - double***** Table_VnaR; - - - void init_Vna_Tpair(void); - void init_Vna_Opair(void); - - - // number of pairs - int Vna_nTpairs; - - // index for atom type pairs - IntArray Vna_Tpair; - - IntArray Vna_Opair; - - IntArray Vna_L2plus1; - - bool destroy_Vna; - - private: - - - // phi is the atomic orbital, chi is the projector of Vna - void cal_Vna_PhiChi_R( - const int &l, - const Numerical_Orbital_Lm &n1, - const Neutral_Pot &n2, - const int &rmesh, - double* rs, - double* drs); - - - //variables - int ntype; - int lmax; - double Rmax; - double dk; - int nlm; - int kmesh; - double *kpoint; - double *r; - double *rab; - double *kab; - - -}; - -#endif diff --git a/ABACUS.develop/source/src_lcao/neutral_pot.cpp b/ABACUS.develop/source/src_lcao/neutral_pot.cpp deleted file mode 100644 index 3dfce0cd24..0000000000 --- a/ABACUS.develop/source/src_lcao/neutral_pot.cpp +++ /dev/null @@ -1,356 +0,0 @@ -#include "neutral_pot.h" -#include "../src_pw/tools.h" -#include "../src_pw/global.h" -#include "../src_global/poission.h" - -Neutral_Pot::Neutral_Pot() -{ - vna = new double[1]; - vna_u = new double[1]; - - // for Vna projector - nchi = new int[1]; - - lmax = -1; - mesh_u = 0; -} - -Neutral_Pot::~Neutral_Pot() -{ - delete[] vna; - delete[] vna_u; - - // for Vna projectors - delete[] nchi; -} - -void Neutral_Pot::setup_Vna(const int &it) -{ - TITLE("Neutral_Pot","setup_Vna"); - - ofs_running << "\n SETUP THE 1D NEUTRAL POTENTIAL VNA FOR " << ucell.atoms[it].label << endl; - //cout << " setup the neutral potential Vna." << endl; - - //================================================== - // setup the local part of pseudopotentials. - //================================================== - Atom* atom = &ucell.atoms[it]; - const int msh = atom->msh; - double* vloc = atom->vloc_at; - double* r = atom->r; - stringstream ss; - ss << global_out_dir << atom->label << "/" << atom->label << "_vl_pseudo_r.dat"; - this->output_1dv(ss.str(),msh,vloc,r); - - //================================================== - // setup the one dimensional atomic charge density. - //================================================== - double* rhoatm = new double[msh]; - double* vatom = new double[msh]; - ZEROS(rhoatm, msh); - ZEROS(vatom, msh); - - for(int ir=0; irrho_at[ir] / FOUR_PI / r2; - } - - double charge = 0.0; - Mathzone::Simpson_Integral(atom->msh,atom->rho_at,atom->rab,charge); - - OUT(ofs_running,"charge from pseudo file",charge); - - //--------------------------------------------- - // need to scale the charge if - // the charge read from the pseudopotential - // is not equal to the actul valence electron - // number - //--------------------------------------------- - assert(charge!=0.0); - double scale=1.0; - if(charge!=atom->zv) - { - OUT(ofs_running,"charge should be",atom->zv); - scale = atom->zv/charge; - } - - for(int ir=0; irlabel << "/" << atom->label << "_v_atom.dat"; - this->output_1dv(ssc.str(),msh,vatom,r); - - //================================== - // calculate the neutral potential. - //================================== - delete[] vna; - vna = new double[msh]; - ZEROS(vna, msh); - - for(int ir=0; irlabel << "/" << atom->label << "_vna.dat"; - this->output_1dv(ssn.str(),msh,vna,r); - - return; -} - -void Neutral_Pot::output_1dv(const string &fn, const int &msh, const double* target, const double* r)const -{ - if(MY_RANK!=0) return; - ofstream ofs(fn.c_str()); - for(int ir=0; ir 0.0 ); - - this->dr = dr_in; - Atom* atom = &ucell.atoms[it]; - this->rcut = atom->r[ atom->msh-1 ]; - - double threshold = 1.0e-5; //tmp by mohan - //if threshold goes down to 1.0e-5, oscillation may happen. - for(int ir=0; ir< atom->msh; ir++) - { - if( abs( vna[ir] ) < threshold ) - { - this->rcut = atom->r[ir]; - break; - } - } - - // mohan note: 2011-05-23, - // if rcut > 15, check pseudo_atom.cpp, - // the readin radius must be larger. - assert(rcut <= 15); - - OUT(ofs_running,"radius cutoff of Vna (Bohr)",rcut); - OUT(ofs_running,"threshold of Vna",threshold); - - this->nr = (int)(rcut / dr_in)+5;//mohan fix bug 2011-06-03 - - delete[] vna_u; - this->vna_u = new double[nr]; - ZEROS(vna_u, nr); - - double* r = new double[nr]; - ZEROS(r, nr); - - for (int ir = 0; ir < this->nr; ir++) - { - r[ir] = ir * this->dr; - // mohan fix serious bug 2012-01-11, - // the dimension of atom->r should be the 3rd parameter. - //this->vna_u[ir] = Mathzone::Polynomial_Interpolation_xy( atom->r, vna, this->nr, r[ir]); - this->vna_u[ir] = Mathzone::Polynomial_Interpolation_xy( atom->r, vna, atom->msh, r[ir]); - } - - stringstream ssu; - ssu << global_out_dir << atom->label << "/" << atom->label << "_vna_uniform.dat"; - this->output_1dv(ssu.str(),nr,vna_u,r); - - delete[] r; - - return; -} - - - -void Neutral_Pot::init_proj(Numerical_Orbital &Phi, const double &dr_uniform) -{ - cout << " ==> init_proj of Vna"; - // set the lmax we used - this->lmax = Phi.getLmax(); - - // set the total number of Chi, which equals the Vna projector now. - this->total_nchi; - for(int L=0; L<=lmax; ++L) - { - this->total_nchi += Phi.getNchi(L); - } - - cout << " lmax=" << lmax << " total_nchi=" << total_nchi << endl; - - delete[] nchi; - this->nchi = new int[lmax+1]; - ZEROS( nchi, lmax+1); - - for(int L=0; L<=lmax; ++L) - { - nchi[L] = Phi.getNchi(L); - } - - // initialize the Chi = Gram-Schemit ( VnaPsi ) - cout << " nr for Vna is " << this->nr << endl; - cout << " rcut fo Vna is " << this->rcut << endl; - cout << " Rcut for Orbital is " << Phi.getRcut() << endl; - - - double radius = std::min( this->rcut, Phi.getRcut() ); - assert(radius>0.0); - assert(dr_uniform>0.0); - this->mesh_u = static_cast(radius / dr_uniform); - if(mesh_u%2==0) ++mesh_u; - cout << " mesh_u = " << mesh_u << endl; - - // calculate the radius function Phi * Vna - double** VnaPhi = new double*[total_nchi]; - for(int ic=0; icset_vnaphi(VnaPhi, Phi, dr_uniform); - - - - for(int ic=0; iclmax; ++L) - { - for(int N=0; N< this->nchi[L]; ++N) - { - for(int ir=0; ir< this->mesh_u; ++ir) - { - VnaPhi[ic_index][ir] = this->vna_u[ir] * Phi.PhiLN(L,N).psi_uniform[ir]; - } - ++ic_index; - } - } - - // - for(int L=0; L<= this->lmax; ++L) - { - for(int N=0; N< this->nchi[L]; ++N) - { - double overlap = 0.0; - for(int ir=0; ir< this->mesh_u; ++ir) - { - // orbr[i] = VnaPhi[ic_index][ir] * ((double)ir*ORB.dr_uniform); - } - ++ic_index; - } - } - - - //------------------------------------- - // Schmit-Gramit orthogonalization. - //------------------------------------- - double **new_orb = new double*[this->total_nchi]; - for(int i=0; ilmax; ++L) - { - for(int N1=0; N1< this->nchi[L]; ++N1) - { - if(N1==0) - { - for(int ir=0; ir< this->mesh_u; ++ir) - { - new_orb[ic_index][ir] = vna_u[ir] * Phi.PhiLN(L,N1).psi_uniform[ir]; - } - } - - //------------------------------------------------ - // calculate the overlap < Phi_new | Vna | Phi > - // and < Phi_new | Vna | Phi_new > - //------------------------------------------------ - else if(N1>0) - { - const int NN = nchi[L] - 1; - // must orthogonal to the previous multi-zeta orbitals. - for(int N_pre=0; N_premesh_u, f, rab, overlap); - - // ddot < Phi_new | Vna | Phi > - for(int ir=0; ir -#include "numerical_orbital.h" -#include "numerical_vna_lm.h" -using namespace std; - -class Neutral_Pot -{ - public: - - Neutral_Pot(); - ~Neutral_Pot(); - - void setup_Vna(const int &it); - void uniform_Vna(const int &it, const double &dr_in ); - - double* vna; - double* vna_u; // uniform mesh. - double dr; - double rcut; - int nr; - - private: - - void output_1dv(const string &fn, const int &msh, const double* target, const double* r)const; - - - //--------------------------------------------------------- - // the following is for the exansion of Neutral Potential - //--------------------------------------------------------- - public: - - const int& getLmax(void) const {return lmax;} - const int& getTotal_nchi(void) const { return total_nchi; } - const int& getNchi(const int l) const { return this->nchi[l]; } - - - // initial lmax, nmax, etc. - void init_proj(Numerical_Orbital &Phi, const double &dr_uniform); - - - Numerical_Vna_Lm* VnaLN;// length: total_nchi (only store radial function ) - - private: - - int lmax; - int total_nchi; - int* nchi; - int mesh_u; - - void set_vnaphi(double** VnaPhi, Numerical_Orbital &Phi, const double &dr_uniform); - -}; - -#endif diff --git a/ABACUS.develop/source/src_lcao/numerical_vna_lm.cpp b/ABACUS.develop/source/src_lcao/numerical_vna_lm.cpp deleted file mode 100644 index 120ed38dae..0000000000 --- a/ABACUS.develop/source/src_lcao/numerical_vna_lm.cpp +++ /dev/null @@ -1,238 +0,0 @@ -#include "numerical_vna_lm.h" - -Numerical_Vna_Lm::Numerical_Vna_Lm() -{ - label = ""; - index_atom_type = 0; - angular_momentum_l = 0; - index_chi = 0; - - nr=1; - nk=1; - - rcut=0.0; - kcut=0.0; - dk=0.0; - - r_radial = new double[1]; - k_radial = new double[1]; - rab = new double[1]; - psi = new double[1]; - psir = new double[1]; - psik = new double[1]; - -} - -Numerical_Vna_Lm::~Numerical_Vna_Lm() -{ - delete[] r_radial; - delete[] k_radial; - delete[] rab; - delete[] psi; - delete[] psir; - delete[] psik; -} - -void Numerical_Vna_Lm::set_vna_proj_info -( - const string &label_in, - const int &index_atom_type_in, - const int &angular_momentum_l_in, - const int &index_chi_in, - const int &nr_in, - const double *rab_in, - const double *r_radial_in, - const double *psi_in, - const int &nk_in, - const double &dk_in, - const double &lat0 -) -{ - this->label = label_in; - this->index_atom_type = index_atom_type_in; - this->angular_momentum_l = angular_momentum_l_in; - this->index_chi = index_chi_in; - assert(nr_in>=2); - assert(nr_in<10000); - assert(nr%2!=0); - this->nr = nr_in; - assert(r_radial_in[nr-1]>0.0); - assert(r_radial_in[nr-1]<50); - assert(lat0 > 0); - this->rcut = r_radial_in[nr-1]; - assert(nk_in>1); - assert(nk_in<10000); - this->nk = nk_in; - assert(nk%2!=0); - assert(dk_in>0); - this->dk = dk_in; - - delete[] r_radial; - delete[] k_radial; - delete[] rab; - delete[] psi; - delete[] psir; - delete[] psik; - - r_radial = new double[nr]; - k_radial = new double[nk]; - rab = new double[nr]; - psi = new double[nr]; - psir = new double[nr]; - psik = new double[nk]; - - /*********************************************************** - be careful! LiaoChen modify on 2010/4/21 - ************************************************************/ -// this->dk = PI / rcut / 2.0; -// this->nk = this->nr; - - for (int ir = 0; ir < nr; ir++) - { - this->r_radial[ir] = r_radial_in[ir]; - this->rab[ir] = rab_in[ir]; - this->psi[ir] = psi_in[ir]; - this->psir[ir] = psi[ir] * r_radial[ir]; //mohan 2010-04-19 - } - - for (int ik = 0; ik < nk; ik++) - { - this->k_radial[ik] = ik * this->dk; - } - this->kcut = (nk-1) * this->dk; - - //liaochen modify on 2010/4/7 - //we do SBT on regular mesh - //so we first generate psi_uniform first - //we put uniform in ahead of cal_kradial - - this->cal_kradial(); - this->norm_test(); - this->plot(); - - return; -} - -//use Sbt_new -void Numerical_Vna_Lm::cal_kradial(void) -{ - assert( this->nr > 0); - double *jl = new double[nr]; - double *integrated_func = new double[nr]; - - const double pref = sqrt( 2.0 / PI ); - //Sbt method - - //integration directly - for (int ik = 0; ik < nk; ik++) - { - Mathzone::Spherical_Bessel( - this->nr, - this->r_radial, - this->k_radial[ik], - this->angular_momentum_l, - jl); - - for (int ir = 0; ir < nr; ir++) - { - integrated_func[ir] = this->psir[ir] * this->r_radial[ir] * jl[ir]; - } - - Mathzone::Simpson_Integral( - this->nr, - integrated_func, - this->rab, - this->psik[ik]); - - this->psik[ik] *= ( pref * k_radial[ik]); - } - - delete[] integrated_func; - delete[] jl; -} - -//=============================================== -//FOUND LOCAL VARIABLE -//asum : integral of psi*psi in whole space -//=============================================== -void Numerical_Vna_Lm::norm_test(void)const -{ -// TITLE(ofs_onscaling, "Numerical_Vna_Lm", "norm_test"); - //double asum_r = 0.0; - //double asum_k = 0.0; - - // note here psir = psi * r - double *f = new double[nr]; - for(int ir=0; irpsir[ir] * this->psir[ir]; - } - - double sumr = 0.0; - //double sumk = 0.0; - - Mathzone::Simpson_Integral(this->nr, f, this->rab, sumr); - - delete[] f; - f = new double[nk]; - for(int ik=0; ikpsik[ik] * this->psik[ik]; - } - -// Mathzone::Simpson_Integral(this->nk, f, this->k_radial, sumk); - - //means nothing. - //ofs_running << setw(12) << sumk << endl; - - delete[] f; - return; -} - -void Numerical_Vna_Lm::plot(void)const -{ - TITLE("Numerical_Vna_Lm","plot"); - - string orbital_type; - switch( this->angular_momentum_l ) - { - case 0: orbital_type = "s"; break; - case 1: orbital_type = "p"; break; - case 2: orbital_type = "d"; break; - case 3: orbital_type = "f"; break; - case 4: orbital_type = "g"; break; - default: WARNING_QUIT("Numerical_Vna_Lm::plot","Please check in functoin."); - } - - if(MY_RANK==0) - { - stringstream ssr, ssk, ssru; - ssr << global_out_dir << this->label << "/" - << this->label << "-" << orbital_type << index_chi+1 << "-vna-proj-r.dat"; - - ssk << global_out_dir << this->label << "/" - << this->label << "-" << orbital_type << index_chi+1 << "-vna-proj-k.dat"; - - ofstream ofsr(ssr.str().c_str()); - ofstream ofsk(ssk.str().c_str()); - - if (!ofsk || !ofsr) - { - WARNING("Numerical_Vna_Lm : plot", "Can't open files !"); - } - - for (int i = 0; i < this->nr; i++) - { - ofsr << this->r_radial[i] << " " << psi[i] << endl; - } - - for (int i = 0; i < this->nk; i++) - { - ofsk << this->k_radial[i] << " " << psik[i] << endl; - } - - ofsr.close(); - ofsk.close(); - } - return; -} diff --git a/ABACUS.develop/source/src_lcao/numerical_vna_lm.h b/ABACUS.develop/source/src_lcao/numerical_vna_lm.h deleted file mode 100644 index bfb16eb64c..0000000000 --- a/ABACUS.develop/source/src_lcao/numerical_vna_lm.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef NUMERICAL_VNA_LM_H -#define NUMERICAL_VNA_LM_H - -#include "../src_pw/tools.h" -//#include "../src_parallel/fftw.h" - -//========================================================= -//CLASS Numerical_Vna_Lm -//Note : contain information about each Vna projector -//========================================================= - -class Numerical_Vna_Lm -{ - friend class Neutral_Pot; - -public: - - Numerical_Vna_Lm(); - ~Numerical_Vna_Lm(); - - const int& getL() const { return angular_momentum_l; } - const int& getType() const { return index_atom_type; } - const int& getChi() const {return index_chi; } - - const double* getRadial() const { return r_radial; } - const double& getRadial(const int ir) const { return r_radial[ir]; } - - const double* getPsi() const { return psi;} - const double* getPsi_r() const { return psir; } - const double& getPsi_r(const int ir) const { return psir[ir]; } - - const double& getDk()const { return dk; } - const double* getKpoint()const { return k_radial; } - const double& getKpoint(const int ik) const { return k_radial[ik]; } - const double* getPsi_k() const { return psik; } - const double& getPsi_k(const int ik) const { return psik[ik]; } - -//========================================================== -// EXPLAIN : set information about Numerical_Orbital_Lm -// MEMBER FUNCTION : -//========================================================== - void set_vna_proj_info - ( - const string &label_in, - const int &index_atom_type_in, - const int &angular_momentum_l_in, - const int &index_chi_in, - - const int &nr_in, - const double *rab_in, - const double *r_radial_in, - const double *psi_in, - - const int &nk_in, - const double &dk_in, - - const double &lat0 - ); - -private: - - void cal_kradial(void); - void norm_test()const; - void plot()const; - - string label; - int index_atom_type; - int angular_momentum_l; - int index_chi; - - int nr; - int nk; - - double rcut; - double kcut; - double dk; - - double* r_radial; //points of r - double* k_radial; - - double* rab; - - double* psi;//psi(r) - double* psir; //psi(r) * r - double* psik; - -}; - -#endif - diff --git a/ABACUS.develop/source/src_lcao/orbital_information_0.cpp b/ABACUS.develop/source/src_lcao/orbital_information_0.cpp deleted file mode 100644 index fcb924ff26..0000000000 --- a/ABACUS.develop/source/src_lcao/orbital_information_0.cpp +++ /dev/null @@ -1,100 +0,0 @@ -//========================================================= -//AUTHOR : mohan -//DATE : 2008-11-29 -//========================================================= -#include "orbital_information_0.h" - -Orbital_Information_0::Orbital_Information_0() -{ -} - -Orbital_Information_0::~Orbital_Information_0() -{ - if (init_done) - { - delete[] label; - delete[] enviroment; - delete[] transparence; - delete[] lmax; - - for (int i = 0; i < ntype; i++) - { - delete[] nchi[i]; - } - - delete[] nchi; - } -} - -void Orbital_Information_0::Read(const string &fn, ofstream &ofs) -{ - if (test_overlap)TITLE("Orbital_Information_0", "Read"); - - ifstream ifs(fn.c_str()); - - if (!ofs) - { - WARNING_QUIT("Orbital_Information_0::Read","Can not find the file."); - } - else - { - cout << "\n Read in file : " << fn; - } - - CHECK_NAME(ifs, "INPUT_ORBITAL_INFORMATION_0"); - - CHECK_NAME(ifs, "ntype"); - ifs >> ntype; - OUT(ofs, "ntype", ntype); - - if (ntype <= 0 || ntype > 50) - { - WARNING_QUIT("Orbital_Information_0::Read", "ntype<=0 || ntype>50"); - } - - this->init_done = false; - - this->label = new string[ntype]; - this->enviroment = new string[ntype]; - this->transparence = new double[ntype]; - this->lmax = new int[ntype]; - this->nchi = new int*[ntype]; - - for (int i = 0; i < ntype; i++) - { - CHECK_NAME(ifs, "label"); - ifs >> label[i]; - OUT(ofs, "label", label[i]); - - CHECK_NAME(ifs, "enviroment"); - ifs >> enviroment[i]; - OUT(ofs, "enviroment", enviroment[i]); - - CHECK_NAME(ifs, "transparence"); - ifs >> transparence[i]; - OUT(ofs, "transparence", transparence[i]); - - CHECK_NAME(ifs, "Lmax"); - ifs >> lmax[i]; - OUT(ofs, "Lmax", lmax[i]); - nchi[i] = new int[ lmax[i] ]; - - for (int j = 0;j <= lmax[i];j++) - { - CHECK_NAME(ifs, "L"); - OUT(ofs, "L", j); - int k; - ifs >> k; - assert(k == j); - - CHECK_NAME(ifs, "nchi"); - int m; - ifs >> nchi[i][j]; - OUT(ofs, "nchi", nchi[i][j]); - } - } - - this->init_done = true; - - return; -} diff --git a/ABACUS.develop/source/src_lcao/orbital_information_0.h b/ABACUS.develop/source/src_lcao/orbital_information_0.h deleted file mode 100644 index 422ebc6499..0000000000 --- a/ABACUS.develop/source/src_lcao/orbital_information_0.h +++ /dev/null @@ -1,41 +0,0 @@ -//========================================================= -//AUTHOR : mohan -//DATE : 2008-11-29 -//========================================================= -#ifndef ORBITAL_INFORMATION_0_H -#define ORBITAL_INFORMATION_0_H - -#include "../src_pw/tools.h" - -class Orbital_Information_0 -{ - public: - - Orbital_Information_0(); - ~Orbital_Information_0(); - - void Read(const string &fn,ofstream &ofs); - - const int& getNtype(void) const {return ntype;} - const string& getLabel(const int it) const {return label[it];} - const string& getEnv(const int it)const {return enviroment[it]; } - const double& getTran(const int it)const {return transparence[it];} - const int* getNchi(const int it) const { return nchi[it]; } - const int& getNchi_l(const int it,const int il){ return nchi[it][il]; } - const int& getLmax(const int it) const { return lmax[it]; } - - private: - - int ntype; - string *label; - string *enviroment; - double *transparence; - int* lmax; - int** nchi; - - bool init_done; - - -}; - -#endif diff --git a/ABACUS.develop/source/src_lcao/record_adj.cpp b/ABACUS.develop/source/src_lcao/record_adj.cpp index a7219241fe..4dbb2f3661 100644 --- a/ABACUS.develop/source/src_lcao/record_adj.cpp +++ b/ABACUS.develop/source/src_lcao/record_adj.cpp @@ -26,7 +26,7 @@ void Record_adj::delete_grid(void) // This will record the orbitals according to // HPSEPS's 2D block division. //-------------------------------------------- -#include "lcao_nnr.h" +#include "LCAO_nnr.h" void Record_adj::for_2d(void) { TITLE("Record_adj","for_2d"); diff --git a/ABACUS.develop/source/src_lcao/run_md.cpp b/ABACUS.develop/source/src_lcao/run_md.cpp new file mode 100644 index 0000000000..e85f99ac2a --- /dev/null +++ b/ABACUS.develop/source/src_lcao/run_md.cpp @@ -0,0 +1,501 @@ +#include "run_md.h" +#include "src_pw/global.h" +#include "src_parallel/parallel_orbitals.h" +#include "src_pdiag/pdiag_double.h" +#include "LCAO_nnr.h" +#include "FORCE_STRESS.h" +#include "src_global/global_function.h" +#include "src_io/write_HS.h" +#include "src_io/cal_r_overlap_R.h" +#include "src_ions/variable_cell.h" // mohan add 2021-02-01 +#include "src_ri/exx_abfs.h" +#include "src_ri/exx_opt_orb.h" +#include "ELEC_scf.h" +#include "src_global/sltk_atom_arrange.h" +#include "src_pw/vdwd2.h" + +Run_MD::Run_MD() +{} + +Run_MD::~Run_MD() +{} + + +void Run_MD::opt_cell(void) +{ + TITLE("Run_MD","opt_cell"); + + + + + // Initialize the local wave functions. + // npwx, eigenvalues, and weights + // npwx may change according to cell change + // this function belongs to cell LOOP + wf.allocate_ekb_wg(kv.nks); + + // Initialize the FFT. + // this function belongs to cell LOOP + UFFT.allocate(); + + // output is ppcell.vloc 3D local pseudopotentials + // this function belongs to cell LOOP + ppcell.init_vloc(pw.nggm, ppcell.vloc); + + // Initialize the sum of all local potentials. + // if ion_step==0, read in/initialize the potentials + // this function belongs to ions LOOP + int ion_step=0; + pot.init_pot(ion_step, pw.strucFac); + + + opt_ions(); + return; +} + + +void Run_MD::opt_ions(void) +{ + TITLE("Run_MD","opt_ions"); + timer::tick("Run_MD","opt_ions",'B'); + + if(OUT_LEVEL=="i") + { + cout << setprecision(12); + cout<< " " << setw(7)<< "ISTEP" + <istep = 1; + int force_step = 1; + int stress_step = 1; + bool stop = false; + while(istep <= NSTEP && !stop) + { + time_t estart = time(NULL); + + // xiaohui add "m" option, 2015-09-16 + if(OUT_LEVEL=="ie" || OUT_LEVEL=="m") + { + cout << " ---------------------------------------------------------" << endl; + if(mdtype==1||mdtype==2) + { + cout<<" Molecular Dynamics (NVT) STEP "<< MDNVT.step_rst + istep<istep); + + time_t eend = time(NULL); + + //xiaohui add 2014-07-07, for second-order extrapolation + int iat=0; + + for(int it = 0;it < ucell.ntype;it++) + { + Atom* atom = &ucell.atoms[it]; + for(int ia =0;ia< ucell.atoms[it].na;ia++) + { + CE.pos_old2[3*iat ] = CE.pos_old1[3*iat ]; + CE.pos_old2[3*iat+1] = CE.pos_old1[3*iat+1]; + CE.pos_old2[3*iat+2] = CE.pos_old1[3*iat+2]; + + CE.pos_old1[3*iat ] = CE.pos_now[3*iat ]; + CE.pos_old1[3*iat+1] = CE.pos_now[3*iat+1]; + CE.pos_old1[3*iat+2] = CE.pos_now[3*iat+2]; + + CE.pos_now[3*iat ] = atom->tau[ia].x*ucell.lat0; + CE.pos_now[3*iat+1] = atom->tau[ia].y*ucell.lat0; + CE.pos_now[3*iat+2] = atom->tau[ia].z*ucell.lat0; + + iat++; + } + } + + if(mdtype==1||mdtype==2) + { + MDNVT.runnvt(istep); + } + else if(mdtype==0) + { + MDNVE.runNVE(istep); + } + if((mdtype==1||mdtype==2)&&(istep==NSTEP||stop)) + { + MDNVT.md_release(); + } + if(mdtype==0&&(istep==NSTEP||stop)) + { + MDNVE.md_release(); + } + + if(pot.out_potential == 2) + { + stringstream ssp; + stringstream ssp_ave; + ssp << global_out_dir << "ElecStaticPot"; + ssp_ave << global_out_dir << "ElecStaticPot_AVE"; + pot.write_elecstat_pot(ssp.str(), ssp_ave.str()); //output 'Hartree + local pseudopot' + } + + time_t fstart = time(NULL); + time_t fend = time(NULL); + + //xiaohui add 2014-07-07, for second-order extrapolation + iat=0; + for(int it = 0;it < ucell.ntype;it++) + { + Atom* atom = &ucell.atoms[it]; + for(int ia =0;ia< ucell.atoms[it].na;ia++) + { + CE.pos_next[3*iat ] = atom->tau[ia].x*ucell.lat0; + CE.pos_next[3*iat+1] = atom->tau[ia].y*ucell.lat0; + CE.pos_next[3*iat+2] = atom->tau[ia].z*ucell.lat0; + + iat++; + } + } + + //xiaohui add CE.istep = istep 2014-07-07 + CE.istep = istep; + + // charge extrapolation if istep>0. + CE.extrapolate_charge(); + + if(pot.extra_pot=="dm")//xiaohui modify 2015-02-01 + { + // done after grid technique. + } + else + { + pot.init_pot( istep, pw.strucFac ); + } + + + if(OUT_LEVEL=="i") + { + double etime_min = difftime(eend, estart)/60.0; + double ftime_min = difftime(fend, fstart)/60.0; + stringstream ss; + ss << MOVE_IONS << istep; + + cout << setiosflags(ios::scientific) + << " " << setw(7) << ss.str() + << setw(5) << ELEC_scf::iter + << setw(18) << setprecision(6) << en.etot * Ry_to_eV; + + cout << setprecision(2) << setiosflags(ios::scientific) + << setw(10) << IMM.get_ediff() * Ry_to_eV * 1000 + << setw(10) << IMM.get_largest_grad() * Ry_to_eV / BOHR_TO_A; + + cout << resetiosflags(ios::scientific) + << setprecision(2) << setw(10) << etime_min + ftime_min; + cout << endl; + } + + ++istep; + } + + // mohan update 2021-02-10 + hm.orb_con.clear_after_ions(); + + timer::tick("Run_MD","opt_ions",'B'); + return; +} + +//bool Run_MD::force_stress(void) +bool Run_MD::force_stress(const int &istep, int &force_step, int &stress_step) +{ + TITLE("Run_MD","force_stress"); + if(!FORCE && !STRESS) + { + return 1; + } + timer::tick("Run_MD","force_stress",'D'); + matrix fcs; + matrix scs; + Force_Stress_LCAO FSL; + FSL.allocate (); + FSL.getForceStress(FORCE, STRESS, TEST_FORCE, TEST_STRESS, fcs, scs); + //-------------------------------------------------- + // only forces are needed, no stresses are needed + //-------------------------------------------------- + if(FORCE && !STRESS) + { + +#ifdef __MPI //2015-10-01, xiaohui + atom_arrange::delete_vector( SEARCH_RADIUS ); +#endif //2015-10-01, xiaohui + + if(CALCULATION=="relax") + { + IMM.cal_movement(istep, istep, fcs, en.etot); + + if(IMM.get_converged() || (istep==NSTEP)) + { + return 1; // 1 means converged + } + else // ions are not converged + { + CE.istep = istep; + CE.extrapolate_charge(); + + if(pot.extra_pot=="dm") + { + } + else + { + pot.init_pot( istep, pw.strucFac ); + } + } + return 0; + } + else + { + return 1; + } + + // mohan update 2013-04-11 + // setup the structure factor + // and do the density extraploation. + // for both ionic iteratoin and + // force calculations. + + //xiaohui modify 2014-08-09 + //pw.setup_structure_factor(); + + // charge extrapolation if istep>0. + //xiaohui modify 2014-08-09 + //CE.extrapolate_charge(); + +/*xiaohui modify 2014-08-09 + if(pot.extra_pot==4) + { + // done after grid technique. + } + else + { + pot.init_pot( istep ); + } +xiaohui modify 2014-08-09*/ + } + + static bool converged_force = false; + static bool converged_stress = false; + + if(!FORCE&&STRESS) + { + +#ifdef __MPI + atom_arrange::delete_vector( SEARCH_RADIUS ); +#endif + if(CALCULATION=="cell-relax") + { + LCM.cal_lattice_change(stress_step, scs, en.etot); + converged_stress = LCM.get_converged(); + if(converged_stress) + { + return 1; + } + else + { + Variable_Cell::init_after_vc(); + pot.init_pot(stress_step, pw.strucFac); + + ++stress_step; + return 0; + } + } + else + { + return 1; + } + } + + if(FORCE&&STRESS) + { + +//#ifdef __MPI + atom_arrange::delete_vector( SEARCH_RADIUS ); +//#endif + + //if(CALCULATION=="relax") IMM.cal_movement(istep, FL.fcs, en.etot); + if(CALCULATION=="relax" || CALCULATION=="cell-relax") + { + IMM.cal_movement(istep, force_step, fcs, en.etot); + + if(IMM.get_converged()) + { + force_step = 1; + + + if(CALCULATION=="cell-relax") + { + LCM.cal_lattice_change(stress_step, scs, en.etot); + converged_stress = LCM.get_converged(); + if(converged_stress) + { + return 1; + } + else + { + Variable_Cell::init_after_vc(); + pot.init_pot(stress_step, pw.strucFac); + + ++stress_step; + return 0; + } + } + else + { + return 1; + } + +#ifdef __MPI + //atom_arrange::delete_vector( SEARCH_RADIUS ); +#endif + } + else + { +#ifdef __MPI + //atom_arrange::delete_vector( SEARCH_RADIUS ); +#endif + //CE.istep = istep; + CE.istep = force_step; + CE.extrapolate_charge(); + + if(pot.extra_pot=="dm")//xiaohui modify 2015-02-01 + { + // done after grid technique. + } + else + { + pot.init_pot( istep, pw.strucFac ); + } + ++force_step; + return 0; + } + } + else + { + return 1; + } + } + + return 0; + + timer::tick("Run_MD","force_stress",'D'); +} + +void Run_MD::final_scf(void) +{ + TITLE("Run_MD","final_scf"); + + FINAL_SCF = true; + Variable_Cell::final_calculation_after_vc(); + atom_arrange::set_sr_NL(); + atom_arrange::search( SEARCH_RADIUS ); + GridT.set_pbc_grid( + pw.ncx, pw.ncy, pw.ncz, + pw.bx, pw.by, pw.bz, + pw.nbx, pw.nby, pw.nbz, + pw.nbxx, pw.nbzp_start, pw.nbzp); + + // (2) If k point is used here, allocate HlocR after atom_arrange. + if(!GAMMA_ONLY_LOCAL) + { + // For each atom, calculate the adjacent atoms in different cells + // and allocate the space for H(R) and S(R). + LNNR.cal_nnr(); + LM.allocate_HS_R(LNNR.nnr); + + // need to first calculae lgd. + // using GridT.init. + LNNR.cal_nnrg(GridT); + } + + // (4) set the augmented orbitals index. + // after ParaO and GridT, + // this information is used to calculate + // the force. + LOWF.set_trace_aug(GridT); + + // (5) init density kernel + // (6) init wave functions. + if(GAMMA_ONLY_LOCAL) + { + // here we reset the density matrix dimension. + LOC.allocate_gamma(GridT); + } + else + { + LOWF.allocate_k(GridT); + LOC.allocate_DM_k(); + } + + UHM.set_lcao_matrices(); + + if(vdwd2_para.flag_vdwd2) //Peize Lin add 2014-04-04, update 2021-03-09 + { + Vdwd2 vdwd2(ucell,vdwd2_para); + vdwd2.cal_energy(); + en.evdw = vdwd2.get_energy(); + } + else if(vdwd3.vdwD3) //jiyy add 2019-05-18 + { + vdwd3.energy(); + en.evdw = vdwd3.energy_result; + } + + ELEC_scf es; + es.scf(0); + + if(CALCULATION=="scf" || CALCULATION=="relax") + { + ofs_running << "\n\n --------------------------------------------" << endl; + ofs_running << setprecision(16); + ofs_running << " !FINAL_ETOT_IS " << en.etot * Ry_to_eV << " eV" << endl; + ofs_running << " --------------------------------------------\n\n" << endl; + } + + return; +} diff --git a/ABACUS.develop/source/src_lcao/local_orbital_ions.h b/ABACUS.develop/source/src_lcao/run_md.h similarity index 57% rename from ABACUS.develop/source/src_lcao/local_orbital_ions.h rename to ABACUS.develop/source/src_lcao/run_md.h index 4c9ff9214d..96e7b42dc8 100644 --- a/ABACUS.develop/source/src_lcao/local_orbital_ions.h +++ b/ABACUS.develop/source/src_lcao/run_md.h @@ -1,43 +1,48 @@ -#ifndef LOCAL_ORBITAL_IONS_H -#define LOCAL_ORBITAL_IONS_H +#ifndef RUN_MD_H +#define RUN_MD_H -#include "local_orbital_elec.h" +#include "LOOP_elec.h" #include "../src_ions/ions_move_methods.h" #include "../src_pw/charge_extra.h" -//#include "../src_develop/src_md/md.h" -//2014-06-06, xiaohui #include "../src_pw/md.h" -//added by daye 2014/6/19 #include "../src_pw/mdNVT.h" #include "../src_pw/mdNVE.h" #include "../src_ions/lattice_change_methods.h" -class Local_Orbital_Ions +class Run_MD { -public: - Local_Orbital_Ions(); - ~Local_Orbital_Ions(); - Local_Orbital_Elec LOE; + public: + Run_MD(); + ~Run_MD(); + + LOOP_elec LOE; + + void opt_cell(void); void opt_ions(void); - void output_HS_R(void); //LiuXh add 2019-07-15 + //2014-06-06, xiaohui - mdnvt MDNVT ; - mdNVE MDNVE ; + mdnvt MDNVT ; + mdNVE MDNVE ; + + private: -private: Ions_Move_Methods IMM; - //MD md; //bool force_stress(void); Lattice_Change_Methods LCM; + bool force_stress(const int &istep, int &force_step, int &stress_step); + int istep; + // electron charge density extropolation method Charge_Extra CE; + //choose md ensemble, zheng daye int mdtype; + void final_scf(void); }; diff --git a/ABACUS.develop/source/src_lcao/stress_lcao.cpp b/ABACUS.develop/source/src_lcao/stress_lcao.cpp deleted file mode 100644 index 6e6c5b296d..0000000000 --- a/ABACUS.develop/source/src_lcao/stress_lcao.cpp +++ /dev/null @@ -1,1067 +0,0 @@ -#include "stress_lcao.h" -#include "../src_pw/global.h" -#include "../src_pw/xc_functional.h" -#include "../src_pw/gga_pw.h" - -double Stress_LCAO::stress_invalid_threshold_ev = 0.00; - -Stress_LCAO::Stress_LCAO () -{ - allocate_flag = false; - output_acc = 1.0e-8; -} - -Stress_LCAO::~Stress_LCAO () -{ - this->destroy(); -} - -void Stress_LCAO::destroy (void) -{ - if (allocate_flag) - { - - allocate_flag = false; - } -} - -void Stress_LCAO::allocate(void) -{ - TITLE("Stress_LCAO","init"); - - if (allocate_flag) - { - this->destroy(); - } - - allocate_flag = true; - return; -} - -#include "../src_pw/efield.h" -#include "../src_pw/stress.h" -// be called in : Local_Orbital_Ions::force_stress -void Stress_LCAO::start_stress(double overlap[][3],double tvnl_dphi[][3],double vnl_dbeta[][3],double vl_dphi[][3], const matrix& stress_vdw) -{ - TITLE("Stress_LCAO","start_stress"); - timer::tick("Stress_LCAO","start_stress",'E'); - - - for(int i=0;i<3;i++){ - for(int j=0;j<3;j++){ - scs[i][j] = 0.0; - soverlap[i][j] = overlap[i][j]; - stvnl_dphi[i][j] = tvnl_dphi[i][j]; - svnl_dbeta[i][j] = vnl_dbeta[i][j]; - svl_dphi[i][j] = vl_dphi[i][j]; - sigmacc[i][j] = 0.0; - sigmadvl[i][j] = 0.0; - sigmaewa[i][j] = 0.0; - sigmaxc[i][j] = 0.0; - sigmahar[i][j] = 0.0; - } - } - //-------------------------------------------------------- - // local pseudopotential stress: - // use charge density; plane wave; local pseudopotential; - //-------------------------------------------------------- - this->cal_stress_loc (); - - //-------------------------------------------------------- - //hartree term - //-------------------------------------------------------- - this->cal_stress_har (); - - //-------------------------------------------------------- - // ewald stress: use plane wave only. - //-------------------------------------------------------- - this->cal_stress_ew (); //remain problem - - - //-------------------------------------------------------- - // stress due to core correlation. - //-------------------------------------------------------- - this->cal_stress_cc(); - - //-------------------------------------------------------- - // stress due to self-consistent charge. - //-------------------------------------------------------- - for(int i=0;i<3;i++){ - //sigmaxc[i][i] = - (en.etxc-en.vtxc) / ucell.omega; - sigmaxc[i][i] = -(en.etxc) / ucell.omega; - -// sigmahar[i][i] = en.ehart /ucell.omega; - - } - //Exchange-correlation for PBE - cal_stress_gradcorr(); - - //-------------------------------------------------------- - // need to move atom positions here. - //-------------------------------------------------------- - if(GAMMA_ONLY_LOCAL) - { -// this->stable_gamma(); - } - else - { -// this->stable_k(); - } - -/* if(vdwd2.vdwD2) //Peize Lin add 2014-04-04, update 2019-04-26 - { - vdwd2.stress(); - } -*/ -/* if(vdwd3.vdwD3) //jiyy add 2019-05-18 - { - vdwd3.stress(); - } -*/ -/* matrix sefield; - if(EFIELD) - { - sefield.create(3, 3); - Efield::compute_stress(sefield); - }*/ - - for(int i=0; i<3; i++) - { - for (int j=0;j<3;j++) - { - scs[i][j] += soverlap[i][j] - + stvnl_dphi[i][j] - + svnl_dbeta[i][j] - + svl_dphi[i][j] - + sigmadvl[i][j] // derivative of local potential stress (pw) - + sigmaewa[i][j] // ewald stress (pw) - + sigmacc[i][j] //nonlinear core correction stress (pw) - + sigmaxc[i][j]//exchange corretion stress - + sigmahar[i][j];// hartree stress - - if(vdwd2.vdwD2) // Peize Lin update 2019-04-26 - { - scs[i][j] += stress_vdw(i , j); - } - if(vdwd3.vdwD3) // jiyy add 2019-05-18 - { - scs[i][j] += stress_vdw(i , j); - } - /* if(EFIELD) - { - scs(iat, i) = scs(iat, i) + sefield(iat, i); - } -*/ - - } - - - -// if(OUT_LEVEL != "m") ofs_running << " correction stress for each atom along direction " << i+1 << " is " << sum/ucell.nat << endl; - } - -/*if(SYMMETRY) -{ - double *pos; - double d1,d2,d3; - pos = new double[ucell.nat*3]; - ZEROS(pos, ucell.nat*3); - int iat = 0; - for(int it = 0;it < ucell.ntype;it++) - { - //Atom* atom = &ucell.atoms[it]; - for(int ia =0;ia< ucell.atoms[it].na;ia++) - { - pos[3*iat ] = ucell.atoms[it].taud[ia].x ; - pos[3*iat+1] = ucell.atoms[it].taud[ia].y ; - pos[3*iat+2] = ucell.atoms[it].taud[ia].z; - for(int k=0; k<3; ++k) - { - symm.check_translation( pos[iat*3+k], -floor(pos[iat*3+k])); - symm.check_boundary( pos[iat*3+k] ); - } - iat++; - - } - } - - for(int iat=0; iatprint_stress("OVERLAP STRESS",soverlap,TEST_STRESS,ry); - //test - this->print_stress("T STRESS",stvnl_dphi,TEST_STRESS,ry); - this->print_stress("VNL STRESS",svnl_dbeta,TEST_STRESS,ry); - - this->print_stress("T_VNL STRESS",stvnl,TEST_STRESS,ry); - - this->print_stress("VL_dPHI STRESS",svl_dphi,TEST_STRESS,ry); - this->print_stress("VL_dVL STRESS",sigmadvl,TEST_STRESS,ry); - this->print_stress("HAR STRESS",sigmahar,TEST_STRESS,ry); - - this->print_stress("EWALD STRESS",sigmaewa,TEST_STRESS,ry); - this->print_stress("cc STRESS",sigmacc,TEST_STRESS,ry); -// this->print_stress("NLCC STRESS",sigmacc,TEST_STRESS,ry); - this->print_stress("XC STRESS",sigmaxc,TEST_STRESS,ry); - this->print_stress("TOTAL STRESS",scs,TEST_STRESS,ry); - } - - -/* if(EFIELD) - { - STRESS::print("EFIELD STRESS", sefield); - } -*/ - ofs_running << setiosflags(ios::left); - - this->printstress_total(ry); - - ofs_running << resetiosflags(ios::showpos); - - if(TEST_STRESS) - { - ofs_running << "\n STRESS INVALID TABLE." << endl; - // ofs_running << " " << setw(8) << "atom" << setw(5) << "x" << setw(5) << "y" << setw(5) << "z" << endl; - for(int i=0;i<3; i++) - { - for(int j=0; j<3; j++) - { - if( abs( scs[i][j]*Ry_to_eV/0.529177 ) < Stress_LCAO::stress_invalid_threshold_ev) - { - scs[i][j] = 0.0; - ofs_running << setw(5) << "1"; - } - else - { - ofs_running << setw(5) << "0"; - } - } - ofs_running << endl; - } - } - timer::tick("Stress_LCAO","start_stress",'E'); - return; -} - -void Stress_LCAO::print_stress(const string &name, double f[][3], const bool screen, bool ry)const -{ - ofs_running << " --------------------------- " << name << " ----------------------------" << endl; - - - double fac = 1.0; - - if(!ry) - { - // fac = Ry_to_eV / 0.529177; - } - - cout << setprecision(5); - cout << setiosflags(ios::showpos); - - if(screen) - { - cout << " ------------------- " << name << " --------------------" << endl; - - } - - for (int i=0;i<3;i++){ - ofs_running << setw(15)<< " "; - if( abs(f[i][0]) >output_acc) ofs_running << setw(15) << f[i][0]*fac; - else ofs_running << setw(15) << "0"; - if( abs(f[i][1]) >output_acc) ofs_running << setw(15) << f[i][1]*fac; - else ofs_running << setw(15) << "0"; - if( abs(f[i][2]) >output_acc) ofs_running << setw(15) << f[i][2]*fac; - else ofs_running << setw(15) << "0"; - ofs_running << endl; - - if(screen) - { - if( abs(f[i][0]) >output_acc) cout << setw(15) << f[i][0]*fac; - else cout << setw(15) << "0"; - if( abs(f[i][1]) >output_acc) cout << setw(15) << f[i][1]*fac; - else cout << setw(15) << "0"; - if( abs(f[i][2]) >output_acc) cout << setw(15) << f[i][2]*fac; - else cout << setw(15) << "0"; - cout << endl; - } - - - } - - - cout << resetiosflags(ios::showpos); - - return; -} - -void Stress_LCAO::printstress_total (bool ry) -{ -// zhengdy update 2016-10-08 - double unit_transform = 1; - - if(!ry) - { - unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * eps8; - } -// cout.setf(ios::fixed); - - - //ofs_running << setiosflags(ios::right); - ofs_running << setprecision(6) << setiosflags(ios::showpos) << setiosflags(ios::fixed) << endl; - NEW_PART("TOTAL-STRESS (KBAR)");//Ryd/(a.u.)^3 - cout << " ><><><><><><><><><><><><><><><><><><><><><><" << endl; - cout << " TOTAL-STRESS (KBAR):" << endl; - cout << " ><><><><><><><><><><><><><><><><><><><><><><" << endl; - -// if(INPUT.stress_set == 1) -// int TEST_STRESS = 1; - - if(TEST_STRESS) - { - cout << setiosflags(ios::fixed) << setprecision(6); - cout << setiosflags(ios::showpos); - cout << " ------------------- TOTAL STRESS --------------------" << endl; - cout << " " << setw(8) << "STRESS" << endl; - ofs_running << " " << setw(12) << "STRESS" << endl; - } - - - for (int i=0; i<3; i++) - { - - //if(TEST_STRESS) - cout << " " << setw(15) << scs[i][0]*unit_transform << setw(15) - << scs[i][1]*unit_transform << setw(15) << scs[i][2]*unit_transform << endl; - - ofs_running << " " << setw(15) << scs[i][0]*unit_transform << setw(15) - << scs[i][1]*unit_transform << setw(15) << scs[i][2]*unit_transform << endl; - - - } - ofs_running << setiosflags(ios::left); - cout << resetiosflags(ios::showpos); - - return; -} - -void Stress_LCAO::cal_stress_loc(void) -{ - timer::tick("Stress_LCAO","cal_stress_loc",'F'); - - double *dvloc; - double evloc,fact=1.0; - int ng,nt,l,m,is; - - dvloc = new double[pw.ngmc]; - - for(l=0;l<3;l++){ - for(m=0;m<3;m++){ - sigmadvl[l][m]=0; - } - } - - complex *Porter = UFFT.porter; - - ZEROS( Porter, pw.nrxx ); - for(int is=0; is(chr.rho[is][ir], 0.0 ); - } - } - pw.FFT_chg.FFT3D(Porter, -1); - -// if(INPUT.gamma_only==1) fact=2.0; -// else fact=1.0; - - evloc=0.0; - double g[3]={0,0,0}; - - - complex *vg = new complex[pw.ngmc]; - ZEROS( vg, pw.ngmc ); - for (int it=0; itzv, dvloc); - // - } - else{ - // - // normal case: dvloc contains dV_loc(G)/dG - // - str.dvloc_of_g ( atom->msh, atom->rab, atom->r, - atom->vloc_at, atom->zv, dvloc); - // - } - - for( ng = 0;ng< pw.ngmc;ng++){ - const int j = pw.ig2fftc[ng]; - g[0]=pw.gcar[ng].x; - g[1]=pw.gcar[ng].y; - g[2]=pw.gcar[ng].z; - for (l = 0;l< 3;l++){ - for (m = 0; m1e-7); - - //G-space sum here - //Determine if this processor contains G=0 and set the constant term - double sdewald; - if(pw.gstart == 1){ - sdewald = (TWO_PI) * e2 / 4.0 / alpha * pow(charge/ucell.omega,2); - } - else { - sdewald = 0.0; - } - - //sdewald is the diagonal term - - double fact=1.0; -// if (INPUT.gamma_only) fact=2.0; -// else fact=1.0; - - double g2,g2a; - double arg; - complex rhostar; - double sewald; - for(int ng=pw.gstart;ng(ucell.atoms[it].zv * cos(arg),ucell.atoms[it].zv * sin(arg)); - } - } - rhostar /= ucell.omega; - sewald = fact* (TWO_PI) * e2 * exp(-g2a) / g2 * pow(abs(rhostar),2); - sdewald = sdewald - sewald; - g[0]=pw.gcar[ng].x; - g[1]=pw.gcar[ng].y; - g[2]=pw.gcar[ng].z; - for(l=0;l<3;l++){ - for(m=0;m *r; - double *r2; - r = new Vector3[mxr]; - r2 = new double[mxr]; - irr = new int[mxr]; - double rr; - Vector3 d_tau; - double r0[3]; - int rmax , nrm=0; - double fac; - if(pw.gstart==1){ - rmax = 4.0/sqrt(alpha)/ucell.lat0; - //with this choice terms up to ZiZj*erfc(5) are counted (erfc(5)=2*10^-1) - for(int it=0; it < ucell.ntype; it++){ - for(int i=0; iprint(ofs_running, "ewald stress", stression); - timer::tick("Force_lo","cal_stress_ew"); - - return; -} - -void Stress_LCAO::cal_stress_cc(void) -{ - timer::tick("Stress_LCAO","cal_stress_cc",'E'); - - int nt,ng,l,m,ir; - double fact=1.0; - complex sigmadiag; - double* rhocg; - double g[3]; - - - int judge=0; - for(nt=0;nt * psic = new complex [pw.nrxx]; - - ZEROS(psic, pw.nrxx); - - if(NSPIN==1||NSPIN==4){ - for(ir=0;ir(vxc(0, ir), 0.0); - } - } - else{ - for(ir=0;ir t = conj(psic[pw.ig2fftc[ng]] ) - * pw.strucFac (nt, ng) * rhocg [pw.ig2ngg[ng] ] * ucell.tpiba * - g [l] * g [m] / pw.gcar[ng].norm() * fact; - sigmacc [l][ m] += t.real(); - }//end m - }//end l - }//end ng - }//end if - }//end nt - for( l = 0;l< 3;l++){ - sigmacc [l][ l] += sigmadiag.real(); - } - for( l = 0;l< 3;l++){ - for (m = 0;m< 3;m++){ - Parallel_Reduce::reduce_double_pool( sigmacc[l][m] ); - } - } - - delete[] rhocg; - delete[] psic; - - timer::tick("Stress_LCAO","cal_stress_cc",'E'); - return; -} - -void Stress_LCAO::cal_stress_har(){ - - double shart,g2; - const double eps=1e-8; - int is,ig,l,m,nspin0; - - - - complex *Porter = UFFT.porter; - - // Hartree potential VH(r) from n(r) - ZEROS( Porter, pw.nrxx ); - for(int is=0; is( chr.rho[is][ir], 0.0 ); - } - } - //============================= - // bring rho (aux) to G space - //============================= - pw.FFT_chg.FFT3D(Porter, -1); - - complex *psic = new complex [pw.nrxx]; - double *psic0 = new double[pw.nrxx]; - ZEROS( psic0, pw.nrxx); - for(int is=0; is(psic0[ir], 0.0); - } - } - - pw.FFT_chg.FFT3D(psic, -1) ; - - - double charge; - if (pw.gstart == 1) - { - charge = ucell.omega * Porter[pw.ig2fftc[0]].real(); - } - - complex *vh_g = new complex[pw.ngmc]; - ZEROS(vh_g, pw.ngmc); - - double g[3]; -//test - // int i=pw.gstart; - // cout<< "gstart " <0); - const double fac = 1.0/ NSPIN; - - // doing FFT to get rho in G space: rhog1 - chr.set_rhog(chr.rho[0], chr.rhog[0]); - if(NSPIN==2)//mohan fix bug 2012-05-28 - { - chr.set_rhog(chr.rho[1], chr.rhog[1]); - } - chr.set_rhog(chr.rho_core, chr.rhog_core); - - double* rhotmp1; - double* rhotmp2; - complex* rhogsum1; - complex* rhogsum2; - Vector3* gdr1; - Vector3* gdr2; - - rhotmp1 = new double[pw.nrxx]; - rhogsum1 = new complex[pw.ngmc]; - ZEROS(rhotmp1, pw.nrxx); - ZEROS(rhogsum1, pw.ngmc); - for(int ir=0; ir[pw.nrxx]; - ZEROS(gdr1, pw.nrxx); - - GGA_PW::grad_rho( rhogsum1 , gdr1 ); - - if(NSPIN==2) - { - rhotmp2 = new double[pw.nrxx]; - rhogsum2 = new complex[pw.ngmc]; - ZEROS(rhotmp2, pw.nrxx); - ZEROS(rhogsum2, pw.ngmc); - for(int ir=0; ir[pw.nrxx]; - ZEROS(gdr2, pw.nrxx); - - GGA_PW::grad_rho( rhogsum2 , gdr2 ); - } - - const double epsr = 1.0e-6; - const double epsg = 1.0e-10; - - double grho2a = 0.0; - double grho2b = 0.0; - double sx = 0.0; - double sc = 0.0; - double v1x = 0.0; - double v2x = 0.0; - double v1c = 0.0; - double v2c = 0.0; - double vtxcgc = 0.0; - double etxcgc = 0.0; - - if(NSPIN==1||NSPIN==4) - { - double segno; - for(int ir=0; ir epsr) - { - grho2a = gdr1[ir].norm2(); - if( grho2a > epsg ) - { - if( rhotmp1[ir] >= 0.0 ) segno = 1.0; - if( rhotmp1[ir] < 0.0 ) segno = -1.0; - - XC_Functional::gcxc( arho, grho2a, sx, sc, v1x, v2x, v1c, v2c); - double tt[3]; - tt[0] = gdr1[ir].x; - tt[1] = gdr1[ir].y; - tt[2] = gdr1[ir].z; - for(int l = 0;l< 3;l++){ - for(int m = 0;m< l+1;m++){ - sigma_gradcorr[l][m] += tt[l] * tt[m] * e2 * (v2x + v2c); - } - } - } - } - } - } - else if(NSPIN==2) - { - double v1cup = 0.0; - double v1cdw = 0.0; - double v2cup = 0.0; - double v2cdw = 0.0; - double v1xup = 0.0; - double v1xdw = 0.0; - double v2xup = 0.0; - double v2xdw = 0.0; - double v2cud = 0.0; - double v2c = 0.0; - for(int ir=0; ir epsr) - { - if(igcc_is_lyp) - { - WARNING_QUIT("stress","igcc_is_lyp is not available now."); - } - else - { - double zeta = ( rhotmp1[ir] - rhotmp2[ir] ) / rh; - double grh2 = (gdr1[ir]+gdr2[ir]).norm2(); - //XC_Functional::gcc_spin(rh, zeta, grh2, sc, v1cup, v1cdw, v2c); - gcc_spin(rh, zeta, grh2, sc, v1cup, v1cdw, v2c); - v2cup = v2c; - v2cdw = v2c; - v2cud = v2c; - } - } - else - { - sc = 0.0; - v1cup = 0.0; - v1cdw = 0.0; - v2c = 0.0; - v2cup = 0.0; - v2cdw = 0.0; - v2cud = 0.0; - } - double tt1[3],tt2[3]; - { - tt1[0] = gdr1[ir].x; - tt1[1] = gdr1[ir].y; - tt1[2] = gdr1[ir].z; - tt2[0] = gdr2[ir].x; - tt2[1] = gdr2[ir].y; - tt2[2] = gdr2[ir].z; - } - for(int l = 0;l< 3;l++){ - for(int m = 0;m< l+1;m++){ - // exchange - sigma_gradcorr [l][m] += tt1[l] * tt1[m] * e2 * v2xup + - tt2[l] * tt2[m] * e2 * v2xdw; - // correlation - sigma_gradcorr [l][m] += ( tt1[l] * tt1[m] * v2cup + - tt2[l] * tt2[m] * v2cdw + - (tt1[l] * tt2[m] + - tt2[l] * tt1[m] ) * v2cud ) * e2; - } - } - } - } - - for(int l = 0;l< 3;l++){ - for(int m = 0;m< l;m++){ - sigma_gradcorr[m][l] = sigma_gradcorr[l][m]; - } - } - for(int l = 0;l<3;l++){ - for(int m = 0;m<3;m++){ - Parallel_Reduce::reduce_double_pool( sigma_gradcorr[l][m] ); - } - } - p= &sigma_gradcorr[0][0]; - double* p1 = &sigmaxc[0][0]; - for(int i=0;i<9;i++){ - *p /= pw.ncxyz ; - *p1++ += *p++; - } - - delete[] rhotmp1; - delete[] rhogsum1; - delete[] gdr1; - if(NSPIN==2) - { - delete[] rhotmp2; - delete[] rhogsum2; - delete[] gdr2; - } - return; -} - - diff --git a/ABACUS.develop/source/src_lcao/stress_lcao.h b/ABACUS.develop/source/src_lcao/stress_lcao.h deleted file mode 100644 index 79001c4c08..0000000000 --- a/ABACUS.develop/source/src_lcao/stress_lcao.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef STRESS_LCAO_H -#define STRESS_LCAO_H - -#include "../src_pw/tools.h" - -#include "../src_pw/stress.h" //test - -class Stress_LCAO -{ - public : - - Stress_LCAO (); - ~Stress_LCAO (); - - void allocate (void); - void destroy (void); - - void cal_stress_loc (void); - void cal_stress_ew (void); - void cal_stress_scc (void); - void cal_stress_cc (void); - void cal_stress_har(void); - void cal_stress_gradcorr(void); - - void print_stress(const string &name, double f[][3], const bool screen, bool ry)const; - void printstress_total (bool ry); - - void start_stress(double overlap[][3],double tvnl_dphi[][3],double vnl_dbeta[][3],double vl_dphi[][3], const matrix& stress_vdw); - - // total stress - double scs[3][3]; - - static double stress_invalid_threshold_ev; - private: - - //each part of stress - double sigmadvl[3][3]; - double sigmaewa[3][3]; - double sigmacc[3][3]; - double sigmaxc[3][3]; - double sigmahar[3][3]; - //each part of stress - //only calculated in force_lcao part - double soverlap[3][3]; - double stvnl_dphi[3][3]; - double svnl_dbeta[3][3]; - double svl_dphi[3][3]; - - bool allocate_flag; - double output_acc; // control the accuracy - - Stress str; //test -}; -#endif diff --git a/ABACUS.develop/source/src_lcao/wfc_dm_2d.cpp b/ABACUS.develop/source/src_lcao/wfc_dm_2d.cpp index e843bb458a..e98017514e 100644 --- a/ABACUS.develop/source/src_lcao/wfc_dm_2d.cpp +++ b/ABACUS.develop/source/src_lcao/wfc_dm_2d.cpp @@ -11,9 +11,11 @@ #include "src_pw/global.h" #include "src_external/src_test/test_function.h" +#include "src_external/src_test/src_global/complexmatrix-test.h" void Wfc_Dm_2d::init() { + TITLE("Wfc_Dm_2d", "init"); if(GAMMA_ONLY_LOCAL) { wfc_gamma.resize(NSPIN); @@ -28,6 +30,23 @@ void Wfc_Dm_2d::init() void Wfc_Dm_2d::cal_dm(const matrix &wg) { + TITLE("Wfc_Dm_2d", "cal_dm"); + + #ifdef TEST_DIAG + { + static int istep=0; + ofstream ofs("wfc_"+TO_STRING(istep++)+"_"+TO_STRING(MY_RANK)); + if(GAMMA_ONLY_LOCAL) + { + ofs< wg_local(ParaO.ncol,0.0); + for(int ib_global=0; ib_global!=wg.nc; ++ib_global) + { + const int ib_local = ParaO.trace_loc_col[ib_global]; + if(ib_local>=0) + { + wg_local[ib_local] = wg(is,ib_global); + } + } + + // wg_wfc(ib,iw) = wg[ib] * wfc(ib,iw); + matrix wg_wfc(wfc_gamma[is]); + for(int ir=0; ir!=wg_wfc.nr; ++ir) + { + LapackConnector::scal( wg_wfc.nc, wg_local[ir], wg_wfc.c+ir*wg_wfc.nc, 1 ); + } + + // C++: dm(iw1,iw2) = wfc(ib,iw1).T * wg_wfc(ib,iw2) + const double one_float=1.0, zero_float=0.0; + const int one_int=1; + const char N_char='N', T_char='T'; + dm_gamma[is].create( wfc_gamma[is].nr, wfc_gamma[is].nc ); + pdgemm_( + &N_char, &T_char, + &NLOCAL, &NLOCAL, &wg.nc, + &one_float, + wg_wfc.c, &one_int, &one_int, ParaO.desc, + wfc_gamma[is].c, &one_int, &one_int, ParaO.desc, + &zero_float, + dm_gamma[is].c, &one_int, &one_int, ParaO.desc); + } } else { assert(wg.nr==kv.nks); for(int ik=0; ik!=kv.nks; ++ik) - cal_dm(wg,ik); + { + std::vector wg_local(ParaO.ncol,0.0); + for(int ib_global=0; ib_global!=wg.nc; ++ib_global) + { + const int ib_local = ParaO.trace_loc_col[ib_global]; + if(ib_local>=0) + { + wg_local[ib_local] = wg(ik,ib_global); + } + } + + // wg_wfc(ib,iw) = wg[ib] * wfc(ib,iw).conj(); + ComplexMatrix wg_wfc = conj(wfc_k[ik]); + for(int ir=0; ir!=wg_wfc.nr; ++ir) + { + LapackConnector::scal( wg_wfc.nc, wg_local[ir], wg_wfc.c+ir*wg_wfc.nc, 1 ); + } + + // C++: dm(iw1,iw2) = wfc(ib,iw1).T * wg_wfc(ib,iw2) + const double one_float=1.0, zero_float=0.0; + const int one_int=1; + const char N_char='N', T_char='T'; + dm_k[ik].create( wfc_k[ik].nr, wfc_k[ik].nc ); + pzgemm_( + &N_char, &T_char, + &NLOCAL, &NLOCAL, &wg.nc, + &one_float, + wg_wfc.c, &one_int, &one_int, ParaO.desc, + wfc_k[ik].c, &one_int, &one_int, ParaO.desc, + &zero_float, + dm_k[ik].c, &one_int, &one_int, ParaO.desc); + } } #ifdef TEST_DIAG { static int istep=0; ofstream ofs("dm_"+TO_STRING(istep)+"_"+TO_STRING(MY_RANK)); - ofs< wg_local(ParaO.ncol,0.0); - for(int ib_global=0; ib_global!=wg.nc; ++ib_global) + if(GAMMA_ONLY_LOCAL) { - const int ib_local = ParaO.trace_loc_col[ib_global]; - if(ib_local>=0) - wg_local[ib_local] = wg(ik,ib_global); + ofs< wg_local(ParaO.ncol,0.0); - for(int ib_global=0; ib_global!=wg.nc; ++ib_global) + else { - const int ib_local = ParaO.trace_loc_col[ib_global]; - if(ib_local>=0) - wg_local[ib_local] = wg(ik,ib_global); + ofs< wfc_gamma; // wfc_gamma[is](ib,iw); std::vector wfc_k; // wfc_k[ik](ib,iw); + + // dm stands for density matrix std::vector dm_gamma; // dm_gamma[is](iw1,iw2); std::vector dm_k; // dm_k[ik](iw1,iw2); - void init(); + void init(void); + + // dm = wfc.T * wg * wfc.conj() void cal_dm(const matrix &wg); // wg(ik,ib), cal all dm - void cal_dm(const matrix &wg, const int ik); // wg(ik,ib), cal only dm[ik] - // dm = wfc.T * wg * wfc.conj() }; -#endif \ No newline at end of file +#endif diff --git a/ABACUS.develop/source/src_parallel/ft.h b/ABACUS.develop/source/src_parallel/ft.h index 4cd6fb4775..90370dad47 100644 --- a/ABACUS.develop/source/src_parallel/ft.h +++ b/ABACUS.develop/source/src_parallel/ft.h @@ -21,6 +21,7 @@ class FFT: public Parallel_PW FFT(); ~FFT(); + // mohan add 'const' 2021-02-25 void FFT3D(complex *psi,const int sign); // void FFT3D(double *psi, const int sign); // void FFT3D(matrix &psi, const int sign); // just for now diff --git a/ABACUS.develop/source/src_parallel/parallel_atoms.cpp b/ABACUS.develop/source/src_parallel/parallel_atoms.cpp deleted file mode 100644 index a502c7535d..0000000000 --- a/ABACUS.develop/source/src_parallel/parallel_atoms.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "parallel_atoms.h" -#include "../src_pw/global.h" - -Parallel_Atoms::Parallel_Atoms() -{ - keep_this_atom = new bool[1]; - nat = 0; -} - -Parallel_Atoms::~Parallel_Atoms() -{ - delete[] keep_this_atom; -} - - -void Parallel_Atoms::cut_atoms(void) -{ - TITLE("Parallel_Atoms","cut_atoms"); - OUT(ofs_running,"TotalAtomNumber",ucell.nat); - OUT(ofs_running,"AtomDistribution",ATOM_DISTRIBUTION); - - delete[] keep_this_atom; - keep_this_atom = new bool[ucell.nat]; - for(int i=0; inat = 0; - this->nlocal = 0; - ofs_running << " Atom index in this processor." << endl; - for(int iat=0; iatkeep_this_atom[iat] ) - { - const int start = ucell.itiaiw2iwt(it, ia, 0); - for(int iw=0; iw=0 && trace_loc_col[j]>=0) - { - ofs_running << setw(8) << i+1 << setw(8) << j+1 - << setw(8) << trace_loc_row[i] << setw(8) << trace_loc_col[j] << endl; - } - } - } - */ - - return; -} diff --git a/ABACUS.develop/source/src_parallel/parallel_atoms.h b/ABACUS.develop/source/src_parallel/parallel_atoms.h deleted file mode 100644 index 84e2858257..0000000000 --- a/ABACUS.develop/source/src_parallel/parallel_atoms.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef PARALLEL_ATOMS_H -#define PARALLEL_ATOMS_H - -#include "../src_pw/tools.h" - -class Parallel_Atoms -{ - public: - - Parallel_Atoms(); - ~Parallel_Atoms(); - - bool* keep_this_atom; - int nat; // how many atoms on this processor. - int nlocal; // how many orbitals on this processor. - void cut_atoms(void); - void set_trace(int *trace_loc_row, int *trace_loc_col, int &nrow, int &ncol); - - private: - - -}; - -#endif diff --git a/ABACUS.develop/source/src_parallel/parallel_global.cpp b/ABACUS.develop/source/src_parallel/parallel_global.cpp index d5a1d881bd..2cc9464fee 100644 --- a/ABACUS.develop/source/src_parallel/parallel_global.cpp +++ b/ABACUS.develop/source/src_parallel/parallel_global.cpp @@ -7,6 +7,10 @@ #include "parallel_reduce.h" #include "../src_global/global_function.h" +#ifdef _OPENMP +#include // Peize Lin add 2018-02-13 +#endif + using namespace std; #if defined __MPI @@ -151,7 +155,16 @@ void Parallel_Global::read_mpi_parameters(int argc,char **argv) } cout<trace_loc_row, this->trace_loc_col, - this->nrow, this->ncol); - this->nloc = nrow * ncol; - - cout << " ATOM TRACE ! " << endl; - } - else - { - cout << " common cg setting " << endl; - for (int i=0; inrow = NLOCAL; - this->ncol = NLOCAL; - } - } - //else if (DIAGO_TYPE == "canonical" - // || DIAGO_TYPE == "trace_resetting" - // || DIAGO_TYPE == "trace_correcting") xiaohui modify 2013-09-02 - else if(KS_SOLVER == "canonical" - || KS_SOLVER == "trace_resetting" - || KS_SOLVER =="trace_correcting") //xiaohui add 2013-09-02 - { - // mohan add 2011-04-07 - ParaA.cut_atoms(); - ParaA.set_trace(this->trace_loc_row, this->trace_loc_col, - this->nrow, this->ncol); - this->nloc = nrow * ncol; - } + { + cout << " common settings for trace_loc_row and dtraace_loc_col " << endl; + for (int i=0; inrow = NLOCAL; + this->ncol = NLOCAL; + } #ifdef __MPI - //else if (DIAGO_TYPE=="scalpack" - // || DIAGO_TYPE=="hpseps" || DIAGO_TYPE=="selinv") xiaohui modify 2013-09-02 - else if(KS_SOLVER=="scalpack" || KS_SOLVER=="genelpa" || KS_SOLVER=="hpseps" || KS_SOLVER=="selinv" || KS_SOLVER=="scalapack_gvx") //xiaohui add 2013-09-02 + else if(KS_SOLVER=="scalpack" || KS_SOLVER=="genelpa" || KS_SOLVER=="hpseps" + || KS_SOLVER=="selinv" || KS_SOLVER=="scalapack_gvx") //xiaohui add 2013-09-02 { - // set the row index. - //ofs_running << " nrow=" << nrow << endl; + // ofs_running << " nrow=" << nrow << endl; for (int irow=0; irow< this->nrow; irow++) { int global_row = MatrixInfo.row_set[irow]; trace_loc_row[global_row] = irow; -// ofs_running << " global_row=" << global_row << " trace_loc_row=" << trace_loc_row[global_row] << endl; + // ofs_running << " global_row=" << global_row + // << " trace_loc_row=" << trace_loc_row[global_row] << endl; } - //ofs_running << " ncol=" << ncol << endl; + // ofs_running << " ncol=" << ncol << endl; for (int icol=0; icol< this->ncol; icol++) { int global_col = MatrixInfo.col_set[icol]; trace_loc_col[global_col] = icol; -// ofs_running << " global_col=" << global_col << " trace_loc_col=" << trace_loc_col[global_col] << endl; + // ofs_running << " global_col=" << global_col + // << " trace_loc_col=" << trace_loc_col[global_col] << endl; } - } #endif else { - //cout << " Parallel Orbial, DIAGO_TYPE = " << DIAGO_TYPE << endl; xiaohui modify 2013-09-02 - cout << " Parallel Orbial, DIAGO_TYPE = " << KS_SOLVER << endl; //xiaohui add 2013-09-02 - //WARNING_QUIT("Parallel_Orbitals::set_trace","Check diago_type."); xiaohui modify 2013-09-02 - WARNING_QUIT("Parallel_Orbitals::set_trace","Check KS_SOLVER."); //xiaohui add 2013-09-02 + cout << " Parallel Orbial, DIAGO_TYPE = " << KS_SOLVER << endl; + WARNING_QUIT("Parallel_Orbitals::set_trace","Check KS_SOLVER."); } //--------------------------- diff --git a/ABACUS.develop/source/src_parallel/parallel_orbitals.h b/ABACUS.develop/source/src_parallel/parallel_orbitals.h index 9199008db3..aa65d65844 100644 --- a/ABACUS.develop/source/src_parallel/parallel_orbitals.h +++ b/ABACUS.develop/source/src_parallel/parallel_orbitals.h @@ -1,12 +1,13 @@ #ifndef PARALLEL_ORBITALS_H #define PARALLEL_ORBITALS_H -#include "../src_pw/tools.h" -#include "../src_external/src_pdiag/pdiag_double.h" +#include "src_pw/tools.h" +#include "src_pdiag/pdiag_double.h" class Parallel_Orbitals : public Pdiag_Double { public: + Parallel_Orbitals(); ~Parallel_Orbitals(); diff --git a/ABACUS.develop/source/src_parallel/parallel_pw.cpp b/ABACUS.develop/source/src_parallel/parallel_pw.cpp index 45409e71cf..c77c903bfd 100644 --- a/ABACUS.develop/source/src_parallel/parallel_pw.cpp +++ b/ABACUS.develop/source/src_parallel/parallel_pw.cpp @@ -95,9 +95,9 @@ void Parallel_PW::init(const double &gcut_in, const int &n1_in, const int &n2_in } } -delete[] this->ngm_i_number; -this->ngm_i_number = new int[10]; -ZEROS(ngm_i_number, 10); + delete[] this->ngm_i_number; + this->ngm_i_number = new int[10]; + ZEROS(ngm_i_number, 10); return; } diff --git a/ABACUS.develop/source/src_parallel/parallel_pw.h b/ABACUS.develop/source/src_parallel/parallel_pw.h index e54d8f38b7..88c72a83b8 100644 --- a/ABACUS.develop/source/src_parallel/parallel_pw.h +++ b/ABACUS.develop/source/src_parallel/parallel_pw.h @@ -36,7 +36,7 @@ class Parallel_PW//: public PW_Basis void fft_map(int *ig2fft,const int ngm, const int &ngmc_g_in, int ggchg_time); void fft_map_final_scf(int *ig2fft,const int ngm, const int &ngmc_g_in); //LiuXh add 20180619 void print_data(ofstream &print)const; - void fft_map_after_vc(int *ig2fft,const int ngm, const int &ngmc_g_in, int ggchg_time); //LiuXh add 20180515 + void fft_map_after_vc(int *ig2fft,const int ngm, const int &ngmc_g_in, int ggchg_time); //LiuXh add 20180515 int *isind; int *ismap; @@ -60,13 +60,14 @@ class Parallel_PW//: public PW_Basis int rank_use; private: + double gcut; int *ig_l2g; int ngm_i; int ngm_i_record; bool allocate_igl2g; - int ngm_i2; //LiuXh add 20180515 - int ngm_i_record2; //LiuXh add 20180515 + int ngm_i2; //LiuXh add 20180515 + int ngm_i_record2; //LiuXh add 20180515 int *ngm_i_number; bool allocate_igl2g_final_scf; //LiuXh add 20180619 int ngm_i_final_scf; diff --git a/ABACUS.develop/source/src_parallel/subgrid_oper.cpp b/ABACUS.develop/source/src_parallel/subgrid_oper.cpp index ad81e2498d..936cc78508 100644 --- a/ABACUS.develop/source/src_parallel/subgrid_oper.cpp +++ b/ABACUS.develop/source/src_parallel/subgrid_oper.cpp @@ -113,15 +113,7 @@ void SubGrid_oper::cal_totwfc() // reduce occupy and get the full occupations. #ifdef __MPI // mohan 2012-02-23 - if(ATOM_DISTRIBUTION==1) - { - ofs_running << " Because of the atom distribution." << endl; - ofs_running << " Don't reduce the trace_lo_tot here." << endl; - } - else - { - Parallel_Reduce::reduce_int_grid(occupy, NLOCAL); - } + Parallel_Reduce::reduce_int_grid(occupy, NLOCAL); #endif /* @@ -180,22 +172,11 @@ void SubGrid_oper::cal_totwfc() // need to allocate the pointer, // because it would be some array's // entrance parameters. - if(!BFIELD) - { - this->totwfc = new double**[1]; - for(int is=0; is<1; ++is) - { - this->totwfc[is] = new double*[NBANDS]; - } - } - // for B field. - else + // mohan update 2021-02-12 + this->totwfc = new double**[1]; + for(int is=0; is<1; ++is) { - this->totwfc_B = new complex**[1]; - for(int is=0; is<1; ++is) - { - this->totwfc_B[is] = new complex*[NBANDS]; - } + this->totwfc[is] = new double*[NBANDS]; } this->allocate_totwfc=false; return; @@ -211,76 +192,40 @@ void SubGrid_oper::cal_totwfc() } - if(!BFIELD) - { - this->totwfc = new double**[1]; - for(int is=0; is<1; ++is) - { - this->totwfc[is] = new double*[NBANDS]; - for(int ib=0; ibtotwfc[is][ib] = new double[lgd]; - ZEROS(totwfc[is][ib], lgd); - - // mohan update 2012-02-10 - //if(DIAGO_TYPE!="cg") xiaohui modify 2013-09-02 - if(KS_SOLVER!="cg") //xiaohui add 2013-09-02 - { - for(int i=0; itotwfc[is][ib][i] = LOWF.WFC_GAMMA[CURRENT_SPIN][ib][i]; //mohan update 2012-02-07 - } - } - } - } - } - else + this->totwfc = new double**[1]; + for(int is=0; is<1; ++is) { - this->totwfc_B = new complex**[1]; - for(int is=0; is<1; ++is) + this->totwfc[is] = new double*[NBANDS]; + for(int ib=0; ibtotwfc_B[is] = new complex*[NBANDS]; - for(int ib=0; ibtotwfc_B[is][ib] = new complex[lgd]; - ZEROS(totwfc_B[is][ib], lgd); - //if(DIAGO_TYPE!="cg") xiaohui modify 2013-09-02 - if(KS_SOLVER!="cg") //xiaohui add 2013-09-02 + this->totwfc[is][ib] = new double[lgd]; + ZEROS(totwfc[is][ib], lgd); + + // mohan update 2012-02-10 + //if(DIAGO_TYPE!="cg") xiaohui modify 2013-09-02 + if(KS_SOLVER!="cg") //xiaohui add 2013-09-02 + { + for(int i=0; itotwfc_B[is][ib][trace_lo_tot[i]] = ONE; - } + totwfc[is][ib][trace_lo_tot[i]] = 1.0; } } } - else + } + else //use cg method + { + // bug: dimension of WFC_GAMMA is smaller than totwfc + for(int i=0; itotwfc_B[is][ib][i] = LOWF.WFC_GAMMA_B[CURRENT_SPIN][ib][i]; - } + // mohan comment out 2021-02-09 + // this->totwfc[is][ib][i] = LOWF.WFC_GAMMA[CURRENT_SPIN][ib][i]; //mohan update 2012-02-07 } } - } + } } allocate_totwfc = true; @@ -328,7 +273,8 @@ void SubGrid_oper::dis_subwfc() for(int ib=0; ibtotwfc[0][ib][mu2]; + // mohan comment out 2021-02-09 + // LOWF.WFC_GAMMA[CURRENT_SPIN][ib][mu1] = this->totwfc[0][ib][mu2]; }//ib }//mu1>=0 }//iw @@ -419,7 +365,8 @@ void SubGrid_oper::dis_subwfc() { for (int mu=0; mutotwfc[0][ib][mu2]; + // mohan comment out 2021-02-09 +// LOWF.WFC_GAMMA[CURRENT_SPIN][ib][mu1] = this->totwfc[0][ib][mu2]; }//ib }//mu1>=0 }//iw @@ -494,240 +442,3 @@ void SubGrid_oper::dis_subwfc() return; } - - - -void SubGrid_oper::dis_subwfc_complex() -{ - TITLE("SubGrid_oper","dis_subwfc_complex"); - -#ifdef __MPI - -// cout << " distribute the wave functions " << endl; - - //------------------------------------------ - // bcast the eigenvalues - //------------------------------------------ - for(int ik=0; ik= 0) - { - const int mu2 = this->trace_lo_tot[iw]; - - for(int ib=0; ibtotwfc_B[0][ib][mu2]; - }//ib - }//mu1>=0 - }//iw - }//i - else - { - int tag; - // receive trace_lo2 - tag = i * 10; - int* trace_lo2 = new int[NLOCAL]; - MPI_Recv(trace_lo2, NLOCAL, MPI_INT, i, tag, GRID_WORLD, &status); - -/* - ofs_running << " Proc " << i << endl; - for(int i=0; i* crecv = new complex[NBANDS*GridT.lgd]; - ZEROS(crecv, NBANDS*GridT.lgd); - - tag = GRANK * 10 + 2; -// ofs_running << " receive=" << tag << endl; - MPI_Recv(crecv, NBANDS*GridT.lgd, mpicomplex, 0, tag, GRID_WORLD, &status); -// ofs_running << " receive done." << endl; - - - for(int ib=0; ib*** totwfc_B;//mohan add 2012-04-13 bool allocate_totwfc; int lgd; diff --git a/ABACUS.develop/source/src_external/src_pdiag/Cblacs.h b/ABACUS.develop/source/src_pdiag/Cblacs.h similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/Cblacs.h rename to ABACUS.develop/source/src_pdiag/Cblacs.h diff --git a/ABACUS.develop/source/src_external/src_pdiag/GenELPA.cpp b/ABACUS.develop/source/src_pdiag/GenELPA.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/GenELPA.cpp rename to ABACUS.develop/source/src_pdiag/GenELPA.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/GenELPA.h b/ABACUS.develop/source/src_pdiag/GenELPA.h similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/GenELPA.h rename to ABACUS.develop/source/src_pdiag/GenELPA.h diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dcopy.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dcopy.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dcopy.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dcopy.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlae2.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlae2.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlae2.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlae2.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaebz.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlaebz.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaebz.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlaebz.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaev2.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlaev2.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaev2.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlaev2.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaneg.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlaneg.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaneg.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlaneg.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlanst.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlanst.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlanst.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlanst.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlar1v.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlar1v.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlar1v.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlar1v.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarnv.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarnv.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarnv.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarnv.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarra.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarra.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarra.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarra.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrb.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrb.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrb.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrb.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrc.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrc.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrc.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrc.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrd.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrd.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrd.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrd.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarre.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarre.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarre.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarre.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrf.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrf.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrf.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrf.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrj.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrj.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrj.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrj.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrk.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrk.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrk.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrk.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrr.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrr.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrr.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrr.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrv.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlarrv.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlarrv.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlarrv.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaruv.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlaruv.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaruv.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlaruv.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlas2.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlas2.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlas2.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlas2.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlascl.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlascl.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlascl.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlascl.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaset.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlaset.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlaset.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlaset.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq2.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlasq2.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq2.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlasq2.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq3.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlasq3.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq3.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlasq3.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq4.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlasq4.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq4.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlasq4.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq5.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlasq5.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq5.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlasq5.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq6.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlasq6.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasq6.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlasq6.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasrt.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlasrt.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlasrt.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlasrt.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dlassq.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dlassq.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dlassq.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dlassq.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dscal.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dscal.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dscal.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dscal.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dstemr_mpi.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dstemr_mpi.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dstemr_mpi.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dstemr_mpi.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/dswap.cpp b/ABACUS.develop/source/src_pdiag/MRRR/dswap.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/dswap.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/dswap.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/i_nint.cpp b/ABACUS.develop/source/src_pdiag/MRRR/i_nint.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/i_nint.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/i_nint.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/ieeeck.cpp b/ABACUS.develop/source/src_pdiag/MRRR/ieeeck.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/ieeeck.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/ieeeck.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/ilaenv.cpp b/ABACUS.develop/source/src_pdiag/MRRR/ilaenv.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/ilaenv.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/ilaenv.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/iparmq.cpp b/ABACUS.develop/source/src_pdiag/MRRR/iparmq.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/iparmq.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/iparmq.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/lsame.cpp b/ABACUS.develop/source/src_pdiag/MRRR/lsame.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/lsame.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/lsame.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/mr_interface.h b/ABACUS.develop/source/src_pdiag/MRRR/mr_interface.h similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/mr_interface.h rename to ABACUS.develop/source/src_pdiag/MRRR/mr_interface.h diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/mrrr.h b/ABACUS.develop/source/src_pdiag/MRRR/mrrr.h similarity index 97% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/mrrr.h rename to ABACUS.develop/source/src_pdiag/MRRR/mrrr.h index 5ed9293fe6..0c04fb184b 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/MRRR/mrrr.h +++ b/ABACUS.develop/source/src_pdiag/MRRR/mrrr.h @@ -13,6 +13,7 @@ #define max(a,b) ((a) >= (b) ? (a) : (b)) #define dmin(a,b) (double)min(a,b) #define dmax(a,b) (double)max(a,b) +#define dlamch dlamch_ extern "C" double dlamch(char *); /* diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/psort_w.cpp b/ABACUS.develop/source/src_pdiag/MRRR/psort_w.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/psort_w.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/psort_w.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/s_cmp.cpp b/ABACUS.develop/source/src_pdiag/MRRR/s_cmp.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/s_cmp.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/s_cmp.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/s_copy.cpp b/ABACUS.develop/source/src_pdiag/MRRR/s_copy.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/s_copy.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/s_copy.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/MRRR/xerbla.cpp b/ABACUS.develop/source/src_pdiag/MRRR/xerbla.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/MRRR/xerbla.cpp rename to ABACUS.develop/source/src_pdiag/MRRR/xerbla.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/my_elpa.h b/ABACUS.develop/source/src_pdiag/my_elpa.h similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/my_elpa.h rename to ABACUS.develop/source/src_pdiag/my_elpa.h diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdgseps.cpp b/ABACUS.develop/source/src_pdiag/pdgseps.cpp similarity index 98% rename from ABACUS.develop/source/src_external/src_pdiag/pdgseps.cpp rename to ABACUS.develop/source/src_pdiag/pdgseps.cpp index 097594cab3..9af506ac5a 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdgseps.cpp +++ b/ABACUS.develop/source/src_pdiag/pdgseps.cpp @@ -1,9 +1,7 @@ //column-circle decomposition #include"./MRRR/mr_interface.h" #include "pdgseps.h" - -#include "../../src_parallel/parallel_reduce.h" - +#include "src_parallel/parallel_reduce.h" #include "pdsyg2st.h" #include "pdsytrd.h" #include "pdt2s.h" diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdgseps.h b/ABACUS.develop/source/src_pdiag/pdgseps.h similarity index 88% rename from ABACUS.develop/source/src_external/src_pdiag/pdgseps.h rename to ABACUS.develop/source/src_pdiag/pdgseps.h index 2b72590864..cc23bcf5e2 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdgseps.h +++ b/ABACUS.develop/source/src_pdiag/pdgseps.h @@ -1,7 +1,7 @@ #ifndef PDGSEPS_H #define PDGSEPS_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pdgseps( diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdiag_basic.cpp b/ABACUS.develop/source/src_pdiag/pdiag_basic.cpp similarity index 95% rename from ABACUS.develop/source/src_external/src_pdiag/pdiag_basic.cpp rename to ABACUS.develop/source/src_pdiag/pdiag_basic.cpp index b2554cfdc4..41b3a5ecad 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdiag_basic.cpp +++ b/ABACUS.develop/source/src_pdiag/pdiag_basic.cpp @@ -1,7 +1,7 @@ #include "pdiag_basic.h" -#include "../../src_parallel/parallel_common.h" -#include "../../src_pw/global.h" -#include "../../src_lcao/wf_local.h" +#include "src_parallel/parallel_common.h" +#include "src_pw/global.h" +#include "src_io/wf_local.h" #include "src_global/lapack_connector.h" Pdiag_Basic::Pdiag_Basic() @@ -40,8 +40,6 @@ void Pdiag_Basic::set_parameters(void) WARNING_QUIT("Pdiag_Basic::set_parameters","NLOCAL < DSIZE"); } - - if (DRANKlastband_in_proc = 0; this->lastband_number = 0; @@ -101,7 +100,7 @@ void Pdiag_Basic::set_parameters(void) { if (i **cc,comp // mohan add 2012-01-09 // // for complex - if(BFIELD) - { - ofs_running << " not augmented wave functions are implemented with B field" << endl; - //WF_Local::distri_lowf_aug_complex( ctot, LOWF.WFC_GAMMA_B_aug[ik]); - } - else - { - WF_Local::distri_lowf_aug_complex( ctot, LOWF.WFC_K_aug[ik]); //mohan add 2012-01-09 - } + // mohan update 2021-02-12, delete BFIELD option + WF_Local::distri_lowf_aug_complex( ctot, LOWF.WFC_K_aug[ik]); //mohan add 2012-01-09 // clean staff. diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdiag_basic.h b/ABACUS.develop/source/src_pdiag/pdiag_basic.h similarity index 97% rename from ABACUS.develop/source/src_external/src_pdiag/pdiag_basic.h rename to ABACUS.develop/source/src_pdiag/pdiag_basic.h index 996d4d65af..eb3afaa717 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdiag_basic.h +++ b/ABACUS.develop/source/src_pdiag/pdiag_basic.h @@ -1,7 +1,7 @@ #ifndef PDIAG_BASIC_H #define PDIAG_BASIC_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" class Pdiag_Basic diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdiag_common.cpp b/ABACUS.develop/source/src_pdiag/pdiag_common.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdiag_common.cpp rename to ABACUS.develop/source/src_pdiag/pdiag_common.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdiag_common.h b/ABACUS.develop/source/src_pdiag/pdiag_common.h similarity index 89% rename from ABACUS.develop/source/src_external/src_pdiag/pdiag_common.h rename to ABACUS.develop/source/src_pdiag/pdiag_common.h index 55cd8466fb..d5eaef7f7e 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdiag_common.h +++ b/ABACUS.develop/source/src_pdiag/pdiag_common.h @@ -5,7 +5,7 @@ #include "mpi.h" #endif #include "src_global/blas_connector.h" -#include "../../src_global/lapack_connector.h" // Peize Lin add 2016-08-04 +#include "src_global/lapack_connector.h" // Peize Lin add 2016-08-04 struct LocalMatrix { diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdiag_double.cpp b/ABACUS.develop/source/src_pdiag/pdiag_double.cpp similarity index 81% rename from ABACUS.develop/source/src_external/src_pdiag/pdiag_double.cpp rename to ABACUS.develop/source/src_pdiag/pdiag_double.cpp index caa3417198..6a3b6a3c7b 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdiag_double.cpp +++ b/ABACUS.develop/source/src_pdiag/pdiag_double.cpp @@ -3,10 +3,10 @@ #include "src_global/lapack_connector.h" #include "src_pw/occupy.h" #include "src_pw/global.h" -//#include "../src_pw/global.h" -//xiaohui add 2014-06-20 #include "src_lcao/local_orbital_charge.h" -#include "src_lcao/wf_local.h" +#include "src_io/wf_local.h" + + #ifdef __MPI extern "C" { @@ -313,9 +313,6 @@ void Pdiag_Double::divide_HS_2d if(DCOLOR!=0) return; // mohan add 2012-01-13 -// OUT(ofs_running,"NLOCAL",NLOCAL); -// OUT(ofs_running,"NPROC",NPROC); - // get the 2D index of computer. this->dim0 = (int)sqrt((double)DSIZE); //mohan update 2012/01/13 //while (NPROC_IN_POOL%dim0!=0) @@ -325,7 +322,7 @@ void Pdiag_Double::divide_HS_2d } assert(dim0 > 0); this->dim1=DSIZE/dim0; -// testpb=1; //mohan test + if(testpb)OUT(ofs_running,"dim0",dim0); if(testpb)OUT(ofs_running,"dim1",dim1); @@ -395,8 +392,13 @@ void Pdiag_Double::divide_HS_2d return; } -void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2d, - double* h_mat, double* s_mat, double* ekb) +void Pdiag_Double::diago_double_begin( + const int &ik, // k-point index + double **wfc, // wave functions + matrix &wfc_2d, // wave functions in 2d + double* h_mat, // hamiltonian matrix + double* s_mat, // overlap matrix + double* ekb) // eigenvalues for each k-point and band { #ifdef TEST_DIAG { @@ -512,6 +514,7 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 MPI_Reduce(&nloc, &maxnloc, 1, MPI_LONG, MPI_MAX, 0, comm_2D); MPI_Bcast(&maxnloc, 1, MPI_LONG, 0, comm_2D); wfc_2d.create(this->ncol,this->nrow); // Fortran order + double *work=new double[maxnloc]; // work/buffer matrix static int method; bool wantEigenVector=true; @@ -522,7 +525,7 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 int THIS_REAL_ELPA_KERNEL_API=12; int useQR=0; // may be changed to input parameter sometime - if(chr.get_new_e_iteration()) + if(CHR.get_new_e_iteration()) { timer::tick("Diago_LCAO_Matrix","genelpa1",'G'); method=0; @@ -545,9 +548,11 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 LapackConnector::copy(NBANDS, eigen, inc, ekb, inc); delete[] eigen; OUT(ofs_running,"eigenvalues were copied to ekb"); + if(NEW_DM==0) { - //convert wave function to band distribution and calculate the density matrix in the tranditional way + // convert wave function to band distribution + // and calculate the density matrix in the tranditional way // redistribute eigenvectors to wfc / wfc_aug timer::tick("Diago_LCAO_Matrix","gath_eig",'G'); @@ -586,21 +591,11 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 } Memory::record("Pdiag_Basic","ctot",NBANDS*NLOCAL,"double"); } - if(BFIELD) - { - cout << " not implement distri_lowf_aug yet." << endl; - WARNING_QUIT("Pdiag_Basic::gath_eig","not implement distri_lowf_aug yet for Bfield"); - info=q2ZLOC_WFC_CTOT(myid, pos, naroc, nb, - dim0, dim1, iprow, ipcol, this->loc_size, - work, Z_LOC[ik], wfc, ctot); - } - else - { - info=q2ZLOC_WFC_WFCAUG_CTOT(myid, pos, naroc, nb, - dim0, dim1, iprow, ipcol, this->loc_size, - work, Z_LOC[ik], wfc, LOWF.WFC_GAMMA_aug[CURRENT_SPIN], ctot); - } - stringstream ss; + // mohan delete Bfield option 2021-02-12 + info=q2ZLOC_WFC_WFCAUG_CTOT(myid, pos, naroc, nb, + dim0, dim1, iprow, ipcol, this->loc_size, + work, Z_LOC[ik], wfc, LOWF.WFC_GAMMA_aug[CURRENT_SPIN], ctot); + stringstream ss; ss << global_out_dir << "LOWF_GAMMA_S" << CURRENT_SPIN+1 << ".dat"; // mohan add 2012-04-03, because we need the occupations for the // first iteration. @@ -616,21 +611,11 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 } else { - if(BFIELD) - { - cout << " not implement distri_lowf_aug yet." << endl; - WARNING_QUIT("Pdiag_Basic::gath_eig","not implement distri_lowf_aug yet for Bfield"); - info=q2ZLOC_WFC(pos, naroc, nb, - dim0, dim1, iprow, ipcol, this->loc_size, - work, Z_LOC[ik], wfc); - } - else - { - info=q2ZLOC_WFC_WFCAUG(pos, naroc, nb, - dim0, dim1, iprow, ipcol, this->loc_size, - work, Z_LOC[ik], wfc, LOWF.WFC_GAMMA_aug[CURRENT_SPIN]); - } - } + // mohan update 2021-02-12, delete Bfield option + info=q2ZLOC_WFC_WFCAUG(pos, naroc, nb, + dim0, dim1, iprow, ipcol, this->loc_size, + work, Z_LOC[ik], wfc, LOWF.WFC_GAMMA_aug[CURRENT_SPIN]); + } } } } @@ -650,18 +635,30 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 const int itype=1; int lwork=-1, info=0; vector work(1,0); - dsygv_(&itype, &jobz, &uplo, &NLOCAL, wfc_2d.c, &NLOCAL, s_tmp.c, &NLOCAL, ekb_tmp.data(), work.data(), &lwork, &info); + dsygv_(&itype, &jobz, &uplo, &NLOCAL, wfc_2d.c, &NLOCAL, + s_tmp.c, &NLOCAL, ekb_tmp.data(), work.data(), &lwork, &info); + if(info) + { throw runtime_error("info="+TO_STRING(info)+". "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + lwork = work[0]; work.resize(lwork); - dsygv_(&itype, &jobz, &uplo, &NLOCAL, wfc_2d.c, &NLOCAL, s_tmp.c, &NLOCAL, ekb_tmp.data(), work.data(), &lwork, &info); + + dsygv_(&itype, &jobz, &uplo, &NLOCAL, wfc_2d.c, &NLOCAL, + s_tmp.c, &NLOCAL, ekb_tmp.data(), work.data(), &lwork, &info); + if(info) + { throw runtime_error("info="+TO_STRING(info)+". "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } memcpy( ekb, ekb_tmp.data(), sizeof(double)*NBANDS ); if(NEW_DM==0) + { throw domain_error("NEW_DM must be 1. "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } } else if(KS_SOLVER=="lapack_gvx") { @@ -678,23 +675,35 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 vector work(1,0); vector iwork(5*NLOCAL,0); vector ifail(NLOCAL,0); + dsygvx_(&itype, &jobz, &range, &uplo, &NLOCAL, h_tmp.c, &NLOCAL, s_tmp.c, &NLOCAL, NULL, NULL, &il, &iu, &abstol, &M, ekb, wfc_2d.c, &NLOCAL, work.data(), &lwork, iwork.data(), ifail.data(), &info); + if(info) + { throw runtime_error("info="+TO_STRING(info)+". "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + lwork = work[0]; work.resize(lwork); dsygvx_(&itype, &jobz, &range, &uplo, &NLOCAL, h_tmp.c, &NLOCAL, s_tmp.c, &NLOCAL, NULL, NULL, &il, &iu, &abstol, &M, ekb, wfc_2d.c, &NLOCAL, work.data(), &lwork, iwork.data(), ifail.data(), &info); + if(info) + { throw runtime_error("info="+TO_STRING(info)+". "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } if(M!=NBANDS) + { throw runtime_error("M="+TO_STRING(M)+". NBANDS="+TO_STRING(NBANDS)+". "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } if(NEW_DM==0) + { throw domain_error("NEW_DM must be 1. "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } } else if(KS_SOLVER=="scalapack_gvx") { @@ -719,32 +728,42 @@ void Pdiag_Double::diago_double_begin(const int &ik, double **wfc, matrix &wfc_2 NULL, NULL, &il, &iu, &abstol, &M, &NZ, ekb, &orfac, wfc_2d.c, &one, &one, desc, work.data(), &lwork, iwork.data(), &liwork, ifail.data(), iclustr.data(), gap.data(), &info); + ofs_running<<"lwork="< **wfc, ComplexMatrix &wfc_2d, complex* ch_mat, complex* cs_mat, double *ekb) { + #ifdef TEST_DIAG + { + static int istep = 0; + auto print_matrix_C = [&](const string &file_name, complex*m) + { + ofstream ofs(file_name+"-C_"+TO_STRING(istep)+"_"+TO_STRING(MY_RANK)); + for(int ic=0; ic1E-10) + { + if(std::imag(m[index])>1E-10) + ofs<*m) + { + ofstream ofs(file_name+"-F_"+TO_STRING(istep)+"_"+TO_STRING(MY_RANK)); + for(int ir=0; ir1E-10) + { + if(std::imag(m[index])>1E-10) + ofs< **wfc, Com } Memory::record("Pdiag_Basic","ctot",NBANDS*NLOCAL,"cdouble"); } - if(BFIELD) - { - ofs_running << " not augmented wave functions are implemented with B field" << endl; - info=q2WFC_CTOT_complex(myid, naroc, nb, - dim0, dim1, iprow, ipcol, - work, wfc, ctot); - } - else - { - info=q2WFC_WFCAUG_CTOT_complex(myid, naroc, nb, - dim0, dim1, iprow, ipcol, - work, wfc, LOWF.WFC_K_aug[ik], ctot); - } + // mohan update 2021-02-12, delete BFIELD option + info=q2WFC_WFCAUG_CTOT_complex(myid, naroc, nb, + dim0, dim1, iprow, ipcol, + work, wfc, LOWF.WFC_K_aug[ik], ctot); stringstream ss; ss << global_out_dir << "LOWF_K_" << ik+1 << ".dat"; // mohan add 2012-04-03, because we need the occupations for the @@ -919,25 +982,134 @@ void Pdiag_Double::diago_complex_begin(const int &ik, complex **wfc, Com } else { - if(BFIELD) - { - ofs_running << " not augmented wave functions are implemented with B field" << endl; - info=q2WFC_complex(naroc, nb, - dim0, dim1, iprow, ipcol, - work, wfc); - } - else - { - info=q2WFC_WFCAUG_complex(naroc, nb, - dim0, dim1, iprow, ipcol, - work, wfc, LOWF.WFC_K_aug[ik]); - } - } + // mohan update 2021-02-12, delte BFIELD option + info=q2WFC_WFCAUG_complex(naroc, nb, + dim0, dim1, iprow, ipcol, + work, wfc, LOWF.WFC_K_aug[ik]); + } } } delete[] work; timer::tick("Diago_LCAO_Matrix","gath_eig_complex",'G'); } // GenELPA method + else if(KS_SOLVER=="scalapack_gvx") + { + ComplexMatrix h_tmp(this->ncol, this->nrow, false); + memcpy( h_tmp.c, ch_mat, sizeof(complex)*this->ncol*this->nrow ); + ComplexMatrix s_tmp(this->ncol, this->nrow, false); + memcpy( s_tmp.c, cs_mat, sizeof(complex)*this->ncol*this->nrow ); + wfc_2d.create(this->ncol, this->nrow, false); + + const char jobz='V', range='I', uplo='U'; + const int itype=1, il=1, iu=NBANDS, one=1; + int M=0, NZ=0, lwork=-1, lrwork=-1, liwork=-1, info=0; + const double abstol=0, orfac=-1; + vector> work(1,0); + vector rwork(1,0); + vector iwork(1,0); + vector ifail(NLOCAL,0); + vector iclustr(2*DSIZE); + vector gap(DSIZE); + + pzhegvx_(&itype, &jobz, &range, &uplo, + &NLOCAL, h_tmp.c, &one, &one, desc, s_tmp.c, &one, &one, desc, + NULL, NULL, &il, &iu, &abstol, + &M, &NZ, ekb, &orfac, wfc_2d.c, &one, &one, desc, + work.data(), &lwork, rwork.data(), &lrwork, iwork.data(), &liwork, ifail.data(), iclustr.data(), gap.data(), &info); + ofs_running<<"lwork="< *work=new complex[maxnloc]; // work/buffer matrix + + int naroc[2]; // maximum number of row or column + for(int iprow=0; iprowout_lowf) + { + complex **ctot; + if(myid==0) + { + ctot = new complex*[NBANDS]; + for (int i=0; i[NLOCAL]; + ZEROS(ctot[i], NLOCAL); + } + Memory::record("Pdiag_Basic","ctot",NBANDS*NLOCAL,"cdouble"); + } + // mohan update 2021-02-12, delete BFIELD option + info=q2WFC_WFCAUG_CTOT_complex(myid, naroc, nb, + dim0, dim1, iprow, ipcol, + work, wfc, LOWF.WFC_K_aug[ik], ctot); + stringstream ss; + ss << global_out_dir << "LOWF_K_" << ik+1 << ".dat"; + // mohan add 2012-04-03, because we need the occupations for the + // first iteration. + WF_Local::write_lowf_complex( ss.str(), ctot, ik );//mohan add 2010-09-09 + if(myid==0) + { + for (int i=0; i **wfc, ComplexMatrix &wfc_2d, complex *ch_mat, complex *cs_mat, double *ekb); // Peize Lin add wfc_2d 2019-01-17 @@ -32,6 +34,7 @@ class Pdiag_Double : public Pdiag_Basic void readin(const string &fa, const string &fb, const int &nlocal, double *eigen, double *eigvr); #endif + // be called void divide_HS_2d ( #ifdef __MPI diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdst2g.cpp b/ABACUS.develop/source/src_pdiag/pdst2g.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdst2g.cpp rename to ABACUS.develop/source/src_pdiag/pdst2g.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdst2g.h b/ABACUS.develop/source/src_pdiag/pdst2g.h similarity index 85% rename from ABACUS.develop/source/src_external/src_pdiag/pdst2g.h rename to ABACUS.develop/source/src_pdiag/pdst2g.h index 5165a472bd..5370f75294 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdst2g.h +++ b/ABACUS.develop/source/src_pdiag/pdst2g.h @@ -1,7 +1,7 @@ #ifndef PDST2G_H #define PDST2G_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pdst2g(MPI_Comm comm_2D,int NB,int N_A,double *A,double *B, diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdstebz.cpp b/ABACUS.develop/source/src_pdiag/pdstebz.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdstebz.cpp rename to ABACUS.develop/source/src_pdiag/pdstebz.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdstebz.h b/ABACUS.develop/source/src_pdiag/pdstebz.h similarity index 81% rename from ABACUS.develop/source/src_external/src_pdiag/pdstebz.h rename to ABACUS.develop/source/src_pdiag/pdstebz.h index 290d1fab28..de2dd53f9a 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdstebz.h +++ b/ABACUS.develop/source/src_pdiag/pdstebz.h @@ -1,7 +1,7 @@ #ifndef PDSTEBZ_H #define PDSTEBZ_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pdstebz(MPI_Comm comm_2D, double *D,double *E,double *eigen,int N); diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdsteiz.cpp b/ABACUS.develop/source/src_pdiag/pdsteiz.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdsteiz.cpp rename to ABACUS.develop/source/src_pdiag/pdsteiz.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdsteiz.h b/ABACUS.develop/source/src_pdiag/pdsteiz.h similarity index 81% rename from ABACUS.develop/source/src_external/src_pdiag/pdsteiz.h rename to ABACUS.develop/source/src_pdiag/pdsteiz.h index a5ac34e831..66301e0e45 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdsteiz.h +++ b/ABACUS.develop/source/src_pdiag/pdsteiz.h @@ -1,7 +1,7 @@ #ifndef PDSTEIZ_H #define PDSTEIZ_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pdsteiz(int n,double *a,double *b,double *w,double *Z,int m); diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdsyg2st.cpp b/ABACUS.develop/source/src_pdiag/pdsyg2st.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdsyg2st.cpp rename to ABACUS.develop/source/src_pdiag/pdsyg2st.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdsyg2st.h b/ABACUS.develop/source/src_pdiag/pdsyg2st.h similarity index 86% rename from ABACUS.develop/source/src_external/src_pdiag/pdsyg2st.h rename to ABACUS.develop/source/src_pdiag/pdsyg2st.h index c16bb5ac0b..bfa5429b0b 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdsyg2st.h +++ b/ABACUS.develop/source/src_pdiag/pdsyg2st.h @@ -1,7 +1,7 @@ #ifndef PDSYG2ST_H #define PDSYG2ST_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pdsyg2st( diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdsytrd.cpp b/ABACUS.develop/source/src_pdiag/pdsytrd.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdsytrd.cpp rename to ABACUS.develop/source/src_pdiag/pdsytrd.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdsytrd.h b/ABACUS.develop/source/src_pdiag/pdsytrd.h similarity index 87% rename from ABACUS.develop/source/src_external/src_pdiag/pdsytrd.h rename to ABACUS.develop/source/src_pdiag/pdsytrd.h index e2bb4ab1ef..b427e9a310 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdsytrd.h +++ b/ABACUS.develop/source/src_pdiag/pdsytrd.h @@ -1,7 +1,7 @@ #ifndef PDSYTRD_H #define PDSYTRD_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" #include "pdsytrd.h" diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdt2s.cpp b/ABACUS.develop/source/src_pdiag/pdt2s.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdt2s.cpp rename to ABACUS.develop/source/src_pdiag/pdt2s.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdt2s.h b/ABACUS.develop/source/src_pdiag/pdt2s.h similarity index 85% rename from ABACUS.develop/source/src_external/src_pdiag/pdt2s.h rename to ABACUS.develop/source/src_pdiag/pdt2s.h index d006d11edc..a3075d7adb 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdt2s.h +++ b/ABACUS.develop/source/src_pdiag/pdt2s.h @@ -1,7 +1,7 @@ #ifndef PDT2S_H #define PDT2S_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pdt2s(MPI_Comm comm2D,int N_A,int NB,double *A,double *X, diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdtrsm.cpp b/ABACUS.develop/source/src_pdiag/pdtrsm.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pdtrsm.cpp rename to ABACUS.develop/source/src_pdiag/pdtrsm.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pdtrsm.h b/ABACUS.develop/source/src_pdiag/pdtrsm.h similarity index 86% rename from ABACUS.develop/source/src_external/src_pdiag/pdtrsm.h rename to ABACUS.develop/source/src_pdiag/pdtrsm.h index 12370d18c2..8194780e5c 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pdtrsm.h +++ b/ABACUS.develop/source/src_pdiag/pdtrsm.h @@ -1,7 +1,7 @@ #ifndef PDTRSM_H #define PDTRSM_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pdtrsm(char isuplo,int b_n,MPI_Comm comm_2D,int NB,int N_A, diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzgseps.cpp b/ABACUS.develop/source/src_pdiag/pzgseps.cpp similarity index 98% rename from ABACUS.develop/source/src_external/src_pdiag/pzgseps.cpp rename to ABACUS.develop/source/src_pdiag/pzgseps.cpp index 96d9d69ec6..727db9c853 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzgseps.cpp +++ b/ABACUS.develop/source/src_pdiag/pzgseps.cpp @@ -1,6 +1,6 @@ //column-circle decomposition #include "pzgseps.h" -#include "../../src_parallel/parallel_reduce.h" +#include "src_parallel/parallel_reduce.h" #include "src_global/lapack_connector.h" #include "pzheg2st.h" diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzgseps.h b/ABACUS.develop/source/src_pdiag/pzgseps.h similarity index 90% rename from ABACUS.develop/source/src_external/src_pdiag/pzgseps.h rename to ABACUS.develop/source/src_pdiag/pzgseps.h index 7986936d57..3ad2309278 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzgseps.h +++ b/ABACUS.develop/source/src_pdiag/pzgseps.h @@ -1,7 +1,7 @@ #ifndef PZGSEPS_H #define PZGSEPS_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pzgseps( diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzheg2st.cpp b/ABACUS.develop/source/src_pdiag/pzheg2st.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pzheg2st.cpp rename to ABACUS.develop/source/src_pdiag/pzheg2st.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzheg2st.h b/ABACUS.develop/source/src_pdiag/pzheg2st.h similarity index 87% rename from ABACUS.develop/source/src_external/src_pdiag/pzheg2st.h rename to ABACUS.develop/source/src_pdiag/pzheg2st.h index f16d9fd659..15fca54b07 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzheg2st.h +++ b/ABACUS.develop/source/src_pdiag/pzheg2st.h @@ -1,7 +1,7 @@ #ifndef PZHEG2ST_H #define PZHEG2ST_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pzheg2st( diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzhetrd.cpp b/ABACUS.develop/source/src_pdiag/pzhetrd.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pzhetrd.cpp rename to ABACUS.develop/source/src_pdiag/pzhetrd.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzhetrd.h b/ABACUS.develop/source/src_pdiag/pzhetrd.h similarity index 88% rename from ABACUS.develop/source/src_external/src_pdiag/pzhetrd.h rename to ABACUS.develop/source/src_pdiag/pzhetrd.h index aed4926688..921859a308 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzhetrd.h +++ b/ABACUS.develop/source/src_pdiag/pzhetrd.h @@ -1,7 +1,7 @@ #ifndef PZHETRD_H #define PZHETRD_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" #include "pzhetrd.h" diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzhtrsm.cpp b/ABACUS.develop/source/src_pdiag/pzhtrsm.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pzhtrsm.cpp rename to ABACUS.develop/source/src_pdiag/pzhtrsm.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzhtrsm.h b/ABACUS.develop/source/src_pdiag/pzhtrsm.h similarity index 87% rename from ABACUS.develop/source/src_external/src_pdiag/pzhtrsm.h rename to ABACUS.develop/source/src_pdiag/pzhtrsm.h index b70e19ac6e..d36bb96f92 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzhtrsm.h +++ b/ABACUS.develop/source/src_pdiag/pzhtrsm.h @@ -1,7 +1,7 @@ #ifndef PZHTRSM_H #define PZHTRSM_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pzhtrsm(char isuplo,int b_n,MPI_Comm comm_2D,int NB,int N_A, diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzst2g.cpp b/ABACUS.develop/source/src_pdiag/pzst2g.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pzst2g.cpp rename to ABACUS.develop/source/src_pdiag/pzst2g.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzst2g.h b/ABACUS.develop/source/src_pdiag/pzst2g.h similarity index 86% rename from ABACUS.develop/source/src_external/src_pdiag/pzst2g.h rename to ABACUS.develop/source/src_pdiag/pzst2g.h index b870c96cf8..fe7e36206a 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzst2g.h +++ b/ABACUS.develop/source/src_pdiag/pzst2g.h @@ -1,7 +1,7 @@ #ifndef PZST2G_H #define PZST2G_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pzst2g(MPI_Comm comm_2D,int NB,int N_A,complex *A,complex *B, diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzsteiz.cpp b/ABACUS.develop/source/src_pdiag/pzsteiz.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pzsteiz.cpp rename to ABACUS.develop/source/src_pdiag/pzsteiz.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzsteiz.h b/ABACUS.develop/source/src_pdiag/pzsteiz.h similarity index 82% rename from ABACUS.develop/source/src_external/src_pdiag/pzsteiz.h rename to ABACUS.develop/source/src_pdiag/pzsteiz.h index 179adb166d..93d0f0e478 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzsteiz.h +++ b/ABACUS.develop/source/src_pdiag/pzsteiz.h @@ -1,7 +1,7 @@ #ifndef PZSTEIZ_H #define PZSTEIZ_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pzsteiz(int n,double *a,double *b,double *w,complex *Z,int m); diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzt2s.cpp b/ABACUS.develop/source/src_pdiag/pzt2s.cpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/pzt2s.cpp rename to ABACUS.develop/source/src_pdiag/pzt2s.cpp diff --git a/ABACUS.develop/source/src_external/src_pdiag/pzt2s.h b/ABACUS.develop/source/src_pdiag/pzt2s.h similarity index 87% rename from ABACUS.develop/source/src_external/src_pdiag/pzt2s.h rename to ABACUS.develop/source/src_pdiag/pzt2s.h index 32edaab7ff..e2e85111a8 100644 --- a/ABACUS.develop/source/src_external/src_pdiag/pzt2s.h +++ b/ABACUS.develop/source/src_pdiag/pzt2s.h @@ -1,7 +1,7 @@ #ifndef PZT2S_H #define PZT2S_H -#include "../../src_pw/tools.h" +#include "src_pw/tools.h" #include "pdiag_common.h" void pzt2s(MPI_Comm comm2D,int N_A,int NB,complex *A,complex *X, diff --git a/ABACUS.develop/source/src_external/src_pdiag/saveMatrix.hpp b/ABACUS.develop/source/src_pdiag/saveMatrix.hpp similarity index 100% rename from ABACUS.develop/source/src_external/src_pdiag/saveMatrix.hpp rename to ABACUS.develop/source/src_pdiag/saveMatrix.hpp diff --git a/ABACUS.develop/source/src_pw/H_Ewald_pw.cpp b/ABACUS.develop/source/src_pw/H_Ewald_pw.cpp new file mode 100644 index 0000000000..aaae168f19 --- /dev/null +++ b/ABACUS.develop/source/src_pw/H_Ewald_pw.cpp @@ -0,0 +1,359 @@ +#include "H_Ewald_pw.h" +#include "src_global/mymath.h" // use heapsort +#include "myfunc.h" // use dnrm2 + +double H_Ewald_pw::alpha=0.0; +int H_Ewald_pw::mxr = 50; +double H_Ewald_pw::ewald_energy=0.0; + +H_Ewald_pw::H_Ewald_pw(){}; +H_Ewald_pw::~H_Ewald_pw(){}; + +void H_Ewald_pw::compute_ewald(const UnitCell &cell, const PW_Basis &pwb) +{ + TITLE("H_Ewald_pw","compute_ewald"); + timer::tick("H_Ewald_pw","compute_ewald"); + +//---------------------------------------------------------- +// Calculates Ewald energy with both G- and R-space terms. +// Determines optimal alpha. Should hopefully work for any structure. +//---------------------------------------------------------- + //int ng=0; + int nr=0; + int na=0; + int nb=0; + //int nt=0; + int nrm=0; + + double ewaldg=0.0; + double ewaldr=0.0; + double ewalds=0.0; + + Vector3 dtau ; + Vector3 *r; + double *r2; + double rmax=0.0; + double rr=0.0; + double upperbound=0.0; + double fact=0; + // total ionic charge in the cell + // ewald energy computed in reciprocal space + // ewald energy computed in real space + // the difference tau_s - tau_s' + // alpha term in ewald sum + // input of the rgen routine ( not used here ) + // the square modulus of R_j-tau_s-tau_s' + // the maximum radius to consider real space sum + // buffer variable + // used to optimize alpha + + if(test_energy)OUT(ofs_running,"mxr",mxr); + r = new Vector3[mxr]; + r2 = new double[mxr]; + int* irr = new int[mxr]; + + // (1) calculate total ionic charge + double charge = 0.0; + for (int it = 0;it < cell.ntype;it++) + { + charge += cell.atoms[it].na * cell.atoms[it].zv;//mohan modify 2007-11-7 + } + if(test_energy)OUT(ofs_running,"Total ionic charge",charge); + + // (2) calculate the converged value: alpha + H_Ewald_pw::alpha = 2.90; + do + { + alpha -= 0.10; + // choose alpha in order to have convergence in the sum over G + // upperbound is a safe upper bound for the error in the sum over G + + if (alpha <= 0.0) + { + WARNING_QUIT("ewald","Can't find optimal alpha."); + } + upperbound = 2.0 * charge * charge * sqrt(2.0 * alpha / TWO_PI) * + erfc(sqrt(cell.tpiba2 * pwb.ggchg / 4.0 / alpha)); + } + while (upperbound > 1.0e-7); + if(test_energy)OUT(ofs_running,"alpha",alpha); + if(test_energy)OUT(ofs_running,"Upper bound",upperbound); + + // G-space sum here. + // Determine if this processor contains G=0 and set the constant term + if (pwb.gstart == 1) + { + ewaldg = - charge * charge / alpha / 4.0; + } + else + { + ewaldg = 0.0; + } + + // in plane wave basis, only use k=0 point is not + // called "gamma_only", only if the wave functions + // are stored as double type, the gamma_only = true. + // I don't know why "gamma_only" in plane wave + // makes the fact below is 2, that's a little complicated + // to understand. I think that may because only half + // the G vectors are used. Unfortunately implement the + // function hasn't in my plan list yet. + // + // but that's not the term "gamma_only" I want to use in LCAO, + fact = 1.0; + + //ofs_running << "\n pwb.gstart = " << pwb.gstart << endl; + + for (int ig=pwb.gstart; ig rhon = ZERO; + for (int it=0; it( cell.atoms[it].zv ) * conj( pwb.strucFac(it, ig)); + } + if(pwb.gg[ig] >= 1.0e-12) //LiuXh 20180515 + { + ewaldg += fact * abs(rhon) * abs(rhon) + * exp(- pwb.gg[ig] * cell.tpiba2 / alpha / 4.0 ) / pwb.gg[ig] / cell.tpiba2; + } + } + + ewaldg = FOUR_PI / cell.omega * ewaldg; + +// cout << "\n ewaldg = " << ewaldg; + + // Here add the other constant term + if(pwb.gstart == 1) + { + for (int it = 0; it < cell.ntype;it++) + { + ewaldg = ewaldg - cell.atoms[it].na * cell.atoms[it].zv * cell.atoms[it].zv * sqrt(8.0 / TWO_PI * alpha); + } + }//mohan modify 2007-11-7, 2010-07-26 + + // R-space sum here (only done for the processor that contains G=0) + ewaldr = 0.0; + if (pwb.gstart == 1) + { + rmax = 4.0 / sqrt(alpha) / cell.lat0; + if(test_energy)OUT(ofs_running,"rmax(unit lat0)",rmax); + // with this choice terms up to ZiZj*erfc(4) are counted (erfc(4)=2x10^-8 + int nt1=0; + int nt2=0; + + for (nt1 = 0; nt1 < cell.ntype; nt1++) + { + for (nt2 = 0; nt2 < cell.ntype; nt2++) + { + for (na = 0; na < cell.atoms[nt1].na; na++) + { + for (nb = 0; nb < cell.atoms[nt2].na; nb++) + { + //calculate tau[na]-tau[nb] + dtau = cell.atoms[nt1].tau[na] - cell.atoms[nt2].tau[nb]; + //generates nearest-neighbors shells + H_Ewald_pw::rgen(dtau, rmax, irr, cell.latvec, cell.G, r, r2, nrm); + // at-->cell.latvec, bg-->G + // and sum to the real space part + + if (test_energy>1) + { + OUT("dtau.x",dtau.x); + OUT("dtau.y",dtau.y); + OUT("dtau.z",dtau.z); + OUT("nrm",nrm); + } + for (nr = 0;nr < nrm;nr++) + { + rr = sqrt(r2 [nr]) * cell.lat0; + ewaldr = ewaldr + cell.atoms[nt1].zv * cell.atoms[nt2].zv * + erfc(sqrt(alpha) * rr) / rr; + + } // enddo + if (test_energy>1) OUT("ewaldr",ewaldr); + } // enddo + } // enddo + } // nt2 + }//nt1 + } // endif + + ewalds = 0.50 * e2 * (ewaldg + ewaldr); + + // mohan fix bug 2010-07-26 + Parallel_Reduce::reduce_double_pool( ewalds ); + + if (test_energy>1) + { + OUT("ewaldg",ewaldg); + OUT("ewaldr",ewaldr); + OUT("ewalds",ewalds); + } + + delete[] irr; + delete[] r; + delete[] r2; + + // set the Ewald energy, mohan add 2021-02-25 + H_Ewald_pw::ewald_energy = ewalds; + + timer::tick("H_Ewald_pw","compute_ewald"); + return; +} // end function ewald + + +void H_Ewald_pw::rgen( + const Vector3 &dtau, + const double &rmax, + int *irr, + const Matrix3 &latvec, + const Matrix3 &G, + Vector3 *r, + double *r2, + int &nrm) +{ + //------------------------------------------------------------------- + // generates neighbours shells (in units of alat) with length + // less than rmax,and returns them in order of increasing length. + // r=i*a1+j*a2+k*a3-dtau, + // where a1,a2,a3 are the vectors defining the lattice + + // first the dummy variables + // int nrm, mxr; + // output: the number of vectors in the spher + // input: the maximum number of vectors + + // real r (3, mxr), r2 (mxr), at (3, 3), bg (3, 3), dtau (3),rmax; + // output: coordinates of vectors R+tau_s-tau + // output: square modulus of vectors R+tau_s- + // input: direct lattice vectors + // input: reciprocal lattice vectors + // input: the vector tau_s-tau_s' + // input: the radius of the sphere in real sp + // and here the local variables + + int nm1=0; + int nm2=0; + int nm3=0; + int i=0; + int j=0; + int k=0; + // index on R vectors for order + // maximum values for trial vectors + // counters on trial vectors + // counter on polarizations + // counter on R vectors + // index of swapping + // used for swapping + + Vector3 t; + Vector3 t1; + double tt=0.0; + double bg1[3]={0,0,0}; + // buffer contains the actual r + // buffer cotains the modulus of actual r + // used for swapping + // function to find the norm of a vector + // external dnrm2, see myfunc + + nrm = 0; + + if (rmax == 0.0) + { + return; + } + + bg1[0] = G.e11; + bg1[1] = G.e12; + bg1[2] = G.e13; + + nm1 = (int)(dnrm2(3, bg1, 1) * rmax + 2); + + bg1[0] = G.e21; + bg1[1] = G.e22; + bg1[2] = G.e23; + + nm2 = (int)(dnrm2(3, bg1, 1) * rmax + 2); + + bg1[0] = G.e31; + bg1[1] = G.e32; + bg1[2] = G.e33; + + nm3 = (int)(dnrm2(3, bg1, 1) * rmax + 2); + + if (test_energy>1) + { + OUT("nm1",nm1); + OUT("nm2",nm2); + OUT("nm3",nm3); + } + + for (i = -nm1; i <= nm1; i++) // mohan fix bug, add '='. 2009-02-27 + { + for (j = -nm2; j <= nm2; j++) + { + for (k = -nm3; k <= nm3; k++) + { + Vector3 t1(i,j,k); +// out.printV3(t1); + t = t1 * latvec; // bug ! first '*latvec', second '-dtau'. + t = t - dtau; // bug ! t = t - dtau, not t1 = t1 -tau; + +// out.printV3(t); // mohan fix 2bugs here, 2009-2-27 +// out.printM3("latvec",latvec); + + tt = t.x * t.x + t.y * t.y + t.z * t.z; + + if (tt <= rmax * rmax && abs(tt) > 1.e-10) + { + if (nrm > mxr) + { + cerr << "\n rgen, too many r-vectors," << nrm; + } + r[nrm] = t; + r2[nrm] = tt; + nrm++; + } // endif + } // enddo + } // enddo + } // enddo + + // reorder the vectors in order of increasing magnitude + // initialize the index inside sorting routine + irr[0] = 0; + if (nrm > 1) + { + heapsort(nrm, r2, irr); + } + + // mohan fix bug 2011-06-07 + for(int i=0; i &dtau, + const double &rmax, + int *irr, + const Matrix3 &at, + const Matrix3 &bg, + Vector3 *r, + double *r2, + int &nrm + ); + + // the coefficient of ewald method + static double alpha; + static int mxr; + +}; + +#endif //ewald energy diff --git a/ABACUS.develop/source/src_pw/H_Hartree_pw.cpp b/ABACUS.develop/source/src_pw/H_Hartree_pw.cpp new file mode 100644 index 0000000000..84175bccf4 --- /dev/null +++ b/ABACUS.develop/source/src_pw/H_Hartree_pw.cpp @@ -0,0 +1,142 @@ +#include "H_Hartree_pw.h" + +double H_Hartree_pw::hartree_energy=0.0; + +//-------------------------------------------------------------------- +// Transform charge density to hartree potential. +//-------------------------------------------------------------------- +void H_Hartree_pw::v_hartree( + const UnitCell &cell, + PW_Basis &pwb, + const Use_FFT &ufft, + const int &nspin, + matrix &v, + double** rho) +{ + TITLE("H_Hartree_pw","v_hartree"); + timer::tick("H_Hartree_pw","v_hartree"); + + complex *Porter = ufft.porter; + + // Hartree potential VH(r) from n(r) + ZEROS( Porter, pwb.nrxx ); + int nspin0 = 1; + if(nspin==2) nspin0 = nspin; + for(int is=0; is( rho[is][ir], 0.0 ); + } + } + + //============================= + // bring rho (aux) to G space + //============================= + pwb.FFT_chg.FFT3D(Porter, -1); + + //double charge; + //if (pwb.gstart == 1) + //{ + // charge = cell.omega * Porter[pwb.ig2fftc[0]].real(); + //} + //OUT(ofs_running, "v_h charge", charge); + + //======================================================= + // calculate hartree potential in G-space (NB: V(G=0)=0 ) + //======================================================= + + double ehart = 0.0; + + complex *vh_g = new complex[pwb.ngmc]; + ZEROS(vh_g, pwb.ngmc); + + for (int ig = pwb.gstart; ig= 1.0e-12) //LiuXh 20180410 + { + const double fac = e2 * FOUR_PI / (cell.tpiba2 * pwb.gg [ig]); + + ehart += ( conj( Porter[j] ) * Porter[j] ).real() * fac; + vh_g[ig] = fac * Porter[j]; + } + } + + Parallel_Reduce::reduce_double_pool( ehart ); + ehart *= 0.5 * cell.omega; + + //cout << " ehart=" << ehart << endl; + + H_Hartree_pw::hartree_energy = ehart; + + + + ZEROS(Porter, pwb.nrxx); + + for (int ig = 0;ig < pwb.ngmc;ig++) + { + Porter[pwb.ig2fftc[ig]] = vh_g[ig]; + } + + //========================================== + //transform hartree potential to real space + //========================================== + pwb.FFT_chg.FFT3D(Porter, 1); + //========================================== + //Add hartree potential to the xc potential + //========================================== + + if(nspin==4) + { + for (int ir = 0;ir < pwb.nrxx;ir++) + { + v(0, ir) += Porter[ir].real(); + } + } + else + { + for (int is = 0;is < nspin;is++) + { + for (int ir = 0;ir < pwb.nrxx;ir++) + { + v(is, ir) += Porter[ir].real(); + } + } + } + + +//----------------------------------------------------------- +// we need to add this out_potential funciton back +// in near future, 2021-02-25 +//----------------------------------------------------------- + + //------------------------------------------- + // output the Hartree potential into a file. + //------------------------------------------- +/* + if(out_potential==-2) + { + cout << " output VH" << endl; + int is = 0; + int iter = 0; + int precision = 3; + string fn = "VH.dat"; + stringstream ss; + ss << global_out_dir << fn; + matrix v; + v.create(1,pwb.nrxx); + for(int ir=0; irwrite_potential( is, iter, ss.str(), v, precision, 1 ); + } +*/ + + timer::tick("H_Hartree_pw","v_hartree"); + + delete[] vh_g; + + return; +} // end subroutine v_h diff --git a/ABACUS.develop/source/src_pw/H_Hartree_pw.h b/ABACUS.develop/source/src_pw/H_Hartree_pw.h new file mode 100644 index 0000000000..c5e31f13a6 --- /dev/null +++ b/ABACUS.develop/source/src_pw/H_Hartree_pw.h @@ -0,0 +1,33 @@ +#ifndef H_HARTREE_PW_H +#define H_HARTREE_PW_H + +#include "tools.h" +#include "unitcell.h" +#include "pw_basis.h" +#include "use_fft.h" + +class H_Hartree_pw +{ + public: + + H_Hartree_pw(); + ~H_Hartree_pw(); + + // the Hartree energy + static double hartree_energy; + + // compute the Hartree energy + static void v_hartree( + const UnitCell &cell, + PW_Basis &pwb, + const Use_FFT &ufft, + const int &nspin, + matrix &v, + double** rho); + + private: + + +}; + +#endif //Hartree energy diff --git a/ABACUS.develop/source/src_pw/H_TDDFT_pw.cpp b/ABACUS.develop/source/src_pw/H_TDDFT_pw.cpp new file mode 100644 index 0000000000..1befe288c0 --- /dev/null +++ b/ABACUS.develop/source/src_pw/H_TDDFT_pw.cpp @@ -0,0 +1,111 @@ +#include "src_pw/potential.h" +#include "global.h" + +//========================================================== +// this function aims to add external time-dependent potential +// (eg: linear potential) used in tddft +// fuxiang add in 2017-05 +//========================================================== +void Potential::set_vrs_tddft(const int istep) +{ + TITLE("Potential","set_vrs_tddft"); + timer::tick("Potential","set_vrs_tddft"); + + for (int is = 0;is < NSPIN;is++) + { + //==================================================== + // add external linear potential, fuxiang add in 2017/05 + //==================================================== + + const int timescale = 1; // get the time that vext influences; + if (istep >= timescale) + { + for (int i = 0;i < pw.nrxx;i++) + { + this->vr_eff(is, i) = this->vltot[i] + this->vr(is, i); + } + cout << "vext = 0! " << endl; + } + else + { + this->vextold = new double[pw.nrxx]; + this->vext = new double[pw.nrxx]; + const int yz = pw.ncy*pw.nczp; + int index, i, j, k; + + for(int ir=0; irvextold[ir] = (0.019447*k/pw.ncx-0.001069585)*ucell.lat0; + else if (k>=pw.ncx*0.05 && kvextold[ir] = -0.0019447*k/pw.ncx*ucell.lat0; + else if (k>=pw.ncx*0.95) this->vextold[ir] = (0.019447*(1.0*k/pw.ncx-1)-0.001069585)*ucell.lat0; + } + else if(vext_dire == 2) + { + if (jvextold[ir] = (0.019447*j/pw.ncx-0.001069585)*ucell.lat0; + else if (j>=pw.ncx*0.05 && jvextold[ir] = -0.0019447*j/pw.ncx*ucell.lat0; + else if (j>=pw.ncx*0.95) this->vextold[ir] = (0.019447*(1.0*j/pw.ncx-1)-0.001069585)*ucell.lat0; + } + else if(vext_dire == 3) + { + if (ivextold[ir] = (0.019447*i/pw.ncx-0.001069585)*ucell.lat0; + else if (i>=pw.ncx*0.05 && ivextold[ir] = -0.0019447*i/pw.ncx*ucell.lat0; + else if (i>=pw.ncx*0.95) this->vextold[ir] = (0.019447*(1.0*i/pw.ncx-1)-0.001069585)*ucell.lat0; + } + + // Gauss +/* + const double w = 22.13; // eV + const double sigmasquare = 6836; + const double timecenter = 700; + const double timenow = (istep-timecenter)*INPUT.md_dt*41.34; + this->vext[ir] = this->vextold[ir]*cos(w/27.2116*timenow)*exp(-timenow*timenow*0.5/(sigmasquare))*0.25; //0.1 is modified in 2018/1/12 +*/ + + //HHG of H atom +/* + if(istep < 1875) + { + this->vext[ir] = this->vextold[ir]*2.74*istep/1875*cos(0.0588*istep*INPUT.md_dt*41.34); // 2.75 is equal to E0; + } + else if(istep < 5625) + { + this->vext[ir] = this->vextold[ir]*2.74*cos(0.0588*istep*INPUT.md_dt*41.34); + } + else if(istep < 7500) + { + this->vext[ir] = this->vextold[ir]*2.74*(7500-istep)/1875*cos(0.0588*istep*INPUT.md_dt*41.34); + } +*/ + + //HHG of H2 + + //const double timenow = (istep)*INPUT.md_dt*41.34; + //this->vext[ir] = this->vextold[ir]*2.74*cos(0.856*timenow)*sin(0.0214*timenow)*sin(0.0214*timenow); + //this->vext[ir] = this->vextold[ir]*2.74*cos(0.856*timenow)*sin(0.0214*timenow)*sin(0.0214*timenow)*0.01944; + //this->vext[ir] = this->vextold[ir]*2.74*cos(0.0428*timenow)*sin(0.00107*timenow)*sin(0.00107*timenow); + + this->vr_eff(is,ir) = this->vltot[ir] + this->vr(is, ir) + this->vext[ir]; + + //cout << "x: " << k <<" " << "y: " << j <<" "<< "z: "<< i <<" "<< "ir: " << ir << endl; + //cout << "vext: " << this->vext[ir] << endl; + //cout << "vrs: " << vrs(is,ir) <vextold; + delete[] this->vext; + } + } + + + timer::tick("potential","set_vrs_tddft"); + return; +} //end subroutine set_vrs_tddft diff --git a/ABACUS.develop/source/src_pw/H_XC_pw.cpp b/ABACUS.develop/source/src_pw/H_XC_pw.cpp new file mode 100644 index 0000000000..04a06ce90f --- /dev/null +++ b/ABACUS.develop/source/src_pw/H_XC_pw.cpp @@ -0,0 +1,165 @@ +#include "H_XC_pw.h" +#include "xc_functional.h" +#include "xc_gga_pw.h" + +double H_XC_pw::etxc; +double H_XC_pw::vtxc; + +void H_XC_pw::v_xc +( + const int &nrxx, // number of real-space grid + const int &ncxyz, // total number of charge grid + const double &omega, // volume of cell + double **rho_in, + double *rho_core, // core charge density + matrix &v) +{ + TITLE("H_XC_pw","v_xc"); + timer::tick("H_XC_pw","v_xc"); + + //Exchange-Correlation potential Vxc(r) from n(r) + etxc = 0.0; + vtxc = 0.0; + + // the square of the e charge + // in Rydeberg unit, so * 2.0. + double e2 = 2.0; + + double rhox = 0.0; + double arhox = 0.0; + double zeta = 0.0; + double ex = 0.0; + double ec = 0.0; + double vx[2]; + double vc[2]; + + int ir, is; + int neg [3]; + + double vanishing_charge = 1.0e-10; + + if (NSPIN == 1 || ( NSPIN ==4 && !DOMAG && !DOMAG_Z)) + { + // spin-unpolarized case + for (int ir = 0;ir < nrxx;ir++) + { + // total electron charge density + rhox = rho_in[0][ir] + rho_core[ir]; + arhox = abs(rhox); + if (arhox > vanishing_charge) + { + XC_Functional::xc(arhox, ex, ec, vx[0], vc[0]); + v(0,ir) = e2 * (vx[0] + vc[0]); + // consider the total charge density + etxc += e2 * (ex + ec) * rhox; + // only consider rho_in + vtxc += v(0, ir) * rho_in[0][ir]; + } // endif + } //enddo + } + else if(NSPIN ==2) + { + // spin-polarized case + neg [0] = 0; + neg [1] = 0; + neg [2] = 0; + + for (ir = 0;ir < nrxx;ir++) + { + rhox = rho_in[0][ir] + rho_in[1][ir] + rho_core[ir]; //HLX(05-29-06): bug fixed + arhox = abs(rhox); + + if (arhox > vanishing_charge) + { + zeta = (rho_in[0][ir] - rho_in[1][ir]) / arhox; //HLX(05-29-06): bug fixed + + if (abs(zeta) > 1.0) + { + ++neg[2]; + zeta = (zeta > 0.0) ? 1.0 : (-1.0); + } + + if (rho_in[0][ir] < 0.0) + { + ++neg[0]; + } + + if (rho_in[1][ir] < 0.0) + { + ++neg[1]; + } + + // call + XC_Functional::xc_spin(arhox, zeta, ex, ec, vx[0], vx[1], vc[0], vc[1]); + + for (is = 0;is < NSPIN;is++) + { + v(is, ir) = e2 * (vx[is] + vc[is]); + } + + etxc += e2 * (ex + ec) * rhox; + + vtxc += v(0, ir) * rho_in[0][ir] + v(1, ir) * rho_in[1][ir]; + } + } + + } + else if(NSPIN == 4)//noncollinear case added by zhengdy + { + for( ir = 0;ir vanishing_charge ) + { + zeta = amag / arhox; + + if ( abs( zeta ) > 1.0 ) + { + neg[1] += 1.0 / omega; + + zeta = (zeta > 0.0) ? 1.0 : (-1.0); + }//end if + + XC_Functional::xc_spin( arhox, zeta, ex, ec, vx[0], vx[1], vc[0], vc[1] ); + + etxc += e2 * ( ex + ec ) * rhox; + + v(0, ir) = e2*( 0.5 * ( vx[0] + vc[0] + vx[1] + vc[1] ) ); + vtxc += v(0,ir) * rho_in[0][ir]; + + double vs = 0.5 * ( vx[0] + vc[0] - vx[1] - vc[1] ); + if ( amag > vanishing_charge ) + { + for(int ipol = 1;ipol< 4;ipol++) + { + v(ipol, ir) = e2 * vs * rho_in[ipol][ir] / amag; + vtxc += v(ipol,ir) * rho_in[ipol][ir]; + }//end do + }//end if + }//end if + }//end do + }//end if + // energy terms, local-density contributions + + // add gradient corrections (if any) + // mohan modify 2009-12-15 + GGA_PW::gradcorr(etxc, vtxc, v); + + // parallel code : collect vtxc,etxc + // mohan add 2008-06-01 + Parallel_Reduce::reduce_double_pool( etxc ); + Parallel_Reduce::reduce_double_pool( vtxc ); + + etxc *= omega / ncxyz; + vtxc *= omega / ncxyz; + + timer::tick("H_XC_pw","v_xc"); + return; +} diff --git a/ABACUS.develop/source/src_pw/H_XC_pw.h b/ABACUS.develop/source/src_pw/H_XC_pw.h new file mode 100644 index 0000000000..a8f6dc0d00 --- /dev/null +++ b/ABACUS.develop/source/src_pw/H_XC_pw.h @@ -0,0 +1,38 @@ +#ifndef H_XC_PW_H +#define H_XC_PW_H + +#include "tools.h" + +class H_XC_pw +{ + public: + + friend class Stress_Func; + friend class Stress_PW; + friend class Forces; + friend class Force_Stress_LCAO; + friend class Potential; + friend class energy; + friend class eximport; + + H_XC_pw(); + ~H_XC_pw(); + + private: + + // the Hartree energy + static double etxc; + static double vtxc; + + // compute the exchange-correlation energy + static void v_xc( + const int &nrxx, // number of real-space grid + const int &ncxyz, // total number of charge grid + const double &omega, // volume of cell + double** rho_in, + double *rho_core, // core charge density + matrix &v); + +}; + +#endif //Exchange-correlation energy diff --git a/ABACUS.develop/source/src_pw/MD_func.cpp b/ABACUS.develop/source/src_pw/MD_func.cpp new file mode 100644 index 0000000000..9905f14eed --- /dev/null +++ b/ABACUS.develop/source/src_pw/MD_func.cpp @@ -0,0 +1,612 @@ +#include "MD_func.h" + + + +void MD_func::initMD(){ + //parameter from input file + mdtype=INPUT.md_mdtype; + Qmass=INPUT.md_qmass/6.02/9.109*1e5; + dt=INPUT.md_dt/fundamentalTime/1e15; + temperature=INPUT.md_tfirst/3.1577464e5; + rstMD=INPUT.md_rstmd; + dumpmdfreq=INPUT.md_dumpmdfred; + fixTemperature=INPUT.md_fixtemperature; + ediff=INPUT.md_ediff; + ediffg=INPUT.md_ediffg; + mdoutputpath=INPUT.md_mdoutpath; + NVT_control = INPUT.md_nvtcontrol; + NVT_tau = INPUT.md_nvttau; + MNHC = INPUT.md_mnhc; + + + //other parameter default + outputstressperiod = 1 ;// The period to output stress + numIon=ucell.nat; + ntype=ucell.ntype; + step_rst=0; + ionlatvec=ucell.latvec; + + mdenergy=en.etot/2; + + //allocate for MD + this->md_allocate(); + + //MD starting setup + if(rstMD==0){ + connection0(); + connection1(); + //A fresh new MD: Do not restart MD + InitVelocity() ; + // Initialize thermostat, and barostat + + } + else if ( rstMD>0 ){ + connection0(); + connection1(); + InitVelocity() ; + if(!RestartMD()){ + cout<<"error in restart MD!"<=1;j--){ + for(int k=0;k>xLogS; + file.get(); + file.ignore(7, '\n'); + // file>>vLogS; + file.get(); + file.ignore(23, '\n'); + for(i = 0;i>vell[i]; + } + /*file.get(); file.ignore(17, '\n'); + for(i=0;i>cart[i]; + } + file.get(); file.ignore(13, '\n'); + for(i=0;i>dira[i]; + }*/ + file.get(); + file.ignore(6, '\n'); + file>>step_rst; + file.close(); + } +//2015-09-05, xiaohui +#ifdef __MPI + MPI_Bcast(&step_rst,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(vell,numIon*3,MPI_DOUBLE,0,MPI_COMM_WORLD); +#endif + for(i=0;i echo_md_restart.dat, for debug purpose. "< 1&& step%dumpmdfreq==0 ) ) + pass =1; + if (!pass) return; + + if(!MY_RANK){ + stringstream ssc; + ssc << global_out_dir << "Restart_md.dat"; + ofstream file(ssc.str().c_str()); + file<<"MD_RESTART"< 0 ) + { + + // Change the temperature every 'fixTemperature' steps. + if( (step!=1)&&(step%fixTemperature == 1) ) + { + + // Read in new temperature from file. + ifstream file; + file.open("ChangeTemp.dat"); + if (!file){ + cout<<"ERROR IN OPENING ChangeTemp.dat, CODE STOP!"<> intemp; + sstep+=fixTemperature; + } + file.close(); + + // Renew information. + intemp = intemp * K_BOLTZMAN_AU; + if ( fabs(intemp-temperature) >1e-6 ) { + cout <<"(ReadNewTemp): Read in new temp:"<< intemp/K_BOLTZMAN_AU + <<" previous temp:"<< temperature/K_BOLTZMAN_AU<9999999999) return "error!"; + for(int j=9; j>-1; j--) + { + if(iter==0) continue; + if(iter>pow(10,j)-1) + { + i[k] = iter%10; + iter /= 10; + k++; + } + } + for(int j=k-1;j>-1;j--){ + path+=(i[j]+48); + } + return path; +} + +void MD_func::connection0(){ +//some prepared information +//mass and degree of freedom + int ion=0; + nfrozen=0; + for(int it=0;it=1.0) taudirac[ia].x -= 1.0; + if(taudirac[ia].y>=1.0) taudirac[ia].y -= 1.0; + if(taudirac[ia].z>=1.0) taudirac[ia].z -= 1.0; + + if(taudirac[ia].x<0 || taudirac[ia].y<0 + || taudirac[ia].z<0 || + taudirac[ia].x>=1.0 || + taudirac[ia].y>=1.0 || + taudirac[ia].z>=1.0) + { + cout << " ion: "<< ia << endl; + cout << "d=" << taudirac[ia].x << " " << + taudirac[ia].y << " " << taudirac[ia].z << endl; + WARNING_QUIT("md::moveatoms","the movement of atom is larger than the length of cell."); + } + + cartNoWrap[ia] = taudirac[ia] * ionlatvec*ucell.lat0; + } + return; +} + +void MD_func::printpos(string file,int iter) +{ +//intend to output the positions of atoms to ordered file + bool pass; + pass = 0; + + if (dumpmdfreq==1||iter==1||( dumpmdfreq > 1&& iter%dumpmdfreq==0 ) ) + pass =1; + if (!pass) return; + + string file1=file+".xyz"; + string file2=file+".cif"; + + //xiaohui add 'OUT_LEVEL', 2015-09-16 + if(OUT_LEVEL == "i"||OUT_LEVEL == "ie") ucell.print_tau(); + if(OUT_LEVEL == "i"||OUT_LEVEL == "ie") ucell.print_cell_xyz(file1); + ucell.print_cell_cif(file2); + stringstream ss; + + ss << global_out_dir << "STRU_MD"; + + //zhengdy modify 2015-05-06, outputfile "STRU_Restart" + ucell.print_stru_file(ss.str(),2); + + return; +} + +//rescale velocities to target temperature. +void MD_func::scalevel() +{ + double ke=GetAtomKE(); + if(ke>1e-9) + for(int i=0;i fracStep; + for(int ii=0;iimaxStep) + { + maxStep = pow(vel[ii].x,2)+pow(vel[ii].y,2)+pow(vel[ii].z,2); + } + Mathzone::Cartesian_to_Direct(vel[ii].x*dt/ucell.lat0,vel[ii].y*dt/ucell.lat0,vel[ii].z*dt/ucell.lat0, + ionlatvec.e11,ionlatvec.e12,ionlatvec.e13, + ionlatvec.e21,ionlatvec.e22,ionlatvec.e23, + ionlatvec.e31,ionlatvec.e32,ionlatvec.e33, + fracStep.x,fracStep.y,fracStep.z); + + taudirac[ii] = taudirac[ii] + fracStep; + } + + //save the atom position change to DFT module + moveatoms(step); + string t("md_pos_"); + t=intTurnTostring(step,t); + connection2(); + printpos(t,step); + maxStep = sqrt(maxStep)*dt; + + if (!MY_RANK){ + out<maxStep) + { + maxStep = pow(vel[i].x,2.0)+pow(vel[i].y,2.0)+pow(vel[i].z,2.0); + } + Mathzone::Cartesian_to_Direct(vel[i].x*dt/ucell.lat0,vel[i].y*dt/ucell.lat0,vel[i].z*dt/ucell.lat0, + ionlatvec.e11,ionlatvec.e12,ionlatvec.e13, + ionlatvec.e21,ionlatvec.e22,ionlatvec.e23, + ionlatvec.e31,ionlatvec.e32,ionlatvec.e33, + fracStep.x,fracStep.y,fracStep.z); + taudirac[i] = taudirac[i] + fracStep; + } + moveatoms(step); + string t("md_pos_"); + t=intTurnTostring(step,t); + connection2(); + printpos(t,step); + maxStep = sqrt(maxStep)*dt; + + + // calculate the conserved quantity during MD + hamiltonian = Conserved(twiceKE/2, mdenergy); + + cout<< setprecision (9)<maxStep) + { + maxStep = pow(vel[i].x,2.0)+pow(vel[i].y,2.0)+pow(vel[i].z,2.0); + } + Mathzone::Cartesian_to_Direct(vel[i].x*dt/ucell.lat0,vel[i].y*dt/ucell.lat0,vel[i].z*dt/ucell.lat0, + ionlatvec.e11,ionlatvec.e12,ionlatvec.e13, + ionlatvec.e21,ionlatvec.e22,ionlatvec.e23, + ionlatvec.e31,ionlatvec.e32,ionlatvec.e33, + fracStep.x,fracStep.y,fracStep.z); + taudirac[i] = taudirac[i] + fracStep; + } + + moveatoms(step); + string t("md_pos_"); + t=intTurnTostring(step,t); + connection2(); + printpos(t,step); + maxStep = sqrt(maxStep)*dt; + + hamiltonian = Conserved(twiceKE/2, mdenergy); + + + + + // Output the message to the screen. + oldEtot=mdenergy; + + cout<<"(NVE): this step finished."<MNHC = MNHC_in; + unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4; + init_by_array(init, length); + ofs<<" ...............Nose-Hoover Chain parameter initialization............... " << endl; + ofs<<" Temperature = "<< temperature << endl; + ofs<<" Temperature2 = "<< temperature/K_BOLTZMAN_AU << endl; + ofs<<" NHC frequency = "<< 1.0/NVT_tau << endl; + ofs<<" NHC chain = "<< MNHC << endl; + ofs<<" Qmass = "<< Qmass << endl; + ofs<<" ............................................................... " << endl; + w[0]=0.7845136105; + w[6]=0.7845136105; + w[1]=0.2355732134; + w[5]=0.2355732134; + w[2]=-1.177679984; + w[4]=-1.177679984; + w[3]=1-w[0]-w[1]-w[2]-w[4]-w[5]-w[6]; + // + for(int i=0;i[MNHC*numIon]; + delete[] NHCeta; + NHCeta=new Vector3[MNHC*numIon]; + delete[] NHCpeta; + NHCpeta=new Vector3[MNHC*numIon]; + + for(int j=0;j=1;j--) + { + for(int k=0;k=0;j--) + { + for(int k=0;k=0;j--) + { + for(int k=0;k *G; //parameter in NHC + Vector3 *NHCeta; //NHC position + Vector3 *NHCpeta; //NHC momentum + +}; \ No newline at end of file diff --git a/ABACUS.develop/source/src_pw/algorithms.h b/ABACUS.develop/source/src_pw/algorithms.h deleted file mode 100644 index b11cd0c04b..0000000000 --- a/ABACUS.develop/source/src_pw/algorithms.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef ALGORITHMS_H -#define ALGORITHMS_H - -#include "diago_cg.h" -#include "diago_david.h" -#include "../src_ions/ions_move_bfgs.h" - -#include "../src_pw/dos.h" - -#include "../src_pw/myfunc.h" -#include "numerical_basis.h" -#include "bessel_basis.h" -//#include "../src_algorithms/spillage.h" -//#include "../src_algorithms/mymath.h" - -#ifdef __FP -#endif - -#endif diff --git a/ABACUS.develop/source/src_pw/atom_spec.cpp b/ABACUS.develop/source/src_pw/atom_spec.cpp index 9b3886f584..8d2f9e2036 100644 --- a/ABACUS.develop/source/src_pw/atom_spec.cpp +++ b/ABACUS.develop/source/src_pw/atom_spec.cpp @@ -150,22 +150,14 @@ void Atom::bcast_atom() Parallel_Common::bcast_double( mag[i] ); } -#ifdef __EPM - bcast_atom_epm( na ); -#else bcast_atom_pseudo( na ); -#endif return; } void Atom::bcast_atom2() { -#ifdef __EPM - -#else bcast_atom_pseudo2(); -#endif } #endif diff --git a/ABACUS.develop/source/src_pw/atom_spec.h b/ABACUS.develop/source/src_pw/atom_spec.h index 6edc765c22..d5a3144fb5 100644 --- a/ABACUS.develop/source/src_pw/atom_spec.h +++ b/ABACUS.develop/source/src_pw/atom_spec.h @@ -2,14 +2,8 @@ #define ATOM_H #include "tools.h" - -#ifdef __EPM -#include "../src_epm/atom_epm.h" -class Atom: public Atom_epm -#else #include "atom_pseudo.h" class Atom: public Atom_pseudo -#endif { public: diff --git a/ABACUS.develop/source/src_pw/cal_test0.cpp b/ABACUS.develop/source/src_pw/cal_test0.cpp deleted file mode 100644 index 9899f2497f..0000000000 --- a/ABACUS.develop/source/src_pw/cal_test0.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "global.h" -#include "tools.h" -#include "cal_test0.h" -#include "../src_lcao/sltk_atom_arrange.h" -//xiaohui modified 2013-03-23, adding "//" before #include... -//#include "../src_develop/src_siao/trace_rho_hs.h" - -int Cal_Test::Hnnz=0; - -void Cal_Test::adjacent_atoms(void) -{ - TITLE("Cal_Test","adjacent_atoms"); - - // (1) Find adjacent atoms for each atom. - atom_arrange::set_sr_NL(); - atom_arrange::search( SEARCH_RADIUS ); - - return; -} -// xiaohui modified 2013-03-23 -/* -void Cal_Test::sparsity(void) -{ - TITLE("Cal_Test","sparsity"); - - Trace_Rho_HS TRHS; - // nonzero need to be update later. - bool** nonzero = new bool*[NLOCAL]; - for(int col=0; colnspin = nspin_in; + this->nrxx = nrxx_in; + this->ngmc = ngmc_in; + if (test_charge > 1) { - cout << "\n spin_number = " << NSPIN - << " real_point_number = " << pw.nrxx; + cout << "\n spin_number = " << nspin + << " real_point_number = " << nrxx; } // allocate memory - rho = new double*[NSPIN]; - rhog = new complex*[NSPIN]; - rho_save = new double*[NSPIN]; - rhog_save = new complex*[NSPIN]; + rho = new double*[nspin]; + rhog = new complex*[nspin]; + rho_save = new double*[nspin]; + rhog_save = new complex*[nspin]; - for(int is=0; is[pw.ngmc]; - rho_save[is] = new double[pw.nrxx]; - rhog_save[is] = new complex[pw.ngmc]; - ZEROS(rho[is], pw.nrxx); - ZEROS(rhog[is], pw.ngmc); - ZEROS(rho_save[is], pw.nrxx); - ZEROS(rhog_save[is], pw.ngmc); + rho[is] = new double[nrxx]; + rhog[is] = new complex[ngmc]; + rho_save[is] = new double[nrxx]; + rhog_save[is] = new complex[ngmc]; + ZEROS(rho[is], nrxx); + ZEROS(rhog[is], ngmc); + ZEROS(rho_save[is], nrxx); + ZEROS(rhog_save[is], ngmc); } - Memory::record("Charge","rho",NSPIN*pw.nrxx,"double"); - Memory::record("Charge","rho_save",NSPIN*pw.nrxx,"double"); - Memory::record("Charge","rhog",NSPIN*pw.ngmc,"double"); - Memory::record("Charge","rhog_save",NSPIN*pw.ngmc,"double"); + Memory::record("Charge","rho",nspin*nrxx,"double"); + Memory::record("Charge","rho_save",nspin*nrxx,"double"); + Memory::record("Charge","rhog",nspin*ngmc,"double"); + Memory::record("Charge","rhog_save",nspin*ngmc,"double"); - this->rho_core = new double[pw.nrxx]; // core charge in real space - ZEROS( rho_core, pw.nrxx); + this->rho_core = new double[nrxx]; // core charge in real space + ZEROS( rho_core, nrxx); - this->rhog_core = new complex[pw.ngmc]; // reciprocal core charge - ZEROS( rhog_core, pw.ngmc); + this->rhog_core = new complex[ngmc]; // reciprocal core charge + ZEROS( rhog_core, ngmc); - Memory::record("Charge","rho_core",pw.nrxx,"double"); - Memory::record("Charge","rhog_core",pw.ngmc,"double"); + Memory::record("Charge","rho_core",nrxx,"double"); + Memory::record("Charge","rhog_core",ngmc,"double"); this->allocate_rho = true; return; } + double Charge::sum_rho(void) const { + TITLE("Charge","sum_rho"); + double sum_rho = 0.0; int nspin0 = 1; - if(NSPIN==2) nspin0 = NSPIN; + if(nspin==2) + { + nspin0 = 2; + } + for(int is=0; isrho[is][ir]; } } - // Here multiply the sum of charge density by a factor + // multiply the sum of charge density by a factor sum_rho *= ucell.omega / static_cast( pw.ncxyz ); Parallel_Reduce::reduce_double_pool( sum_rho ); @@ -125,6 +135,7 @@ double Charge::sum_rho(void) const ofs_warning << " sum_rho=" << sum_rho << endl; WARNING_QUIT("Charge::renormalize_rho","Can't find even an electron!"); } + return sum_rho; } @@ -138,9 +149,9 @@ void Charge::renormalize_rho(void) OUT(ofs_warning,"charge before normalized",sr); const double normalize_factor = ucell.nelec / sr; - for(int is=0; is0); double *rho1d = new double[ucell.meshx]; @@ -190,7 +198,11 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const } } } - if(NSPIN==4) startmag_type = 1;//zhengdy-soc, type 2 is still wrong. + + if(NSPIN==4) + { + startmag_type = 1;//zhengdy-soc, type 2 is still wrong. + } OUT(ofs_warning,"startmag_type",startmag_type); @@ -198,12 +210,9 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const { Atom* atom = &ucell.atoms[it]; - if (test_charge>0) cout<<" To get charge in G for atom type : " << it <msh; - - //---------------------------------------------------------- // Here we check the electron number //---------------------------------------------------------- @@ -213,9 +222,9 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const double r2=atom->r[ir]*atom->r[ir]; rhoatm[ir]=atom->rho_at[ir]/FOUR_PI/r2; } - rhoatm[0] = pow( (rhoatm[2]/rhoatm[1]), 1./(atom->r[2]-atom->r[1]) );//{zws add + rhoatm[0] = pow( (rhoatm[2]/rhoatm[1]), 1./(atom->r[2]-atom->r[1]) );//zws add rhoatm[0] = pow(rhoatm[0], atom->r[1]); - rhoatm[0] = rhoatm[1] / rhoatm[0]; //} + rhoatm[0] = rhoatm[1] / rhoatm[0]; double charge = 0.0; Mathzone::Simpson_Integral(atom->msh,atom->rho_at,atom->rab,charge); @@ -223,6 +232,7 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const OUT(ofs_warning,"charge from rho_at",charge); assert(charge!=0.0); double scale=1.0; + if(charge!=atom->zv) { OUT(ofs_warning,"charge should be",atom->zv); @@ -238,12 +248,11 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const //---------------------------------------------------------- // Here we compute the G=0 term //---------------------------------------------------------- - if (pw.gstart == 1) { for (int ir = 0;ir < mesh;ir++) { -// rho1d [ir] = atom->rho_at[ir]; +// rho1d [ir] = atom->rho_at[ir]; rho1d[ir] = rhoatm[ir]; } Mathzone::Simpson_Integral(mesh, rho1d, atom->rab , rho_lgl[0]); @@ -276,19 +285,9 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const } Mathzone::Simpson_Integral(mesh , rho1d, atom->rab , rho_lgl [ig]); } - - delete[] rhoatm; - - - - - - - - if (test_charge>0) cout<<" |G|>0 term done." < swap = pw.strucFac(it, ig)* rho_lgl[pw.ig2ngg[ig]]; //rho_g3d(0, ig) += swap * mag.nelup_percent(it); //rho_g3d(1, ig) += swap * mag.neldw_percent(it); - const double up = 0.5 * ( 1 + mag.start_magnetization[it] / atom->zv ); - const double dw = 0.5 * ( 1 - mag.start_magnetization[it] / atom->zv ); - rho_g3d(0, ig) += swap * up; - rho_g3d(1, ig) += swap * dw; + const double up = 0.5 * ( 1 + mag.start_magnetization[it] / atom->zv ); + const double dw = 0.5 * ( 1 - mag.start_magnetization[it] / atom->zv ); + rho_g3d(0, ig) += swap * up; + rho_g3d(1, ig) += swap * dw; } } // mohan add 2011-06-14 @@ -364,12 +362,12 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const rho_g3d(0, ig) += swap ; if(DOMAG) { - //rho_g3d(1, ig) += swap * mag.start_magnetization[it] * sin(soc.angle1[it]) * cos(soc.angle2[it]); - //rho_g3d(2, ig) += swap * mag.start_magnetization[it] * sin(soc.angle1[it]) * sin(soc.angle2[it]); - //rho_g3d(3, ig) += swap * mag.start_magnetization[it] * cos(soc.angle1[it]); - rho_g3d(1, ig) += swap * (mag.start_magnetization[it] / atom->zv) * sin(soc.angle1[it]) * cos(soc.angle2[it]); - rho_g3d(2, ig) += swap * (mag.start_magnetization[it] / atom->zv) * sin(soc.angle1[it]) * sin(soc.angle2[it]); - rho_g3d(3, ig) += swap * (mag.start_magnetization[it] / atom->zv) * cos(soc.angle1[it]); + rho_g3d(1, ig) += swap * (mag.start_magnetization[it] / atom->zv) + * sin(soc.angle1[it]) * cos(soc.angle2[it]); + rho_g3d(2, ig) += swap * (mag.start_magnetization[it] / atom->zv) + * sin(soc.angle1[it]) * sin(soc.angle2[it]); + rho_g3d(3, ig) += swap * (mag.start_magnetization[it] / atom->zv) + * cos(soc.angle1[it]); } else if(DOMAG_Z) { @@ -396,16 +394,15 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const rho_g3d(0, ig) += swap; if(DOMAG) { - //rho_g3d(1, ig) += swap * atom->mag[ia] * sin(soc.angle1[it]) * cos(soc.angle2[it]); - //rho_g3d(2, ig) += swap * atom->mag[ia] * sin(soc.angle1[it]) * sin(soc.angle2[it]); - //rho_g3d(3, ig) += swap * atom->mag[ia] * cos(soc.angle1[it]); - rho_g3d(1, ig) += swap * (atom->mag[ia] / atom->zv) * sin(soc.angle1[it]) * cos(soc.angle2[it]); - rho_g3d(2, ig) += swap * (atom->mag[ia] / atom->zv) * sin(soc.angle1[it]) * sin(soc.angle2[it]); - rho_g3d(3, ig) += swap * (atom->mag[ia] / atom->zv) * cos(soc.angle1[it]); + rho_g3d(1, ig) += swap * (atom->mag[ia] / atom->zv) + * sin(soc.angle1[it]) * cos(soc.angle2[it]); + rho_g3d(2, ig) += swap * (atom->mag[ia] / atom->zv) + * sin(soc.angle1[it]) * sin(soc.angle2[it]); + rho_g3d(3, ig) += swap * (atom->mag[ia] / atom->zv) + * cos(soc.angle1[it]); } else if(DOMAG_Z) { - //rho_g3d(3, ig) += swap * atom->mag[ia]; rho_g3d(3, ig) += swap * (atom->mag[ia] / atom->zv); } } @@ -421,7 +418,6 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const delete [] rho_lgl; delete [] rho1d;; - if (test_charge>0) cout<<"\n Charge in G space is done."< 0 ); double* ne = new double[spin_number_need]; @@ -498,8 +494,6 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const } } - - // if TWO_EFEMI, // the total magnetism will affect the calculation of // occupations. @@ -513,11 +507,9 @@ void Charge::atomic_rho(const int spin_number_need, double** rho_in)const return; } + //========================================================== -// MEMBER FUNCTION : -// set_rhoc : computes the core charge on the real space -// 3D mesh. -// from set_rhoc.f90 +// computes the core charge on the real space 3D mesh. //========================================================== void Charge::set_rho_core( const ComplexMatrix &structure_factor @@ -525,6 +517,7 @@ void Charge::set_rho_core( { TITLE("Charge","set_rho_core"); timer::tick("Charge","set_rho_core"); + //double eps = 1.e-10; en.etxcc = 0.0; //---------------------------------------------------------- @@ -540,10 +533,6 @@ void Charge::set_rho_core( bool bl = false; for (int it = 0; it> name; - - // check lattice constant, unit is Angstrom - CHECK_DOUBLE(ifs,ucell.lat0 * 0.529177,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e11,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e12,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e13,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e21,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e22,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e23,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e31,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e32,quit); - CHECK_DOUBLE(ifs,ucell.latvec.e33,quit); - - for(int it=0; it> coordinate; - - for(int it=0; it> rho[is][i*pw.ncy*pw.ncz + j*pw.ncz +k]; - } - } - } -#else - - const int nxy = pw.ncx * pw.ncy; - double *zpiece = new double[nxy]; - for(int iz=0; izallocate_rho_final_scf = true; return; } - -//fuxiang add 2017-03-15 -void Charge::write_rho_dipole(const int &is, const int &iter, const string &fn, const int &precision, const bool for_plot) -{ - TITLE("Charge","write_rho_dipole"); - if (out_charge==0) - { - return; - } - else if(iter % out_charge != 0) - { - return; // mohan add 2010-05-22 - } - - time_t start, end; - ofstream ofs; - - if(MY_RANK==0) - { - start = time(NULL); - - ofs.open(fn.c_str()); - if (!ofs) - { - WARNING("Charge::write_rho","Can't create Charge File!"); - } - - //ofs_running << "\n Output charge file." << endl; - - ofs << ucell.latName << endl;//1 - ofs << " " << ucell.lat0 * 0.529177 << endl; - ofs << " " << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; - ofs << " " << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; - ofs << " " << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; - for(int it=0; it( pw.ncxyz ); - dipole_elec_y *= ucell.omega / static_cast( pw.ncxyz ); - dipole_elec_z *= ucell.omega / static_cast( pw.ncxyz ); - Parallel_Reduce::reduce_double_pool( dipole_elec_x ); - Parallel_Reduce::reduce_double_pool( dipole_elec_y ); - Parallel_Reduce::reduce_double_pool( dipole_elec_z ); - - //cout << "dipole_elec_x: " << dipole_elec_x <** rhog_save; double *rho_core; - complex *rhog_core; // mohan add 2009-12-15 + complex *rhog_core; - int out_charge; // output charge if out_charge > 0, and output every "out_charge" elec step. + // output charge if out_charge > 0, and output every "out_charge" elec step. + int out_charge; double *start_mag_type; double *start_mag_atom; - void init(); + // mohan update 2021-02-20 + void allocate(const int &nspin_in, const int &nrxx_in, const int &ngmc_in); + void atomic_rho(const int spin_number_need, double **rho_in)const; + void set_rho_core(const ComplexMatrix &structure_factor); - void write_rho(const int &is, const int &iter, const string &fn, const int &precision = 11, const bool for_plot = false);//mohan add 2007-10-17 - void write_rho_dipole(const int &is, const int &iter, const string &fn, const int &precision = 11, const bool for_plot = false);//fuxiang add 2017-3-15 - bool read_rho(const int &is, const string &fn);//mohan add 2007-10-17 + void sum_band(void); + void renormalize_rho(void); + void save_rho_before_sum_band(void); - void non_linear_core_correction// drhoc + + // for non-linear core correction + void non_linear_core_correction ( const bool &numeric, const int mesh, @@ -65,14 +68,33 @@ class Charge void init_final_scf(); //LiuXh add 20180619 -private: + public: + + void write_rho(const double* rho_save, const int &is, const int &iter, const string &fn, + const int &precision = 11, const bool for_plot = false);//mohan add 2007-10-17 + + void write_rho_dipole(const double* rho_save, const int &is, const int &iter, const string &fn, + const int &precision = 11, const bool for_plot = false);//fuxiang add 2017-3-15 + + bool read_rho(const int &is, const string &fn, double* rho);//mohan add 2007-10-17 + + + private: + + // mohan add 2021-02-20 + int nrxx; // number of r vectors in this processor + int ngmc; // number of g vectors in this processor + int nspin; // number of spins void sum_band_k(); + void rho_mpi(void); + double sum_rho(void) const; bool allocate_rho; -bool allocate_rho_final_scf; //LiuXh add 20180606 + + bool allocate_rho_final_scf; //LiuXh add 20180606 }; diff --git a/ABACUS.develop/source/src_pw/charge_broyden.cpp b/ABACUS.develop/source/src_pw/charge_broyden.cpp index 7d95fa1999..04db391a62 100644 --- a/ABACUS.develop/source/src_pw/charge_broyden.cpp +++ b/ABACUS.develop/source/src_pw/charge_broyden.cpp @@ -1,11 +1,12 @@ #include "charge_broyden.h" #include "global.h" -#include "../src_pw/inverse_matrix.h" +#include "../src_global/inverse_matrix.h" Charge_Broyden::Charge_Broyden() { initb = false; } + Charge_Broyden::~Charge_Broyden() { if (initb) diff --git a/ABACUS.develop/source/src_pw/charge_broyden.h b/ABACUS.develop/source/src_pw/charge_broyden.h index 3fd52f134e..318e475889 100644 --- a/ABACUS.develop/source/src_pw/charge_broyden.h +++ b/ABACUS.develop/source/src_pw/charge_broyden.h @@ -12,6 +12,7 @@ //=================================== #include "tools.h" #include "charge_pulay.h" + class Charge_Broyden: public Charge_Pulay { public: @@ -22,7 +23,6 @@ class Charge_Broyden: public Charge_Pulay const double &tr2,const int &iter, bool &converged);// mix rho - private: // Sophisticated mixing method. @@ -33,8 +33,6 @@ class Charge_Broyden: public Charge_Pulay void generate_Zmk(const int &totstep, const int &irstep, const int &idstep, const int &is); void generate_new_broyden_rho(const int &is, const int &irstep); - - bool initb; // b stands for Broyden algorithms. double w0; double* w; @@ -42,8 +40,6 @@ class Charge_Broyden: public Charge_Pulay matrix betabar; // (dstep, dstep) matrix* Zmk; matrix* Zmk_old; - - }; #endif diff --git a/ABACUS.develop/source/src_pw/charge_extra.cpp b/ABACUS.develop/source/src_pw/charge_extra.cpp index 1a39a5b8bd..8ef14f105c 100644 --- a/ABACUS.develop/source/src_pw/charge_extra.cpp +++ b/ABACUS.develop/source/src_pw/charge_extra.cpp @@ -6,11 +6,12 @@ Charge_Extra::Charge_Extra() { init_rho = false; - //xiaohui add 2014-05-07, for first-order extrapolation + + // for first-order extrapolation this->delta_rho1 = new double*[NSPIN]; this->delta_rho2 = new double*[NSPIN]; this->delta_rho = new double*[NSPIN]; - //xiaohui add 2014-05-10, for second-order extrapolation + // for second-order extrapolation this->delta_rho3 = new double*[NSPIN]; for(int is=0; isdim = 0;//xiaohui modify 2015-02-01 - //xiaohui add 2014-05-10, for second-order extrapolation + + this->dim = 0; + + // for the second-order extrapolation pos_dim = ucell.nat * 3; delete[] this->pos_old1; @@ -101,35 +98,12 @@ void Charge_Extra::allocate(void) ZEROS(pos_now, pos_dim); ZEROS(pos_next, pos_dim); - /* xiaohui modify 2014-05-12, test - //xiaohui add 2014-05-11, test - delete[] this->pos_old1; - this->pos_old1 = new double[pos_dim]; - ZEROS(pos_old1, pos_dim); - - delete[] this->pos_old2; - this->pos_old2 = new double[pos_dim]; - ZEROS(pos_old2, pos_dim); - - //delete[] this->pos_now; - //this->pos_now = new double[pos_dim]; - //ZEROS(pos_now, pos_dim); - - //delete[] this->pos_next; - //this->pos_next = new double[pos_dim]; - //ZEROS(pos_next, pos_dim); - */ - - //cout<<"here pos_dim is: "<rho_ion = new double**[dim]; for(int i=0; irho_ion[0][is][ir]; - } + //------------------------------------------------------- - // (3) save the current charge density for next step. - for(int ir=0; irrho_ion[0][is][ir] = rho_tmp[ir]; - } - - delete[] rho_tmp; - } - } - else if(pot.extra_pot == 2) - { - // 2 nd order - } - else if(pot.extra_pot == 3) - { - // start from atomic charge density. - // worst method ever! - chr.atomic_rho(NSPIN, chr.rho); - } -xiaohui modify 2015-02-01*/ - //else if(pot.extra_pot == 4) if(pot.extra_pot == "dm")//xiaohui modify 2015-02-01 { - //if(LOCAL_BASIS!=4 || LINEAR_SCALING!=1) xiaohui modify 2013-09-01 - if(BASIS_TYPE=="pw" || BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-01 + if(BASIS_TYPE=="pw" || BASIS_TYPE=="lcao_in_pw") { - WARNING_QUIT("Charge_Extra","extrapolate_charge"); + WARNING_QUIT("Charge_Extra","charge extrapolation method is not available"); } else { pw.setup_structure_factor(); - // should not do this after grid_technique is done!. -// for(int is=0; isdelta_rho1 = new double*[NSPIN]; - //this->delta_rho2 = new double*[NSPIN]; - //this->delta_rho = new double*[NSPIN]; for(int is=0; isdelta_rho1 = new double*[NSPIN]; - //this->delta_rho2 = new double*[NSPIN]; - //this->delta_rho = new double*[NSPIN]; for(int is=0; isnew_e_iteration) { @@ -274,7 +271,16 @@ void Charge_Pulay::Pulay_mixing(void) this->read_rho(ifname.str()); } */ - + #if TEST_EXX_LCAO==1 + cout<<"Charge_Pulay::Pulay_mixing\t"<<__FILE__<<"\t"<<__LINE__< and S|phi> // Works for generalized eigenvalue problem (US pseudopotentials) as well + //------------------------------------------------------------------- complex *sphi = new complex[dim](); complex *scg = new complex[dim](); complex *hphi = new complex[dim](); @@ -61,18 +64,12 @@ void Diago_CG::diag if (test_cg>2) ofs_running << "Diagonal Band : " << m << endl; for (int i=0; i - this->schmit_orth(dim, m, phi, sphi, phi_m); + hm.hpw.s_1psi(dim, phi_m, sphi); // sphi = S|psi(m)> + this->schmit_orth(dim, dmx, m, phi, sphi, phi_m); -// cout<<"\n before h_1psi sphi"; -// for(int i=0; iddot_real(dim, phi_m, hphi ); -// cout<<"\n\n m="<calculate_gradient( precondition, dim, hphi, sphi, g, pphi ); - this->orthogonal_gradient( dim, g, scg, lagrange, phi, m); + this->orthogonal_gradient( dim,dmx, g, scg, lagrange, phi, m); this->calculate_gamma_cg( iter, dim, precondition, g, scg, g0, cg, gg_last, cg_norm, theta, phi_m);// scg used as sg converged = this->update_psi( dim, cg_norm, theta, pphi, cg, scg, phi_m , e[m], eps, hphi, sphi); // pphi is used as hcg if ( converged ) break; }//end iter -// hm.s_1psi(dim, phi_m, sphi); // sphi = S|psi(m)> -// if(test_cg>2) cout<<"\n\n m="< *hpsi, const complex *spsi, @@ -191,8 +186,6 @@ void Diago_CG::calculate_gradient( const double es = this->ddot_real( dim, spsi, ppsi); const double lambda = eh / es; -// OUT("lambda",lambda); - // Update g! for (int i=0; i *g, complex *sg, complex *lagrange, const ComplexMatrix &eigenfunction, const int m) { if (test_cg==1) TITLE("Diago_CG","orthogonal_gradient"); //timer::tick("Diago_CG","orth_grad"); - hm.s_1psi(dim , g, sg); - - for (int i=0; i>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Parallel_Reduce::reduce_complex_double_pool(lagrange, m); // (3) orthogonal |g> and |Sg> to all states (0~m-1) - for (int i=0; i>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //timer::tick("Diago_CG","orth_grad"); return; @@ -317,6 +323,7 @@ void Diago_CG::calculate_gamma_cg( return; } + bool Diago_CG::update_psi( const int dim, double &cg_norm, @@ -332,8 +339,9 @@ bool Diago_CG::update_psi( { if (test_cg==1) TITLE("Diago_CG","update_psi"); //timer::tick("Diago_CG","update"); - hm.h_1psi(dim, cg, hcg, scg); + hm.hpw.h_1psi(dim, cg, hcg, scg); cg_norm = sqrt( this->ddot_real(dim, cg, scg) ); + if (cg_norm < 1.0e-10 ) return 1; const double a0 = this->ddot_real(dim, psi_m, hcg) * 2.0 / cg_norm; @@ -391,6 +399,7 @@ bool Diago_CG::update_psi( void Diago_CG::schmit_orth ( const int& dim, + const int& dmx, const int& m, //end const ComplexMatrix &psi, complex *sphi, @@ -410,29 +419,42 @@ void Diago_CG::schmit_orth complex *lagrange = new complex[ m+1 ]; ZEROS(lagrange, m+1); - for (int j = 0; j <= m; j++) + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //qianrui replace 2021-3-15 + int inc=1; + int mp1 = m+1; + char trans='C'; + zgemv_(&trans,&dim,&mp1,&ONE,psi.c,&dmx,sphi,&inc,&ZERO,lagrange,&inc); + //====================================================================== + /*for (int j = 0; j <= m; j++) { for (int ig=0; ig < dim; ig++) { lagrange[j] += conj(psi( j, ig)) * sphi[ig] ; } - } + }*/ + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // be careful , here reduce m+1 Parallel_Reduce::reduce_complex_double_pool( lagrange, m+1 ); double psi_norm = lagrange[m].real(); -// cout << "\n psi norm1 = " << psi_norm; - for (int j = 0; j < m; j++) + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //qianrui replace 2021-3-15 + char trans2='N'; + zgemv_(&trans2,&dim,&m,&NEG_ONE,psi.c,&dmx,lagrange,&inc,&ONE,psi_m,&inc); + psi_norm -= ddot_real(m,lagrange,lagrange); + //====================================================================== + /*for (int j = 0; j < m; j++) { for (int ig =0; ig < dim; ig++) { psi_m[ig] -= lagrange[j] * psi(j, ig); } -// cout << "\n j = " << j << " lagrange norm = " << ( conj(lagrange[j]) * lagrange[j] ).real(); psi_norm -= ( conj(lagrange[j]) * lagrange[j] ).real(); - } + }*/ + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ( psi_norm <= 0.0) { @@ -440,10 +462,6 @@ void Diago_CG::schmit_orth for(int j=0; j<=m; ++j) { cout << "\n j = " << j << " lagrange norm = " << ( conj(lagrange[j]) * lagrange[j] ).real(); -// for(int ig=0; ig + hm.hpw.s_1psi(dim, psi_m, sphi); // sphi = S|psi(m)> delete [] lagrange ; //timer::tick("Diago_CG","schmit_orth"); return ; } + double Diago_CG::ddot_real ( const int &dim, @@ -486,15 +505,28 @@ complex Diago_CG::ddot const complex * psi_R ) { - complex result(0, 0); - for (int i = 0; i < dim ; i++) + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //qianrui modify 2021-3-14 + //Note that ddot_(2*dim,a,1,b,1) = REAL( zdotc_(dim,a,1,b,1) ) + int dim2=2*dim; + double *pL,*pR; + pL=(double *)psi_L; + pR=(double *)psi_R; + double result=LapackConnector::dot(dim2,pL,1,pR,1); + Parallel_Reduce::reduce_double_pool( result ); + return result; + //====================================================================== + /*complex result(0,0); + for (int i=0;i>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> } // end of ddot + // this return complex Diago_CG::ddot ( @@ -517,6 +549,7 @@ complex Diago_CG::ddot return result; } // end of ddot + // this return complex Diago_CG::ddot ( @@ -535,5 +568,6 @@ complex Diago_CG::ddot result += conj( psi_L(m,i) ) * psi_R(n,i) ; } Parallel_Reduce::reduce_complex_double_pool( result ); + return result; } // end of ddot diff --git a/ABACUS.develop/source/src_pw/diago_cg.h b/ABACUS.develop/source/src_pw/diago_cg.h index b471291c6e..d389d90422 100644 --- a/ABACUS.develop/source/src_pw/diago_cg.h +++ b/ABACUS.develop/source/src_pw/diago_cg.h @@ -1,15 +1,3 @@ -//===============---------------=========================================== -// Author: Mohan Chen -// UpDATE : -// 09-03-13 mohan -// Rewrite the cg code. -// -// 09-05-07 wangjp -// (1) modify ddot(),ddot_real() as static member function -// (2) overload member function ddot() to compute the product -// of two rows of ComplexMatrixs -//========================================================================== - #ifndef DIAGO_CG_H #define DIAGO_CG_H @@ -17,10 +5,13 @@ class Diago_CG { -public: + public: + Diago_CG(); ~Diago_CG(); + static int moved; + static double ddot_real( const int & dim, const complex* psi_L, @@ -48,6 +39,7 @@ class Diago_CG ComplexMatrix &phi, double *e, const int &dim, + const int &dmx, const int &n_band, const double *precondition, const double &eps, @@ -58,13 +50,14 @@ class Diago_CG static void schmit_orth( const int &dim, + const int &dmx, const int &end, const ComplexMatrix &psi, complex *spsi, complex *psi_m ); -private: + private: int test_cg; @@ -78,6 +71,7 @@ class Diago_CG void orthogonal_gradient( const int &dim, + const int &dmx, complex *g, complex *scg, complex *lagrange, diff --git a/ABACUS.develop/source/src_pw/diago_david.cpp b/ABACUS.develop/source/src_pw/diago_david.cpp index a61a781e6f..12ab75d0d5 100644 --- a/ABACUS.develop/source/src_pw/diago_david.cpp +++ b/ABACUS.develop/source/src_pw/diago_david.cpp @@ -11,9 +11,11 @@ Diago_David::Diago_David() // default: no check } -Diago_David::~Diago_David() { +Diago_David::~Diago_David() +{ } + void Diago_David::diag ( ComplexMatrix &psi, @@ -29,7 +31,7 @@ void Diago_David::diag ) { if (test_david==1) TITLE("Diago_David","diag"); - timer::tick("Diago_David", "diag"); + timer::tick("Diago_David", "diag", 'G'); assert( order > 1 ); assert( order*nband < npw ); @@ -67,16 +69,19 @@ void Diago_David::diag ZEROS( convflag, nband ); for ( int m = 0 ; m < nband; m++ ) unconv[m] = m; - timer::tick("Diago_David","first"); + timer::tick("Diago_David","first",'G'); // orthogonalise the initial trial psi(0~nband-1) for (int m = 0; m < nband; m++) { // psi_m = psi(m) - for ( int ig = 0; ig < npw; ig++ ) psi_m[ig] = psi(m,ig); + for ( int ig = 0; ig < npw; ig++ ) + { + psi_m[ig] = psi(m,ig); + } this->SchmitOrth(npw, nband, m, basis, psi_m, spsi); - hm.h_1psi(npw, psi_m, hpsi, spsi); + hm.hpw.h_1psi(npw, psi_m, hpsi, spsi); // basis(m) = psi_m, hp(m) = H |psi_m>, sp(m) = S |psi_m> for ( int ig = 0; ig < npw; ig++ ) @@ -94,30 +99,35 @@ void Diago_David::diag this->diag_zhegvx( nbase, nband, hc, sc, nbase_x, e, vc ); - for ( int m = 0; m < nband; m++ ) en[m] = e[m]; + for ( int m = 0; m < nband; m++ ) + { + en[m] = e[m]; + } - timer::tick("Diago_David","first"); + timer::tick("Diago_David","first",'G'); int dav_iter = 0; do { dav_iter++; - this->cal_grad( npw, nbase, notconv, basis, hp, sp, vc, unconv, precondition, e, hpsi, spsi, ppsi, respsi ); + this->cal_grad( npw, nbase, notconv, basis, hp, sp, vc, + unconv, precondition, e, hpsi, spsi, ppsi, respsi ); this->cal_elem( npw, nbase, notconv, basis, hp, sp, hc, sc ); this->diag_zhegvx( nbase, nband, hc, sc, nbase_x, e, vc ); // check convergence and update eigenvalues - timer::tick("Diago_David","check_update"); + timer::tick("Diago_David","check_update",'G'); notconv = 0; for ( int m = 0 ; m < nband; m++ ) { convflag[m] = ( abs( e[m] - en[m] ) < eps ); - if ( !convflag[m] ) { + if ( !convflag[m] ) + { unconv[notconv] = m; notconv++; } @@ -125,7 +135,7 @@ void Diago_David::diag en[m] = e[m]; } - timer::tick("Diago_David","check_update"); + timer::tick("Diago_David","check_update",'G'); /* // test_david==2 cout info of each iteration if( test_david==2 ) @@ -136,7 +146,7 @@ void Diago_David::diag */ if ( !notconv || ( nbase + notconv > nbase_x) || (dav_iter == maxiter) ) { - timer::tick("Diago_David","last"); + timer::tick("Diago_David","last",'G'); // updata eigenvectors of Hamiltonian psi.zero_out(); @@ -144,7 +154,10 @@ void Diago_David::diag { for ( int j = 0; j < nbase; j++ ) { - for ( int ig = 0; ig < npw; ig++ ) psi(m,ig) += vc(j,m) * basis(j,ig); + for ( int ig = 0; ig < npw; ig++ ) + { + psi(m,ig) += vc(j,m) * basis(j,ig); + } } } @@ -152,7 +165,7 @@ void Diago_David::diag { // overall convergence or last iteration: exit the iteration - timer::tick("Diago_David","last"); + timer::tick("Diago_David","last",'G'); break; } else @@ -162,7 +175,7 @@ void Diago_David::diag // estimate of the eigenvectors and set the basis dimension to N; this->refresh( npw, nband, nbase, en, psi, basis, hp, sp, hc, sc, vc ); - timer::tick("Diago_David","last"); + timer::tick("Diago_David","last",'G'); } }// end of if @@ -189,7 +202,7 @@ void Diago_David::diag delete[] convflag; delete[] unconv; - timer::tick("Diago_David", "diag"); + timer::tick("Diago_David", "diag", 'G'); return; } @@ -212,7 +225,7 @@ void Diago_David::cal_grad ) { if ( test_david ==1 ) TITLE("DIAGO_DAVID","cal_grad"); - timer::tick("Diago_David","cal_grad"); + timer::tick("Diago_David","cal_grad", 'G'); // expand the reduced basis set with the new basis vectors P|R(psi)>... // in which psi are the last eigenvectors @@ -228,7 +241,10 @@ void Diago_David::cal_grad } } - for ( int ig = 0; ig < npw; ig++ ) ppsi[ig] = respsi[ig] / precondition[ig] ; + for ( int ig = 0; ig < npw; ig++ ) + { + ppsi[ig] = respsi[ig] / precondition[ig] ; + } /* double ppsi_norm = Diago_CG::ddot_real( npw, ppsi, ppsi); double rpsi_norm = Diago_CG::ddot_real( npw, respsi, respsi); @@ -237,7 +253,7 @@ void Diago_David::cal_grad */ this->SchmitOrth(npw, nbase+notconv, nbase+m, basis, ppsi, spsi); - hm.h_1psi(npw, ppsi, hpsi, spsi); + hm.hpw.h_1psi(npw, ppsi, hpsi, spsi); for ( int ig = 0; ig < npw; ig++ ) { @@ -247,7 +263,7 @@ void Diago_David::cal_grad } } - timer::tick("Diago_David","cal_grad"); + timer::tick("Diago_David","cal_grad",'G'); return; } @@ -264,7 +280,7 @@ void Diago_David::cal_elem ) { if ( test_david ==1 ) TITLE("DIAGO_DAVID","cal_elem"); - timer::tick("Diago_David","cal_elem"); + timer::tick("Diago_David","cal_elem",'G'); // updat the reduced Hamiltonian int offset_h = nbase * hc.nr ; @@ -299,7 +315,7 @@ void Diago_David::cal_elem } */ nbase += notconv; - timer::tick("Diago_David","cal_elem"); + timer::tick("Diago_David","cal_elem",'G'); return; } @@ -328,7 +344,7 @@ void Diago_David::diag_zhegvx ) { // TITLE("DIAGO_DAVID","diag_zhegvx"); - timer::tick("Diago_David","diag_zhegvx"); + timer::tick("Diago_David","diag_zhegvx",'G'); assert( ldh >= max(1,n) ); int lwork ; int info = 0; @@ -380,7 +396,7 @@ void Diago_David::diag_zhegvx delete[] rwork; delete[] iwork; delete[] ifail; - timer::tick("Diago_David","diag_zhegvx"); + timer::tick("Diago_David","diag_zhegvx",'G'); return; } @@ -400,7 +416,7 @@ void Diago_David::refresh ) { if ( test_david==1 ) TITLE("Diago_David","refresh"); - timer::tick("Diago_David","refresh"); + timer::tick("Diago_David","refresh",'G'); // update hp,sp basis.zero_out(); @@ -443,7 +459,7 @@ void Diago_David::refresh vc(i,i) = ONE; } - timer::tick("Diago_David","refresh"); + timer::tick("Diago_David","refresh",'G'); return; } @@ -459,7 +475,7 @@ void Diago_David::cal_err complex* respsi ) { - timer::tick("Diago_David","cal_err"); + timer::tick("Diago_David","cal_err",'G'); double *err = new double[nband]; assert(err != 0); @@ -486,7 +502,7 @@ void Diago_David::cal_err } delete[] err; - timer::tick("Diago_David","cal_err"); + timer::tick("Diago_David","cal_err",'G'); return; } @@ -501,7 +517,7 @@ void Diago_David::SchmitOrth ) { // if(test_david == 1) TITLE("Diago_David","SchmitOrth"); - timer::tick("Diago_David","SchmitOrth"); + timer::tick("Diago_David","SchmitOrth",'G'); // orthogonalize starting eigenfunction to those already calculated // psi_m orthogonalize to psi(0) ~ psi(m-1) @@ -513,7 +529,7 @@ void Diago_David::SchmitOrth assert(m >= 0); assert(m < n_band); - hm.s_1psi(npw, psi_m, spsi); + hm.hpw.s_1psi(npw, psi_m, spsi); complex* lagrange = new complex[m+1]; ZEROS( lagrange, m+1 ); @@ -526,7 +542,10 @@ void Diago_David::SchmitOrth } // lagrange[j] = Diago_CG::ddot( npw, psi, j, spsi ); } - for (int ig = 0; ig conv_elec = false;//mohan add 2008-05-25 - clock_t start,finish; - double duration = 0.0; // mohan add 2010/3/25 // output the charge mixing data : @@ -153,12 +143,6 @@ void electrons::self_consistent(const int &istep) // } // ### - // start the Exx calculation - if(DFT_FUNCTIONAL == "PBE0") - { - exxpw.init(true); - } - for (this->iter = 1;iter <= NITER;iter++) { ofs_running @@ -166,11 +150,12 @@ void electrons::self_consistent(const int &istep) << " ELEC=" << setw(4) << iter << "--------------------------------\n"; // mohan add 2010-07-16 - if(iter==1) chr.set_new_e_iteration(true); - else chr.set_new_e_iteration(false); + if(iter==1) CHR.set_new_e_iteration(true); + else CHR.set_new_e_iteration(false); // record the start time. - start=std::clock(); + // the clock is not accurate, needs to be fixed 2021-03-15 mohan + clock_t start=std::clock(); //(1) set converged threshold, // automatically updated during self consistency. @@ -180,27 +165,32 @@ void electrons::self_consistent(const int &istep) if(FINAL_SCF && iter==1) { init_mixstep_final_scf(); - //chr.irstep=0; - //chr.idstep=0; - //chr.totstep=0; + //CHR.irstep=0; + //CHR.idstep=0; + //CHR.totstep=0; } - // mohan move harris functional to here, 2012-06-05 - // use 'rho(in)' and 'v_h and v_xc'(in) - en.calculate_harris(1); - - // first_iter_again: // Peize Lin delete 2019-05-01 - - //(2) calculate band energy using cg or davidson method. - // output the new eigenvalues and wave functions. - this->c_bands(); - - // mohan add 2010-07-22 - if(DFT_FUNCTIONAL == "PBE0") - { - exxpw.get_exx2(); - } + // mohan move harris functional to here, 2012-06-05 + // use 'rho(in)' and 'v_h and v_xc'(in) + en.calculate_harris(1); + // first_iter_again: // Peize Lin delete 2019-05-01 + + // calculate exact-exchange + switch(xcf.iexch_now) // Peize Lin add 2019-03-09 + { + case 5: case 6: case 9: + if( !exx_global.info.separate_loop ) + { + exx_lip.cal_exx(); + } + break; + } + + //(2) calculate band energy using cg or davidson method. + // output the new eigenvalues and wave functions. + this->c_bands(istep); + if (check_stop_now()) return; en.eband = 0.0; @@ -214,24 +204,27 @@ void electrons::self_consistent(const int &istep) //(4) save change density as previous charge, // prepared fox mixing. - chr.save_rho_before_sum_band(); + CHR.save_rho_before_sum_band(); //(5) calculate new charge density according to // new wave functions. - + // calculate the new eband here. - chr.sum_band(); - - //(6) calculate the delta_harris energy - // according to new charge density. - // mohan add 2009-01-23 - en.calculate_harris(2); - - Symmetry_rho srho; - for(int is=0; is = are calculated after sum // band, using output charge density. - // but E_Hartree(en.ehart) and Exc(en.etxc) are calculated in v_of_rho above, + // but E_Hartree and Exc(en.etxc) are calculated in v_of_rho above, // using the mixed charge density. // so delta_escf corrects for this difference at first order. en.delta_escf(); @@ -315,7 +308,7 @@ void electrons::self_consistent(const int &istep) // mohan fix bug 2012-06-05, // the new potential V(PL)+V(H)+V(xc) - pot.v_of_rho(chr.rho, en.ehart, en.etxc, en.vtxc, pot.vr); + pot.v_of_rho(CHR.rho, pot.vr); //cout<<"Exc = "<= 0 ) chr.rho = chr.rho_save; + //if ( imix >= 0 ) CHR.rho = CHR.rho_save; //ofs_running << "\n start next iterate for idum "; } //END DO - timer::tick("electrons","self_consistent",'D'); + timer::tick("Electrons","self_consistent",'D'); return; -} // end electrons +} // end Electrons -bool electrons::check_stop_now(void) + +bool Electrons::check_stop_now(void) { bool check_stop_now = false; @@ -432,10 +438,11 @@ bool electrons::check_stop_now(void) return check_stop_now; } // END FUNCTION check_stop_now -void electrons::c_bands(void) + +void Electrons::c_bands(const int &istep) { - if (test_elec) TITLE("electrons","c_bands"); - timer::tick("electrons","c_bands",'E'); + if (test_elec) TITLE("Electrons","c_bands"); + timer::tick("Electrons","c_bands",'E'); int precondition_type = 2; @@ -448,12 +455,7 @@ void electrons::c_bands(void) ofs_running << setprecision(6) << setiosflags(ios::fixed) << setiosflags(ios::showpoint); for (int ik = 0;ik < kv.nks;ik++) { - hm.init_k(ik); - - if(DFT_FUNCTIONAL == "PBE0") - { - exxpw.ik_now = ik; - } + hm.hpw.init_k(ik); //=========================================== // Conjugate-Gradient diagonalization @@ -477,7 +479,7 @@ void electrons::c_bands(void) } } //h_diag can't be zero! //zhengdy-soc - if(NPOL==2) + if(NPOL==2) { for(int ig = wf.npw;ig < wf.npwx; ig++) { @@ -495,13 +497,9 @@ void electrons::c_bands(void) // // In localized orbital presented in plane wave case, // only using cinitcgg. - // - // In linear scaling method, using sparse matrix and - // adjacent searching code and cg method to calculate the - // eigenstates. //============================================================= double avg_iter_k = 0.0; - hm.diago(this->istep, this->iter, ik, h_diag, avg_iter_k); + hm.diago(istep, this->iter, ik, h_diag, avg_iter_k); avg_iter += avg_iter_k; @@ -528,13 +526,14 @@ void electrons::c_bands(void) return; } // END SUBROUTINE c_bands_k -void electrons::init_mixstep_final_scf(void) + +void Electrons::init_mixstep_final_scf(void) { TITLE("electrons","init_mixstep_final_scf"); - chr.irstep=0; - chr.idstep=0; - chr.totstep=0; + CHR.irstep=0; + CHR.idstep=0; + CHR.totstep=0; return; } diff --git a/ABACUS.develop/source/src_pw/electrons.h b/ABACUS.develop/source/src_pw/electrons.h index c8c0194c05..74fab33c44 100644 --- a/ABACUS.develop/source/src_pw/electrons.h +++ b/ABACUS.develop/source/src_pw/electrons.h @@ -4,57 +4,42 @@ #include "tools.h" #include "threshold_elec.h" -class electrons: private Threshold_Elec +class Electrons: private Threshold_Elec { public: // constructor and deconstructor - electrons(); - ~electrons(); + Electrons(); + ~Electrons(); -#ifdef __EPM - -#else public: //========================================================== - // lberry : If TRUE Berry phase polarization is calculated. - // iter : Current step of electrons iteration. - // ntry : - // notconv : - // ethr : the convergence threshold for eigenvalues // avg_iter : Average iteration number in ccgdiagg //========================================================== int iter; + static double avg_iter; + int test; + int unit; - double delta_total_energy; -// bool lscf; // if .TRUE. the calculation is selfconsistent -// bool lmd; // if .TRUE. the calculation is a dynamics -// bool lpath; // if .TRUE. the calculation is a path optimizations -// bool tefield; // if .TRUE. a finite electric field is added to the -// double etotefield; // energy correction due to the field + double delta_total_energy; -protected: void self_consistent(const int &istep); - void non_self_consistent(void); - int istep; -private: - - void c_bands(void); - void compute_magnetization(void); + void non_self_consistent(const int &istep); private: - // used in electrons() + void c_bands(const int &istep); + bool check_stop_now(void); + void init_mixstep_final_scf(void); -#endif }; -#endif// ELECTRONS +#endif diff --git a/ABACUS.develop/source/src_pw/energy.cpp b/ABACUS.develop/source/src_pw/energy.cpp index a7f27621c7..8e77ff7f89 100644 --- a/ABACUS.develop/source/src_pw/energy.cpp +++ b/ABACUS.develop/source/src_pw/energy.cpp @@ -2,40 +2,24 @@ // AUTHOR : Lixin He, mohan // DATE : 2008-11-21 //========================================================== - #include "tools.h" #include "global.h" #include "energy.h" -#include "algorithms.h" -#include "mymath.h" -//#include "../src_develop/src_siao/selinv.h" -#include "../src_lcao/Mulliken_Charge.h" -#include "../src_lcao/lcao_nnr.h" -//#include "../src_lcao/Mulliken_Charge.h" -#include "../src_lcao/use_overlap_matrix.h" -#include "../src_lcao/sltk_atom_arrange.h"//qifeng-2019-01-21 -#include "../src_lcao/local_orbital_charge.h" - -#include "../src_pw/global.h" -#include "../src_pw/wavefunc.h" -#include "../src_lcao/lcao_matrix.h" -#include "../src_lcao/dftu.h" //Quxin adds for DFT+U on 20201029 - -#include "../src_lcao/global_fp.h" -#include "../src_lcao/wfc_dm_2d.h" -#include "../src_global/lapack_connector.h" -#include "../src_global/scalapack_connector.h" -#include "../src_global/matrix.h" -#include "../src_global/complexmatrix.h" +#include "src_global/mymath.h" #include #include -#include +#include #include "../src_pw/tools.h" -int energy::mxr = 50; +#include "../src_lcao/dftu.h" //Quxin adds for DFT+U on 20201029 +#include "src_pw/myfunc.h" +//new +#include "H_Ewald_pw.h" +#include "H_Hartree_pw.h" +#include "H_XC_pw.h" + energy::energy() { - // max, used in ewald , mohan add 2009-06-05 // the maximum number of R vectors included in r // the square of the electron charge (Ry atomic units) this->etot = 0; // the total energy of the solid @@ -43,13 +27,9 @@ energy::energy() this->eband = 0; // the band energy this->deband = 0; // correction for variational energy this->deband_harris = 0; // harris energy - this->ehart = 0; // the hartree energy - this->etxc = 0; // the exchange and correlation energy - this->vtxc = 0; // another exchange-correlation energy this->etxcc = 0; // the nlcc exchange and correlation this->exx = 0; // the exact exchange energy. - this->ewld = 0; // the ewald energy this->demet = 0; // correction for metals this->ef = 0; // the fermi energy } @@ -60,7 +40,6 @@ energy::~energy() #include "efield.h" -#ifndef __EPM void energy::calculate_harris(const int &flag) { // TITLE("energy","calculate_harris"); @@ -71,37 +50,41 @@ void energy::calculate_harris(const int &flag) } else if(flag==2) { - this->etot_harris = eband + deband_harris + (etxc - etxcc) + ewld - + ehart + demet + exx + Efield::etotefield; - - if(INPUT.dft_plus_u) this->etot_harris += dftu.EU; //Energy correction from DFT+U; Quxin adds on 20201029 + this->etot_harris = eband + deband_harris + + (H_XC_pw::etxc - etxcc) + + H_Ewald_pw::ewald_energy + + H_Hartree_pw::hartree_energy + + demet + + exx + + Efield::etotefield + + evdw; // Peize Lin add evdw 2021.03.09 + + if(INPUT.dft_plus_u) + { + this->etot_harris += dftu.EU; //Energy correction from DFT+U; Quxin adds on 20201029 + } } return; } -#endif void energy::calculate_etot(void) { TITLE("energy","calculate_etot"); //cout << "\n demet in etot = " << demet << endl; - this->etot = eband + deband + (etxc - etxcc) + ewld + - ehart + demet + descf + exx + Efield::etotefield; - - if(vdwd2.vdwD2) //Peize Lin add 2014-04-03, update 2019-04-26 - { - this->etot += vdwd2.energy_result; - } - if(vdwd3.vdwD3) //jiyy add 2019-05-18 - { - this->etot += vdwd3.energy_result; - } + this->etot = eband + deband + + (H_XC_pw::etxc - etxcc) + + H_Ewald_pw::ewald_energy + + H_Hartree_pw::hartree_energy + + demet + + descf + + exx + + Efield::etotefield + + evdw; // Peize Lin add evdw 2021.03.09 //Quxin adds for DFT+U energy correction on 20201029 - if(INPUT.dft_plus_u) this->etot += dftu.EU; - -/* - cout << resetiosflags(ios::scientific) << endl; + + /*cout << resetiosflags(ios::scientific) << endl; cout << setprecision(6) << endl; cout << " eband=" << eband << endl; cout << " deband=" << deband << endl; @@ -110,14 +93,24 @@ void energy::calculate_etot(void) cout << " ehart=" << ehart << endl; cout << " demet=" << demet << endl; cout << " descf=" << descf << endl; - cout << " exx=" << exx << endl; cout << " efiled=" << Efield::etotefield << endl; - */ + cout << " fermienergy= "<etot += dftu.EU; + } + return; } -void energy::print_etot(const bool converged, const int &istep, const int &iter_in, -const double &dr2, const double &duration, const double ðr, const double &avg_iter, -bool print) +void energy::print_etot( + const bool converged, + const int &istep, + const int &iter_in, + const double &dr2, + const double &duration, + const double ðr, + const double &avg_iter, + bool print) { TITLE("energy","print_etot"); this->iter = iter_in; @@ -127,136 +120,89 @@ bool print) ofs_running << "\n Density error is " << dr2 << endl; - if(OUT_LEVEL != "m") //xiaohui add "OUT_LEVEL", 2015-09-16 - { - //if(!LOCAL_BASIS)OUT(ofs_running,"Error Threshold",ethr); xiaohui modify 2013-09-02 - if(BASIS_TYPE=="pw")OUT(ofs_running,"Error Threshold",ethr); //xiaohui add 2013-09-02 - - if( this->printe>0 && ( (iter+1) % this->printe == 0 || converged || iter == NITER) ) + if(OUT_LEVEL != "m") //xiaohui add "OUT_LEVEL", 2015-09-16 { - ofs_running << "\n " << setw(12) << "Energy" << setw(30) << "Rydberg" << setw(30) << "eV" << endl; - this->print_format("E_KohnSham",etot); - this->print_format("E_Harris",etot_harris); - this->print_format("E_band",eband); - this->print_format("E_one_elec",eband+deband); - this->print_format("E_Hartree",ehart); - this->print_format("E_xc",etxc-etxcc); - this->print_format("E_Ewald",ewld); - this->print_format("E_demet",demet); //mohan add 2011-12-02 - this->print_format("E_descf",descf); - this->print_format("E_efield",Efield::etotefield); - if(vdwd2.vdwD2) //Peize Lin add 2014-04, update 2019-04-26 + if(BASIS_TYPE=="pw")OUT(ofs_running,"Error Threshold",ethr); //xiaohui add 2013-09-02 + + if( this->printe>0 && ( (iter+1) % this->printe == 0 || converged || iter == NITER) ) { - this->print_format("E_vdwD2",vdwd2.energy_result); + ofs_running << "\n " << setw(12) << "Energy" << setw(30) << "Rydberg" << setw(30) << "eV" << endl; + this->print_format("E_KohnSham",etot); + this->print_format("E_Harris",etot_harris); + this->print_format("E_band",eband); + this->print_format("E_one_elec",eband+deband); + this->print_format("E_Hartree",H_Hartree_pw::hartree_energy); + this->print_format("E_xc",H_XC_pw::etxc-etxcc); + this->print_format("E_Ewald",H_Ewald_pw::ewald_energy); + this->print_format("E_demet",demet); //mohan add 2011-12-02 + this->print_format("E_descf",descf); + this->print_format("E_efield",Efield::etotefield); + if(vdwd2_para.flag_vdwd2) //Peize Lin add 2014-04, update 2021-03-09 + { + this->print_format("E_vdwD2",evdw); + } + if(vdwd3.vdwD3) //jiyy add 2019-05 + { + this->print_format("E_vdwD3",vdwd3.energy_result); + } + this->print_format("E_exx",exx); } - if(vdwd3.vdwD3) //jiyy add 2019-05 + else { - this->print_format("E_vdwD3",vdwd3.energy_result); + ofs_running << "\n " << setw(12) << "Energy" << setw(30) << "Rydberg" << setw(30) << "eV" << endl; + this->print_format("E_KohnSham",etot); + this->print_format("E_Harris",etot_harris); } -// this->print_format("e_exx",exx); - } - else - { - ofs_running << "\n " << setw(12) << "Energy" << setw(30) << "Rydberg" << setw(30) << "eV" << endl; - this->print_format("E_KohnSham",etot); - this->print_format("E_Harris",etot_harris); - } - if(TWO_EFERMI) - { - this->print_format("E_Fermi_up",ef_up); - this->print_format("E_Fermi_dw",ef_dw); - } - else - { - this->print_format("E_Fermi",this->ef); - } - }//xiaohui add "OUT_LEVEL", 2015-09-16 - - if (iter_in == 1) // pengfei Li added 2015-1-31 - { - this->etot_old = this->etot; - } - - // for test, output eigenvalues. - /* - for(int ik=0; ikprint_format("E_Fermi_up",ef_up); + this->print_format("E_Fermi_dw",ef_dw); } - } - */ + else + { + this->print_format("E_Fermi",this->ef); + } + }//xiaohui add "OUT_LEVEL", 2015-09-16 + if (iter_in == 1) // pengfei Li added 2015-1-31 + { + this->etot_old = this->etot; + } + // mohan update 2011-02-26 stringstream ss; - //xiaohui modify 2013-09-02 - //if(LINEAR_SCALING == 2) - //{ - // if(DIAGO_TYPE=="canonical") - // { - // ss << "CA" << iter << "\0"; - // } - // else if(DIAGO_TYPE=="trace_correcting") - // { - // ss << "TC" << iter << "\0"; - - // } - // else if(DIAGO_TYPE=="trace_resetting") - // { - // ss << "TR" << iter << "\0"; - // } - //} - //else - //{ - // if(DIAGO_TYPE=="cg") - // { - // ss << "CG" << iter << "\0"; - // } - // else if(DIAGO_TYPE=="lapack") - // { - // ss << "LA" << iter << "\0"; - // } - // else if(DIAGO_TYPE=="hpseps") - // { - // ss << "HP" << iter << "\0"; - // } - // //else if(DIAGO_TYPE=="selinv") - // //{ - // // selinv series version - // // ss << "SI" << iter << "\0"; - // //} - // else if(DIAGO_TYPE=="dav") - // { - // ss << "DA" << iter << "\0"; - // } - // else - // { - // WARNING_QUIT("Energy","print_etot"); - // } - //} xiaohui modify 2013-09-02 //xiaohui add 2013-09-02, Peize Lin update 2020.11.14 string label; if(KS_SOLVER=="cg") + { label = "CG"; + } else if (KS_SOLVER=="lapack") + { label = "LA"; + } else if(KS_SOLVER=="hpseps") + { label = "HP"; + } else if(KS_SOLVER=="genelpa") + { label = "GE"; + } else if(KS_SOLVER=="dav") + { label = "DA"; + } else if(KS_SOLVER=="scalapack_gvx") + { label = "GV"; + } else + { WARNING_QUIT("Energy","print_etot"); + } ss << label << iter; //xiaohui add 2013-09-02 @@ -291,7 +237,9 @@ bool print) else if(NSPIN==4 && NONCOLIN) { cout << setprecision(2); - cout<1.0) @@ -311,7 +259,7 @@ bool print) printf( "[36m%-15f[0m", en.etot*Ry_to_eV); cout << setprecision(3); // cout << setw(11) << en.eband; - // cout << setw(11) << en.ehart; + // cout << setw(11) << H_Hartree_pw::hartree_energy; // cout << setw(11) << en.etxc - en.etxcc; cout << resetiosflags(ios::scientific); //if(DIAGO_TYPE=="cg") xiaohui modify 2013-09-02 @@ -346,7 +294,7 @@ bool print) cout << setw(11) << dr2; cout << setprecision(3); // cout << setw(11) << en.eband; - // cout << setw(11) << en.ehart; + // cout << setw(11) << H_Hartree_pw::hartree_energy; // cout << setw(11) << en.etxc - en.etxcc; //if(DIAGO_TYPE=="cg") xiaohui modify 2013-09-02 if(KS_SOLVER=="cg") //xiaohui add 2013-09-02 @@ -366,48 +314,9 @@ bool print) } else { - // if(iter_in % 4 == 0) cout << endl; - // cout << setprecision(6) << setw(15) << en.etot; } - /* - cout << setprecision(9); - - if(converged) - { - ofs_running << "\n end of self-consistenr calculation "; - - cout - << "\n" << setw(20) << " oooO Oooo |" << setw(15) << etot - << "\n" << setw(20) << " (####) (####) |" << setw(15) << dr2 - << "\n" << setw(20) << " \\##( )##/ |" << setw(15) << duration - << "\n" << setw(20) << " \\_) (_/ |" - << endl; - - } - else - { - if(iter%2==0) - { - cout - << "\n" << setw(20) << " oooO |" << setw(15) << etot - << "\n" << setw(20) << " (####) |" << setw(15) << dr2 - << "\n" << setw(20) << " \\##( |" << setw(15) << duration - << "\n" << setw(20) << " \\_) |" - << endl; - } - else - { - cout - << "\n" << setw(20) << " Oooo |" << setw(15) << etot - << "\n" << setw(20) << " (####) |" << setw(15) << dr2 - << "\n" << setw(20) << " )##/ |" << setw(15) << duration - << "\n" << setw(20) << " (_/ |" - << endl; - } - } - */ - this->etot_old = this->etot; + this->etot_old = this->etot; return; } @@ -422,355 +331,7 @@ void energy::print_format(const string &name, const double &value) return; } -// from ewald.f90 -double energy::ewald(void) -{ - TITLE("energy","ewald"); - timer::tick("energy","ewald"); - -//---------------------------------------------------------- -// Calculates Ewald energy with both G- and R-space terms. -// Determines optimal alpha. Should hopefully work for any structure. -//---------------------------------------------------------- - //int ng=0; - int nr=0; - int na=0; - int nb=0; - //int nt=0; - int nrm=0; - - double ewaldg=0.0; - double ewaldr=0.0; - double ewalds=0.0; - - Vector3 dtau ; - Vector3 *r; - double *r2; - double rmax=0.0; - double rr=0.0; - double upperbound=0.0; - double fact=0; - // total ionic charge in the cell - // ewald energy computed in reciprocal space - // ewald energy computed in real space - // the difference tau_s - tau_s' - // alpha term in ewald sum - // input of the rgen routine ( not used here ) - // the square modulus of R_j-tau_s-tau_s' - // the maximum radius to consider real space sum - // buffer variable - // used to optimize alpha - - if(test_energy)OUT(ofs_running,"mxr",mxr); - r = new Vector3[mxr]; - r2 = new double[mxr]; - int* irr = new int[mxr]; - - // (1) calculate total ionic charge - double charge = 0.0; - for (int it = 0;it < ucell.ntype;it++) - { - charge += ucell.atoms[it].na * ucell.atoms[it].zv;//mohan modify 2007-11-7 - } - if(test_energy)OUT(ofs_running,"Total ionic charge",charge); - - // (2) calculate the converged value: alpha - this->alpha = 2.90; - do - { - alpha -= 0.10; - // choose alpha in order to have convergence in the sum over G - // upperbound is a safe upper bound for the error in the sum over G - - if (alpha <= 0.0) - { - WARNING_QUIT("ewald","Can't find optimal alpha."); - } - upperbound = 2.0 * charge * charge * sqrt(2.0 * alpha / TWO_PI) * - erfc(sqrt(ucell.tpiba2 * pw.ggchg / 4.0 / alpha)); - } - while (upperbound > 1.0e-7); - if(test_energy)OUT(ofs_running,"alpha",alpha); - if(test_energy)OUT(ofs_running,"Upper bound",upperbound); - - // G-space sum here. - // Determine if this processor contains G=0 and set the constant term - if (pw.gstart == 1) - { - ewaldg = - charge * charge / alpha / 4.0; - } - else - { - ewaldg = 0.0; - } - - - // in plane wave basis, only use k=0 point is not - // called "gamma_only", only if the wave functions - // are stored as double type, the gamma_only = true. - // I don't know why "gamma_only" in plane wave - // makes the fact below is 2, that's a little complicated - // to understand. I think that may because only half - // the G vectors are used. Unfortunately implement the - // function hasn't in my plan list yet. - // - // but that's not the term "gamma_only" I want to use in LCAO, - fact = 1.0; - - //ofs_running << "\n pw.gstart = " << pw.gstart << endl; - - for (int ig=pw.gstart; ig rhon = ZERO; - for (int it=0; it( ucell.atoms[it].zv ) * conj( pw.strucFac(it, ig)); - } - if(pw.gg[ig] >= 1.0e-12) //LiuXh 20180515 - { - ewaldg += fact * abs(rhon) * abs(rhon) - * exp(- pw.gg[ig] * ucell.tpiba2 / alpha / 4.0 ) / pw.gg[ig] / ucell.tpiba2; - } - } - - - ewaldg = FOUR_PI / ucell.omega * ewaldg; - -// cout << "\n ewaldg = " << ewaldg; - - // Here add the other constant term - if(pw.gstart == 1) - { - for (int it = 0; it < ucell.ntype;it++) - { - ewaldg = ewaldg - ucell.atoms[it].na * ucell.atoms[it].zv * ucell.atoms[it].zv * sqrt(8.0 / TWO_PI * alpha); - } - }//mohan modify 2007-11-7, 2010-07-26 - - // R-space sum here (only done for the processor that contains G=0) - ewaldr = 0.0; - if (pw.gstart == 1) - { - rmax = 4.0 / sqrt(alpha) / ucell.lat0; - if(test_energy)OUT(ofs_running,"rmax(unit lat0)",rmax); - // with this choice terms up to ZiZj*erfc(4) are counted (erfc(4)=2x10^-8 - int nt1=0; - int nt2=0; - - for (nt1 = 0; nt1 < ucell.ntype; nt1++) - { - for (nt2 = 0; nt2 < ucell.ntype; nt2++) - { - for (na = 0; na < ucell.atoms[nt1].na; na++) - { - for (nb = 0; nb < ucell.atoms[nt2].na; nb++) - { - //calculate tau[na]-tau[nb] - dtau = ucell.atoms[nt1].tau[na] - ucell.atoms[nt2].tau[nb]; - //generates nearest-neighbors shells - this->rgen(dtau, rmax, irr, ucell.latvec, ucell.G, r, r2, nrm); - //pw.at-->ucell.latvec, pw.bg-->pw.G - // and sum to the real space part - - if (test_energy>1) - { - OUT("dtau.x",dtau.x); - OUT("dtau.y",dtau.y); - OUT("dtau.z",dtau.z); - OUT("nrm",nrm); - } - for (nr = 0;nr < nrm;nr++) - { - rr = sqrt(r2 [nr]) * ucell.lat0; - ewaldr = ewaldr + ucell.atoms[nt1].zv * ucell.atoms[nt2].zv * - erfc(sqrt(alpha) * rr) / rr; - - } // enddo - if (test_energy>1) OUT("ewaldr",ewaldr); - } // enddo - } // enddo - } // nt2 - }//nt1 - } // endif - - ewalds = 0.50 * e2 * (ewaldg + ewaldr); - - // mohan fix bug 2010-07-26 - Parallel_Reduce::reduce_double_pool( ewalds ); - - if (test_energy>1) - { - OUT("ewaldg",ewaldg); - OUT("ewaldr",ewaldr); - OUT("ewalds",ewalds); - } - - delete[] irr; - delete[] r; - delete[] r2; - timer::tick("energy","ewald"); - return ewalds; -} // end function ewald - -//----------------------------------------------------------------------- -void energy::rgen( - const Vector3 &dtau, - const double &rmax, - int *irr, - const Matrix3 &latvec, - const Matrix3 &G, - Vector3 *r, - double *r2, - int &nrm) const -{ - //------------------------------------------------------------------- - // generates neighbours shells (in units of alat) with length - // less than rmax,and returns them in order of increasing length. - // r=i*a1+j*a2+k*a3-dtau, - // where a1,a2,a3 are the vectors defining the lattice - - // first the dummy variables - // int nrm, mxr; - // output: the number of vectors in the spher - // input: the maximum number of vectors - - // real r (3, mxr), r2 (mxr), at (3, 3), bg (3, 3), dtau (3),rmax; - // output: coordinates of vectors R+tau_s-tau - // output: square modulus of vectors R+tau_s- - // input: direct lattice vectors - // input: reciprocal lattice vectors - // input: the vector tau_s-tau_s' - // input: the radius of the sphere in real sp - // and here the local variables - - int nm1=0; - int nm2=0; - int nm3=0; - int i=0; - int j=0; - int k=0; - // index on R vectors for order - // maximum values for trial vectors - // counters on trial vectors - // counter on polarizations - // counter on R vectors - // index of swapping - // used for swapping - - Vector3 t; - Vector3 t1; - double tt=0.0; - double bg1[3]={0,0,0}; - // buffer contains the actual r - // buffer cotains the modulus of actual r - // used for swapping - // function to find the norm of a vector - // external dnrm2, see myfunc - - nrm = 0; - - if (rmax == 0.0) - { - return; - } - - bg1[0] = G.e11; - bg1[1] = G.e12; - bg1[2] = G.e13; - - nm1 = (int)(dnrm2(3, bg1, 1) * rmax + 2); - - bg1[0] = G.e21; - bg1[1] = G.e22; - bg1[2] = G.e23; - - nm2 = (int)(dnrm2(3, bg1, 1) * rmax + 2); - - bg1[0] = G.e31; - bg1[1] = G.e32; - bg1[2] = G.e33; - - nm3 = (int)(dnrm2(3, bg1, 1) * rmax + 2); - - if (test_energy>1) - { - OUT("nm1",nm1); - OUT("nm2",nm2); - OUT("nm3",nm3); - } - - for (i = -nm1; i <= nm1; i++) // mohan fix bug, add '='. 2009-02-27 - { - for (j = -nm2; j <= nm2; j++) - { - for (k = -nm3; k <= nm3; k++) - { - Vector3 t1(i,j,k); -// out.printV3(t1); - t = t1 * latvec; // bug ! first '*latvec', second '-dtau'. - t = t - dtau; // bug ! t = t - dtau, not t1 = t1 -tau; -// out.printV3(t); // mohan fix 2bugs here, 2009-2-27 -// out.printM3("latvec",latvec); - - tt = t.x * t.x + t.y * t.y + t.z * t.z; - - if (tt <= rmax * rmax && abs(tt) > 1.e-10) - { - if (nrm > mxr) - { - cerr << "\n rgen, too many r-vectors," << nrm; - } - r[nrm] = t; - r2[nrm] = tt; - nrm++; - } // endif - } // enddo - } // enddo - } // enddo - - // reorder the vectors in order of increasing magnitude - // initialize the index inside sorting routine - irr[0] = 0; - if (nrm > 1) - { - heapsort(nrm, r2, irr); - } - - // mohan fix bug 2011-06-07 - for(int i=0; idescf -= ( chr.rho[0][ir]- chr.rho_save[0][ir] ) * pot.vr(0,ir); + this->descf -= ( CHR.rho[0][ir]- CHR.rho_save[0][ir] ) * pot.vr(0,ir); } if (NSPIN==2) { for (int ir=0; irdescf -= ( chr.rho[1][ir] - chr.rho_save[1][ir] ) * pot.vr(1, ir); + this->descf -= ( CHR.rho[1][ir] - CHR.rho_save[1][ir] ) * pot.vr(1, ir); } } if (NSPIN==4) { for(int ir=0; irdescf -= ( chr.rho[1][ir] - chr.rho_save[1][ir] ) * pot.vr(1, ir); - this->descf -= ( chr.rho[2][ir] - chr.rho_save[2][ir] ) * pot.vr(2, ir); - this->descf -= ( chr.rho[3][ir] - chr.rho_save[3][ir] ) * pot.vr(3, ir); + this->descf -= ( CHR.rho[1][ir] - CHR.rho_save[1][ir] ) * pot.vr(1, ir); + this->descf -= ( CHR.rho[2][ir] - CHR.rho_save[2][ir] ) * pot.vr(2, ir); + this->descf -= ( CHR.rho[3][ir] - CHR.rho_save[3][ir] ) * pot.vr(3, ir); } } @@ -851,667 +413,7 @@ void energy::delta_escf(void) this->descf *= ucell.omega / pw.ncxyz; return; } -#endif - -void energy::perform_dos(void) -{ - TITLE("energy","perform_dos"); - - - if(out_dos !=0 || out_band !=0) - { - ofs_running << "\n\n\n\n"; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl; - ofs_running << " | |" << endl; - ofs_running << " | Post-processing of data: |" << endl; - ofs_running << " | DOS (density of states) and bands will be output here. |" << endl; - ofs_running << " | If atomic orbitals are used, Mulliken charge analysis can be done. |" << endl; - ofs_running << " | Also the .bxsf file containing fermi surface information can be |" << endl; - ofs_running << " | done here. |" << endl; - ofs_running << " | |" << endl; - ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl; - ofs_running << "\n\n\n\n"; - } - - - if(MY_RANK==0) - { - if(CALCULATION=="scf" || CALCULATION=="md" || CALCULATION=="relax") - //if(CALCULATION=="scf" || CALCULATION=="md") - { - stringstream ss; - ss << global_out_dir << "istate.info" ; - ofstream ofsi( ss.str().c_str() ); - /*for(int ib=0; ibout_dos) - { - // find the maximal and minimal band energy. - double emax = wf.ekb[0][0]; - double emin = wf.ekb[0][0]; - for(int ik=0; ikdos_edelta_ev; - - - - const int npoints = static_cast(std::floor ( ( emax - emin ) / de_ev )); - int NUM=NLOCAL*npoints; - Wfc_Dm_2d D; - D.init(); - if(GAMMA_ONLY_LOCAL) - { - for(int in=0;in *waveg = new complex [NLOCAL]; - - double* Gauss = new double [np]; - - for(int is=0; is Mulk; - Mulk.resize(1); - Mulk[0].create(ParaO.ncol,ParaO.nrow); - - - matrix Dwf = D.wfc_gamma[is]; - for (int i=0; i Mulk; - Mulk.resize(1); - Mulk[0].create(ParaO.ncol,ParaO.nrow); - - - for(int ik=0;ik" <" << NSPIN<< "<"<<"/"<<"nspin"<<">"<< endl; - out << "<"<<"norbitals"<<">" <"<< endl; - out << "<"<<"energy"<<"_"<<"values units"<<"="<<"\""<<"eV"<<"\""<<">"<" <nw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - const int w = ucell.itiaiw2iwt(t, a, j); - - //out << "<"<<"/"<<"energy"<<"_"<<"values"<<">" <" <" <" <" <" <nw; ++j) - { - const int L1 = atom1->iw2l[j]; - const int N1 = atom1->iw2n[j]; - const int m1 = atom1->iw2m[j]; - out <dos_edelta_ev, - emax, - emin, - kv.nks, kv.nkstot, kv.wk, wf.wg, NBANDS, wf.ekb ); - ifstream in(ss.str().c_str()); - if(!in) - { - // cout<<"\n Can't find file : "<< name << endl; - // return 0; - } - - //---------------------------------------------------------- - // FOUND LOCAL VARIABLES : - // NAME : number(number of DOS points) - // NAME : nk(number of k point used) - // NAME : energy(energy range,from emin_ev to emax_ev) - // NAME : dos(old,count k points in the energy range) - // NAME : dos2(new,count k points in the energy range) - //---------------------------------------------------------- - int number=0; - int nk=0; - in >> number; - in >> nk; - double *energy = new double[number]; - double *dos = new double[number]; - double *dos2 = new double[number]; - for(int i=0 ;i> energy[i] >> dos[i]; - } - if(!in.eof()) - { - //cout<<"\n Read Over!"<ef << " Rydberg" << endl; - } - else if(nspin0==2) - { - ofs_running << " Fermi energy (spin = 1) is " << this->ef_up << " Rydberg" << endl; - ofs_running << " Fermi energy (spin = 2) is " << this->ef_dw << " Rydberg" << endl; - } - - //int nks; - //if(nspin0==1) nks = kv.nkstot; - //else if(nspin0==2) nks = kv.nkstot/2; - - - - /*for(int is=0; isef, wf.ekb); - }*/ - - if(out_dos==3) - { - for(int i=0; iout_band) //pengfei 2014-10-13 - { - - int nks; - if(nspin0==1) nks = kv.nkstot; - else if(nspin0==2) nks = kv.nkstot/2; - - - - for(int is=0; isef*0, wf.ekb); - } - - } - -} void energy::print_band(const int &ik) { @@ -1561,3 +463,40 @@ void energy::print_band(const int &ik) } return; } + +// Peize Lin add 2016-12-03 +void energy::set_exx() +{ + TITLE("energy", "set_exx"); + + auto exx_energy = []() -> double + { + if("lcao_in_pw"==BASIS_TYPE) + { + return exx_lip.get_exx_energy(); + } + else if("lcao"==BASIS_TYPE) + { + return exx_lcao.get_energy(); + } + else + { + throw invalid_argument(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + } + }; + + if( 5==xcf.iexch_now && 0==xcf.igcx_now ) // HF + { + this->exx = exx_energy(); + } + else if( 6==xcf.iexch_now && 8==xcf.igcx_now ) // PBE0 + { + this->exx = exx_global.info.hybrid_alpha * exx_energy(); + } + else if( 9==xcf.iexch_now && 12==xcf.igcx_now ) // HSE + { + this->exx = exx_global.info.hybrid_alpha * exx_energy(); + } + + return; +} diff --git a/ABACUS.develop/source/src_pw/energy.h b/ABACUS.develop/source/src_pw/energy.h index b7c65feb51..e5759685eb 100644 --- a/ABACUS.develop/source/src_pw/energy.h +++ b/ABACUS.develop/source/src_pw/energy.h @@ -9,13 +9,14 @@ class energy { public: - friend class electrons; - friend class Local_Orbital_Elec; + friend class Electrons; + friend class Electrons_Stochastic;//mohan add 2021-01-31 + friend class LOOP_elec; friend class Local_Orbital_Charge; friend class Threshold_Elec; friend class Forces; friend class Charge; - friend class potential; + friend class Potential; friend class Occupy; friend class wavefunc; friend class eximport; @@ -24,6 +25,7 @@ class energy friend class Force_Lo; friend class Exx_pw; friend class ON_Tests; + energy(); ~energy(); @@ -36,7 +38,6 @@ class energy int printe; // print energy every 'printe' electron iteration. int iter; - //private: //mohan change 2011-06-12 public: // The variables needed to compute the energies @@ -47,22 +48,19 @@ class energy double deband_harris; double descf; - double ehart; // the hartree energy - double etxc; // the exchange and correlation energy - double vtxc; // another exchange-correlation energy double etxcc; // the nlcc exchange and correlation double exx; // the exact exchange energy. + double evdw; // the vdw energy // Peize Lin add 2021.03.09 - double ewld; // the ewald energy - double alpha; // the coefficient of ewald method double demet; // correction for metals int out_dos; // control dos calculation int out_band; // control band calculation pengfei 2014-10-13 - double dos_emin_ev; + + double dos_emin_ev; double dos_emax_ev; double dos_edelta_ev; - double bcoeff; + double bcoeff; double ewald(); @@ -80,23 +78,15 @@ class energy void print_format(const string &name, const double &value); -#ifndef __EPM void calculate_harris(const int &flag); //mohan add 2012-06-05 + double delta_e(void); + void delta_escf(void); -#endif - void rgen( - const Vector3 &dtau, - const double &rmax, - int *irr, - const Matrix3 &at, - const Matrix3 &bg, - Vector3 *r, - double *r2, - int &nrm - ) const; + + + void set_exx(); // Peize Lin add 2016-12-03 - static int mxr; }; #endif //energy diff --git a/ABACUS.develop/source/src_pw/exx.f90 b/ABACUS.develop/source/src_pw/exx.f90 deleted file mode 100644 index cdadbe973d..0000000000 --- a/ABACUS.develop/source/src_pw/exx.f90 +++ /dev/null @@ -1,229 +0,0 @@ - subroutine vexx(lda, n, m, psi, hpsi) - !band loop - temppsic(:) = ( 0.D0, 0.D0 ) - temppsic(nls(igk(1:npw))) = psi(1:npw,im) - CALL cft3s( temppsic, nr1s, nr2s, nr3s, nrx1s, nrx2s, nrx3s, 2 ) - - ! k point loop - do iqi=1,nqi - ! G loop - do ibnd=1,nbnd !for each band of psi - - !calculate rho in real space - rhoc(:)=CONJG(tempphic(:))*temppsic(:) / omega - !brings it to G-space - CALL cft3s( rhoc,nr1s, nr2s, nr3s, nrx1s, nrx2s, nrx3s, -1 ) - - vc(:) = ( 0.D0, 0.D0 ) - vc(nls(1:ngm)) = fac(1:ngm) * rhoc(nls(1:ngm)) - vc = vc * x_occupation(ibnd,ik) / nqs - - !brings back v in real space - CALL cft3s( vc, nr1s, nr2s, nr3s, nrx1s, nrx2s, nrx3s, 1 ) - - !accumulates over bands and k points - result(1:nrxxs)=result(1:nrxxs)+vc(1:nrxxs)*tempphic(1:nrxxs) - end do - end do - !write(*,*) result(1:10) - CALL mp_sum( result(1:nrxxs), inter_image_comm ) - !write(*,*) 'result is: ',result(1), result(nrxxs), nrxxs, my_image_id - !brings back result in G-space - CALL cft3s( result, nr1s, nr2s, nr3s, nrx1s, nrx2s, nrx3s, -2 ) - !adds it to hpsi - hpsi(1:npw,im)=hpsi(1:npw,im) - exxalfa*result(nls(igk(1:npw))) - - deallocate (tempphic,temppsic, result, rhoc, vc, fac ) - - call stop_clock ('vexx') - - end subroutine vexx - - function exxenergy () - ! This function is called to correct the deband value and have - ! the correct energy -! energy=0.d0 -! do ik=1,nks -! current_k = ik -! IF ( lsda ) current_spin = isk(ik) - ! npw = ngk (ik) - ! IF ( nks > 1 ) THEN - ! READ( iunigk ) igk - ! call get_buffer (psi, nwordwfc, iunwfc, ik) - ! ELSE - ! psi(1:npwx,1:nbnd) = evc(1:npwx,1:nbnd) - ! END IF - ! vxpsi(:,:) = (0.d0, 0.d0) - ! call vexx(npwx,npw,nbnd,psi,vxpsi) - do ibnd=1,nbnd - energy = energy + & - wg(ibnd,ik) * ZDOTC(npw,psi(1,ibnd),1,vxpsi(1,ibnd),1) - end do - if (gamma_only .and. gstart == 2) then - do ibnd=1,nbnd - energy = energy - & - 0.5d0 * wg(ibnd,ik) * CONJG(psi(1,ibnd)) * vxpsi(1,ibnd) - end do - end if - end do - - if (gamma_only) energy = 2.d0 * energy - - - call mp_sum( energy, intra_pool_comm ) - call mp_sum( energy, inter_pool_comm ) - - exxenergy = energy - - call stop_clock ('exxenergy') - end function exxenergy - - !----------------------------------------------------------------------- - function exxenergy2() - !----------------------------------------------------------------------- - energy=0.d0 - - tpiba2 = (fpi / 2.d0 / alat) **2 - - allocate (tempphic(nrxxs), temppsic(nrxxs), rhoc(nrxxs), fac(ngm) ) - - nqi=nqs/nimage - - IF ( nks > 1 ) REWIND( iunigk ) - do ikk=1,nks - current_k = ikk - IF ( lsda ) current_spin = isk(ikk) - npw = ngk (ikk) - IF ( nks > 1 ) THEN - READ( iunigk ) igk - call get_buffer (evc, nwordwfc, iunwfc, ikk) - END IF - - do jbnd=1, nbnd !for each band of psi (the k cycle is outside band) - temppsic(:) = ( 0.D0, 0.D0 ) - temppsic(nls(igk(1:npw))) = evc(1:npw,jbnd) - - CALL cft3s( temppsic, nr1s, nr2s, nr3s, nrx1s, nrx2s, nrx3s, 2 ) - - do iqi=1,nqi - iq=iqi+nqi*my_image_id - ikq = index_xkq(current_k,iq) - ik = index_xk(ikq) - isym = abs(index_sym(ikq)) - - xk_cryst(:)=at(1,:)*xk(1,ik)+at(2,:)*xk(2,ik)+at(3,:)*xk(3,ik) - if (index_sym(ikq) < 0 ) xk_cryst = - xk_cryst - sxk(:) = s(:,1,isym)*xk_cryst(1) + & - s(:,2,isym)*xk_cryst(2) + & - s(:,3,isym)*xk_cryst(3) - xkq(:) = bg(:,1)*sxk(1) + bg(:,2)*sxk(2) + bg(:,3)*sxk(3) - - do ig=1,ngm - q(1)= xk(1,current_k) - xkq(1) + g(1,ig) - q(2)= xk(2,current_k) - xkq(2) + g(2,ig) - q(3)= xk(3,current_k) - xkq(3) + g(3,ig) - qq = ( q(1)*q(1) + q(2)*q(2) + q(3)*q(3) ) - if (qq.gt.1.d-8) then - fac(ig)=e2*fpi/(tpiba2*qq + yukawa ) * grid_factor - if (gamma_only) fac(ig) = 2.d0 * fac(ig) - if (on_double_grid) fac(ig) = 0.d0 - else - fac(ig)= - exxdiv ! & ! or rather something else (see F.Gygi) - ! - e2*fpi ! THIS ONLY APPLYS TO HYDROGEN - if (yukawa.gt.1.d-8 .and. .not. x_gamma_extrapolation) then - fac(ig) = fac(ig) + e2*fpi/(tpiba2*qq + yukawa ) - end if - end if - end do - - do ibnd=1,nbnd !for each band of psi - if ( abs(x_occupation(ibnd,ik)) < 1.d-6) cycle - do ji=1, nrxxs - tempphic(ji)=exxbuff(ji,ikq,ibnd) - enddo - !calculate rho in real space - rhoc(:)=CONJG(tempphic(:))*temppsic(:) / omega - !brings it to G-space - CALL cft3s( rhoc,nr1s, nr2s, nr3s, nrx1s, nrx2s, nrx3s, -1 ) - vc = 0.D0 - do ig=1,ngm - vc = vc + fac(ig) * rhoc(nls(ig)) * CONJG(rhoc(nls(ig))) - end do - vc = vc * omega * x_occupation(ibnd,ik) / nqs - energy = energy - exxalfa * vc * wg(jbnd,ikk) - end do - end do - end do - end do - - deallocate (tempphic, temppsic, rhoc, fac ) - - call mp_sum( energy, inter_image_comm ) - call mp_sum( energy, intra_pool_comm ) - call mp_sum( energy, inter_pool_comm ) - - exxenergy2 = energy - - call stop_clock ('exxen2') - - end function exxenergy2 - - function exx_divergence () - - alpha = 10.d0 * tpiba2 / ecutwfc - - dq1= 1.d0/DBLE(nq1) - dq2= 1.d0/DBLE(nq2) - dq3= 1.d0/DBLE(nq3) - - div = 0.d0 - do iq1=1,nq1 - do iq2=1,nq2 - do iq3=1,nq3 - xq(:) = bg(:,1) * (iq1-1) * dq1 + & - bg(:,2) * (iq2-1) * dq2 + & - bg(:,3) * (iq3-1) * dq3 - do ig=1,ngm - q(1)= xq(1) + g(1,ig) - q(2)= xq(2) + g(2,ig) - q(3)= xq(3) + g(3,ig) - qq = ( q(1)*q(1) + q(2)*q(2) + q(3)*q(3) ) - if (.not.on_double_grid) then - if ( qq.gt.1.d-8 .or. yukawa .gt. 1.d-8) then - div = div + exp( -alpha * qq) / (qq + yukawa/tpiba2) & - * grid_factor - else - div = div - alpha ! or maybe something else - end if - end if - end do - end do - end do - end do - call mp_sum( div, intra_pool_comm ) - - div = div * e2 * fpi / tpiba2 / nqs - alpha = alpha / tpiba2 - nqq = 100000 - dq = 5.0d0 / sqrt(alpha) /nqq - aa = 0.d0 - do iq=0, nqq - q_ = dq * (iq+0.5d0) - qq = q_ * q_ - aa = aa - exp( -alpha * qq) * yukawa / (qq + yukawa) * dq - end do - aa = aa * 8.d0 /fpi - aa = aa + 1.d0/sqrt(alpha*0.25d0*fpi) - write (stdout,*) aa, 1.d0/sqrt(alpha*0.25d0*fpi) - - div = div - e2*omega * aa -! div = div - e2*omega/sqrt(alpha*0.25d0*fpi) - exx_divergence = div * nqs - write (stdout,'(a,i4,a,3f12.4)') 'EXX divergence (',nq1,')= ', & - div, alpha - - return - end function exx_divergence - - -end module exx diff --git a/ABACUS.develop/source/src_pw/exx_div.cpp b/ABACUS.develop/source/src_pw/exx_div.cpp deleted file mode 100644 index b8d823757f..0000000000 --- a/ABACUS.develop/source/src_pw/exx_div.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "exx_div.h" -#include "global.h" - -Exx_Divergence::Exx_Divergence() -{ - this->factor = new double[1]; -} - -Exx_Divergence::~Exx_Divergence() -{ - delete[] factor; -} - -void Exx_Divergence::init(void) -{ - // default : use gamma_extrapolation - - this->gamma_extra = true; - - if(this->gamma_extra) - { - this->grid_fac = 8.0 / 7.0; - } - else - { - this->grid_fac = 1.0; - } - return; -} - -// set the factor = 1/|G + k - q|^2 -// and then deal with the divergence term. -void Exx_Divergence::get_factor(const int &ik, const int &iq) -{ - delete[] factor; - this->factor = new double[wf.npw]; - - static double e2 = 2.0; // in Rydberg unit. - const double multi = e2 * FOUR_PI / ucell.tpiba2; - - if(pw.gstart==1) - { - factor[0] = 141.966625802957; // tmp - //factor[0] = 0.0; - } - - for(int ig=pw.gstart; igfactor[ig] = multi / ( pw.gcar[ig] + kv.kvec_c[ik] - kv.kvec_c[iq] ).norm2() * grid_fac; - // cout << " ig=" << ig << " factor=" << factor[ig] << endl; - } - //QUIT(); - - - return; -} diff --git a/ABACUS.develop/source/src_pw/exx_div.h b/ABACUS.develop/source/src_pw/exx_div.h deleted file mode 100644 index f8311e7730..0000000000 --- a/ABACUS.develop/source/src_pw/exx_div.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef EXX_DIV_H -#define EXX_DIV_H - -class Exx_Divergence -{ - public: - - Exx_Divergence(); - ~Exx_Divergence(); - - void init(void); - void get_factor(const int &ik, const int &iq); - - - double* factor; - - private: - - bool gamma_extra; - double grid_fac; - - -}; - -#endif diff --git a/ABACUS.develop/source/src_pw/exx_global.h b/ABACUS.develop/source/src_pw/exx_global.h new file mode 100644 index 0000000000..47d8f4b49c --- /dev/null +++ b/ABACUS.develop/source/src_pw/exx_global.h @@ -0,0 +1,41 @@ +#ifndef EXX_GLOBAL_H +#define EXX_GLOBAL_H + +#include "src_pw/xc_type.h" + +struct Exx_Global +{ + enum class Hybrid_Type {No,HF,PBE0,HSE,Generate_Matrix}; + struct Exx_Info + { + Exx_Global::Hybrid_Type hybrid_type; + + double hybrid_alpha = 0.25; + double hse_omega = 0.11; + + bool separate_loop = true; + size_t hybrid_step = 1; + + void set_xcfunc( xcfunc &xcf ) const + { + switch( hybrid_type ) + { + case Exx_Global::Hybrid_Type::HF: + xcf.iexch_now=5; xcf.igcx_now=0; + xcf.icorr_now=0; xcf.igcc_now=0; + break; + case Exx_Global::Hybrid_Type::PBE0: + xcf.iexch_now=6; xcf.igcx_now=8; + break; + case Exx_Global::Hybrid_Type::HSE: + xcf.iexch_now=9; xcf.igcx_now=12; + break; + default: + throw invalid_argument(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + } + } + }; + Exx_Info info; +}; + +#endif diff --git a/ABACUS.develop/source/src_pw/exx_lip.cpp b/ABACUS.develop/source/src_pw/exx_lip.cpp new file mode 100644 index 0000000000..d7ab7c6719 --- /dev/null +++ b/ABACUS.develop/source/src_pw/exx_lip.cpp @@ -0,0 +1,929 @@ +//========================================================== +// AUTHOR : Peize Lin +// DATE : 2015-03-10 +//========================================================== + +#include "exx_lip.h" +#include "src_global/global_function.h" +#include "src_global/vector3.h" +#include "src_pw/global.h" +#include "src_pw/klist.h" +#include "src_pw/wavefunc.h" +#include "src_pw/wavefunc_in_pw.h" +#include "src_global/lapack_connector.h" +#include + +#include "src_external/src_test/test_function.h" + +Exx_Lip::Exx_Lip( const Exx_Global::Exx_Info &info_global ) + :init_finish(false), + info(info_global), + exx_matrix(NULL), + exx_energy(0){} + +Exx_Lip::Exx_Info::Exx_Info( const Exx_Global::Exx_Info &info_global ) + :hybrid_type(info_global.hybrid_type), + hse_omega(info_global.hse_omega){} + +void Exx_Lip::cal_exx() +{ + TITLE("Exx_Lip","cal_exx"); + auto my_time = [](timeval &t_begin) -> double + { + const double time_during = cal_time(t_begin); + gettimeofday(&t_begin, NULL); + return time_during; + }; + auto cout_t = [](const string &name, const double t) + { + cout<kv_ptr->nks; ++ik) + { + phi_cal(k_pack, ik); +t_phi_cal += my_time(t); + + judge_singularity(ik); + for( int iw_l=0; iw_lkv_ptr->nks/NSPIN; ++iq_tmp) // !!! k_point parallel incompleted. need to loop iq in other pool + { + int iq = (ik<(k_pack->kv_ptr->nks/NSPIN)) ? (iq_tmp%(q_pack->kv_ptr->nks/NSPIN)) : (iq_tmp%(q_pack->kv_ptr->nks/NSPIN)+(q_pack->kv_ptr->nks/NSPIN)); + qkg2_exp(ik, iq); +t_qkg2_exp += my_time(t); + for( int ib=0; ibkv_ptr->nks; ++ik) + { + phi_cal(k_pack, ik); + + judge_singularity(ik); + for( int iw_l=0; iw_lkv_ptr->nks/NSPIN; ++iq_tmp) // !!! k_point parallel incompleted. need to loop iq in other pool + { + int iq = (ik<(k_pack->kv_ptr->nks/NSPIN)) ? (iq_tmp%(q_pack->kv_ptr->nks/NSPIN)) : (iq_tmp%(q_pack->kv_ptr->nks/NSPIN)+(q_pack->kv_ptr->nks/NSPIN)); + qkg2_exp(ik, iq); + for( int ib=0; ibkv_ptr = kv_ptr_in; + k_pack->wf_ptr = wf_ptr_in; + pw_ptr = pw_ptr_in; + UFFT_ptr = UFFT_ptr_in; + ucell_ptr = ucell_ptr_in; + + int gzero_judge(-1); + if (pw_ptr->gcar[0]==Vector3(0.0,0.0,0.0)) + { + gzero_judge = RANK_IN_POOL; + } + MPI_Allreduce(&gzero_judge, &gzero_rank_in_pool, 1, MPI_INT, MPI_MAX, POOL_WORLD); + + k_pack->wf_wg.create(k_pack->kv_ptr->nks,NBANDS); + + k_pack->hvec_array = new ComplexMatrix [k_pack->kv_ptr->nks]; + for( int ik=0; ikkv_ptr->nks; ++ik) + { + k_pack->hvec_array[ik].create(NLOCAL,NBANDS); + } + + if (pot.start_pot=="atomic") + { + q_pack = k_pack; + } + else if(pot.start_pot=="file") + { + read_q_pack(); + } + + phi = new complex*[NLOCAL]; + for( int iw=0; iw[pw_ptr->nrxx]; + } + + psi = new complex**[q_pack->kv_ptr->nks]; + for( int iq=0; iqkv_ptr->nks; ++iq) + { + psi[iq] = new complex *[NBANDS]; + for( int ib=0; ib[pw_ptr->nrxx]; + } + } + + recip_qkg2 = new double [pw_ptr->ngmc]; + + b = new complex [NLOCAL*pw_ptr->ngmc]; + + sum1 = new complex [NLOCAL*NLOCAL]; + + if( Exx_Global::Hybrid_Type::HF==info.hybrid_type || Exx_Global::Hybrid_Type::PBE0==info.hybrid_type ) + if(gzero_rank_in_pool==RANK_IN_POOL) + { + b0 = new complex [NLOCAL]; + sum3 = new complex *[NLOCAL]; + for( int iw_l=0; iw_l [NLOCAL]; + } + } + else + { + b0 = NULL; + sum3 = NULL; + } + else + { + b0 = NULL; + sum3 = NULL; + } + + exx_matrix = new complex **[k_pack->kv_ptr->nks]; + for( int ik=0; ikkv_ptr->nks; ++ik) + { + exx_matrix[ik] = new complex*[NLOCAL]; + for( int iw_l=0; iw_l[NLOCAL]; + } + } + } + catch(const std::bad_alloc &ex) + { + WARNING_QUIT("exact_exchange","Memory"); + } + + init_finish = true; +} + +Exx_Lip::~Exx_Lip() +{ + TITLE("Exx_Lip","~Exx_Lip"); + if( init_finish) + { + for( int iw=0; iwkv_ptr->nks;++iq) + { + for( int ib=0;ibkv_ptr->nks; ++ik) + { + for( int iw_l=0; iw_lhvec_array; k_pack->hvec_array=NULL; + delete k_pack; + + if (pot.start_pot=="atomic") + { + q_pack = NULL; + } + else if(pot.start_pot=="file") + { + delete q_pack->kv_ptr; q_pack->kv_ptr=NULL; + delete q_pack->wf_ptr; q_pack->wf_ptr=NULL; + delete[] q_pack->hvec_array; q_pack->hvec_array=NULL; + delete q_pack; q_pack=NULL; + } + } +} + +void Exx_Lip::wf_wg_cal() +{ + TITLE("Exx_Lip","wf_wg_cal"); + if(NSPIN==1) + for( int ik=0; ikkv_ptr->nks; ++ik) + for( int ib=0; ibwf_wg(ik,ib) = k_pack->wf_ptr->wg(ik,ib)/2; + else if(NSPIN==2) + for( int ik=0; ikkv_ptr->nks; ++ik) + for( int ib=0; ibwf_wg(ik,ib) = k_pack->wf_ptr->wg(ik,ib); +} + +void Exx_Lip::phi_cal(k_package *kq_pack, int ikq) +{ + for( int iw=0; iw< NLOCAL; ++iw) + { + ZEROS( UFFT_ptr->porter, pw_ptr->nrxx ); + for( int ig=0; igkv_ptr->ngk[ikq]; ++ig) + UFFT_ptr->porter[ pw_ptr->ig2fftw[kq_pack->wf_ptr->igk(ikq,ig)] ] = kq_pack->wf_ptr->wanf2[ikq](iw,ig); + pw_ptr->FFT_wfc.FFT3D(UFFT_ptr->porter,1); + int ir(0); + for( int ix=0; ixncx; ++ix) + { + const double phase_x = kq_pack->kv_ptr->kvec_d[ikq].x * ix / pw_ptr->ncx; + for( int iy=0; iyncy; ++iy) + { + const double phase_xy = phase_x + kq_pack->kv_ptr->kvec_d[ikq].y * iy / pw_ptr->ncy; + for( int iz=pw_ptr->nczp_start; iznczp_start+pw_ptr->nczp; ++iz) + { + const double phase_xyz = phase_xy + kq_pack->kv_ptr->kvec_d[ikq].z * iz / pw_ptr->ncz; + const complex exp_tmp = exp(phase_xyz*TWO_PI*IMAG_UNIT); + phi[iw][ir] = UFFT_ptr->porter[ir]*exp_tmp; + ++ir; + } + } + } + } +} + +void Exx_Lip::psi_cal() +{ + TITLE("Exx_Lip","psi_cal"); + if (pot.start_pot=="atomic") + { + for( int iq = 0; iq < q_pack->kv_ptr->nks; ++iq) + { + for( int ib = 0; ib < NBANDS; ++ib) + { + ZEROS( UFFT_ptr->porter, pw_ptr->nrxx ); + for( int ig = 0; ig < q_pack->kv_ptr->ngk[iq] ; ++ig) + { + UFFT_ptr->porter[ pw_ptr->ig2fftw[q_pack->wf_ptr->igk(iq,ig)] ] = q_pack->wf_ptr->evc[iq](ib,ig); + } + pw_ptr->FFT_wfc.FFT3D(UFFT_ptr->porter,1); + int ir(0); + for( int ix=0; ixncx; ++ix) + { + const double phase_x = q_pack->kv_ptr->kvec_d[iq].x * ix / pw_ptr->ncx; + for( int iy=0; iyncy; ++iy) + { + const double phase_xy = phase_x + q_pack->kv_ptr->kvec_d[iq].y * iy / pw_ptr->ncy; + for( int iz=pw_ptr->nczp_start; iznczp_start+pw_ptr->nczp; ++iz) + { + const double phase_xyz = phase_xy + q_pack->kv_ptr->kvec_d[iq].z * iz / pw_ptr->ncz; + const complex exp_tmp = exp(phase_xyz*TWO_PI*IMAG_UNIT); + psi[iq][ib][ir] = UFFT_ptr->porter[ir]*exp_tmp; + ++ir; + } + } + } + } + } + } + else if(pot.start_pot=="file") + { + for( int iq=0; iqkv_ptr->nks; ++iq) + { + phi_cal( q_pack, iq); + for( int ib=0; ibnrxx); + for( int iw=0; iwnrxx; ++ir) + { + psi[iq][ib][ir] += q_pack->hvec_array[iq](iw,ib) * phi[iw][ir]; + } + } + } + } + } +/////////////////////////////////////////////////////////////////////////// +// !!! k_point parallel incompleted. need to loop iq in other pool +/////////////////////////////////////////////////////////////////////////// +} + +void Exx_Lip::judge_singularity( int ik) +{ + if (pot.start_pot=="atomic") + { + iq_vecik = ik; + } + else if(pot.start_pot=="file") + { + double min_q_minus_k(numeric_limits::max()); + for( int iq=0; iqkv_ptr->nks; ++iq) + { + const double q_minus_k ( (q_pack->kv_ptr->kvec_c[iq] - k_pack->kv_ptr->kvec_c[ik]).norm2() ); + if(q_minus_k < min_q_minus_k) + { + min_q_minus_k = q_minus_k; + iq_vecik = iq; + } + } + } +} + + +void Exx_Lip::qkg2_exp(int ik, int iq) +{ + for( int ig=0; igngmc; ++ig) + { + const double qkg2 = ( (q_pack->kv_ptr->kvec_c[iq] - k_pack->kv_ptr->kvec_c[ik] + pw_ptr->gcar[ig]) *(TWO_PI/ucell_ptr->lat0)).norm2(); + if( (Exx_Global::Hybrid_Type::PBE0==info.hybrid_type) || (Exx_Global::Hybrid_Type::HF==info.hybrid_type) ) + { + if( abs(qkg2)<1e-10 ) + recip_qkg2[ig] = 0.0; // 0 to ignore bb/qkg2 when qkg2==0 + else + recip_qkg2[ig] = 1.0/qkg2; + sum2_factor += recip_qkg2[ig] * exp(-info.lambda*qkg2) ; + recip_qkg2[ig] = sqrt(recip_qkg2[ig]); + } + else if(Exx_Global::Hybrid_Type::HSE==info.hybrid_type) + { + if( abs(qkg2)<1e-10 ) + recip_qkg2[ig] = 1.0/(2*info.hse_omega); + else + recip_qkg2[ig] = sqrt( (1-exp(-qkg2/(4*info.hse_omega*info.hse_omega))) /qkg2); + } + } +} + + +void Exx_Lip::b_cal( int ik, int iq, int ib) +{ + const Vector3 q_minus_k = q_pack->kv_ptr->kvec_d[iq] - k_pack->kv_ptr->kvec_d[ik]; + vector > mul_tmp(pw_ptr->nrxx); + for( size_t ir=0,ix=0; ixncx; ++ix) + { + const double phase_x = q_minus_k.x*ix/pw_ptr->ncx; + for( size_t iy=0; iyncy; ++iy) + { + const double phase_xy = phase_x + q_minus_k.y*iy/pw_ptr->ncy; + for( size_t iz=pw_ptr->nczp_start; iznczp_start+pw_ptr->nczp; ++iz) + { + const double phase_xyz = phase_xy + q_minus_k.z*iz/pw_ptr->ncz; + mul_tmp[ir] = exp(-phase_xyz*TWO_PI*IMAG_UNIT); + mul_tmp[ir] *= psi[iq][ib][ir]; + ++ir; + } + } + } + + complex * const porter = UFFT_ptr->porter; + const int * const ig2fftc = pw_ptr->ig2fftc; + for(size_t iw=0; iw< NLOCAL; ++iw) + { + const complex * const phi_w = phi[iw]; + for( size_t ir=0; irnrxx; ++ir) + { + porter[ir] = conj(phi_w[ir]) * mul_tmp[ir] ; +// porter[ir] = phi_w[ir] * psi_q_b[ir] *exp_tmp[ir] ; + } + pw_ptr->FFT_chg.FFT3D( porter, -1); + if( Exx_Global::Hybrid_Type::HF==info.hybrid_type || Exx_Global::Hybrid_Type::PBE0==info.hybrid_type ) + if((iq==iq_vecik) && (gzero_rank_in_pool==RANK_IN_POOL)) /// need to check while use k_point parallel + b0[iw] = porter[ pw_ptr->ig2fftc[0] ]; + complex * const b_w = b+iw*pw_ptr->ngmc; + for( size_t ig=0; igngmc; ++ig) + b_w[ig] = porter[ ig2fftc[ig] ] * recip_qkg2[ig]; + } +} + + +void Exx_Lip::sum3_cal(int iq, int ib) +{ + if( gzero_rank_in_pool == RANK_IN_POOL ) + for( int iw_l=0; iw_lwf_wg(iq,ib); +} + + +void Exx_Lip::b_sum( int iq, int ib) // Peize Lin change 2019-04-14 +{ + // sum1[iw_l,iw_r] += \sum_{ig} b[iw_l,ig] * conj(b[iw_r,ig]) * q_pack->wf_wg(iq,ib) + LapackConnector::zherk( + 'U','N', + NLOCAL, pw_ptr->ngmc, + q_pack->wf_wg(iq,ib), b, pw_ptr->ngmc, + 1.0, sum1, NLOCAL); +// cblas_zherk( CblasRowMajor, CblasUpper, CblasNoTrans, +// NLOCAL, pw_ptr->ngmc, +// q_pack->wf_wg(iq,ib), static_cast(b), pw_ptr->ngmc, +// 1.0, static_cast(sum1), NLOCAL); +} + +void Exx_Lip::sum_all(int ik) +{ + double sum2_factor_g(0.0); + if( Exx_Global::Hybrid_Type::HF==info.hybrid_type || Exx_Global::Hybrid_Type::PBE0==info.hybrid_type ) + MPI_Reduce( &sum2_factor, &sum2_factor_g, 1, MPI_DOUBLE, MPI_SUM, gzero_rank_in_pool, POOL_WORLD); + + for( size_t iw_l=1; iw_lomega *sum1[iw_l*NLOCAL+iw_r]); + if( Exx_Global::Hybrid_Type::HF==info.hybrid_type || Exx_Global::Hybrid_Type::PBE0==info.hybrid_type ) + if(gzero_rank_in_pool==RANK_IN_POOL) + { + exx_matrix[ik][iw_l][iw_r] += 2.0* (4*PI/ucell_ptr->omega *sum3[iw_l][iw_r] *sum2_factor_g ); + exx_matrix[ik][iw_l][iw_r] += 2.0* (-1/sqrt(info.lambda*PI)*(q_pack->kv_ptr->nks/NSPIN) * sum3[iw_l][iw_r]); + } + } + } +} + +void Exx_Lip::exx_energy_cal() +{ + TITLE("Exx_Lip","exx_energy_cal"); + + double exx_energy_tmp = 0.0; + + for( int ik=0; ikkv_ptr->nks; ++ik) + { + for( int iw_l=0; iw_lhvec_array[ik](iw_l,ib)) *k_pack->hvec_array[ik](iw_r,ib) ).real() *k_pack->wf_wg(ik,ib); + } + } + } + } + MPI_Allreduce( &exx_energy_tmp, &exx_energy, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); // !!! k_point parallel incompleted. different pools have different kv.nks => deadlock + exx_energy *= (NSPIN==1) ? 2 : 1; + exx_energy /= 2; // ETOT = E_band - 1/2 E_exx + + #if TEST_EXX==1 + { + ofstream ofs("exx_matrix.dat",ofstream::app); + static int istep=0; + ofs<<"istep:\t"<kv_ptr->nks; ++ik) + { + ofs<<"ik:\t"<kv_ptr->nks; ++ik) + { + ofs<<"ik:\t"< DM = {0,0}; + for( int ib=0; ibhvec_array[ik](iw_l,ib)) *k_pack->hvec_array[ik](iw_r,ib) *k_pack->wf_wg(ik,ib); + ofs<kv_ptr->nks; ++iq) + { + for( int ib=0; ibwf_wg(iq,ib)<<"\t"; + } + ofs_wf_wg<kv_ptr->nks; ++iq) + { + for( int iw=0; iwhvec_array[iq](iw,ib).real()<<" "<hvec_array[iq](iw,ib).imag()<<" "; + } + ofs_hvec<kv_ptr = new kvect(); + const string exx_kpoint_card = global_out_dir + exx_q_pack + global_kpoint_card; + q_pack->kv_ptr->set( symm, exx_kpoint_card, NSPIN, ucell_ptr->G, ucell_ptr->latvec ); +// q_pack->kv_ptr->set( symm, exx_kpoint_card, NSPIN, ucell_ptr->G, ucell_ptr->latvec, &Pkpoints ); + + + q_pack->wf_ptr = new wavefunc(); + q_pack->wf_ptr->allocate(q_pack->kv_ptr->nks); // mohan update 2021-02-25 +// q_pack->wf_ptr->init(q_pack->kv_ptr->nks,q_pack->kv_ptr,ucell_ptr,pw_ptr,&ppcell,&ORB,&hm,&Pkpoints); + q_pack->wf_ptr->table_local.create(ucell.ntype, ucell.nmax_total, NQX); +// q_pack->wf_ptr->table_local.create(q_pack->wf_ptr->ucell_ptr->ntype, q_pack->wf_ptr->ucell_ptr->nmax_total, NQX); + Wavefunc_in_pw::make_table_q(ORB.orbital_file, q_pack->wf_ptr->table_local); +// Wavefunc_in_pw::make_table_q(q_pack->wf_ptr->ORB_ptr->orbital_file, q_pack->wf_ptr->table_local, q_pack->wf_ptr); + for(int iq=0; iqkv_ptr->nks; ++iq) + { + Wavefunc_in_pw::produce_local_basis_in_pw(iq, q_pack->wf_ptr->wanf2[iq], q_pack->wf_ptr->table_local); +// Wavefunc_in_pw::produce_local_basis_in_pw(iq, q_pack->wf_ptr->wanf2[iq], q_pack->wf_ptr->table_local, q_pack->wf_ptr); + } + + q_pack->wf_wg.create(q_pack->kv_ptr->nks,NBANDS); + if(!RANK_IN_POOL) + { + stringstream ss_wf_wg; + ss_wf_wg << global_out_dir << exx_q_pack << "wf_wg_" << MY_POOL; + ifstream ifs_wf_wg(ss_wf_wg.str().c_str()); + for( int iq = 0; iq < q_pack->kv_ptr->nks; ++iq) + { + for( int ib=0; ib>q_pack->wf_wg(iq,ib); + } + } + ifs_wf_wg.close(); + } + MPI_Bcast( q_pack->wf_wg.c, q_pack->kv_ptr->nks*NBANDS, MPI_DOUBLE, 0, POOL_WORLD); + + q_pack->hvec_array = new ComplexMatrix [q_pack->kv_ptr->nks]; + for( int iq=0; iqkv_ptr->nks; ++iq) + { + q_pack->hvec_array[iq].create(NLOCAL,NBANDS); + } + if(!RANK_IN_POOL) + { + stringstream ss_hvec; + ss_hvec << global_out_dir << exx_q_pack << "hvec_" << MY_POOL; + ifstream ifs_hvec(ss_hvec.str().c_str()); + for( int iq=0; iqkv_ptr->nks; ++iq) + { + for( int iw=0; iw>a>>b; + q_pack->hvec_array[iq](iw,ib) = {a,b}; + } + } + } + ifs_hvec.close(); + } + for( int iq=0; iqkv_ptr->nks; ++iq) + { + MPI_Bcast( q_pack->hvec_array[iq].c, NLOCAL*NBANDS, mpicomplex, 0, POOL_WORLD); + } + + return; +} + +/* +void Exx_Lip::write_q_pack() const +{ + + if( !RANK_IN_POOL ) + { + stringstream ssc; + ssc << global_out_dir << "exx_q_pack_" << MY_POOL; + ofstream ofs(ssc.str().c_str()); + if (!ofs) + { + WARNING("Exx_Lip::write_q_pack","Can't create Exx_Lip File!"); + } + + ofs<kv_ptr->nks<kv_ptr->nks; ++iq) + { + ofs<kv_ptr->ngk[iq]<<" "; + } + ofs<kv_ptr->nks; ++iq) + { + ofs<kv_ptr->nks; ++iq) + { + for( int ib=0; ibkv_ptr->nks; ++iq) + { + for( int iw=0; iw> q_pack->kv_ptr->nks; + } + + MPI_Bcast( &q_pack->kv_ptr->nks, 1, MPI_INT, 0, POOL_WORLD); + + q_pack->kv_ptr->ngk = new int [q_pack->kv_ptr->nks]; + q_pack.kvec_c = new Vector3 [q_pack->kv_ptr->nks]; + q_pack.kvec_d = new Vector3 [q_pack->kv_ptr->nks]; + double *kvec_tmp = new double [q_pack->kv_ptr->nks*6]; // just for MPI + q_pack.wf_wg = new double *[q_pack->kv_ptr->nks]; + for( int iq=0; iqkv_ptr->nks; ++iq) + { + q_pack.wf_wg[iq] = new double[NBANDS]; + } + q_pack.hvec_array = new ComplexMatrix [q_pack->kv_ptr->nks]; + for( int iq=0; iqkv_ptr->nks; ++iq) + { + q_pack.hvec_array[iq].create(NLOCAL,NBANDS); + } + + if( !RANK_IN_POOL ) + { + for( int iq = 0; iq < q_pack->kv_ptr->nks; ++iq) + { + ifs>>q_pack->kv_ptr->ngk[iq]; + } + for( int iq_tmp = 0; iq_tmp < q_pack->kv_ptr->nks*6; ++iq_tmp) + { + ifs>>kvec_tmp[iq_tmp]; + } + for( int iq = 0; iq < q_pack->kv_ptr->nks; ++iq) + { + for( int ib=0; ib>q_pack.wf_wg[iq][ib]; + } + } + for( int iq=0; iqkv_ptr->nks; ++iq) + { + for( int iw=0; iw>q_pack.hvec_array[iq](iw,ib).real()>>q_pack.hvec_array[iq](iw,ib).imag(); + } + } + } + ifs.close(); + } + + MPI_Bcast( q_pack->kv_ptr->ngk, q_pack->kv_ptr->nks, MPI_INT, 0, POOL_WORLD); + MPI_Bcast( kvec_tmp, q_pack->kv_ptr->nks*6, MPI_DOUBLE, 0, POOL_WORLD); + for( int iq=0; iqkv_ptr->nks; ++iq) + { + q_pack.kvec_c[iq].x = kvec_tmp[iq*6+0]; + q_pack.kvec_c[iq].y = kvec_tmp[iq*6+1]; + q_pack.kvec_c[iq].z = kvec_tmp[iq*6+2]; + q_pack.kvec_d[iq].x = kvec_tmp[iq*6+3]; + q_pack.kvec_d[iq].y = kvec_tmp[iq*6+4]; + q_pack.kvec_d[iq].z = kvec_tmp[iq*6+5]; + } + delete[] kvec_tmp; + for( int iq=0; iqkv_ptr->nks; ++iq) + { + MPI_Bcast( q_pack.wf_wg[iq], NBANDS, MPI_DOUBLE, 0, POOL_WORLD); + } + for( int iq=0; iqkv_ptr->nks; ++iq) + { + MPI_Bcast( q_pack.hvec_array[iq].c, NLOCAL*NBANDS, mpicomplex, 0, POOL_WORLD); + } + + + auto test_print = [&]() + { + stringstream sss; + sss << global_out_dir << "exx_q_pack_tmp" << MY_RANK; + ofstream ofs(sss.str().c_str()); + if (!ofs) + { + WARNING("Exx_Lip::write_q_pack","Can't create Exx_Lip File!"); + } + + ofs<kv_ptr->nks<kv_ptr->nks; ++iq) + { + ofs<kv_ptr->ngk[iq]<<" "; + } + ofs<kv_ptr->nks; ++iq) + { + ofs<kv_ptr->nks; ++iq) + { + for( int ib=0; ibkv_ptr->nks; ++iq) + { + for( int iw=0; iw * const * const * get_exx_matrix() const { return exx_matrix; } + double get_exx_energy() const { return exx_energy; } + + void write_q_pack() const; + +private: + + bool init_finish; + + int gzero_rank_in_pool; + + struct k_package + { + kvect *kv_ptr; + wavefunc *wf_ptr; + matrix wf_wg; + ComplexMatrix *hvec_array; + } *k_pack, *q_pack; + + int iq_vecik; + + complex **phi; + complex ***psi; + double *recip_qkg2; + double sum2_factor; + complex *b; + complex *b0; + complex *sum1; + complex **sum3; + + complex ***exx_matrix; + double exx_energy; + + void wf_wg_cal(); + void phi_cal(k_package *kq_pack, int ikq); + void psi_cal(); + void judge_singularity( int ik); + void qkg2_exp(int ik, int iq); + void b_cal(int ik, int iq, int ib); + void sum3_cal(int iq, int ib); + void b_sum(int iq, int ib); + void sum_all(int ik); + void exx_energy_cal(); + void read_q_pack(); + +// mohan comment out 2021-02-24 + friend void Hamilt_PW::cinitcgg(const int ik,const int nstart,const int n_band,const ComplexMatrix &psi,ComplexMatrix &evc,double *en); + +public: + PW_Basis *pw_ptr; + Use_FFT *UFFT_ptr; + UnitCell_pseudo *ucell_ptr; +}; + + +#endif diff --git a/ABACUS.develop/source/src_pw/exx_pw.cpp b/ABACUS.develop/source/src_pw/exx_pw.cpp deleted file mode 100644 index 0b8a3f6f4c..0000000000 --- a/ABACUS.develop/source/src_pw/exx_pw.cpp +++ /dev/null @@ -1,236 +0,0 @@ -#include "exx_pw.h" -#include "global.h" - -Exx_pw::Exx_pw() -{ - ik_now = 0; - alpha = 0.0; - start = false; -} - -Exx_pw::~Exx_pw() -{} - -void Exx_pw::init(bool start_in) -{ - TITLE("Exx_pw","init"); - this->start = start_in; - this->exxdiv.init(); - if(DFT_FUNCTIONAL == "PBE0") - { - this->alpha = 0.25; - } - return; -} - -void Exx_pw::get_exx(void) -{ - TITLE("Exx_pw","get_exx"); - timer::tick("Exx_pw","get_exx"); - - en.exx = 0.0; - - for(int ik=0; ikik_now = ik; - wf.npw = kv.ngk[ik]; - if(NSPIN==2) CURRENT_SPIN = kv.isk[ik]; - - complex *vpsi = new complex[wf.npw]; - complex *psi = new complex[wf.npw]; - - for(int ib=0; ibvxx_psi(psi, vpsi); - - for(int ig=0; ig *psi = new complex[pw.nrxx]; - complex *phi = new complex[pw.nrxx]; - complex *prho = new complex[pw.nrxx]; - en.exx = 0.0; - - for(int ik=0; ikik_now = ik; - wf.npw = kv.ngk[ik]; - for(int ib=0; ibexxdiv.get_factor(ik, iq); - for(int m=0; m - for(int ir=0; ir rho = prho[ pw.ig2fftw[ wf.igk(ik,ig) ] ]; - vc += exxdiv.factor[ig] * ( rho * conj(rho) ).real(); - } - cout << " ib=" << ib << " m=" << m << " vc=" << vc << endl;; - - en.exx = en.exx - this->alpha * vc * ucell.omega * wf.wg(ik,ib) / (double) kv.nkstot; - } // end m - } // end iq - }// end ib - } // end ik - delete[] psi; - delete[] phi; - delete[] prho; - - cout << " Exx = " << en.exx << " (Rydberg)" << endl; - en.exx *= -0.5; - timer::tick("Exx_pw","get_exx2"); - return; -} - -void Exx_pw::vxx_psi(complex* psi_in, complex *hpsi) -{ - return; - if(!start) return; - timer::tick("Exx_pw","vxx_psi"); - - // SUMMARAY : - // Vxx|psi(kn)> = \int dr sum_{mq} psi_mq(r') * psi_mq(r) * phi_kn(r) / |r-r'| - // where the last term, is pair density(pdensity). - - //(2) FFT(psi) - complex *psi = new complex[pw.nrxx]; - ZEROS(psi, pw.nrxx); - for(int ig=0; ig *phi = new complex[pw.nrxx]; - complex *prho = new complex[pw.nrxx]; - complex *denG = new complex[wf.npw]; - const double e2 = 2.0; - - for (int iq=0; iqexxdiv.get_factor(this->ik_now, iq); - for(int n=0; n - for(int ir=0; irexxdiv.factor[ig] * denG[ig] * wf.wg(iq,n) / (double)kv.nkstot; - } - - // (3.5) FFT prho/|r-r'| back to real space - ZEROS(prho, pw.nrxx); - for(int ig=0; igalpha * prho[ pw.ig2fftw[ wf.igk(ik_now, ig) ] ]; - } - - // Vxx_psi(r') = Vpari(r') * psi_{mq}(r') - // note: Vpair is diagnolized in real space, but not in G space, - // this is the same as Vlocal. - // get Vxx_psi(G) according to FFT( Vxx_psi(r') ). - } - } - - delete[] denG; - delete[] prho; - delete[] psi; - delete[] phi; - timer::tick("Exx_pw","vxx_psi"); - return; -} - - diff --git a/ABACUS.develop/source/src_pw/exx_pw.h b/ABACUS.develop/source/src_pw/exx_pw.h deleted file mode 100644 index c98fdc477a..0000000000 --- a/ABACUS.develop/source/src_pw/exx_pw.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef EXX_PW_H -#define EXX_PW_H - -#include "tools.h" -#include "exx_div.h" - -class Exx_pw -{ - public: - - Exx_pw(); - ~Exx_pw(); - - void init(bool start_in); - void get_exx(void); - void get_exx2(void); - void vxx_psi(complex* psi_in, complex *hpsi); - int ik_now; - - private: - - Exx_Divergence exxdiv; - double alpha; // 0.25 for PBE0. - bool start; - -}; - -// If we ignore the divergence term, the error intruduced in total energy -// is proportional to 1/(NQS*Omega) - -// other tricks: -// dexx = fock1 - 0.5 * ( fock + fock2 ) must be converged. -// fock0 = sum -// fock1 = sum -// fock2 = sum - -// -------------- Level 1 ----------------------- -// Target : Implement the H|psi> including exact -// exchange Vx | psi > - -// * need to overview of CG method, see how to do -// h|psi> - -// * need to calculate Vx, which is non-local. -// for eack k point. - -// * calculate the pair density for a k point -// n_{nk,mq}(r) = phi_{mq}(r) * chi_{nk}(r) - -// * solve the singularity problem. - -// -------------- Level 2 ----------------------- -// Target : Can calculate the total energy -// include Ex. - -// -------------- Level 3 ----------------------- -// Target : Implement 0.25 Ex, and PBE0. -// in potential, alphs Ex + (1-alpha) Ex(PBE) -// Ec. And the potential. - -// -------------- Level 4 ----------------------- -// Target : Parallel PBE0. - -// -------------- Level 5 ----------------------- -// Target : Force including PBE0. - -// -------------- Level 6 ----------------------- -// Target : consider HSE03 or B3LYP. -#endif diff --git a/ABACUS.develop/source/src_pw/field_electric.cpp b/ABACUS.develop/source/src_pw/field_electric.cpp deleted file mode 100644 index eed87fcd20..0000000000 --- a/ABACUS.develop/source/src_pw/field_electric.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "field_electric.h" - - diff --git a/ABACUS.develop/source/src_pw/field_electric.h b/ABACUS.develop/source/src_pw/field_electric.h deleted file mode 100644 index 6b153a8880..0000000000 --- a/ABACUS.develop/source/src_pw/field_electric.h +++ /dev/null @@ -1,19 +0,0 @@ -//========================================================== -// AUTHOR : Lixin He, mohan -// DATE : 2008-11-21 -//========================================================== -#ifndef FIELD_ELECTRIC_H -#define FIELD_ELECTRIC_H -#include "tools.h" - -class Field_Electric -{ -public: - Field_Electric(); - ~Field_Electric(); - - - -}; - -#endif diff --git a/ABACUS.develop/source/src_pw/forces.cpp b/ABACUS.develop/source/src_pw/forces.cpp index 4a5a344b96..2b944bf137 100644 --- a/ABACUS.develop/source/src_pw/forces.cpp +++ b/ABACUS.develop/source/src_pw/forces.cpp @@ -2,35 +2,61 @@ #include "global.h" #include "vdwd2.h" #include "vdwd3.h" +#include "symmetry.h" +// new +#include "H_XC_pw.h" double Forces::output_acc = 1.0e-8; // (Ryd/angstrom). -Forces::Forces(const int natom): nat(natom) +Forces::Forces() { } Forces::~Forces() {} #include "efield.h" -void Forces::init() +void Forces::init(matrix& force) { - TITLE("Forces", "init"); - this->force.create(nat, 3); + TITLE("Forces", "init"); + this->nat = ucell.nat; + force.create(nat, 3); - this->cal_force_loc(); - this->cal_force_ew(); - this->cal_force_nl(); - this->cal_force_cc(); - this->cal_force_scc(); - - matrix stress_vdw_pw(3,3);//.create(3,3); - if(vdwd2.vdwD2) //Peize Lin add 2014-04-03, update 2019-04-26 + matrix forcelc(nat, 3); + matrix forceion(nat, 3); + matrix forcecc(nat, 3); + matrix forcenl(nat, 3); + matrix forcescc(nat, 3); + this->cal_force_loc(forcelc); + this->cal_force_ew(forceion); + this->cal_force_nl(forcenl); + this->cal_force_cc(forcecc); + this->cal_force_scc(forcescc); + + matrix stress_vdw_pw;//.create(3,3); + matrix force_vdw; + force_vdw.create(nat, 3); + if(vdwd2_para.flag_vdwd2) //Peize Lin add 2014.04.03, update 2021.03.09 { - vdwd2.force(stress_vdw_pw, STRESS); + Vdwd2 vdwd2(ucell,vdwd2_para); + vdwd2.cal_force(); + for(int iat=0; iatforcelc.create(nat, 3); complex *aux = new complex[pw.nrxx]; ZEROS(aux, pw.nrxx); @@ -332,7 +345,7 @@ void Forces::cal_force_loc(void) { for (int ir=0; ir( chr.rho[is][ir], 0.0 ); + aux[ir] += complex( CHR.rho[is][ir], 0.0 ); } } @@ -344,7 +357,6 @@ void Forces::cal_force_loc(void) // ofs_running << "\n ggs = " << pw.ggs[0]; // ofs_running << "\n gstart_here = " << gstart_here; - int iat = 0; for (int it = 0;it < ucell.ntype;it++) { @@ -362,25 +374,22 @@ void Forces::cal_force_loc(void) } for (int ipol = 0;ipol < 3;ipol++) { - this->forcelc(iat, ipol) *= (ucell.tpiba * ucell.omega); + forcelc(iat, ipol) *= (ucell.tpiba * ucell.omega); } ++iat; } } - //this->print(ofs_running, "local forces", forcelc); Parallel_Reduce::reduce_double_pool(forcelc.c, forcelc.nr * forcelc.nc); - delete[] aux; timer::tick("Forces","cal_force_loc"); return; } - -void Forces::cal_force_ew(void) +#include "H_Ewald_pw.h" +void Forces::cal_force_ew(matrix& forceion) { timer::tick("Forces","cal_force_ew"); - this->forceion.create(nat, 3); double fact = 2.0; complex *aux = new complex [pw.ngmc]; @@ -447,7 +456,7 @@ void Forces::cal_force_ew(void) } for (int ipol = 0;ipol < 3;ipol++) { - this->forceion(iat, ipol) *= ucell.atoms[it].zv * e2 * ucell.tpiba * TWO_PI / ucell.omega * fact; + forceion(iat, ipol) *= ucell.atoms[it].zv * e2 * ucell.tpiba * TWO_PI / ucell.omega * fact; } // cout << " atom" << iat << endl; @@ -488,9 +497,7 @@ void Forces::cal_force_ew(void) if (iat1 != iat2) { Vector3 d_tau = ucell.atoms[T1].tau[I1] - ucell.atoms[T2].tau[I2]; - en.rgen(d_tau, rmax, irr, ucell.latvec, ucell.G, r, r2, nrm); - - + H_Ewald_pw::rgen(d_tau, rmax, irr, ucell.latvec, ucell.G, r, r2, nrm); for (int n = 0;n < nrm;n++) { @@ -500,9 +507,9 @@ void Forces::cal_force_ew(void) * (erfc(sqrt(alpha) * rr) / rr + sqrt(8.0 * alpha / TWO_PI) * exp(-1.0 * alpha * rr * rr)) * ucell.lat0; - this->forceion(iat1, 0) -= factor * r[n].x; - this->forceion(iat1, 1) -= factor * r[n].y; - this->forceion(iat1, 2) -= factor * r[n].z; + forceion(iat1, 0) -= factor * r[n].x; + forceion(iat1, 1) -= factor * r[n].y; + forceion(iat1, 2) -= factor * r[n].z; // cout << " r.z=" << r[n].z << " r2=" << r2[n] << endl; // cout << " " << iat1 << " " << iat2 << " n=" << n @@ -533,13 +540,11 @@ void Forces::cal_force_ew(void) return; } -void Forces::cal_force_cc(void) +void Forces::cal_force_cc(matrix& forcecc) { - this->forcecc.create(nat, 3); - // recalculate the exchange-correlation potential. matrix vxc(NSPIN, pw.nrxx); - pot.v_xc(chr.rho, en.etxc, en.vtxc, vxc); + H_XC_pw::v_xc(pw.nrxx, pw.ncxyz, ucell.omega, CHR.rho, CHR.rho_core, vxc); complex * psiv = new complex [pw.nrxx]; ZEROS(psiv, pw.nrxx); @@ -570,7 +575,7 @@ void Forces::cal_force_cc(void) if (ucell.atoms[T1].nlcc) { //call drhoc - chr.non_linear_core_correction( + CHR.non_linear_core_correction( ppcell.numeric, ucell.atoms[T1].msh, ucell.atoms[T1].r, @@ -621,12 +626,11 @@ void Forces::cal_force_cc(void) return; } -void Forces::cal_force_nl(void) +void Forces::cal_force_nl(matrix& forcenl) { TITLE("Forces","cal_force_nl"); timer::tick("Forces","cal_force_nl"); - this->forcenl.create(nat, 3); const int nkb = ppcell.nkb; if(nkb == 0) return; // mohan add 2010-07-25 @@ -772,10 +776,8 @@ void Forces::cal_force_nl(void) return; } -void Forces::cal_force_scc(void) +void Forces::cal_force_scc(matrix& forcescc) { - forcescc.create(nat, 3); - complex* psic = new complex [pw.nrxx]; ZEROS(psic, pw.nrxx); diff --git a/ABACUS.develop/source/src_pw/forces.h b/ABACUS.develop/source/src_pw/forces.h index bb87f04235..b6ca06255e 100644 --- a/ABACUS.develop/source/src_pw/forces.h +++ b/ABACUS.develop/source/src_pw/forces.h @@ -6,7 +6,7 @@ class Forces { public: - friend class Force_LCAO; + friend class Force_Stress_LCAO; /* This routine is a driver routine which compute the forces * acting on the atoms, the complete forces in plane waves * is computed from 4 main parts @@ -16,28 +16,21 @@ class Forces * (4) cal_nl: contribution due to the non-local pseudopotential. * (4) cal_scc: contributino due to incomplete SCF calculation. */ - Forces(const int natom); + Forces(); ~Forces(); - void init(); + void init(matrix& matrix); - matrix force; private: int nat; static double output_acc; - matrix forcelc; - matrix forceion; - matrix forcecc; - matrix forcenl; - matrix forcescc; - - void cal_force_loc(); - void cal_force_ew(); - void cal_force_cc(); - void cal_force_nl(); - void cal_force_scc(); + void cal_force_loc(matrix& forcelc); + void cal_force_ew(matrix& forceion); + void cal_force_cc(matrix& forcecc); + void cal_force_nl(matrix& forcenl); + void cal_force_scc(matrix& forcescc); static void print( const string &name, const matrix &f, bool rv=true ); static void print_to_files( ofstream &ofs, const string &name, const matrix &f ); diff --git a/ABACUS.develop/source/src_pw/global.cpp b/ABACUS.develop/source/src_pw/global.cpp index d3d3030c36..7c9a3c1871 100644 --- a/ABACUS.develop/source/src_pw/global.cpp +++ b/ABACUS.develop/source/src_pw/global.cpp @@ -1,6 +1,7 @@ //========================================================== // Author: Lixin He,mohan // DATE : 2008-11-6 +// LAST MODIFIED : 2021-01-31 by Mohan //========================================================== #include "global.h" @@ -14,45 +15,27 @@ FFT fftwan; output out; PW_Basis pw; +Stochastic_WF STO_WF; energy en; wavefunc wf; Hamilt hm; -Exx_pw exxpw; - -#ifdef __EPM - -UnitCell_epm ucell; -Potential_EPM epm; -FFT fftsb; -so_pw sopw; -so_smallbox sobox ; -zeeman zm; - -#else - - -#ifdef __FP -//wannier wan; -#endif +Exx_Global exx_global; +Exx_Lip exx_lip(exx_global.info); UnitCell_pseudo ucell; pseudopot_cell_vnl ppcell; xcfunc xcf; -Charge_Broyden chr; +Charge_Broyden CHR; Magnetism mag; -potential pot; -electrons elec; +Potential pot; Symmetry symm; Parallel_Grid Pgrid; //mohan add 2010-06-06 Parallel_Kpoints Pkpoints; // mohan add 2010-06-07 -Vdwd2 vdwd2(ucell); // Peize Lin add 2019-04-26 +Vdwd2_Parameters vdwd2_para; // Peize Lin add 2021-03-09 Vdwd3 vdwd3(ucell); // jiyy add 2019-05-18 -Soc soc;//added by zhengdy-soc - -Restart restart; // Peize Lin add 2020.04.04 - -#endif +Soc soc; //added by zhengdy-soc +Restart restart; // Peize Lin add 2020.04.04 diff --git a/ABACUS.develop/source/src_pw/global.h b/ABACUS.develop/source/src_pw/global.h index 7861da1479..c9039d6d78 100644 --- a/ABACUS.develop/source/src_pw/global.h +++ b/ABACUS.develop/source/src_pw/global.h @@ -1,41 +1,34 @@ //========================================================== - // Author: Lixin He,mohan // DATE : 2008-11-6 +// LAST MODIFIED : 2021-01-31 by Mohan //========================================================== #ifndef GLOBAL_H #define GLOBAL_H -#include "../src_global/global_variable.h" -#include "../src_global/global_function.h" +#include "../run_pw.h" +#include "src_global/global_variable.h" +#include "src_global/global_function.h" #include "pw_basis.h" #include "energy.h" -#include "occupy.h" - -#ifndef __EPM - #include "pseudopot_cell_vnl.h" -#include "../run_frag.h" #include "charge_broyden.h" #include "potential.h" -#include "electrons.h" -#include "functional.h" - -#endif - +#include "xc_type.h" #include "hamilt.h" #include "ions.h" #include "wavefunc.h" #include "use_fft.h" #include "klist.h" -//#include "../src_develop/src_wannier/wan_global.h" -#include "../src_pw/output.h" +#include "../src_io/output.h" #include "magnetism.h" -#include "exx_pw.h" #include "vdwd2.h" -#include "vdwd3.h" +#include "vdwd2_parameters.h" +#include "vdwd3.h" #include "src_global/restart.h" - +#include "exx_global.h" +#include "exx_lip.h" +#include "soc.h" #include "../src_parallel/ft.h" //========================================================== @@ -47,29 +40,12 @@ extern kvect kv; extern output out; extern PW_Basis pw; +extern Stochastic_WF STO_WF; //qianrui add 2021-2-5 extern energy en; extern wavefunc wf; extern Hamilt hm; -extern Exx_pw exxpw; - -// if define epm. -#ifdef __EPM - -#include "../src_epm/potential_epm.h" -#include "../src_epm/unitcell_epm.h" -#include "../src_epm/so_pw.h" -#include "../src_epm/so_smallbox.h" -#include "../src_epm/zeeman.h" - -extern UnitCell_epm ucell; -extern Potential_EPM epm; -extern FFT fftsb; -extern so_pw sopw; -extern so_smallbox sobox; -extern zeeman zm; - -// else, plane wave or first principles -#else +extern Exx_Global exx_global; +extern Exx_Lip exx_lip; #include "symmetry.h" #include "unitcell_pseudo.h" @@ -77,70 +53,19 @@ extern zeeman zm; #include "../src_parallel/parallel_kpoints.h" extern pseudopot_cell_vnl ppcell; extern xcfunc xcf; -extern Charge_Broyden chr; -extern potential pot; -extern electrons elec; -//extern wannier wan; +extern Charge_Broyden CHR; +extern Potential pot; extern Symmetry symm; extern Magnetism mag; extern UnitCell_pseudo ucell; extern Parallel_Grid Pgrid; extern Parallel_Kpoints Pkpoints; - -extern Vdwd2 vdwd2; // Peize Lin add 2019-04-26 +extern Vdwd2_Parameters vdwd2_para; // Peize Lin add 2021.03.09 extern Vdwd3 vdwd3; // jiyy add 2019-05-18 +extern Restart restart; // Peize Lin add 2020.04.04 +extern Soc soc; // zhengdy-soc -extern Restart restart; // Peize Lin add 2020.04.04 - -//zhengdy-soc -#include "soc.h" -extern Soc soc; -#ifdef __FP #include "../src_lcao/global_fp.h" -#endif - -#endif -//========================================================== -// EXPLAIN : from control_flags.f90 -// EXPLAIN : define "GLOBAL VARIABLES" -// EXPLAIN : bool variables ,"l" stands for label. -//========================================================== -//extern bool two_fermi_energies; // TURE : in LSDA calculation case , there are -//extern int isolve; // "2": Davidson or "1": CG diagonalization -//extern double alpha0; // the mixing parameters for the extrapolation -//extern double beta0; // ??? of the starting potential -//extern int ngm0; // used in mix_rho -//extern int nmix; // the number of iteration kept in the history -//extern int iverbosity; // type of printing ( 0 few, 1 all ) -//extern bool lfixatom; // if .TRUE. some atoms is kept fixed -//extern bool lmd; // if .TRUE. the calculation is a dynamics -//extern bool lpath; // if .TRUE. the calculation is a path optimizations -//extern bool lneb; // if .TRUE. the calculation is NEB dynamics -//extern bool lsmd; // if .TRUE. the calculation is string dynamics -//extern bool lwf; // if .TRUE. the calculation is with wannier functions -//extern bool lphonon; // if .TRUE. the calculation is phonon -//extern bool lraman; // if .TRUE. the calculation is raman -//extern bool lconstrain; // if .TRUE. the calculation is constraint -//extern bool ldamped; // if .TRUE. the calculation is a damped dynamics -//extern bool conv_ions; // if .TRUE. ionic convergence has been reached -//extern bool noinv; // if .TRUE. eliminates inversion symmetry -//extern bool reduce_io; // if .TRUE. reduce the I/O to the strict minimum -//extern realArray ns; //(:,:,:,:), the occupation matrix used in h_psi -//extern realArray nsnew; //(:,:,:,:) the occupation matrix computed by at -//extern double eth; // the (corrected) Hubbard contribution -//extern double *Hubbard_U; //(ntypx),the Hubbard U -//extern int Hubbard_lmax; // maximum agular momentum of Hubbard states -//extern ComplexMatrix swfcatom; // = (), -//extern string U_projection; // 'atomic', 'ortho-atomic', 'file' -//extern double magtot; -//extern double absmag; -//extern int current_spin; -//extern matrix f_inp; -//extern matrix tetra; // index of k-points in a given tetrahedron -//extern int ntetra; // specifies how input coordinates are given -//extern bool lberry; -//extern ComplexMatrix becp; // is used in wf,chr,elec. -//extern bool noncolin; #endif diff --git a/ABACUS.develop/source/src_pw/guider.cpp b/ABACUS.develop/source/src_pw/guider.cpp deleted file mode 100644 index 8fbb6f621c..0000000000 --- a/ABACUS.develop/source/src_pw/guider.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "guider.h" - -Guider::Guider(){} - -Guider::~Guider(){} - -void Guider::find_new_parameter(const string &name, T &v) -{ - - - - -} diff --git a/ABACUS.develop/source/src_pw/guider.h b/ABACUS.develop/source/src_pw/guider.h deleted file mode 100644 index 68d2056f78..0000000000 --- a/ABACUS.develop/source/src_pw/guider.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GUIDER_H -#define GUIDER_H - -#include "tools.h" - -class Guider -{ - Guider(); - ~Guider(); - - -}; - -#endif diff --git a/ABACUS.develop/source/src_pw/hamilt.cpp b/ABACUS.develop/source/src_pw/hamilt.cpp index 833b83a2f1..2f65ea2319 100644 --- a/ABACUS.develop/source/src_pw/hamilt.cpp +++ b/ABACUS.develop/source/src_pw/hamilt.cpp @@ -1,38 +1,10 @@ #include "global.h" #include "hamilt.h" -#include "algorithms.h" +#include "diago_cg.h" +#include "diago_david.h" Hamilt::Hamilt() {} -Hamilt::~Hamilt() -{ - if(test_deconstructor) - { - cout << " ~Hamilt()" << endl; - } -} - -#ifdef __EPM -void Hamilt::init(void) -{ - this->hpw.init(); -} -#else -void Hamilt::init(const bool use_pw) -{ - if (test_hm)TITLE("Hamilt","init"); -// ofs_running << " use_pw=" << use_pw << endl; - if (use_pw) - { - this->hpw.init(); - } - return; -} -#endif - -void Hamilt::init_k(const int ik) -{ - this->hpw.init_k(ik); -} +Hamilt::~Hamilt() {} void Hamilt::diago( @@ -44,7 +16,6 @@ void Hamilt::diago( { TITLE("Hamilt","diago"); timer::tick("Hamilt","diago",'F'); -// timer::tick("Hamilt","diago"); double avg = 0.0; // set ik0 because of mem_saver. @@ -52,64 +23,33 @@ void Hamilt::diago( // but if mem_saver is used, ik0=0. int ik0 = ik; - // mohan add 2010-09-07 - // mohan update 2010-09-14, about wanf2 if(CALCULATION=="nscf" && wf.mem_saver==1) { - //if(LOCAL_BASIS==0) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="pw") //xiaohui add 2013-09-02 + if(BASIS_TYPE=="pw") { // generate PAOs first, then diagonalize to get // inital wavefunctions. wf.diago_PAO_in_pw_k2(ik, wf.evc[0]); } - //else if(LOCAL_BASIS==4) xiaohui modify 2013-09-02 - else if(BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-02. Attention! Maybe "BASIS_TYPE==lcao_in_pw" is just ok. + else if(BASIS_TYPE=="lcao_in_pw") { wf.LCAO_in_pw_k(ik, wf.wanf2[0]); } ik0 = 0; } - //if (LOCAL_BASIS) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-02. Attention... + if(BASIS_TYPE=="lcao_in_pw") { - //if(DIAGO_TYPE=="lapack") xiaohui modify 2013-09-02 - if(KS_SOLVER=="lapack") //xiaohui add 2013-09-02 + if(KS_SOLVER=="lapack") { assert(NLOCAL >= NBANDS); this->cinitcgg(ik, NLOCAL, NBANDS, wf.wanf2[ik0], wf.evc[ik0], wf.ekb[ik]); - - /* - cout << " Check evc unit of ik = " << ik0 << endl; - for(int ib=0; ib tmpn = ZERO; - for(int ig=0; ig 0 || istep > 0 || ntry > 0) { @@ -128,11 +67,12 @@ void Hamilt::diago( Diago_CG cg; bool reorder = true; - if(NPOL==1) cg.diag(wf.evc[ik0], wf.ekb[ik], kv.ngk[ik], + + if(NPOL==1) cg.diag(wf.evc[ik0], wf.ekb[ik], kv.ngk[ik], wf.npwx, NBANDS, precondition, ETHR, DIAGO_CG_MAXITER, reorder, notconv, avg); else{ - cg.diag(wf.evc[ik0], wf.ekb[ik], wf.npwx*NPOL, + cg.diag(wf.evc[ik0], wf.ekb[ik], wf.npwx*NPOL, wf.npwx*NPOL, NBANDS, precondition, ETHR, DIAGO_CG_MAXITER, reorder, notconv, avg); } @@ -142,24 +82,26 @@ void Hamilt::diago( // if cinitcgg has not been called, // we need to reorder the eigenvectors. } - //else if ( DIAGO_TYPE=="dav" ) xiaohui modify 2013-09-02 - else if(KS_SOLVER=="dav") //xiaohui add 2013-09-02 - { - Diago_David david; - if(NPOL==1) david.diag(wf.evc[ik0], wf.ekb[ik], kv.ngk[ik], - NBANDS, precondition, DIAGO_DAVID_NDIM, - ETHR, DIAGO_CG_MAXITER, notconv, avg); - else{ - david.diag(wf.evc[ik0], wf.ekb[ik], wf.npwx*NPOL, - NBANDS, precondition, DIAGO_DAVID_NDIM, - ETHR, DIAGO_CG_MAXITER, notconv, avg); - } - } - else - { - //WARNING_QUIT("calculate_bands","Check DIAGO_TYPE !"); xiaohui modify 2013-09-02 - WARNING_QUIT("calculate_bands","Check KS_SOLVER !"); //xiaohui add 2013-09-02 - } + else if(KS_SOLVER=="dav") + { + Diago_David david; + if(NPOL==1) + { + david.diag(wf.evc[ik0], wf.ekb[ik], kv.ngk[ik], + NBANDS, precondition, DIAGO_DAVID_NDIM, + ETHR, DIAGO_CG_MAXITER, notconv, avg); + } + else + { + david.diag(wf.evc[ik0], wf.ekb[ik], wf.npwx*NPOL, + NBANDS, precondition, DIAGO_DAVID_NDIM, + ETHR, DIAGO_CG_MAXITER, notconv, avg); + } + } + else + { + WARNING_QUIT("calculate_bands","Check KS_SOLVER !"); + } avg_iter += avg; ++ntry; } @@ -176,6 +118,7 @@ void Hamilt::diago( return; } + bool Hamilt::test_exit_cond(const int &ntry, const int ¬conv) { //================================================================ @@ -206,172 +149,23 @@ void Hamilt::cinitcgg( ComplexMatrix &evc, double *en) { - // 1 : Local basis or not. - // yes : using cinitcgg - // no : using cinitcgg, then cg method - // - // 2 : Linear scaling or not. - // yes : using - // - // 3 : Lapack using or cg method. - // - // - // 4 : Sparse matrix or not. - // (Default setting : yes for LINEAR SCALING) - // - // LINEAR SCALING: yes( consider set it or not ), no (never do it) - // LOCAL BASIS : yes( consider set it or not), no(never do it) - // - // belong to STORE hamiltonian and overlap. - // Can used for LAPACK for check. - // Formally used for CG method. - // - // In LINEAR SCALING case, - // there are some difference between - // S|psi and H|psi - // - // 5 : belong to CONSTRUCT hamiltonian and overlap. - // only for Local basis = 1 or 2. - // not for Local basis = 0 - // can used for both cg or lapack - // can used for both sparsematrix or complexmatrix - // - // - // Using overlap from SIESTA method - // Using kinetic from SISTA method - // Using non-local from SISTA method - // Local part from SISTA method - // - // Overlap, kinetic and non-local can only do once. - // Local part built up in each iteration - if(nstart < n_band) { WARNING_QUIT("cinitcgg","nstart < n_band!"); } - //if (LINEAR_SCALING && LOCAL_BASIS) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao") //xiaohui add 2013-09-02 - { - WARNING_QUIT("cinitcgg","Diago not doing here."); - } - //else if (!LINEAR_SCALING) xiaohui modify 2013-09-02 - else if(BASIS_TYPE=="pw" || BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-02 + if(BASIS_TYPE=="pw" || BASIS_TYPE=="lcao_in_pw") { this->hpw.cinitcgg(ik, nstart, n_band, psi, evc, en); } else { - //WARNING_QUIT("cinitcgg","Check parameters: LINEAR_SCALING and LOCAL_BASIS. "); xiaohui modify 2013-09-02 - WARNING_QUIT("cinitcgg","Check parameters: BASIS_TYPE. "); //xiaohui add 2013-09-02 + WARNING_QUIT("cinitcgg","Check parameters: BASIS_TYPE. "); } return; } -void Hamilt::h_1psi(const int dim,const complex *psi,complex *hpsi,complex *spsi) -{ - //if (LINEAR_SCALING) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao") //xiaohui add 2013-09-02. Attention! Maybe this change is not reasonable. - { -#ifndef __EPM -#ifdef __FP - timer::tick("Hamilt","Sparse_SH"); - double *psi_real = new double[dim]; - double *hpsi_real = new double[dim]; - double *spsi_real = new double[dim]; - - for (int i=0; ihon.UHM.Sparse_H.multiply_vector(psi_real, hpsi_real); -// this->hon.UOM.Sparse_S.multiply_vector(psi_real, spsi_real); - - for (int i=0; i( spsi_real[i], 0.0 ); - for (int i=0; i( hpsi_real[i], 0.0 ); - - delete[] psi_real; - delete[] hpsi_real; - delete[] spsi_real; - timer::tick("Hamilt","Sparse_SH"); -#endif -#endif - } - else - { - this->hpw.h_1psi(dim, psi, hpsi, spsi); - } - return; -} - -void Hamilt::s_1psi(const int dim, const complex *psi, complex *spsi) -{ - //if (LINEAR_SCALING) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao") //xiaohui add 2013-09-02. Attention! Maybe this change is not reasonable. - { -#ifndef __EPM -#ifdef __FP - timer::tick("Hamilt","Sparse_S"); - double *psi_real = new double[dim]; - double *spsi_real = new double[dim]; - - for (int i=0; ihon.UOM.Sparse_S.multiply_vector(psi_real, spsi_real); - - for (int i=0; i( spsi_real[i] , 0.0 ); - } - - delete[] psi_real; - delete[] spsi_real; - timer::tick("Hamilt","Sparse_S"); -#endif -#endif - } - else - { - this->hpw.s_1psi(dim, psi, spsi); - } - return; -} - -#ifndef __EPM -void Hamilt::h_psi( const int dim, const complex *psi, complex *hpsi) -{ - //if (LINEAR_SCALING) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao") //xiaohui add 2013-09-02. Attention! Maybe this change is not reasonable. - { -#ifdef __FP - timer::tick("Hamilt","Sparse_H"); - double *psi_real = new double[dim]; - double *hpsi_real = new double[dim]; - - for (int i=0; ihon.UHM.Sparse_H.multiply_vector(psi_real, hpsi_real); - - for (int i=0; i( hpsi[i].real(), 0.0 ); - - delete[] psi_real; - delete[] hpsi_real; - timer::tick("Hamilt","Sparse_H"); -#endif - } - else - { - this->hpw.h_psi( psi, hpsi); - } - return; -} -#endif void Hamilt::cdiaghg( const int nstart, @@ -382,7 +176,7 @@ void Hamilt::cdiaghg( double *e, ComplexMatrix &hvec) { - if (test_hm==1) TITLE("Hamilt","cdiaghg"); + TITLE("Hamilt","cdiaghg"); timer::tick("Hamilt","cdiaghg"); //==================================================================== // calculates eigenvalues and eigenvectors of the generalized problem @@ -390,7 +184,6 @@ void Hamilt::cdiaghg( // On output both matrix are unchanged // LAPACK version - uses both ZHEGV and ZHEGVX //===================================================================== -// BLOCK_HERE("cdiaghg"); int lwork; //======================================== @@ -400,20 +193,14 @@ void Hamilt::cdiaghg( ComplexMatrix sdum(nstart, ldh); ComplexMatrix hdum; -// cout << "\n nstart = " << nstart << endl; -// cout << "\n ldh = " << ldh << endl; -// cout << "\n nbands = " << nbands << endl; sdum = sc; const bool all_eigenvalues = (nstart == nbands); -// cout << "\n all eigenvalue = " << all_eigenvalues << endl; - // cout<<"\n dimension = "< *psi,complex *hpsi,complex *spi); - void s_1psi(const int dim,const complex *psi,complex *spsi); - - void h_1psi_real(const int dim,const double *psi,double *hpsi,double *spi); - void s_1psi_real(const int dim,const double *psi, double *spsi); - - void h_psi( const int dim, const complex *psi,complex *hpsi); - Hamilt_PW hpw; -#ifndef __EPM -#ifdef __FP - Hamilt_Linear hon; -#endif -#endif + + // mohan update 2021-02-10 + ORB_control orb_con; + private: bool test_exit_cond( const int &ntry, const int ¬conv); diff --git a/ABACUS.develop/source/src_pw/hamilt_pw.cpp b/ABACUS.develop/source/src_pw/hamilt_pw.cpp index 8f0873f3bf..702e12382c 100644 --- a/ABACUS.develop/source/src_pw/hamilt_pw.cpp +++ b/ABACUS.develop/source/src_pw/hamilt_pw.cpp @@ -1,14 +1,9 @@ -/* hermit.cpp file */ #include "tools.h" #include "global.h" -#include "algorithms.h" #include "hamilt_pw.h" #include "src_global/blas_connector.h" -#include "optical.h" // only get judgement to calculate optical matrix or not. - -#ifdef __EPM -#include "../src_epm/nscf_epm.h" -#endif +#include "../src_io/optical.h" // only get judgement to calculate optical matrix or not. +#include "src_pw/myfunc.h" int Hamilt_PW::moved = 0; @@ -17,64 +12,32 @@ Hamilt_PW::Hamilt_PW() hpsi = new complex[1]; spsi = new complex[1]; GR_index = new int[1]; - -#ifndef __EPM Bec = new complex[1]; Ps = new complex[1]; -#else - GR_index2 = new int[1]; -#endif } Hamilt_PW::~Hamilt_PW() { - if(test_deconstructor) - { - cout << " ~Hamilt_PW()" << endl; - } delete[] hpsi; delete[] spsi; delete[] GR_index; -#ifndef __EPM delete[] Bec; delete[] Ps; -#else - delete[] GR_index2; -#endif } -#ifdef __EPM -void Hamilt_PW::init() -{ - TITLE("Hamilt_PW","init"); - const int nrxxs = pw.nrxxs; - - delete[] hpsi; - delete[] spsi; - delete[] GR_index; - delete[] GR_index2; - this->hpsi = new complex[wf.npwx]; - this->spsi = new complex[wf.npwx]; - this->GR_index = new int[nrxxs]; - this->GR_index2= new int[nrxxs]; - - OUT(ofs_running,"hpsi allocation = ","Done"); - OUT(ofs_running,"spsi allocation = ","Done"); - OUT(ofs_running,"GR_index allocation = ","Done"); - OUT(ofs_running,"GR_index2 allocation = ","Done"); - - ZEROS(hpsi,wf.npwx); - ZEROS(spsi,wf.npwx); - ZEROS(GR_index,wf.npwx); - ZEROS(GR_index2,wf.npwx); - - return; -} -#else -void Hamilt_PW::init(void) +void Hamilt_PW::allocate( + const int &npwx, + const int &npol, + const int &nkb, + const int &nrxx) { - if (test_hm) TITLE("Hamilt_PW","init"); + TITLE("Hamilt_PW","allocate"); + + assert(npwx > 0); + assert(npol > 0); + assert(nkb >=0); + assert(nrxx > 0); delete[] hpsi; delete[] spsi; @@ -82,62 +45,64 @@ void Hamilt_PW::init(void) delete[] Bec; delete[] Ps; - this->hpsi = new complex [wf.npwx * NPOL]; - this->spsi = new complex [wf.npwx * NPOL]; - this->GR_index = new int[pw.nrxxs]; - this->Bec = new complex [ppcell.nkb]; - this->Ps = new complex [ppcell.nkb * NPOL]; + this->hpsi = new complex [npwx * npol]; + this->spsi = new complex [npwx * npol]; + this->GR_index = new int[nrxx]; + this->Bec = new complex [nkb]; + this->Ps = new complex [nkb * npol]; + + ZEROS(this->hpsi, npwx * npol); + ZEROS(this->spsi, npwx * npol); + ZEROS(this->GR_index, nrxx); - ZEROS(this->hpsi,wf.npwx * NPOL); - ZEROS(this->spsi,wf.npwx * NPOL); - ZEROS(this->GR_index, pw.nrxxs); -// ofs_running << "\n Hamiltonian allocate done."< 0 && !LINEAR_SCALING) xiaohui modify 2013-09-02 if(ppcell.nkb > 0 && (BASIS_TYPE=="pw" || BASIS_TYPE=="lcao_in_pw")) //xiaohui add 2013-09-02. Attention... { ppcell.getvnl(ik); } + // (5) The number of wave functions. wf.npw = kv.ngk[ik]; + // (6) The index of plane waves. for (int ig = 0;ig < wf.npw;ig++) { this->GR_index[ig] = pw.ig2fftw[ wf.igk(ik, ig) ]; } - -#ifdef __EPM - for ( int ig=0; ig< wf.npw;ig++) - { - this->GR_index2[ig] = pw.ig2ngg[ wf.igk(ik, ig) ]; - } -#endif return; } -// from cinitcgg.f90 +//---------------------------------------------------------------------- // Hamiltonian diagonalization in the subspace spanned // by nstart states psi (atomic or random wavefunctions). // Produces on output n_band eigenvectors (n_band <= nstart) in evc. +//---------------------------------------------------------------------- void Hamilt_PW::cinitcgg( const int ik, const int nstart, @@ -146,7 +111,7 @@ void Hamilt_PW::cinitcgg( ComplexMatrix &evc, double *en) { - if (test_hm==1) TITLE("Hamilt_PW","cinitcgg"); + TITLE("Hamilt_PW","cinitcgg"); timer::tick("Hamilt_PW","cinitcgg",'G'); assert(nstart!=0); @@ -155,13 +120,54 @@ void Hamilt_PW::cinitcgg( ComplexMatrix hc(nstart, nstart); ComplexMatrix sc(nstart, nstart); ComplexMatrix hvec(nstart,n_band); - + int dmin,dmax; + const int npw = kv.ngk[ik]; + if(!NONCOLIN) + { + dmin= npw; + dmax = wf.npwx; + } + else { + dmin = wf.npwx*NPOL; + dmax = wf.npwx*NPOL; + } + //qianrui improve this part 2021-3-14 + complex *aux=new complex [dmax*nstart]; + complex *paux = aux; + complex *ppsi = psi.c; + for(int m=0;mh_psi(ppsi, paux); + paux += dmax; + ppsi += dmax; + } + char trans1 = 'C'; + char trans2 = 'N'; + zgemm_(&trans1,&trans2,&nstart,&nstart,&dmin,&ONE,psi.c,&dmax,aux,&dmax,&ZERO,hc.c,&nstart); + hc=transpose(hc,false); + zgemm_(&trans1,&trans2,&nstart,&nstart,&dmin,&ONE,psi.c,&dmax,psi.c,&dmax,&ZERO,sc.c,&nstart); + sc=transpose(sc,false); + //After psis are strictly normalized, we should use this part. + //for(int m=1;m **p = new complex*[nstart]; for(int i=0; i[wf.npwx*NPOL]; - else p[i] = new complex[wf.npwx]; + { + p[i] = new complex[wf.npwx*NPOL]; + } + else + { + p[i] = new complex[wf.npwx]; + } } for(int i=0; i* hpsi = new complex[dmin]; complex* spsi = new complex[dmin]; @@ -208,56 +201,89 @@ void Hamilt_PW::cinitcgg( if (m+1just_ddot(dmin, p[j], hpsi); sc(j,m) = this->just_ddot(dmin, p[j], spsi); hc(m, j) = conj(hc(j, m)); sc(m, j) = conj(sc(j, m)); - } // enddo - // timer::tick("Hamilt_PW","zdotc"); + } } - } // enddo + } delete[] hpsi; delete[] spsi; + for(int i=0; i1) { Parallel_Reduce::reduce_complex_double_pool( hc.c, nstart*nstart ); Parallel_Reduce::reduce_complex_double_pool( sc.c, nstart*nstart ); } -// timer::tick("Hamilt_PW","reduce"); - for(int i=0; i pw.gcar[0] = " << " " << pw.gcar[0].x << " " << pw.gcar[0].y << " " << pw.gcar[0].z << endl; + + // Peize Lin add 2019-03-09 + if("lcao_in_pw"==BASIS_TYPE) + { + switch(exx_global.info.hybrid_type) + { + case Exx_Global::Hybrid_Type::HF: + case Exx_Global::Hybrid_Type::PBE0: + case Exx_Global::Hybrid_Type::HSE: + exx_lip.k_pack->hvec_array[ik] = hvec; + break; + } + } + //======================= //diagonize the H-matrix //======================= - if (test_hm > 2) - { +// for tests +/* cout << setprecision(3); out.printV3(ofs_running,kv.kvec_c[ik]); out.printcm_norm("sc",sc,1.0e-4); out.printcm_norm("hvec",hvec,1.0e-4); out.printcm_norm("hc",hc,1.0e-4); cout << endl; - } -// cout << " ----------------------------- ik=" << ik << endl; -// out.printV3( kv.kvec_c[ik] ); -// cout << " cinitcgg" << endl; +*/ + cout << setprecision(5); //-------------------------- @@ -298,17 +324,15 @@ void Hamilt_PW::cinitcgg( // KEEP THIS BLOCK FOR TESTS //-------------------------- -// cout << "OUTPUT Overlap Matrix = " << setprecision(6); - //if(LOCAL_BASIS==4 && CALCULATION=="nscf" && !Optical::opt_epsilon2) xiaohui modify 2013-09-02 - if((BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") && CALCULATION=="nscf" && !Optical::opt_epsilon2) //xiaohui add 2013-09-02. Attention! + if((BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") && CALCULATION=="nscf" && !Optical::opt_epsilon2) { ofs_running << " Not do zgemm to get evc." << endl; } - //else if(LOCAL_BASIS==4 && ( CALCULATION == "scf" || CALCULATION == "md") ) xiaohui modify 2013-09-02 - else if((BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") && ( CALCULATION == "scf" || CALCULATION == "md" || CALCULATION == "relax")) //pengfei 2014-10-13 + else if((BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") + && ( CALCULATION == "scf" || CALCULATION == "md" || CALCULATION == "relax")) //pengfei 2014-10-13 { - // because psi and evc is different here, + // because psi and evc are different here, // I think if psi and evc is the same, // there may be problems, mohan 2011-01-01 char transa = 'N'; @@ -329,8 +353,22 @@ void Hamilt_PW::cinitcgg( } else { - /* As the evc and psi may refer to the same matrix, we first - * create a temporary matrix to story the result. (by wangjp) */ + // As the evc and psi may refer to the same matrix, we first + // create a temporary matrix to story the result. (by wangjp) + //qianrui improve this part 2021-3-13 + char transa = 'N'; + char transb = 'T'; + ComplexMatrix evctmp(n_band, dmin,false); + zgemm_(&transa,&transb,&dmin,&n_band,&nstart,&ONE,psi.c,&dmax,hvec.c,&n_band,&ZERO,evctmp.c,&dmin); + for(int ib=0; ib pw.gcar[0] = " << " " << pw.gcar[0].x << " " << pw.gcar[0].y << " " << pw.gcar[0].z << endl; return; -} //end subroutine cinitcgg +} + void Hamilt_PW::h_1psi( const int npw_in, const complex < double> *psi, complex *hpsi, complex < double> *spsi) { -#ifdef __EPM - nscf_epm::hpsi(psi, hpsi); -#else this->h_psi(psi, hpsi); -#endif for (int i=0;i *psi, return; } + void Hamilt_PW::s_1psi ( const int dim, @@ -426,7 +462,6 @@ void Hamilt_PW::s_1psi } -#ifndef __EPM void Hamilt_PW::h_psi(const complex *psi_in, complex *hpsi) { timer::tick("Hamilt_PW","h_psi",'H'); @@ -447,7 +482,8 @@ void Hamilt_PW::h_psi(const complex *psi_in, complex *hpsi) hpsi[ig] = wf.g2kin[ig] * psi_in[ig]; } //added by zhengdy-soc - if(NSPIN==4){ + if(NSPIN==4) + { for (ig = wf.npwx;ig < wf.npw + wf.npwx;ig++) { hpsi[ig] = wf.g2kin[ig - wf.npwx] * psi_in[ig]; @@ -460,9 +496,10 @@ void Hamilt_PW::h_psi(const complex *psi_in, complex *hpsi) //------------------------------------ if(VL_IN_H) { - if(NSPIN!=4){ - ZEROS( UFFT.porter, pw.nrxxs); - UFFT.RoundTrip( psi_in, pot.vrs1, GR_index, UFFT.porter ); + if(NSPIN!=4) + { + ZEROS( UFFT.porter, pw.nrxx); + UFFT.RoundTrip( psi_in, pot.vr_eff1, GR_index, UFFT.porter ); for (j = 0;j < wf.npw;j++) { @@ -471,9 +508,9 @@ void Hamilt_PW::h_psi(const complex *psi_in, complex *hpsi) } else { - complex* porter1 = new complex[pw.nrxxs]; - ZEROS( UFFT.porter, pw.nrxxs); - ZEROS( porter1, pw.nrxxs); + complex* porter1 = new complex[pw.nrxx]; + ZEROS( UFFT.porter, pw.nrxx); + ZEROS( porter1, pw.nrxx); for (int ig=0; ig< wf.npw; ig++) { UFFT.porter[ GR_index[ig] ] = psi_in[ig]; @@ -485,10 +522,10 @@ void Hamilt_PW::h_psi(const complex *psi_in, complex *hpsi) complex sup,sdown; for (int ir=0; ir< pw.nrxx; ir++) { - sup = UFFT.porter[ir] * (pot.vrs(0,ir) + pot.vrs(3,ir)) + - porter1[ir] * (pot.vrs(1,ir) - complex(0.0,1.0) * pot.vrs(2,ir)); - sdown = porter1[ir] * (pot.vrs(0,ir) - pot.vrs(3,ir)) + - UFFT.porter[ir] * (pot.vrs(1,ir) + complex(0.0,1.0) * pot.vrs(2,ir)); + sup = UFFT.porter[ir] * (pot.vr_eff(0,ir) + pot.vr_eff(3,ir)) + + porter1[ir] * (pot.vr_eff(1,ir) - complex(0.0,1.0) * pot.vr_eff(2,ir)); + sdown = porter1[ir] * (pot.vr_eff(0,ir) - pot.vr_eff(3,ir)) + + UFFT.porter[ir] * (pot.vr_eff(1,ir) + complex(0.0,1.0) * pot.vr_eff(2,ir)); UFFT.porter[ir] = sup; porter1[ir] = sdown; } @@ -512,9 +549,19 @@ void Hamilt_PW::h_psi(const complex *psi_in, complex *hpsi) { if ( ppcell.nkb > 0) { - complex *becp = new complex[ ppcell.nkb * NPOL ]; + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //qianrui improve 2021-3-16 + int nkb=ppcell.nkb; + ComplexMatrix becp(NPOL,nkb,false); + char transa = 'C'; + char transb = 'N'; + zgemm_(&transa,&transb,&nkb,&NPOL,&wf.npw,&ONE,ppcell.vkb.c,&wf.npwx,psi_in,&wf.npwx,&ZERO,becp.c,&nkb); + becp=transpose(becp,false); + Parallel_Reduce::reduce_complex_double_pool( becp.c, ppcell.nkb * NPOL); + this->add_vuspsi(hpsi, becp.c); + //====================================================================== + /*complex *becp = new complex[ ppcell.nkb * NPOL ]; ZEROS(becp,ppcell.nkb * NPOL); - //zgemm('N','C',1,ppcell.nkb,wf.npw,ONE,psi,1,ppcell.vkb,ppcell.nkb,ZERO,becp,1); for (i=0;i< ppcell.nkb;i++) { const complex* p = &ppcell.vkb(i,0); @@ -522,33 +569,24 @@ void Hamilt_PW::h_psi(const complex *psi_in, complex *hpsi) const complex* psip = psi_in; for (;padd_vuspsi(hpsi, becp); - delete[] becp; + delete[] becp;*/ + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> } } - // mohan add 2010-07-22 - if( DFT_FUNCTIONAL == "PBE0" ) - { - //exxpw.vxx_psi(psi_in, hpsi); - } - timer::tick("Hamilt_PW","h_psi",'H'); return; } -#endif -#ifndef __EPM void Hamilt_PW::add_vuspsi(complex *hpsi_in,const complex *becp) { timer::tick("Hamilt_PW","add_vuspsi",'I'); @@ -571,16 +609,16 @@ void Hamilt_PW::add_vuspsi(complex *hpsi_in,const complex *becp) { for (int ip2=0; ip2Ps[sum+ip2] += ppcell.deeq(CURRENT_SPIN, iat, ip, ip2) * becp[sum+ip]; - else - { - this->Ps[sum+ ip2*2] += ppcell.deeq_nc(0, iat, ip2, ip) * becp[sum+ip*2] + if(NSPIN!=4) + this->Ps[sum+ip2] += ppcell.deeq(CURRENT_SPIN, iat, ip, ip2) * becp[sum+ip]; + else + { + this->Ps[sum+ ip2*2] += ppcell.deeq_nc(0, iat, ip2, ip) * becp[sum+ip*2] +ppcell.deeq_nc(1, iat, ip2, ip) * becp[sum+ip*2+1]; - this->Ps[sum+ ip2*2+1] += ppcell.deeq_nc(2, iat, ip2, ip) * becp[sum+ip*2] + this->Ps[sum+ ip2*2+1] += ppcell.deeq_nc(2, iat, ip2, ip) * becp[sum+ip*2] +ppcell.deeq_nc(3, iat, ip2, ip) * becp[sum+ip*2+1]; - } - }// end ih + } + }// end ih }//end jh if(NSPIN!=4) sum += Nprojs; else sum += 2 * Nprojs; @@ -600,7 +638,13 @@ void Hamilt_PW::add_vuspsi(complex *hpsi_in,const complex *becp) // use simple method. - if(NSPIN!=4) + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //qianrui improve 2021-3-16 + char transa = 'N'; + char transb = 'T'; + zgemm_(&transa,&transb,&wf.npw,&NPOL,&ppcell.nkb,&ONE,ppcell.vkb.c,&wf.npwx,Ps,&NPOL,&ONE,hpsi_in,&wf.npwx); + //====================================================================== + /*if(!NONCOLIN) for(int i=0; i* p = &ppcell.vkb(i,0); @@ -625,14 +669,12 @@ void Hamilt_PW::add_vuspsi(complex *hpsi_in,const complex *becp) hp[0] += psp[0] * (p[0]); hp1[0] += psp[1] * (p[0]); } - } + }*/ + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -// zgemm('N', 'N', 1, wf.npw, ppcell.nkb, ONE, this->Ps , 1, ppcell.vkb, -// ppcell.nkb, ONE, hpsi , 1); timer::tick("Hamilt_PW","add_vuspsi",'I'); return; } -#endif void Hamilt_PW::diag_zheev(const int &npw_in, ComplexMatrix &psi, const int &nband, double *em, double *err) { @@ -871,13 +913,25 @@ double Hamilt_PW::ddot_real const complex* psi_R )const { - complex result(0,0); + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //qianrui modify 2021-3-14 + //Note that ddot_(2*dim,a,1,b,1) = REAL( zdotc_(dim,a,1,b,1) ) + int dim2=2*dim; + double *pL,*pR; + pL=(double *)psi_L; + pR=(double *)psi_R; + double result=LapackConnector::dot(dim2,pL,1,pR,1); + Parallel_Reduce::reduce_double_pool( result ); + return result; + //====================================================================== + /*complex result(0,0); for (int i=0;i>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> } complex Hamilt_PW::ddot( @@ -897,7 +951,7 @@ complex Hamilt_PW::ddot( Parallel_Reduce::reduce_complex_double_pool( result ); } return result; -} // end of ddot +} complex Hamilt_PW::just_ddot( const int & dim, @@ -906,8 +960,7 @@ complex Hamilt_PW::just_ddot( )const { complex result = ZERO; - //const int incx = 1; - //const int incy = 1; + // mohan add 2010-10-11 // zdotc_(&result, &dim, psi_L, &incx, psi_R, &incy); @@ -923,8 +976,9 @@ complex Hamilt_PW::just_ddot( { result += conj(psi_L[i])*psi_R[i]; } + return result; -} // end of ddot +} diff --git a/ABACUS.develop/source/src_pw/hamilt_pw.h b/ABACUS.develop/source/src_pw/hamilt_pw.h index d0d088a9f4..6113c5ae32 100644 --- a/ABACUS.develop/source/src_pw/hamilt_pw.h +++ b/ABACUS.develop/source/src_pw/hamilt_pw.h @@ -3,30 +3,21 @@ #include "tools.h" -//#if defined __FFTW2 -//#include "../src_parallel/fftw.h" -//#elif defined __FFTW3 -//#include "../src_parallel/fftw3.h" -//#endif - class Hamilt_PW { + public: + Hamilt_PW(); ~Hamilt_PW(); static int moved; - void init(void); - - void diag_zheev - ( - const int& npw, - ComplexMatrix& psi, - const int& nband, - double *em, - double *err - ) ; + void allocate( + const int &npwx, // number of plane wave (max) + const int &npol, // polarization + const int &nkb, // number of non-local pseudopotential projectors + const int &nrxx); // number of grids on this processor void cal_err ( @@ -39,6 +30,13 @@ class Hamilt_PW void init_k(const int ik); + private: + + friend class Diago_David; + friend class Diago_CG; + friend class Exx_Lip; + friend class Hamilt; + void cinitcgg(const int ik, const int nstart, const int nbnd, @@ -52,20 +50,16 @@ class Hamilt_PW complex *hpsi, complex *spsi); -#ifndef __EPM void h_psi( const complex *psi, complex *hpsi); -#endif void s_1psi( const int npw, const complex < double> *psi, complex < double> *spsi); - int test; - double ddot_real( const int& npw, const complex* psi_L, const complex* psi_R)const; + private: int *GR_index; - int *GR_index2; complex *psi_one; @@ -76,10 +70,11 @@ class Hamilt_PW complex *Bec; complex *Ps; -#ifndef __EPM void add_vuspsi(complex *hpsi, const complex *becp); -#endif + private: + + double ddot_real( const int& npw, const complex* psi_L, const complex* psi_R)const; complex ddot( const int& npw, @@ -94,6 +89,18 @@ class Hamilt_PW const ComplexMatrix &psi, const int & m, const complex *psik )const ; + + private: + + void diag_zheev + ( + const int& npw, + ComplexMatrix& psi, + const int& nband, + double *em, + double *err + ) ; + }; -#endif // HERMIT_H +#endif diff --git a/ABACUS.develop/source/src_pw/ions.cpp b/ABACUS.develop/source/src_pw/ions.cpp index 74590095fc..d3faddfcd1 100644 --- a/ABACUS.develop/source/src_pw/ions.cpp +++ b/ABACUS.develop/source/src_pw/ions.cpp @@ -1,14 +1,13 @@ #include "tools.h" #include "ions.h" #include "forces.h" -#include "stress.h" -#include "algorithms.h" +#include "stress_pw.h" #include "../src_pw/global.h" // use chr. #include "vdwd2.h" #include "vdwd3.h" - #include "../src_pw/pw_complement.h" #include "../src_pw/pw_basis.h" +#include "../src_ions/variable_cell.h" // mohan add 2021-02-01 void Ions::opt_ions_pw(void) { @@ -34,7 +33,7 @@ void Ions::opt_ions_pw(void) if(FORCE) { IMM.allocate(); - CE.allocate(); + CE.allocate_ions(); } if(STRESS) // pengfei Li 2018-05-14 @@ -93,71 +92,115 @@ void Ions::opt_ions_pw(void) ofs_running << " -------------------------------------------" << endl; } - - - - if(vdwd2.vdwD2) //Peize Lin add 2014-04-03, update 2019-04-26 + + if(vdwd2_para.flag_vdwd2) //Peize Lin add 2014-04-03, update 2021-03-09 { - vdwd2.energy(); + Vdwd2 vdwd2(ucell,vdwd2_para); + vdwd2.cal_energy(); + en.evdw = vdwd2.get_energy(); } - if(vdwd3.vdwD3) //jiyy add 2019-05-18 + if(vdwd3.vdwD3) //jiyy add 2019-05-18 { vdwd3.energy(); - } - + en.evdw = vdwd3.energy_result; + } + + + // mohan added eiter to count for the electron iteration number, 2021-01-28 + int eiter=0; if (CALCULATION=="scf" || CALCULATION=="md" || CALCULATION=="relax" || CALCULATION=="cell-relax") // pengfei 2014-10-13 { - this->self_consistent(istep-1); + if( Exx_Global::Hybrid_Type::No==exx_global.info.hybrid_type ) + { + elec.self_consistent(istep-1); + eiter = elec.iter; + } + else if( Exx_Global::Hybrid_Type::Generate_Matrix == exx_global.info.hybrid_type ) + { + throw invalid_argument(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + } + else // Peize Lin add 2019-03-09 + { + if( exx_global.info.separate_loop ) + { + for( size_t hybrid_step=0; hybrid_step!=exx_global.info.hybrid_step; ++hybrid_step ) + { + elec.self_consistent(istep-1); + eiter += elec.iter; + if( elec.iter==1 || hybrid_step==exx_global.info.hybrid_step-1 ) // exx converge + break; + exx_global.info.set_xcfunc(xcf); + exx_lip.cal_exx(); + } + } + else + { + elec.self_consistent(istep-1); + eiter += elec.iter; + exx_global.info.set_xcfunc(xcf); + elec.self_consistent(istep-1); + eiter += elec.iter; + } + } } else if(CALCULATION=="nscf") { - this->non_self_consistent(); + elec.non_self_consistent(istep-1); + eiter = elec.iter; } + // mohan added 2021-01-28, perform stochastic calculations + else if(CALCULATION=="scf-sto" || CALCULATION=="relax-sto" || CALCULATION=="md-sto") + { + elec_sto.scf_stochastic(istep-1); + eiter = elec_sto.iter; + } - int iat=0; //LiuXh add 20180619 - if(CALCULATION=="relax"|| CALCULATION=="md" || CALCULATION=="cell-relax") - { - for(int it = 0;it < ucell.ntype;it++) - { - Atom* atom = &ucell.atoms[it]; - for(int ia =0;ia< ucell.atoms[it].na;ia++) - { - CE.pos_old2[3*iat ] = CE.pos_old1[3*iat ]; - CE.pos_old2[3*iat+1] = CE.pos_old1[3*iat+1]; - CE.pos_old2[3*iat+2] = CE.pos_old1[3*iat+2]; - - CE.pos_old1[3*iat ] = CE.pos_now[3*iat ]; - CE.pos_old1[3*iat+1] = CE.pos_now[3*iat+1]; - CE.pos_old1[3*iat+2] = CE.pos_now[3*iat+2]; - - CE.pos_now[3*iat ] = atom->tau[ia].x*ucell.lat0; - CE.pos_now[3*iat+1] = atom->tau[ia].y*ucell.lat0; - CE.pos_now[3*iat+2] = atom->tau[ia].z*ucell.lat0; - - iat++; - } - } - } - - if(pot.out_potential == 2) - { - stringstream ssp; - stringstream ssp_ave; - ssp << global_out_dir << "ElecStaticPot"; - ssp_ave << global_out_dir << "ElecStaticPot_AVE"; - pot.write_elecstat_pot(ssp.str(), ssp_ave.str()); //output 'Hartree + local pseudopot' - } - + int iat=0; //LiuXh add 20180619 + if(CALCULATION=="relax"|| CALCULATION=="md" || CALCULATION=="cell-relax") + { + for(int it = 0;it < ucell.ntype;it++) + { + Atom* atom = &ucell.atoms[it]; + for(int ia =0;ia< ucell.atoms[it].na;ia++) + { + CE.pos_old2[3*iat ] = CE.pos_old1[3*iat ]; + CE.pos_old2[3*iat+1] = CE.pos_old1[3*iat+1]; + CE.pos_old2[3*iat+2] = CE.pos_old1[3*iat+2]; + + CE.pos_old1[3*iat ] = CE.pos_now[3*iat ]; + CE.pos_old1[3*iat+1] = CE.pos_now[3*iat+1]; + CE.pos_old1[3*iat+2] = CE.pos_now[3*iat+2]; + + CE.pos_now[3*iat ] = atom->tau[ia].x*ucell.lat0; + CE.pos_now[3*iat+1] = atom->tau[ia].y*ucell.lat0; + CE.pos_now[3*iat+2] = atom->tau[ia].z*ucell.lat0; + + iat++; + } + } + } + + if(pot.out_potential == 2) + { + stringstream ssp; + stringstream ssp_ave; + ssp << global_out_dir << "ElecStaticPot"; + ssp_ave << global_out_dir << "ElecStaticPot_AVE"; + pot.write_elecstat_pot(ssp.str(), ssp_ave.str()); //output 'Hartree + local pseudopot' + } + time_t eend = time(NULL); time_t fstart = time(NULL); - //stop = this->force_stress(istep); + + if (CALCULATION=="scf" || CALCULATION=="relax" || CALCULATION=="cell-relax") { stop = this->force_stress(istep, force_step, stress_step); // pengfei Li 2018-05-14 } time_t fend = time(NULL); + if(OUT_LEVEL=="i") { double etime_min = difftime(eend, estart)/60.0; @@ -166,7 +209,7 @@ void Ions::opt_ions_pw(void) ss << MOVE_IONS << istep; cout << " " << setw(7) << ss.str() - << setw(5) << this->iter + << setw(5) << eiter << setw(15) << setprecision(6) << en.etot * Ry_to_eV << setw(15) << IMM.get_ediff() * Ry_to_eV << setprecision(3) @@ -187,38 +230,8 @@ void Ions::opt_ions_pw(void) ofs_running << setprecision(16); ofs_running << " !FINAL_ETOT_IS " << en.etot * Ry_to_eV << " eV" << endl; ofs_running << " --------------------------------------------\n\n" << endl; - -/* - if(STRESS) - { - if(stress_step==1) - { - Stress ss; - ss.cal_stress(); - matrix stress; - stress.create(3,3); - - PRESSURE = (ss.sigmatot[0][0]+ss.sigmatot[1][1]+ss.sigmatot[2][2])/3; - } - double pressure = PRESSURE; - en.etot = en.etot + ucell.omega * pressure; - - ofs_running << "\n\n --------------------------------------------" << endl; - ofs_running << setprecision(16); - ofs_running << " !FINAL_ETOT_IS (+ P*V) " << en.etot * Ry_to_eV << " eV" << endl; - ofs_running << " --------------------------------------------\n\n" << endl; - } -*/ } -/* - if(stop && STRESS) //LiuXh add 20180619 - { - FINAL_SCF = true; - Run_Frag::final_calculation_after_vc(); - this->self_consistent(0); - } -*/ if(OUT_LEVEL=="i") { @@ -229,28 +242,23 @@ void Ions::opt_ions_pw(void) return; } -//bool Ions::force_stress(const int &istep) + bool Ions::force_stress(const int &istep, int &force_step, int &stress_step) // pengfei Li 2018-05-14 { TITLE("Ions","force_stress"); + if(!FORCE && !STRESS) { return 1; } - //if(STRESS) - //{ - //calculate the stress - //Stress ss; - //ss.cal_stress(); - //change the latvec - //} if(FORCE&&!STRESS) { // (1) calculate the force. - Forces fcs(ucell.nat); - fcs.init(); + matrix force; + Forces fcs; + fcs.init(force); // (2) move the ions. bool converged = false; @@ -264,7 +272,7 @@ bool Ions::force_stress(const int &istep, int &force_step, int &stress_step) // //} if(CALCULATION=="relax") { - IMM.cal_movement(istep, istep, fcs.force, en.etot); + IMM.cal_movement(istep, istep, force, en.etot); converged = IMM.get_converged(); if(converged || (istep==NSTEP) ) @@ -283,12 +291,10 @@ bool Ions::force_stress(const int &istep, int &force_step, int &stress_step) // ofs_running << " Setup the Vl+Vh+Vxc according to new structure factor and new charge." << endl; // calculate the new potential accordint to // the new charge density. - pot.init_pot( istep ); + pot.init_pot( istep, pw.strucFac ); ofs_running << " Setup the new wave functions?" << endl; - // newd() not needed now(if Q in r space, needed). wf.wfcinit(); - // mp_bcast } } else @@ -302,24 +308,18 @@ bool Ions::force_stress(const int &istep, int &force_step, int &stress_step) // if(!FORCE&&STRESS) { - Stress ss; - ss.cal_stress(); + Stress_PW ss; matrix stress; - stress.create(3,3); + ss.cal_stress(stress); double unit_transform = 0.0; - unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * eps8; + unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * 1.0e-8; double external_stress[3] = {PRESS1,PRESS2,PRESS3}; for(int i=0;i<3;i++) { - for(int j=0;j<3;j++) - { - stress(i,j) = ss.sigmatot[i][j]; - //OUT(ofs_running,"stress(i,j)", stress(i,j)); //LiuXh modify 20180619 - } - stress(i,i) = ss.sigmatot[i][i] - external_stress[i]/unit_transform; + stress(i,i) -= external_stress[i]/unit_transform; } - PRESSURE = (ss.sigmatot[0][0]+ss.sigmatot[1][1]+ss.sigmatot[2][2])/3; + PRESSURE = (stress(0,0)+stress(1,1)+stress(2,2))/3; if(CALCULATION=="cell-relax") { LCM.cal_lattice_change(stress_step, stress, en.etot); @@ -331,9 +331,8 @@ bool Ions::force_stress(const int &istep, int &force_step, int &stress_step) // } else { - Run_Frag::frag_init_after_vc(); - //pot.init_pot(0); - pot.init_pot(stress_step); //LiuXh add 20180619 + Variable_Cell::init_after_vc(); + pot.init_pot(stress_step, pw.strucFac); //LiuXh add 20180619 ofs_running << " Setup the new wave functions?" << endl; //LiuXh add 20180619 wf.wfcinit(); //LiuXh add 20180619 ++stress_step; @@ -350,12 +349,16 @@ bool Ions::force_stress(const int &istep, int &force_step, int &stress_step) // { //cout<<" istep force_step stress_step converged_force converged_stress = "< = 2*|psi(t)> - |psi(t-dt)> - // wfc_order = 3 second order extrapolation: - // |psi(t+dt)> = |psi(t)> + - // + alpha0*( |psi(t)> - |psi(t-dt)> ) - // + beta0* ( |psi(t-dt)> - |psi(t-2*dt)> ) - - - return; -} diff --git a/ABACUS.develop/source/src_pw/ions.h b/ABACUS.develop/source/src_pw/ions.h index 64a4968ce0..412831b0ee 100644 --- a/ABACUS.develop/source/src_pw/ions.h +++ b/ABACUS.develop/source/src_pw/ions.h @@ -7,8 +7,9 @@ #include "../src_ions/lattice_change_methods.h" #include "charge_extra.h" //#include "../src_develop/src_md/md.h" +#include "sto_elec.h" //mohan added 2021-01-28 -class Ions : public electrons +class Ions { public: @@ -19,16 +20,29 @@ class Ions : public electrons private: + // mohan add 2021-01-28 + Electrons elec; + + // mohan add for stochastic wave functions + Stochastic_Elec elec_sto; + + // mohan add 2021-01-28 + // mohan moved this variable from electrons.h to ions.h + int istep; + Ions_Move_Methods IMM; + //MD md; //mohan add 2011-11-07 + Charge_Extra CE; Lattice_Change_Methods LCM; + bool force_stress(const int &istep, int &force_step, int &stress_step); // pengfei Li 2018-05-14 bool force_stress(const int &istep); + void update_pot(void); - void extrapolate_wfcs(void); }; diff --git a/ABACUS.develop/source/src_pw/klist.cpp b/ABACUS.develop/source/src_pw/klist.cpp index b73986de25..0cb42d25ba 100644 --- a/ABACUS.develop/source/src_pw/klist.cpp +++ b/ABACUS.develop/source/src_pw/klist.cpp @@ -1,6 +1,7 @@ #include "global.h" #include "klist.h" #include "../src_parallel/parallel_global.h" +#include "symmetry.h" kvect::kvect() { @@ -64,25 +65,26 @@ void kvect::set( { TITLE("kvect", "set"); - ofs_running << "\n\n\n\n"; - ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl; - ofs_running << " | |" << endl; - ofs_running << " | Setup K-points |" << endl; - ofs_running << " | We setup the k-points according to input parameters. |" << endl; - ofs_running << " | The reduced k-points are set according to symmetry operations. |" << endl; - ofs_running << " | We treat the spin as another set of k-points. |" << endl; - ofs_running << " | |" << endl; - ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl; - ofs_running << "\n\n\n\n"; - - + ofs_running << "\n\n\n\n"; + ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << endl; + ofs_running << " | |" << endl; + ofs_running << " | Setup K-points |" << endl; + ofs_running << " | We setup the k-points according to input parameters. |" << endl; + ofs_running << " | The reduced k-points are set according to symmetry operations. |" << endl; + ofs_running << " | We treat the spin as another set of k-points. |" << endl; + ofs_running << " | |" << endl; + ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl; + ofs_running << "\n\n\n\n"; ofs_running << "\n SETUP K-POINTS" << endl; // (1) set nspin, read kpoints. this->nspin = nspin_in; OUT(ofs_running,"nspin",nspin); - if(this->nspin==4) this->nspin = 1;//zhengdy-soc + if(this->nspin==4) + { + this->nspin = 1;//zhengdy-soc + } bool read_succesfully = this->read_kpoints(k_file_name); #ifdef __MPI @@ -94,7 +96,7 @@ void kvect::set( } // (2) - if (SYMMETRY) + if(Symmetry::symm_flag) { this->ibz_kpoint(symm); this->update_use_ibz(); @@ -122,9 +124,8 @@ void kvect::set( // It's very important in parallel case, // firstly do the mpi_k() and then // do set_kup_and_kdw() -#ifndef __EPM Pkpoints.kinfo(nkstot); -#endif + this->mpi_k();//2008-4-29 this->set_kup_and_kdw(); @@ -165,7 +166,6 @@ bool kvect::read_kpoints(const string &fn) if (MY_RANK != 0) return 1; // mohan add 2010-09-04 -#ifdef __FP if(GAMMA_ONLY_LOCAL) { ofs_warning << " Auto generating k-points file: " << fn << endl; @@ -176,7 +176,6 @@ bool kvect::read_kpoints(const string &fn) ofs << "1 1 1 0 0 0" << endl; ofs.close(); } -#endif ifstream ifk(fn.c_str()); if (!ifk) @@ -226,7 +225,9 @@ bool kvect::read_kpoints(const string &fn) this->k_kword = kword; //LiuXh add 20180619 - if (nkstot > MAX_KPOINTS) + // mohan update 2021-02-22 + int max_kpoints = 100000; + if (nkstot > 100000) { ofs_warning << " nkstot > MAX_KPOINTS" << endl; return 0; @@ -282,7 +283,7 @@ bool kvect::read_kpoints(const string &fn) else if (kword == "Line_Cartesian" ) { //cout << " kword = " << kword << endl; - if(SYMMETRY) + if(Symmetry::symm_flag) { WARNING("kvect::read_kpoints","Line mode of k-points is open, please set symmetry to 0."); return 0; @@ -370,7 +371,7 @@ bool kvect::read_kpoints(const string &fn) else if (kword == "Line_Direct" || kword == "L" || kword == "Line" ) { //cout << " kword = " << kword << endl; - if(SYMMETRY) + if(Symmetry::symm_flag) { WARNING("kvect::read_kpoints","Line mode of k-points is open, please set symmetry to 0."); return 0; diff --git a/ABACUS.develop/source/src_pw/lattlib.F b/ABACUS.develop/source/src_pw/lattlib.F deleted file mode 100644 index 0131904142..0000000000 --- a/ABACUS.develop/source/src_pw/lattlib.F +++ /dev/null @@ -1,930 +0,0 @@ - SUBROUTINE LATTYP(A1,A2,A3,ITYP,CELDIM,PRCHAN) -! Routine LATTYP identifies the type of bravais lattice spanned by * -! the primitive lattice vectors A1, A2 and A3. The lattice will be * -! transformed to a 'standard crystallographic setting' and the cell * -! dimensions will be estimated using the conventions of routine * -! LATGEN. The relation between 'original' and 'transformed' lattice * -! vectors will be given in matrix form. * -! * -! A1, A2 and A3 are the three crystallographic vectors of the * -! primitive unit cell (given in cartesian coordinates x,y,z) * -! of the real space lattice given in units of bohrs ('a'). * -! PRCHAN defines the unit number for printing output information. * -! * -! Output parameters: * -! ------------------ * -! A1, A2 and A3 contain on output the three crystallographic * -! vectors being transformed to some 'standard setting'. * -! ITYP gives the lattice type (1-14) as keyed in routine LATGEN. * -! CELDIM gives the cell dimensions as defined in routine LATGEN. * -!*********************************************************************** - INTEGER PRCHAN - DIMENSION A1(3),A2(3),A3(3),RB(3,3),XB(3,3),CELDIM(6),YB(3) - DIMENSION CELLDM(6),SA1(3),SA2(3),SA3(3),CDMINP(6) - -! First test the original vectors (what do we apparently find?): - ISTRGE=0 -! Lengths of the axes and cosines between the axes: - ABS1=XB(1,1)*XB(1,1)+XB(2,1)*XB(2,1)+XB(3,1)*XB(3,1) - ABS2=XB(1,2)*XB(1,2)+XB(2,2)*XB(2,2)+XB(3,2)*XB(3,2) - ABS3=XB(1,3)*XB(1,3)+XB(2,3)*XB(2,3)+XB(3,3)*XB(3,3) - A2XA1=XB(1,1)*XB(1,2)+XB(2,1)*XB(2,2)+XB(3,1)*XB(3,2) - A3XA1=XB(1,1)*XB(1,3)+XB(2,1)*XB(2,3)+XB(3,1)*XB(3,3) - A3XA2=XB(1,2)*XB(1,3)+XB(2,2)*XB(2,3)+XB(3,2)*XB(3,3) - ABS2M1=SQRT(ABS1+ABS2-2._q*A2XA1) - ABS3M1=SQRT(ABS1+ABS3-2._q*A3XA1) - ABS3M2=SQRT(ABS2+ABS3-2._q*A3XA2) - ABS2P1=SQRT(ABS1+ABS2+2._q*A2XA1) - ABS3P1=SQRT(ABS1+ABS3+2._q*A3XA1) - ABS3P2=SQRT(ABS2+ABS3+2._q*A3XA2) - A1P2M3=SQRT(ABS1+ABS2+ABS3+2._q*A2XA1-2._q*A3XA1-2._q*A3XA2) - A2P3M1=SQRT(ABS1+ABS2+ABS3+2._q*A3XA2-2._q*A2XA1-2._q*A3XA1) - A3P1M2=SQRT(ABS1+ABS2+ABS3+2._q*A3XA1-2._q*A3XA2-2._q*A2XA1) - ABS123=A2XA1+A3XA1+A3XA2 - ABS1=SQRT(ABS1) - ABS2=SQRT(ABS2) - ABS3=SQRT(ABS3) - A2XA1=A2XA1/ABS1/ABS2 - A3XA1=A3XA1/ABS1/ABS3 - A3XA2=A3XA2/ABS2/ABS3 - A1XA2=ABS(A2XA1) - A1XA3=ABS(A3XA1) - A2XA3=ABS(A3XA2) -! Warning extremly strange inputs (very large/small ratios 'c/a', 'b/a' -! or cosines very close to +/-1) could sometimes lead to some problems -! due to the finite precision of the machine ...). Here we test some -! parameters and if we find 'strange parameters', we (DO NOT) stop! - IF (A1XA2>0.995_q) ISTRGE=ISTRGE+1 - IF (A2XA3>0.995_q) ISTRGE=ISTRGE+1 - IF (A1XA3>0.995_q) ISTRGE=ISTRGE+1 - IF ((ABS3/ABS1)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS2/ABS1)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS3/ABS2)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS1/ABS3)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS1/ABS2)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS2/ABS3)<0.001_q) ISTRGE=ISTRGE+1 - -! Following the identification of the crystal type, transformation of -! the basis to 'crystallographic standard settings' and estimate of the -! cell dimensions (using the conventions of routine LATGEN): - CELLDM(1)=0._q - CELLDM(2)=0._q - CELLDM(3)=0._q - CELLDM(4)=0._q - CELLDM(5)=0._q - CELLDM(6)=0._q - IBRAV=15 -! Crystal classes with A1*A2=A1*A3=A2*A3: - IF ((ABS(A2XA1-A3XA1)TINY).AND. & - & ((ABS2-ABS1)>TINY)) THEN - IBRAV=8 - CELLDM(1)=ABS1 - CELLDM(2)=ABS2/ABS1 - CELLDM(3)=ABS3/ABS1 - END IF - END IF -! Crystal classes with A1*A3=A2*A3=/A1*A2: - ELSE IF (ABS(A3XA1-A3XA2)TINY)) THEN - IBRAV=12 - IF ((PRCHAN>=0).AND.(PRCHAN<=99)) & - & WRITE(PRCHAN,*) ' Warning from LATTYP: '// & - & 'Monoclinic adjustement (A1->A3, A2->A1, A3->A2)!' - CELLDM(1)=ABS2 - CELLDM(2)=ABS3/ABS2 - CELLDM(3)=ABS1/ABS2 - CELLDM(5)=A2XA1 - SA3(1)=XB(1,1) - SA3(2)=XB(2,1) - SA3(3)=XB(3,1) - SA1(1)=XB(1,2) - SA1(2)=XB(2,2) - SA1(3)=XB(3,2) - SA2(1)=XB(1,3) - SA2(2)=XB(2,3) - SA2(3)=XB(3,3) - END IF -! Arbitrary angles between the axes: - ELSE -! |A1|=|A2|=|A3| means body-centered tetragonal (IBRAV=6): -! Further additional criterions are: (A1+A2), (A1+A3) and (A2+A3) are -! orthogonal to one another and (adjustment!): |A1+A3|=|A2+A3|<|A1+A2| - IF ((ABS(ABS1-ABS2)TINY).AND. & - & (ABS(ABS3*ABS3+ABS123)|A1+A3|>|A2+A3| - IF ((ABS(ABS1-ABS2)TINY).AND. & - & ((ABS2P1-ABS3P1)>TINY).AND. & - & (ABS(ABS3*ABS3+ABS123)|A1+A3-A2|>|A2+A3-A1| - ELSE IF ((ABS(ABS2M1-ABS3)TINY).AND. & - & ((A3P1M2-A2P3M1)>TINY)) THEN - IBRAV=10 - CELLDM(1)=A2P3M1 - CELLDM(2)=A3P1M2/A2P3M1 - CELLDM(3)=A1P2M3/A2P3M1 -! Now there exists only one further possibility - triclinic (IBRAV=14): -! Adjustment: All three cosines shall be greater than zero and ordered: - ELSE IF ((A2XA1>A3XA1).AND.(A3XA1>A3XA2).AND. & - & (A3XA2>TINY)) THEN - IBRAV=14 - CELLDM(1)=ABS1 - CELLDM(2)=ABS2/ABS1 - CELLDM(3)=ABS3/ABS1 - CELLDM(4)=A3XA2 - CELLDM(5)=A3XA1 - CELLDM(6)=A2XA1 - END IF - END IF -! Remember the result ... : - IBRINP=IBRAV - CDMINP(1)=CELLDM(1) - CDMINP(2)=CELLDM(2) - CDMINP(3)=CELLDM(3) - CDMINP(4)=CELLDM(4) - CDMINP(5)=CELLDM(5) - CDMINP(6)=CELLDM(6) - -! Warning extremly strange inputs (very large/small ratios 'c/a', 'b/a' -! or cosines very close to +/-1) could sometimes lead to some problems -! due to the finite precision of the machine ...). Here we test some -! parameters and if we find 'strange parameters' we (DO NOT) stop! - ABS1=RB(1,1)*RB(1,1)+RB(2,1)*RB(2,1)+RB(3,1)*RB(3,1) - ABS2=RB(1,2)*RB(1,2)+RB(2,2)*RB(2,2)+RB(3,2)*RB(3,2) - ABS3=RB(1,3)*RB(1,3)+RB(2,3)*RB(2,3)+RB(3,3)*RB(3,3) - A2XA1=RB(1,1)*RB(1,2)+RB(2,1)*RB(2,2)+RB(3,1)*RB(3,2) - A3XA1=RB(1,1)*RB(1,3)+RB(2,1)*RB(2,3)+RB(3,1)*RB(3,3) - A3XA2=RB(1,2)*RB(1,3)+RB(2,2)*RB(2,3)+RB(3,2)*RB(3,3) - ABS1=SQRT(ABS1) - ABS2=SQRT(ABS2) - ABS3=SQRT(ABS3) - A1XA2=ABS(A2XA1/ABS1/ABS2) - A1XA3=ABS(A3XA1/ABS1/ABS3) - A2XA3=ABS(A3XA2/ABS2/ABS3) - IF (A1XA2>0.99999_q) ISTRGE=ISTRGE+1 - IF (A2XA3>0.99999_q) ISTRGE=ISTRGE+1 - IF (A1XA3>0.99999_q) ISTRGE=ISTRGE+1 - IF ((ABS3/ABS1)<0.00001_q) ISTRGE=ISTRGE+1 - IF ((ABS2/ABS1)<0.00001_q) ISTRGE=ISTRGE+1 - IF ((ABS3/ABS2)<0.00001_q) ISTRGE=ISTRGE+1 - IF ((ABS1/ABS3)<0.00001_q) ISTRGE=ISTRGE+1 - IF ((ABS1/ABS2)<0.00001_q) ISTRGE=ISTRGE+1 - IF ((ABS2/ABS3)<0.00001_q) ISTRGE=ISTRGE+1 - -! Search a primitive basis with shortest lattice vectors: - - ICOUNT=0 - GOTO 199 - -! The algorithm is the following: Take first one vector and subtract or -! add the two other vectors until you have found the shortest vector. -! Do the same with the other two vectors ... . The iterative method -! used here garantuees that the cell volume will be kept constant and -! all cell vectors occuring during the iterations span primitive cells. -! Two parameters control the flow: ILOOP checks every loop whether a -! vector could be found with smaller or with equal length compared to -! the starting vector by subtraction of an other vector. If ILOOP is not -! set you cannot lower the vector by subtraction of an other vector so -! you have to try it with addition of the vectors. Therefore every loop -! has the following structure: First try it with Ai-ICOUNT*Aj. If the -! shortest vector is found for ICOUNT=0 then try to take Ai+ICOUNT*Aj. -! The loops break if the vector length starts to increase and the vector -! Ai will be set equal to the shortest vector (Ai <-- Ai +/- ICOUNT*Aj). -! IFLAG will be set equal to one whenever a shorter vector was found -! during the total iteration step (6 loops!). If IFLAG is not set we -! found a basis with shortest lattice vectors. If not we should start -! a new iteration ... . - -! First try A1-ICOUNT*A2 (loop 1a): - 100 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)-RB(1,2) - RB(2,1)=RB(2,1)-RB(2,2) - RB(3,1)=RB(3,1)-RB(3,2) - ABSR=SQRT(RB(1,1)*RB(1,1)+RB(2,1)*RB(2,1)+RB(3,1)*RB(3,1)) -! Breakpoint of loop 1a: - IF (ABSR>(ABS1+TINY)) GOTO 102 -! Found some shorter vector ? Then set IFLAG (and store the length): - IF (ABSR<(ABS1-TINY)) THEN - IFLAG=1 - ABS1=ABSR - END IF -! Vector was not longer than the starting vector. Set ILOOP ... : - ILOOP=1 - GOTO 100 -! After leaving loop 1a we have subtracted A2 one times too often ... : - 102 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)+RB(1,2) - RB(2,1)=RB(2,1)+RB(2,2) - RB(3,1)=RB(3,1)+RB(3,2) -! Nothing found ? Try A1+ICOUNT*A2 (loop 1b): - IF (ILOOP==0) THEN - 103 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)+RB(1,2) - RB(2,1)=RB(2,1)+RB(2,2) - RB(3,1)=RB(3,1)+RB(3,2) - ABSR=SQRT(RB(1,1)*RB(1,1)+RB(2,1)*RB(2,1)+RB(3,1)*RB(3,1)) -! Breakpoint of loop 1b: - IF (ABSR>(ABS1+TINY)) GOTO 105 -! Found some shorter vector ? Then set IFLAG (and store the length): - IF (ABSR<(ABS1-TINY)) THEN - IFLAG=1 - ABS1=ABSR - END IF - GOTO 103 -! After leaving loop 1b we have added A2 one times too often ... : - 105 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)-RB(1,2) - RB(2,1)=RB(2,1)-RB(2,2) - RB(3,1)=RB(3,1)-RB(3,2) - END IF -! Reset ILOOP before starting the next loop ... : - ILOOP=0 -! Try A1-ICOUNT*A3 (loop 2a): - 110 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)-RB(1,3) - RB(2,1)=RB(2,1)-RB(2,3) - RB(3,1)=RB(3,1)-RB(3,3) - ABSR=SQRT(RB(1,1)*RB(1,1)+RB(2,1)*RB(2,1)+RB(3,1)*RB(3,1)) - IF (ABSR>(ABS1+TINY)) GOTO 112 - IF (ABSR<(ABS1-TINY)) THEN - IFLAG=1 - ABS1=ABSR - END IF - ILOOP=1 - GOTO 110 - 112 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)+RB(1,3) - RB(2,1)=RB(2,1)+RB(2,3) - RB(3,1)=RB(3,1)+RB(3,3) -! Nothing found ? Try A1+ICOUNT*A3 (loop 2b): - IF (ILOOP==0) THEN - 113 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)+RB(1,3) - RB(2,1)=RB(2,1)+RB(2,3) - RB(3,1)=RB(3,1)+RB(3,3) - ABSR=SQRT(RB(1,1)*RB(1,1)+RB(2,1)*RB(2,1)+RB(3,1)*RB(3,1)) - IF (ABSR>(ABS1+TINY)) GOTO 115 - IF (ABSR<(ABS1-TINY)) THEN - IFLAG=1 - ABS1=ABSR - END IF - GOTO 113 - 115 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,1)=RB(1,1)-RB(1,3) - RB(2,1)=RB(2,1)-RB(2,3) - RB(3,1)=RB(3,1)-RB(3,3) - END IF - ILOOP=0 -! Try A2-ICOUNT*A1 (loop 3a): - 120 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)-RB(1,1) - RB(2,2)=RB(2,2)-RB(2,1) - RB(3,2)=RB(3,2)-RB(3,1) - ABSR=SQRT(RB(1,2)*RB(1,2)+RB(2,2)*RB(2,2)+RB(3,2)*RB(3,2)) - IF (ABSR>(ABS2+TINY)) GOTO 122 - IF (ABSR<(ABS2-TINY)) THEN - IFLAG=1 - ABS2=ABSR - END IF - ILOOP=1 - GOTO 120 - 122 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)+RB(1,1) - RB(2,2)=RB(2,2)+RB(2,1) - RB(3,2)=RB(3,2)+RB(3,1) -! Nothing found ? Try A2+ICOUNT*A1 (loop 3b): - IF (ILOOP==0) THEN - 123 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)+RB(1,1) - RB(2,2)=RB(2,2)+RB(2,1) - RB(3,2)=RB(3,2)+RB(3,1) - ABSR=SQRT(RB(1,2)*RB(1,2)+RB(2,2)*RB(2,2)+RB(3,2)*RB(3,2)) - IF (ABSR>(ABS2+TINY)) GOTO 125 - IF (ABSR<(ABS2-TINY)) THEN - IFLAG=1 - ABS2=ABSR - END IF - GOTO 123 - 125 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)-RB(1,1) - RB(2,2)=RB(2,2)-RB(2,1) - RB(3,2)=RB(3,2)-RB(3,1) - END IF - ILOOP=0 -! Try A2-ICOUNT*A3 (loop 4a): - 130 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)-RB(1,3) - RB(2,2)=RB(2,2)-RB(2,3) - RB(3,2)=RB(3,2)-RB(3,3) - ABSR=SQRT(RB(1,2)*RB(1,2)+RB(2,2)*RB(2,2)+RB(3,2)*RB(3,2)) - IF (ABSR>(ABS2+TINY)) GOTO 132 - IF (ABSR<(ABS2-TINY)) THEN - IFLAG=1 - ABS2=ABSR - END IF - ILOOP=1 - GOTO 130 - 132 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)+RB(1,3) - RB(2,2)=RB(2,2)+RB(2,3) - RB(3,2)=RB(3,2)+RB(3,3) -! Nothing found ? Try A2+ICOUNT*A3 (loop 4b): - IF (ILOOP==0) THEN - 133 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)+RB(1,3) - RB(2,2)=RB(2,2)+RB(2,3) - RB(3,2)=RB(3,2)+RB(3,3) - ABSR=SQRT(RB(1,2)*RB(1,2)+RB(2,2)*RB(2,2)+RB(3,2)*RB(3,2)) - IF (ABSR>(ABS2+TINY)) GOTO 135 - IF (ABSR<(ABS2-TINY)) THEN - IFLAG=1 - ABS2=ABSR - END IF - GOTO 133 - 135 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,2)=RB(1,2)-RB(1,3) - RB(2,2)=RB(2,2)-RB(2,3) - RB(3,2)=RB(3,2)-RB(3,3) - END IF - ILOOP=0 -! Try A3-ICOUNT*A1 (loop 5a): - 140 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)-RB(1,1) - RB(2,3)=RB(2,3)-RB(2,1) - RB(3,3)=RB(3,3)-RB(3,1) - ABSR=SQRT(RB(1,3)*RB(1,3)+RB(2,3)*RB(2,3)+RB(3,3)*RB(3,3)) - IF (ABSR>(ABS3+TINY)) GOTO 142 - IF (ABSR<(ABS3-TINY)) THEN - IFLAG=1 - ABS3=ABSR - END IF - ILOOP=1 - GOTO 140 - 142 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)+RB(1,1) - RB(2,3)=RB(2,3)+RB(2,1) - RB(3,3)=RB(3,3)+RB(3,1) -! Nothing found ? Try A3+ICOUNT*A1 (loop 5b): - IF (ILOOP==0) THEN - 143 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)+RB(1,1) - RB(2,3)=RB(2,3)+RB(2,1) - RB(3,3)=RB(3,3)+RB(3,1) - ABSR=SQRT(RB(1,3)*RB(1,3)+RB(2,3)*RB(2,3)+RB(3,3)*RB(3,3)) - IF (ABSR>(ABS3+TINY)) GOTO 145 - IF (ABSR<(ABS3-TINY)) THEN - IFLAG=1 - ABS3=ABSR - END IF - GOTO 143 - 145 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)-RB(1,1) - RB(2,3)=RB(2,3)-RB(2,1) - RB(3,3)=RB(3,3)-RB(3,1) - END IF - ILOOP=0 -! Try A3-ICOUNT*A2 (loop 6a): - 150 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)-RB(1,2) - RB(2,3)=RB(2,3)-RB(2,2) - RB(3,3)=RB(3,3)-RB(3,2) - ABSR=SQRT(RB(1,3)*RB(1,3)+RB(2,3)*RB(2,3)+RB(3,3)*RB(3,3)) - IF (ABSR>(ABS3+TINY)) GOTO 152 - IF (ABSR<(ABS3-TINY)) THEN - IFLAG=1 - ABS3=ABSR - END IF - ILOOP=1 - GOTO 150 - 152 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)+RB(1,2) - RB(2,3)=RB(2,3)+RB(2,2) - RB(3,3)=RB(3,3)+RB(3,2) -! Nothing found ? Try A3+ICOUNT*A2 (loop 6b): - IF (ILOOP==0) THEN - 153 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)+RB(1,2) - RB(2,3)=RB(2,3)+RB(2,2) - RB(3,3)=RB(3,3)+RB(3,2) - ABSR=SQRT(RB(1,3)*RB(1,3)+RB(2,3)*RB(2,3)+RB(3,3)*RB(3,3)) - IF (ABSR>(ABS3+TINY)) GOTO 155 - IF (ABSR<(ABS3-TINY)) THEN - IFLAG=1 - ABS3=ABSR - END IF - GOTO 153 - 155 CONTINUE - ICOUNT=ICOUNT+1 - RB(1,3)=RB(1,3)-RB(1,2) - RB(2,3)=RB(2,3)-RB(2,2) - RB(3,3)=RB(3,3)-RB(3,2) - END IF -! Nothing found during loops 1a-6b ? Hurray, we have got it !! - IF (IFLAG==0) GOTO 200 -! Next iteration ... : - 199 ABS1=SQRT(RB(1,1)*RB(1,1)+RB(2,1)*RB(2,1)+RB(3,1)*RB(3,1)) - ABS2=SQRT(RB(1,2)*RB(1,2)+RB(2,2)*RB(2,2)+RB(3,2)*RB(3,2)) - ABS3=SQRT(RB(1,3)*RB(1,3)+RB(2,3)*RB(2,3)+RB(3,3)*RB(3,3)) - IFLAG=0 - ILOOP=0 - GOTO 100 - 200 CONTINUE - -! Adjustement of the basis to right-hand-sense (by inversion of all -! three lattice vectors if necessary ...): - CALL CELVOL(RB(1,1),RB(1,2),RB(1,3),OMEGA) - IF (OMEGA<0) THEN - RB(1,1)=-1._q*RB(1,1) - RB(2,1)=-1._q*RB(2,1) - RB(3,1)=-1._q*RB(3,1) - RB(1,2)=-1._q*RB(1,2) - RB(2,2)=-1._q*RB(2,2) - RB(3,2)=-1._q*RB(3,2) - RB(1,3)=-1._q*RB(1,3) - RB(2,3)=-1._q*RB(2,3) - RB(3,3)=-1._q*RB(3,3) - END IF - -! Warning extremly strange inputs (very large/small ratios 'c/a', 'b/a' -! or cosines very close to +/-1) could sometimes lead to some problems -! due to the finite precision of the machine ...). Here we test some -! parameters and if we find 'strange parameters' we (DO NOT) stop! - ABS1=RB(1,1)*RB(1,1)+RB(2,1)*RB(2,1)+RB(3,1)*RB(3,1) - ABS2=RB(1,2)*RB(1,2)+RB(2,2)*RB(2,2)+RB(3,2)*RB(3,2) - ABS3=RB(1,3)*RB(1,3)+RB(2,3)*RB(2,3)+RB(3,3)*RB(3,3) - A2XA1=RB(1,1)*RB(1,2)+RB(2,1)*RB(2,2)+RB(3,1)*RB(3,2) - A3XA1=RB(1,1)*RB(1,3)+RB(2,1)*RB(2,3)+RB(3,1)*RB(3,3) - A3XA2=RB(1,2)*RB(1,3)+RB(2,2)*RB(2,3)+RB(3,2)*RB(3,3) - ABS1=SQRT(ABS1) - ABS2=SQRT(ABS2) - ABS3=SQRT(ABS3) - A1XA2=ABS(A2XA1/ABS1/ABS2) - A1XA3=ABS(A3XA1/ABS1/ABS3) - A2XA3=ABS(A3XA2/ABS2/ABS3) - IF (A1XA2>0.995_q) ISTRGE=ISTRGE+1 - IF (A2XA3>0.995_q) ISTRGE=ISTRGE+1 - IF (A1XA3>0.995_q) ISTRGE=ISTRGE+1 - IF ((ABS3/ABS1)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS2/ABS1)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS3/ABS2)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS1/ABS3)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS1/ABS2)<0.001_q) ISTRGE=ISTRGE+1 - IF ((ABS2/ABS3)<0.001_q) ISTRGE=ISTRGE+1 - -! Now construct several possible combinations of lattice vectors -! and test them all for specific criterions ... : - - !write(*,*) "RB1=",RB(1,1),RB(2,1),RB(3,1) !mohan - !write(*,*) "RB2=",RB(1,2),RB(2,2),RB(3,2) !mohan - !write(*,*) "RB3=",RB(1,3),RB(2,3),RB(3,3) !mohan - ITYP=15 - COS1=1._q - COS2=1._q - COS3=1._q - DO N9=-2,2 - DO N8=-2,2 - DO N7=-2,2 - DO N6=-2,2 - DO N5=-2,2 - ID1=N5*N9-N6*N8 - DO N4=-2,2 - ID2=N6*N7-N4*N9 - ID3=N4*N8-N5*N7 - DO N3=-2,2 - ID4=N3*ID3 - DO N2=-2,2 - ID5=N2*ID2+ID4 - DO N1=-2,2 - IF ((N1*ID1+ID5)==1) THEN - XB(1,1)=N1*RB(1,1)+N2*RB(1,2)+N3*RB(1,3) - XB(2,1)=N1*RB(2,1)+N2*RB(2,2)+N3*RB(2,3) - XB(3,1)=N1*RB(3,1)+N2*RB(3,2)+N3*RB(3,3) - XB(1,2)=N4*RB(1,1)+N5*RB(1,2)+N6*RB(1,3) - XB(2,2)=N4*RB(2,1)+N5*RB(2,2)+N6*RB(2,3) - XB(3,2)=N4*RB(3,1)+N5*RB(3,2)+N6*RB(3,3) - XB(1,3)=N7*RB(1,1)+N8*RB(1,2)+N9*RB(1,3) - XB(2,3)=N7*RB(2,1)+N8*RB(2,2)+N9*RB(2,3) - XB(3,3)=N7*RB(3,1)+N8*RB(3,2)+N9*RB(3,3) - -! Lengths of the axes and cosines between the axes: - ABS1=XB(1,1)*XB(1,1)+XB(2,1)*XB(2,1)+XB(3,1)*XB(3,1) - ABS2=XB(1,2)*XB(1,2)+XB(2,2)*XB(2,2)+XB(3,2)*XB(3,2) - ABS3=XB(1,3)*XB(1,3)+XB(2,3)*XB(2,3)+XB(3,3)*XB(3,3) - A2XA1=XB(1,1)*XB(1,2)+XB(2,1)*XB(2,2)+XB(3,1)*XB(3,2) - A3XA1=XB(1,1)*XB(1,3)+XB(2,1)*XB(2,3)+XB(3,1)*XB(3,3) - A3XA2=XB(1,2)*XB(1,3)+XB(2,2)*XB(2,3)+XB(3,2)*XB(3,3) - ABS2M1=SQRT(ABS1+ABS2-2._q*A2XA1) - ABS3M1=SQRT(ABS1+ABS3-2._q*A3XA1) - ABS3M2=SQRT(ABS2+ABS3-2._q*A3XA2) - ABS2P1=SQRT(ABS1+ABS2+2._q*A2XA1) - ABS3P1=SQRT(ABS1+ABS3+2._q*A3XA1) - ABS3P2=SQRT(ABS2+ABS3+2._q*A3XA2) - A1P2M3=SQRT(ABS1+ABS2+ABS3+2._q*A2XA1-2._q*A3XA1-2._q*A3XA2) - A2P3M1=SQRT(ABS1+ABS2+ABS3+2._q*A3XA2-2._q*A2XA1-2._q*A3XA1) - A3P1M2=SQRT(ABS1+ABS2+ABS3+2._q*A3XA1-2._q*A3XA2-2._q*A2XA1) - ABS123=A2XA1+A3XA1+A3XA2 - ABS1=SQRT(ABS1) - ABS2=SQRT(ABS2) - ABS3=SQRT(ABS3) - A2XA1=A2XA1/ABS1/ABS2 - A3XA1=A3XA1/ABS1/ABS3 - A3XA2=A3XA2/ABS2/ABS3 - A1XA2=ABS(A2XA1) - A1XA3=ABS(A3XA1) - A2XA3=ABS(A3XA2) -! Warning extremly strange inputs (very large/small ratios 'c/a', 'b/a' -! or cosines very close to +/-1) could sometimes lead to some problems -! due to the finite precision of the machine ...). Here we test some -! parameters and if we find 'strange parameters', we (DO NOT) stop! - -! Following the identification of the crystal type, transformation of -! the basis to 'crystallographic standard settings' and estimate of the -! cell dimensions (using the conventions of routine LATGEN): - CELLDM(1)=0._q - CELLDM(2)=0._q - CELLDM(3)=0._q - CELLDM(4)=0._q - CELLDM(5)=0._q - CELLDM(6)=0._q - IBRAV=15 -! Crystal classes with A1*A2=A1*A3=A2*A3: - IF ((ABS(A2XA1-A3XA1)TINY).AND. & - & ((ABS2-ABS1)>TINY)) THEN - IBRAV=8 - CELLDM(1)=ABS1 - CELLDM(2)=ABS2/ABS1 - CELLDM(3)=ABS3/ABS1 - END IF - END IF -! Crystal classes with A1*A3=A2*A3=/A1*A2: - ELSE IF (ABS(A3XA1-A3XA2)TINY)) THEN - IBRAV=12 - CELLDM(1)=ABS2 - CELLDM(2)=ABS3/ABS2 - CELLDM(3)=ABS1/ABS2 - CELLDM(5)=A2XA1 - YB(1)=XB(1,3) - YB(2)=XB(2,3) - YB(3)=XB(3,3) - XB(1,3)=XB(1,1) - XB(2,3)=XB(2,1) - XB(3,3)=XB(3,1) - XB(1,1)=XB(1,2) - XB(2,1)=XB(2,2) - XB(3,1)=XB(3,2) - XB(1,2)=YB(1) - XB(2,2)=YB(2) - XB(3,2)=YB(3) - END IF -! Arbitrary angles between the axes: - ELSE -! |A1|=|A2|=|A3| means body-centered tetragonal (IBRAV=6): -! Further additional criterions are: (A1+A2), (A1+A3) and (A2+A3) are -! orthogonal to one another and (adjustment!): |A1+A3|=|A2+A3|/=|A1+A2| - IF ((ABS(ABS1-ABS2)TINY).AND. & - & (ABS(ABS3*ABS3+ABS123)|A1+A3|>|A2+A3| - IF ((ABS(ABS1-ABS2)TINY).AND. & - & ((ABS2P1-ABS3P1)>TINY).AND. & - & (ABS(ABS3*ABS3+ABS123)|A1+A3-A2|>|A2+A3-A1| - ELSE IF ((ABS(ABS2M1-ABS3)TINY).AND. & - & ((A3P1M2-A2P3M1)>TINY)) THEN - IBRAV=10 - CELLDM(1)=A2P3M1 - CELLDM(2)=A3P1M2/A2P3M1 - CELLDM(3)=A1P2M3/A2P3M1 -! Now there exists only one further possibility - triclinic (IBRAV=14): -! Adjustment: All three cosines shall be greater than zero and ordered: - ELSE IF ((A2XA1>A3XA1).AND.(A3XA1>A3XA2).AND. & - & (A3XA2>TINY)) THEN - IBRAV=14 - CELLDM(1)=ABS1 - CELLDM(2)=ABS2/ABS1 - CELLDM(3)=ABS3/ABS1 - CELLDM(4)=A3XA2 - CELLDM(5)=A3XA1 - CELLDM(6)=A2XA1 - END IF - END IF - -! Have we found some lattice with lower index IBRAV as all previous? - IF ((IBRAV[numIon]; - cartNoWrap=new Vector3[numIon]; - taudirac=new Vector3[numIon]; - allmass=new double[numIon]; - ionmbl=new Vector3[numIon]; - force=new Vector3[numIon]; - return; + +void md::md_allocate() +{ + na=new int[ntype]; + if (!MY_RANK) + { + stringstream ssc; + ssc << global_out_dir << "MD_OUT"; + out.open(ssc.str().c_str()); } + for(int i=0;i[numIon]; + cartNoWrap=new Vector3[numIon]; + taudirac=new Vector3[numIon]; + allmass=new double[numIon]; + ionmbl=new Vector3[numIon]; + force=new Vector3[numIon]; + return; +} + const double md::fundamentalTime = 2.418884326505e-17; -void md::initMD(){ - mdtype=INPUT.md_mdtype; +void md::initMD(void) +{ + + mdtype=INPUT.md_mdtype; - mdenergy=en.etot/2; - - Qmass=INPUT.md_qmass/6.02/9.109*1e5; - dt=INPUT.md_dt/fundamentalTime/1e15; - temperature=INPUT.md_tfirst/3.1577464e5; - rstMD=INPUT.md_rstmd; - - nResn=INPUT.md_nresn; - nYosh=INPUT.md_nyosh; - dumpmdfreq=INPUT.md_dumpmdfred; - fixTemperature=INPUT.md_fixtemperature; - ediff=INPUT.md_ediff; - ediffg=INPUT.md_ediffg; - doMSD=INPUT.md_domsd; - doMSDAtom=INPUT.md_domsdatom; - mdoutputpath=INPUT.md_mdoutpath; - msdstartTime=INPUT.md_msdstartTime; - - if(rstMD==0){ - connection0(); - connection1(); + mdenergy=en.etot/2; + + Qmass=INPUT.md_qmass/6.02/9.109*1e5; + dt=INPUT.md_dt/fundamentalTime/1e15; + temperature=INPUT.md_tfirst/3.1577464e5; + rstMD=INPUT.md_rstmd; + + nResn=INPUT.md_nresn; + nYosh=INPUT.md_nyosh; + dumpmdfreq=INPUT.md_dumpmdfred; + fixTemperature=INPUT.md_fixtemperature; + ediff=INPUT.md_ediff; + ediffg=INPUT.md_ediffg; + doMSD=INPUT.md_domsd; + doMSDAtom=INPUT.md_domsdatom; + mdoutputpath=INPUT.md_mdoutpath; + msdstartTime=INPUT.md_msdstartTime; + + if(rstMD==0) + { + connection0(); + connection1(); //A fresh new MD: Do not restart MD - InitVelocity() ; - // Initialize thermostat, and barostat - xLogS = 0.0 ; // position of thermostat - vLogS = 0.0; // velocity of thermostat - - } - else if ( rstMD>0 ){ - connection0(); - connection1(); - InitVelocity() ; - if(!RestartMD()){ - cout<<"error in restart MD!"<0 ) + { + connection0(); + connection1(); + InitVelocity() ; + if(!RestartMD()){ + cout<<"error in restart MD!"<>xLogS; - file.get(); file.ignore(7, '\n'); - file>>vLogS; - file.get(); file.ignore(23, '\n'); - for(i = 0;i>vell[i]; - } - /*file.get(); file.ignore(17, '\n'); - for(i=0;i>cart[i]; - } - file.get(); file.ignore(13, '\n'); - for(i=0;i>dira[i]; - }*/ - file.get(); file.ignore(6, '\n'); - file>>step_rst; - file.close(); - } + file.ignore(7, '\n'); + file>>xLogS; + file.get(); file.ignore(7, '\n'); + file>>vLogS; + file.get(); file.ignore(23, '\n'); + for(i = 0;i>vell[i]; + } + /*file.get(); file.ignore(17, '\n'); + for(i=0;i>cart[i]; + } + file.get(); file.ignore(13, '\n'); + for(i=0;i>dira[i]; + }*/ + file.get(); + file.ignore(6, '\n'); + file>>step_rst; + file.close(); + } + //2015-09-05, xiaohui #ifdef __MPI - MPI_Bcast(&xLogS,1,MPI_DOUBLE,0,MPI_COMM_WORLD); - MPI_Bcast(&vLogS,1,MPI_DOUBLE,0,MPI_COMM_WORLD); - MPI_Bcast(&step_rst,1,MPI_INT,0,MPI_COMM_WORLD); - MPI_Bcast(vell,numIon*3,MPI_DOUBLE,0,MPI_COMM_WORLD); - // MPI_Bcast(cart,numIon*3,MPI_DOUBLE,0,MPI_COMM_WORLD); - // MPI_Bcast(dira,numIon*3,MPI_DOUBLE,0,MPI_COMM_WORLD); + MPI_Bcast(&xLogS,1,MPI_DOUBLE,0,MPI_COMM_WORLD); + MPI_Bcast(&vLogS,1,MPI_DOUBLE,0,MPI_COMM_WORLD); + MPI_Bcast(&step_rst,1,MPI_INT,0,MPI_COMM_WORLD); + MPI_Bcast(vell,numIon*3,MPI_DOUBLE,0,MPI_COMM_WORLD); + // MPI_Bcast(cart,numIon*3,MPI_DOUBLE,0,MPI_COMM_WORLD); + // MPI_Bcast(dira,numIon*3,MPI_DOUBLE,0,MPI_COMM_WORLD); #endif - for(i=0;i echo_md_restart.dat, for debug purpose. "< echo_md_restart.dat, for debug purpose. "< 1&& step%dumpmdfreq==0 ) ) - pass =1; - if (!pass) return; +void md::mstout(int step) +{ + //this function used for outputting the information of restart file + bool pass; + pass = 0; - int i; - if(!MY_RANK){ - stringstream ssc; - ssc << global_out_dir << "Restart_md.dat"; - ofstream file(ssc.str().c_str()); - file<<"MD_RESTART"< 1&& step%dumpmdfreq==0 ) ) + pass =1; + if (!pass) return; + + int i; + if(!MY_RANK) + { + stringstream ssc; + ssc << global_out_dir << "Restart_md.dat"; + ofstream file(ssc.str().c_str()); + file<<"MD_RESTART"<> EXTERNAL VARIABLES <> EXTERNAL VARIABLES <> INTERIOR VARIABLES <> INITIALIZATION <> FUNCTION BODY <> INTERIOR VARIABLES <> INITIALIZATION <> FUNCTION BODY <=0) i1=i0; else i1=i0+m; - i0=a*(j%q)-r*((j-j%q)/q); - if(j0>=0) j1=j0; else j1=j0+m; - for(M=0;M<3*numIon;){ - i0=a*(i1%q)-r*((i1-i1%q)/q); - if(i0>=0) i2=i0; - else i2=i0+m; - u=((double)i1)/((double)m); //first ramdon number - i1=i2; - j0=a*(j1%q)-r*((j1-j1%q)/q); - if(j0>=0) j2=j0; - else j2=j0+m; - v=((double)j1)/((double)m); //second ramdon number - j1=j2; - x=tan(PI*(u-0.5)); - y=1.6*v/(PI*(x*x+1.0)); - if(y<=(1.0/sqrt(2.0*PI)*exp(-0.5*x*x))){ - if(M=0) i1=i0; else i1=i0+m; + i0=a*(j%q)-r*((j-j%q)/q); + if(j0>=0) j1=j0; else j1=j0+m; + for(M=0;M<3*numIon;) + { + i0=a*(i1%q)-r*((i1-i1%q)/q); + if(i0>=0) i2=i0; + else i2=i0+m; + u=((double)i1)/((double)m); //first ramdon number + i1=i2; + j0=a*(j1%q)-r*((j1-j1%q)/q); + if(j0>=0) j2=j0; + else j2=j0+m; + v=((double)j1)/((double)m); //second ramdon number + j1=j2; + x=tan(PI*(u-0.5)); + y=1.6*v/(PI*(x*x+1.0)); + if(y<=(1.0/sqrt(2.0*PI)*exp(-0.5*x*x))) + { + if(M #include"tools.h" #include"global.h" -#include"../src_lcao/force_lcao.h" +#include"../src_lcao/FORCE_STRESS.h" #include"unitcell_pseudo.h" + using namespace std; + //const double fundamentalTime = 2.418884326505e-17; -class md{ -public: + +//------------------------------------------------------------------- +// mohan reconstruction note: 2021-02-07 +// 1) explain every variable and every function +// 2) if too many, divide the class into more files +// 3) leave a space between different functions +// 4) write the comments above the variables or functions +//------------------------------------------------------------------- + +class md +{ + public: + md(int n=1); - void md_allocate(); - void initMD(); + + void md_allocate(); + void initMD(); bool RestartMD(); - void mstout(int step); + void mstout(int step); void RemoveMovementOfCenterOfMass(); double GetAtomKE(); void MakeIntCoeff(); @@ -34,69 +48,64 @@ class md{ void connection1(); void connection2(); void callforce(); - void moveatoms(int step); - void printpos(string file,int iter); - void md_release(); - void scalevel(); - void RDF(); - void printRDF(int step); - void PDF(int step); + void moveatoms(int step); + void printpos(string file,int iter); + void md_release(); + void scalevel(); + void RDF(); + void printRDF(int step); + void PDF(int step); + + // variables: int mdtype; // 1: NVT:Nose Hoover, 2:NVT:Nose Hoover add velocity scaling 3: NPT, 0: NVE - double xLogS; // thermostat's position - double vLogS;// thermostat's speed - Vector3 *vel;// velocity of each atom, unit is a.u. - Matrix3 vBoxG; // barostat's velocity + double xLogS; // thermostat's position + double vLogS;// thermostat's speed + Vector3 *vel;// velocity of each atom, unit is a.u. + Matrix3 vBoxG; // barostat's velocity Matrix3 ionlatvec; double tauthermo; // The thermostat fluctuation period, for Al fcc at 300K ~ 1000fs - double taubaro; // The barostat fluctuation period, for Al fcc at 300K ~ 500 fs - double Qmass; // Inertia of extended system variable - double dt ; // Time increment (hbar/E_hartree) - double temperature; //Temperature (in Hartree, 1 Hartree ~ 3E5 K) - bool doMSD; // compute the mean square displacement. - bool doMSDAtom; // compute the mean square displacement for each atom. - double msdstartTime; //beyond this time, msd is going to be computed - double *msd ; - double diffuCoeff ; + double taubaro; // The barostat fluctuation period, for Al fcc at 300K ~ 500 fs + double Qmass; // Inertia of extended system variable + double dt ; // Time increment (hbar/E_hartree) + double temperature; //Temperature (in Hartree, 1 Hartree ~ 3E5 K) + bool doMSD; // compute the mean square displacement. + bool doMSDAtom; // compute the mean square displacement for each atom. + double msdstartTime; //beyond this time, msd is going to be computed + double *msd ; + double diffuCoeff ; int numIon; int ntype; int* na; - int nfrozen; + int nfrozen; double *allmass; Vector3 *force; Vector3 *ionmbl; Vector3 *taudirac; //dirac coord of atoms - Vector3 *cartNoWrap; //cartensian coord of atoms, *not* wrapped - Vector3 *msdcoords0; - Vector3 *msdcoordst; - int nResn; // Coarseness of Trotter factorization of Nose-Hoover thermostat - int nYosh; // Order of thermostat scheme corresponding with "intCoeff" - double *intCoeff; - int outputstressperiod;// The period to output stress - int dumpmdfreq; // The period to dump MD information for monitoring and restarting MD - int fixTemperature; // The period to read in new temperature during MD run. - string mdoutputpath; // output directory of md files: .ion .vel - int rstMD;// 1 : restart MD, vel.restart and ion.restart files will be read - // 0 : not restart from ion and vel files + Vector3 *cartNoWrap; //cartensian coord of atoms, *not* wrapped + Vector3 *msdcoords0; + Vector3 *msdcoordst; + int nResn; // Coarseness of Trotter factorization of Nose-Hoover thermostat + int nYosh; // Order of thermostat scheme corresponding with "intCoeff" + double *intCoeff; + int outputstressperiod;// The period to output stress + int dumpmdfreq; // The period to dump MD information for monitoring and restarting MD + int fixTemperature; // The period to read in new temperature during MD run. + string mdoutputpath; // output directory of md files: .ion .vel + int rstMD;// 1 : restart MD, vel.restart and ion.restart files will be read + // 0 : not restart from ion and vel files double ediff; //parameter for constrain double ediffg; //parameter for constrain - int startStep;// the first step number of MD - bool velRescale;// whether to rescale velocities at the first step + int startStep;// the first step number of MD + bool velRescale;// whether to rescale velocities at the first step ofstream out; double mdenergy; - const static double fundamentalTime; - double rdf[100]; - int step_rst; + const static double fundamentalTime; + double rdf[100]; + int step_rst; matrix stress_lcao; }; -/*class mdmd:public md{ - mdmd(){}; - void initMD(); - void runMD(); - mdnvt MDNVT(0); - mdNVE MDNVE(0); -}*/ #endif diff --git a/ABACUS.develop/source/src_pw/mdNVE.cpp b/ABACUS.develop/source/src_pw/mdNVE.cpp index b34e3fb03d..ffb3a199f5 100644 --- a/ABACUS.develop/source/src_pw/mdNVE.cpp +++ b/ABACUS.develop/source/src_pw/mdNVE.cpp @@ -127,7 +127,7 @@ void mdNVE::runNVE(int step1){ for(int i=0;i<3;i++) press += stress_lcao(i,i)/3; press += twiceKE/3/ucell.omega; //output virtual press = 2/3*Ek/V + sum(sigma[i][i])/3 - double unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * eps8 ; + double unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * 1.0e-8 ; cout<<"Virtual Pressure is "< *a, int ng Vector3 < double> *g, int *ig2fftc, double lat0, double *da); -// myfunc4.cpp -/* -void wsinit(double *rws0, Vector3 < double> *rws, int nrwsx, int nrws, - Matrix3 atw); -void ccalbec(int nkb, - int npwx, - int npw, - int nbnd, - ComplexMatrix &bec, - const ComplexMatrix &vkb, - const ComplexMatrix &psi); - -void pw_gemm(char sum_over_nodes, int na, int nb, int n, ComplexMatrix a, - int lda, ComplexMatrix b, int ldb, ComplexMatrix c, int ldc); - -void interpolate(double *v, double *vs, int iflag); -void cinterpolate(complex < double> *v, complex < double> *vs, int iflag); -*/ - // myfunc5.cpp (from LPACK) // compute y = alpha * y where alpha is a scalar and y is an n-vector void dscal(const int n, const double &alpha, double *y, const int incy); diff --git a/ABACUS.develop/source/src_pw/myfunc3.cpp b/ABACUS.develop/source/src_pw/myfunc3.cpp deleted file mode 100644 index 081e697a16..0000000000 --- a/ABACUS.develop/source/src_pw/myfunc3.cpp +++ /dev/null @@ -1,436 +0,0 @@ -#include "../src_pw/global.h" -#include "myfunc.h" -#include "mymath.h" - - -// from gradcorr.f90 -void gradcorr(double &etxc, double &vtxc, matrix &v) -{ - BLOCK_HERE("gradcorr"); - if (xcf.igcx_now == 0 && xcf.igcc_now == 0) - { - return; - } - - double zeta, rh, grh2; - int k, ipol, is; - - double *dh; - double grho2[2], sx, sc, v1x, v2x, v1c, v2c, v1xup, v1xdw, - v2xup, v2xdw, v1cup, v1cdw , etxcgc, vtxcgc, segno, arho, fac; - - etxcgc = 0.0; - vtxcgc = 0.0; - - realArray h(NSPIN, pw.nrxx, 3); - realArray grho(NSPIN, pw.nrxx, 3); - - // calculate the gradient of rho+rho_core in real space - Vector3 *grho_v3 = new Vector3[pw.nrxx]; - Vector3 *h_v3 = new Vector3[pw.nrxx]; - - fac = 1.0 / NSPIN; - - for (is=0; is epsr && grho2 [1] > epsg) - { - gcxc(arho, grho2[1], sx, sc, v1x, v2x, v1c, v2c); //?grho2[0] - // first term of the gradient correction : D(rho*Exc)/D(rho) - v(0, k) = v(0, k) + e2 * (v1x + v1c); - // h contains D(rho*Exc)/D(|grad rho|) * (grad rho) / |grad rho| - - for (ipol = 0;ipol < 3;ipol++) // do ipol = 1, 3 - { - h(0, k, ipol) = e2 * (v2x + v2c) * grho(0, k, ipol); - } // enddo - - vtxcgc = vtxcgc + e2 * (v1x + v1c) * ( chr.rho1[k] - chr.rho_core[k]); - - etxcgc = etxcgc + e2 * (sx + sc) * segno; - } - else - { - for (ipol = 0;ipol < 3;ipol++) // do ipol = 1, 3 - { - h(0, k, ipol) = 0.0; - } // enddo - } // endif - } - else - { - // spin-polarised case - gcx_spin( chr.rho1[k], chr.rho2[k], grho2 [0], grho2 [1], - sx, v1xup, v1xdw, v2xup, v2xdw); - rh = chr.rho1[k] + chr.rho2[k]; - - if (rh > epsr) - { - zeta = ( chr.rho1[k] - chr.rho2[k] ) / rh; - Vector3 < double> v3; - v3.x = grho(0, k, 0) + grho(1, k, 0); - v3.y = grho(0, k, 1) + grho(1, k, 1); - v3.z = grho(0, k, 2) + grho(1, k, 2); - grh2 = v3 * v3; - // grh2 = (grho (k, 1, 1) + grho (k, 1, 2) ) **2 + - // (grho (k, 2, 1) + grho (k, 2, 2) ) **2 + - // (grho (k, 3, 1) + grho (k, 3, 2) ) **2; - gcc_spin(rh, zeta, grh2, sc, v1cup, v1cdw, v2c); - } - else - { - sc = 0.0; - v1cup = 0.0; - v1cdw = 0.0; - v2c = 0.0; - } // endif - - // first term of the gradient correction : D(rho*Exc)/D(rho) - v(0, k) = v(0, k) + e2 * (v1xup + v1cup); - - v(1, k) = v(1, k) + e2 * (v1xdw + v1cdw); - - // h contains D(rho*Exc)/D(|grad rho|) * (grad rho) / |grad rho| - for (ipol = 0;ipol < 3;ipol++) // do ipol = 1, 3 - { - h(0, k, ipol) = e2 * ((v2xup + v2c) * grho(0, k, ipol) - + v2c * grho(1, k, ipol)); - h(1, k, ipol) = e2 * ((v2xdw + v2c) * grho(1, k, ipol) - + v2c * grho(0, k, ipol)); - } // enddo - - vtxcgc = vtxcgc + e2 * (v1xup + v1cup) * ( chr.rho1[k] - - chr.rho_core[k] * fac); - - vtxcgc = vtxcgc + e2 * (v1xdw + v1cdw) * ( chr.rho2[k] - - chr.rho_core[k] * fac); - - etxcgc = etxcgc + e2 * (sx + sc); - } // endif - } // enddo - - - daxpy(pw.nrxx, -fac, chr.rho_core, 1, chr.rho1, 1); - if(NSPIN==2) - { - daxpy(pw.nrxx, -fac, chr.rho_core, 1, chr.rho2, 1); - } - - dh = new double [pw.nrxx]; - - // second term of the gradient correction : - // \sum_alpha (D / D r_alpha) ( D(rho*Exc)/D(grad_alpha rho) ) - - for (is = 0;is < NSPIN;is++) // do is = 1, n_spin - { - for (k = 0; k < pw.nrxx; k++) - { - h_v3[k].x = h(is, k, 0); - h_v3[k].y = h(is, k, 1); - h_v3[k].z = h(is, k, 2); - } - - grad_dot(pw.ncx, pw.ncy, pw.ncz, pw.ncxyz, h_v3, pw.ngmc, pw.g, pw.ig2fftc, ucell.lat0, dh); - - for (k = 0;k < pw.nrxx;k++) // do k = 1, ncxyz - { - v(is, k) = v(is, k) - dh [k]; - } - - if(is==0) - { - for (k = 0;k < pw.nrxx;k++) - { - vtxcgc = vtxcgc - dh [k] * chr.rho1[k]; - } - } - else if(is==1) - { - for (k = 0;k < pw.nrxx;k++) - { - vtxcgc = vtxcgc - dh [k] * chr.rho2[k]; - } - } - - } // enddo - - double vtxcaux = vtxc; - double etxcaux = etxc; - -#ifdef __MPI - MPI_Allreduce(&vtxcaux,&vtxc,1,MPI_DOUBLE,MPI_SUM,POOL_WORLD); - MPI_Allreduce(&etxcaux,&etxc,1,MPI_DOUBLE,MPI_SUM,POOL_WORLD); -#endif - - vtxc += ucell.omega * vtxcgc / pw.ncxyz;//(nr1 * nr2 * nr3); - etxc += ucell.omega * etxcgc / pw.ncxyz;//(nr1 * nr2 * nr3); - - delete [] grho_v3; - delete [] h_v3; - delete [] dh; - - return; -} // end subroutine gradcorr - -// from gradcorr.f90 -void gradient( double *a, Vector3 *ga) -{ - //------------------------------------------------------- - // Calculates ga = \grad a in R-space (a is also in R-space) - // use gvect, only: int *nlm; - // use wvfct, only: bool gamma_only; - double tpiba = TWO_PI / lat0; - - int n=0; - int ipol=0; - matrix aux(2, pw.nrxx); - matrix gaux(2, pw.nrxx); - - double *aux_1d= new double[pw.nrxx]; - double *gaux_1d= new double[pw.nrxx]; - double *ga_1d= new double[pw.nrxx]; - - matrix gx(ngmc, 3); - - for (n = 0;n < ngmc;n++) - { - gx(n, 0) = g[n].x; - gx(n, 1) = g[n].y; - gx(n, 2) = g[n].z; - } - - // copy a(r) to complex array... - // aux(2,:) = 0.0l; ? - for (n = 0;n < ncxyz;n++) - { - aux(0, n) = 0.01; - aux(1, n) = 0.01; - } - - for (n = 0;n < ncxyz;n++) - { - aux_1d[n] = aux(1, n); - } - - dcopy(ncxyz, a, 1, aux_1d, 1); - // bring a(r) to G-space, a(G) ... - - // cft3 (aux, nr1, nr2, nr3, nrx1, nrx2, nrx3, - 1); - // setupFFT( ncx, ncy,ncz); -#ifdef __MPI -#else -// fftchg.FFT3D(aux, -1); -#endif - // multiply by (iG) to get (\grad_ipol a)(G) ... - - // ga(:,:) = 0.0; - // ga.zero_out(); - - for (ipol = 0;ipol < 3;ipol++) - { - // gaux(:,:) = 0.0; - gaux.zero_out(); - - for (n = 0;n < ngmc;n++) // do n = 1, ngm - { - gaux(0, ig2fftc[n]) = - gx(n, 0) * aux(1, ig2fftc[n]); - gaux(1, ig2fftc[n]) = gx(n, 1) * aux(0, ig2fftc[n]); - } // enddo - - if (wf.gamma_only) - { -// for(n=0;n *g, int *nl, double alat, -// double *da) -void grad_dot(int ncx, int ncy, int ncz, int ncxyz, Vector3 < double> *a, int ngmc, - Vector3 < double> *g, int *ig2fftc, double lat0, double *da) -{ - //----------------------------------------------------------- - - // Calculates da = \sum_i \grad_i a_i in R-space - - // use gvect, only: nlm - // use wvfct, only: gamma_only - - // integer :: nrx1, nrx2, nrx3, nr1, nr2, nr3, ncxyz, ngm, nl (ngm); - // real(kind=DP) :: a (3, ncxyz), g (3, ngm), da (ncxyz), alat; - int n, ipol; - matrix aux; // (:,:), - matrix gaux; // (:,:); - aux.create(2, ncxyz); // allocate (aux( 2,ncxyz)); - gaux.create(2, ncxyz); // allocate (gaux(2,ncxyz)); - - double tpiba= TWO_PI / lat0; - matrix gx; - gx.create(ngmc, 3); - - for (n = 0;n < ngmc;n++) - { - gx(n, 0) = g[n].x; - gx(n, 1) = g[n].y; - gx(n, 2) = g[n].z; - } - - for (ipol = 0;ipol < 3;ipol++) // do ipol = 1, 3 - { - // copy a(ipol,r) to a complex array... - - for (n = 0;n < ncxyz;n++) - { - aux(0, n) = 0.0; - } - - //dcopy (ncxyz, a (ipol, 1), 3, aux, 2); - //if(ipol = 0){ - if (ipol == 0) //mohan modify 2007-01-23 - { - for (n = 0; n < ncxyz; n++) - { - aux(0, n) = a[n].x; - } - - //}else if(ipol = 1){ - } - else if (ipol == 1) //mohan modify 2007-01-23 - { - for (n = 0; n < ncxyz; n++) - { - aux(0, n) = a[n].y; - } - } - else - { - for (n = 0; n < ncxyz; n++) - { - aux(0, n) = a[n].z; - } - } - - // bring a(ipol,r) to G-space, a(G) ... - // cft3 (aux, nr1, nr2, nr3, nrx1, nrx2, nrx3, - 1); -// setupFFT3D( ncx, ncy,ncz); -// -#ifdef __MPI -#else - // fftchg.FFT3D(aux, -1); -#endif - - // multiply by (iG) to get (\grad_ipol a)(G) ... - for (n = 0;n < ngmc;n++) // do n = 1, ngm - { - gaux(0, ig2fftc[n]) -= gx(n, ipol) * aux(1, ig2fftc[n]); - gaux(1, ig2fftc[n]) += gx(n, ipol) * aux(0, ig2fftc[n]); - } // enddo - } // enddo - - if (wf.gamma_only) - { -// for(n=0;n(ni) * h0 ; ni++; h1 = 2.00 * x * h0 - 2.00 * static_cast(ni) * h1 ; - - //cout << " a = " <(ni) * h0m1 ) * hp ; - // cout << " w1 == "< &r, Vector3 *rws,const int nrws) { //============================================================ @@ -1153,5 +1076,3 @@ void Occupy::piksort(const int n, double *a) } return; } //end subroutine piksort - - diff --git a/ABACUS.develop/source/src_pw/occupy.h b/ABACUS.develop/source/src_pw/occupy.h index 20c4c31e14..65a73cd380 100644 --- a/ABACUS.develop/source/src_pw/occupy.h +++ b/ABACUS.develop/source/src_pw/occupy.h @@ -1,5 +1,3 @@ -// AUTHOR : Mohan Chen -// UPDATE LAST TIME : 2010-1-9 #ifndef OCCUPY_H #define OCCUPY_H @@ -10,7 +8,8 @@ using namespace std; class Occupy { - friend class Chi0_hilbert; // pengfei 2016-11-23 + // pengfei 2016-11-23 + friend class Chi0_hilbert; public: @@ -21,13 +20,18 @@ class Occupy static void decision(const string &name,const string &smearing,const double °auss); - static const bool& gauss(void) { + static const bool& gauss(void) + { return use_gaussian_broadening; } - static const bool& tetra(void) { + + static const bool& tetra(void) + { return use_tetrahedron_method; } - static const bool& fix(void) { + + static const bool& fix(void) + { return fixed_occupations; } @@ -45,23 +49,30 @@ class Occupy static bool fixed_occupations; static void iweights(const int nks,const double *wk,const int nband, - const double &nelec, double **ekb, double &ef, matrix &wg, const int &is, const int *isk); + const double &nelec, double **ekb, double &ef, + matrix &wg, const int &is, const int *isk); - static void gweights(const int nks,const double *wk,const int nband,const double &nelec,const double °auss, - const int ngauss,double **ekb, double &ef, double &demet, matrix &wg, const int &is, const int *isk); + static void gweights(const int nks,const double *wk,const int nband, + const double &nelec,const double °auss, + const int ngauss,double **ekb, double &ef, + double &demet, matrix &wg, const int &is, const int *isk); - static void tweights(const int nks,const int nspin,const int nband,const double &nelec,const int ntetra, + static void tweights(const int nks,const int nspin,const int nband, + const double &nelec,const int ntetra, const matrix &tetra,double **ekb,double &ef,matrix &wg); static double wsweight(const Vector3 &r, Vector3 *rws,const int nrws); private: - static void efermig(double **ekb,const int nbnd,const int nks,const double &nelec,const double *wk, - const double °auss,const int ngauss,double &ef, const int &is, const int *isk); + static void efermig(double **ekb,const int nbnd,const int nks, + const double &nelec,const double *wk, + const double °auss,const int ngauss, + double &ef, const int &is, const int *isk); - static double sumkg(double **ekb,const int nband,const int nks,const double *wk,const double °auss, - const int ngauss,const double &e, const int &is, const int *isk); + static double sumkg(double **ekb,const int nband,const int nks, + const double *wk,const double °auss, const int ngauss, + const double &e, const int &is, const int *isk); static double wgauss(const double &x,const int n); @@ -79,7 +90,6 @@ class Occupy const matrix &tetra,const double &eup); static void piksort(const int n, double *a); - }; #endif diff --git a/ABACUS.develop/source/src_pw/potential.cpp b/ABACUS.develop/source/src_pw/potential.cpp index a391c3b652..c95cffda30 100644 --- a/ABACUS.develop/source/src_pw/potential.cpp +++ b/ABACUS.develop/source/src_pw/potential.cpp @@ -2,117 +2,106 @@ #include "global.h" #include "potential.h" #include "xc_functional.h" -#include "gga_pw.h" +#include "xc_gga_pw.h" #include "efield.h" #include "math.h" +#include "potential_libxc.h" +// new +#include "H_Hartree_pw.h" +#include "H_XC_pw.h" -potential::potential() +Potential::Potential() { - this->test = 0; vltot = new double[1]; - vrs1 = new double[1]; + vr_eff1 = new double[1]; this->out_potential = 0; } -potential::~potential() +Potential::~Potential() { delete[] vltot; - delete[] vrs1; + delete[] vr_eff1; } -void potential::init(const int nrxx) +void Potential::allocate(const int nrxx) { - if (test_potential) TITLE("potential","init"); + TITLE("Potential","allocate"); assert(nrxx>0); delete[] this->vltot; this->vltot = new double[nrxx]; - Memory::record("potential","vltot",nrxx,"double"); + Memory::record("Potential","vltot",nrxx,"double"); this->vr.create(NSPIN,nrxx); - this->vrs.create(NSPIN,nrxx); - Memory::record("potential","vr",NSPIN*nrxx,"double"); - Memory::record("potential","vrs",NSPIN*nrxx,"double"); + this->vr_eff.create(NSPIN,nrxx); + Memory::record("Potential","vr",NSPIN*nrxx,"double"); + Memory::record("Potential","vr_eff",NSPIN*nrxx,"double"); - delete[] this->vrs1; - this->vrs1 = new double[nrxx];//mohan add 2007-11-12 - Memory::record("potential","vrs1",nrxx,"double"); + delete[] this->vr_eff1; + this->vr_eff1 = new double[nrxx]; + Memory::record("Potential","vr_eff1",nrxx,"double"); this->vnew.create(NSPIN,nrxx); - Memory::record("potential","vnew",NSPIN*nrxx,"double"); + Memory::record("Potential","vnew",NSPIN*nrxx,"double"); return; } -// from PW/potinit.f90 //---------------------------------------------------------- -// EXPLAIN : -// This routine initializes the self consistent potential -// in the array vr -// if 'delta_vh=0' & 'vna=1', then -// the final potential: atom Hartree + Local pp = Vna -// else if 'delta_vh=1' & 'vna=0', then -// the final potential: remain Hartree potential. +// Initializes the self consistent potential //---------------------------------------------------------- -void potential::init_pot(const int &istep, const bool delta_vh, const bool vna) +void Potential::init_pot( + const int &istep, // number of ionic steps + ComplexMatrix &sf // structure factors +) { - TITLE("potential","init_pot"); - timer::tick("potential","init_pot"); + TITLE("Potential","init_pot"); + timer::tick("Potential","init_pot"); assert(istep>=0); - //ofs_running << " istep=" << istep << " delta_vh=" << delta_vh << " vna=" << vna << endl; - - vrs.zero_out(); + // total potential in real space + this->vr_eff.zero_out(); - // mohan fix bug 2011-07-08 // the vltot should and must be zero here. ZEROS(this->vltot, pw.nrxx); - // vna use this line to get delta_vh and V_Efield to do grid integration. - // if detal_vh is set to 1, then local pseudopotential is not added. - if(delta_vh) - { - if(EFIELD && !DIPOLE) - { - Efield EFID; - // in fact, chr.rho is not used here. - // if charge correction due to Efield is considered, - // the structure here need to be updated. - - static bool first = true; - if(first) - { - cout << " ADD THE EFIELD (V/A) : " << Efield::eamp*51.44 << endl; - first = false; - } - EFID.add_efield(chr.rho[0], this->vltot); - } - } - else - { - // (1) local part of pseudopotentials. - // set vltot - this->set_local(this->vltot); + //------------------------------------------------------------------- + // (1) local pseudopotential + electric field (if any) in vltot + //------------------------------------------------------------------- + this->set_local_pot( + this->vltot, // 3D local pseudopotentials + ucell.ntype, + pw.ngmc, + ppcell.vloc, + pw.ig2ngg, + sf // structure factors + ); + + // zhengdy-soc, pauli matrix, just index 0 has vlocal term + int nspin0=NSPIN; + + if(NSPIN==4) + { + nspin0=1; + } - // mohan fix bug 2011-07-07 - // set pseudopotentials. - int nspin0=NSPIN;//zhengdy-soc, pauli matrix, just index 0 has vlocal term. - if(NSPIN==4) nspin0=1; - for(int is=0; isvrs(is,ir) = this->vltot[ir]; - } - } - // (2) core correction potential. - chr.set_rho_core( pw.strucFac ); + for(int is=0; isvr_eff(is,ir) = this->vltot[ir]; + } + } - //if(vna==1)return; // tmp by mohan - } + // core correction potential. + CHR.set_rho_core( pw.strucFac ); - if(istep==0)//not begin to do ion relaxation. + //-------------------------------------------------------------------- + // (2) other effective potentials need charge density, + // choose charge density from ionic step 0. + //-------------------------------------------------------------------- + if(istep==0) { OUT(ofs_running,"start_pot",start_pot); @@ -120,7 +109,7 @@ void potential::init_pot(const int &istep, const bool delta_vh, const bool vna) if (this->start_pot == "atomic")//mohan add 2007-10-17 { start_from_atomic: - chr.atomic_rho(NSPIN, chr.rho); + CHR.atomic_rho(NSPIN, CHR.rho); } else if (this->start_pot == "file") { @@ -131,43 +120,50 @@ void potential::init_pot(const int &istep, const bool delta_vh, const bool vna) ssc << global_out_dir << "SPIN" << is + 1 << "_CHG"; ofs_running << ssc.str() << endl; // mohan update 2012-02-10 - if(chr.read_rho( is, ssc.str() )) + if(CHR.read_rho( is, ssc.str(), CHR.rho[is] )) { ofs_running << " Read in the charge density: " << ssc.str() << endl; - } - else if(is>0 && NSPIN==4) - { - if(PRENSPIN == 1) - {//read only up+down , others set to zero. - ofs_running << " Didn't read in the charge density but autoset it for spin " <0 && NSPIN==4) { - ofs_running << " rearrange charge density " << endl; - for(int ir=0;irv_of_rho( chr.rho, en.ehart, en.etxc, en.vtxc, vr, delta_vh, vna); //---------------------------------------------------------- - // Define the total local potential (external+scf) + // (3) compute Hartree and XC potentials saves in vr //---------------------------------------------------------- - if(vext == 0) this->set_vrs(pw.doublegrid); - else this->set_vrs_tddft(pw.doublegrid, istep); + this->v_of_rho(CHR.rho, vr); - //figure::picture(this->vrs1,pw.ncx,pw.ncy,pw.ncz); - timer::tick("potential","init_pot"); + //---------------------------------------------------------- + // (4) total potentials + //---------------------------------------------------------- + if(vext == 0) + { + this->set_vr_eff(); + } + else + { + this->set_vrs_tddft(istep); + } + + // plots + //figure::picture(this->vr_eff1,pw.ncx,pw.ncy,pw.ncz); + timer::tick("Potential","init_pot"); return; } -// from setlocal.f90 + //========================================================== // This routine computes the local potential in real space -// vltot(ir) //========================================================== -void potential::set_local(double* vl_pseudo)const +void Potential::set_local_pot( + double* vl_pseudo, // store the local pseudopotential + const int &ntype, // number of atom types + const int &ngmc, // number of |g|, g is plane wave + matrix &vloc, // local pseduopotentials + int* ig2ngg, // ig2ngg + ComplexMatrix &sf // structure factors +)const { - TITLE("potential","set_local"); - timer::tick("potential","set_local"); + TITLE("Potential","set_local_pot"); + timer::tick("Potential","set_local_pot"); + + complex *vg = new complex[ngmc]; + + ZEROS( vg, ngmc ); - complex *vg = new complex[pw.ngmc]; - ZEROS( vg, pw.ngmc ); - for (int it=0; itv_h(NSPIN, ehart, v_in, rho_atom); - - for(int is=0; isv_xc(rho_in, etxc, vtxc, v_in); + + #ifdef USE_LIBXC + Potential_Libxc::v_xc(rho_in, H_XC_pw::etxc, H_XC_pw::vtxc, v_in); + #else + H_XC_pw::v_xc(pw.nrxx, pw.ncxyz, ucell.omega, rho_in, CHR.rho_core, v_in); + #endif //---------------------------------------------------------- // calculate the Hartree potential //---------------------------------------------------------- - if(delta_vh) - { - //-------------------------------------------- - // get the atomic charge on real space grid. - //-------------------------------------------- - double** rho_atom = new double*[NSPIN]; - for(int is=0; isv_h(NSPIN, ehart, v_in, rho_atom); - - for(int is=0; isv_h(NSPIN, ehart, v_in, rho_in); - } + H_Hartree_pw::v_hartree(ucell, pw, UFFT, NSPIN, v_in, rho_in); // mohan add 2011-06-20 if(EFIELD && DIPOLE) @@ -365,602 +311,53 @@ void potential::v_of_rho EFID.add_efield(rho_in[is], &v_in.c[is*pw.nrxx]); } } - timer::tick("potential","v_of_rho",'E'); + timer::tick("Potential","v_of_rho",'E'); return; } //end subroutine v_of_rho -//-------------------------------------------------------------------- -void potential::v_xc -( - double **rho_in, - double &etxc, - double &vtxc, - matrix &v) -{ - TITLE("potential","v_xc"); - timer::tick("potential","v_xc"); - //Exchange-Correlation potential Vxc(r) from n(r) - etxc = 0.0; - vtxc = 0.0; - - // the square of the e charge - // in Rydeberg unit, so * 2.0. - double e2 = 2.0; - - double rhox = 0.0; - double arhox = 0.0; - double zeta = 0.0; - double ex = 0.0; - double ec = 0.0; - double vx[2]; - double vc[2]; - - int ir, is; - int neg [3]; - - double vanishing_charge = 1.0e-10; - if (NSPIN == 1 || ( NSPIN ==4 && !DOMAG && !DOMAG_Z)) - { - // spin-unpolarized case - // for parallel : ncxyz change ==> nrxx - // 2008-06-01 mohan - for (int ir = 0;ir < pw.nrxx;ir++) - { - rhox = rho_in[0][ir] + chr.rho_core[ir]; - arhox = abs(rhox); - if (arhox > vanishing_charge) - { - // call - XC_Functional::xc(arhox, ex, ec, vx[0], vc[0]); - //if(ir<10) - //{ - // cout << "\n ir = " << ir << " ex = " << ex << " ec = " << ec; - //} - v(0,ir) = e2 * (vx[0] + vc[0]); - etxc += e2 * (ex + ec) * rhox; - vtxc += v(0, ir) * rho_in[0][ir]; - } // endif - } //enddo - } - else if(NSPIN ==2) - { - // spin-polarized case - neg [0] = 0; - neg [1] = 0; - neg [2] = 0; - - // 2008-06-01 mohan - if (test_potential>0) cout<<"\n Begin calculate Exc(r) and Vxc(r)"; - for (ir = 0;ir < pw.nrxx;ir++) - { - rhox = rho_in[0][ir] + rho_in[1][ir] + chr.rho_core[ir]; //HLX(05-29-06): bug fixed - arhox = abs(rhox); - - if (arhox > vanishing_charge) - { - zeta = (rho_in[0][ir] - rho_in[1][ir]) / arhox; //HLX(05-29-06): bug fixed - - if (abs(zeta) > 1.0) - { - ++neg[2]; - zeta = (zeta > 0.0) ? 1.0 : (-1.0); - } - - if (rho_in[0][ir] < 0.0) - { - ++neg[0]; - } - - if (rho_in[1][ir] < 0.0) - { - ++neg[1]; - } - - // call - XC_Functional::xc_spin(arhox, zeta, ex, ec, vx[0], vx[1], vc[0], vc[1]); - - //if(ir<10) - //{ - // cout << "\n ir = " << ir << " ex = " << ex << " ec = " << ec; - //} - - for (is = 0;is < NSPIN;is++) - { - v(is, ir) = e2 * (vx[is] + vc[is]); - } - - etxc += e2 * (ex + ec) * rhox; - - vtxc += v(0, ir) * rho_in[0][ir] + v(1, ir) * rho_in[1][ir]; - } // endif - } // enddo - if (test_potential>0) cout<<"\n End calculate Exc(r) and Vxc(r) with SPIN == 2"; - - } // nspin 2 - else if(NSPIN == 4)//noncollinear case added by zhengdy - { - for( ir = 0;ir vanishing_charge ) - { - zeta = amag / arhox; - - if ( abs( zeta ) > 1.0 ) - { - neg[1] += 1.0 / ucell.omega; - - zeta = (zeta > 0.0) ? 1.0 : (-1.0); - }//end if - - XC_Functional::xc_spin( arhox, zeta, ex, ec, vx[0], vx[1], vc[0], vc[1] ); - double vs = 0.5 * ( vx[0] + vc[0] - vx[1] - vc[1] ); - v(0, ir) = e2*( 0.5 * ( vx[0] + vc[0] + vx[1] + vc[1] ) ); - - if ( amag > vanishing_charge ) - { - for(int ipol = 1;ipol< 4;ipol++) - { - v(ipol, ir) = e2 * vs * rho_in[ipol][ir] / amag; - vtxc += v(ipol,ir) * rho_in[ipol][ir]; - }//end do - }//end if - etxc += e2 * ( ex + ec ) * rhox; - vtxc += v(0,ir) * rho_in[0][ir]; - }//end if - }//end do - }//end if - // energy terms, local-density contributions - - // add gradient corrections (if any) - // mohan modify 2009-12-15 - GGA_PW::gradcorr(etxc, vtxc, v); - - // parallel code : collect vtxc,etxc - // mohan add 2008-06-01 - Parallel_Reduce::reduce_double_pool( etxc ); - Parallel_Reduce::reduce_double_pool( vtxc ); - - etxc *= ucell.omega / pw.ncxyz; - vtxc *= ucell.omega / pw.ncxyz; - if (test_potential > 1) - { - OUT(ofs_running,"etxc",etxc); - OUT(ofs_running,"vtxc",vtxc); - } - - if (test_potential >0 ) cout<<"\n End calculate gradient"; - - if (test_potential > 2) - { - cout<<"\n After gradcorr : vtxc = "< *Porter = UFFT.porter; - - // Hartree potential VH(r) from n(r) - ZEROS( Porter, pw.nrxx ); - int nspin0 = 1; - if(NSPIN==2)nspin0 = NSPIN; - for(int is=0; is( rho[is][ir], 0.0 ); - } - } - - //============================= - // bring rho (aux) to G space - //============================= - pw.FFT_chg.FFT3D(Porter, -1); - - //double charge; - //if (pw.gstart == 1) - //{ - // charge = ucell.omega * Porter[pw.ig2fftc[0]].real(); - //} - //OUT(ofs_running, "v_h charge", charge); - - //======================================================= - // calculate hartree potential in G-space (NB: V(G=0)=0 ) - //======================================================= - ehart = 0.0; - - complex *vh_g = new complex[pw.ngmc]; - ZEROS(vh_g, pw.ngmc); - - for (int ig = pw.gstart; ig= 1.0e-12) //LiuXh 20180410 - { - const double fac = e2 * FOUR_PI / (ucell.tpiba2 * pw.gg [ig]); - - ehart += ( conj( Porter[j] ) * Porter[j] ).real() * fac; - vh_g[ig] = fac * Porter[j]; - } - } - - Parallel_Reduce::reduce_double_pool( ehart ); - ehart *= 0.5 * ucell.omega; - - //cout << " ehart=" << ehart << endl; - - ZEROS(Porter, pw.nrxx); - - for (int ig = 0;ig < pw.ngmc;ig++) - { - Porter[pw.ig2fftc[ig]] = vh_g[ig]; - } - - //========================================== - //transform hartree potential to real space - //========================================== - pw.FFT_chg.FFT3D(Porter, 1); - //========================================== - //Add hartree potential to the xc potential - //========================================== - - if(NSPIN==4) - for (int ir = 0;ir < pw.nrxx;ir++) - { - v(0, ir) += Porter[ir].real(); - } - else - for (int is = 0;is < NSPIN;is++) - { - for (int ir = 0;ir < pw.nrxx;ir++) - { - v(is, ir) += Porter[ir].real(); - } - } - - //------------------------------------------- - // output the Hartree potential into a file. - //------------------------------------------- - if(out_potential==-2) - { - cout << " output VH" << endl; - int is = 0; - int iter = 0; - int precision = 3; - string fn = "VH.dat"; - stringstream ss; - ss << global_out_dir << fn; - matrix v; - v.create(1,pw.nrxx); - for(int ir=0; irwrite_potential( is, iter, ss.str(), v, precision, 1 ); - } - - timer::tick("potential","v_hartree"); - delete[] vh_g; - return; -} // end subroutine v_h - -// translate from write_rho in charge.cpp. -void potential::write_potential(const int &is, const int &iter, const string &fn, -const matrix &v, const int &precision, const int &hartree)const -{ - TITLE("potential","write_potential"); - - if(out_potential==0) - { - return; - } - else if(out_potential<0) - { - if(hartree==0) return; - } - else if(iter % out_potential != 0) - { - return; - } - timer::tick("potential","write_potential"); - - ofstream ofs; - - if(MY_RANK==0) - { - ofs.open( fn.c_str() ); - - ofs << ucell.latName << endl;//1 - ofs << " " << ucell.lat0 * 0.529177 << endl; - ofs << " " << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; - ofs << " " << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; - ofs << " " << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; - - for(int it=0; it=start_z[NPROC_IN_POOL-1]) - { - which_ip[iz] = NPROC_IN_POOL-1; - break; - } - else if(iz>=start_z[ip] && iz0) - for (int i = 0;i < pw.nrxx;i++) - { - this->vrs(is, i) = this->vr(is, i); - } - else - for (int i = 0;i < pw.nrxx;i++) - { - this->vrs(is, i) = this->vltot[i] + this->vr(is, i); - //cout <<"i: "<< i <<" "<< "vrs: " << vrs(is,i) <= 0) - { - for (int i = 0;i < pw.nrxx;i++) - { - this->vrs(is, i) = this->vltot[i] + this->vr(is, i); - } - } - else - { - this->vext = new double[pw.nrxx]; - const int yz = pw.ncy*pw.nczp; - int index, i, j, k; - - for(int ir=0; irvext[ir] = -0.4*k/pw.ncx+0.05; - //else if (k>=pw.ncx*0.1 && kvext[ir] = 0.1*k/pw.ncx; - //else if (k>=pw.ncx*0.9) this->vext[ir] = -0.4*(1.0*k/pw.ncx-1)+0.05; - - if (kvext[ir] = (0.019447*k/pw.ncx-0.001069585)*ucell.lat0; - else if (k>=pw.ncx*0.05 && kvext[ir] = -0.0019447*k/pw.ncx*ucell.lat0; - else if (k>=pw.ncx*0.95) this->vext[ir] = (0.019447*(1.0*k/pw.ncx-1)-0.001069585)*ucell.lat0; - - this->vrs(is,ir) = this->vltot[ir] + this->vr(is, ir) + this->vext[ir]; - - //cout << "x: " << k <<" " << "y: " << j <<" "<< "z: "<< i <<" "<< "ir: " << ir << endl; - //cout << "vext: " << this->vext[ir] << endl; - //cout << "vrs: " << vrs(is,ir) <0) + { + for (int i = 0;i < pw.nrxx; i++) + { + this->vr_eff(is, i) = this->vr(is, i); + } + } + else + { + for (int i = 0;i < pw.nrxx; i++) + { + this->vr_eff(is, i) = this->vltot[i] + this->vr(is, i); + } + } } -#endif - timer::tick("potential","set_vrs"); + timer::tick("Potential","set_vr_eff"); return; -} //end subroutine set_vrs +} + // ---------------------------------------------------------------------- -void potential::newd() +void Potential::newd(void) { - if (test_potential) TITLE("potential","newd"); + TITLE("Potential","newd"); // distringuish non-local pseudopotential in REAL or RECIPROCAL space. // if in real space, call new_r @@ -971,714 +368,57 @@ void potential::newd() // This routine computes the integral of the effective potential with // the Q function and adds it to the bare ionic D term which is used // to compute the non-local term in the US scheme. - if (!ppcell.okvan) - { - // no ultrasoft potentials: use bare coefficients for projectors - // if( spin_orbital) .... - // else if(noncolin) .... - for (int iat=0; iat(0.0 , 0.0); - ppcell.deeq_nc(is, iat, jh, ih) = complex(0.0 , 0.0); - } - else if(is==2) - { - ppcell.deeq_nc(is, iat, ih, jh) = complex(0.0 , 0.0); - ppcell.deeq_nc(is, iat, jh, ih) = complex(0.0 , 0.0); - } - else if(is==3) - { - ppcell.deeq_nc(is, iat, ih, jh) = ppcell.dvan(it, ih, jh); - ppcell.deeq_nc(is, iat, jh, ih) = ppcell.dvan(it, ih, jh); - } - } - else{ - ppcell.deeq(is, iat, ih, jh) = ppcell.dvan(it, ih, jh); - ppcell.deeq(is, iat, jh, ih) = ppcell.dvan(it, ih, jh); - } - } - } - } - } - return; - } - //==================== - // if use PAW method - //==================== - /* if (okpaw) then - ! Add paw contributions to deeq (computed in paw_potential) - do na=1,nat - nt = ityp(na) - IF (.not.upf(nt)%tpawp) cycle - ijh=0 - do ih=1,nh(nt) - do jh=ih,nh(nt) - ijh=ijh+1 - deeq(ih,jh,na,1:nspin) = deeq(ih,jh,na,1:nspin) & - + ddd_paw(ijh,na,1:nspin) - deeq(jh,ih,na,1:nspin) = deeq(ih,jh,na,1:nspin) - end do - end do - end do - end IF - */ - - return; + // no ultrasoft potentials: use bare coefficients for projectors + // if( spin_orbital) .... + // else if(noncolin) .... + for (int iat=0; iat(0.0 , 0.0); + ppcell.deeq_nc(is, iat, jh, ih) = complex(0.0 , 0.0); + } + else if(is==2) + { + ppcell.deeq_nc(is, iat, ih, jh) = complex(0.0 , 0.0); + ppcell.deeq_nc(is, iat, jh, ih) = complex(0.0 , 0.0); + } + else if(is==3) + { + ppcell.deeq_nc(is, iat, ih, jh) = ppcell.dvan(it, ih, jh); + ppcell.deeq_nc(is, iat, jh, ih) = ppcell.dvan(it, ih, jh); + } + } + else + { + ppcell.deeq(is, iat, ih, jh) = ppcell.dvan(it, ih, jh); + ppcell.deeq(is, iat, jh, ih) = ppcell.dvan(it, ih, jh); + } + } + } + } + } + return; } // end subroutine newd - -void potential::print_pot(ofstream &ofs)const -{ - // ofs << "\n potinit() : "; - ofs << "\n vtxc = " << en.vtxc; - ofs << "\n etxc = " << en.etxc; - ofs << "\n ehart = " << en.ehart; - // ofs << "\n charge = " << charge; - out.printr1_d(ofs, " vltot : ", vltot, pw.nrxx); - out.printrm(ofs, " vrs : ", vrs); - -} - -/* - -// from mix_potential.f90 -//----------------------------------------------------------------------- -void potential::mix_potential (int ndim, double *vout, double *vin, double alphamix, - double &dr2, double tr2, int iter, int n_iter, string filename, - bool &conv) -{ - cout << "\n ==== mix_potential() ==== "; - //----------------------------------------------------------------------- - // - // Modified Broyden"s method for potential/charge density mixing - // D.D.Johnson, PRB 38, 12807 (1988) - // On input : - // ndim dimension of arrays vout, vin - // vout output potential/rho at current iteration - // vin potential/rho at previous iteration - // alphamix mixing factor (0 < alphamix <= 1) - // tr2 threshold for selfconsistency - // iter current iteration number - // n_iter number of iterations used in the mixing - // filename if present save previous iterations on file "filename" - // otherwise keep everything in memory - // On output: - // dr2 [(vout-vin)/ndim]^2 - // vin mixed potential - // vout vout-vin - // conv true if dr2 <= tr2 - - // First the dummy variables - // character (len=42) :: filename - // integer :: ndim, iter, n_iter - // real(kind=DP) :: vout (ndim), vin (ndim), alphamix, dr2, tr2 - // logical :: conv - - // Here the local variables - - // max number of iterations used in mixing: n_iter must be .le. maxter - // parameter : - int maxter = 8; - - int n, i, j, *iwork, info, iter_used, - ipos, inext, ndimtot; - iwork = new int[maxter]; - assert(iwork != 0); - // work space containing info from previous iterations: - // must be kept in memory and saved between calls if filename=' ' - - // allocatable, save :: - matrix df, dv ; - double *vinsave, *ework; - ework = new double[maxter]; - assert(ework != 0); - matrix beta (maxter, maxter); - double gamma, norm; - - // adjustable parameters as suggested in the original paper - double *w, w0; - w = new double[maxter]; - // data : - w0 = 0.010 ; - // w / maxter * 1.0 / ? - - double *work; - work = new double[maxter];//? - assert(work != 0); - start_clock ("mix_pot"); - - if (iter < 1) - cout << "\n mix_potential, iter is wrong"; - if (nmix > maxter) - cout << "\n mix_potential, nmix too big"; - if (ndim <= 0) - cout << "\n mix_potential, ndim <= 0"; - - for(n=0;n n_iter - iter_used = (iter - 1 < nmix)?(iter-1):nmix; // min - // ipos is the position in which results from the present iteraction - // are stored. ipos=iter-1 until ipos=n_iter, then back to 1,2,... - - ipos = iter - 1 - ( (iter - 2) / nmix) * nmix; - if (iter > 1){ - for(n=0;n - // [sum_i v(i)^n] / size of the array - double ave = 0.0; - if (size < 0) - { - cout << "\n The size of the array should > = 1, error"; - exit(0); - } - for (int i =0; i< size; i++) ave += pow(p[i], n); - return ( ave / static_cast(size) ) ; -} - - -//========================================================== -// this function aims to add external time-dependent potential (eg: linear potential) -// used in tddft -// fuxiang add in 2017-05 -//========================================================== - -void potential::set_vrs_tddft(const bool doublegrid, const int istep) -{ - TITLE("potential","set_vrs_tddft"); - timer::tick("potential","set_vrs_tddft"); - - for (int is = 0;is < NSPIN;is++) - { - //==================================================== - // add external linear potential, fuxiang add in 2017/05 - //==================================================== - - const int timescale = 1; // get the time that vext influences; - if (istep >= timescale) - { - for (int i = 0;i < pw.nrxx;i++) - { - this->vrs(is, i) = this->vltot[i] + this->vr(is, i); - } - cout << "vext = 0! " << endl; - } - else - { - this->vextold = new double[pw.nrxx]; - this->vext = new double[pw.nrxx]; - const int yz = pw.ncy*pw.nczp; - int index, i, j, k; - - for(int ir=0; irvextold[ir] = (0.019447*k/pw.ncx-0.001069585)*ucell.lat0; - else if (k>=pw.ncx*0.05 && kvextold[ir] = -0.0019447*k/pw.ncx*ucell.lat0; - else if (k>=pw.ncx*0.95) this->vextold[ir] = (0.019447*(1.0*k/pw.ncx-1)-0.001069585)*ucell.lat0; - } - else if(vext_dire == 2) - { - if (jvextold[ir] = (0.019447*j/pw.ncx-0.001069585)*ucell.lat0; - else if (j>=pw.ncx*0.05 && jvextold[ir] = -0.0019447*j/pw.ncx*ucell.lat0; - else if (j>=pw.ncx*0.95) this->vextold[ir] = (0.019447*(1.0*j/pw.ncx-1)-0.001069585)*ucell.lat0; - } - else if(vext_dire == 3) - { - if (ivextold[ir] = (0.019447*i/pw.ncx-0.001069585)*ucell.lat0; - else if (i>=pw.ncx*0.05 && ivextold[ir] = -0.0019447*i/pw.ncx*ucell.lat0; - else if (i>=pw.ncx*0.95) this->vextold[ir] = (0.019447*(1.0*i/pw.ncx-1)-0.001069585)*ucell.lat0; - } - - // Gauss -/* - const double w = 22.13; // eV - const double sigmasquare = 6836; - const double timecenter = 700; - const double timenow = (istep-timecenter)*INPUT.md_dt*41.34; - this->vext[ir] = this->vextold[ir]*cos(w/27.2116*timenow)*exp(-timenow*timenow*0.5/(sigmasquare))*0.25; //0.1 is modified in 2018/1/12 -*/ - - //HHG of H atom -/* - if(istep < 1875) - { - this->vext[ir] = this->vextold[ir]*2.74*istep/1875*cos(0.0588*istep*INPUT.md_dt*41.34); // 2.75 is equal to E0; - } - else if(istep < 5625) - { - this->vext[ir] = this->vextold[ir]*2.74*cos(0.0588*istep*INPUT.md_dt*41.34); - } - else if(istep < 7500) - { - this->vext[ir] = this->vextold[ir]*2.74*(7500-istep)/1875*cos(0.0588*istep*INPUT.md_dt*41.34); - } -*/ - - //HHG of H2 - - //const double timenow = (istep)*INPUT.md_dt*41.34; - //this->vext[ir] = this->vextold[ir]*2.74*cos(0.856*timenow)*sin(0.0214*timenow)*sin(0.0214*timenow); - //this->vext[ir] = this->vextold[ir]*2.74*cos(0.856*timenow)*sin(0.0214*timenow)*sin(0.0214*timenow)*0.01944; - //this->vext[ir] = this->vextold[ir]*2.74*cos(0.0428*timenow)*sin(0.00107*timenow)*sin(0.00107*timenow); - - this->vrs(is,ir) = this->vltot[ir] + this->vr(is, ir) + this->vext[ir]; - - //cout << "x: " << k <<" " << "y: " << j <<" "<< "z: "<< i <<" "<< "ir: " << ir << endl; - //cout << "vext: " << this->vext[ir] << endl; - //cout << "vrs: " << vrs(is,ir) <vextold; - delete[] this->vext; - } - - //==================================================== - // And interpolate it on the smooth mesh if necessary - //==================================================== - /* - if (doublegrid) - { - double *vrs_1d = new double[pw.nrxx](); - assert(vrs_1d != 0); - dcopy(vrs, is, vrs_1d); - //interpolate (vrs (1, is), vrs (1, is), - 1); - interpolate(vrs_1d, vrs_1d, -1); - //(vrs ( is, 0), vrs ( is, 0), - 1); - delete [] vrs_1d; - } - */ - } - -#ifdef __FP - if(BFIELD) - { - if(NSPIN==2) - { - bfid.add_zeeman(); - } - } -#endif - - timer::tick("potential","set_vrs_tddft"); - return; -} //end subroutine set_vrs_tddft - -void potential::write_elecstat_pot(const string &fn, const string &fn_ave) -{ - TITLE("potential","write_elecstat_pot"); - timer::tick("potential","write_elecstat_pot"); - - double *v_elecstat; - v_elecstat = new double[pw.nrxx]; - ZEROS(v_elecstat, pw.nrxx); - - complex *Porter = UFFT.porter; - ZEROS( Porter, pw.nrxx ); - - int nspin0 = 1; - if(NSPIN==2) nspin0 = NSPIN; - for(int is=0; is( chr.rho[is][ir], 0.0 ); - } - } - - //============================= - // bring rho (aux) to G space - //============================= - pw.FFT_chg.FFT3D(Porter, -1); - - //======================================================= - // calculate hartree potential in G-space (NB: V(G=0)=0 ) - //======================================================= - complex *vh_g = new complex[pw.ngmc]; - ZEROS(vh_g, pw.ngmc); - - for(int ig = pw.gstart; ig= 1.0e-12) //LiuXh 20180410 - { - const double fac = e2 * FOUR_PI / (ucell.tpiba2 * pw.gg [ig]); - vh_g[ig] = fac * Porter[j]; - } - } - - ZEROS(Porter, pw.nrxx); - - for (int ig = 0;ig < pw.ngmc;ig++) - { - Porter[pw.ig2fftc[ig]] = vh_g[ig]; - } - - //========================================== - //transform hartree potential to real space - //========================================== - pw.FFT_chg.FFT3D(Porter, 1); - //========================================== - //Add hartree potential and local pseudopot - //========================================== - for (int ir = 0;ir < pw.nrxx;ir++) - { - v_elecstat[ir] = Porter[ir].real() + this->vltot[ir]; - } - - //------------------------------------------- - // output the electrostatic potential into a file. - //------------------------------------------- - ofstream ofs; - ofstream ofs_ave; - - if(MY_RANK==0) - { - ofs.open( fn.c_str() ); - ofs_ave.open( fn_ave.c_str() ); - - ofs << ucell.latName << endl;//1 - ofs << " " << ucell.lat0 * 0.529177 << endl; - ofs << " " << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; - ofs << " " << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; - ofs << " " << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; - - ofs_ave << ucell.latName << endl;//1 - ofs_ave << " " << ucell.lat0 * 0.529177 << endl; - ofs_ave << " " << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; - ofs_ave << " " << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; - ofs_ave << " " << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; - - for(int it=0; it=start_z[NPROC_IN_POOL-1]) - { - which_ip[iz] = NPROC_IN_POOL-1; - break; - } - else if(iz>=start_z[ip] && iz funcs = init_func(); + + // the type of input_tmp is automatically set to 'tuple' + // [rho, sigma, gdr] = cal_input( funcs, rho_in ); + const auto input_tmp = cal_input( funcs, rho_in ); + + // obtain the electron charge density rho from 'get' function (first variable) + const vector &rho = std::get<0>(input_tmp); + + // obtain the sigma from 'get' function (second variable) + const vector &sigma = std::get<1>(input_tmp); + + for( xc_func_type &func : funcs ) + { + vector exc ( pw.nrxx ); + vector vrho ( pw.nrxx * nspin0() ); + vector vsigma( pw.nrxx * ((1==nspin0())?1:3) ); + + // cal etxc from rho, exc + auto process_exc = [&](vector &sgn) + { + for( size_t is=0; is!=nspin0(); ++is ) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + etxc += e2 * exc[ir] * rho[ir*nspin0()+is] * sgn[ir*nspin0()+is]; + } + } + }; + + // cal vtx, v from rho_in, vrho + auto process_vrho = [&](vector &sgn) + { + if(nspin0()==1 || NSPIN==2) + { + for( size_t is=0; is!=nspin0(); ++is ) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + const double v_tmp = e2 * vrho[ir*nspin0()+is] * sgn[ir*nspin0()+is]; + v(is,ir) += v_tmp; + vtxc += v_tmp * rho_in[is][ir]; + } + } + } + else // may need updates for SOC + { + constexpr double vanishing_charge = 1.0e-12; + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + vector v_tmp(4); + v_tmp[0] = e2 * (0.5 * (vrho[ir*2] + vrho[ir*2+1])); + const double vs = 0.5 * (vrho[ir*2] - vrho[ir*2+1]); + const double amag = sqrt( pow(rho_in[1][ir],2) + + pow(rho_in[2][ir],2) + + pow(rho_in[3][ir],2) ); + + if(amag>vanishing_charge) + { + for(int ipol=1; ipol<4; ++ipol) + { + v_tmp[ipol] = e2 * vs * rho_in[ipol][ir] / amag; + } + } + for(int ipol=0; ipol<4; ++ipol) + { + v(ipol, ir) += v_tmp[ipol]; + vtxc += v_tmp[ipol] * rho_in[ipol][ir]; + } + } + } + + }; + + // cal vtxc, v from rho_in, rho, gdr, vsigma + auto process_vsigma = [&](vector &sgn) + { + const std::vector>> &gdr = std::get<2>(input_tmp); + + vector>> h( nspin0(), vector>(pw.nrxx) ); + if( 1==nspin0() ) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + h[0][ir] = e2 * gdr[0][ir] * vsigma[ir] * 2.0 * sgn[ir]; + } + } + else + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + h[0][ir] = e2 * (gdr[0][ir] * vsigma[ir*3 ] * 2.0 + * sgn[ir*2 ] + gdr[1][ir] * vsigma[ir*3+1] * sgn[ir*2] * sgn[ir*2+1]); + h[1][ir] = e2 * (gdr[1][ir] * vsigma[ir*3+2] * 2.0 + * sgn[ir*2+1] + gdr[0][ir] * vsigma[ir*3+1] * sgn[ir*2] * sgn[ir*2+1]); + } + } + + // define two dimensional array dh [ nspin, pw.nrxx ] + vector> dh(nspin0(), vector(pw.nrxx)); + for( size_t is=0; is!=nspin0(); ++is ) + { + GGA_PW::grad_dot( VECTOR_TO_PTR(h[is]), VECTOR_TO_PTR(dh[is]) ); + } + + + for( size_t is=0; is!=nspin0(); ++is ) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + vtxc -= dh[is][ir] * rho[ir*nspin0()+is]; + } + } + + if(nspin0()==1 || NSPIN==2) + { + for( size_t is=0; is!=nspin0(); ++is ) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + v(is,ir) -= dh[is][ir]; + } + } + } + else // may need updates for SOC + { + constexpr double vanishing_charge = 1.0e-12; + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + v(0,ir) -= 0.5 * (dh[0][ir] + dh[1][ir]); + const double amag = sqrt( pow(rho_in[1][ir],2) + pow(rho_in[2][ir],2) + pow(rho_in[3][ir],2) ); + const double neg = (soc.lsign && rho_in[1][ir]*soc.ux[0] + +rho_in[2][ir]*soc.ux[1]+rho_in[3][ir]*soc.ux[2]<=0) ? -1 : 1; + if(amag > vanishing_charge) + { + for(int i=1;i<4;i++) + { + v(i,ir) -= neg * 0.5 * (dh[0][ir]-dh[1][ir]) * rho_in[i][ir] / amag; + } + } + } + } + }; + + // jiyy add for threshold + constexpr double rho_threshold = 1E-6; + constexpr double grho_threshold = 1E-10; + xc_func_set_dens_threshold(&func, rho_threshold); + + // LPZ: Explain what is sgn + vector sgn( pw.nrxx * nspin0(), 1.0); + if(nspin0()==2 && func.info->family != XC_FAMILY_LDA && func.info->kind==XC_CORRELATION) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + if ( rho[ir*2]family" includes LDA, GGA, Hybrid functional (HYB). + //------------------------------------------------------------------ + switch( func.info->family ) + { + case XC_FAMILY_LDA: + // call Libxc function: xc_lda_exc_vxc + xc_lda_exc_vxc( &func, pw.nrxx, + VECTOR_TO_PTR(rho), VECTOR_TO_PTR(exc), VECTOR_TO_PTR(vrho) ); + process_exc(sgn); + process_vrho(sgn); + break; + case XC_FAMILY_GGA: + case XC_FAMILY_HYB_GGA: + // call Libxc function: xc_gga_exc_vxc + xc_gga_exc_vxc( &func, pw.nrxx, + VECTOR_TO_PTR(rho), VECTOR_TO_PTR(sigma), VECTOR_TO_PTR(exc), + VECTOR_TO_PTR(vrho), VECTOR_TO_PTR(vsigma) ); + process_exc(sgn); + process_vrho(sgn); + process_vsigma(sgn); + break; + default: + throw domain_error("func.info->family ="+TO_STRING(func.info->family) + +" unfinished in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + break; + } + // Libxc function: Deallocate memory + xc_func_end(&func); + } + + + //------------------------------------------------- + // for MPI, reduce the exchange-correlation energy + //------------------------------------------------- + Parallel_Reduce::reduce_double_pool( etxc ); + Parallel_Reduce::reduce_double_pool( vtxc ); + + etxc *= ucell.omega / pw.ncxyz; + vtxc *= ucell.omega / pw.ncxyz; + + timer::tick("Potential_Libxc","v_xc"); + return; +} + + +//---------------------------------------------------------------------------- +// for adding new xc functionals, only this function needs to be updated +// now we use iexch, igcx, icorr, igcc in xcf to characterize XC functionals +//---------------------------------------------------------------------------- +std::vector Potential_Libxc::init_func() +{ + // 'funcs' is the return value + std::vector funcs; + + const int xc_polarized = (1==nspin0()) ? XC_UNPOLARIZED : XC_POLARIZED; + + //------------------------------------------- + // define a function named 'add_func', which + // will be called in the following codes + //------------------------------------------- + auto add_func = [&]( const int function ) + { + funcs.push_back({}); + // 'xc_func_init' is defined in Libxc + xc_func_init( &funcs.back(), function, xc_polarized ); + }; + + //-------------------------------------- + // for the exchange energy + //-------------------------------------- + if( 6==xcf.iexch_now && + 8==xcf.igcx_now && + 4==xcf.icorr_now && + 4==xcf.igcc_now ) // GGA functional + { + add_func( XC_HYB_GGA_XC_PBEH ); + double parameter_hse[3] = { exx_global.info.hybrid_alpha, + exx_global.info.hse_omega, + exx_global.info.hse_omega }; + xc_func_set_ext_params(&funcs.back(), parameter_hse); + return funcs; + } + else if( 9==xcf.iexch_now && + 12==xcf.igcx_now && + 4==xcf.icorr_now && + 4==xcf.igcc_now ) // HSE06 hybrid functional + { + add_func( XC_HYB_GGA_XC_HSE06 ); + double parameter_hse[3] = { exx_global.info.hybrid_alpha, + exx_global.info.hse_omega, + exx_global.info.hse_omega }; + xc_func_set_ext_params(&funcs.back(), parameter_hse); + return funcs; + } + + if( 1==xcf.iexch_now && + 0==xcf.igcx_now ) // LDA functional + { + add_func( XC_LDA_X ); + } + else if( 1==xcf.iexch_now && + 3==xcf.igcx_now ) // GGA functional + { + add_func( XC_GGA_X_PBE ); + } + else + { + throw domain_error("iexch="+TO_STRING(xcf.iexch_now)+", igcx=" + +TO_STRING(xcf.igcx_now)+" unfinished in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + + //-------------------------------------- + // for the correlation energy part + //-------------------------------------- + if( 1==xcf.icorr_now && 0==xcf.igcc_now ) + { + add_func( XC_LDA_C_PZ ); + } + else if( 4==xcf.icorr_now && 4==xcf.igcc_now ) + { + add_func( XC_GGA_C_PBE ); + } + else + { + throw domain_error("icorr="+TO_STRING(xcf.icorr_now)+", igcc=" + +TO_STRING(xcf.igcc_now)+" unfinished in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + + return funcs; +} + + + +// [rho, sigma, gdr] = cal_input( funcs, rho_in ) +std::tuple< std::vector, + std::vector, + std::vector>> > +Potential_Libxc::cal_input( + const std::vector &funcs, + const double * const * const rho_in ) +{ + // ..., ↑_{i},↓_{i}, ↑_{i+1},↓_{i+1}, ... + std::vector rho; + bool finished_rho = false; + + // here we assume CHR.rho_core equally exists in different spins, may need double check + auto cal_rho = [&]() + { + if(!finished_rho) + { + rho.resize(pw.nrxx*nspin0()); + if(nspin0()==1 || NSPIN==2) + { + for( size_t is=0; is!=nspin0(); ++is ) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + rho[ir*nspin0()+is] = rho_in[is][ir] + 1.0/nspin0()*CHR.rho_core[ir]; + } + } + } + else // may need updates for SOC + { + if(xcf.igcx||xcf.igcc) + { + soc.cal_ux(ucell.ntype); + } + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + const double amag = sqrt( pow(rho_in[1][ir],2) + pow(rho_in[2][ir],2) + pow(rho_in[3][ir],2) ); + const double neg = (soc.lsign && rho_in[1][ir]*soc.ux[0] + +rho_in[2][ir]*soc.ux[1] + +rho_in[3][ir]*soc.ux[2]<=0) ? -1 : 1; + rho[ir*2] = 0.5 * (rho_in[0][ir] + neg * amag) + 0.5 * CHR.rho_core[ir]; + rho[ir*2+1] = 0.5 * (rho_in[0][ir] - neg * amag) + 0.5 * CHR.rho_core[ir]; + } + } + } + finished_rho = true; + }; + + // [...,↑_{i},↑_{i+1},...], [...,↓_{i},↓_{i+1},...] + std::vector>> gdr; + bool finished_gdr = false; + auto cal_gdr = [&]() + { + if(!finished_gdr) + { + gdr.resize( nspin0() ); + for( size_t is=0; is!=nspin0(); ++is ) + { + vector rhor(pw.nrxx); + for(int ir=0; ir> rhog(pw.ngmc); + + //------------------------------------------- + // bring electron charge density from real + // space to reciprocal space + //------------------------------------------- + CHR.set_rhog(rhor.data(), rhog.data()); + + //------------------------------------------- + // compute the gradient of charge density and + // store the gradient in gdr[is] + //------------------------------------------- + gdr[is].resize(pw.nrxx); + GGA_PW::grad_rho(rhog.data(), gdr[is].data()); + } + } + finished_gdr = true; + }; + + // ..., ↑↑_{i},↑↓_{i},↓↓_{i}, ↑↑_{i+1},↑↓_{i+1},↓↓_{i+1}, ... + std::vector sigma; + bool finished_sigma = false; + auto cal_sigma = [&]() + { + if(!finished_sigma) + { + sigma.resize( pw.nrxx * ((1==nspin0())?1:3) ); + + if( 1==nspin0() ) + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + sigma[ir] = gdr[0][ir]*gdr[0][ir]; + } + } + else + { + for( size_t ir=0; ir!=pw.nrxx; ++ir ) + { + sigma[ir*3] = gdr[0][ir]*gdr[0][ir]; + sigma[ir*3+1] = gdr[0][ir]*gdr[1][ir]; + sigma[ir*3+2] = gdr[1][ir]*gdr[1][ir]; + } + } + } + finished_sigma = true; + }; + + for( const xc_func_type &func : funcs ) + { + switch( func.info->family ) + { + case XC_FAMILY_LDA: + cal_rho(); + break; + case XC_FAMILY_GGA: + case XC_FAMILY_HYB_GGA: + cal_rho(); + cal_gdr(); + cal_sigma(); + break; + default: + throw domain_error("func.info->family =" + +TO_STRING(func.info->family)+" unfinished in " + +TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + break; + } + } + + return std::make_tuple( rho, sigma, gdr ); +} + +#endif //ifdef USE_LIBXC diff --git a/ABACUS.develop/source/src_pw/potential_libxc.h b/ABACUS.develop/source/src_pw/potential_libxc.h new file mode 100644 index 0000000000..54c3352523 --- /dev/null +++ b/ABACUS.develop/source/src_pw/potential_libxc.h @@ -0,0 +1,68 @@ +//========================================================== +// AUTHOR : Peize Lin +// DATE : 2017-09-14 +// UPDATE : 2021-02-28 +//========================================================== + +#ifdef USE_LIBXC + +#ifndef POTENTIAL_LIBXC_H +#define POTENTIAL_LIBXC_H + +#include "src_global/matrix.h" +#include "src_global/vector3.h" +#include "src_global/global_variable.h" +#include "src_global/global_function.h" +#include +#include +#include + +class Potential_Libxc +{ + public: + + //------------------------------------------------ + // evaluate the exchange-correlation (XC) energy + // by using the input charge density rho_in + //------------------------------------------------ + static void v_xc( + const double * const * const rho_in, + double &etxc, + double &vtxc, + matrix &v); + + private: + + //------------------------------------------- + // return the type of XC functional by + // calling init_func() + //------------------------------------------- + static std::vector init_func(); + + //------------------------------------------------ + // evaluate three quantities: rho, sigma, and gdr + // according to the input types of XC functionals + //------------------------------------------------ + // [rho, sigma, gdr] = cal_input( funcs, rho_in ) + static std::tuple< + std::vector, + std::vector, + std::vector>> > + cal_input( + const std::vector &funcs, + const double * const * const rho_in ); + + //---------------------------- + // decide the value of spin + //---------------------------- + static int nspin0() // may need updates from SOC + { + if (NSPIN==1 || (NSPIN==4 && (!DOMAG && !DOMAG_Z))) return 1; + else if(NSPIN==2 || (NSPIN==4 && ( DOMAG || DOMAG_Z))) return 2; + else throw runtime_error(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } +}; + +#endif + +#endif // ifdef USE_LIBXC diff --git a/ABACUS.develop/source/src_pw/pseudo_atom.cpp b/ABACUS.develop/source/src_pw/pseudo_atom.cpp index 04e4dc1d95..0177a0e8e2 100644 --- a/ABACUS.develop/source/src_pw/pseudo_atom.cpp +++ b/ABACUS.develop/source/src_pw/pseudo_atom.cpp @@ -30,13 +30,11 @@ void pseudo_atom::set_pseudo_at(const Pseudopot_upf &upf) // in order to calculate more accurate Vna. rcut = 15.0;//(a.u.); -#ifdef __FP //if(!LOCAL_BASIS) xiaohui modify 2013-09-02 // mohan modified 2009-1-21 if(BASIS_TYPE=="pw") //xiaohui add 2013-09-02 { //rcut = winput::rcut; } -#endif // remember to update here if you need it. // rcut = 25.0; diff --git a/ABACUS.develop/source/src_pw/pseudo_atom.h b/ABACUS.develop/source/src_pw/pseudo_atom.h index fcfbf41712..470dfc910f 100644 --- a/ABACUS.develop/source/src_pw/pseudo_atom.h +++ b/ABACUS.develop/source/src_pw/pseudo_atom.h @@ -1,13 +1,3 @@ -//===================================================================== -// Atomic part -// ... // the mesh where the PP is defined -// ... // non-linear core correction, optional -// ... // atomic charge density -// ... // atomic wavfunctions -// The variables needed to describe the atoms and related quantities -// based on atom.f90 -// USE parameters, ONLY : npsx, ndmx, nchix //maybe not necessary -//===================================================================== #ifndef PSEUDO_ATOM_H #define PSEUDO_ATOM_H @@ -17,7 +7,8 @@ class pseudo_atom: public pseudo_h { -public: + public: + // double *r; // radial logaritmic mesh, r[0:mesh-1] double *rab; // derivative of the radial mesh, rab[0:mesh-1] diff --git a/ABACUS.develop/source/src_pw/pseudo_h.cpp b/ABACUS.develop/source/src_pw/pseudo_h.cpp index d804cb5618..885c063829 100644 --- a/ABACUS.develop/source/src_pw/pseudo_h.cpp +++ b/ABACUS.develop/source/src_pw/pseudo_h.cpp @@ -2,7 +2,7 @@ // AUTHOR : Lixin He,mohan // DATE : 2008-11-11 //========================================================== -#include "functional.h" +#include "xc_type.h" #include "global.h" #include "pseudo_h.h" #include "tools.h" @@ -55,7 +55,10 @@ void pseudo_h::set_pseudo_h(const Pseudopot_upf &upf) this->lmax = upf.lmax; this->mesh = upf.mesh; - + + // mohan update 2021-02-22 + // max number of points in the atomic radial mesh + int ndmx = 2000; if (this->mesh > ndmx) { cout << "\n set_pseudo_h, too many grid points,"; diff --git a/ABACUS.develop/source/src_pw/pseudo_h.h b/ABACUS.develop/source/src_pw/pseudo_h.h index 097ba808ce..24eda08d38 100644 --- a/ABACUS.develop/source/src_pw/pseudo_h.h +++ b/ABACUS.develop/source/src_pw/pseudo_h.h @@ -1,9 +1,3 @@ -/***************************************************************** -// General information part -// base on pseudo_type.f90, -// ... // for reader's information only -// ... // general information about the pseudopotential -*******************************************************************/ #ifndef PSEUDOH_H #define PSEUDOH_H @@ -19,6 +13,9 @@ class pseudo_h { public: + pseudo_h(); + ~pseudo_h(); + // bool has_so; // if .true. includes spin-orbit int nv; // UPF file version number @@ -39,51 +36,13 @@ class pseudo_h int *lchi; // lchi[nchi] double *oc; // oc[nchi] - /* */ -// char generated[80]; // author -// char date_author[80]; // Misc info -// char comment[80]; // -// int * nn; // nn(nwfc) -// double * rcut; // cut-off radius(nwfc) ?? -// double * rcutus; // cut-off ultrasoft radius (nwfc) -// double * epseu; // energy (nwfc) -// double xmin; // the minimum x of the linear mesh -// double rmax; // the maximum radius of the mesh -// double zmesh; // the nuclear charge used for mesh -// double dx; // the deltax of the linear mesh -// double *jchi; // jchi(nwfc) - double *jjj; // total angual momentum, jjj[nbeta] - double *jchi; //jchi(nwfc), added by zhengdy-soc + double *jjj; // total angual momentum, jjj[nbeta] + double *jchi; //jchi(nwfc), added by zhengdy-soc int *nn; - pseudo_h(); - ~pseudo_h(); - // member functions void set_pseudo_h(const Pseudopot_upf &upf); void print_pseudo_h(ofstream &ofs); }; #endif // PSEUDOH_H - -/* -// pseudo-potential that has spin-orboit term -// We are not going to implement this PP in the first version -// USE parameters, ONLY : lqmax, nbrx, npsx, nqfx, ndmx - -#ifndef PSEUDO_SO_H -#define PSEUDO_SO_H - -class pseudo_so:public pseudo_us -{ - double *jjj; //(nbrx,npsx), &! total angular momentum of the beta function -// pseudo_us uspp; // if SO+USPP - - pseudo_so(); - ~pseudo_so(); - - void set_pseudo_upf(); - -}; -#endif // PSEUDO_SO_H -*/ diff --git a/ABACUS.develop/source/src_pw/pseudo_nc.h b/ABACUS.develop/source/src_pw/pseudo_nc.h index 851175a902..80b8f4f61d 100644 --- a/ABACUS.develop/source/src_pw/pseudo_nc.h +++ b/ABACUS.develop/source/src_pw/pseudo_nc.h @@ -1,14 +1,3 @@ -/************************************************************* -// Norm conserving NON-LOCAL pseudopotential (NCNL-PP) -// include pseudo_vl -// ... // projector -// ... // d(i,j) - -// Norm-conserving (atomitic) potential -// based on MODULE uspp_param -// USE parameters, ONLY : lqmax, nbrx, npsx, nqfx, ndmx -*************************************************************/ - #ifndef PSEUDO_NC_H #define PSEUDO_NC_H @@ -18,7 +7,11 @@ class pseudo_nc: public pseudo_vl { -public: + public: + + pseudo_nc(); + ~pseudo_nc(); + // int *lll; // lll(nbeta), angular momentum of the beta function int kkbeta; // kkbeta(nbeta), point where the beta are zero @@ -30,9 +23,6 @@ class pseudo_nc: public pseudo_vl // other int nh; // number of beta functions per atomic type - pseudo_nc(); - ~pseudo_nc(); - void set_pseudo_nc(const Pseudopot_upf &upf); void print_pseudo_nc(ofstream &ofs); diff --git a/ABACUS.develop/source/src_pw/pseudo_us.cpp b/ABACUS.develop/source/src_pw/pseudo_us.cpp index e819c0aa3c..2bdabf1615 100644 --- a/ABACUS.develop/source/src_pw/pseudo_us.cpp +++ b/ABACUS.develop/source/src_pw/pseudo_us.cpp @@ -1,6 +1,4 @@ -/* pseudo_us.cpp */ - -#include "../src_pw/output.h" +#include "../src_io/output.h" #include "pseudo_us.h" pseudo_us::pseudo_us() diff --git a/ABACUS.develop/source/src_pw/pseudo_us.h b/ABACUS.develop/source/src_pw/pseudo_us.h index 5b7a8ff66d..3ee83b0d9d 100644 --- a/ABACUS.develop/source/src_pw/pseudo_us.h +++ b/ABACUS.develop/source/src_pw/pseudo_us.h @@ -1,17 +1,3 @@ -/************************************************************ -// Ultrasoft pseudopotential (US-PP) -// include pseudo_nc -// ... //psudo-charge - -//We are not going to implement this PP in the first version -//but we still construct the PP here for future reference - -// based on MODULE uspp_param -// USE parameters, ONLY : lqmax, nbrx, npsx, nqfx, ndmx -#ifndef PSEUDO_US_H -#define PSEUDO_US_H -************************************************************/ - #ifndef PSEUDO_US_H #define PSEUDO_US_H @@ -21,9 +7,14 @@ class pseudo_us: public pseudo_nc { -public: + public: + + pseudo_us(); + ~pseudo_us(); + // int nqf; + // double *rinner; // rinner(0:2*lmax) matrix qqq; // qqq(nbeta,nbeta) @@ -35,10 +26,8 @@ class pseudo_us: public pseudo_nc // other ? int nqlc; // number of angular momenta in Q - pseudo_us(); - ~pseudo_us(); - void set_pseudo_us(const Pseudopot_upf &upf); + void print_pseudo_us(ofstream &ofs); }; diff --git a/ABACUS.develop/source/src_pw/pseudo_vl.h b/ABACUS.develop/source/src_pw/pseudo_vl.h index 0768333991..458cf14084 100644 --- a/ABACUS.develop/source/src_pw/pseudo_vl.h +++ b/ABACUS.develop/source/src_pw/pseudo_vl.h @@ -1,14 +1,3 @@ -/********************************************************************** -// LOCAL pseudopotential (PP) -// include pseudo_info,pseudo_atom -// ... // local part of the potential - -// Local part of the (atomitic) potential -// based on MODULE uspp_param -// USE parameters, ONLY : lqmax, nbrx, npsx, nqfx, ndmx - -**********************************************************************/ - #ifndef PSEUDO_VL_H #define PSEUDO_VL_H @@ -18,6 +7,7 @@ class pseudo_vl: public pseudo_atom { public: + double *vloc_at; // [mesh], local potential( = pseudopot_upf.vloc ) pseudo_vl(); diff --git a/ABACUS.develop/source/src_pw/pseudopot_cell_us.cpp b/ABACUS.develop/source/src_pw/pseudopot_cell_us.cpp deleted file mode 100644 index d07a1d827c..0000000000 --- a/ABACUS.develop/source/src_pw/pseudopot_cell_us.cpp +++ /dev/null @@ -1,612 +0,0 @@ -//#include "../mymath.h" -//#include "../output.h" -#include "global.h" -#include "pseudopot_cell_us.h" -#include "tools.h" - -pseudopot_cell_us::pseudopot_cell_us(void) -{ -} - -pseudopot_cell_us::~pseudopot_cell_us(void) -{ -} - -/*************************************************************** -//void start_clock (char *); -//void stop_clock (char *); -//void reduce ( int , ::real *qq ); -void divide (int nqxq, int startq, int lastq); // ? -void setqf(::real , ::real , ::real r, int nqf,int , int ilast); // ? -// void invmat(int llx, matrix ylm, matrix mly, ::real dum); ? - -template -void copyarr(T *orig, T *dest, int len); - -pseudopot_cell_us::pseudopot_cell_us(void) -{ - - nlx = (lmaxx+1) * (lmaxx+1); - // maximum number of combined angular momentum - mx = 2*lqmax-1; // maximum magnetic angular momentum of Q - lpx = matrix(nlx, nlx); // (nlx,nlx); for each pair of combined momenta lm(1),lm(2): - // maximum combined angular momentum LM - lpl = realArray (mx,nlx,nlx); //(nlx,nlx,mx) list of combined angular momenta LM - - ap = realArray(nlx,nlx,lqmax*lqmax); //(lqmax*lqmax,nlx,nlx) - // Clebsch-Gordan coefficients for spherical harmonics -// qq = realArray(ntyp,nhm,nhm); //(:,:,:), the q functions in the solid -// qrad = realArray(nbeta*(nbeta+1),nbrx,nbrx); //(:,:,:,:), radial FT of Q functions - -// int nkbus; // as above, for US-PP only - -// realArray deeq; //(:,:,:,:), the integral of V_eff and Q_{nm} -// realArray becsum; //(:,:,:), \sum_i f(i) -// realArray beta; //(:,:,:), beta functions for CP (without struct.factor) //not sure! - - // from spin_orb - lspinorb = true; - domag = true; // if .TRUE. this is a spin-robit calculation - // from us - okvan = false;; // if .TRUE. at least one pseudo is Vanderbilt - rot_ylm = ComplexMatrix(2*lmaxx+1,2*lmaxx+1); - //(2*lmaxx+1,2*lmaxx+1), transform real - // spherical harmonics into complex ones -// fcoef = ComplexArray(ntyp,nhm,nhm,2,2); // (:,:,:,:,:), function needed to - // account for spinors. - - // from uspp -// dvan_so = ComplexArray(ntyp,nhm,nhm,4); // (:,:,:,:), D_{nm} -// qq_so = ComplexArray(ntyp,nhm,nhm,4); // (:,:,:,:), Q_{nm} -} - -pseudopot_cell_us::~pseudopot_cell_us(void) -{ -} - -//---------------------------------------------------------------------- -// from init_us_1.f90 -void pseudopot_cell_us::init_us_1(PW_Basis pw) -{ - //------------------------------------------------------------------ - // This routine performs the following tasks: - // a) For each non vanderbilt pseudopotential it computes the D and - // the betar in the same form of the Vanderbilt pseudopotential. - // b) It computes the indices indv which establish the correspondence - // nh <-> beta in the atom - // c) It computes the indices nhtol which establish the correspondence - // nh <-> angular momentum of the beta function - // d) It computes the indices nhtolm which establish the correspondence - // nh <-> combined (l,m) index for the beta function. - // e) It computes the coefficients c_{LM}^{nm} which relates the - // spherical harmonics in the Q expansion - // f) It computes the radial fourier transform of the Q function on - // all the g vectors - // g) It computes the q terms which define the S matrix. - // h) It fills the interpolation table for the beta functions - - // USE parameters, ONLY : lmaxx, nbrx, lqmax - // USE constants, ONLY : fpi - // USE atom, ONLY : r, rab - // USE ions_base, ONLY : ntyp => nsp - // USE cell_base, ONLY : omega, tpiba - // USE gvect, ONLY : g, gg - // USE pseud, ONLY : lloc, lmax - // USE lsda_mod, ONLY : nspin - // USE us, ONLY : okvan, nqxq, dq, nqx, tab, qrad - // USE uspp, ONLY : nhtol, nhtoj, nhtolm, dvan, qq, indv, ap, aainit, - // qq_so, dvan_so - // USE uspp_param, ONLY : lmaxq, dion, betar, qfunc, qfcoef, rinner, nbeta, - // kkbeta, nqf, nqlc, lll, jjj, lmaxkb, nh, tvanp, nhm - // USE spin_orb, ONLY : lspinorb, rot_ylm, fcoef - - // here a few local variables - int nt, ih, jh, nb, mb, nmb, l, m, ir, iq, is, startq, - lastq, ilast, ndm; - // various counters - - ::real *aux , *aux1 , *besr ; - realArray qtot ; // (:,:,:) - // various work space - - ::real prefr, pref, q, qi; - // the prefactor of the q functions - // the prefactor of the beta functions - // the modulus of g for each shell - // q-point grid for interpolation - - matrix ylmk0; - // the spherical harmonics - - ::real *vll; // (0:lmaxx), - ::real vqint, sqrt2, j; - // the denominator in KB case - // interpolated value - - int n1, m0, m1, n, li, mi, vi, vj, ijs, is1, is2, - lk, mk, vk, kh, lh; - realArray sph_ind; - complex <::real> coeff, qgm; //(1);? - realArray spinor; - ::real ji, jk; - - ::real x; - complex <::real> cx; - complex <::real> c0,c10; - c0 = complex <::real>(0,0); - c10 = complex <::real>(1,0); - - int ntyp,nbeta,kkbeta; - int nh; - ::real omega; - int *lll; - omega = pw.omega; - ntyp = pw.ntype; -// start_clock ("init_us_1"); - // Initialization of the variables - - // ndm = MAXVAL (kkbeta),(1:ntyp)); - ndm = 0; - for(n=0;n kkbeta)?ndm:kkbeta; - } - // allocate - aux = new real[ndm]; - aux1 = new real[ndm]; - besr = new real [ndm]; - qtot = realArray(nbrx, nbrx, ndm); - ylmk0 = matrix( lmaxq , lmaxq); - ap.zero_out(); // (:,:,:) = 0.0; - if (lmaxq > 0) - qrad.zero_out(); //(:,:,:,:)= 0.0; - prefr = fpi / omega; - if (lspinorb){ - // In the spin-orbit case we need the unitary matrix u which - // rotates the real spherical harmonics and yields the complex ones. - - sqrt2=1.0/sqrt(2.0); // dsqrt() - rot_ylm.zero_out(); //(0.0,0.0) - l=lmaxx; - rot_ylm(l+1,1)=c10; //(1.0,0.0); - for(n1=2;n1<2*l+1;n1+=2){ // do n1=2,2*l+1,2 - m=n1/2; - n=l+1-m; - rot_ylm(n,n1)=std::complex (pow(-1.0, m)*sqrt2,0.0); - rot_ylm(n,n1+1)=std::complex (0.0,pow(-(-1.0),m)*sqrt2); - n=l+1+m; - rot_ylm(n,n1)=std::complex (sqrt2,0.0); - rot_ylm(n,n1+1)=std::complex (0.0, sqrt2); - } // enddo - fcoef.zero_out(); - dvan_so.zero_out(); - qq_so.zero_out(); - }else{ - qq.zero_out(); // (:,:,:) = 0.d0 - dvan.zero_out(); - } // endif - // For each pseudopotential we initialize the indices nhtol, nhtolm, - // nhtoj, indv, and if the pseudopotential is of KB type we initialize - // the atomic D terms - for(nt=0;nt= fabs (lll [nb] - lll [mb]) ) && - (l <= lll [nb] + lll [mb]) && - (((int)(l + lll [nb] + lll [mb]) % 2) == 0) ){ - // mod (l + lll [nb] + lll [mb], 2) - for(ir=0;ir= - pw.atoms[nt].ppus.rinner [l + 1]){ - qtot.assign (nb, mb, ir, - pw.atoms[nt].ppus.qfunc.valueof (ir, nb, mb)); - }else{ - ilast = ir; - } // endif - } // enddo - if (pw.atoms[nt].ppus.rinner [l + 1] > 0.0) - setqf(pw.atoms[nt].ppus.qfcoef.valueof (1, l+1, nb, mb), - qtot.valueof(nb,mb,1), pw.atoms[nt].r[1], - pw.atoms[nt].ppus.nqf,l,ilast); - } // endif - } // enddo - } // enddo - // here we compute the spherical bessel function for each |g| - for(iq=startq;iq= fabs (lll [nb] - lll [mb]) ) && - (l <= lll [nb] + lll [mb]) && - (((int)(l + lll[nb] + lll[mb]) % 2) == 0) ){ - // mod (l + lll[nb] + lll[mb], 2) - for(ir=0;ir 1.0e-8) -//? goto 100; -#endif - ylmr2 (lmaxq * lmaxq, 1, pw.g, pw.gg, ylmk0); - for(nt=0;nt *r; //(:,:), - ::real *rr; //(:), - matrix ylm; //(:,:), - matrix mly; //(:,:) - // an array of random vectors: r(3,llx) - // the norm of r: rr(llx) - // the real spherical harmonics for array r: ylm(llx,llx) - // the inverse of ylm considered as a matrix: mly(llx,llx) - ::real dum; - int lli2; - lli2 = lli * lli; - - if (lli < 0) - cout << "\n error,aainit,lli not allowed," - << lli; - - if (lli2 > nlx) - cout << "\n error, aainit, nlx is too small," - << lli2; - - llx = (2*lli-1); - llx *= llx; - if (2*lli-1 > lqmax) - cout << "\n error, aainit, ap leading dimension is too small," - << llx; - - rr = new ::real[ llx ]; - r = new Vector3 <::real>[llx]; - ylm = matrix( llx, llx ); - mly = matrix( llx, llx ); - -// r.zero_out(); - ylm.zero_out(); - mly.zero_out(); - ap.zero_out(); //(:,:,:)= 0.d0 - - // - generate an array of random vectors (uniform deviate on unitary sphere) - gen_rndm_r(llx,r,rr); - - // - generate the real spherical harmonics for the array: ylm(ir,lm) - ylmr2(llx,llx,r,rr,ylm); - - //- store the inverse of ylm(ir,lm) in mly(lm,ir) - // invmat(llx, ylm, mly, dum); - mly = ylm.Inverse(); //? dum - - ::real x; - //- for each li,lj compute ap(l,li,lj) and the indices, lpx and lpl - for(li=0;li 1.e-3){ - lpx(li,lj) = lpx(li,lj) + 1; - if (lpx(li,lj) > mx) - cout << "\n error, aainit, mx dimension too small," - << lpx(li,lj); - lpl.assign(li,lj,lpx(li,lj),l); - } // end if - } // end do - } // end do - } // end do - - //deallocate(mly) - //deallocate(ylm) - //deallocate(rr) - //deallocate(r) - return; -} // end subroutine aainit - -// ----------------------------------------------------------------------- -// from uspp.f90 -void gen_rndm_r(int llx,Vector3 <::real> *r,::real *rr) // Vector3 *r ? -{ - //----------------------------------------------------------------------- - // - generate an array of random vectors (uniform deviate on unitary sphere) - // - // USE constants, ONLY: tpi - - // first the I/O variables - // int llx; // input: the dimension of r and rr - // matrix r(3,llx), // output: an array of random vectors - // real *rr(llx) // output: the norm of r - - // here the local variables - int ir; - ::real costheta, sintheta, phi; - - for(ir=0;ir -void copyarr(T *orig, T *dest, int len) -{ - for(int i=0;i - realArray beta; //(:,:,:), beta functions for CP (without struct.factor) //not sure! - - // from spin_orb -// bool lspinorb, -// domag; // if .TRUE. this is a spin-robit calculation - // from us -// ComplexMatrix rot_ylm; //(2*lmaxx+1,2*lmaxx+1), transform real - // spherical harmonics into complex ones -// ComplexArray fcoef; // (:,:,:,:,:), function needed to - // account for spinors. - - // from uspp -// ComplexArray dvan_so, // (:,:,:,:), D_{nm} -// qq_so; // (:,:,:,:), Q_{nm} - - //MODULE us - //. These parameters are needed with the US pseudopotentials - -// ::real dq = 0.01; // space between points in the pseudopotential tab. - // moved to constants.h - -// realArray qrad; //(:,:,:,:),radial FT of Q functions - - // END MODULE us - - pseudopot_cell_us(); - ~pseudopot_cell_us(); - /* - // member functions: - // void init_us_1(); // generate qrad(:,:,:,:) ? - void init_us_1(PW_Basis pw); // generate tab(:,:,:), indv, nhtol, nhtolm - void aainit(int); //Clebsch-Gordan coefficients "ap" - ::real compute_ap(int l,int li,int lj,int llx,matrix ylm,matrix mly); - void gen_rndm_r(int llx, Vector3 <::real> *r, ::real *rr); - // void gen_rndm_r(int llx,Vector3 *r,::real *rr); - void qvan2 (int, int ih, int jh, int nt, ::real *gg, - complex<::real> qgm, matrix ylmk0); - // void newd(); //computes the fourier transform of the Q function, qq - - void printus(ofstream &ofs); - - // template - // void copyarr(T *, T *, int len); - // void copyarr(::real *, ::real *, int ); - - */ -}; - -#endif // PSEUDOPOT_CELL_US_H diff --git a/ABACUS.develop/source/src_pw/pseudopot_cell_vl.cpp b/ABACUS.develop/source/src_pw/pseudopot_cell_vl.cpp index d8100ac852..7c08a04648 100644 --- a/ABACUS.develop/source/src_pw/pseudopot_cell_vl.cpp +++ b/ABACUS.develop/source/src_pw/pseudopot_cell_vl.cpp @@ -15,28 +15,25 @@ pseudopot_cell_vl::~pseudopot_cell_vl() delete[] zp; } -// from init_vloc.f90 -void pseudopot_cell_vl::init_vloc(void) + +void pseudopot_cell_vl::init_vloc(const int &nggm, matrix &vloc_in) { + TITLE("pseudopot_cell_vl","init_vloc"); + // This routine computes the fourier coefficient of the local // potential vloc(ig,it) for each type of atom - if(test_pp > 0) TITLE("pseudopot_cell_vl","init_vloc"); timer::tick("ppcell_vl","init_vloc",'C'); - double *vloc1d = new double[pw.nggm]; - ZEROS(vloc1d, pw.nggm); + double *vloc1d = new double[nggm]; + ZEROS(vloc1d, nggm); this->allocate(); for (int it = 0; it < ucell.ntype; it++) { - // ofs_running << " it=" << it << endl; - // ofs_running << " numeric[it]=" << numeric[it] << endl; - const Atom* atom = &ucell.atoms[it]; - ZEROS(vloc1d, pw.nggm); - //HLX(05-24-06): add zp[it]=ucell.atoms[it].zv; read zp[it] from atoms + ZEROS(vloc1d, nggm); this->zp[it] = atom->zv; @@ -56,17 +53,17 @@ void pseudopot_cell_vl::init_vloc(void) WARNING_QUIT("init_vloc","not available now."); } - dcopy(vloc1d, this->vloc,it); //HLX(05-23-06): dcopy might have problems, check later! + dcopy(vloc1d, vloc_in, it); } - delete [] vloc1d; + delete[] vloc1d; this->print_vloc(); timer::tick("ppcell_vl","init_vloc",'C'); return; -} // end subroutine init_vloc +} void pseudopot_cell_vl::allocate(void) @@ -81,38 +78,14 @@ void pseudopot_cell_vl::allocate(void) for (int it = 0; it < ucell.ntype; it++) { this->numeric[it] = true; } + // mohan change global variable 'npsx' to local variable, + // npsx( max number of different PPs) + // 2021-02-22 + int npsx = 50; delete[] zp; this->zp = new double[npsx]; ZEROS(zp, npsx); - // npsx( max number of different PPs) - - /* - cc.create(npsx, 2); - alpc.create(npsx, 2); - aps.create(npsx, 4, 6); - alps.create(npsx, 4, 3); - - a_nlcc = new double[npsx]; - ZEROS(a_nlcc, npsx); - b_nlcc = new double[npsx]; - ZEROS(b_nlcc, npsx); - - alpha_nlcc = new double[npsx]; - ZEROS(alpha_nlcc, npsx); - - nlc = new int[npsx]; - ZEROS(nlc, npsx); - - nnl = new int[npsx]; - ZEROS(nnl, npsx); - - lmax = new int[npsx]; - ZEROS(lmax, npsx); - - lloc = new int[npsx]; - ZEROS(lloc, npsx); - */ return; } @@ -123,7 +96,7 @@ void pseudopot_cell_vl::allocate(void) ! !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ -// from vloc_of_g.f90 + // Here we always have numeric form, i.e. numeric=ture void pseudopot_cell_vl::vloc_of_g( const int& msh, @@ -159,6 +132,7 @@ void pseudopot_cell_vl::vloc_of_g( ZEROS(aux, msh); ZEROS(aux1, msh); + // for tests /* for(ir=0; irnhm); deeq.create(NSPIN, ucell.nat, this->nhm, this->nhm); deeq_nc.create(NSPIN, ucell.nat, this->nhm, this->nhm); - // qq.create(ntype, this->nhm, this->nhm); dvan.create(ntype, this->nhm, this->nhm); dvan_so.create(NSPIN, ntype, this->nhm, this->nhm); becsum.create(NSPIN, ucell.nat, this->nhm * (this->nhm + 1) / 2); @@ -98,16 +97,34 @@ void pseudopot_cell_vnl::init(const int ntype, const bool allocate_vkb) //NQX = this->calculate_nqx(pw.ecutwfc,DQ) * 10; //LiuXh add 20180515 NQX = this->calculate_nqx(pw.ecutwfc,DQ) * cell_factor; //LiuXh add 20180619 // nqx = (sqrt(ecutwfc)/dq+4)*cell_factor; - // - // nbrx is defined in constant.h + + + // mohan update 2021-02-22 + const int nbrx = 10; + const int nbrx_nc = 20; // max number of beta functions - if(NSPIN!=4) this->tab.create(ntype, nbrx, NQX); - else this->tab.create(ntype, nbrx_nc, NQX); + if(NSPIN!=4) + { + this->tab.create(ntype, nbrx, NQX); + } + else + { + this->tab.create(ntype, nbrx_nc, NQX); + } - // nchix is defined in constant.h + + // mohan update 2021-02-22 + int nchix = 10; + int nchix_nc = 20; // nchix : max number of atomic wavefunctions per atom - if(NSPIN!=4) this->tab_at.create(ntype, nchix, NQX); - else this->tab_at.create(ntype, nchix_nc, NQX); + if(NSPIN!=4) + { + this->tab_at.create(ntype, nchix, NQX); + } + else + { + this->tab_at.create(ntype, nchix_nc, NQX); + } if(test_pp > 1) { @@ -125,12 +142,11 @@ void pseudopot_cell_vnl::init(const int ntype, const bool allocate_vkb) return; } + + //---------------------------------------------------------- -// MEMBER FUNCTION NAME : -// NAME : pseudopot_cell_vnl -// Calculates beta functions (Kleinman-Bylander projectors), with -// structure factor, for all atoms, in reciprocal space -// from init_us_2.f90 +// Calculates beta functions (Kleinman-Bylander projectors), +// with structure factor, for all atoms, in reciprocal space //---------------------------------------------------------- void pseudopot_cell_vnl::getvnl(const int &ik) { @@ -155,13 +171,11 @@ void pseudopot_cell_vnl::getvnl(const int &ik) gk[ig] = wf.get_1qvec_cartesian(ik, ig); } - Mathzone::Ylm_Real(x1, npw, gk, ylm); int jkb = 0; for(int it = 0;it < ucell.ntype;it++) { - if(test_pp>1) OUT("it",it); // calculate beta in G-space using an interpolation table const int nbeta = ucell.atoms[it].nbeta; const int nh = ucell.atoms[it].nh; @@ -175,17 +189,9 @@ void pseudopot_cell_vnl::getvnl(const int &ik) { const double gnorm = gk[ig].norm() * ucell.tpiba; -// cout << "\n gk[ig] = " << gk[ig].x << " " << gk[ig].y << " " << gk[ig].z; -// cout << "\n gk.norm = " << gnorm; - -//if(ik==0){ -//cout<<"ik: "<tab, it, nb, NQX, DQ, gnorm ); - } // enddo + } // add spherical harmonic part for (ih = 0;ih < nh;ih++) @@ -221,13 +227,17 @@ void pseudopot_cell_vnl::getvnl(const int &ik) delete [] gk; delete [] vq; + timer::tick("pp_cell_vnl","getvnl"); + return; } // end subroutine getvnl -void pseudopot_cell_vnl::init_vnl(void) + + +void pseudopot_cell_vnl::init_vnl(UnitCell_pseudo &cell) { - if(test_pp) TITLE("pseudopot_cell_vnl","init_vnl"); + TITLE("pseudopot_cell_vnl","init_vnl"); timer::tick("ppcell_vnl","init_vnl"); //from init_us_1 @@ -240,22 +250,23 @@ void pseudopot_cell_vnl::init_vnl(void) // d) It computes the indices nhtolm which establish the correspondence // nh <-> combined (l,m) index for the beta function. - // For each pseudopotential we initialize the indices nhtol, nhtolm, - // nhtoj, indv, and if the pseudopotential is of KB type we initialize + // For each pseudopotential we initialize the indices nhtol, nhtolm, + // nhtoj, indv, and if the pseudopotential is of KB type we initialize // the atomic D terms + this->dvan.zero_out(); this->dvan_so.zero_out();//added by zhengdy-soc soc.rot_ylm(this->lmaxkb); - soc.fcoef.create(ucell.ntype, this->nhm, this->nhm); + soc.fcoef.create(cell.ntype, this->nhm, this->nhm); - for(int it=0;itnhtol(it,BetaIndex) = l; @@ -269,7 +280,7 @@ void pseudopot_cell_vnl::init_vnl(void) // From now on the only difference between KB and US pseudopotentials // is in the presence of the q and Q functions. // Here we initialize the D of the solid - if(ucell.atoms[it].has_so ) + if(cell.atoms[it].has_so ) { for(int ip=0; ip( indv(it, ip ) ); - for(int ip2=0; ip2( indv(it, ip2) ); int ijs =0; - for(int is1=0;is1<2;++is1){ - for(int is2=0;is2<2;++is2){ - this->dvan_so(ijs,it,ip,ip2) = ucell.atoms[it].dion(ir, is) * soc.fcoef(it,is1,is2,ip,ip2); + for(int is1=0;is1<2;++is1) + { + for(int is2=0;is2<2;++is2) + { + this->dvan_so(ijs,it,ip,ip2) = cell.atoms[it].dion(ir, is) * soc.fcoef(it,is1,is2,ip,ip2); ++ijs; if(ir != is) soc.fcoef(it,is1,is2,ip,ip2) = complex(0.0,0.0); } @@ -331,31 +346,33 @@ void pseudopot_cell_vnl::init_vnl(void) { const int ir = static_cast( indv(it, ip ) ); const int is = static_cast( indv(it, ip2) ); - if(LSPINORB){ - this->dvan_so(0,it,ip,ip2) = ucell.atoms[it].dion(ir, is); - this->dvan_so(3,it,ip,ip2) = ucell.atoms[it].dion(ir, is); + if(LSPINORB) + { + this->dvan_so(0,it,ip,ip2) = cell.atoms[it].dion(ir, is); + this->dvan_so(3,it,ip,ip2) = cell.atoms[it].dion(ir, is); } - else{ - this->dvan(it, ip, ip2) = ucell.atoms[it].dion(ir, is); + else + { + this->dvan(it, ip, ip2) = cell.atoms[it].dion(ir, is); } } } } } - // h) It fills the interpolation table for the beta functions + // h) It fills the interpolation table for the beta functions /********************************************************** // He Lixin: this block is used for non-local potential // fill the interpolation table tab ************************************************************/ - const double pref = FOUR_PI / sqrt(ucell.omega); + const double pref = FOUR_PI / sqrt(cell.omega); this->tab.zero_out(); ofs_running<<"\n Init Non-Local PseudoPotential table : "; - for (int it = 0;it < ucell.ntype;it++) + for (int it = 0;it < cell.ntype;it++) { - const int nbeta = ucell.atoms[it].nbeta; - int kkbeta = ucell.atoms[it].kkbeta; + const int nbeta = cell.atoms[it].nbeta; + int kkbeta = cell.atoms[it].kkbeta; //mohan modify 2008-3-31 //mohan add kkbeta>0 2009-2-27 @@ -369,19 +386,19 @@ void pseudopot_cell_vnl::init_vnl(void) for (int ib = 0;ib < nbeta;ib++) { - const int l = ucell.atoms[it].lll[ib]; + const int l = cell.atoms[it].lll[ib]; for (int iq=0; iqtab(it, ib, iq) = vqint * pref; } } @@ -393,6 +410,7 @@ void pseudopot_cell_vnl::init_vnl(void) return; } + complex pseudopot_cell_vnl::Cal_C(int alpha, int lu, int mu, int L, int M) // pengfei Li 2018-3-23 { complex cf; @@ -567,6 +585,11 @@ void pseudopot_cell_vnl::init_vnl_alpha(void) // pengfei Li 2018-3-23 } } } + + + // max number of beta functions + const int nbrx = 10; + const double pref = FOUR_PI / sqrt(ucell.omega); this->tab_alpha.create(ucell.ntype, nbrx, lmaxkb+2, NQX); this->tab_alpha.zero_out(); @@ -615,11 +638,14 @@ void pseudopot_cell_vnl::init_vnl_alpha(void) // pengfei Li 2018-3-23 } + void pseudopot_cell_vnl::print_vnl(ofstream &ofs) { out.printr3_d(ofs, " tab : ", tab); } + + int pseudopot_cell_vnl::calculate_nqx(const double &ecutwfc,const double &dq) { int points_of_table = static_cast( sqrt(ecutwfc)/dq + 4 ) ;//* cell_factor; diff --git a/ABACUS.develop/source/src_pw/pseudopot_cell_vnl.h b/ABACUS.develop/source/src_pw/pseudopot_cell_vnl.h index d1dfeededc..4d69f64b0b 100644 --- a/ABACUS.develop/source/src_pw/pseudopot_cell_vnl.h +++ b/ABACUS.develop/source/src_pw/pseudopot_cell_vnl.h @@ -7,38 +7,64 @@ #include "tools.h" #include "pseudopot_cell_vl.h" -#include "../src_lcao/use_overlap_table.h" +#include "../src_lcao/ORB_gen_tables.h" +#include "wavefunc_in_pw.h" +#include "unitcell_pseudo.h" //========================================================== -// CLASS : -// NAME : pseudopot_cell_vnl -// (Calculate the non-local pseudopotential in reciprocal -// space. -// Using plane wave as basis set.) +// Calculate the non-local pseudopotential in reciprocal +// space using plane wave as basis set. //========================================================== class pseudopot_cell_vnl: public pseudopot_cell_vl { + public: -//========================================================== -// MEMBER VARIABLES : -// NAME : dq(space between points in the pseudopotential tab) + pseudopot_cell_vnl(); + ~pseudopot_cell_vnl(); + + friend class Stress_Func; + friend class Forces; + friend class Epsilon0_vasp; + friend class Potential; + friend class Hamilt_PW; + friend class WF_atomic; + friend class wavefunc; + friend class Stochastic_hchi; + + void init(const int ntype, const bool allocate_vkb=1); + + double cell_factor; //LiuXh add 20180619 + // NAME : nkb(total number of beta functions, with struct.fact.) -// NAME : nqxq(size of interpolation table) + int nkb; // be called in hm.hpw.init + +// NAME : lmaxkb(max angular momentum,(see pseudo_h)) + int lmaxkb; + + void init_vnl(UnitCell_pseudo &cell); + +private: + + void getvnl(const int &ik); + + void getvnl_alpha(const int &ik); + + void init_vnl_alpha(void); + +//=============================================================== +// MEMBER VARIABLES : // NAME : nqx(number of interpolation points) +// NAME : nqxq(size of interpolation table) // NAME : nhm(max number of different beta functions per atom) -// NAME : lmaxkb(max angular momentum,(see pseudo_h)) -// NAME : lmaxq(new added) -//========================================================== - int nkb; +// NAME : lmaxq +// NAME : dq(space between points in the pseudopotential tab) +//=============================================================== + int calculate_nqx(const double &ecutwfc,const double &dq); int nhm; - int lmaxkb; int lmaxq; -// int nbetam; // max number of different projectors per atom ? -// int nchim; // max number of different wavefunctions per atom -// int lllm; // max number of matrix indv; // indes linking atomic beta's to beta's in the solid matrix nhtol; // correspondence n <-> angular momentum l @@ -47,38 +73,25 @@ class pseudopot_cell_vnl: public pseudopot_cell_vl realArray dvan; //(:,:,:), the D functions of the solid ComplexArray dvan_so; //(:,:,:), spin-orbit case, added by zhengdy-soc + realArray tab; //(:,:,:), interpolation table for PPs realArray tab_alpha; realArray tab_at; //(:,:,:), interpolation table for atomic wfc + realArray deeq; //(:,:,:,:), the integral of V_eff and Q_{nm} ComplexArray deeq_nc; //(:,:,:,:), the spin-orbit case realArray becsum; //(:,:,:,:), \sum_i f(i) //used in charge -// realArray qq; //(:,:,:), the q functions in the solid ComplexMatrix vkb; // all beta functions in reciprocal space complex ***vkb1_alpha; complex ***vkb_alpha; - bool okvan; // if .TRUE. at least one pseudo is Vanderbilt - pseudopot_cell_vnl(); - ~pseudopot_cell_vnl(); - - double cell_factor; //LiuXh add 20180619 - -public: - void init(const int ntype, const bool allocate_vkb=1); - void init_vnl(void); - void getvnl(const int &ik); - void getvnl_alpha(const int &ik); - void init_vnl_alpha(void); - -private: complex Cal_C(int alpha, int lu, int mu, int L, int M); double CG(int l1, int m1, int l2, int m2, int L, int M); void print_vnl(ofstream &ofs); - Make_Gaunt_Table MGT; + ORB_gaunt_table MGT; }; #endif // PSEUDOPOT_CELL_VNL_H diff --git a/ABACUS.develop/source/src_pw/pseudopot_upf.cpp b/ABACUS.develop/source/src_pw/pseudopot_upf.cpp index f7e78f31d1..2b6a76f8fa 100644 --- a/ABACUS.develop/source/src_pw/pseudopot_upf.cpp +++ b/ABACUS.develop/source/src_pw/pseudopot_upf.cpp @@ -1,9 +1,8 @@ -/* pseudopot_upf.cpp */ //========================================================== // Author: Lixin He,mohan // DATE : 2009-02-26 //========================================================== -#include "../src_pw/output.h" +#include "../src_io/output.h" #include "pseudopot_upf.h" #include #include diff --git a/ABACUS.develop/source/src_pw/pw_basis.cpp b/ABACUS.develop/source/src_pw/pw_basis.cpp index f282b7aef7..900ee567fc 100644 --- a/ABACUS.develop/source/src_pw/pw_basis.cpp +++ b/ABACUS.develop/source/src_pw/pw_basis.cpp @@ -4,7 +4,6 @@ // 3. delete condition justification in pw_and_columns distributins 2 #include "tools.h" -//#include "algorithms.h" #include "pw_basis.h" #include "../src_pw/pw_complement.h" @@ -35,7 +34,7 @@ PW_Basis::PW_Basis() this->nczp_start = 0; gg_global0 = nullptr; //LiuXh 20180515 - cutgg_num_table = nullptr; //LiuXh 20180515 + cutgg_num_table = nullptr; //LiuXh 0180515 ggchg_time_global = 0; //LiuXh 20180515 } @@ -121,7 +120,6 @@ void PW_Basis::set } -//#include "../src_develop/src_wannier/winput.h" // initialize of plane wave basis. void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &Klist_in) { @@ -153,6 +151,7 @@ void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &K this->Klist = &Klist_in; //mohan modify 2008-3-25 + // setup for ggpsi, ggwfc, ggwfc2, ggchg this->setup_gg(); this->setup_FFT_dimension(); @@ -160,7 +159,7 @@ void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &K // if calculation is 'test', we don't need // to allocate the arrays, claculate the // structure factors, etc. - // we just return here. + // just return here. //---------------------------------------- if(CALCULATION=="test") { @@ -181,13 +180,11 @@ void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &K //{ // ofs_running << " Turn on the cutgg function." << endl; //} - - #else // mohan update 2011-09-21 this->nbzp=nbz; //nbz shoud equal nz for single proc. this->nczp=nbzp*bz; - this->nbxx=nbz*ncx*ncy; + this->nbxx=nbz*nbx*nby; //mohan fix 2021-02-17 this->nbzp_start=0; bool cutgg_flag = false; #endif @@ -203,11 +200,11 @@ void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &K double cutgg_pieces = 10; -// OUT(ofs_running,"cutgg_pieces",cutgg_pieces); + // OUT(ofs_running,"cutgg_pieces",cutgg_pieces); const double cutgg_delta = ggchg / std::pow( (double)cutgg_pieces, 2.0/3.0 ); // get cutgg_delta from input. -// OUT(ofs_running,"cutgg_delta",cutgg_delta); + // OUT(ofs_running,"cutgg_delta",cutgg_delta); //int cutgg_num_start = 0; double ggchg_start = 0.0; @@ -310,10 +307,10 @@ void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &K #ifdef __MPI this->get_MPI_GVectors(); - //cout<<" UNIFORM GRID DIM : "<nx <<" * "<ny <<" * "<nz << "," << this->nrxxs << endl; + //cout<<" UNIFORM GRID DIM : "<nx <<" * "<ny <<" * "<nz << "," << this->nrxx << endl; //cout<<" UNIFORM GRID DIM : "<ncx<<" * "<ncy<<" * "<ncz << "," << this->nrxx << endl; - FFT_wfc.setup_MPI_FFT3D(this->nx, this->ny, this->nz,this->nrxxs,1); + FFT_wfc.setup_MPI_FFT3D(this->nx, this->ny, this->nz,this->nrxx,1); FFT_chg.setup_MPI_FFT3D(this->ncx, this->ncy, this->ncz,this->nrxx,1); #endif } @@ -345,7 +342,7 @@ void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &K this->get_MPI_GVectors(); - FFT_wfc.setup_MPI_FFT3D(this->nx, this->ny, this->nz,this->nrxxs,1); + FFT_wfc.setup_MPI_FFT3D(this->nx, this->ny, this->nz,this->nrxx,1); FFT_chg.setup_MPI_FFT3D(this->ncx, this->ncy, this->ncz,this->nrxx,1); #else this->get_GVectors(); @@ -358,11 +355,7 @@ void PW_Basis::gen_pw(ofstream &runlog, const UnitCell &Ucell_in, const kvect &K this->get_nggm(this->ngmc); -#ifdef __EPM // needs in EPM because spin-orbital must use it. - if (EPM_SPIN_ORBITAL) this->setup_structure_factor(); -#else this->setup_structure_factor(); -#endif // this->printPW("src_check/check_pw.txt"); timer::tick("PW_Basis","gen_pw",'B'); @@ -386,14 +379,10 @@ void PW_Basis::setup_gg(void) // Ry*a0^2/(2*PI)^2 //================================= - //================================= // FFT cut off for wave function - //================================= this->ggwfc = 4 * this->ggpsi; - //================================== // FFT cut off for charge/potential - //================================== this->ggchg = wfac * this->ggpsi; this->ggwfc2 = 0; @@ -415,12 +404,6 @@ void PW_Basis::setup_gg(void) OUT(ofs_running,"energy cutoff for wavefunc (unit:Ry)",ecutwfc); - this->doublegrid = false; - if (ggwfc != ggchg) - { - doublegrid = true; - ofs_running << "Double grid is used."<nbz%NPROC_IN_POOL; this->nbzp = this->nbz/NPROC_IN_POOL; - if (RANK_IN_POOL < remain_planes) + + if (RANK_IN_POOL < remain_planes) { nbzp++; } @@ -501,7 +484,7 @@ void PW_Basis::divide_fft_grid(void) this->nbxx = nbzp*this->nbx*this->nby; this->nrxx = nczp*this->ncx*this->ncy; - this->nrxxs = this->nrxx; + //===================================== // set nrxx_start //===================================== @@ -525,9 +508,7 @@ void PW_Basis::divide_fft_grid(void) if(test_pw)OUT(ofs_running,"nbzp_start",nbzp); OUT(ofs_running,"nbxx",nbxx); OUT(ofs_running,"nrxx",nrxx); - if(test_pw)OUT(ofs_running,"nrxxs",nrxxs); if(test_pw)OUT(ofs_running,"nrxx_start",nrxx_start); - if(test_pw)OUT(ofs_running,"nbxx_start",nbxx_start); //===================================== // generate nst,st_i,st_j,st_k,npps @@ -572,7 +553,7 @@ void PW_Basis::divide_fft_grid(void) ////////////////////////////////// EXPLAIN ////////////////////////////////// -// M. Gong has made mistakes during calculating the effective structure factor +// M. Gong has made mistakes during calculating the effective structure factor // ig1[i], ig2[i], ig3[i] store the $G$ points using Cartesian coordinate, // where -ncx <= ig1[] <= ncx, -ncy <= ig2[] <= ncy and -ncz <= ig3[] <= ncz // ngmc > ngmw. ig1, ig2 and ig3 is a mapping between (k+G) <-> G @@ -627,7 +608,6 @@ void PW_Basis::get_GVectors(void) timer::tick("PW_Basis","get_GVectors"); this->nrxx = this->ncxyz; - this->nrxxs = this->nxyz; this->ngmc=this->ngmc_g; //************************************************************ @@ -701,7 +681,7 @@ void PW_Basis::get_nggm(const int ngmc_local) for (int ig = 1; ig < ngmc_local; ig++) { - if (abs(this->gg[ig] - tmp[ng]) > eps8) + if (abs(this->gg[ig] - tmp[ng]) > 1.0e-8) { ng++; tmp[ng] = this->gg[ig]; @@ -712,9 +692,7 @@ void PW_Basis::get_nggm(const int ngmc_local) //******************************** - // - // number of different |G| shells - // + // number of different |G| values // ******************************* this->nggm = ng; diff --git a/ABACUS.develop/source/src_pw/pw_basis.h b/ABACUS.develop/source/src_pw/pw_basis.h index c05545bc83..7d9236fbc5 100644 --- a/ABACUS.develop/source/src_pw/pw_basis.h +++ b/ABACUS.develop/source/src_pw/pw_basis.h @@ -5,21 +5,22 @@ #ifndef PLANEWAVE_H #define PLANEWAVE_H -#include "../src_global/complexmatrix.h" -#include "../src_global/vector3.h" #include "unitcell.h" #include "klist.h" +#include "../src_global/complexmatrix.h" +#include "../src_global/vector3.h" #include "../src_parallel/ft.h" + using namespace std; class PW_Basis { + public: + PW_Basis(); + ~PW_Basis(); - const UnitCell *Ucell; - const kvect *Klist; - FFT FFT_chg; - FFT FFT_wfc; + void gen_pw(ofstream &log, const UnitCell &Ucell_in, const kvect &Klist_in); void set ( @@ -36,66 +37,117 @@ class PW_Basis const int &by_in, const int &bz_in ); - //==================== - //Part1:Energy cutoff - //==================== - bool gamma_only; // only half G are used. - double wfac; - double ecutwfc; // Energy cutoff for wavefunctions. - double ecutrho; // Energy cutoff for charge/potential. - - double ggpsi; // planewave cut off for the wavefunctions, unit (2*PI/lat0)^2 + + const UnitCell *Ucell; // pointer for UnitCell + const kvect *Klist; // pointer for K-point list + + FFT FFT_chg; // FFT operations for charge density + FFT FFT_wfc; // FFT operations for wave functions + + + +//=============================================== +// Part 1: Kinetic energy cutoff for plane waves +//=============================================== +public: + bool gamma_only; // only half G are used. + double ecutwfc; // Energy cutoff for wavefunctions. + double ecutrho; // Energy cutoff for charge/potential. + // ggpsi=2*Ecut*(lat0*lat0)/(4.0*PI*PI); - double ggwfc; // ggwav;(=G2max);/ G^2 cutoff for wave function FFT box, unit (2*PI/a0)^2, - double ggwfc2; // ggwav=wfact*ggpsi, default value: wfact=4.0 - double ggchg; // G^2 cutoff for supporting charge density, - // in NCPP, ggchg=ggfft - // USPP (double grids), ggchg=4*ggfft - //=============== - // FFT_dimension - //=============== - int bx, by, bz, bxyz; // subset of each grid of FFT box, for example 2 2 2 - int nbx, nby, nbz, nbxyz; // - int nbzp, nbzp_start; // start ncz in each process, mohan add 2009-11-09 - int nbxx, nbxx_start; - - int nx, ny, nz, nxyz; // fft dimensions for wave functions. - int ncx, ncy, ncz, ncxyz; // fft dimensions for charge/potential. - int nczp, nczp_start; // start ncz in each process, mohan add 2009-11-09 - - ComplexMatrix strucFac; // StrucFac (ntype,ngmax) - - //======================================== - //Part2:Wave function(G vectors,FFT box) - //======================================== - int nrxxs; - int ngmw; //(= ngmax) / num. of G vectors within ggfft - /*** mohan add 2008-3-25 ***/ - int *ig2fftw; //(=*ind_FFT) /1D G vector -> for wave function FFT - //ig2fftw= new int [ngmw] for wave functions - //ig2fftw[ng] -> the coordinates in FFT box - - //============================================= - //Part3:Charge & Potential (G vectors,FFT box) - //============================================= - // G vectors, FFT box related to charge density and potentials etc. - //fft grid for charge density, potentials etc. - //this grid equal to the wave function grid - //when only NCPPs are used - //(doublegrid=.false.) - int nrxx; //for parallel,local FFT grid dimension - int nrxx_start; //for parallel,local FFT grid dimension - int ngmc; // new, num. of G vectors within ggchg, - int ngmc_g; // mohan add 2008-4-2 - // ngmc global (for parrel) - int *ig2fftc; //(=*ind_FFT) //1D G vector -> charge/potential FFT - //ig2fftc= new int [ngmc] for wave functions - //ig2fftc[ng] -> the coordinates in FFT box + // in NCPP, ggchg=ggfft; in USPP (double grids), ggchg=4*ggfft + double ggpsi; // planewave cut off for the wavefunctions, unit (2*PI/lat0)^2 + double ggwfc; // cutoff for wave function, ggwfc=4*ggpsi + double ggwfc2; // ggwav=wfact*ggpsi, default value: wfact=4.0 + double wfac; // weighting factor from ggpsi to ggwfc2 + double ggchg; // G^2 cutoff for supporting charge density, + +private: + // setup for ggpsi, ggwfc, ggwfc2, ggchg + void setup_gg(void); + + + +//=============================================== +// Part 2: FFT dimensions in real space +//=============================================== +public: + // FFT dimensions for wave functions. + int nx, ny, nz, nxyz; + // FFT dimensions for charge/potential. + int ncx, ncy, ncz, ncxyz; + // nczp: number of x-y planes in each processor + // nczp_start: starting nczp index in each processor + int nczp, nczp_start; + // nrxx: for parallel,local FFT grid dimension + int nrxx; + // nrxx_start: starting nrxx in each processor + int nrxx_start; + +private: + void setup_FFT_dimension(void); // set up FFT dimensions + + + +//=============================================== +// Part 3: FFT dimensions in real space +// used in LCAO algorithm: grid integrals +//=============================================== +public: + // combine [bx,by,bz] FFT grids into a big one + // typical values are bx=2, by=2, bz=2 + // bxyz = bx*by*bz, typical value is 8 + int bx, by, bz, bxyz; + // nbx=ncx/bx, nby=ncy/by, nbz=ncz/bz, + // nbxyz=nbx*nby*nbz + int nbx, nby, nbz, nbxyz; + // nbzp: number of x-y planes in each processor + // nbzp_start: starting nbzp index in each processor + int nbzp, nbzp_start; + // nbxx is local dimension of nbxyz + // nbxx=nbx*nby*nbzp + int nbxx; + + + +//=============================================== +// Part 4: G vectors in reciprocal FFT box +//=============================================== +public: + // mohan add 2008-4-2 + int ngmc_g; // global ngmc (total number of G vectors) + int ngmc; // num. of G vectors within ggchg in each proc. + // map: 1D G vector -> charge in FFT grid + int *ig2fftc; // dimension: [ngmc] + // PW_complement::get_ngmw(ngmc, ggwfc2, gg_global, ngmw); + int ngmw; // num. of G vectors within ggwfc2 in each proc. + // map: 1D G vector -> wave function in FFT grid + int *ig2fftw; // dimension: [ngmw] + + // structure factor (ntype, ngmc) + ComplexMatrix strucFac; + void setup_structure_factor(void); // Calculate structur factors + +private: +#ifdef __MPI + void divide_fft_grid(void); + void get_MPI_GVectors(void); + void columns_and_pw_distribution_2(void); +#else + void get_GVectors(void); +#endif + + + +//=============================================== +// Part 5: G vectors, |G|^2, G index [ngmc] +//=============================================== +public: Vector3 *gdirect; //(= *G1d) ; // ig = new Vector igc[ngmc], Vector3 *gdirect_global; //(= *G1d) ; // ig = new Vector igc[ngmc], // store the 3D G vector coordinates for charge density grid; - //ig.x, ig.y, ig.z should be integers !!! + // ig.x, ig.y, ig.z should be integers !!! // G vectors are in order of increasing G^2 // can be shared by charge density/potential and wave functions. @@ -104,57 +156,53 @@ class PW_Basis //g=ig*G ?? HLX (05-26-06): need to check if this is ok! //tau is also defined in Cartesian coordintes unit lat0 - double *gg; // modulus (G^2) of G vectors - double *gg_global; // modulus (G^2) of G vectors + double *gg; // modulus (G^2) of G vectors [ngmc] + double *gg_global; // modulus (G^2) of G vectors [ngmc_g] //gg[ng]=ig[ng]*GGT*ig[ng]/(lat0*lat0)=g[ng]*g[ng] (/lat0*lat0) + // gg_global dimension: [cutgg_num_now] (save memory skill is used) - //================== - // void set_nggm() - //================== - int nggm; // =ngl(another dft code); - // number of |G| shells (i.e., how many different |G|s) - double *ggs; // store the |G|^2 for each shell - int *ig2ngg; //=*igtong1 (another dft code) - // G -> correspondence shells of G - // end charge grids - - int gstart; // first nonzero g vector - - ComplexMatrix eigts1; // - ComplexMatrix eigts2; //the phases e^{-iG*tau_s} - ComplexMatrix eigts3; // - int *ig1; // - int *ig2; // the indices of G components - int *ig3; // - double *gg_global0; //LiuXh add 20180515 - int *cutgg_num_table; //LiuXh add 20180515 - int ggchg_time_global; //LiuXh add 20180515 - - bool doublegrid; // .TRUE. if we use a double grid; (for USPP) - // .FALSE., if NCPP. + // index of cartesian coordinates [ngmc] + int *ig1; // + int *ig2; // the indices of G components + int *ig3; // - PW_Basis(); - ~PW_Basis(); - void gen_pw(ofstream &log, const UnitCell &Ucell_in, const kvect &Klist_in); - void setup_structure_factor(); // Calculate structur factors - void update_gvectors(ofstream &log, const UnitCell &Ucell_in); //LiuXh add 20180515 -private: - void setup_gg(); - void setup_FFT_dimension(); // set up FFT dimensions +//=============================================== +// Part 6: |G|^2 [nggm] +//=============================================== +public: + // number of |G| shells (i.e., how many different |G|s) + int nggm; + double *ggs; // store |G|^2 for each shell + int *ig2ngg; // dimension [ngmc], index from ngmc to nggm + int gstart; // first nonzero g vector private: + void get_nggm(const int ngmc_local); -#ifdef __MPI - void divide_fft_grid(); - void get_MPI_GVectors(); - void columns_and_pw_distribution_2(); -#else - void get_GVectors(); -#endif - void get_nggm(const int ngmc_local); +//=============================================== +// Part 7: phase of e^{-iG*tau_s} +//=============================================== +public: + // phase of e^{-iG*tau_s} + ComplexMatrix eigts1; // dimension: [Ucell->nat, 2*this->ncx + 1] + ComplexMatrix eigts2; // dimension: [Ucell->nat, 2*this->ncy + 1] + ComplexMatrix eigts3; // dimension: [Ucell->nat, 2*this->ncz + 1] + + + +//=============================================== +// Part 8: update_gvectors +// LiuXh add 20180515 +//=============================================== +public: + double *gg_global0; + int *cutgg_num_table; + int ggchg_time_global; + + void update_gvectors(ofstream &log, const UnitCell &Ucell_in); }; #endif //PlaneWave class diff --git a/ABACUS.develop/source/src_pw/pw_complement.cpp b/ABACUS.develop/source/src_pw/pw_complement.cpp index 56d406911e..0635c88c77 100644 --- a/ABACUS.develop/source/src_pw/pw_complement.cpp +++ b/ABACUS.develop/source/src_pw/pw_complement.cpp @@ -1,5 +1,5 @@ #include "pw_complement.h" -#include "mymath.h" +#include "src_global/mymath.h" int PW_complement::get_total_pw_number( const double& ggcut_start, diff --git a/ABACUS.develop/source/src_pw/soc.cpp b/ABACUS.develop/source/src_pw/soc.cpp index b42dec8169..0b0f5cf938 100644 --- a/ABACUS.develop/source/src_pw/soc.cpp +++ b/ABACUS.develop/source/src_pw/soc.cpp @@ -37,108 +37,117 @@ void Fcoef::create(const int i1, const int i2, const int i3) Soc::Soc() { - m_loc = new Vector3 [1]; - angle1 = new double[1]; - angle2 = new double[1]; + m_loc = new Vector3 [1]; + angle1 = new double[1]; + angle2 = new double[1]; p_rot = new complex [1]; } Soc::~Soc() { - delete[] m_loc; - delete[] angle1; - delete[] angle2; + delete[] m_loc; + delete[] angle1; + delete[] angle2; delete[] p_rot; -// deallocate1(); } void Soc::init() { - return; } + double Soc::spinor(const int l, const double j, const int m, const int spin) { - double den; // denominator - double spinor0; - - if (spin!=0&&spin!=1) WARNING_QUIT("spinor","spin direction unknown"); - if (m<-l-1||m>l) WARNING_QUIT("spinor","m not allowed"); - - den = 1.0/(2.0*l+1.0); - if (fabs(j-l-0.50)<1e-8) { - //j == l+0.5 - if (spin==0) spinor0= sqrt((l+m+1.0)*den); - if (spin==1) spinor0= sqrt((l-m)*den); - } - else if (fabs(j-l+0.50)<1e-8){ - //j == l-0.5 - if (m<-l+1) - spinor0=0.0; - else - { - if (spin==0) spinor0= sqrt((l-m+1.0)*den); - if (spin==1) spinor0= -sqrt((l+m)*den); - } - } - else - { - WARNING_QUIT("soc::spinor","j and l not compatible"); - } - - return spinor0; + double den; // denominator + double spinor0; + + if (spin!=0&&spin!=1) WARNING_QUIT("spinor","spin direction unknown"); + if (m<-l-1||m>l) WARNING_QUIT("spinor","m not allowed"); + + den = 1.0/(2.0*l+1.0); + if (fabs(j-l-0.50)<1e-8) + { + //j == l+0.5 + if (spin==0) + { + spinor0= sqrt((l+m+1.0)*den); + } + if (spin==1) + { + spinor0= sqrt((l-m)*den); + } + } + else if (fabs(j-l+0.50)<1e-8){ + //j == l-0.5 + if (m<-l+1) + { + spinor0=0.0; + } + else + { + if (spin==0) spinor0= sqrt((l-m+1.0)*den); + if (spin==1) spinor0= -sqrt((l+m)*den); + } + } + else + { + WARNING_QUIT("soc::spinor","j and l not compatible"); + } + + return spinor0; } void Soc::rot_ylm(const int lmax) { int m,n,l; -// this->rotylm = new complex* [2*lmax +1]; -// for(int i=0;i< 2 * lmax + 1; i++){ -// this->rotylm[i] = new complex [2*lmax +1]; -// for(int j = 0;j< 2 * lmax + 1;j++){ -// this->rotylm[i][j] = complex(0.0,0.0) ; -// } -// } + // this->rotylm = new complex* [2*lmax +1]; + // for(int i=0;i< 2 * lmax + 1; i++){ + // this->rotylm[i] = new complex [2*lmax +1]; + // for(int j = 0;j< 2 * lmax + 1;j++){ + // this->rotylm[i][j] = complex(0.0,0.0) ; + // } + // } this->l_max = 2 * lmax + 1; delete[] p_rot; this->p_rot = new complex [this->l_max * this->l_max]; ZEROS(p_rot, this->l_max*this->l_max); - this->rotylm(0,lmax) = complex(1.0, 0.0); - - l = lmax; - for(int i=1;i<2*l+1;i += 2) - { - m = (i+1)/2; - n = l-m; - this->rotylm(i,n) = complex(pow(-1.0 , m) / sqrt(2) , 0.0); - this->rotylm(i+1,n) = complex(0.0,-pow(-1.0 , m)/sqrt(2)); - n = l+m; - this->rotylm(i,n) = complex(1.0/sqrt(2), 0.0); - this->rotylm(i+1,n) = complex(0.0, 1.0/sqrt(2)); - } - return; + this->rotylm(0,lmax) = complex(1.0, 0.0); + + l = lmax; + for(int i=1;i<2*l+1;i += 2) + { + m = (i+1)/2; + n = l-m; + this->rotylm(i,n) = complex(pow(-1.0 , m) / sqrt(2) , 0.0); + this->rotylm(i+1,n) = complex(0.0,-pow(-1.0 , m)/sqrt(2)); + n = l+m; + this->rotylm(i,n) = complex(1.0/sqrt(2), 0.0); + this->rotylm(i+1,n) = complex(0.0, 1.0/sqrt(2)); + } + return; } + /*void Soc::allocate_fcoef(const int nhm,const int nt) -{ - //allocate - fcoef = new complex ****[nt]; - for(int i=0;i ***[2]; - for(int j=0;j<2;j++){ - fcoef[i][j] = new complex **[2]; - for(int k=0;k *[nhm]; - for(int l=0;l [nhm]; - for(int m=0;m(0.0,0.0); - } - } - } - } - } - return; + { +//allocate +fcoef = new complex ****[nt]; +for(int i=0;i ***[2]; +for(int j=0;j<2;j++){ +fcoef[i][j] = new complex **[2]; +for(int k=0;k *[nhm]; +for(int l=0;l [nhm]; +for(int m=0;m(0.0,0.0); +} +} +} +} +} +return; }*/ int Soc::sph_ind(const int l, const double j, const int m, const int spin) @@ -149,69 +158,95 @@ int Soc::sph_ind(const int l, const double j, const int m, const int spin) // Spin selects the up (spin=1) or down (spin=2) coefficient. int sph_ind0; if (spin != 0 && spin!= 1) + { WARNING_QUIT("sph_ind","spin must be 0 1"); + } if (m< -l-1 || m> l) + { WARNING_QUIT("sph_ind","m not allowed"); - if (fabs(j-l-0.5)< 1e-8){ + } + if (fabs(j-l-0.5)< 1e-8) + { if(spin == 0) sph_ind0 = m; if(spin == 1) sph_ind0 = m+1; } - else if (fabs(j-l+0.5)<1e-8 ){ - if(m<-l+1) sph_ind0 = 0; - else { - if(spin ==0) sph_ind0 = m-1; - if(spin ==1) sph_ind0 = m; + else if (fabs(j-l+0.5)<1e-8 ) + { + if(m<-l+1) + { + sph_ind0 = 0; + } + else + { + if(spin ==0) + { + sph_ind0 = m-1; + } + if(spin ==1) + { + sph_ind0 = m; + } } } - else { - cout<<"l= "<l )sph_ind0 =0; + else + { + cout<<"l= "<l ) + { + sph_ind0 =0; + } return sph_ind0; } + void Soc::cal_ux(const int ntype) { - double amag, uxmod; - int starting_it; - bool is_paraller; - //do not sign feature in teh general case - lsign = false; - ZEROS(ux, 3); - - starting_it = 0; - for(int it = 0;it 1e-6) - { - ux[0] = m_loc[it].x; - ux[1] = m_loc[it].y; - ux[2] = m_loc[it].z; - starting_it = it; - lsign = true; - break; - } - } - //initial magnetizations should be parallel - for(int it = starting_it+1; it 1e-6) + { + ux[0] = m_loc[it].x; + ux[1] = m_loc[it].y; + ux[2] = m_loc[it].z; + starting_it = it; + lsign = true; + break; + } + } + //initial magnetizations should be parallel + for(int it = starting_it+1; it b) { bool jp=false; @@ -220,4 +255,3 @@ bool Soc::judge_parallel(double a[3], Vector3 b) jp = (fabs(cross)<1e-6); return jp; } - diff --git a/ABACUS.develop/source/src_pw/soc.h b/ABACUS.develop/source/src_pw/soc.h index 7871712055..953aef7255 100644 --- a/ABACUS.develop/source/src_pw/soc.h +++ b/ABACUS.develop/source/src_pw/soc.h @@ -2,53 +2,74 @@ #define SOC_H #include "tools.h" + class Fcoef { + public: + Fcoef(); ~Fcoef(); + int ind1,ind4,ind5; + complex *p; + inline complex &operator()(const int &i1,const int &i2,const int &i3,const int &i4,const int &i5) { return p[ind2*ind3*ind4*ind5*i1 + ind3*ind4*ind5*i2 + ind4*ind5*i3 + ind5*i4 + i5]; } inline const complex &operator()(const int &i1,const int &i2,const int &i3,const int &i4,const int &i5)const { return p[ind2*ind3*ind4*ind5*i1 + ind3*ind4*ind5*i2 + ind4*ind5*i3 + ind5*i4 + i5]; } + void create(const int i1, const int i2, const int i3); -// void free(); + +// void free(); + private: + int ind2,ind3; }; +//----------------------- +// spin-orbital coupling +//----------------------- class Soc { -public: + + public: + Soc(); ~Soc(); - void init(); - double spinor(const int l, const double j, const int m, const int spin); - int sph_ind(const int l, const double j, const int m, const int spin); - void rot_ylm(const int lmax); -// complex **rotylm; + void init(); + + double spinor(const int l, const double j, const int m, const int spin); + + int sph_ind(const int l, const double j, const int m, const int spin); + + void rot_ylm(const int lmax); + // complex **rotylm; + complex *p_rot; + complex & rotylm(const int &i1,const int &i2) { return p_rot[l_max*i1 + i2]; } - Fcoef fcoef; - + Fcoef fcoef; - Vector3 *m_loc; //magnetization for each atom axis - double *angle1; - double *angle2; + Vector3 *m_loc; //magnetization for each atom axis + double *angle1; + double *angle2; + + double ux[3]; + void cal_ux(const int ntype); + bool lsign ; + + //int npol; + private: + + bool judge_parallel(double a[3],Vector3 b); - double ux[3]; - void cal_ux(const int ntype); - bool lsign ; - - //int npol; -private: - bool judge_parallel(double a[3],Vector3 b); int l_max; }; #endif diff --git a/ABACUS.develop/source/src_pw/sto_che.cpp b/ABACUS.develop/source/src_pw/sto_che.cpp new file mode 100644 index 0000000000..3b8caae50e --- /dev/null +++ b/ABACUS.develop/source/src_pw/sto_che.cpp @@ -0,0 +1,155 @@ +#include "sto_che.h" +#include "global.h" + + +Stochastic_Chebychev::Stochastic_Chebychev() +{ + initplan = false; + initcoef = false; + getcoef = false; + getpolyval = false; + extend = 10; + norder = 5; + ccoef = new complex [1]; + coef = new double [1]; + polyvalue = new complex [1]; +} + +Stochastic_Chebychev::~Stochastic_Chebychev() +{ + if(initplan) + { + fftw_destroy_plan(plancoef); + } + delete [] coef; + delete [] ccoef; + delete [] polyvalue; +} +void Stochastic_Chebychev:: init() +{ + norder = STO_WF.nche_sto; + assert(norder > 5); + assert(extend >= 1); + if(norder != 0) + { + norder2 = 2 * norder * extend; + delete[] coef; + delete[] ccoef; + delete[] polyvalue; + ccoef = new complex [norder2]; + coef = new double [norder2]; + polyvalue = new complex [norder]; + initcoef = true; + } + else + { + WARNING_QUIT("Stochastic_Chebychev", "The Chebychev expansion order should be at least one!"); + } + +} + +void Stochastic_Chebychev:: calcoef(double fun(double)) +{ + if(!initcoef) WARNING_QUIT("Stochastic_Chebychev", "Please init coef first!"); + for(int i = 0; i < norder2; ++i) + { + coef[i]=fun(cos((i+0.5)*TWO_PI/norder2)); + } + if(!initplan) + { + initplan = true; + plancoef = fftw_plan_dft_r2c_1d(norder2, coef, (fftw_complex *) ccoef, FFTW_MEASURE); + } + fftw_execute(plancoef); + complex ui(0,1); + for(int i = 0; i Stochastic_Chebychev:: calresult() +{ + if(!getcoef||!getpolyval) WARNING_QUIT("Stochastic_Chebychev", "Please calculate coef or polyval first!"); + complex result = 0; + for(int ior = 0; ior < norder; ++ior) + { + result += coef[ior] * polyvalue[ior]; + } + return result; +} + +void Stochastic_Chebychev:: calresult(double &t, double& result) +{ + if(!getcoef) WARNING_QUIT("Stochastic_Chebychev", "Please calculate coef first!"); + double tnp1, tn, tn_1; + tn_1 = 1; + tn = tn_1 * t; + //0- & 1-st order + result = coef[0] * tn_1 + coef[1] * tn; + + //more than 1-st orders + for(int ior = 2; ior < norder; ++ior) + { + recurs(tnp1, tn, tn_1, t); + result += coef[ior] * tnp1; + tn_1 = tn; + tn = tnp1; + } + return; +} + + +void Stochastic_Chebychev:: calpolyval(void tfun(complex *in, complex *out), int& ndim, complex *wavein) +{ + + complex *arraynp1, *arrayn, *arrayn_1; + arraynp1 = new complex [ndim]; + arrayn = new complex [ndim]; + arrayn_1 = new complex [ndim]; + + DCOPY(wavein, arrayn_1, ndim); + tfun(arrayn_1, arrayn); + + ZEROS(polyvalue,norder); + //0- & 1-st order + for(int i = 0; i < ndim; ++i) + { + polyvalue[0] += conj(wavein[i]) * wavein[i];// 0-th order : = ndim + polyvalue[1] += conj(wavein[i]) * arrayn[i];// 1-st order : + } + + //more than 1-st orders + for(int ior = 2; ior < norder; ++ior) + { + recurs(arraynp1, arrayn, arrayn_1, tfun, ndim); + for(int i = 0; i < ndim; ++i) // n-th order : + { + polyvalue[ior] += conj(wavein[i]) * arraynp1[i]; + } + + complex* tem = arrayn_1; + arrayn_1 = arrayn; + arrayn = arraynp1; + arraynp1 = tem; + } + + delete [] arraynp1; + delete [] arrayn; + delete [] arrayn_1; + getpolyval = true; + return; +} diff --git a/ABACUS.develop/source/src_pw/sto_che.h b/ABACUS.develop/source/src_pw/sto_che.h new file mode 100644 index 0000000000..ed89500e2f --- /dev/null +++ b/ABACUS.develop/source/src_pw/sto_che.h @@ -0,0 +1,101 @@ +#ifndef INCLUDE_STO_CHEBYCHEV_H +#define INCLUDE_STO_CHEBYCHEV_H + +#include "tools.h" +#include "../src_global/mymath.h" +//---------------------------------------------- +// Chebychev Filtering +//---------------------------------------------- + +class Stochastic_Chebychev +{ + + public: + + // constructor and deconstructor + Stochastic_Chebychev(); + ~Stochastic_Chebychev(); + void init(); + + void calcoef(double fun(double)); + complex calresult(); + void calresult(double &t, double &result); + + template + void calresult(void fun(T *in, T *out), int& ndim, T *wavein, T *waveout); + + + + void calpolyval(void fun(complex *in, complex *out), int& ndim, complex *wavein); + + int norder; + int extend; + int norder2; // 2 * norder + double* coef; //[norder2] expansion coefficient of each order, only first norder coefficients are usefull + complex *ccoef; //[norder2] temporary complex expansion coefficient of each order, only first norder coefficients are usefull. + complex *polyvalue; // + fftw_plan plancoef; + bool initplan, initcoef, getcoef, getpolyval; + + private: + void recurs(double&tnp1, double &tn, double &tn_1, double& t); //tnp1: T_(n+1), tn: T_n, tn_1: T_(n-1) + template + void recurs(T *arraynp1, T* arrayn, T *arrayn_1, void fun(T *in,T *out), int& ndim); + + +}; + +template +void Stochastic_Chebychev:: recurs(T *arraynp1, T* arrayn, T *arrayn_1, void fun(T *in,T *out), int& ndim) +{ + fun(arrayn,arraynp1); + for(int i = 0; i < ndim; ++i) + { + arraynp1[i]=2*arraynp1[i]-arrayn_1[i]; + } +} + +template +void Stochastic_Chebychev:: calresult(void tfun(T *in, T *out), int &ndim, T *wavein, T *waveout) +{ + if(!getcoef) WARNING_QUIT("Stochastic_Chebychev", "Please calculate coef first!"); + + T *arraynp1, *arrayn, *arrayn_1; + arraynp1 = new T [ndim]; + arrayn = new T [ndim]; + arrayn_1 = new T [ndim]; + DCOPY(wavein, arrayn_1, ndim); + tfun(arrayn_1, arrayn); + + //0- & 1-st order + for(int i = 0; i < ndim; ++i) + { + waveout[i] = coef[0] * arrayn_1[i] + coef[1] * arrayn[i]; + } + + + + //more than 1-st orders + for(int ior = 2; ior < norder; ++ior) + { + recurs(arraynp1, arrayn, arrayn_1, tfun, ndim); + for(int i = 0; i < ndim; ++i) + { + waveout[i] += coef[ior] * arraynp1[i]; + } + T * tem = arrayn_1; + arrayn_1 = arrayn; + arrayn = arraynp1; + arraynp1 = tem; + } + delete [] arraynp1; + delete [] arrayn; + delete [] arrayn_1; + return; +} + + + + + +#endif// Eelectrons_Chebychev diff --git a/ABACUS.develop/source/src_pw/sto_elec.cpp b/ABACUS.develop/source/src_pw/sto_elec.cpp new file mode 100644 index 0000000000..8cd94ffd0e --- /dev/null +++ b/ABACUS.develop/source/src_pw/sto_elec.cpp @@ -0,0 +1,416 @@ +#include "tools.h" +#include "global.h" +#include "sto_elec.h" +#include "occupy.h" +#include "symmetry_rho.h" +#include "../src_io/wf_io.h" +#include "H_Ewald_pw.h" + +double Stochastic_Elec::avg_iter = 0; + +Stochastic_Elec::Stochastic_Elec() +{ +} + +Stochastic_Elec::~Stochastic_Elec() +{ +} + + +void Stochastic_Elec::scf_stochastic(const int &istep) +{ + timer::tick("Elec_Stochastic","scf_stochastic",'D'); + + // mohan update 2021-02-25 + H_Ewald_pw::compute_ewald(ucell,pw); + + set_ethr(); + + if(OUT_LEVEL=="ie") + { + cout << setprecision(12); + cout<< " " << setw(7)<< "ITER"; + + if(NSPIN==2) + { + cout<conv_elec = false; + + clock_t start,finish; + double duration = 0.0; + //for (this->iter = 1;iter <= NITER;iter++) + STO_WF.init(); + for (this->iter = 1;iter <= 20;iter++) + { + ofs_running + << "\n PW-STOCHASTIC ALGO --------- ION=" << setw(4) << istep + 1 + << " ELEC=" << setw(4) << iter + << "--------------------------------\n"; + + if(iter==1) + { + CHR.new_e_iteration = true; + } + else + { + CHR.new_e_iteration = false; + } + + // record the start time. + start=std::clock(); + + //(1) set converged threshold, + // automatically updated during self consistency. + //this->update_ethr(iter); + if(FINAL_SCF && iter==1) + { + ETHR = 1.0e-12; // only for test + //ETHR = 1.0e-2; + } + else + { + this->update_ethr(iter); + } + + if(FINAL_SCF && iter==1) + { + CHR.irstep=0; + CHR.idstep=0; + CHR.totstep=0; + } + + // mohan move harris functional to here, 2012-06-05 + // use 'rho(in)' and 'v_h and v_xc'(in) + en.calculate_harris(1); + + // first_iter_again: // Peize Lin delete 2019-05-01 + + //(2) calculate band energy using cg or davidson method. + // output the new eigenvalues and wave functions. + + if(NBANDS > 0) + { + this->c_bands(istep+1); + } + + if (check_stop_now()) return; + + en.eband = 0.0; + en.demet = 0.0; + en.ef = 0.0; + en.ef_up = 0.0; + en.ef_dw = 0.0; + + //(3) save change density as previous charge, + // prepared fox mixing. + CHR.save_rho_before_sum_band(); + + //(4) calculate fermi energy. + stoiter.init(); + stoiter.test(); + stoiter.itermu(); + + + //(5) calculate new charge density + // calculate KS rho. + if(NBANDS > 0) + { + CHR.sum_band(); + } + else + { + for(int is=0; is= 0 ) CHR.rho = CHR.rho_save; + //ofs_running << "\n start next iterate for idum "; + + } + + timer::tick("Elec_Stochastic","scf_stochastic",'D'); + return; +} // end electrons + + +bool Stochastic_Elec::check_stop_now(void) +{ + bool check_stop_now = false; + + if (check_stop_now) + { + conv_elec = false; + } + + return check_stop_now; +} + + +void Stochastic_Elec::c_bands(const int &istep) +{ + if (test_elec) TITLE("electrons","c_bands"); + timer::tick("Elec_Stochastic","c_bands",'E'); + + int precondition_type = 2; + + double *h_diag = new double[wf.npwx * NPOL];//added by zhengdy-soc + ZEROS(h_diag, wf.npwx * NPOL); + + avg_iter = 0.0; + + ofs_running << " " <iter, ik, h_diag, avg_iter_k); + + + avg_iter += avg_iter_k; + + en.print_band(ik); + + clock_t finish=clock(); + const double duration = static_cast(finish - start) / CLOCKS_PER_SEC; + + + ofs_running << " " << setw(8) + << ik+1 << setw(15) + << avg_iter_k << setw(15) << duration << endl; + }//End K Loop + + + if(BASIS_TYPE=="pw") + { + // ofs_running << " avg_iteri " << avg_iter << endl; + Parallel_Reduce::reduce_double_allpool(avg_iter); //mohan fix bug 2012-06-05 + // ofs_running << " avg_iter_after " << avg_iter << endl; + avg_iter /= static_cast(kv.nkstot); + } + + delete [] h_diag; + + timer::tick("Elec_Stochastic","c_bands",'E'); + + return; +} + diff --git a/ABACUS.develop/source/src_pw/sto_elec.h b/ABACUS.develop/source/src_pw/sto_elec.h new file mode 100644 index 0000000000..eb15a7e46b --- /dev/null +++ b/ABACUS.develop/source/src_pw/sto_elec.h @@ -0,0 +1,36 @@ +#ifndef INCLUDE_STO_ELEC_H +#define INCLUDE_STO_ELEC_H + +#include "tools.h" +#include "threshold_elec.h" +#include "sto_wf.h" +#include "sto_iter.h" + +//---------------------------------------------- +// methods based on stochastic wave functions +//---------------------------------------------- + +class Stochastic_Elec: private Threshold_Elec +{ + + public: + + // constructor and deconstructor + Stochastic_Elec(); + ~Stochastic_Elec(); + + int iter; + + static double avg_iter; + + void scf_stochastic(const int &istep); + + private: + Stochastic_Iter stoiter; + + void c_bands(const int &istep); + + bool check_stop_now(void); +}; + +#endif// Eelectrons_Stochastic diff --git a/ABACUS.develop/source/src_pw/sto_hchi.cpp b/ABACUS.develop/source/src_pw/sto_hchi.cpp new file mode 100644 index 0000000000..ae9f333636 --- /dev/null +++ b/ABACUS.develop/source/src_pw/sto_hchi.cpp @@ -0,0 +1,356 @@ +#include "tools.h" +#include "global.h" +#include "sto_hchi.h" + +int Stochastic_hchi:: nrxx; +int Stochastic_hchi:: nx,Stochastic_hchi::ny,Stochastic_hchi::nz; +fftw_plan Stochastic_hchi:: pb, Stochastic_hchi::pf; +double Stochastic_hchi:: Emin, Stochastic_hchi:: Emax; +bool Stochastic_hchi:: initplan, Stochastic_hchi::ortho; +complex* Stochastic_hchi:: rp_chi, * Stochastic_hchi::rl_chi; +int * Stochastic_hchi:: GRA_index; + + +Stochastic_hchi::Stochastic_hchi() +{ + initplan = false; + ortho = false; + nrxx = 0; + rp_chi = new complex [1]; + rl_chi = new complex [1]; + GRA_index = new int [1]; +} + +Stochastic_hchi::~Stochastic_hchi() +{ + if(initplan) + { + fftw_destroy_plan(pb); + fftw_destroy_plan(pf); + } + delete[] rp_chi; + delete[] rl_chi; +} + +void Stochastic_hchi:: init() +{ + //wait for init-------------------------------------- + //nrxx + //--------------------------------------------------- + nrxx = pw.nrxx; + nx = pw.nx; + ny = pw.ny; + nz = pw.nz; + if(nrxx != 0) + { + delete[] rp_chi; + delete[] rl_chi; + delete[] GRA_index; + rp_chi = new complex [nrxx]; + rl_chi = new complex [nrxx]; + GRA_index = new int [wf.npw]; + pf=fftw_plan_dft_3d(nx,ny,nz,(fftw_complex *)rp_chi,(fftw_complex *)rp_chi, FFTW_FORWARD, FFTW_MEASURE); + pb=fftw_plan_dft_3d(nx,ny,nz,(fftw_complex *)rl_chi,(fftw_complex *)rl_chi, FFTW_BACKWARD, FFTW_MEASURE); + initplan = true; + } + else + { + WARNING_QUIT("Stochastic_hchi", "Number of grids should be at least one!"); + } + +} + +void Stochastic_hchi::get_GRA_index() +{ + int ix,iy,iz; + int ir; + ZEROS(GRA_index,wf.npw); + for(int ig = 0 ; ig < wf.npw; ++ig) + { + ix = floor(pw.gcar[wf.igk(0, ig)].x+0.1); + iy = floor(pw.gcar[wf.igk(0, ig)].y+0.1); + iz = floor(pw.gcar[wf.igk(0, ig)].z+0.1); + if(ix < 0) ix += nx; + if(iy < 0) iy += ny; + if(iz < 0) iz += nz; + ir = ix * ny * nz + iy * nz + iz; + GRA_index[ig] = ir; + } +} + +void Stochastic_hchi::orthogonal_to_psi_real(complex *wfin, complex *wfout, int &ikk) +{ + + TITLE("Stochastic_hchi","orthogonal_to_psi0"); + if(!initplan) WARNING_QUIT("Stochastic_hchi", "Please init hchi first!"); + + DCOPY(wfin,rp_chi,nrxx); + fftw_execute(pf); + + complex * chig = new complex [wf.npw]; + for(int ig = 0; ig < wf.npw; ++ig) + { + chig[ig] = rp_chi[GRA_index[ig]]; + } + + //orthogonal part + complex sum; + for(int iksb = 0; iksb < NBANDS; ++iksb) + { + complex *kswf = &wf.evc[ikk](iksb,0); + sum=0; + for(int ig = 0; ig < wf.npw; ++ig) + { + sum += conj(kswf[ig]) * chig[ig]; + } + for(int ig = 0; ig < wf.npw; ++ig) + { + chig[ig] -= sum*kswf[ig]; + } + } + + //test orthogonal in reciprocal space + //complex overlap; + //for(int iksb = 0; iksb < NBANDS; ++iksb) + //{ + // complex *kswf = &wf.evc[ikk](iksb,0); + // overlap=0; + // for(int ig = 0; ig < wf.npw; ++ig) + // { + // overlap += conj(kswf[ig]) * chig[ig]; + // } + // cout<<"OVERLAP "< overlap; + complex * kswf = new complex [nrxx]; + fftw_plan pp=fftw_plan_dft_3d(pw.nx,pw.ny,pw.nz,(fftw_complex *)kswf,(fftw_complex *)kswf, FFTW_BACKWARD, FFTW_ESTIMATE); + for(int iksb = 0; iksb < NBANDS; ++iksb) + { + ZEROS(kswf,nrxx); + for(int ig = 0 ; ig < wf.npw; ++ig) + { + kswf[GRA_index[ig]] = wf.evc[ikk](iksb,ig); + } + fftw_execute(pp); + overlap=0; + for(int ir = 0; ir < nrxx; ++ir) + { + overlap += conj(kswf[ir]) * wfout[ir]; + } + cout<<"OVERLAP "<*chi_in, complex *hchi) +{ + + double*vr = pot.vr_eff1; //vr= pot.vrs1 temporarily use cutoff vr. + + //wait for init-------------------------------------- + double dk1,dk2,dk3; + dk1 = ucell.tpiba; + dk2 = ucell.tpiba; + dk3 = ucell.tpiba; + + //--------------------------------------------------- + if(!initplan) WARNING_QUIT("Stochastic_hchi", "Please init hchi first!"); + + ZEROS(hchi,nrxx); + DCOPY(chi_in, rp_chi, nrxx); + fftw_execute(pf); + + complex * chig = new complex [wf.npw]; + ZEROS(chig,wf.npw); + for(int ig = 0; ig < wf.npw; ++ig) + { + chig[ig] = rp_chi[GRA_index[ig]]; + } + + //------------------------------------ + //(1) the local potential. + //------------------------------------ + + if(VL_IN_H) + { + for(int ir = 0; ir < nrxx; ++ir) + { + hchi[ir] += chi_in[ir] * vr[ir] ; + } + + } + /*cout<<"HCHI-------------------------"< gg; + int gx,gy,gz; + for(int ig1 = 0, i = 0; ig1 < nx; ++ig1) + { + for(int ig2 = 0; ig2 < ny; ++ig2) + { + for(int ig3 = 0; ig3 < nz; ++ig3) + { + gx = ig1; + gy = ig2; + gz = ig3; + if(ig1 > nx/2) gx -= nx; + if(ig2 > ny/2) gy -= ny; + if(ig3 > nz/2) gz -= nz; + gg.set(gx*dk1, gy*dk2, gz*dk3); + rl_chi[i] = gg.norm2()*rp_chi[i]; + ++i; + } + } + + } + } + + + + + //------------------------------------ + // (3) the nonlocal pseudopotential. + //------------------------------------ + if(VNL_IN_H) + { + if ( ppcell.nkb > 0) + { + complex *becp = new complex[ ppcell.nkb * NPOL ]; + ZEROS(becp,ppcell.nkb * NPOL); + + for (int i=0;i< ppcell.nkb;++i) + { + const complex* p = &ppcell.vkb(i,0); + for (int ig=0; ig< wf.npw; ++ig) + { + if(NSPIN!=4) becp[i] += chig[ig] * conj( p[ig] ); + else + { + //We didnot consider it temporarily. + } + } + } + + //Parallel_Reduce::reduce_complex_double_pool( becp, ppcell.nkb * NPOL); + complex * Ps = new complex [ppcell.nkb * NPOL]; + ZEROS( Ps, ppcell.nkb * NPOL ); + int sum = 0; + int iat = 0; + // this function sum up each non-local pseudopotential located in each atom, + // all we need to do is put the right Dij coefficient to each becp, which + // is calculated before. + for (int it=0; it* p = &ppcell.vkb(i,0); + for(int ig=0; ig< wf.npw; ++ig) + { + chig[ig] += Ps[i] * p[ig]; + } + } + delete[] becp; + delete[] Ps; + } + for(int ig = 0; ig < wf.npw; ++ig) + { + rl_chi[GRA_index[ig]] += chig[ig]; + } + } + + + //------------------------------------ + // (4) Conver (2) & (3) in Reciprocal space to Real one + //------------------------------------ + fftw_execute(pb); + for(int i = 0; i < nrxx; ++i) + { + hchi[i] += rl_chi[i] / nrxx; + } + + + double Ebar = (Emin + Emax)/2; + double DeltaE = (Emax - Emin)/2; + for(int i = 0; i < nrxx; ++i) + { + hchi[i] = (hchi[i] - Ebar * chi_in[i]) / DeltaE; + } + delete [] chig; + //test Emax & Emin + //------------------------------------------------------------ + //double sum1 = 0; + //double sum2 = 0; + //for(int i = 0 ; i < nrxx; ++i) + //{ + // sum1 += norm(chi_in[i]); + // sum2 += real(conj(chi_in[i]) * hchi[i]); + //} + //cout< sum=0; + //for(int i = 0 ; i < nrxx; ++i) + //{ + // sum+=conj(chi_in[i]) * hchi[i]; + //} + //cout< *rp_chi,*rl_chi; + + static int * GRA_index; + static void get_GRA_index(); + + static void orthogonal_to_psi_real(complex* wfin, complex *wfout, int& ikk); //wfin & wfout are wavefunctions in real space + static void hchi_real(complex *wfin, complex *wfout); //wfin & wfout are wavefunctions in real space + + static void orthogonal_to_psi_reciprocal(complex* wfin, complex *wfout, int& ikk); //wfin & wfout are wavefunctions in reciprocal space + static void hchi_reciprocal(complex *wfin, complex *wfout); //wfin & wfout are wavefunctions in reciprocal space + + + private: + + // chi should be orthogonal to psi (generated by diaganolization methods, + // such as CG) + + + +}; + +#endif// Eelectrons_hchi diff --git a/ABACUS.develop/source/src_pw/sto_iter.cpp b/ABACUS.develop/source/src_pw/sto_iter.cpp new file mode 100644 index 0000000000..a579886577 --- /dev/null +++ b/ABACUS.develop/source/src_pw/sto_iter.cpp @@ -0,0 +1,482 @@ +#include "tools.h" +#include "global.h" +#include "sto_iter.h" +#include "occupy.h" + +double Stochastic_Iter:: mu; +double Stochastic_Iter:: mu0; +double Stochastic_Iter:: Emin; +double Stochastic_Iter:: Emax; + +Stochastic_Iter::Stochastic_Iter() +{ + mu0 = 0; + spolyv = new double [1]; +} + +Stochastic_Iter::~Stochastic_Iter() +{ +} +void Stochastic_Iter:: init() +{ + nchip = STO_WF.nchip; + //wait for init + targetne = ucell.nelec; + stoche.init(); + stohchi.init(); + stohchi.get_GRA_index(); + delete [] spolyv; + int norder = stoche.norder; + spolyv = new double [norder]; + +} + +void Stochastic_Iter:: itermu() +{ + + + int nkk=1;// We temporarily use gamma k point. + //orthogonal part + if(NBANDS > 0) + { + for(int ik = 0; ik < nkk; ++ik) + { + for(int ichi = 0; ichi < nchip; ++ichi) + { + complex * p0 = &STO_WF.chi0[ik](ichi,0); + complex * pchi = &STO_WF.chiortho[ik](ichi,0); + stohchi.orthogonal_to_psi_real(p0,pchi,ik); + } + } + } + + //if(NBANDS > 0) + //{ + // Emin = wf.ekb[0][0];} + //Emax = pw.ecutwfc * 20-250; + Emax = 750; + Emin = -10; + Stochastic_hchi:: Emin = this->Emin; + Stochastic_hchi:: Emax = this->Emax; + + sumpolyval(); + mu = mu0 - 2; + double ne1 = calne(); + double mu1 = mu; + mu = mu0 + 2; + double ne2 = calne(); + double mu2 = mu; + th_ne = 1e-6; + double Dne = th_ne + 1; + double ne3; + double mu3; + + mu = 0; + ne1 = calne(); + //test the domin of mu + /*for(mu = -5; mu<5;mu+=0.2) + { + ne1 = calne(); + cout<<"mu: "< targetne) + { + mu1 -= 2; + mu = mu1; + ne1 = calne(); + cout<<"Reset mu1 from "< th_ne) + { + mu3 = (mu2 + mu1) / 2; + mu = mu3; + ne3 = calne(); + if(ne3 < targetne) + { + ne1 = ne3; + mu1 = mu3; + } + else if(ne3 > targetne) + { + ne2 = ne3; + mu2 = mu3; + } + Dne = abs(targetne - ne3); + //cout< 100) + { + cout<<"Fermi energy cannot be converged."< 0) + { + for(int ikk = 0; ikk < nkk; ++ikk) + { + double *en=wf.ekb[ikk]; + for(int iksb = 0; iksb < NBANDS; ++iksb) + { + wf.wg(ikk,iksb) = fd(en[iksb])*kv.wk[ikk]; + } + } + } +} + +void Stochastic_Iter:: sumpolyval() +{ + int norder = stoche.norder; + //wait for init + int nkk=1; + + int nrxx = stohchi.nrxx; + ZEROS(spolyv, norder); + + complex * pchi; + for(int ik = 0; ik < nkk; ++ik) + { + for(int ichi = 0; ichi < nchip; ++ichi) + { + if(NBANDS > 0) + { + pchi = &STO_WF.chiortho[ik](ichi,0); + } + else + { + pchi = &STO_WF.chi0[ik](ichi,0); + } + stoche.calpolyval(stohchi.hchi_real, nrxx, pchi); + for(int ior = 0; ior < norder; ++ior) + { + spolyv[ior] += stoche.polyvalue[ior].real(); + } + } + } + + return; +} + + +double Stochastic_Iter::calne() +{ + //wait for init + int nkk = 1; + + stoche.calcoef(this->nfd); + int norder = stoche.norder; + double totne = 0; + KS_ne = 0; + for(int ikk = 0; ikk < nkk; ++ikk) + { + for(int ior = 0; ior < norder; ++ior) + { + totne += stoche.coef[ior] * spolyv[ior] * kv.wk[ikk]; + } + //cout< 0) + { + double *en=wf.ekb[ikk]; + //number of electrons in KS orbitals + for(int iksb = 0; iksb < NBANDS; ++iksb) + { + KS_ne += fd(en[iksb]) * kv.wk[ikk]; + } + } + + } + totne += KS_ne; + + return totne; +} + +void Stochastic_Iter::sum_stoband() +{ + //stoche.calcoef(this->nfd); + stoche.calcoef(this->nroot_fd); + + int nkk=1;// We temporarily use gamma k point. + int nrxx = stohchi.nrxx; + + complex * out = new complex [nrxx]; + complex * hout = new complex [nrxx]; + + double dr3 = nrxx / ucell.omega; + double Ebar = (Emin + Emax)/2; + double DeltaE = (Emax - Emin)/2; + + double out2, tmpne; + double sto_ne; + double sto_ekband=0; + cout<<"Eband 1 "< * pchi; + for(int ik = 0; ik < nkk; ++ik) + { + sto_ekband =0; + double *rho = CHR.rho[ik]; + tmpne = 0; + for(int ichi = 0; ichi < nchip; ++ichi) + { + if(NBANDS > 0) + { + pchi = &STO_WF.chiortho[ik](ichi,0); + } + else + { + pchi = &STO_WF.chi0[ik](ichi,0); + } + stoche.calresult(stohchi.hchi_real, nrxx, pchi, out); + stohchi.hchi_real(out,hout); + for(int ir = 0; ir < nrxx; ++ir) + { + out2 = norm(out[ir]); + tmpne = out2 * kv.wk[ik]; + sto_ekband += real(conj(out[ir]) * hout[ir]) * DeltaE + Ebar * out2; + rho[ir] += tmpne * dr3; + sto_ne += tmpne; + //rho[ir] += real(conj(pchi[ir]) * out[ir]) * kv.wk[ik] * nrxx / ucell.omega; + } + } + en.eband += sto_ekband * kv.wk[ik]; + } + cout<<"Eband 2 "< 200) + return 0; + else + return 1 / sqrt(1 + exp(e_mu)); +} + +double Stochastic_Iter:: nroot_fd(double e) +{ + double Ebar = (Emin + Emax)/2; + double DeltaE = (Emax - Emin)/2; + double ne_mu = (e * DeltaE + Ebar - mu) / Occupy::gaussian_parameter ; + if(ne_mu > 200) + return 0; + else + return 1 / sqrt(1 + exp(ne_mu)); +} + +double Stochastic_Iter:: fd(double e) +{ + double e_mu = (e - mu) / Occupy::gaussian_parameter ; + if(e_mu > 100) + return 0; + else + return 1 / (1 + exp(e_mu)); +} + +double Stochastic_Iter:: nfd(double e) +{ + double Ebar = (Emin + Emax)/2; + double DeltaE = (Emax - Emin)/2; + double ne_mu = (e * DeltaE + Ebar - mu) / Occupy::gaussian_parameter ; + if(ne_mu > 100) + return 0; + else + return 1 / (1 + exp(ne_mu)); +} + void Stochastic_Iter:: test() + { + //=====================test============================ + /* + complex *in = new complex [pw.nrxx]; + + complex *chig1 = new complex [wf.npw]; + complex *chig2 = new complex [wf.npw]; + ZEROS(in,pw.nrxx); + ZEROS(in2,pw.nrxx);*/ + + //--------------------------------------------------- + /*//test hermit property of hchi matrix + Emin = -1; + Emax = 1; + Stochastic_hchi:: Emin = this -> Emin; + Stochastic_hchi:: Emax = this -> Emax; + complex *out = new complex [pw.nrxx]; + complex *in2 = new complex [pw.nrxx]; + cout<<"------------------------------------"< cij,cji; + double dc; + for(int i = 0 ; i < 300 ; ++i) + { + if( i % 10 == 0) + cout<<"We are testing "< 1e-6) + { + cout<<"(i,j) = ("< Emin; + Stochastic_hchi:: Emax = this -> Emax; + int * GRA_index = stohchi.GRA_index; + ZEROS(in,pw.nrxx); + complex *kswf = &wf.evc[0](0,0); + for ( int ig = 0 ; ig< wf.npw; ++ig) + { + in[GRA_index[ig]] = kswf [ig]; + } + fftw_plan pp=fftw_plan_dft_3d(pw.nx,pw.ny,pw.nz,(fftw_complex *)in,(fftw_complex *)in2, FFTW_BACKWARD, FFTW_ESTIMATE); + fftw_execute(pp); + stohchi.hchi_real(in2,out); + fftw_plan pp2=fftw_plan_dft_3d(pw.nx,pw.ny,pw.nz,(fftw_complex *)out,(fftw_complex *)out, FFTW_FORWARD, FFTW_ESTIMATE); + fftw_execute(pp2); + for(int i = 0; i *chigout = new complex [wf.npw]; + complex *wave = new complex [pw.nrxx]; + complex *waveout = new complex [pw.nrxx]; + Emax = 1000; + Emin = 0; + Stochastic_hchi:: Emin = this->Emin; + Stochastic_hchi:: Emax = this->Emax; + double Ebar = (Emax + Emin)/2; + double DeltaE = (Emax - Emin)/2; + fftw_plan pp=fftw_plan_dft_3d(pw.nx,pw.ny,pw.nz,(fftw_complex *)wave,(fftw_complex *)wave, FFTW_BACKWARD, FFTW_ESTIMATE); + for(int ib = 0 ; ib < NBANDS ; ++ib) + { + complex *kswf = &wf.evc[0](ib,0); + hm.hpw.h_psi( kswf , chigout); + double energy = 0; + double norm1 =0; + ZEROS(wave,pw.nrxx); + for(int ig = 0 ; ig < wf.npw ; ++ig) + { + energy += real(conj(kswf[ig]) * chigout[ig]); + norm1 += norm (kswf[ig]); + wave[GRA_index[ig]] = kswf[ig]; + } + fftw_execute(pp); + stohchi.hchi_real(wave,waveout); + double energy2 = 0; + double norm2 =0; + for(int ir = 0 ; ir < pw.nrxx ; ++ir) + { + energy2 += real(conj(wave[ir]) * waveout[ir]) * DeltaE + Ebar * norm(wave[ir]); + norm2 += norm(wave[ir]); + } + + + cout<<"BAND "< *wave = new complex [pw.nrxx]; + complex *waveout = new complex [pw.nrxx]; + Emax = 750; + Emin = -100; + Stochastic_hchi:: Emin = this->Emin; + Stochastic_hchi:: Emax = this->Emax; + mu = en.ef; + stoche.calcoef(this->nfd); + fftw_plan pp=fftw_plan_dft_3d(pw.nx,pw.ny,pw.nz,(fftw_complex *)wave,(fftw_complex *)wave, FFTW_BACKWARD, FFTW_ESTIMATE); + for(int ib = 0 ; ib < NBANDS ; ++ib) + { + ZEROS(wave,pw.nrxx); + complex *kswf = &wf.evc[0](ib,0); + for(int ig = 0 ; ig < wf.npw ; ++ig) + { + wave[GRA_index[ig]] = kswf[ig]; + } + fftw_execute(pp); + double ne =0; + double norm1 = 0; + stoche.calresult(stohchi.hchi_real, pw.nrxx, wave, waveout); + for(int ir = 0 ; ir < pw.nrxx ; ++ir) + { + ne += real(conj(wave[ir]) * waveout[ir]); + norm1 += norm(wave[ir]); + } + cout<<"Ne of Band "< ui(0,1); + + delete[] chi0; + //We temporarily init one group of orbitals for all k points. + //This save memories. + chi0 = new ComplexMatrix[1]; + chi0[0].create(nchip,nrxx,false); + //init with random number + + srand((unsigned)time(NULL)); + for(int i=0; i 0) + { + chiortho[0].create(nchip,nrxx,false); + } + return; +} + + diff --git a/ABACUS.develop/source/src_pw/sto_wf.h b/ABACUS.develop/source/src_pw/sto_wf.h new file mode 100644 index 0000000000..184478ef9d --- /dev/null +++ b/ABACUS.develop/source/src_pw/sto_wf.h @@ -0,0 +1,44 @@ +#ifndef STOCHASTIC_WF_H +#define STOCHASTIC_WF_H + +#include "tools.h" +#include "sto_che.h" +//qianrui 2021-2-4 + +//---------------------------------------------- +// Generate stochastic wave functions +//---------------------------------------------- + +class Stochastic_WF +{ + public: + + Stochastic_WF(); + + ~Stochastic_WF(); + + + void init(); + + // ComplexMatrix may not be a best filetype to store the electronic wave functions + ComplexMatrix* chi0; // origin stochastic wavefunctions in real space + ComplexMatrix* chiortho; // stochastic wavefunctions after in reciprocal space orthogonalized with KS wavefunctions + Stochastic_Chebychev sto_che; + int nchi; // Total number of stochatic obitals; unit in a_0^(3/2) + int nchip; // The number of stochatic obitals in current process + int nche_sto; // number of orders for Chebyshev expansion + + int nbands_diag; // number of bands obtained from diagonalization + + int nbands_total; // number of bands in total, nbands_total=nchi+nbands_diag; + + protected: + + + + + // check the properties of chi + void check_chi(const ComplexMatrix *chi)const; + +}; +#endif diff --git a/ABACUS.develop/source/src_pw/stress.cpp b/ABACUS.develop/source/src_pw/stress.cpp index f0259163f7..4c5bc8c9d6 100644 --- a/ABACUS.develop/source/src_pw/stress.cpp +++ b/ABACUS.develop/source/src_pw/stress.cpp @@ -2,41 +2,52 @@ #include "global.h" #include "potential.h" #include "xc_functional.h" -#include "gga_pw.h" +#include "xc_gga_pw.h" #include "efield.h" +#include "myfunc.h" +#include "symmetry.h" +// new +#include "H_Ewald_pw.h" +#include "H_Hartree_pw.h" +#include "H_XC_pw.h" void Stress::cal_stress() { - TITLE("Stress","cal_stress"); - timer::tick("Stress","cal_stress",'E'); - - for(int i=0;i<3;i++){ - for(int j=0;j<3;j++){ - sigmatot[i][j] = 0.0; - sigmaxc[i][j] = 0.0; - sigmahar[i][j] = 0.0; - sigmakin[i][j] = 0.0; - sigmaloc[i][j] = 0.0; - sigmanlc[i][j] = 0.0; - sigmaewa[i][j] = 0.0; - sigmaxcc[i][j] = 0.0; - } - } - //kinetic contribution - stres_knl(); -if(SYMMETRY) -{ - symm.stress_symmetry(sigmakin); -}//end symmetry - //hartree contribution - stres_har(); + TITLE("Stress","cal_stress"); + timer::tick("Stress","cal_stress",'E'); + + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + { + sigmatot[i][j] = 0.0; + sigmaxc[i][j] = 0.0; + sigmahar[i][j] = 0.0; + sigmakin[i][j] = 0.0; + sigmaloc[i][j] = 0.0; + sigmanlc[i][j] = 0.0; + sigmaewa[i][j] = 0.0; + sigmaxcc[i][j] = 0.0; + } + } + //kinetic contribution + stres_knl(); + + if(Symmetry::symm_flag) + { + symm.stress_symmetry(sigmakin); + }//end symmetry + + //hartree contribution + stres_har(); //ewald contribution stres_ewa(); //xc contribution: add gradient corrections(non diagonal) - for(int i=0;i<3;i++){ - sigmaxc[i][i] = - (en.etxc-en.vtxc) / ucell.omega; + for(int i=0;i<3;i++) + { + sigmaxc[i][i] = - (H_XC_pw::etxc - H_XC_pw::vtxc) / ucell.omega; } stres_gradcorr(); @@ -47,24 +58,28 @@ if(SYMMETRY) stres_cc(); //nonlocal - stres_nl(); -if(SYMMETRY) -{ - symm.stress_symmetry(sigmanlc); -}//end symmetry + stres_nl(); - for(int ipol=0;ipol<3;ipol++){ - for(int jpol=0;jpol<3;jpol++){ + if(Symmetry::symm_flag) + { + symm.stress_symmetry(sigmanlc); + }//end symmetry + + for(int ipol=0;ipol<3;ipol++) + { + for(int jpol=0;jpol<3;jpol++) + { sigmatot[ipol][jpol] = sigmakin[ipol][jpol] + sigmahar[ipol][jpol] + sigmanlc[ipol][jpol] + sigmaxc[ipol][jpol] + sigmaxcc[ipol][jpol] + sigmaewa[ipol][jpol] + sigmaloc[ipol][jpol]; } } -if(SYMMETRY) -{ - symm.stress_symmetry(sigmatot); -} + if(Symmetry::symm_flag) + { + symm.stress_symmetry(sigmatot); + } + /* cout<<"total stress:"<printstress_total(ry); - - if(TEST_STRESS) - { - ofs_running << "\n PARTS OF STRESS: " << endl; - ofs_running << setiosflags(ios::showpos); - ofs_running << setiosflags(ios::fixed) << setprecision(10) << endl; - this->print_stress("KINETIC STRESS",sigmakin,TEST_STRESS,ry); - this->print_stress("LOCAL STRESS",sigmaloc,TEST_STRESS,ry); - this->print_stress("HARTREE STRESS",sigmahar,TEST_STRESS,ry); - this->print_stress("NON-LOCAL STRESS",sigmanlc,TEST_STRESS,ry); - this->print_stress("XC STRESS",sigmaxc,TEST_STRESS,ry); - this->print_stress("EWALD STRESS",sigmaewa,TEST_STRESS,ry); - this->print_stress("NLCC STRESS",sigmaxcc,TEST_STRESS,ry); - this->print_stress("TOTAL STRESS",sigmatot,TEST_STRESS,ry); - } - return; + bool ry = false; + this->printstress_total(ry); + + if(TEST_STRESS) + { + ofs_running << "\n PARTS OF STRESS: " << endl; + ofs_running << setiosflags(ios::showpos); + ofs_running << setiosflags(ios::fixed) << setprecision(10) << endl; + this->print_stress("KINETIC STRESS",sigmakin,TEST_STRESS,ry); + this->print_stress("LOCAL STRESS",sigmaloc,TEST_STRESS,ry); + this->print_stress("HARTREE STRESS",sigmahar,TEST_STRESS,ry); + this->print_stress("NON-LOCAL STRESS",sigmanlc,TEST_STRESS,ry); + this->print_stress("XC STRESS",sigmaxc,TEST_STRESS,ry); + this->print_stress("EWALD STRESS",sigmaewa,TEST_STRESS,ry); + this->print_stress("NLCC STRESS",sigmaxcc,TEST_STRESS,ry); + this->print_stress("TOTAL STRESS",sigmatot,TEST_STRESS,ry); + } + return; } void Stress::print_stress(const string &name, double f[][3], const bool screen, bool ry)const { - ofs_running << " --------------------------- " << name << " ----------------------------" << endl; + ofs_running << " --------------------------- " << name << " ----------------------------" << endl; - double fac = 1.0; + double fac = 1.0; - if(!ry) - { - // fac = Ry_to_eV / 0.529177; - } + if(!ry) + { + // fac = Ry_to_eV / 0.529177; + } - cout << setprecision(8); - cout << setiosflags(ios::showpos); + cout << setprecision(8); + cout << setiosflags(ios::showpos); - if(screen) - { - cout << " ------------------- " << name << " --------------------" << endl; - - } + if(screen) + { + cout << " ------------------- " << name << " --------------------" << endl; - const double output_acc = 1.0e-8; - for (int i=0;i<3;i++){ - ofs_running << setw(15)<< " "; - if( abs(f[i][0]) >output_acc) ofs_running << setw(15) << f[i][0]*fac; - else ofs_running << setw(15) << "0"; - if( abs(f[i][1]) >output_acc) ofs_running << setw(15) << f[i][1]*fac; - else ofs_running << setw(15) << "0"; - if( abs(f[i][2]) >output_acc) ofs_running << setw(15) << f[i][2]*fac; - else ofs_running << setw(15) << "0"; - ofs_running << endl; - - if(screen) - { - if( abs(f[i][0]) >output_acc) cout << setw(15) << f[i][0]*fac; - else cout << setw(15) << "0"; - if( abs(f[i][1]) >output_acc) cout << setw(15) << f[i][1]*fac; - else cout << setw(15) << "0"; - if( abs(f[i][2]) >output_acc) cout << setw(15) << f[i][2]*fac; - else cout << setw(15) << "0"; - cout << endl; - } + } + const double output_acc = 1.0e-8; + for (int i=0;i<3;i++) + { + ofs_running << setw(15)<< " "; + if( abs(f[i][0]) >output_acc) ofs_running << setw(15) << f[i][0]*fac; + else ofs_running << setw(15) << "0"; + if( abs(f[i][1]) >output_acc) ofs_running << setw(15) << f[i][1]*fac; + else ofs_running << setw(15) << "0"; + if( abs(f[i][2]) >output_acc) ofs_running << setw(15) << f[i][2]*fac; + else ofs_running << setw(15) << "0"; + ofs_running << endl; + + if(screen) + { + if( abs(f[i][0]) >output_acc) cout << setw(15) << f[i][0]*fac; + else cout << setw(15) << "0"; + if( abs(f[i][1]) >output_acc) cout << setw(15) << f[i][1]*fac; + else cout << setw(15) << "0"; + if( abs(f[i][2]) >output_acc) cout << setw(15) << f[i][2]*fac; + else cout << setw(15) << "0"; + cout << endl; + } - } + } - cout << resetiosflags(ios::showpos); + cout << resetiosflags(ios::showpos); - return; + return; } void Stress::printstress_total (bool ry) @@ -154,12 +169,12 @@ void Stress::printstress_total (bool ry) if(!ry) { - unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * eps8; + unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * 1.0e-8; } -// cout.setf(ios::fixed); + // cout.setf(ios::fixed); - //ofs_running << setiosflags(ios::right); + //ofs_running << setiosflags(ios::right); ofs_running << setprecision(8) << setiosflags(ios::showpos) << setiosflags(ios::fixed) << endl; NEW_PART("TOTAL-STRESS (KBAR)");//Ryd/(a.u.)^3 @@ -176,7 +191,9 @@ void Stress::printstress_total (bool ry) for(int i=0; i<3; i++) { - ofs << " " << sigmatot[i][0]*unit_transform << " " << sigmatot[i][1]*unit_transform << " " << sigmatot[i][2]*unit_transform << endl; + ofs << " " << sigmatot[i][0]*unit_transform + << " " << sigmatot[i][1]*unit_transform + << " " << sigmatot[i][2]*unit_transform << endl; } ofs.close(); @@ -209,8 +226,10 @@ void Stress::printstress_total (bool ry) } -void Stress::stres_knl() +void Stress::stres_knl(void) { + TITLE("Stress","stres_nkl"); + double *kfac; double **gk; gk=new double* [3]; @@ -218,19 +237,18 @@ void Stress::stres_knl() int ik,l,m,i,j,ibnd,is; int npw; - tbsp=2.0/sqrt(PI); int npwx=0; int qtot = 0; - for(int ik=0; ik *Porter = UFFT.porter; +void Stress::stres_har(void) +{ + TITLE("Stress","stres_har"); - // Hartree potential VH(r) from n(r) - ZEROS( Porter, pw.nrxx ); - for(int is=0; is( chr.rho[is][ir], 0.0 ); - } - } - //============================= - // bring rho (aux) to G space - //============================= - pw.FFT_chg.FFT3D(Porter, -1); - - complex *psic = new complex [pw.nrxx]; - double *psic0 = new double[pw.nrxx]; - ZEROS( psic0, pw.nrxx); - for(int is=0; is(psic0[ir], 0.0); - } - } + double shart,g2; + const double eps=1e-8; + int is,ig,l,m,nspin0; - pw.FFT_chg.FFT3D(psic, -1) ; + /* for(l=0;l<3;l++){ + for(m=0;m<3;m++){ + sigmahar[l][m]=0.0; + } + }*/ + complex *Porter = UFFT.porter; - double charge; - if (pw.gstart == 1) - { - charge = ucell.omega * Porter[pw.ig2fftc[0]].real(); - } + // Hartree potential VH(r) from n(r) + ZEROS( Porter, pw.nrxx ); + for(int is=0; is( CHR.rho[is][ir], 0.0 ); + } + } + //============================= + // bring rho (aux) to G space + //============================= + pw.FFT_chg.FFT3D(Porter, -1); + + complex *psic = new complex [pw.nrxx]; + double *psic0 = new double[pw.nrxx]; + ZEROS( psic0, pw.nrxx); + for(int is=0; is(psic0[ir], 0.0); + } + } - complex *vh_g = new complex[pw.ngmc]; - ZEROS(vh_g, pw.ngmc); - - double g[3]; -//test - // int i=pw.gstart; - // cout<< "gstart " <= 1.0e-12) //LiuXh 20180410 - { - const double fac = e2 * FOUR_PI / (ucell.tpiba2 * pw.gg [ig]); - - ehart += ( conj( Porter[j] ) * Porter[j] ).real() * fac; -// vh_g[ig] = fac * Porter[j]; - shart= ( conj( Porter[j] ) * Porter[j] ).real()/(ucell.tpiba2 * pw.gg [ig]); - g[0]=pw.gcar[ig].x; - g[1]=pw.gcar[ig].y; - g[2]=pw.gcar[ig].z; - //test - - //cout<<"g "< *vh_g = new complex[pw.ngmc]; + ZEROS(vh_g, pw.ngmc); - for(l=0;l<3;l++){ - for(m=0;m<3;m++){ - sigmahar[l][m]*=-1; - } - } -// cout<<"stres_har"<= 1.0e-12) //LiuXh 20180410 + { + const double fac = e2 * FOUR_PI / (ucell.tpiba2 * pw.gg [ig]); + + ehart += ( conj( Porter[j] ) * Porter[j] ).real() * fac; + // vh_g[ig] = fac * Porter[j]; + + shart= ( conj( Porter[j] ) * Porter[j] ).real()/(ucell.tpiba2 * pw.gg [ig]); + + g[0]=pw.gcar[ig].x; + g[1]=pw.gcar[ig].y; + g[2]=pw.gcar[ig].z; + //test + + //cout<<"g "< *Porter = UFFT.porter; - - ZEROS( Porter, pw.nrxx ); - for(int is=0; is(chr.rho[is][ir], 0.0 ); - } - } - pw.FFT_chg.FFT3D(Porter, -1); - -/* complex *psic = new complex [pw.nrxx]; - double *psic0 = new double[pw.nrxx]; - ZEROS( psic0, pw.nrxx); - for(int is=0; is(psic0[ir], 0.0); - } - } + /* for(l=0;l<3;l++){ + for(m=0;m<3;m++){ + sigmaloc[l][m]=0; + } + }*/ - pw.FFT_chg.FFT3D(psic, -1) ; - */ - if(INPUT.gamma_only==1) fact=2.0; - else fact=1.0; + complex *Porter = UFFT.porter; - evloc=0.0; - double g[3]={0,0,0}; + ZEROS( Porter, pw.nrxx ); + for(int is=0; is(CHR.rho[is][ir], 0.0 ); + } + } + pw.FFT_chg.FFT3D(Porter, -1); + + /* complex *psic = new complex [pw.nrxx]; + double *psic0 = new double[pw.nrxx]; + ZEROS( psic0, pw.nrxx); + for(int is=0; is(psic0[ir], 0.0); + } + } + + pw.FFT_chg.FFT3D(psic, -1) ; + */ + + if(INPUT.gamma_only==1) fact=2.0; + else fact=1.0; + + evloc=0.0; + double g[3]={0,0,0}; + + complex *vg = new complex[pw.ngmc]; + ZEROS( vg, pw.ngmc ); + for (int it=0; itzv, dvloc); + } + else{ + // normal case: dvloc contains dV_loc(G)/dG + dvloc_of_g ( atom->msh, atom->rab, atom->r, + atom->vloc_at, atom->zv, dvloc); + } - complex *vg = new complex[pw.ngmc]; - ZEROS( vg, pw.ngmc ); - for (int it=0; itzv, dvloc); - // - } - else{ - // - // normal case: dvloc contains dV_loc(G)/dG - // - dvloc_of_g ( atom->msh, atom->rab, atom->r, - atom->vloc_at, atom->zv, dvloc); - // - } - - for( ng = 0;ng< pw.ngmc;ng++){ - const int j = pw.ig2fftc[ng]; - g[0]=pw.gcar[ng].x; - g[1]=pw.gcar[ng].y; - g[2]=pw.gcar[ng].z; - for (l = 0;l< 3;l++){ - for (m = 0; m ) - ComplexMatrix dbecp( nkb, NBANDS); - ComplexMatrix becp( nkb, NBANDS); + const int nkb = ppcell.nkb; + if(nkb == 0) return; - // vkb1: |Beta(nkb,npw)> - ComplexMatrix vkb1( nkb, wf.npwx ); - ComplexMatrix vkb0[3]; - for(int i=0;i<3;i++){ - vkb0[i].create(nkb, wf.npwx); - } - ComplexMatrix vkb2( nkb, wf.npwx ); - for (int ik = 0;ik < kv.nks;ik++) - { - for(int i=0;i<3;i++){ - vkb0[i].zero_out(); - } - vkb2.zero_out(); - - if (NSPIN==2) CURRENT_SPIN = kv.isk[ik]; - wf.npw = kv.ngk[ik]; - // generate vkb - if (ppcell.nkb > 0) - { - ppcell.getvnl(ik); - } + // dbecp: conj( -iG * ) + ComplexMatrix dbecp( nkb, NBANDS); + ComplexMatrix becp( nkb, NBANDS); - // get becp according to wave functions and vkb - // important here ! becp must set zero!! - // vkb: Beta(nkb,npw) - // becp(nkb,nbnd): - becp.zero_out(); - for (int ib=0; ib + ComplexMatrix vkb1( nkb, wf.npwx ); + ComplexMatrix vkb0[3]; + for(int i=0;i<3;i++){ + vkb0[i].create(nkb, wf.npwx); + } + ComplexMatrix vkb2( nkb, wf.npwx ); + for (int ik = 0;ik < kv.nks;ik++) + { + for(int i=0;i<3;i++){ + vkb0[i].zero_out(); + } + vkb2.zero_out(); - + if (NSPIN==2) CURRENT_SPIN = kv.isk[ik]; + wf.npw = kv.ngk[ik]; + // generate vkb + if (ppcell.nkb > 0) + { + ppcell.getvnl(ik); + } - for(int i=0;i<3;i++) { - get_dvnl1(vkb0[i],ik,i); - } - - get_dvnl2(vkb2,ik); - - Vector3 qvec; - double qvec0[3]; - - for (int ipol = 0; ipol<3; ipol++) - { - for(int jpol = 0; jpol < ipol+1; jpol++) - { - dbecp.zero_out(); - vkb1.zero_out(); - for (int i = 0;i < nkb;i++) - { - - for (int ig=0; ig + becp.zero_out(); + for (int ib=0; ib 1e-8) qm1 = 1.0 / qvec.norm(); - else qm1 = 0; - dbecp(i,ib) += -2.0 * wf.evc[ik](ib,ig) * conj(vkb2(i,ig)) * qvec0[ipol] * qvec0[jpol] * qm1 * ucell.tpiba; - }//end ig - }//end i - }//end ib - - -// don't need to reduce here, keep dbecp different in each processor, -// and at last sum up all the forces. -// Parallel_Reduce::reduce_complex_double_pool( dbecp.ptr, dbecp.ndata); - -// double *cf = new double[ucell.nat*3]; -// ZEROS(cf, ucell.nat); - for (int ib=0; ibprint(ofs_running, "nonlocal stress", stresnl); - timer::tick("Stress","stres_nl"); - return; + for(int i=0;i<3;i++) { + get_dvnl1(vkb0[i],ik,i); + } + + get_dvnl2(vkb2,ik); + + Vector3 qvec; + double qvec0[3]; + + for (int ipol = 0; ipol<3; ipol++) + { + for(int jpol = 0; jpol < ipol+1; jpol++) + { + dbecp.zero_out(); + vkb1.zero_out(); + for (int i = 0;i < nkb;i++) + { + + for (int ig=0; ig 1e-8) qm1 = 1.0 / qvec.norm(); + else qm1 = 0; + dbecp(i,ib) += -2.0 * wf.evc[ik](ib,ig) * conj(vkb2(i,ig)) * qvec0[ipol] * qvec0[jpol] * qm1 * ucell.tpiba; + }//end ig + }//end i + }//end ib + + + // don't need to reduce here, keep dbecp different in each processor, + // and at last sum up all the forces. + // Parallel_Reduce::reduce_complex_double_pool( dbecp.ptr, dbecp.ndata); + + // double *cf = new double[ucell.nat*3]; + // ZEROS(cf, ucell.nat); + for (int ib=0; ibprint(ofs_running, "nonlocal stress", stresnl); + timer::tick("Stress","stres_nl"); + return; } void Stress::get_dvnl1( - ComplexMatrix &vkb, - const int ik, - const int ipol) + ComplexMatrix &vkb, + const int ik, + const int ipol) { - if(test_pp) TITLE("Stress","get_dvnl1"); -// timer::tick("Stress","get_dvnl1"); + if(test_pp) TITLE("Stress","get_dvnl1"); + // timer::tick("Stress","get_dvnl1"); - const int lmaxkb = ppcell.lmaxkb; - if(lmaxkb < 0) - { - return; - } + const int lmaxkb = ppcell.lmaxkb; + if(lmaxkb < 0) + { + return; + } - const int npw = kv.ngk[ik]; - const int nhm = ppcell.nhm; - int ig, ia, nb, ih; - matrix vkb1(nhm, npw); - vkb1.zero_out(); - double *vq = new double[npw]; - const int x1= (lmaxkb + 1)*(lmaxkb + 1); - - matrix dylm(x1, npw); - Vector3 *gk = new Vector3[npw]; - for (ig = 0;ig < npw;ig++) - { - gk[ig] = wf.get_1qvec_cartesian(ik, ig); - } - - dylmr2(x1, npw, gk, dylm, ipol); + const int npw = kv.ngk[ik]; + const int nhm = ppcell.nhm; + int ig, ia, nb, ih; + matrix vkb1(nhm, npw); + vkb1.zero_out(); + double *vq = new double[npw]; + const int x1= (lmaxkb + 1)*(lmaxkb + 1); + + matrix dylm(x1, npw); + Vector3 *gk = new Vector3[npw]; + for (ig = 0;ig < npw;ig++) + { + gk[ig] = wf.get_1qvec_cartesian(ik, ig); + } - int jkb = 0; - for(int it = 0;it < ucell.ntype;it++) - { - if(test_pp>1) OUT("it",it); - // calculate beta in G-space using an interpolation table - const int nbeta = ucell.atoms[it].nbeta; - const int nh = ucell.atoms[it].nh; + dylmr2(x1, npw, gk, dylm, ipol); - if(test_pp>1) OUT("nbeta",nbeta); + int jkb = 0; + for(int it = 0;it < ucell.ntype;it++) + { + if(test_pp>1) OUT("it",it); + // calculate beta in G-space using an interpolation table + const int nbeta = ucell.atoms[it].nbeta; + const int nh = ucell.atoms[it].nh; - for (nb = 0;nb < nbeta;nb++) - { - if(test_pp>1) OUT("ib",nb); - for (ig = 0;ig < npw;ig++) - { - const double gnorm = gk[ig].norm() * ucell.tpiba; + if(test_pp>1) OUT("nbeta",nbeta); -// cout << "\n gk[ig] = " << gk[ig].x << " " << gk[ig].y << " " << gk[ig].z; -// cout << "\n gk.norm = " << gnorm; + for (nb = 0;nb < nbeta;nb++) + { + if(test_pp>1) OUT("ib",nb); + for (ig = 0;ig < npw;ig++) + { + const double gnorm = gk[ig].norm() * ucell.tpiba; - vq [ig] = Mathzone::Polynomial_Interpolation( - ppcell.tab, it, nb, NQX, DQ, gnorm ); + // cout << "\n gk[ig] = " << gk[ig].x << " " << gk[ig].y << " " << gk[ig].z; + // cout << "\n gk.norm = " << gnorm; - } // enddo + vq [ig] = Mathzone::Polynomial_Interpolation( + ppcell.tab, it, nb, NQX, DQ, gnorm ); - // add spherical harmonic part - for (ih = 0;ih < nh;ih++) - { - if (nb == ppcell.indv(it, ih)) - { - const int lm = static_cast( ppcell.nhtolm(it, ih) ); - for (ig = 0;ig < npw;ig++) - { - vkb1(ih, ig) = dylm(lm, ig) * vq [ig]; - } + } // enddo - } + // add spherical harmonic part + for (ih = 0;ih < nh;ih++) + { + if (nb == ppcell.indv(it, ih)) + { + const int lm = static_cast( ppcell.nhtolm(it, ih) ); + for (ig = 0;ig < npw;ig++) + { + vkb1(ih, ig) = dylm(lm, ig) * vq [ig]; + } - } // end ih + } - } // end nbeta + } // end ih - // vkb1 contains all betas including angular part for type nt - // now add the structure factor and factor (-i)^l - for (ia=0; ia *sk = wf.get_sk(ik, it, ia); - for (ih = 0;ih < nh;ih++) - { - complex pref = pow( NEG_IMAG_UNIT, ppcell.nhtol(it, ih)); //? - for (ig = 0;ig < npw;ig++) - { - vkb(jkb, ig) = vkb1(ih, ig) * sk [ig] * pref; - } - ++jkb; - } // end ih - delete [] sk; - } // end ia - } // enddo - delete [] gk; - delete [] vq; - //timer::tick("Stress","get_dvnl1"); - return; + } // end nbeta + + // vkb1 contains all betas including angular part for type nt + // now add the structure factor and factor (-i)^l + for (ia=0; ia *sk = wf.get_sk(ik, it, ia); + for (ih = 0;ih < nh;ih++) + { + complex pref = pow( NEG_IMAG_UNIT, ppcell.nhtol(it, ih)); //? + for (ig = 0;ig < npw;ig++) + { + vkb(jkb, ig) = vkb1(ih, ig) * sk [ig] * pref; + } + ++jkb; + } // end ih + delete [] sk; + } // end ia + } // enddo + delete [] gk; + delete [] vq; + //timer::tick("Stress","get_dvnl1"); + return; }//end get_dvnl1 -void Stress::get_dvnl2(ComplexMatrix &vkb, - const int ik) + +void Stress::get_dvnl2( + ComplexMatrix &vkb, + const int ik) { - if(test_pp) TITLE("Stress","get_dvnl2"); - timer::tick("Stress","get_dvnl2"); + if(test_pp) TITLE("Stress","get_dvnl2"); + timer::tick("Stress","get_dvnl2"); - const int lmaxkb = ppcell.lmaxkb; - if(lmaxkb < 0) - { - return; - } + const int lmaxkb = ppcell.lmaxkb; + if(lmaxkb < 0) + { + return; + } - const int npw = kv.ngk[ik]; - const int nhm = ppcell.nhm; - int ig, ia, nb, ih; - matrix vkb1(nhm, npw); - double *vq = new double[npw]; - const int x1= (lmaxkb + 1)*(lmaxkb + 1); + const int npw = kv.ngk[ik]; + const int nhm = ppcell.nhm; + int ig, ia, nb, ih; + matrix vkb1(nhm, npw); + double *vq = new double[npw]; + const int x1= (lmaxkb + 1)*(lmaxkb + 1); - matrix ylm(x1, npw); - Vector3 *gk = new Vector3[npw]; - for (ig = 0;ig < npw;ig++) - { - gk[ig] = wf.get_1qvec_cartesian(ik, ig); - } - Mathzone::Ylm_Real(x1, npw, gk, ylm); + matrix ylm(x1, npw); + Vector3 *gk = new Vector3[npw]; + for (ig = 0;ig < npw;ig++) + { + gk[ig] = wf.get_1qvec_cartesian(ik, ig); + } + Mathzone::Ylm_Real(x1, npw, gk, ylm); - int jkb = 0; - for(int it = 0;it < ucell.ntype;it++) - { - if(test_pp>1) OUT("it",it); - // calculate beta in G-space using an interpolation table - const int nbeta = ucell.atoms[it].nbeta; - const int nh = ucell.atoms[it].nh; + int jkb = 0; + for(int it = 0;it < ucell.ntype;it++) + { + if(test_pp>1) OUT("it",it); + // calculate beta in G-space using an interpolation table + const int nbeta = ucell.atoms[it].nbeta; + const int nh = ucell.atoms[it].nh; - if(test_pp>1) OUT("nbeta",nbeta); + if(test_pp>1) OUT("nbeta",nbeta); - for (nb = 0;nb < nbeta;nb++) - { - if(test_pp>1) OUT("ib",nb); - for (ig = 0;ig < npw;ig++) - { - const double gnorm = gk[ig].norm() * ucell.tpiba; - -// cout << "\n gk[ig] = " << gk[ig].x << " " << gk[ig].y << " " << gk[ig].z; -// cout << "\n gk.norm = " << gnorm; - vq [ig] = Polynomial_Interpolation_nl( - ppcell.tab, it, nb, DQ, gnorm ); - - } // enddo - - // add spherical harmonic part - for (ih = 0;ih < nh;ih++) - { - if (nb == ppcell.indv(it, ih)) - { - const int lm = static_cast( ppcell.nhtolm(it, ih) ); - for (ig = 0;ig < npw;ig++) - { - vkb1(ih, ig) = ylm(lm, ig) * vq [ig]; - } - } - } // end ih - } // end nbeta - - // vkb1 contains all betas including angular part for type nt - // now add the structure factor and factor (-i)^l - for (ia=0; ia *sk = wf.get_sk(ik, it, ia); - for (ih = 0;ih < nh;ih++) - { - complex pref = pow( NEG_IMAG_UNIT, ppcell.nhtol(it, ih)); //? - for (ig = 0;ig < npw;ig++) - { - vkb(jkb, ig) = vkb1(ih, ig) * sk [ig] * pref; - } - ++jkb; - } // end ih - delete [] sk; - - } // end ia - } // enddo - - delete [] gk; - delete [] vq; - timer::tick("Stress","get_dvnl2"); + for (nb = 0;nb < nbeta;nb++) + { + if(test_pp>1) OUT("ib",nb); + for (ig = 0;ig < npw;ig++) + { + const double gnorm = gk[ig].norm() * ucell.tpiba; - return; -} + // cout << "\n gk[ig] = " << gk[ig].x << " " << gk[ig].y << " " << gk[ig].z; + // cout << "\n gk.norm = " << gnorm; + vq [ig] = Polynomial_Interpolation_nl( + ppcell.tab, it, nb, DQ, gnorm ); + + } // enddo + + // add spherical harmonic part + for (ih = 0;ih < nh;ih++) + { + if (nb == ppcell.indv(it, ih)) + { + const int lm = static_cast( ppcell.nhtolm(it, ih) ); + for (ig = 0;ig < npw;ig++) + { + vkb1(ih, ig) = ylm(lm, ig) * vq [ig]; + } + } + } // end ih + } // end nbeta + // vkb1 contains all betas including angular part for type nt + // now add the structure factor and factor (-i)^l + for (ia=0; ia *sk = wf.get_sk(ik, it, ia); + for (ih = 0;ih < nh;ih++) + { + complex pref = pow( NEG_IMAG_UNIT, ppcell.nhtol(it, ih)); //? + for (ig = 0;ig < npw;ig++) + { + vkb(jkb, ig) = vkb1(ih, ig) * sk [ig] * pref; + } + ++jkb; + } // end ih + delete [] sk; + } // end ia + } // enddo + + delete [] gk; + delete [] vq; + timer::tick("Stress","get_dvnl2"); + + return; +} double Stress::Polynomial_Interpolation_nl @@ -1289,7 +1366,8 @@ void Stress::stres_ewa(){ double alpha=2.9; double upperbound; - do{ + do + { alpha-=0.1; if(alpha==0.0) WARNING_QUIT("stres_ew", "optimal alpha not found"); @@ -1300,7 +1378,8 @@ void Stress::stres_ewa(){ //G-space sum here //Determine if this processor contains G=0 and set the constant term double sdewald; - if(pw.gstart == 1){ + if(pw.gstart == 1) + { sdewald = (TWO_PI) * e2 / 4.0 / alpha * pow(charge/ucell.omega,2); } else { @@ -1370,7 +1449,7 @@ void Stress::stres_ewa(){ //calculate tau[na]-tau[nb] d_tau = ucell.atoms[it].tau[i] - ucell.atoms[jt].tau[j]; //generates nearest-neighbors shells - en.rgen(d_tau, rmax, irr, ucell.latvec, ucell.G, r, r2, nrm); + H_Ewald_pw::rgen(d_tau, rmax, irr, ucell.latvec, ucell.G, r, r2, nrm); for(int nr=0 ; nr[pw.ngmc]; ZEROS(rhotmp1, pw.nrxx); ZEROS(rhogsum1, pw.ngmc); - for(int ir=0; ir[pw.nrxx]; ZEROS(gdr1, pw.nrxx); @@ -1471,8 +1550,8 @@ void Stress::stres_gradcorr() rhogsum2 = new complex[pw.ngmc]; ZEROS(rhotmp2, pw.nrxx); ZEROS(rhogsum2, pw.ngmc); - for(int ir=0; ir[pw.nrxx]; ZEROS(gdr2, pw.nrxx); @@ -1642,7 +1721,7 @@ void Stress::stres_cc() //recalculate the exchange-correlation potential matrix vxc(NSPIN, pw.nrxx); - pot.v_xc(chr.rho, en.etxc, en.vtxc, vxc); + H_XC_pw::v_xc(pw.nrxx, pw.ncxyz, ucell.omega, CHR.rho, CHR.rho_core, vxc); complex * psic = new complex [pw.nrxx]; ZEROS(psic, pw.nrxx); @@ -1675,7 +1754,7 @@ void Stress::stres_cc() for(nt=0;nt *gk, - matrix &dylm, - const int ipol); - double Polynomial_Interpolation_nl( - const realArray &table, - const int &dim1, - const int &dim2, - const double &table_interval, - const double &x); - void get_dvnl2( - ComplexMatrix &vkb, - const int ik); - void get_dvnl1( - ComplexMatrix &vkb, - const int ik, - const int ipol); - - - - double sigmaxc[3][3]; - double sigmakin[3][3]; - double sigmahar[3][3]; - double sigmaloc[3][3]; - double sigmanlc[3][3]; - double sigmaewa[3][3]; - double sigmaxcc[3][3]; + private: + + void stres_knl(); + + void stres_har(); + + void stres_ewa(); + + void stres_loc(); + + void stres_cc(); + + void stres_gradcorr(); + + void stres_nl(); + + void dylmr2 ( + const int nylm, + const int ngy, + Vector3 *gk, + matrix &dylm, + const int ipol); + + double Polynomial_Interpolation_nl( + const realArray &table, + const int &dim1, + const int &dim2, + const double &table_interval, + const double &x); + + void get_dvnl2( + ComplexMatrix &vkb, + const int ik); + + void get_dvnl1( + ComplexMatrix &vkb, + const int ik, + const int ipol); + + // stress for exchange-correlation functional term + double sigmaxc[3][3]; + // stress for electron kinetic energy term + double sigmakin[3][3]; + // stress for hartree term + double sigmahar[3][3]; + // stress for local pseudopotential term + double sigmaloc[3][3]; + // stress for nonlocal pseudopotential term + double sigmanlc[3][3]; + // stress for Ewald term (ion-ion interaction) + double sigmaewa[3][3]; + // stress for non-linear core correction term + double sigmaxcc[3][3]; }; diff --git a/ABACUS.develop/source/src_pw/stress_func.h b/ABACUS.develop/source/src_pw/stress_func.h new file mode 100644 index 0000000000..5d2c506946 --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_func.h @@ -0,0 +1,127 @@ +#ifndef STRESS_FUNC_H +#define STRESS_FUNC_H + +#include "tools.h" +#include "./global.h" + +//------------------------------------------------------------------- +// mohan reconstruction note: 2021-02-07 +// the stress code needs reconstructions (by Daye Zheng) +// 1) add explanations for each function, each variable, for +// main procedures, make the code readable +// 2) divide the stress class into several files, each file +// deals with only one part of the stress, it is convenient for +// the next-step reconstruction, for example, we want to make +// pw as an external variable instead of a global variable +// 3) for PW and LCAO, keeps only one copy of the code, for example +// the ewald term needs only one copy, it will reduce the +// time to maintain both copies of stress codes. +// 4) remain openning interfaces for others to contribute stress +// codes, for example, molecular dynamics will have an ionic stress +// term, +U? exx? may have other stress terms. +// 5) delete useless comments and tests, if you have a useless code, +// please explicitly explain why you want to keep the test +// 6) format should be beautiful! code should be readable like a +// note (let readers be comfortable) +//------------------------------------------------------------------- + +//---------------------------------------------------------------- +// compute the stress terms in terms of the plane wave basis set +// the stress terms include: +// 1) the stress from the electron kinetic energy +// 2) the stress from the local pseudopotentials +// 3) the stress from the non-local pseudopotentials +// 4) the stress from the Hartree term +// 5) the stress from the non-linear core correction (if any) +// 6) the strees from the exchange-correlation functional term +// 7) the stress from the ewald term (ion-ion intraction under +// periodic boundary conditions). +// 8) the stress from ionic contributions (for molecular dynamics) +//---------------------------------------------------------------- + +class Stress_Func +{ + public: + + Stress_Func(){}; + ~Stress_Func(){}; + +//stress functions +// 1) the stress from the electron kinetic energy + void stress_kin(matrix& sigma); //electron kinetic part in PW basis + +// 2) the stress from the Hartree term + void stress_har(matrix& sigma, const bool is_pw); //hartree part in PW or LCAO basis + +// 3) the stress from the ewald term (ion-ion intraction under +// periodic boundary conditions). + void stress_ewa(matrix& sigma, const bool is_pw); //ewald part in PW or LCAO basis + +// 4) the stress from the local pseudopotentials + void stress_loc(matrix& sigma, const bool is_pw); //local pseudopotential part in PW or LCAO + + void dvloc_of_g (const int& msh, + const double* rab, + const double* r, + const double* vloc_at, + const double& zp, + double* dvloc); //used in local pseudopotential stress + + void dvloc_coul (const double& zp, double* dvloc); //used in local pseudopotential stress + +// 5) the stress from the non-linear core correction (if any) + void stress_cc(matrix& sigma, const bool is_pw); //nonlinear core correction stress in PW or LCAO basis + + void deriv_drhoc ( + const bool &numeric, + const int mesh, + const double *r, + const double *rab, + const double *rhoc, + double *drhocg); //used in nonlinear core correction stress + +// 6) the stress from the exchange-correlation functional term + void stress_gga(matrix& sigma); //gga part in both PW and LCAO basis + +// 7) the stress from the non-local pseudopotentials + void stress_nl(matrix& sigma); //nonlocal part in PW basis + + + void get_dvnl1( + ComplexMatrix &vkb, + const int ik, + const int ipol); //used in nonlocal part in PW basis + void dylmr2 ( + const int nylm, + const int ngy, + Vector3 *gk, + matrix &dylm, + const int ipol); //used in get_dvnl1() + void get_dvnl2( + ComplexMatrix &vkb, + const int ik); //used in nonlocal part in PW basis + double Polynomial_Interpolation_nl( + const realArray &table, + const int &dim1, + const int &dim2, + const double &table_interval, + const double &x); //used in get_dvnl2() + + //functions for stress print + void print_stress(const string &name, const matrix& f, const bool screen, bool ry)const; + + void printstress_total (const matrix& scs, bool ry); + + static double stress_invalid_threshold_ev; + +}; + +#endif + + + + + + + + diff --git a/ABACUS.develop/source/src_pw/stress_func_cc.cpp b/ABACUS.develop/source/src_pw/stress_func_cc.cpp new file mode 100644 index 0000000000..410c0d4bc1 --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_func_cc.cpp @@ -0,0 +1,192 @@ +#include "./stress_func.h" +#include "./H_XC_pw.h" + +//NLCC term, need to be tested +void Stress_Func::stress_cc(matrix& sigma, const bool is_pw) +{ + timer::tick("Stress_Func","stress_cc",'F'); + + int nt,ng,l,m,ir; + double fact=1.0; + + if(is_pw&&INPUT.gamma_only) + { + fact = 2.0; //is_pw:PW basis, gamma_only need to double. + } + + complex sigmadiag; + double* rhocg; + double g[3]; + + int judge=0; + for(nt=0;nt * psic = new complex [pw.nrxx]; + + ZEROS(psic, pw.nrxx); + + if(NSPIN==1||NSPIN==4) + { + for(ir=0;ir(vxc(0, ir), 0.0); + } + } + else + { + for(ir=0;irderiv_drhoc ( + ppcell.numeric, + ucell.atoms[nt].msh, + ucell.atoms[nt].r, + ucell.atoms[nt].rab, + ucell.atoms[nt].rho_atc, + rhocg); + // non diagonal term (g=0 contribution missing) + for( ng = pw.gstart;ng< pw.ngmc;ng++) + { + g[0] = pw.gcar[ng].x; + g[1] = pw.gcar[ng].y; + g[2] = pw.gcar[ng].z; + for( l = 0;l< 3;l++) + { + for (m = 0;m< 3;m++) + { + const complex t = conj(psic[pw.ig2fftc[ng]] ) + * pw.strucFac (nt, ng) * rhocg [pw.ig2ngg[ng] ] * ucell.tpiba * + g [l] * g [m] / pw.gcar[ng].norm() * fact; +// sigmacc [l][ m] += t.real(); + sigma(l,m) += t.real(); + }//end m + }//end l + }//end ng + }//end if + }//end nt + + for( l = 0;l< 3;l++) + { + sigma(l,l) += sigmadiag.real(); +// sigmacc [l][ l] += sigmadiag.real(); + } + for( l = 0;l< 3;l++) + { + for (m = 0;m< 3;m++) + { + Parallel_Reduce::reduce_double_pool( sigma(l,m) ); + } + } + + delete[] rhocg; + delete[] psic; + + timer::tick("Stress_Func","stress_cc"); + return; +} + + +void Stress_Func::deriv_drhoc +( + const bool &numeric, + const int mesh, + const double *r, + const double *rab, + const double *rhoc, + double *drhocg +) +{ + + double gx = 0, rhocg1 = 0; + // the modulus of g for a given shell + // the fourier transform + double *aux = new double[ mesh]; + // auxiliary memory for integration + + int igl0; + // counter on radial mesh points + // counter on g shells + // lower limit for loop on ngl + + // + // G=0 term + // + if (pw.ggs[0] < 1.0e-8) + { + drhocg [0] = 0.0; + igl0 = 1; + } + else + { + igl0 = 0; + } + // + // G <> 0 term + // + + for(int igl = igl0;igl< pw.nggm;igl++) + { + gx = sqrt(pw.ggs [igl] * ucell.tpiba2); + for( int ir = 0;ir< mesh; ir++) + { + aux [ir] = r [ir] * rhoc [ir] * (r [ir] * cos (gx * r [ir] ) / gx - sin (gx * r [ir] ) / pow(gx,2)); + }//ir + Mathzone::Simpson_Integral(mesh, aux, rab, rhocg1); + drhocg [igl] = FOUR_PI / ucell.omega * rhocg1; + }//igl + + delete [] aux; + + return; +} diff --git a/ABACUS.develop/source/src_pw/stress_func_ewa.cpp b/ABACUS.develop/source/src_pw/stress_func_ewa.cpp new file mode 100644 index 0000000000..7c66d64fc2 --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_func_ewa.cpp @@ -0,0 +1,159 @@ +#include "./stress_func.h" +#include "./H_Ewald_pw.h" + +//calcualte the Ewald stress term in PW and LCAO +void Stress_Func::stress_ewa(matrix& sigma, const bool is_pw) +{ + timer::tick("Stress_Func","stress_ew",'F'); + + int i,j,l,m; + double g[3]; + + double charge=0; + for(int it=0; it < ucell.ntype; it++) + { + for(int i=0; i1e-7); + + //G-space sum here + //Determine if this processor contains G=0 and set the constant term + double sdewald; + if(pw.gstart == 1) + { + sdewald = (TWO_PI) * e2 / 4.0 / alpha * pow(charge/ucell.omega,2); + } + else + { + sdewald = 0.0; + } + + //sdewald is the diagonal term + + double fact=1.0; + if (INPUT.gamma_only && is_pw) fact=2.0; +// else fact=1.0; + + double g2,g2a; + double arg; + complex rhostar; + double sewald; + for(int ng=pw.gstart;ng(ucell.atoms[it].zv * cos(arg),ucell.atoms[it].zv * sin(arg)); + } + } + rhostar /= ucell.omega; + sewald = fact* (TWO_PI) * e2 * exp(-g2a) / g2 * pow(abs(rhostar),2); + sdewald = sdewald - sewald; + g[0]=pw.gcar[ng].x; + g[1]=pw.gcar[ng].y; + g[2]=pw.gcar[ng].z; + for(l=0;l<3;l++) + { + for(m=0;m *r; + double *r2; + r = new Vector3[mxr]; + r2 = new double[mxr]; + irr = new int[mxr]; + double rr; + Vector3 d_tau; + double r0[3]; + int rmax , nrm=0; + double fac; + if(pw.gstart==1) + { + rmax = 4.0/sqrt(alpha)/ucell.lat0; + //with this choice terms up to ZiZj*erfc(5) are counted (erfc(5)=2*10^-1) + for(int it=0; it < ucell.ntype; it++) + { + for(int i=0; iprint(ofs_running, "ewald stress", stression); + timer::tick("Force_Func","stress_ew"); + + return; +} diff --git a/ABACUS.develop/source/src_pw/stress_func_gga.cpp b/ABACUS.develop/source/src_pw/stress_func_gga.cpp new file mode 100644 index 0000000000..41718cb95b --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_func_gga.cpp @@ -0,0 +1,235 @@ +#include "./stress_func.h" +#include "./xc_functional.h" +#include "./myfunc.h" +#include "./xc_gga_pw.h" + +//calculate the GGA stress correction in PW and LCAO +void Stress_Func::stress_gga(matrix& sigma) +{ + timer::tick("Stress_Func","stress_gga",'F'); + + if (xcf.igcx == 0 && xcf.igcc == 0) + { + return; + } + double sigma_gradcorr[3][3]; + double* p= &sigma_gradcorr[0][0]; + for(int i=0;i<9;i++) + *p++ = 0; + + bool igcc_is_lyp = false; + if( xcf.igcc == 3 || xcf.igcc == 7) + { + igcc_is_lyp = true; + } + + assert(NSPIN>0); + const double fac = 1.0/ NSPIN; + + // doing FFT to get rho in G space: rhog1 + CHR.set_rhog(CHR.rho[0], CHR.rhog[0]); + if(NSPIN==2)//mohan fix bug 2012-05-28 + { + CHR.set_rhog(CHR.rho[1], CHR.rhog[1]); + } + CHR.set_rhog(CHR.rho_core, CHR.rhog_core); + + double* rhotmp1; + double* rhotmp2; + complex* rhogsum1; + complex* rhogsum2; + Vector3* gdr1; + Vector3* gdr2; + + rhotmp1 = new double[pw.nrxx]; + rhogsum1 = new complex[pw.ngmc]; + ZEROS(rhotmp1, pw.nrxx); + ZEROS(rhogsum1, pw.ngmc); + for(int ir=0; ir[pw.nrxx]; + ZEROS(gdr1, pw.nrxx); + + GGA_PW::grad_rho( rhogsum1 , gdr1 ); + + if(NSPIN==2) + { + rhotmp2 = new double[pw.nrxx]; + rhogsum2 = new complex[pw.ngmc]; + ZEROS(rhotmp2, pw.nrxx); + ZEROS(rhogsum2, pw.ngmc); + for(int ir=0; ir[pw.nrxx]; + ZEROS(gdr2, pw.nrxx); + + GGA_PW::grad_rho( rhogsum2 , gdr2 ); + } + + const double epsr = 1.0e-6; + const double epsg = 1.0e-10; + + double grho2a = 0.0; + double grho2b = 0.0; + double sx = 0.0; + double sc = 0.0; + double v1x = 0.0; + double v2x = 0.0; + double v1c = 0.0; + double v2c = 0.0; + double vtxcgc = 0.0; + double etxcgc = 0.0; + + if(NSPIN==1||NSPIN==4) + { + double segno; + for(int ir=0; ir epsr) + { + grho2a = gdr1[ir].norm2(); + if( grho2a > epsg ) + { + if( rhotmp1[ir] >= 0.0 ) segno = 1.0; + if( rhotmp1[ir] < 0.0 ) segno = -1.0; + + XC_Functional::gcxc( arho, grho2a, sx, sc, v1x, v2x, v1c, v2c); + double tt[3]; + tt[0] = gdr1[ir].x; + tt[1] = gdr1[ir].y; + tt[2] = gdr1[ir].z; + for(int l = 0;l< 3;l++) + { + for(int m = 0;m< l+1;m++) + { + sigma_gradcorr[l][m] += tt[l] * tt[m] * e2 * (v2x + v2c); + } + } + } + } + } + } + else if(NSPIN==2) + { + double v1cup = 0.0; + double v1cdw = 0.0; + double v2cup = 0.0; + double v2cdw = 0.0; + double v1xup = 0.0; + double v1xdw = 0.0; + double v2xup = 0.0; + double v2xdw = 0.0; + double v2cud = 0.0; + double v2c = 0.0; + for(int ir=0; ir epsr) + { + if(igcc_is_lyp) + { + WARNING_QUIT("stress","igcc_is_lyp is not available now."); + } + else + { + double zeta = ( rhotmp1[ir] - rhotmp2[ir] ) / rh; + double grh2 = (gdr1[ir]+gdr2[ir]).norm2(); + //XC_Functional::gcc_spin(rh, zeta, grh2, sc, v1cup, v1cdw, v2c); + gcc_spin(rh, zeta, grh2, sc, v1cup, v1cdw, v2c); + v2cup = v2c; + v2cdw = v2c; + v2cud = v2c; + } + } + else + { + sc = 0.0; + v1cup = 0.0; + v1cdw = 0.0; + v2c = 0.0; + v2cup = 0.0; + v2cdw = 0.0; + v2cud = 0.0; + } + double tt1[3],tt2[3]; + { + tt1[0] = gdr1[ir].x; + tt1[1] = gdr1[ir].y; + tt1[2] = gdr1[ir].z; + tt2[0] = gdr2[ir].x; + tt2[1] = gdr2[ir].y; + tt2[2] = gdr2[ir].z; + } + for(int l = 0;l< 3;l++) + { + for(int m = 0;m< l+1;m++) + { + // exchange + sigma_gradcorr [l][m] += tt1[l] * tt1[m] * e2 * v2xup + + tt2[l] * tt2[m] * e2 * v2xdw; + // correlation + sigma_gradcorr [l][m] += ( tt1[l] * tt1[m] * v2cup + + tt2[l] * tt2[m] * v2cdw + + (tt1[l] * tt2[m] + + tt2[l] * tt1[m] ) * v2cud ) * e2; + } + } + } + } + + for(int l = 0;l< 3;l++) + { + for(int m = 0;m< l;m++) + { + sigma_gradcorr[m][l] = sigma_gradcorr[l][m]; + } + } + for(int l = 0;l<3;l++) + { + for(int m = 0;m<3;m++) + { + Parallel_Reduce::reduce_double_pool( sigma_gradcorr[l][m] ); + } + } + +/* p= &sigma_gradcorr[0][0]; + double* p1 = &sigmaxc[0][0]; + for(int i=0;i<9;i++){ + *p /= pw.ncxyz ; + *p1++ += *p++; + }*/ + + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + { + sigma(i,j) += sigma_gradcorr[i][j] / pw.ncxyz; + } + } + + delete[] rhotmp1; + delete[] rhogsum1; + delete[] gdr1; + if(NSPIN==2) + { + delete[] rhotmp2; + delete[] rhogsum2; + delete[] gdr2; + } + timer::tick("Stress_Func","stress_gga"); + return; +} diff --git a/ABACUS.develop/source/src_pw/stress_func_har.cpp b/ABACUS.develop/source/src_pw/stress_func_har.cpp new file mode 100644 index 0000000000..433698b974 --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_func_har.cpp @@ -0,0 +1,143 @@ +#include "./stress_func.h" +#include "./myfunc.h" +#include "./H_Hartree_pw.h" + +//calculate the Hartree part in PW or LCAO base +void Stress_Func::stress_har(matrix& sigma, const bool is_pw) +{ + timer::tick("Stress_Func","stress_har",'F'); + double shart,g2; + const double eps=1e-8; + int l,m,nspin0; + + complex *Porter = UFFT.porter; + + // Hartree potential VH(r) from n(r) + ZEROS( Porter, pw.nrxx ); + for(int is=0; is( CHR.rho[is][ir], 0.0 ); + } + } + //============================= + // bring rho (aux) to G space + //============================= + pw.FFT_chg.FFT3D(Porter, -1); + + complex *psic = new complex [pw.nrxx]; + double *psic0 = new double[pw.nrxx]; + ZEROS( psic0, pw.nrxx); + for(int is=0; is(psic0[ir], 0.0); + } + } + + pw.FFT_chg.FFT3D(psic, -1) ; + + + double charge; + if (pw.gstart == 1) + { + charge = ucell.omega * Porter[pw.ig2fftc[0]].real(); + } + + complex *vh_g = new complex[pw.ngmc]; + ZEROS(vh_g, pw.ngmc); + + double g[3]; +//test + // int i=pw.gstart; + // cout<< "gstart " <1){ + // iunigh.clear(); + // iunigh.seekg(0,ios::beg); + // }//go back to the beginning of file + + for(ik=0;ik1){ + // iunigk>>igk; + // get_buffer(evc,nwordwfc,iunwfc,ik); + // } + for(i=0;i0){ + // gk2=pow(gk[i].x,2)+pow(gk[i].y,2)+pow(gk[i].z,2); + // arg=pow((gk2-ecfixed)/q2sigma,2); + // kfac[i]=1+qcutz/q2sigma*tbsp*exp(-arg); + // } + } + + //kinetic contribution + + for(l=0;l<3;l++) + { + for(m=0;m *Porter = UFFT.porter; + + ZEROS( Porter, pw.nrxx ); + for(int is=0; is(CHR.rho[is][ir], 0.0 ); + } + } + pw.FFT_chg.FFT3D(Porter, -1); + +// if(INPUT.gamma_only==1) fact=2.0; +// else fact=1.0; + + evloc=0.0; + double g[3]={0,0,0}; + + + complex *vg = new complex[pw.ngmc]; + ZEROS( vg, pw.ngmc ); + for (int it=0; itdvloc_coul (atom->zv, dvloc); + // + } + else + { + // + // normal case: dvloc contains dV_loc(G)/dG + // + this->dvloc_of_g ( atom->msh, atom->rab, atom->r, + atom->vloc_at, atom->zv, dvloc); + // + } + + for( ng = 0;ng< pw.ngmc;ng++) + { + const int j = pw.ig2fftc[ng]; + g[0]=pw.gcar[ng].x; + g[1]=pw.gcar[ng].y; + g[2]=pw.gcar[ng].z; + for (l = 0;l< 3;l++) + { + for (m = 0; m ) + ComplexMatrix dbecp( nkb, NBANDS); + ComplexMatrix becp( nkb, NBANDS); + + // vkb1: |Beta(nkb,npw)> + ComplexMatrix vkb1( nkb, wf.npwx ); + ComplexMatrix vkb0[3]; + for(int i=0;i<3;i++){ + vkb0[i].create(nkb, wf.npwx); + } + ComplexMatrix vkb2( nkb, wf.npwx ); + for (int ik = 0;ik < kv.nks;ik++) + { + for(int i=0;i<3;i++){ + vkb0[i].zero_out(); + } + vkb2.zero_out(); + + if (NSPIN==2) CURRENT_SPIN = kv.isk[ik]; + wf.npw = kv.ngk[ik]; + // generate vkb + if (ppcell.nkb > 0) + { + ppcell.getvnl(ik); + } + + // get becp according to wave functions and vkb + // important here ! becp must set zero!! + // vkb: Beta(nkb,npw) + // becp(nkb,nbnd): + becp.zero_out(); + for (int ib=0; ib qvec; + double qvec0[3]; + + for (int ipol = 0; ipol<3; ipol++) + { + for(int jpol = 0; jpol < ipol+1; jpol++) + { + dbecp.zero_out(); + vkb1.zero_out(); + for (int i = 0;i < nkb;i++) + { + for (int ig=0; ig 1e-8) qm1 = 1.0 / qvec.norm(); + else qm1 = 0; + dbecp(i,ib) += -2.0 * wf.evc[ik](ib,ig) * conj(vkb2(i,ig)) * qvec0[ipol] * qvec0[jpol] * qm1 * ucell.tpiba; + }//end ig + }//end i + }//end ib + +// don't need to reduce here, keep dbecp different in each processor, +// and at last sum up all the forces. +// Parallel_Reduce::reduce_complex_double_pool( dbecp.ptr, dbecp.ndata); + +// double *cf = new double[ucell.nat*3]; +// ZEROS(cf, ucell.nat); + for (int ib=0; ib *gk = new Vector3[npw]; + for (ig = 0;ig < npw;ig++) + { + gk[ig] = wf.get_1qvec_cartesian(ik, ig); + } + + dylmr2(x1, npw, gk, dylm, ipol); + + int jkb = 0; + for(int it = 0;it < ucell.ntype;it++) + { + if(test_pp>1) OUT("it",it); + // calculate beta in G-space using an interpolation table + const int nbeta = ucell.atoms[it].nbeta; + const int nh = ucell.atoms[it].nh; + + if(test_pp>1) OUT("nbeta",nbeta); + + for (nb = 0;nb < nbeta;nb++) + { + if(test_pp>1) OUT("ib",nb); + for (ig = 0;ig < npw;ig++) + { + const double gnorm = gk[ig].norm() * ucell.tpiba; + + //cout << "\n gk[ig] = " << gk[ig].x << " " << gk[ig].y << " " << gk[ig].z; + //cout << "\n gk.norm = " << gnorm; + + vq [ig] = Mathzone::Polynomial_Interpolation( + ppcell.tab, it, nb, NQX, DQ, gnorm ); + + } // enddo + + // add spherical harmonic part + for (ih = 0;ih < nh;ih++) + { + if (nb == ppcell.indv(it, ih)) + { + const int lm = static_cast( ppcell.nhtolm(it, ih) ); + for (ig = 0;ig < npw;ig++) + { + vkb1(ih, ig) = dylm(lm, ig) * vq [ig]; + } + + } + + } // end ih + + } // end nbeta + + // vkb1 contains all betas including angular part for type nt + // now add the structure factor and factor (-i)^l + for (ia=0; ia *sk = wf.get_sk(ik, it, ia); + for (ih = 0;ih < nh;ih++) + { + complex pref = pow( NEG_IMAG_UNIT, ppcell.nhtol(it, ih)); //? + for (ig = 0;ig < npw;ig++) + { + vkb(jkb, ig) = vkb1(ih, ig) * sk [ig] * pref; + } + ++jkb; + } // end ih + delete [] sk; + } // end ia + } // enddo + delete [] gk; + delete [] vq; + return; +}//end get_dvnl1 + +void Stress_Func::get_dvnl2(ComplexMatrix &vkb, + const int ik) +{ + if(test_pp) TITLE("Stress","get_dvnl2"); +// timer::tick("Stress","get_dvnl2"); + + const int lmaxkb = ppcell.lmaxkb; + if(lmaxkb < 0) + { + return; + } + + const int npw = kv.ngk[ik]; + const int nhm = ppcell.nhm; + int ig, ia, nb, ih; + matrix vkb1(nhm, npw); + double *vq = new double[npw]; + const int x1= (lmaxkb + 1)*(lmaxkb + 1); + + matrix ylm(x1, npw); + Vector3 *gk = new Vector3[npw]; + for (ig = 0;ig < npw;ig++) + { + gk[ig] = wf.get_1qvec_cartesian(ik, ig); + } + Mathzone::Ylm_Real(x1, npw, gk, ylm); + + int jkb = 0; + for(int it = 0;it < ucell.ntype;it++) + { + if(test_pp>1) OUT("it",it); + // calculate beta in G-space using an interpolation table + const int nbeta = ucell.atoms[it].nbeta; + const int nh = ucell.atoms[it].nh; + + if(test_pp>1) OUT("nbeta",nbeta); + + for (nb = 0;nb < nbeta;nb++) + { + if(test_pp>1) OUT("ib",nb); + for (ig = 0;ig < npw;ig++) + { + const double gnorm = gk[ig].norm() * ucell.tpiba; + //cout << "\n gk[ig] = " << gk[ig].x << " " << gk[ig].y << " " << gk[ig].z; + //cout << "\n gk.norm = " << gnorm; + vq [ig] = Polynomial_Interpolation_nl( + ppcell.tab, it, nb, DQ, gnorm ); + + } // enddo + + // add spherical harmonic part + for (ih = 0;ih < nh;ih++) + { + if (nb == ppcell.indv(it, ih)) + { + const int lm = static_cast( ppcell.nhtolm(it, ih) ); + for (ig = 0;ig < npw;ig++) + { + vkb1(ih, ig) = ylm(lm, ig) * vq [ig]; + } + } + } // end ih + } // end nbeta + + // vkb1 contains all betas including angular part for type nt + // now add the structure factor and factor (-i)^l + for (ia=0; ia *sk = wf.get_sk(ik, it, ia); + for (ih = 0;ih < nh;ih++) + { + complex pref = pow( NEG_IMAG_UNIT, ppcell.nhtol(it, ih)); //? + for (ig = 0;ig < npw;ig++) + { + vkb(jkb, ig) = vkb1(ih, ig) * sk [ig] * pref; + } + ++jkb; + } // end ih + delete [] sk; + } // end ia + } // enddo + + delete [] gk; + delete [] vq; +// timer::tick("Stress","get_dvnl2"); + + return; +} + + + + +double Stress_Func::Polynomial_Interpolation_nl +( + const realArray &table, + const int &dim1, + const int &dim2, + const double &table_interval, + const double &x // input value +) +{ +// timer::tick("Mathzone","Poly_Interpo_2"); + assert(table_interval>0.0); + const double position = x / table_interval; + const int iq = static_cast(position); + + const double x0 = position - static_cast(iq); + const double x1 = 1.0 - x0; + const double x2 = 2.0 - x0; + const double x3 = 3.0 - x0; + const double y= + ( table(dim1, dim2, iq) * (-x2*x3-x1*x3-x1*x2) / 6.0 + + table(dim1, dim2, iq+1) * (+x2*x3-x0*x3-x0*x2) / 2.0 - + table(dim1, dim2, iq+2) * (+x1*x3-x0*x3-x0*x1) / 2.0 + + table(dim1, dim2, iq+3) * (+x1*x2-x0*x2-x0*x1) / 6.0 )/table_interval ; + +// timer::tick("Mathzone","Poly_Interpo_2"); + return y; +} + +void Stress_Func::dylmr2 ( + const int nylm, + const int ngy, + Vector3 *gk, + matrix &dylm, + const int ipol) +{ + //----------------------------------------------------------------------- + // + // compute \partial Y_lm(G) \over \partial (G)_ipol + // using simple numerical derivation (SdG) + // The spherical harmonics are calculated in ylmr2 + // + //int nylm, ngy, ipol; + // number of spherical harmonics + // the number of g vectors to compute + // desired polarization + //double g (3, ngy), gg (ngy), dylm (ngy, nylm) + // the coordinates of g vectors + // the moduli of g vectors + // the spherical harmonics derivatives + // + int ig, lm; + // counter on g vectors + // counter on l,m component + + const double delta = 1e-6; + double *dg, *dgi; + + matrix ylmaux; + // dg is the finite increment for numerical derivation: + // dg = delta |G| = delta * sqrt(gg) + // dgi= 1 /(delta * sqrt(gg)) + // gx = g +/- dg + + + Vector3 *gx = new Vector3 [ngy]; + + + dg = new double [ngy]; + dgi = new double [ngy]; + + ylmaux.create (nylm, ngy); + + dylm.zero_out(); + ylmaux.zero_out(); + + for( ig = 0;ig< ngy;ig++){ + gx[ig] = gk[ig]; + } + //$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + for( ig = 0;ig< ngy;ig++){ + dg [ig] = delta * gx[ig].norm() ; + if (gx[ig].norm2() > 1e-9) { + dgi [ig] = 1.0 / dg [ig]; + } + else{ + dgi [ig] = 0.0; + } + } + //$OMP END PARALLEL DO + + //$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + for( ig = 0;ig< ngy;ig++){ + if(ipol==0) + gx [ig].x = gk[ ig].x + dg [ig]; + else if(ipol==1) + gx [ig].y = gk [ ig].y + dg [ig]; + else if(ipol==2) + gx [ig].z = gk [ ig].z + dg [ig]; + } + //$OMP END PARALLEL DO + + Mathzone::Ylm_Real(nylm, ngy, gx, dylm); + //$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + for(ig = 0;ig< ngy;ig++){ + if(ipol==0) + gx [ig].x = gk [ ig].x - dg [ig]; + else if(ipol==1) + gx [ig].y = gk [ ig].y - dg [ig]; + else if(ipol==2) + gx [ig].z = gk [ ig].z - dg [ig]; + } + //$OMP END PARALLEL DO + + Mathzone::Ylm_Real(nylm, ngy, gx, ylmaux); + + + // zaxpy ( - 1.0, ylmaux, 1, dylm, 1); + for( lm = 0;lm< nylm;lm++){ + for(ig = 0;ig< ngy;ig++){ + dylm (lm,ig) = dylm(lm,ig) - ylmaux(lm,ig); + } + } + + + for( lm = 0;lm< nylm;lm++){ + //$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(ig) + for(ig = 0;ig< ngy;ig++){ + dylm (lm,ig) = dylm(lm,ig) * 0.5 * dgi [ig]; + } + //$OMP END PARALLEL DO + } + delete[] gx; + delete[] dg; + delete[] dgi; + + return; +} diff --git a/ABACUS.develop/source/src_pw/stress_func_print.cpp b/ABACUS.develop/source/src_pw/stress_func_print.cpp new file mode 100644 index 0000000000..d1162846a5 --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_func_print.cpp @@ -0,0 +1,104 @@ +#include"stress_func.h" + +static double output_acc = 1.0e-8; + +//print target stress term +void Stress_Func::print_stress(const string &name, const matrix& f, const bool screen, bool ry)const +{ + ofs_running << " --------------------------- " << name << " ----------------------------" << endl; + + + double fac = 1.0; + + if(!ry) + { + // fac = Ry_to_eV / 0.529177; + } + + cout << setprecision(5); + cout << setiosflags(ios::showpos); + + if(screen) + { + cout << " ------------------- " << name << " --------------------" << endl; + + } + + for (int i=0;i<3;i++) + { + ofs_running << setw(15)<< " "; + if( abs(f(i,0)) >output_acc) ofs_running << setw(15) << f(i,0) * fac; + else ofs_running << setw(15) << "0"; + if( abs(f(i,1)) >output_acc) ofs_running << setw(15) << f(i,1) * fac; + else ofs_running << setw(15) << "0"; + if( abs(f(i,2)) >output_acc) ofs_running << setw(15) << f(i,2) * fac; + else ofs_running << setw(15) << "0"; + ofs_running << endl; + + if(screen) + { + if( abs(f(i,0)) >output_acc) cout << setw(15) << f(i,0)*fac; + else cout << setw(15) << "0"; + if( abs(f(i,1)) >output_acc) cout << setw(15) << f(i,1)*fac; + else cout << setw(15) << "0"; + if( abs(f(i,2)) >output_acc) cout << setw(15) << f(i,2)*fac; + else cout << setw(15) << "0"; + cout << endl; + } + } + + + cout << resetiosflags(ios::showpos); + + return; +} + +//print total stress +void Stress_Func::printstress_total(const matrix& scs, bool ry) +{ +// zhengdy update 2016-10-08 + double unit_transform = 1; + + if(!ry) + { + unit_transform = RYDBERG_SI / pow(BOHR_RADIUS_SI,3) * 1.0e-8; + } +// cout.setf(ios::fixed); + + + //ofs_running << setiosflags(ios::right); + ofs_running << setprecision(6) << setiosflags(ios::showpos) << setiosflags(ios::fixed) << endl; + NEW_PART("TOTAL-STRESS (KBAR)");//Ryd/(a.u.)^3 + cout << " ><><><><><><><><><><><><><><><><><><><><><><" << endl; + cout << " TOTAL-STRESS (KBAR):" << endl; + cout << " ><><><><><><><><><><><><><><><><><><><><><><" << endl; + +// if(INPUT.stress_set == 1) +// int TEST_STRESS = 1; + + if(TEST_STRESS) + { + cout << setiosflags(ios::fixed) << setprecision(6); + cout << setiosflags(ios::showpos); + cout << " ------------------- TOTAL STRESS --------------------" << endl; + cout << " " << setw(8) << "STRESS" << endl; + ofs_running << " " << setw(12) << "STRESS" << endl; + } + + + for (int i=0; i<3; i++) + { + + //if(TEST_STRESS) + cout << " " << setw(15) << scs(i,0)*unit_transform << setw(15) + << scs(i,1)*unit_transform << setw(15) << scs(i,2)*unit_transform << endl; + + ofs_running << " " << setw(15) << scs(i,0)*unit_transform << setw(15) + << scs(i,1)*unit_transform << setw(15) << scs(i,2)*unit_transform << endl; + + } + ofs_running << setiosflags(ios::left); + cout << resetiosflags(ios::showpos); + + return; +} diff --git a/ABACUS.develop/source/src_pw/stress_pw.cpp b/ABACUS.develop/source/src_pw/stress_pw.cpp new file mode 100644 index 0000000000..b66d0eae23 --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_pw.cpp @@ -0,0 +1,127 @@ +#include "./stress_pw.h" +#include "./H_XC_pw.h" +#include "src_pw/vdwd2.h" + +void Stress_PW::cal_stress(matrix& sigma) +{ + TITLE("Stress_PW","cal_stress"); + timer::tick("Stress_PW","cal_stress",'E'); + + sigma.create(3,3); + matrix sigmaxc; + sigmaxc.create(3,3); + matrix sigmatot; + sigmatot.create(3,3); + matrix sigmahar; + sigmahar.create(3,3); + matrix sigmakin; + sigmakin.create(3,3); + matrix sigmaloc; + sigmaloc.create(3,3); + matrix sigmanl; + sigmanl.create(3,3); + matrix sigmaewa; + sigmaewa.create(3,3); + matrix sigmaxcc; + sigmaxcc.create(3,3); + matrix sigmavdw; + sigmavdw.create(3,3); + for(int i=0;i<3;i++) + { + for(int j=0;j<3;j++) + { + sigmatot(i,j) = 0.0; + sigmaxc(i,j) = 0.0; + sigmahar(i,j) = 0.0; + sigmakin(i,j) = 0.0; + sigmaloc(i,j) = 0.0; + sigmanl(i,j) = 0.0; + sigmaewa(i,j) = 0.0; + sigmaxcc(i,j) = 0.0; + sigmavdw(i,j) = 0.0; + } + } + //kinetic contribution + stress_kin(sigmakin); + + //hartree contribution + stress_har(sigmahar, 1); + + //ewald contribution + stress_ewa(sigmaewa, 1); + + //xc contribution: add gradient corrections(non diagonal) + for(int i=0;i<3;i++) + { + sigmaxc(i,i) = - (H_XC_pw::etxc - H_XC_pw::vtxc) / ucell.omega; + } + stress_gga(sigmaxc); + + //local contribution + stress_loc(sigmaloc, 1); + + //nlcc + stress_cc(sigmaxcc, 1); + + //nonlocal + stress_nl(sigmanl); + + //vdw term + stress_vdw(sigmavdw); + + for(int ipol=0;ipol<3;ipol++) + { + for(int jpol=0;jpol<3;jpol++) + { + sigmatot(ipol,jpol) = sigmakin(ipol,jpol) + + sigmahar(ipol,jpol) + + sigmanl(ipol,jpol) + + sigmaxc(ipol,jpol) + + sigmaxcc(ipol,jpol) + + sigmaewa(ipol,jpol) + + sigmaloc(ipol,jpol); + + sigmavdw(ipol,jpol); + } + } + + if(Symmetry::symm_flag) + { + symm.stress_symmetry(sigmatot); + } + + bool ry = false; + this->printstress_total(sigmatot, ry); + + if(TEST_STRESS) + { + ofs_running << "\n PARTS OF STRESS: " << endl; + ofs_running << setiosflags(ios::showpos); + ofs_running << setiosflags(ios::fixed) << setprecision(10) << endl; + this->print_stress("KINETIC STRESS",sigmakin,TEST_STRESS,ry); + this->print_stress("LOCAL STRESS",sigmaloc,TEST_STRESS,ry); + this->print_stress("HARTREE STRESS",sigmahar,TEST_STRESS,ry); + this->print_stress("NON-LOCAL STRESS",sigmanl,TEST_STRESS,ry); + this->print_stress("XC STRESS",sigmaxc,TEST_STRESS,ry); + this->print_stress("EWALD STRESS",sigmaewa,TEST_STRESS,ry); + this->print_stress("NLCC STRESS",sigmaxcc,TEST_STRESS,ry); + this->print_stress("TOTAL STRESS",sigmatot,TEST_STRESS,ry); + } + return; + +} + +void Stress_PW::stress_vdw(matrix& sigma) +{ + matrix force; + if(vdwd2_para.flag_vdwd2) //Peize Lin add 2014-04-04, update 2021-03-09 + { + Vdwd2 vdwd2(ucell,vdwd2_para); + vdwd2.cal_stress(); + sigma = vdwd2.get_stress().to_matrix(); + } + if(vdwd3.vdwD3) //jiyy add 2019-05-18 + { + vdwd3.force(0, 1, force, sigma); + } + return; +} diff --git a/ABACUS.develop/source/src_pw/stress_pw.h b/ABACUS.develop/source/src_pw/stress_pw.h new file mode 100644 index 0000000000..48e5ce1234 --- /dev/null +++ b/ABACUS.develop/source/src_pw/stress_pw.h @@ -0,0 +1,23 @@ +#ifndef STRESS_PW_H +#define STRESS_PW_H + +#include "stress_func.h" + +class Stress_PW:public Stress_Func +{ + public : + + Stress_PW (){}; + ~Stress_PW (){}; + + //calculate the stress in PW basis + void cal_stress(matrix& sigma); + + private : + //call the vdw stress + void stress_vdw(matrix& sigma); //force and stress calculated in vdw together. + + + +}; +#endif diff --git a/ABACUS.develop/source/src_pw/symm_book.cpp b/ABACUS.develop/source/src_pw/symm_book.cpp deleted file mode 100644 index 48e98bc850..0000000000 --- a/ABACUS.develop/source/src_pw/symm_book.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include "tools.h" -#include "symm_book.h" - -Symm_Book::Symm_Book() -{ - -} - - -Symm_Book::~Symm_Book() -{ - -} - - -void Symm_Book::Bravais() -{ - TITLE("Symm_Book","Bravais"); - - write("There are only 7 crystal systems"); - write("Any other point groups are the subgroup of the 7"); - write("The 7 are: S2, C2h, D2h, D4h, D3d, D6h, Oh"); - - write("There are 32 point groups:"); - ofs_running << setw(5) << " S2" << setw(2) << ":" << - setw(5) << "S2" << - setw(5) << "C1" << endl; - - ofs_running << setw(5) << " C2h" << setw(2) << ":" << - setw(5) << "C2h" << - setw(5) << "C2" << - setw(5) << "C1h" << endl; - - ofs_running << setw(5) << " D2h" << setw(2) << ":" << - setw(5) << "D2h" << - setw(5) << "D2" << - setw(5) << "C2v" << endl; - - ofs_running << setw(5) << " D4h" << setw(2) << ":" << - setw(5) << "D4h" << - setw(5) << "C4" << - setw(5) << "S4" << - setw(5) << "D4" << - setw(5) << "C4v" << - setw(5) << "C4h" << - setw(5) << "D2d" << endl; - - ofs_running << setw(5) << " D3d" << setw(2) << ":" << - setw(5) << "D3d" << - setw(5) << "S6" << - setw(5) << "C3" << - setw(5) << "C3v" << - setw(5) << "D3" << endl; - - ofs_running << setw(5) << " D6h" << setw(2) << ":" << - setw(5) << "D6h" << - setw(5) << "C6" << - setw(5) << "C3h" << - setw(5) << "C6h" << - setw(5) << "C6v" << - setw(5) << "D6" << - setw(5) << "D3h" << endl; - - ofs_running << setw(5) << " Oh" << setw(2) << ":" << - setw(5) << "Oh" << - setw(5) << "T" << - setw(5) << "O" << - setw(5) << "Th" << - setw(5) << "Td" << endl; - - write("There are two types of point groups"); - write("1: C1.C2.C3.C4.C6.D2.D3.D4.D6.T.O"); - write("2: S2.S4.S6.C1h.C2h.C3h.C4h.C6h.C2v.C3v.C4v.C6v.D2h.D3h.D4h.D6h.D2d.D3d.Th.Oh.Td"); - - write("The 14 Bravais Lattices are"); - write("01. Cubic P (a=b=c) (sc)"); - write("02. Cubic I (a=b=c) (bcc)"); - write("03. Cubic F (a=b=c) (fcc)"); - write("04. Trigonal and hexagonal P"); - write("05. Tetragonal P"); - write("06. Tetragonal I"); - write("07. Trigonal R"); - write("08. Orthorhombic P (a!=b!=c)"); - write("09. Orthorhombic I"); - write("10. Orthorhombic F"); - write("11. Orthorhombic C"); - write("12. Monoclinic P"); - write("13. Monoclinic A"); - write("14. Triclinic P"); - - write("The rank of the point groups"); - write("48: Oh"); - write("24: D6h. Th. O. Td"); - write("16: D4h"); - write("12: D3h. C6h. D3d. C6v. D6. T"); - write("08: D2h. C4h. D2d. C4v. D4"); - write("06: C6. C3h. S6. C3v. D3"); - write("04: C4. C2h. S4. C2v. D2"); - write("03: C3"); - write("02: C2, C1h, S2"); - write("01: C1"); - -} - -void Symm_Book::write(const string &name) -{ - ofs_running << " " << name << "." << endl; -} diff --git a/ABACUS.develop/source/src_pw/symm_book.h b/ABACUS.develop/source/src_pw/symm_book.h deleted file mode 100644 index 1f9a4466d8..0000000000 --- a/ABACUS.develop/source/src_pw/symm_book.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SYMM_BOOK_H -#define SYMM_BOOK_H - -#include -using namespace std; - -class Symm_Book -{ - public: - Symm_Book(); - ~Symm_Book(); - - void Bravais(); - - private: - - void write(const string &name); - -}; - - - -#endif diff --git a/ABACUS.develop/source/src_pw/symmetry.cpp b/ABACUS.develop/source/src_pw/symmetry.cpp index c72badf30e..7a171f8687 100644 --- a/ABACUS.develop/source/src_pw/symmetry.cpp +++ b/ABACUS.develop/source/src_pw/symmetry.cpp @@ -19,7 +19,10 @@ Symmetry::~Symmetry() } -#include "symm_book.h" + +bool Symmetry::symm_flag=false; + + void Symmetry::analy_sys(void) { if (available == false) return; @@ -40,10 +43,6 @@ void Symmetry::analy_sys(void) ofs_running << "\n\n\n\n"; - Symm_Book SB; -// SB.Bravais(); - - this->ibrav = 0; // number of total atoms this->nat = ucell.nat; @@ -1594,7 +1593,7 @@ void Symmetry::force_symmetry(matrix &force , double* pos) // pengfei 2016-12- return; } -void Symmetry::stress_symmetry(double sigma[][3]) //zhengdy added 2017 +void Symmetry::stress_symmetry(matrix& sigma) //zhengdy added 2017 { double *tot_sigma, *temp; tot_sigma = new double[9]; @@ -1620,7 +1619,7 @@ void Symmetry::stress_symmetry(double sigma[][3]) //zhengdy added 2017 { for(int l=0;l<3;l++) { - tot_sigma[i*3 +j] += sigma[k][l] * temp[i*3+k] * temp[j*3+l]; + tot_sigma[i*3 +j] += sigma(k,l) * temp[i*3+k] * temp[j*3+l]; } } } @@ -1629,7 +1628,7 @@ void Symmetry::stress_symmetry(double sigma[][3]) //zhengdy added 2017 { for(int j = 0;j<3;j++) { - sigma[i][j] = tot_sigma[i*3+j]; + sigma(i,j) = tot_sigma[i*3+j]; } } ZEROS(temp, 9); @@ -1655,7 +1654,7 @@ void Symmetry::stress_symmetry(double sigma[][3]) //zhengdy added 2017 { for( int m=0; m<3; m++) { - tot_sigma[i * 3 +j] += sigma[l][m] * temp[i * 3 + l] * temp[j * 3 + m]; + tot_sigma[i * 3 +j] += sigma(l,m) * temp[i * 3 + l] * temp[j * 3 + m]; } } } @@ -1666,7 +1665,7 @@ void Symmetry::stress_symmetry(double sigma[][3]) //zhengdy added 2017 { for (int j = 0; j < 3; j++) { - sigma[i][j] = tot_sigma[i *3 + j] / nrotk; + sigma(i,j) = tot_sigma[i *3 + j] / nrotk; } } @@ -1697,7 +1696,7 @@ void Symmetry::stress_symmetry(double sigma[][3]) //zhengdy added 2017 { for(int l=0;l<3;l++) { - tot_sigma[i*3 +j] += sigma[k][l] * temp[i*3+k] * temp[j*3+l]; + tot_sigma[i*3 +j] += sigma(k,l) * temp[i*3+k] * temp[j*3+l]; } } } @@ -1707,7 +1706,7 @@ void Symmetry::stress_symmetry(double sigma[][3]) //zhengdy added 2017 { for(int j = 0;j<3;j++) { - sigma[i][j] = tot_sigma[i*3+j]; + sigma(i,j) = tot_sigma[i*3+j]; } } diff --git a/ABACUS.develop/source/src_pw/symmetry.h b/ABACUS.develop/source/src_pw/symmetry.h index fd9619cc56..8a1f3ce4ed 100644 --- a/ABACUS.develop/source/src_pw/symmetry.h +++ b/ABACUS.develop/source/src_pw/symmetry.h @@ -15,6 +15,9 @@ class Symmetry : public Symmetry_Basic Symmetry(); ~Symmetry(); + // mohan add 2021-02-21 + static bool symm_flag; + void analy_sys(); bool available; @@ -88,7 +91,7 @@ class Symmetry : public Symmetry_Basic void checksym(Matrix3 &s, Vector3 >rans, double *pos); void rho_symmetry(double *rho, const int &nr1, const int &nr2, const int &nr3); void force_symmetry(matrix &force, double* pos); - void stress_symmetry(double sigma[][3]); + void stress_symmetry(matrix &sigma); void write(); void print_pos(const double* pos, const int &nat); diff --git a/ABACUS.develop/source/src_pw/symmetry_basic.cpp b/ABACUS.develop/source/src_pw/symmetry_basic.cpp index d9664c7e48..fc21510409 100644 --- a/ABACUS.develop/source/src_pw/symmetry_basic.cpp +++ b/ABACUS.develop/source/src_pw/symmetry_basic.cpp @@ -4,7 +4,7 @@ //========================================================== #include "symmetry.h" #include "global.h" -#include "mymath.h" +#include "src_global/mymath.h" #include "symm_other.h" Symmetry_Basic::Symmetry_Basic() diff --git a/ABACUS.develop/source/src_pw/symmetry_rho.cpp b/ABACUS.develop/source/src_pw/symmetry_rho.cpp index fab75bb76c..f91202ce61 100644 --- a/ABACUS.develop/source/src_pw/symmetry_rho.cpp +++ b/ABACUS.develop/source/src_pw/symmetry_rho.cpp @@ -15,15 +15,13 @@ void Symmetry_rho::begin(const int &spin_now) const { assert(spin_now < 4);//added by zhengdy-soc - if(!SYMMETRY) return; + if(!Symmetry::symm_flag) return; #ifdef __MPI // parallel version - psymm(chr.rho[spin_now]); + psymm(CHR.rho[spin_now]); #else -#ifndef __EPM // series version. - symm.rho_symmetry(chr.rho[spin_now], pw.ncx, pw.ncy, pw.ncz); -#endif + symm.rho_symmetry(CHR.rho[spin_now], pw.ncx, pw.ncy, pw.ncz); #endif return; } diff --git a/ABACUS.develop/source/src_pw/threshold_elec.cpp b/ABACUS.develop/source/src_pw/threshold_elec.cpp index 1051310e1b..88c3e836a0 100644 --- a/ABACUS.develop/source/src_pw/threshold_elec.cpp +++ b/ABACUS.develop/source/src_pw/threshold_elec.cpp @@ -1,17 +1,6 @@ -// ============================================================================= -// C++ Header File -// Project: Wannier Basis O(N) Scaling Package -// File: electronsns.cpp -// Principal Class: electronsns -// Author: Lixin He,Mohan Chen -// Comment: -// Warning: -// Start time: 2006 -// modified: mohan 2008-08-10 change electronsns to be base class of ions -// ============================================================================= - #include "global.h" #include "threshold_elec.h" + Threshold_Elec::Threshold_Elec() { dr2 = 0.0; @@ -20,15 +9,16 @@ Threshold_Elec::Threshold_Elec() void Threshold_Elec::set_ethr(void) const { + TITLE("Threshold_Elec","set_ethr"); //======================================================================== // setup ethr see setup.f90 Page 5/14 // setup ethr, the convergence threshold for eigenvalues // tr2: the convergence threshold for self-consistency (rho or potential); //======================================================================== - //================== - // nscf calculation - //================== + //=================== + // nscf calculations + //=================== if (CALCULATION=="nscf") { if (ETHR == 0.0) @@ -36,10 +26,10 @@ void Threshold_Elec::set_ethr(void) const ETHR = 0.1 * std::min(1.0e-2, DRHO2 / ucell.nelec); } } - //================ + //================= // self consistent - //================ - else if(CALCULATION=="scf" || CALCULATION=="md" || CALCULATION=="relax") + //================= + else if(CALCULATION=="scf" || CALCULATION=="md" || CALCULATION=="relax" || CALCULATION=="scf-sto")//qianrui 2021-2-20 { if (ETHR == 0.0) { @@ -84,8 +74,7 @@ void Threshold_Elec::update_ethr(const int &iter) // mohan update 2012-03-26 // mohan update 2012-02-08 //---------------------------- - //if(LINEAR_SCALING==1 && LOCAL_BASIS==4) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao") //xiaohui add 2013-09-02 + if(BASIS_TYPE=="lcao") { ETHR = std::min( ETHR, 0.01*dr2/ std::max(1.0, ucell.nelec)); } @@ -102,25 +91,14 @@ void Threshold_Elec::update_ethr(const int &iter) void Threshold_Elec::iter_end(ofstream &ofs) { - //figure::picture(d_rho,pw.ncx,pw.ncy,pw.ncz); - //xiaohui add 'OUT_LEVEL' line, 2015-09-16 - if(OUT_LEVEL != "m") print_eigenvalue(ofs); - -// if (pot.tefield) -// { -// ofs << "\n electric field correction = "<< pot.etotefield << " ryd"; -// } -// if(lda_plus_u) -// { -// ofs << "\n Hubbard energy = "<< eth << " ryd"; -// } -// if ( Occupy::gauss() ) -// { -// ofs << " Correction of metals = "<< en.demet << " Rydberg" << endl; -// } + if(OUT_LEVEL != "m") + { + print_eigenvalue(ofs); + } return; } + void Threshold_Elec::print_eigenvalue(ofstream &ofs) { bool wrong = false; @@ -141,7 +119,11 @@ void Threshold_Elec::print_eigenvalue(ofstream &ofs) } - if(MY_RANK!=0) return; + if(MY_RANK!=0) + { + return; + } + TITLE("Threshold_Elec","print_eigenvalue"); ofs << "\n STATE ENERGY(eV) AND OCCUPATIONS."; @@ -173,21 +155,21 @@ void Threshold_Elec::print_eigenvalue(ofstream &ofs) ofs << setprecision(6); - } - } // Pengfei Li added 14-9-9 - else - { - ofs << " " << ik+1 << "/" << kv.nks << " kpoint (Cartesian) = " - << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y << " " << kv.kvec_c[ik].z - << " (" << kv.ngk[ik] << " pws)" << endl; + } + } // Pengfei Li added 14-9-9 + else + { + ofs << " " << ik+1 << "/" << kv.nks << " kpoint (Cartesian) = " + << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y << " " << kv.kvec_c[ik].z + << " (" << kv.ngk[ik] << " pws)" << endl; + + ofs << setprecision(6); + } - ofs << setprecision(6); - } //---------------------- // no energy to output //---------------------- - //if(DIAGO_TYPE=="selinv") xiaohui modify 2013-09-02 - if(KS_SOLVER=="selinv") //xiaohui add 2013-09-02 + if(KS_SOLVER=="selinv") { ofs << " USING SELINV, NO BAND ENERGY IS AVAILABLE." << endl; } @@ -209,4 +191,3 @@ void Threshold_Elec::print_eigenvalue(ofstream &ofs) }//end ik return; } - diff --git a/ABACUS.develop/source/src_pw/threshold_elec.h b/ABACUS.develop/source/src_pw/threshold_elec.h index d3e0156c3f..027e6ec86b 100644 --- a/ABACUS.develop/source/src_pw/threshold_elec.h +++ b/ABACUS.develop/source/src_pw/threshold_elec.h @@ -5,19 +5,26 @@ class Threshold_Elec { -public: + + public: // constructor and deconstructor Threshold_Elec(); ~Threshold_Elec() {}; -protected: + protected: double dr2; + bool conv_elec; + void set_ethr() const; + void update_ethr(const int &iter); + void iter_end(ofstream &ofs); + + // this should be moved to other places, mohan note 2021-03-03 void print_eigenvalue(ofstream &ofs); }; diff --git a/ABACUS.develop/source/src_pw/tools.h b/ABACUS.develop/source/src_pw/tools.h index 630431c96f..8a25c54f08 100644 --- a/ABACUS.develop/source/src_pw/tools.h +++ b/ABACUS.develop/source/src_pw/tools.h @@ -25,7 +25,6 @@ using namespace std; #include "../src_global/intarray.h" #include "../src_global/complexarray.h" #include "../src_global/complexmatrix.h" -#include "../src_global/sparsematrix.h" #include "../src_global/memory.h" #include "../src_global/timer.h" diff --git a/ABACUS.develop/source/src_pw/unitcell.cpp b/ABACUS.develop/source/src_pw/unitcell.cpp index 76f6473422..a31cadaa72 100644 --- a/ABACUS.develop/source/src_pw/unitcell.cpp +++ b/ABACUS.develop/source/src_pw/unitcell.cpp @@ -28,6 +28,7 @@ UnitCell::UnitCell() iat2it = nullptr; iat2ia = nullptr; iwt2iat = nullptr; + iwt2iw = nullptr; itia2iat.create(1,1); lc = new int[3]; @@ -47,14 +48,13 @@ UnitCell::UnitCell() UnitCell::~UnitCell() { -#ifndef __EPM delete[] atom_label; delete[] atom_mass; delete[] pseudo_fn; -#endif delete[] iat2it; delete[] iat2ia; delete[] iwt2iat; + delete[] iwt2iw; delete[] lc; } @@ -113,9 +113,8 @@ void UnitCell::bcast_unitcell(void) Parallel_Common::bcast_double( latvec_supercell.e32 ); Parallel_Common::bcast_double( latvec_supercell.e33 ); -#ifndef __EPM Parallel_Common::bcast_double( mag.start_magnetization, ntype ); -#endif + if(NSPIN != 1) for(int it = 0;itit, distinguish a atom belong to which type int *iat2ia; //iat==>ia int *iwt2iat; // iwt ==> iat. + int *iwt2iw; // iwt ==> iw, Peize Lin add 2018-07-02 IntArray itia2iat;//(it, ia)==>iat, the index in nat, add 2009-3-2 by mohan IntArray itiaiw2iwt;//(it, ia, iw)==>iwt, the index in nwfc, add 2009-3-2 by mohan //LiuXh add 20180515 diff --git a/ABACUS.develop/source/src_pw/unitcell_pseudo.cpp b/ABACUS.develop/source/src_pw/unitcell_pseudo.cpp index 6140785b78..bace95e42a 100644 --- a/ABACUS.develop/source/src_pw/unitcell_pseudo.cpp +++ b/ABACUS.develop/source/src_pw/unitcell_pseudo.cpp @@ -3,6 +3,7 @@ // DATE : 2008-11-10 //========================================================== #include "unitcell_pseudo.h" +#include "../src_lcao/ORB_read.h" // to use 'ORB' -- mohan 2021-01-30 #include "global.h" #include // Peize Lin fix bug about strcmp 2016-08-02 @@ -71,8 +72,6 @@ void UnitCell_pseudo::setup_cell( ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl; ofs_running << "\n\n\n\n"; - - ofs_running << " READING UNITCELL INFORMATION" << endl; //======================== // call read_atom_species @@ -96,8 +95,11 @@ void UnitCell_pseudo::setup_cell( #ifdef __MPI Parallel_Common::bcast_bool(ok); Parallel_Common::bcast_bool(ok2); - if(NSPIN==4) Parallel_Common::bcast_bool(DOMAG); - if(NSPIN==4) Parallel_Common::bcast_bool(DOMAG_Z); + if(NSPIN==4) + { + Parallel_Common::bcast_bool(DOMAG); + Parallel_Common::bcast_bool(DOMAG_Z); + } #endif if(!ok) { @@ -135,17 +137,18 @@ void UnitCell_pseudo::setup_cell( //========================================================== // Calculate recip. lattice vectors and dot products - // latvec has the unit of lat0, but G has the unit 2Pi/lat0 + // latvec have the unit of lat0, but G has the unit 2Pi/lat0 //========================================================== this->GT = latvec.Inverse(); this->G = GT.Transpose(); this->GGT = G * GT; this->invGGT = GGT.Inverse(); - //LiuXh add 20180515 - this->GT0 = latvec.Inverse(); - this->G0 = GT.Transpose(); - this->GGT0 = G * GT; - this->invGGT0 = GGT.Inverse(); + + //LiuXh add 20180515 + this->GT0 = latvec.Inverse(); + this->G0 = GT.Transpose(); + this->GGT0 = G * GT; + this->invGGT0 = GGT.Inverse(); ofs_running << endl; out.printM3(ofs_running,"Lattice vectors: (Cartesian coordinate: in unit of a_0)",latvec); @@ -274,927 +277,37 @@ void UnitCell_pseudo::setup_cell( xcf.which_dft(atoms[it].dft); } - //this->cal_nelec(); + // setup the total number of PAOs this->cal_natomwfc(); + + // setup NLOCAL this->cal_nwfc(); + + // setup NBANDS this->cal_nelec(); + this->cal_meshx(); + // setup vdwd2 parameters + vdwd2_para.initset(*this); // Peize Lin add 2021.03.09 + // stringstream ss; // ss << global_out_dir << "unitcell_pp.log"; // print_unitcell_pseudo( ss.str() ); return; } -void UnitCell_pseudo::read_atom_species(ifstream &ifa) -{ - TITLE("UnitCell_pseudo","read_atom_species"); - - this->atom_mass = new double[ntype]; //atom masses - this->atom_label = new string[ntype]; //atom labels - this->pseudo_fn = new string[ntype]; //file name of pseudopotential - - string word; - //========================================== - // read in information of each type of atom - //========================================== - if( SCAN_BEGIN(ifa, "ATOMIC_SPECIES") ) - { - OUT(ofs_running,"ntype",ntype); - for (int i = 0;i < ntype;i++) - { - ifa >> atom_label[i] >> atom_mass[i]; - - stringstream ss; - ss << "atom label for species " << i+1; - OUT(ofs_running,ss.str(),atom_label[i]); - READ_VALUE(ifa, pseudo_fn[i]); - if(test_pseudo_cell==2) - { - ofs_running << "\n" << setw(6) << atom_label[i] - << setw(12) << atom_mass[i] - << setw(18) << pseudo_fn[i]; - } - } - } - -#ifdef __FP - if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") - { - if( SCAN_BEGIN(ifa, "NUMERICAL_ORBITAL") ) - { - ORB.read_in_flag = true; - for(int i=0; i> ofile; - //----------------------------------- - // Turn off the read in NONLOCAL file - // function since 2013-08-02 by mohan - //----------------------------------- - //READ_VALUE(ifa, nfile); - - ORB.orbital_file.push_back(ofile); - - //----------------------------------- - // Turn off the read in NONLOCAL file - // function since 2013-08-02 by mohan - //----------------------------------- - //ORB.nonlocal_file.push_back(nfile); - -// ofs_running << " For atom type " << i + 1 << endl; -// ofs_running << " Read in numerical orbitals from file " << ofile << endl; -// ofs_running << " Read in nonlocal projectors from file " << nfile << endl; - - } - } - } -#endif - - //========================== - // read in lattice constant - //========================== - if( SCAN_BEGIN(ifa, "LATTICE_CONSTANT") ) - { - READ_VALUE(ifa, lat0); - if(lat0<=0.0) - { - WARNING_QUIT("read_atom_species","lat0<=0.0"); - } - lat0_angstrom = lat0 * 0.529177 ; - OUT(ofs_running,"lattice constant (Bohr)",lat0); - OUT(ofs_running,"lattice constant (Angstrom)",lat0_angstrom); - this->tpiba = TWO_PI / lat0; - this->tpiba2 = tpiba * tpiba; - } - - //=========================== - // Read in latticies vector - //=========================== - if( SCAN_BEGIN(ifa, "LATTICE_VECTORS") ) - { - // Reading lattice vectors. notice - // here that only one cpu read these - // parameters. - ifa >> latvec.e11 >> latvec.e12; - READ_VALUE(ifa, latvec.e13); - ifa >> latvec.e21 >> latvec.e22; - READ_VALUE(ifa, latvec.e23); - ifa >> latvec.e31 >> latvec.e32; - READ_VALUE(ifa, latvec.e33); - - // lattice vectors in another form. - a1.x = latvec.e11; - a1.y = latvec.e12; - a1.z = latvec.e13; - - a2.x = latvec.e21; - a2.y = latvec.e22; - a2.z = latvec.e23; - - a3.x = latvec.e31; - a3.y = latvec.e32; - a3.z = latvec.e33; - - } - return; -} - -// Read atomic positions -// return 1: no problem. -// return 0: some problems. -bool UnitCell_pseudo::read_atom_positions(ifstream &ifpos) -{ - TITLE("UnitCell_pseudo","read_atom_positions"); - - bool use_xyz = false; - /* LiuXh 20171109 - if( SCAN_BEGIN(ifpos, "USE_XYZ") ) - { - use_xyz = true; - } - */ - - if( SCAN_BEGIN(ifpos, "ATOMIC_POSITIONS")) - { - READ_VALUE( ifpos, Coordinate); - if(Coordinate != "Cartesian" - && Coordinate != "Direct" - && Coordinate != "Cartesian_angstrom" - && Coordinate != "Cartesian_au" - && Coordinate != "Cartesian_angstrom_center_xy" - && Coordinate != "Cartesian_angstrom_center_xz" - && Coordinate != "Cartesian_angstrom_center_yz" - && Coordinate != "Cartesian_angstrom_center_xyz" - ) - { - WARNING("read_atom_position","Cartesian or Direct?"); - ofs_warning << " There are several options for you:" << endl; - ofs_warning << " Direct" << endl; - ofs_warning << " Cartesian_angstrom" << endl; - ofs_warning << " Cartesian_au" << endl; - ofs_warning << " Cartesian_angstrom_center_xy" << endl; - ofs_warning << " Cartesian_angstrom_center_xz" << endl; - ofs_warning << " Cartesian_angstrom_center_yz" << endl; - ofs_warning << " Cartesian_angstrom_center_xyz" << endl; - return 0; - } - - Vector3 v; - Vector3 mv; - int na = 0; - this->nat = 0; - - //====================================== - // calculate total number of atoms - // and adjust the order of atom species - //====================================== - assert(ntype>0); - for (int it = 0;it < ntype; it++) - { - ofs_running << "\n READING ATOM TYPE " << it+1 << endl; - - //======================================= - // (1) read in atom label - // start magnetization - //======================================= - READ_VALUE(ifpos, atoms[it].label); - bool found = false; - for(int it2=0; it2atoms[it].label == this->atom_label[it] ) - found = true; - } - if(!found) - { - ofs_warning << " Label read from ATOMIC_POSITIONS is " << this->atoms[it].label << endl; - ofs_warning << " Lable from ATOMIC_SPECIES is " << this->atom_label[it] << endl; - return 0; - } - READ_VALUE(ifpos, mag.start_magnetization[it] ); - - OUT(ofs_running, "atom label",atoms[it].label); - - if(NSPIN==4)//added by zhengdy-soc - { - if(NONCOLIN) - { - soc.m_loc[it].x = mag.start_magnetization[it] * - sin(soc.angle1[it]) * cos(soc.angle2[it]); - soc.m_loc[it].y = mag.start_magnetization[it] * - sin(soc.angle1[it]) * sin(soc.angle2[it]); - soc.m_loc[it].z = mag.start_magnetization[it] * - cos(soc.angle1[it]); - } - else - { - soc.m_loc[it].x = 0; - soc.m_loc[it].y = 0; - soc.m_loc[it].z = mag.start_magnetization[it]; - } - - OUT(ofs_running, "noncollinear magnetization_x",soc.m_loc[it].x); - OUT(ofs_running, "noncollinear magnetization_y",soc.m_loc[it].y); - OUT(ofs_running, "noncollinear magnetization_z",soc.m_loc[it].z); - - ZEROS(soc.ux ,3); - } - else if(NSPIN==2) - { - soc.m_loc[it].x = mag.start_magnetization[it]; - OUT(ofs_running, "start magnetization",mag.start_magnetization[it]); - } - else if(NSPIN==1) - { - OUT(ofs_running, "start magnetization","FALSE"); - } - - //=========================================== - // (2) read in numerical orbital information - // int atoms[it].nwl - // int* atoms[it].l_nchi; - //=========================================== - /*READ_VALUE(ifpos, this->atoms[it].nwl); - assert(this->atoms[it].nwl<10); - OUT(ofs_running,"L max for local orbitals",atoms[it].nwl); - - delete[] this->atoms[it].l_nchi; - this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1]; - this->atoms[it].nw = 0; - for(int L=0; Latoms[it].l_nchi[L]); - - // calculate the number of local basis(3D) - this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; - - stringstream ss; - ss << "L=" << L << ", number of zeta"; - OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); - }*/ - if (BASIS_TYPE == "lcao" || BASIS_TYPE == "lcao_in_pw") - { - ifstream ifs(ORB.orbital_file[it].c_str(), ios::in); // pengfei 2014-10-13 - if (!ifs) - { - cout << " Can't find the ORBITAL file." << endl; - } - - char word[80]; - delete[] this->atoms[it].l_nchi; - this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1]; - this->atoms[it].nw = 0; - int L =0; - - while (ifs.good()) - { - ifs >> word; - if (strcmp("Lmax", word) == 0) - { - READ_VALUE(ifs, this->atoms[it].nwl); - } - assert(this->atoms[it].nwl<10); - - if (strcmp("Cutoff(a.u.)", word) == 0) // pengfei Li 16-2-29 - { - READ_VALUE(ifs, this->atoms[it].Rcut); - } - - //cout << "atoms[it].nwl = "<", word) == 0) - { - READ_VALUE(ifs, this->atoms[it].l_nchi[L]); - this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; - stringstream ss; - ss << "L=" << L << ", number of zeta"; - OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); - L++; - } - if (strcmp("Porbital-->", word) == 0) - { - READ_VALUE(ifs, this->atoms[it].l_nchi[L]); - this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; - stringstream ss; - ss << "L=" << L << ", number of zeta"; - OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); - L++; - } - if (strcmp("Dorbital-->", word) == 0) - { - READ_VALUE(ifs, this->atoms[it].l_nchi[L]); - this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; - stringstream ss; - ss << "L=" << L << ", number of zeta"; - OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); - L++; - } - if (strcmp("Forbital-->", word) == 0) - { - READ_VALUE(ifs, this->atoms[it].l_nchi[L]); - this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; - stringstream ss; - ss << "L=" << L << ", number of zeta"; - OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); - L++; - } - if (strcmp("Gorbital-->", word) == 0) - { - READ_VALUE(ifs, this->atoms[it].l_nchi[L]); - this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; - stringstream ss; - ss << "L=" << L << ", number of zeta"; - OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); - L++; - } - //cout <<" atoms[it].nw = "<atoms[it].l_nchi; - this->atoms[it].l_nchi = new int[ this->atoms[it].nwl+1]; - this->atoms[it].nw = 0; - - this->atoms[it].nwl = 2; - //cout << INPUT.lmaxmax << endl; - if ( INPUT.lmaxmax != 2 ) - { - this->atoms[it].nwl = INPUT.lmaxmax; - } - for(int L=0; Latoms[it].l_nchi[L] = 1; - // calculate the number of local basis(3D) - this->atoms[it].nw += (2*L + 1) * this->atoms[it].l_nchi[L]; - - stringstream ss; - ss << "L=" << L << ", number of zeta"; - OUT(ofs_running,ss.str(),atoms[it].l_nchi[L]); - } - - /* this->atoms[it].l_nchi[0] = 1; - this->atoms[it].nw += (2*0 + 1) * this->atoms[it].l_nchi[0]; - // stringstream s0; - // s0 << "L=" << 0 << ", number of zeta"; - // OUT(ofs_running,s0.str(),atoms[it].l_nchi[0]); - - this->atoms[it].l_nchi[1] = 1; - this->atoms[it].nw += (2*1 + 1) * this->atoms[it].l_nchi[1]; - // stringstream s1; - // s1 << "L=" << 1 << ", number of zeta"; - // OUT(ofs_running,s1.str(),atoms[it].l_nchi[1]); - - this->atoms[it].l_nchi[2] = 1; - this->atoms[it].nw += (2*2 + 1) * this->atoms[it].l_nchi[2];*/ - // stringstream s2; - // s2 << "L=" << 2 << ", number of zeta"; - // OUT(ofs_running,s2.str(),atoms[it].l_nchi[2]);*/ - - } - - //OUT(ofs_running,"Total number of local orbitals",atoms[it].nw); - - //========================= - // (3) read in atom number - //========================= - READ_VALUE(ifpos, na); - this->atoms[it].na = na; - - OUT(ofs_running,"number of atom for this type",na); - - this->nat += na; - if (na <= 0) - { - WARNING("read_atom_positions"," atom number < 0."); - return 0; - } - if (na > 0) - { - delete[] atoms[it].tau; - delete[] atoms[it].taud; - delete[] atoms[it].mbl; - delete[] atoms[it].mag; - atoms[it].tau = new Vector3[na]; - atoms[it].taud = new Vector3[na]; - atoms[it].mbl = new Vector3[na]; - atoms[it].mag = new double[na]; - atoms[it].mass = this->atom_mass[it]; //mohan add 2011-11-07 - ZEROS(atoms[it].mag,na); - for (int ia = 0;ia < na; ia++) - { - if(use_xyz) - { - string tmpid; - ifpos >> tmpid; - if(tmpid != atoms[it].label) - { - WARNING("read_atom_positions","atom label not match"); - return 0; - } - else - { - ifpos >> v.x >> v.y >> v.z; - - mv.x = true; - mv.y = true; - mv.z = true; - - string mags; - std::getline( ifpos, mags ); - // change string to double. - //atoms[it].mag[ia] = std::atof(mags.c_str()); - atoms[it].mag[ia] = 0.0; - } - } - else - { - ifpos >> v.x >> v.y >> v.z - >> mv.x >> mv.y >> mv.z; - string mags; - std::getline( ifpos, mags ); - // change string to double. - //atoms[it].mag[ia] = std::atof(mags.c_str()); - atoms[it].mag[ia] = 0.0; - } - - if(Coordinate=="Direct") - { - // change v from direct to cartesian, - // the unit is pw.lat0 - atoms[it].taud[ia] = v; - atoms[it].tau[ia] = v * latvec; - } - else if(Coordinate=="Cartesian") - { - atoms[it].tau[ia] = v ;// in unit lat0 - //cout << " T=" << it << " I=" << ia << " tau=" << atoms[it].tau[ia].x << " " << - //atoms[it].tau[ia].y << " " << atoms[it].tau[ia].z << endl; - } - else if(Coordinate=="Cartesian_angstrom") - { - atoms[it].tau[ia] = v / 0.529177 / lat0; - } - else if(Coordinate=="Cartesian_angstrom_center_xy") - { - // calculate lattice center - latcenter.x = (latvec.e11 + latvec.e21 + latvec.e31)/2.0; - latcenter.y = (latvec.e12 + latvec.e22 + latvec.e32)/2.0; - latcenter.z = 0.0; - atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; - } - else if(Coordinate=="Cartesian_angstrom_center_xz") - { - // calculate lattice center - latcenter.x = (latvec.e11 + latvec.e21 + latvec.e31)/2.0; - latcenter.y = 0.0; - latcenter.z = (latvec.e13 + latvec.e23 + latvec.e33)/2.0; - atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; - } - else if(Coordinate=="Cartesian_angstrom_center_yz") - { - // calculate lattice center - latcenter.x = 0.0; - latcenter.y = (latvec.e12 + latvec.e22 + latvec.e32)/2.0; - latcenter.z = (latvec.e13 + latvec.e23 + latvec.e33)/2.0; - atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; - } - else if(Coordinate=="Cartesian_angstrom_center_xyz") - { - // calculate lattice center - latcenter.x = (latvec.e11 + latvec.e21 + latvec.e31)/2.0; - latcenter.y = (latvec.e12 + latvec.e22 + latvec.e32)/2.0; - latcenter.z = (latvec.e13 + latvec.e23 + latvec.e33)/2.0; - atoms[it].tau[ia] = v / 0.529177 / lat0 + latcenter; - } - else if(Coordinate=="Cartesian_au") - { - atoms[it].tau[ia] = v / lat0; - } - - if(Coordinate=="Cartesian" || - Coordinate=="Cartesian_angstrom" || - Coordinate=="Cartesian_angstrom_center_xy" || - Coordinate=="Cartesian_angstrom_center_xz" || - Coordinate=="Cartesian_angstrom_center_yz" || - Coordinate=="Cartesian_angstrom_center_xyz" || - Coordinate=="Cartesian_au") - { - double dx,dy,dz; - Mathzone::Cartesian_to_Direct(atoms[it].tau[ia].x, atoms[it].tau[ia].y, atoms[it].tau[ia].z, - latvec.e11, latvec.e12, latvec.e13, - latvec.e21, latvec.e22, latvec.e23, - latvec.e31, latvec.e32, latvec.e33, - dx,dy,dz); - - atoms[it].taud[ia].x = dx; - atoms[it].taud[ia].y = dy; - atoms[it].taud[ia].z = dz; - - } - - atoms[it].mbl[ia] = mv; - }//endj - }// end na - }//end for ntype - }// end scan_begin - - - ofs_running << endl; - OUT(ofs_running,"TOTAL ATOM NUMBER",nat); - - // mohan add 2010-06-30 - //xiaohui modify 2015-03-15, cancel outputfile "STRU_READIN.xyz" - //this->print_cell_xyz("STRU_READIN.xyz"); - this->check_dtau(); - - if ( this->check_tau() ) - { - - } - else - { - return 0; - } - this->print_tau(); - //xiaohui modify 2015-03-15, cancel outputfile "STRU_READIN.xyz" - //this->print_cell_xyz("STRU_READIN_ADJUST.xyz"); - this->print_cell_cif("STRU_READIN_ADJUST.cif"); - - return 1; -}//end read_atom_positions - -bool UnitCell_pseudo::check_tau(void)const -{ - TITLE("UnitCell_pseudo","check_tau"); - timer::tick("UnitCell_pseudo","check_tau"); - - Vector3 diff = 0.0; - double norm = 0.0; - double tolerence_bohr = 1.0e-3; - - //ofs_running << "\n Output nearest atom not considering periodic boundary condition" << endl; - //ofs_running << " " << setw(5) << "TYPE" << setw(6) << "INDEX" - //<< setw(20) << "NEAREST(Bohr)" - //<< setw(20) << "NEAREST(Angstrom)" << endl; - for(int T1=0; T1< this->ntype; T1++) - { - for(int I1=0; I1< this->atoms[T1].na; I1++) - { - double shortest_norm = 10000.0; // a large number - //int nearest_atom_type = 0; - //int nearest_atom_index = 0; - for(int T2=0; T2ntype; T2++) - { - for(int I2=0; I2atoms[T2].na; I2++) - { - if(T1==T2 && I1==I2) - { - shortest_norm = 0.0; - //nearest_atom_type = T1; - //nearest_atom_index = I2; - // self atom - } - else - { - diff = atoms[T1].tau[I1] - atoms[T2].tau[I2]; - norm = diff.norm() * ucell.lat0; - if( shortest_norm > norm ) - { - shortest_norm = norm; - //nearest_atom_type = T2; - //nearest_atom_index = I2; - } - if( norm < tolerence_bohr ) // unit is Bohr - { - ofs_warning << " two atoms are too close!" << endl; - ofs_warning << " type:" << this->atoms[T1].label << " atom " << I1 + 1 << endl; - ofs_warning << " type:" << this->atoms[T2].label << " atom " << I2 + 1 << endl; - ofs_warning << " distance = " << norm << " Bohr" << endl; - return 0; - } - } - } - } - //ofs_running << " " << setw(5) << atoms[T1].label << setw(6) << I1+1 - //<< setw(20) << shortest_norm - //<< setw(20) << shortest_norm * BOHR_TO_A << endl; - } - } - - timer::tick("UnitCell_pseudo","check_tau"); - return 1; -} - -void UnitCell_pseudo::print_stru_file(const string &fn, const int &type)const -{ - TITLE("UnitCell_pseudo","print_stru_file"); - - if(MY_RANK!=0) return; - - ofstream ofs(fn.c_str()); - - ofs << "ATOMIC_SPECIES" << endl; - ofs << setprecision(12); - - for(int it=0; itpseudo_fn[i]; - //error = upf.read_pseudo_upf( pp_address ); xiaohui modify 2013-06-23 - error = upf.init_pseudo_reader( pp_address ); //xiaohui add 2013-06-23 - //average pseudopotential if needed - error_ap = upf.average_p(); //added by zhengdy 2020-10-20 - } - -#ifdef __MPI - Parallel_Common::bcast_int(error); - Parallel_Common::bcast_int(error_ap); -#endif - - if(error_ap) WARNING_QUIT("UnitCell_pseudo::read_pseudopot","error when average the pseudopotential."); - - if(error==1) - { - cout << " Pseudopotential directory now is : " << pp_address << endl; - ofs_warning << " Pseudopotential directory now is : " << pp_address << endl; - WARNING_QUIT("UnitCell_pseudo::read_pseudopot","Couldn't find pseudopotential file."); - } - else if(error==2) - { - WARNING_QUIT("UnitCell_pseudo::read_pseudopot","Something in pseudopotential not match."); - } - else if(error==3) - { - //xiaohui modify 2015-03-25 - //WARNING_QUIT("UnitCell_pseudo::read_pseudopot","Please check the reference states in pseudopotential .vwr file.\n Also the norm of the read in pseudo wave functions\n explicitly please check S, P and D channels.\n If the norm of the wave function is \n unreasonable large (should be near 1.0), MESIA would quit. \n The solution is to turn off the wave functions \n and the corresponding non-local projectors together\n in .vwr pseudopotential file."); - WARNING_QUIT("UnitCell_pseudo::read_pseudopot","Please check the reference states in pseudopotential .vwr file.\n Also the norm of the read in pseudo wave functions\n explicitly please check S, P and D channels.\n If the norm of the wave function is \n unreasonable large (should be near 1.0), ABACUS would quit. \n The solution is to turn off the wave functions \n and the corresponding non-local projectors together\n in .vwr pseudopotential file."); - } -// OUT(ofs_running,"PP_ERRROR",error); - -//xiaohui add 2015-03-24 -#ifdef __MPI - Parallel_Common::bcast_bool(upf.functional_error); -#endif - //xiaohui add 2015-03-24 - if(upf.functional_error == 1) - { - WARNING_QUIT("Pseudopot_upf::read_pseudo_header","input xc functional does not match that in pseudopot file"); - } - - if(MY_RANK==0) - { -// upf.print_pseudo_upf( ofs ); - atoms[i].set_pseudo_us( upf ); - - ofs_running << "\n Read in pseudopotential file is " << pseudo_fn[i] << endl; - OUT(ofs_running,"pseudopotential type",atoms[i].pp_type); - OUT(ofs_running,"functional Ex", atoms[i].dft[0]); - OUT(ofs_running,"functional Ec", atoms[i].dft[1]); - OUT(ofs_running,"functional GCEx", atoms[i].dft[2]); - OUT(ofs_running,"functional GCEc", atoms[i].dft[3]); - OUT(ofs_running,"nonlocal core correction", atoms[i].nlcc); -// OUT(ofs_running,"spin orbital",atoms[i].has_so); - OUT(ofs_running,"valence electrons", atoms[i].zv); - OUT(ofs_running,"lmax", atoms[i].lmax); - OUT(ofs_running,"number of zeta", atoms[i].nchi); - OUT(ofs_running,"number of projectors", atoms[i].nbeta); - for(int ib=0; ib0; use input number (setup.f90) @@ -1217,7 +330,7 @@ void UnitCell_pseudo::cal_nelec(void) } } -// OUT(ofs_running,"Total nelec",nelec); + //OUT(ofs_running,"Total nelec",nelec); //======================================= // calculate number of bands (setup.f90) @@ -1232,16 +345,17 @@ void UnitCell_pseudo::cal_nelec(void) OUT(ofs_running,"occupied bands",occupied_bands); // mohan add 2010-09-04 - //cout << "nbands(ucell) = " < num. of occupied bands"); } } - + if ( CALCULATION!="scf-sto" && CALCULATION!="relax-sto" && CALCULATION!="md-sto" ) //qianrui 2021-2-20 + { if(NBANDS == 0) { if(NSPIN == 1) @@ -1256,10 +370,6 @@ void UnitCell_pseudo::cal_nelec(void) int nbands4 = 1.2 * nelec; NBANDS = max(nbands3, nbands4); } - if (NBANDS > NLOCAL) - { - NBANDS = NLOCAL; - } AUTO_SET("NBANDS",NBANDS); } //else if ( CALCULATION=="scf" || CALCULATION=="md" || CALCULATION=="relax") //pengfei 2014-10-13 @@ -1271,16 +381,28 @@ void UnitCell_pseudo::cal_nelec(void) OUT(ofs_running,"nelup",mag.get_nelup()); WARNING_QUIT("unitcell","Too few spin up bands!"); } - if(NBANDS < mag.get_neldw() ) - { - WARNING_QUIT("unitcell","Too few spin down bands!"); - } - if (NBANDS > NLOCAL) - { - WARNING_QUIT("unitcell","Too many bands! NBANDS > NBASIS."); - } + if(NBANDS < mag.get_neldw() ) + { + WARNING_QUIT("unitcell","Too few spin down bands!"); + } + } } + // mohan update 2021-02-19 + // mohan add 2011-01-5 + if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") + { + if( NBANDS > NLOCAL ) + { + WARNING_QUIT("UnitCell_pseudo::cal_nwfc","NLOCAL < NBANDS"); + } + else + { + OUT(ofs_running,"NLOCAL",NLOCAL); + OUT(ofs_running,"NBANDS",NBANDS); + } + } + OUT(ofs_running,"NBANDS",NBANDS); return; } @@ -1291,9 +413,9 @@ void UnitCell_pseudo::cal_nelec(void) // atoms[].stapos_wf // NBANDS //=========================================== -void UnitCell_pseudo::cal_nwfc() +void UnitCell_pseudo::cal_nwfc(void) { - if(test_pseudo_cell) TITLE("UnitCell_pseudo","cal_nwfc"); + TITLE("UnitCell_pseudo","cal_nwfc"); assert(ntype>0); assert(nat>0); @@ -1316,8 +438,9 @@ void UnitCell_pseudo::cal_nwfc() this->nwmax = std::max( atoms[it].nw, nwmax ); } assert(namax>0); -// OUT(ofs_running,"max input atom number",namax); -// OUT(ofs_running,"max wave function number",nwmax); +// for tests +// OUT(ofs_running,"max input atom number",namax); +// OUT(ofs_running,"max wave function number",nwmax); //=========================== // (3) set nwfc and stapos_wf @@ -1327,16 +450,22 @@ void UnitCell_pseudo::cal_nwfc() { atoms[it].stapos_wf = NLOCAL; const int nlocal_it = atoms[it].nw * atoms[it].na; - if(NSPIN!=4) NLOCAL += nlocal_it; - else NLOCAL += nlocal_it * 2;//zhengdy-soc -// stringstream ss1; -// ss1 << "number of local orbitals for species " << it; -// if(LOCAL_BASIS)OUT(ofs_running,ss1.str(),nlocal_it); + if(NSPIN!=4) + { + NLOCAL += nlocal_it; + } + else + { + NLOCAL += nlocal_it * 2;//zhengdy-soc + } + +// for tests +// OUT(ofs_running,ss1.str(),nlocal_it); // OUT(ofs_running,"start position of local orbitals",atoms[it].stapos_wf); } //OUT(ofs_running,"NLOCAL",NLOCAL); - ofs_running << " " << setw(40) << "NLOCAL" << " = " << NLOCAL <natomwfc = 0; for (int it = 0;it < ntype;it++) { @@ -1509,124 +637,7 @@ void UnitCell_pseudo::cal_natomwfc(void) return; } -void UnitCell_pseudo::print_unitcell_pseudo(const string &fn) -{ - if(test_pseudo_cell) TITLE("UnitCell_pseudo","print_unitcell_pseudo"); - ofstream ofs( fn.c_str() ); - - this->print_cell(ofs); - for (int i = 0;i < ntype;i++) - { - atoms[i].print_Atom(ofs); - } - - ofs.close(); - return; -} - - -int UnitCell_pseudo::find_type(const string &label) -{ - if(test_pseudo_cell) TITLE("UnitCell_pseudo","find_type"); - assert(ntype>0); - for(int it=0;ittaud[ia].x+10000) - int(atom1->taud[ia].x+10000); - double dy2 = (atom1->taud[ia].y+10000) - int(atom1->taud[ia].y+10000); - double dz2 = (atom1->taud[ia].z+10000) - int(atom1->taud[ia].z+10000); - - // mohan add 2011-04-07 - while(dx2 >= 1) - { - ofs_warning << " dx2 is >=1 " << endl; - dx2 -= 1.0; - } - while(dy2 >= 1) - { - ofs_warning << " dy2 is >=1 " << endl; - dy2 -= 1.0; - } - while(dz2 >= 1) - { - ofs_warning << " dz2 is >=1 " << endl; - dz2 -= 1.0; - } - // mohan add 2011-04-07 - while(dx2<0) - { - ofs_warning << " dx2 is <0 " << endl; - dx2 += 1.0; - } - while(dy2<0) - { - ofs_warning << " dy2 is <0 " << endl; - dy2 += 1.0; - } - while(dz2<0) - { - ofs_warning << " dz2 is <0 " << endl; - dz2 += 1.0; - } - - atom1->taud[ia].x = dx2; - atom1->taud[ia].y = dy2; - atom1->taud[ia].z = dz2; - - double cx2, cy2, cz2; - - Mathzone::Direct_to_Cartesian( - atom1->taud[ia].x, atom1->taud[ia].y, atom1->taud[ia].z, - latvec.e11, latvec.e12, latvec.e13, - latvec.e21, latvec.e22, latvec.e23, - latvec.e31, latvec.e32, latvec.e33, - cx2, cy2, cz2); - - atom1->tau[ia].x = cx2; - atom1->tau[ia].y = cy2; - atom1->tau[ia].z = cz2; - - // cout << setw(15) << dx2 << setw(15) << dy2 << setw(15) << dz2 - // << setw(15) << cx2 << setw(15) << cy2 << setw(15) << cz2 - // << endl; - - } - } - return; -} //LiuXh add a new function here, //20180515 diff --git a/ABACUS.develop/source/src_pw/unitcell_pseudo.h b/ABACUS.develop/source/src_pw/unitcell_pseudo.h index 4578d28500..78c5393039 100644 --- a/ABACUS.develop/source/src_pw/unitcell_pseudo.h +++ b/ABACUS.develop/source/src_pw/unitcell_pseudo.h @@ -39,7 +39,7 @@ class UnitCell_pseudo : public UnitCell void print_tau(void)const; void print_stru_file(const string &fn, const int &type=1)const; // mohan add 2011-03-22 void check_dtau(void); - void setup_cell_after_vc(const string &s_pseudopot_dir, const string &fn, ofstream &log); //LiuXh add 20180515 + void setup_cell_after_vc(const string &s_pseudopot_dir, const string &fn, ofstream &log); //LiuXh add 20180515 private: // member variables bool set_atom_flag;//added on 2009-3-8 by mohan diff --git a/ABACUS.develop/source/src_pw/vdwd2.cpp b/ABACUS.develop/source/src_pw/vdwd2.cpp index a903a5c8f6..77a355ebaa 100644 --- a/ABACUS.develop/source/src_pw/vdwd2.cpp +++ b/ABACUS.develop/source/src_pw/vdwd2.cpp @@ -9,93 +9,22 @@ #include"src_global/constants.h" #include -Vdwd2::Vdwd2( const UnitCell_pseudo &unitcell): - energy_result(0), - ucell(unitcell), - init_set(false) -{ - init_C6(); - init_R0(); -} - -void Vdwd2::C6_input(const std::string &file, const std::string &unit) -{ - if( file != "default" ) - { - ifstream ifs(file); - if(!ifs) - WARNING_QUIT("Vdwd2::C6_input", "Can not find the file "+TO_STRING(file)); - std::string element; - double value; - while( ifs >> element >> value ) - C6[element]=value; - ifs.close(); - } - for(auto &c6 : C6) - { - if( unit == "Jnm6/mol") - c6.second *= 1e6/(ELECTRONVOLT_SI*NA)/pow(BOHR_TO_A,6)/Ry_to_eV; - else if( unit == "eVA6") - c6.second /= pow(BOHR_TO_A,6)/Ry_to_eV; -// else if( unit == "RyBohr6"); - else - WARNING_QUIT("Input","vdwD2_C6_unit must be Jnm6/mol or eVA6"); - } -} - -void Vdwd2::R0_input(const std::string &file, const std::string &unit) -{ - if( file != "default" ) - { - ifstream ifs(file.c_str()); - if(!ifs) - WARNING_QUIT("Vdwd2::R0_input", "Can not find the file "+TO_STRING(file)); - std::string element; - double value; - while( ifs >> element >> value ) - R0[element]=value; - ifs.close(); - } - for(auto &r0 : R0) - { - if( unit == "A") - r0.second/= BOHR_TO_A; - else if( unit == "Bohr") ; - else - WARNING_QUIT("Input","vdwD2_R0_unit must be A or Bohr"); - } -} +Vdwd2::Vdwd2(const UnitCell_pseudo &unit_in, Vdwd2_Parameters ¶_in): + ucell(unit_in), + para(para_in){} -void Vdwd2::initset() -{ - if(!init_set) - { - for(auto &c6 : C6) - c6.second /= pow(ucell.lat0,6); - for(auto &r0 : R0) - r0.second /= ucell.lat0; - if(model=="radius") - { - period.x = 2*ceil(radius/ucell.lat0/sqrt(ucell.a1.norm2())) +1; - period.y = 2*ceil(radius/ucell.lat0/sqrt(ucell.a2.norm2())) +1; - period.z = 2*ceil(radius/ucell.lat0/sqrt(ucell.a3.norm2())) +1; - } - init_set=true; - } -} - -double Vdwd2::energy() +void Vdwd2::cal_energy() { TITLE("Vdwd2","energy"); - initset(); + para.initset(ucell); - energy_result = 0; + energy = 0; for( int it1=0; it1!=ucell.ntype; ++it1 ) { for( int it2=0; it2!=ucell.ntype; ++it2 ) { - const double C6_product = sqrt( C6.at(ucell.atoms[it1].label) * C6.at(ucell.atoms[it2].label) ); - const double R0_sum = R0.at(ucell.atoms[it1].label) + R0.at(ucell.atoms[it2].label); + const double C6_product = sqrt( para.C6.at(ucell.atoms[it1].psd) * para.C6.at(ucell.atoms[it2].psd) )/pow(ucell.lat0,6) ; + const double R0_sum = ( para.R0.at(ucell.atoms[it1].psd) + para.R0.at(ucell.atoms[it2].psd) )/ucell.lat0; if(!R0_sum) WARNING_QUIT("Input", "R0_sum can not be 0"); for( int ia1=0; ia1!=ucell.atoms[it1].na; ++ia1 ) @@ -103,9 +32,9 @@ double Vdwd2::energy() for( int ia2=0; ia2!=ucell.atoms[it2].na; ++ia2 ) { Vector3 ilat_loop; - for( ilat_loop.x = -period.x/2; ilat_loop.x <= (period.x-1)/2; ++ilat_loop.x ) - for( ilat_loop.y = -period.y/2; ilat_loop.y <= (period.y-1)/2; ++ilat_loop.y ) - for( ilat_loop.z = -period.z/2; ilat_loop.z <= (period.z-1)/2; ++ilat_loop.z ) + for( ilat_loop.x = -para.period.x/2; ilat_loop.x <= (para.period.x-1)/2; ++ilat_loop.x ) + for( ilat_loop.y = -para.period.y/2; ilat_loop.y <= (para.period.y-1)/2; ++ilat_loop.y ) + for( ilat_loop.z = -para.period.z/2; ilat_loop.z <= (para.period.z-1)/2; ++ilat_loop.z ) { if( (!( ilat_loop.x || ilat_loop.y || ilat_loop.z )) && (it1==it2) && (ia1==ia2) ) continue; @@ -113,32 +42,30 @@ double Vdwd2::energy() const Vector3 tau2 = ucell.atoms[it2].tau[ia2] + ilat_loop * ucell.latvec; const double r_sqr = (tau1 - tau2).norm2(); const double r = sqrt(r_sqr); - const double tmp_damp_recip = 1+ exp( -damping* (r/R0_sum-1) ); - energy_result -= C6_product/ pow(r_sqr,3)/ tmp_damp_recip/ 2; + const double tmp_damp_recip = 1+ exp( -para.damping* (r/R0_sum-1) ); + energy -= C6_product/ pow(r_sqr,3)/ tmp_damp_recip/ 2; } // end for ilat_loop } // end for ia2 } // end for ia1 } // end for it2 } // end for it1 - energy_result *= scaling; - return energy_result; + energy *= para.scaling; } -const std::vector> &Vdwd2::force(matrix &stress_result, const bool stress_for_vdw) +void Vdwd2::cal_force() { TITLE("Vdwd2","force"); - initset(); + para.initset(ucell); - force_result.clear(); - force_result.resize(ucell.nat); - if(stress_for_vdw) stress_result.zero_out(); + force.clear(); + force.resize(ucell.nat); for( int it1=0; it1!=ucell.ntype; ++it1 ) { for( int it2=0; it2!=ucell.ntype; ++it2 ) { - const double C6_product = sqrt( C6.at(ucell.atoms[it1].label) * C6.at(ucell.atoms[it2].label) ) ; - const double R0_sum = R0.at(ucell.atoms[it1].label) + R0.at(ucell.atoms[it2].label) ; + const double C6_product = sqrt( para.C6.at(ucell.atoms[it1].psd) * para.C6.at(ucell.atoms[it2].psd) )/pow(ucell.lat0,6); + const double R0_sum = ( para.R0.at(ucell.atoms[it1].psd) + para.R0.at(ucell.atoms[it2].psd) )/ucell.lat0; if(!R0_sum) WARNING_QUIT("Input", "R0_sum can not be 0"); for( int ia1=0; ia1!=ucell.atoms[it1].na; ++ia1 ) @@ -146,9 +73,9 @@ const std::vector> &Vdwd2::force(matrix &stress_result, const bo for( int ia2=0; ia2!=ucell.atoms[it2].na; ++ia2 ) { Vector3 ilat_loop; - for( ilat_loop.x = -period.x/2; ilat_loop.x <= (period.x-1)/2; ++ilat_loop.x ) - for( ilat_loop.y = -period.y/2; ilat_loop.y <= (period.y-1)/2; ++ilat_loop.y ) - for( ilat_loop.z = -period.z/2; ilat_loop.z <= (period.z-1)/2; ++ilat_loop.z ) + for( ilat_loop.x = -para.period.x/2; ilat_loop.x <= (para.period.x-1)/2; ++ilat_loop.x ) + for( ilat_loop.y = -para.period.y/2; ilat_loop.y <= (para.period.y-1)/2; ++ilat_loop.y ) + for( ilat_loop.z = -para.period.z/2; ilat_loop.z <= (para.period.z-1)/2; ++ilat_loop.z ) { if( (!( ilat_loop.x || ilat_loop.y || ilat_loop.z )) && (it1==it2) && (ia1==ia2) ) continue; @@ -156,36 +83,62 @@ const std::vector> &Vdwd2::force(matrix &stress_result, const bo const Vector3 tau2 = ucell.atoms[it2].tau[ia2] + ilat_loop * ucell.latvec; const double r_sqr = (tau1 - tau2).norm2(); const double r = sqrt(r_sqr); - const double tmp_exp = exp( -damping* (r/R0_sum-1) ); - const double tmp_factor = C6_product/ pow(r_sqr,3)/ r/ (1+tmp_exp)* ( -6/r + tmp_exp/(1+tmp_exp)*damping/R0_sum); - force_result[ucell.itia2iat(it1,ia1)] += tmp_factor*(tau1-tau2); - if(stress_for_vdw)//added by zhengdy 2018/10/28 - { - double dr[3]={tau2.x - tau1.x, tau2.y - tau1.y, tau2.z - tau1.z}; - for(int ipol = 0;ipol<3;ipol++) - { - for(int jpol = 0;jpol<3;jpol++) - { - stress_result(ipol,jpol) += tmp_factor* dr[ipol] *dr[jpol]/2 ; - } -// stress_result(ipol,1) += tmp_factor* (tau1.y - tau2.y); -// stress_result(ipol,2) += tmp_factor* (tau1.z - tau2.z); - } - } // end if stress + const double tmp_exp = exp( -para.damping* (r/R0_sum-1) ); + const double tmp_factor = C6_product/ pow(r_sqr,3)/ r/ (1+tmp_exp)* ( -6/r + tmp_exp/(1+tmp_exp)*para.damping/R0_sum); + force[ucell.itia2iat(it1,ia1)] += tmp_factor*(tau1-tau2); } // end for ilat_loop } // end for ia2 } // end for ia1 } // end for it2 } // end for it1 for( int iat=0; iat!=ucell.nat; ++iat ) - force_result[iat] *= scaling/ucell.lat0; - for(int ipol=0;ipol<3;ipol++) { - for(int jpol=0;jpol<3;jpol++) - { - stress_result(ipol,jpol) *= scaling / ucell.omega; - } + force[iat] *= para.scaling/ucell.lat0; } +} + - return force_result; +void Vdwd2::cal_stress() +{ + TITLE("Vdwd2","stress"); + para.initset(ucell); + + stress.Reset(); + + for( int it1=0; it1!=ucell.ntype; ++it1 ) + { + for( int it2=0; it2!=ucell.ntype; ++it2 ) + { + const double C6_product = sqrt( para.C6.at(ucell.atoms[it1].psd) * para.C6.at(ucell.atoms[it2].psd) )/pow(ucell.lat0,6); + const double R0_sum = ( para.R0.at(ucell.atoms[it1].psd) + para.R0.at(ucell.atoms[it2].psd) )/ucell.lat0; + if(!R0_sum) + WARNING_QUIT("Input", "R0_sum can not be 0"); + for( int ia1=0; ia1!=ucell.atoms[it1].na; ++ia1 ) + { + for( int ia2=0; ia2!=ucell.atoms[it2].na; ++ia2 ) + { + Vector3 ilat_loop; + for( ilat_loop.x = -para.period.x/2; ilat_loop.x <= (para.period.x-1)/2; ++ilat_loop.x ) + for( ilat_loop.y = -para.period.y/2; ilat_loop.y <= (para.period.y-1)/2; ++ilat_loop.y ) + for( ilat_loop.z = -para.period.z/2; ilat_loop.z <= (para.period.z-1)/2; ++ilat_loop.z ) + { + if( (!( ilat_loop.x || ilat_loop.y || ilat_loop.z )) && (it1==it2) && (ia1==ia2) ) + continue; + const Vector3 tau1 = ucell.atoms[it1].tau[ia1]; + const Vector3 tau2 = ucell.atoms[it2].tau[ia2] + ilat_loop * ucell.latvec; + const Vector3 dr = tau2 - tau1; + const double r_sqr = (tau1 - tau2).norm2(); + const double r = sqrt(r_sqr); + const double tmp_exp = exp( -para.damping* (r/R0_sum-1) ); + const double tmp_factor = C6_product/ pow(r_sqr,3)/ r/ (1+tmp_exp)* ( -6/r + tmp_exp/(1+tmp_exp)*para.damping/R0_sum); + stress += tmp_factor / 2 * Matrix3( + dr.x*dr.x, dr.x*dr.y, dr.x*dr.z, + dr.y*dr.x, dr.y*dr.y, dr.y*dr.z, + dr.z*dr.x, dr.z*dr.y, dr.z*dr.z); + } // end for ilat_loop + } // end for ia2 + } // end for ia1 + } // end for it2 + } // end for it1 + stress *= para.scaling / ucell.omega; } diff --git a/ABACUS.develop/source/src_pw/vdwd2.h b/ABACUS.develop/source/src_pw/vdwd2.h index 7b1dae7146..dde81d62be 100644 --- a/ABACUS.develop/source/src_pw/vdwd2.h +++ b/ABACUS.develop/source/src_pw/vdwd2.h @@ -5,48 +5,33 @@ //========================================================== #ifndef VDWD2_H #define VDWD2_H -#include"input_conv.h" +#include"src_pw/vdwd2_parameters.h" #include"src_pw/unitcell_pseudo.h" #include"src_global/vector3.h" -#include #include class Vdwd2 { public: - Vdwd2( const UnitCell_pseudo &unitcell); - - bool vdwD2; - - double energy_result; - double energy(); - - std::vector> force_result; - const std::vector> &force(matrix &stress_result, const bool stress_for_vdw); + Vdwd2(const UnitCell_pseudo &unit_in, Vdwd2_Parameters ¶_in); + void cal_energy(); + void cal_force(); + void cal_stress(); + + const double &get_energy()const{ return energy; } + const std::vector> &get_force() const{ return force; } + const Matrix3 &get_stress()const{ return stress; } + private: - - double scaling; - double damping; - - std::string model; - double radius; - Vector3 period; - - map C6; - map R0; - void init_C6(); - void init_R0(); - void C6_input(const std::string &file, const std::string &unit); - void R0_input(const std::string &file, const std::string &unit); const UnitCell_pseudo &ucell; + Vdwd2_Parameters ¶ - bool init_set; - void initset(); - - friend void Input_Conv::Convert(); + double energy = 0; + std::vector> force; + Matrix3 stress; }; -#endif +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_pw/vdwd2-parameters.cpp b/ABACUS.develop/source/src_pw/vdwd2_parameters.cpp similarity index 65% rename from ABACUS.develop/source/src_pw/vdwd2-parameters.cpp rename to ABACUS.develop/source/src_pw/vdwd2_parameters.cpp index 0b8a0ad890..f1598a52fe 100644 --- a/ABACUS.develop/source/src_pw/vdwd2-parameters.cpp +++ b/ABACUS.develop/source/src_pw/vdwd2_parameters.cpp @@ -1,193 +1,257 @@ -//========================================================== -// AUTHOR, Peize Lin -// DATE , 2014-03-31 -// UPDATE , 2019-04-26 -//========================================================== - -#include"vdwd2.h" - -void Vdwd2::init_C6() -{ - C6 = - { - {"H", 0.14 }, - {"He", 0.08 }, - {"Li", 1.61 }, - {"Be", 1.61 }, - {"B", 3.13 }, - {"C", 1.75 }, - {"N", 1.23 }, - {"O", 0.70 }, - {"F", 0.75 }, - {"Ne", 0.63 }, - {"Na", 5.71 }, - {"Mg", 5.71 }, - {"Al", 10.79 }, - {"Si", 9.23 }, - {"P", 7.84 }, - {"S", 5.57 }, - {"Cl", 5.07 }, - {"Ar", 4.61 }, - {"K", 10.8 }, - {"Ca", 10.8 }, - {"Sc", 10.8 }, - {"Ti", 10.8 }, - {"V", 10.8 }, - {"Cr", 10.8 }, - {"Mn", 10.8 }, - {"Fe", 10.8 }, - {"Co", 10.8 }, - {"Ni", 10.8 }, - {"Cu", 10.8 }, - {"Zn", 10.8 }, - {"Ga", 16.99 }, - {"Ge", 17.10 }, - {"As", 16.37 }, - {"Se", 12.64 }, - {"Br", 12.47 }, - {"Kr", 12.01 }, - {"Rb", 24.67 }, - {"Sr", 24.67 }, - {"Y", 24.67 }, - {"Zr", 24.67 }, - {"Nb", 24.67 }, - {"Mo", 24.67 }, - {"Tc", 24.67 }, - {"Ru", 24.67 }, - {"Rh", 24.67 }, - {"Pd", 24.67 }, - {"Ag", 24.67 }, - {"Cd", 24.67 }, - {"In", 37.32 }, - {"Sn", 38.71 }, - {"Sb", 38.44 }, - {"Te", 31.74 }, - {"I", 31.50 }, - {"Xe", 29.99 }, - {"Cs", 315.275 }, - {"Ba", 226.994 }, - {"La", 176.252 }, - {"Ce", 140.68 }, - {"Pr", 140.68 }, - {"Nd", 140.68 }, - {"Pm", 140.68 }, - {"Sm", 140.68 }, - {"Eu", 140.68 }, - {"Gd", 140.68 }, - {"Tb", 140.68 }, - {"Dy", 140.68 }, - {"Ho", 140.68 }, - {"Er", 140.68 }, - {"Tm", 140.68 }, - {"Yb", 140.68 }, - {"Lu", 140.68 }, - {"Hf", 105.112 }, - {"Ta", 81.24 }, - {"W", 81.24 }, - {"Re", 81.24 }, - {"Os", 81.24 }, - {"Ir", 81.24 }, - {"Pt", 81.24 }, - {"Au", 81.24 }, - {"Hg", 57.364 }, - {"Tl", 57.254 }, - {"Pb", 63.162 }, - {"Bi", 63.540 }, - {"Po", 55.283 }, - {"At", 57.171 }, - {"Rn", 56.64 } - }; -} - -void Vdwd2::init_R0() -{ - R0 = - { - {"H", 1.001 }, - {"He", 1.012 }, - {"Li", 0.825 }, - {"Be", 1.408 }, - {"B", 1.485 }, - {"C", 1.452 }, - {"N", 1.397 }, - {"O", 1.342 }, - {"F", 1.287 }, - {"Ne", 1.243 }, - {"Na", 1.144 }, - {"Mg", 1.364 }, - {"Al", 1.639 }, - {"Si", 1.716 }, - {"P", 1.705 }, - {"S", 1.683 }, - {"Cl", 1.639 }, - {"Ar", 1.595 }, - {"K", 1.485 }, - {"Ca", 1.474 }, - {"Sc", 1.562 }, - {"Ti", 1.562 }, - {"V", 1.562 }, - {"Cr", 1.562 }, - {"Mn", 1.562 }, - {"Fe", 1.562 }, - {"Co", 1.562 }, - {"Ni", 1.562 }, - {"Cu", 1.562 }, - {"Zn", 1.562 }, - {"Ga", 1.65 }, - {"Ge", 1.727 }, - {"As", 1.76 }, - {"Se", 1.771 }, - {"Br", 1.749 }, - {"Kr", 1.727 }, - {"Rb", 1.628 }, - {"Sr", 1.606 }, - {"Y", 1.639 }, - {"Zr", 1.639 }, - {"Nb", 1.639 }, - {"Mo", 1.639 }, - {"Tc", 1.639 }, - {"Ru", 1.639 }, - {"Rh", 1.639 }, - {"Pd", 1.639 }, - {"Ag", 1.639 }, - {"Cd", 1.639 }, - {"In", 1.672 }, - {"Sn", 1.804 }, - {"Sb", 1.881 }, - {"Te", 1.892 }, - {"I", 1.892 }, - {"Xe", 1.881 }, - {"Cs", 1.8018 }, - {"Ba", 1.7622 }, - {"La", 1.7204 }, - {"Ce", 1.7534 }, - {"Pr", 1.7534 }, - {"Nd", 1.7534 }, - {"Pm", 1.7534 }, - {"Sm", 1.7534 }, - {"Eu", 1.7534 }, - {"Gd", 1.7534 }, - {"Tb", 1.7534 }, - {"Dy", 1.7534 }, - {"Ho", 1.7534 }, - {"Er", 1.7534 }, - {"Tm", 1.7534 }, - {"Yb", 1.7534 }, - {"Lu", 1.7534 }, - {"Hf", 1.7875 }, - {"Ta", 1.7721 }, - {"W", 1.7721 }, - {"Re", 1.7721 }, - {"Os", 1.7721 }, - {"Ir", 1.7721 }, - {"Pt", 1.7721 }, - {"Au", 1.7721 }, - {"Hg", 1.7578 }, - {"Tl", 1.9855 }, - {"Pb", 1.9437 }, - {"Bi", 1.8975 }, - {"Po", 2.0053 }, - {"At", 1.991 }, - {"Rn", 1.9239 } - }; +//========================================================== +// AUTHOR, Peize Lin +// DATE , 2021-03-09 +//========================================================== + +#include "vdwd2_parameters.h" + +Vdwd2_Parameters::Vdwd2_Parameters() +{ + init_C6(); + init_R0(); +} + + +void Vdwd2_Parameters::initset(const UnitCell_pseudo &ucell) +{ + if(model=="radius") + { + period.x = 2*ceil(radius/ucell.lat0/sqrt(ucell.a1.norm2())) +1; + period.y = 2*ceil(radius/ucell.lat0/sqrt(ucell.a2.norm2())) +1; + period.z = 2*ceil(radius/ucell.lat0/sqrt(ucell.a3.norm2())) +1; + } +} + +void Vdwd2_Parameters::C6_input(const std::string &file, const std::string &unit) +{ + if( file != "default" ) + { + ifstream ifs(file); + if(!ifs) + WARNING_QUIT("Vdwd2::C6_input", "Can not find the file "+TO_STRING(file)); + std::string element; + double value; + while( ifs >> element >> value ) + C6[element]=value; + ifs.close(); + } + for(auto &c6 : C6) + { + if( unit == "Jnm6/mol") + c6.second *= 1e6/(ELECTRONVOLT_SI*NA)/pow(BOHR_TO_A,6)/Ry_to_eV; + else if( unit == "eVA6") + c6.second /= pow(BOHR_TO_A,6)/Ry_to_eV; +// else if( unit == "RyBohr6"); + else + WARNING_QUIT("Input","vdwD2_C6_unit must be Jnm6/mol or eVA6"); + } +} + +void Vdwd2_Parameters::R0_input(const std::string &file, const std::string &unit) +{ + if( file != "default" ) + { + ifstream ifs(file.c_str()); + if(!ifs) + WARNING_QUIT("Vdwd2::R0_input", "Can not find the file "+TO_STRING(file)); + std::string element; + double value; + while( ifs >> element >> value ) + R0[element]=value; + ifs.close(); + } + for(auto &r0 : R0) + { + if( unit == "A") + r0.second/= BOHR_TO_A; + else if( unit == "Bohr") ; + else + WARNING_QUIT("Input","vdwD2_R0_unit must be A or Bohr"); + } +} + +void Vdwd2_Parameters::init_C6() +{ + C6 = + { + {"H", 0.14 }, + {"He", 0.08 }, + {"Li", 1.61 }, + {"Be", 1.61 }, + {"B", 3.13 }, + {"C", 1.75 }, + {"N", 1.23 }, + {"O", 0.70 }, + {"F", 0.75 }, + {"Ne", 0.63 }, + {"Na", 5.71 }, + {"Mg", 5.71 }, + {"Al", 10.79 }, + {"Si", 9.23 }, + {"P", 7.84 }, + {"S", 5.57 }, + {"Cl", 5.07 }, + {"Ar", 4.61 }, + {"K", 10.8 }, + {"Ca", 10.8 }, + {"Sc", 10.8 }, + {"Ti", 10.8 }, + {"V", 10.8 }, + {"Cr", 10.8 }, + {"Mn", 10.8 }, + {"Fe", 10.8 }, + {"Co", 10.8 }, + {"Ni", 10.8 }, + {"Cu", 10.8 }, + {"Zn", 10.8 }, + {"Ga", 16.99 }, + {"Ge", 17.10 }, + {"As", 16.37 }, + {"Se", 12.64 }, + {"Br", 12.47 }, + {"Kr", 12.01 }, + {"Rb", 24.67 }, + {"Sr", 24.67 }, + {"Y", 24.67 }, + {"Zr", 24.67 }, + {"Nb", 24.67 }, + {"Mo", 24.67 }, + {"Tc", 24.67 }, + {"Ru", 24.67 }, + {"Rh", 24.67 }, + {"Pd", 24.67 }, + {"Ag", 24.67 }, + {"Cd", 24.67 }, + {"In", 37.32 }, + {"Sn", 38.71 }, + {"Sb", 38.44 }, + {"Te", 31.74 }, + {"I", 31.50 }, + {"Xe", 29.99 }, + {"Cs", 315.275 }, + {"Ba", 226.994 }, + {"La", 176.252 }, + {"Ce", 140.68 }, + {"Pr", 140.68 }, + {"Nd", 140.68 }, + {"Pm", 140.68 }, + {"Sm", 140.68 }, + {"Eu", 140.68 }, + {"Gd", 140.68 }, + {"Tb", 140.68 }, + {"Dy", 140.68 }, + {"Ho", 140.68 }, + {"Er", 140.68 }, + {"Tm", 140.68 }, + {"Yb", 140.68 }, + {"Lu", 140.68 }, + {"Hf", 105.112 }, + {"Ta", 81.24 }, + {"W", 81.24 }, + {"Re", 81.24 }, + {"Os", 81.24 }, + {"Ir", 81.24 }, + {"Pt", 81.24 }, + {"Au", 81.24 }, + {"Hg", 57.364 }, + {"Tl", 57.254 }, + {"Pb", 63.162 }, + {"Bi", 63.540 }, + {"Po", 55.283 }, + {"At", 57.171 }, + {"Rn", 56.64 } + }; +} + +void Vdwd2_Parameters::init_R0() +{ + R0 = + { + {"H", 1.001 }, + {"He", 1.012 }, + {"Li", 0.825 }, + {"Be", 1.408 }, + {"B", 1.485 }, + {"C", 1.452 }, + {"N", 1.397 }, + {"O", 1.342 }, + {"F", 1.287 }, + {"Ne", 1.243 }, + {"Na", 1.144 }, + {"Mg", 1.364 }, + {"Al", 1.639 }, + {"Si", 1.716 }, + {"P", 1.705 }, + {"S", 1.683 }, + {"Cl", 1.639 }, + {"Ar", 1.595 }, + {"K", 1.485 }, + {"Ca", 1.474 }, + {"Sc", 1.562 }, + {"Ti", 1.562 }, + {"V", 1.562 }, + {"Cr", 1.562 }, + {"Mn", 1.562 }, + {"Fe", 1.562 }, + {"Co", 1.562 }, + {"Ni", 1.562 }, + {"Cu", 1.562 }, + {"Zn", 1.562 }, + {"Ga", 1.65 }, + {"Ge", 1.727 }, + {"As", 1.76 }, + {"Se", 1.771 }, + {"Br", 1.749 }, + {"Kr", 1.727 }, + {"Rb", 1.628 }, + {"Sr", 1.606 }, + {"Y", 1.639 }, + {"Zr", 1.639 }, + {"Nb", 1.639 }, + {"Mo", 1.639 }, + {"Tc", 1.639 }, + {"Ru", 1.639 }, + {"Rh", 1.639 }, + {"Pd", 1.639 }, + {"Ag", 1.639 }, + {"Cd", 1.639 }, + {"In", 1.672 }, + {"Sn", 1.804 }, + {"Sb", 1.881 }, + {"Te", 1.892 }, + {"I", 1.892 }, + {"Xe", 1.881 }, + {"Cs", 1.8018 }, + {"Ba", 1.7622 }, + {"La", 1.7204 }, + {"Ce", 1.7534 }, + {"Pr", 1.7534 }, + {"Nd", 1.7534 }, + {"Pm", 1.7534 }, + {"Sm", 1.7534 }, + {"Eu", 1.7534 }, + {"Gd", 1.7534 }, + {"Tb", 1.7534 }, + {"Dy", 1.7534 }, + {"Ho", 1.7534 }, + {"Er", 1.7534 }, + {"Tm", 1.7534 }, + {"Yb", 1.7534 }, + {"Lu", 1.7534 }, + {"Hf", 1.7875 }, + {"Ta", 1.7721 }, + {"W", 1.7721 }, + {"Re", 1.7721 }, + {"Os", 1.7721 }, + {"Ir", 1.7721 }, + {"Pt", 1.7721 }, + {"Au", 1.7721 }, + {"Hg", 1.7578 }, + {"Tl", 1.9855 }, + {"Pb", 1.9437 }, + {"Bi", 1.8975 }, + {"Po", 2.0053 }, + {"At", 1.991 }, + {"Rn", 1.9239 } + }; } \ No newline at end of file diff --git a/ABACUS.develop/source/src_pw/vdwd2_parameters.h b/ABACUS.develop/source/src_pw/vdwd2_parameters.h new file mode 100644 index 0000000000..4d10e6b46b --- /dev/null +++ b/ABACUS.develop/source/src_pw/vdwd2_parameters.h @@ -0,0 +1,39 @@ +//========================================================== +// AUTHOR: Peize Lin +// DATE: 2021-03-09 +//========================================================== + +#ifndef VDWD2_PARAMETERS_H +#define VDWD2_PARAMETERS_H + +#include +#include +#include "src_global/vector3.h" +#include "src_pw/unitcell_pseudo.h" + +class Vdwd2_Parameters +{ +public: + Vdwd2_Parameters(); + + void init_C6(); + void init_R0(); + void C6_input(const std::string &file, const std::string &unit); + void R0_input(const std::string &file, const std::string &unit); + + bool flag_vdwd2; + + map C6; + map R0; + + double scaling; + double damping; + + std::string model; + double radius; + Vector3 period; + + void initset(const UnitCell_pseudo &ucell); +}; + +#endif // define VDWD2_PARAMETERS_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_pw/vdwd3.cpp b/ABACUS.develop/source/src_pw/vdwd3.cpp index 2426f14033..431d228556 100644 --- a/ABACUS.develop/source/src_pw/vdwd3.cpp +++ b/ABACUS.develop/source/src_pw/vdwd3.cpp @@ -30,7 +30,7 @@ void Vdwd3::atomkind (const UnitCell_pseudo &unitcell) { for (int j=0; j!=element_name.size(); j++) { - if ( unitcell.atoms[i].label == element_name[j] ) + if ( unitcell.atoms[i].psd == element_name[j] ) { atom_kind[i] = j ; break; @@ -210,7 +210,12 @@ double Vdwd3::energy() return energy_result; } -vector< vector > Vdwd3::force(matrix &stress_result, const bool stress_for_vdw) +vector< vector > Vdwd3::force( + const bool force_for_vdw, + const bool stress_for_vdw, + matrix &force_vdw, + matrix &stress_result +) { TITLE("Vdwd3","force"); initset(); @@ -249,9 +254,19 @@ vector< vector > Vdwd3::force(matrix &stress_result, const bool stress_f } for(int ipol=0;ipol<3;ipol++) { - for(int jpol=0;jpol<3;jpol++) + if(stress_for_vdw) { - stress_result(ipol,jpol) = 2*sigma[ipol][jpol]/ucell.omega; + for(int jpol=0;jpol<3;jpol++) + { + stress_result(ipol,jpol) = 2*sigma[ipol][jpol]/ucell.omega; + } + } + if(force_for_vdw) + { + for(int iat=0;iat > force_result; - vector< vector > force(matrix &stress_result, const bool stress_for_vdw); + bool vdwD3; + + double energy_result; + double energy(); + + vector< vector > force_result; + vector< vector > force( + const bool force_for_vdw, + const bool stress_for_vdw, + matrix &force_vdw, + matrix &stress_result + ); private: - //third-order term? - bool abc; - bool noabc; - //R^2 distance neglect threshold (important for speed in case of large systems) (a.u.) - double rthr2; - //R^2 distance to cutoff for CN_calculation (a.u.) - double cn_thr2; - - string model; - - double s6; - double rs6; - double s18; - double alp; - double rs18; - - //energies - double e6; - double e8; - double e10; - double e12; - //3_th energy - double e63; - - - const int max_elem; - //maximum coordination number references per element - const int maxc; - const int nline; - - const UnitCell_pseudo &ucell; - vector atom_kind; - void atomkind(const UnitCell_pseudo &unitcell); - - void XYZ(const UnitCell_pseudo &unitcell,double (*xyz)[3],int *iz); - - //C6 for all element pairs - vector C6_tmp; - void init_C6_tmp(); - double c6ab[3][5][5][94][94]; - //how many different C6 for one element - int mxc[94]; - void init_mxc(); - int limit(int &i); - void loadc6(); - - //lattice in au - double lat[3][3]; - void setlat( const UnitCell_pseudo &unitcell); - - int version; - //void setfuncpar(int &ver); - - //atomic / values - vector r2r4; - void init_r2r4(); - double* add_r2r4; - //covalent radii - vector rcov; - void init_rcov(); - double* add_rcov; - - //cut-off radii for all element pairs - double r0ab[94][94]; - double tau_max[3]; - //repetitions of the unitcell to match the rthr and c_thr - int rep_vdw[3]; - int rep_cn[3]; - - bool init_set; - void initset(); - - //force and stress - double stress[3][3]; - double sigma[3][3]; - double disp; - - friend void Input_Conv::Convert(); + //third-order term? + bool abc; + bool noabc; + //R^2 distance neglect threshold (important for speed in case of large systems) (a.u.) + double rthr2; + //R^2 distance to cutoff for CN_calculation (a.u.) + double cn_thr2; + + string model; + + double s6; + double rs6; + double s18; + double alp; + double rs18; + + //energies + double e6; + double e8; + double e10; + double e12; + //3_th energy + double e63; + + + const int max_elem; + //maximum coordination number references per element + const int maxc; + const int nline; + + const UnitCell_pseudo &ucell; + vector atom_kind; + void atomkind(const UnitCell_pseudo &unitcell); + + void XYZ(const UnitCell_pseudo &unitcell,double (*xyz)[3],int *iz); + + //C6 for all element pairs + vector C6_tmp; + void init_C6_tmp(); + double c6ab[3][5][5][94][94]; + //how many different C6 for one element + int mxc[94]; + void init_mxc(); + int limit(int &i); + void loadc6(); + + //lattice in au + double lat[3][3]; + void setlat( const UnitCell_pseudo &unitcell); + + int version; + //void setfuncpar(int &ver); + + //atomic / values + vector r2r4; + void init_r2r4(); + double* add_r2r4; + //covalent radii + vector rcov; + void init_rcov(); + double* add_rcov; + + //cut-off radii for all element pairs + double r0ab[94][94]; + double tau_max[3]; + //repetitions of the unitcell to match the rthr and c_thr + int rep_vdw[3]; + int rep_cn[3]; + + bool init_set; + void initset(); + + //force and stress + double stress[3][3]; + double sigma[3][3]; + double disp; + + friend void Input_Conv::Convert(); }; #endif - diff --git a/ABACUS.develop/source/src_pw/vdwd3-parameters.cpp b/ABACUS.develop/source/src_pw/vdwd3_parameters.cpp similarity index 100% rename from ABACUS.develop/source/src_pw/vdwd3-parameters.cpp rename to ABACUS.develop/source/src_pw/vdwd3_parameters.cpp diff --git a/ABACUS.develop/source/src_pw/wan_global.cpp b/ABACUS.develop/source/src_pw/wan_global.cpp deleted file mode 100644 index c03692f41b..0000000000 --- a/ABACUS.develop/source/src_pw/wan_global.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//#include "wannier.h" -#include "winput.h" -//#include "operation.h" -//#include "setout.h" -//#include "efficient.h" -//#include "build.h" -//#include "spheri.h" -//#include "recons.h" -//#include "improve_pao.h" - -//#include "quality.h" -//#include "eximport.h" -//#include "compare.h" - -//operation op; -//setout st; - -//quality ql; -//eximport ei; -//efficient eff; diff --git a/ABACUS.develop/source/src_pw/wan_global.h b/ABACUS.develop/source/src_pw/wan_global.h deleted file mode 100644 index fb475aec9f..0000000000 --- a/ABACUS.develop/source/src_pw/wan_global.h +++ /dev/null @@ -1,38 +0,0 @@ -//========================================================== -#ifndef WAN_GLOBAL_H -#define WAN_GLOBAL_H -//part 1 -//#include "wannier.h" -#include "winput.h" -//#include "operation.h" -//#include "setout.h" -//#include "efficient.h" -//#include "build.h" -//#include "geometry.h" -//#include "spheri.h" -//#include "improve_pao.h" -//part 2 -//#include "quality.h" -//#include "eximport.h" -//#include "figure.h" -//#include "compare.h" - -//part5 -#include "global.h" -#include "../src_parallel/parallel_global.h" -//part 6 -#include "tools.h" -//part 7 -#include "../input.h" - -//#include "recons.h" -//#include "truncate.h" - -//extern operation op; -//extern setout st; - -//extern quality ql; -//extern eximport ei; -//extern efficient eff; - -#endif diff --git a/ABACUS.develop/source/src_pw/wavefunc.cpp b/ABACUS.develop/source/src_pw/wavefunc.cpp index 7279f0f0f1..c342ecf30d 100644 --- a/ABACUS.develop/source/src_pw/wavefunc.cpp +++ b/ABACUS.develop/source/src_pw/wavefunc.cpp @@ -1,13 +1,8 @@ #include "wavefunc.h" #include "global.h" -#include "algorithms.h" #include "../src_pw/wavefunc_in_pw.h" -//xiaohui add 2013 -08-01 -#include "winput.h" -#include "chi0_hilbert.h" -#ifdef __FP -//#include "../src_develop/src_wannier/manipulation.h" -#endif +#include "src_io/winput.h" +#include "src_io/chi0_hilbert.h" wavefunc::wavefunc() { @@ -32,14 +27,12 @@ wavefunc::~wavefunc() } } -#ifdef __FP -void wavefunc::init_local(void) +void wavefunc::allocate_ekb_wg(const int nks) { TITLE("wavefunc","init_local"); - const int nks = kv.nks; this->npwx = this->setupIndGk(pw, nks); - // mohan add 2009-12-24 + // band energies this->ekb = new double*[nks]; for(int ik=0; ikallocate_ekb = true; - this->wg.create(nks, NBANDS); // the weight of each k point and band + // the weight of each k point and band + this->wg.create(nks, NBANDS); Memory::record("wavefunc","ekb",nks*NBANDS,"double"); Memory::record("wavefunc","wg",nks*NBANDS,"double"); - if(test_wf)ofs_running << " Allocate : EigenValue; Weight;" << endl; return; } -#endif -void wavefunc::init(const int nks) +void wavefunc::allocate(const int nks) { -/*LiuXh modify 20180619 - static bool done_once = false; - if(done_once) - { - return; - } - else - { - done_once = true; - } -LiuXh modify 20180619*/ + TITLE("wavefunc","allocate"); - TITLE("wavefunc","init"); this->npwx = this->setupIndGk(pw, nks); OUT(ofs_running,"npwx",npwx); @@ -79,11 +60,11 @@ LiuXh modify 20180619*/ assert(nks > 0); assert(NBANDS > 0); + // allocate for kinetic energy delete[] g2kin; - this->g2kin = new double[npwx]; // [npw],kinetic energy + this->g2kin = new double[npwx]; ZEROS(g2kin, npwx); Memory::record("wavefunc","g2kin",npwx,"double"); - if(test_wf)OUT(ofs_running,"g2kin allocation","Done"); // if use spin orbital, do not double nks but double allocate evc and wanf2. int prefactor = 1; @@ -97,11 +78,10 @@ LiuXh modify 20180619*/ } this->allocate_ekb = true; - this->wg.create(nks, NBANDS); // the weight of each k point and band + // the weight of each k point and band + this->wg.create(nks, NBANDS); Memory::record("wavefunc","et",nks*NBANDS,"double"); Memory::record("wavefunc","wg",nks*NBANDS,"double"); - if(test_wf)OUT(ofs_running, "et allocation","Done"); - if(test_wf)OUT(ofs_running, "wg allocation","Done"); delete[] evc; delete[] wanf2; @@ -111,20 +91,18 @@ LiuXh modify 20180619*/ if(CALCULATION=="nscf" && wf.mem_saver==1) { // mohan add 2010-09-07 - // only available for first principle now. this->evc = new ComplexMatrix[1]; this->wanf2 = new ComplexMatrix[1]; - evc[0].create(NBANDS, npwx * NPOL);//added by zhengdy-soc -#ifdef __FP - //if(LOCAL_BASIS && LINEAR_SCALING==0) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-02 + // //added by zhengdy-soc + evc[0].create(NBANDS, npwx * NPOL); + + if(BASIS_TYPE=="lcao_in_pw") { wanf2[0].create(NLOCAL, npwx * NPOL); cout << " Memory for wanf2 (MB): " << Memory::record("wavefunc","wanf2",NLOCAL*(prefactor*npwx),"complexmatrix") << endl; } -#endif cout << " MEMORY FOR PSI (MB) : " << Memory::record("wavefunc","evc",NBANDS*(prefactor*npwx),"complexmatrix") << endl; } @@ -138,29 +116,16 @@ LiuXh modify 20180619*/ this->evc[ik].create(NBANDS, npwx * NPOL);//added by zhengdy-soc //Mohan add 2010-1-10 -#ifdef __FP - //xiaohui add 2013 -08-01 - //if (LOCAL_BASIS || winput::out_spillage==2) xiaohui modify 2013-09-02 - if((BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") || winput::out_spillage==2) //xiaohui add 2013-09-02 + if((BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") || winput::out_spillage==2) { this->wanf2[ik].create(NLOCAL, npwx * NPOL);//added by zhengdy-soc } -#endif }; cout << " MEMORY FOR PSI (MB) : " << Memory::record("wavefunc","evc",nks2*NBANDS*(prefactor*npwx),"complexmatrix") << endl; } - if(test_wf) - { - OUT(ofs_running,"evc allocation","Done"); - //if(LOCAL_BASIS) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") //xiaohui add 2013-09-02 - { - OUT(ofs_running,"wanf2 allocation","Done"); - } - } //showMemStats(); return; } @@ -169,13 +134,12 @@ LiuXh modify 20180619*/ // This routine computes an estimate of the start_ wavefunctions // from superposition of atomic wavefunctions or random wave functions. //=================================================================== +#include "occupy.h" void wavefunc::wfcinit(void) { TITLE("wavefunc","wfcinit"); timer::tick("wavefunc","wfcinit",'C'); - - //this->init_at_1(); this->wfcinit_k(); en.demet = 0.0; @@ -183,8 +147,7 @@ void wavefunc::wfcinit(void) //================================ // Occupations are computed here //================================ - //if(LOCAL_BASIS == 0 && LINEAR_SCALING == 0) xiaohui modify 2013-09-02 - if(BASIS_TYPE=="pw") //xiaohui add 2013-09-02 + if(BASIS_TYPE=="pw") { // mohan fix bug 2011-02-25, // in nscf, occupations is not needed, @@ -241,26 +204,16 @@ int wavefunc::get_starting_nw(void)const -// not full test. -void wavefunc::PAO_in_pw_k(const int &ik, ComplexMatrix &wvf) -{ - TITLE("wavefunc","PAO_in_pw_k"); - //assert(LINEAR_SCALING==0); xiaohui modify 2013-09-02 - //assert(LOCAL_BASIS==2); xiaohui modify 2013-09-02. Attention! Here why assert LOCAL_BASIS=2 ??? - - this->atomic_wfc(ik, this->npw, ucell.lmax_ppwf, wvf, ppcell.tab_at, NQX, DQ); -} void wavefunc::LCAO_in_pw_k(const int &ik, ComplexMatrix &wvf) { TITLE("wavefunc","LCAO_in_pw_k"); timer::tick("wavefunc","LCAO_in_pw_k",'G'); -#ifdef __FP - //assert(LOCAL_BASIS==4); xiaohui modify 2013-09-01 - assert(BASIS_TYPE=="lcao_in_pw"); //xiaohui add 2013-09-01. Attention! How about "BASIS_TYPE=="lcao""??? + assert(BASIS_TYPE=="lcao_in_pw"); static bool ltable = false; + if(!ltable) { this->table_local.create(ucell.ntype, ucell.nmax_total, NQX); @@ -273,8 +226,8 @@ void wavefunc::LCAO_in_pw_k(const int &ik, ComplexMatrix &wvf) //------------------------------------------------------------- // (2) diago to get wf.ekb, then the weights can be calculated. //------------------------------------------------------------- - hm.init(); - hm.init_k(ik); + hm.hpw.allocate(this->npwx, NPOL, ppcell.nkb, pw.nrxx); + hm.hpw.init_k(ik); //hm.cinitcgg(ik ,NLOCAL, NBANDS, wvf, wvf, ekb[ik]); // for(int ib=0; ib q) // pengfei 2016-11-23 { - TITLE("wavefunc","LCAO_in_pw_k_q"); - timer::tick("wavefunc","LCAO_in_pw_k_q",'G'); - //assert(LOCAL_BASIS==4); xiaohui modify 2013-09-01 - assert(BASIS_TYPE=="lcao_in_pw"); //xiaohui add 2013-09-01. Attention! How about "BASIS_TYPE=="lcao""??? - -#ifdef __FP + TITLE("wavefunc","LCAO_in_pw_k_q"); + timer::tick("wavefunc","LCAO_in_pw_k_q",'G'); + //assert(LOCAL_BASIS==4); xiaohui modify 2013-09-01 + assert(BASIS_TYPE=="lcao_in_pw"); //xiaohui add 2013-09-01. Attention! How about "BASIS_TYPE=="lcao""??? - Wavefunc_in_pw::produce_local_basis_q_in_pw(ik, wvf, this->table_local, q); + Wavefunc_in_pw::produce_local_basis_q_in_pw(ik, wvf, this->table_local, q); -#endif - timer::tick("wavefunc","LCAO_in_pw_k_q",'G'); - return; + timer::tick("wavefunc","LCAO_in_pw_k_q",'G'); + return; } @@ -310,7 +260,7 @@ void wavefunc::diago_PAO_in_pw_k(const int &ik, ComplexMatrix &wvf) { TITLE("wavefunc","diago_PAO_in_pw_k"); - hm.init_k(ik); + hm.hpw.init_k(ik); this->diago_PAO_in_pw_k2(ik, wvf); return; @@ -378,39 +328,20 @@ void wavefunc::wfcinit_k(void) { TITLE("wavefunc","wfcinit_k"); - if(mem_saver) return; + if(mem_saver) + { + return; + } for(int ik=0; ikLCAO_in_pw_k(ik, wf.wanf2[ik]); } - //else if(LOCAL_BASIS==3) xiaohui modify 2013-09-02. - //{ - // // prepare for Jlq, gauss, slater-type - // // which is anylatic basis. - // WARNING_QUIT("wavefunc::wfcinit_k","not ready for local_basis=3"); - //} xiaohui modify 2013-09-02. Attention... - - //else if(LOCAL_BASIS==2) xiaohui modify 2013-09-02 - //{ - // // prepare for using PAO directly. - // this->PAO_in_pw_k(ik, wf.wanf2[ik]); - // WARNING_QUIT("wavefunc::wfcinit_k","not ready for local_basis=2"); - //} xiaohui modify 2013-09-02. Attention... - - //else if(LOCAL_BASIS==1) xiaohui modify 2013-09-02 - //{ - // // prepare for wannier functions. - // WARNING_QUIT("wavefunc::wfcinit_k","not ready for local_basis=1"); - //} xiaohui modify 2013-09-02. Attention... - - //else if(LOCAL_BASIS==0) xiaohui modify 2013-09-02 - else if (BASIS_TYPE=="pw") //xiaohui add 2013-09-02 + else if (BASIS_TYPE=="pw") { // get the wave functions // by first diagolize PAO @@ -418,33 +349,10 @@ void wavefunc::wfcinit_k(void) this->diago_PAO_in_pw_k(ik, wf.evc[ik]); } } + //--------------------------------------------------- // calculte the overlap //--------------------------------------------------- - /*cout <<"epsilon = "< gkqg, Rcar[NLOCAL][NLOCAL][NR]; // k+G+qg, Rcartesian for(int iw1=0;iw1 phase; + double arg; + complex phase; for(int iq=0; iqLCAO_in_pw_k_q(ik, Mat, qg); for(int iw=0; iw( cos(arg), -sin(arg) ); - overlap_aux[iw1][iw2][g][ir] += conj(wf.wanf2[ik](iw1,ig)) * wanf2_q[ik][iw2][ig] * phase/kv.nks; + overlap_aux[iw1][iw2][g][ir] += conj(wf.wanf2[ik](iw1,ig)) + * wanf2_q[ik][iw2][ig] * phase/static_cast(kv.nks); + // Peize Lin add static_cast 2018-07-14 } } - + } } + } } for(int g=0; g( overlap_R[iw1][iw2][g][ir], overlap_I[iw1][iw2][g][ir]); + overlap[iw1][iw2][g][ir] = complex( overlap_R[iw1][iw2][g][ir], + overlap_I[iw1][iw2][g][ir]); } + } + } + } //------------------------------ // store the overlap in q_(iq) @@ -612,6 +566,7 @@ void wavefunc::wfcinit_k(void) for(int g=0; g r,r1,r2; - + for(int iw1=0; iw1evc[ik].create(NBANDS*prefactor, npwx); -#ifdef __FP if((BASIS_TYPE=="lcao" || BASIS_TYPE=="lcao_in_pw") || winput::out_spillage==2) { this->wanf2[ik].create(NLOCAL, npwx); } -#endif } cout << " MEMORY FOR PSI (MB) : " << diff --git a/ABACUS.develop/source/src_pw/wavefunc.h b/ABACUS.develop/source/src_pw/wavefunc.h index 73eca11a20..5bc4c858b0 100644 --- a/ABACUS.develop/source/src_pw/wavefunc.h +++ b/ABACUS.develop/source/src_pw/wavefunc.h @@ -1,8 +1,3 @@ -//========================================================== -// AUTHOR : Lixin He, Mohan Chen -// DATE : 2008-11-13 -// LAST UPDATE : 2009-03-17 add out_wf -//========================================================== #ifndef WAVEFUNC_H #define WAVEFUNC_H @@ -12,16 +7,15 @@ class wavefunc : public WF_atomic { public: + wavefunc(); ~wavefunc(); // allocate memory - void init(const int nks); -#ifdef __FP - void init_local(void); -#endif + void allocate(const int nks); + void allocate_ekb_wg(const int nks); - bool out_wf; + int out_wf; //qianrui modify 2020-10-19 // et : (nks,nbnd),eigenvalues of the hamiltonian // wg : the weight of each k point and band @@ -37,30 +31,32 @@ class wavefunc : public WF_atomic int get_starting_nw(void)const; // wanf2: save PAO orbitals, - void PAO_in_pw_k(const int &ik, ComplexMatrix &wvf); + //void PAO_in_pw_k(const int &ik, ComplexMatrix &wvf); // wanf2: save given localized orbitals. void LCAO_in_pw_k(const int &ik, ComplexMatrix &wvf); - void LCAO_in_pw_k_q(const int &ik, ComplexMatrix &wvf, Vector3 q); // pengfei 2016-11-23 + void LCAO_in_pw_k_q(const int &ik, ComplexMatrix &wvf, Vector3 q); // pengfei 2016-11-23 // evc: get the initial wave functions from diagnalized the PAO // orbitals first. void diago_PAO_in_pw_k(const int &ik, ComplexMatrix &wvf); + // used if k dependent staff is ready. void prepare_k(void); + void diago_PAO_in_pw_k2(const int &ik, ComplexMatrix &wvf); - int get_R(int ix, int iy, int iz); // pengfei 2016-11-23 - int iw2it( int iw); - int iw2ia( int iw); - void init_after_vc(const int nks); //LiuXh 20180515 + int get_R(int ix, int iy, int iz); // pengfei 2016-11-23 - private: // pengfei 2016-11-23 + int iw2it( int iw); + int iw2ia( int iw); - Vector3 ***R; - int ** Rmax; + void init_after_vc(const int nks); //LiuXh 20180515 + private: // pengfei 2016-11-23 + Vector3 ***R; + int ** Rmax; }; #endif //wavefunc diff --git a/ABACUS.develop/source/src_pw/wavefunc_in_pw.cpp b/ABACUS.develop/source/src_pw/wavefunc_in_pw.cpp index e8aeea9b7c..eda6a710f7 100644 --- a/ABACUS.develop/source/src_pw/wavefunc_in_pw.cpp +++ b/ABACUS.develop/source/src_pw/wavefunc_in_pw.cpp @@ -310,26 +310,26 @@ void Wavefunc_in_pw::produce_local_basis_in_pw(const int &ik,ComplexMatrix &psi, {//atomic_wfc_so_mag double alpha, gamma; complex fup,fdown; - //int nc; - //This routine creates two functions only in the case j=l+1/2 or exit in the other case + //int nc; + //This routine creates two functions only in the case j=l+1/2 or exit in the other case if(fabs(j-L+0.5<1e-4)) continue; delete[] chiaux; chiaux = new double [npw]; - //Find the functions j= l- 1/2 + //Find the functions j= l- 1/2 if(L==0) for(int ig=0;igucell.natomwfc) WARNING_QUIT("wf.atomic_wfc()","error: too many wfcs"); - for(int ig = 0;ig fup, fdown; - alpha = soc.angle1[it]; - gamman = -soc.angle2[it] + 0.5*PI; - for(int m = 0;m<2*L+1;m++) - { - const int lm = L*L +m; - if(iwall+2*L+1>ucell.natomwfc) WARNING_QUIT("wf.atomic_wfc()","error: too many wfcs"); - for(int ig = 0;igucell.natomwfc) WARNING_QUIT("wf.atomic_wfc()","error: too many wfcs"); + for(int ig = 0;ig fup, fdown; + alpha = soc.angle1[it]; + gamman = -soc.angle2[it] + 0.5*PI; + for(int m = 0;m<2*L+1;m++) + { + const int lm = L*L +m; + if(iwall+2*L+1>ucell.natomwfc) WARNING_QUIT("wf.atomic_wfc()","error: too many wfcs"); + for(int ig = 0;ig ((NQX-4) * DQ) ) - { - flq[ig] = 0.0; - } - else - { + if(gkq[ig].norm() * ucell.tpiba > ((NQX-4) * DQ) ) + { + flq[ig] = 0.0; + } + else + { flq[ig] = Mathzone::Polynomial_Interpolation(table_local, it, ic, NQX, DQ, gkq[ig].norm() * ucell.tpiba ); - } + } } @@ -625,17 +624,16 @@ void Wavefunc_in_pw::produce_local_basis_q_in_pw(const int &ik, ComplexMatrix &p }//end is_N }//end if else{//LSDA and nomagnet case - - for(int m=0; m<2*L+1; m++) - { - const int lm = L*L+m; - for(int ig=0; ig WF_igk::get_1qvec_cartesian(const int ik,const int ig)const { Vector3 qvec = kv.kvec_c[ik] + pw.gcar[ this->igk(ik, ig) ]; @@ -163,6 +162,7 @@ Vector3 WF_igk::get_1qvec_cartesian(const int ik,const int ig)const return qvec; } + double* WF_igk::get_qvec_cartesian(const int &ik) { double *qmod = new double[ kv.ngk[ik] ]; @@ -177,6 +177,7 @@ double* WF_igk::get_qvec_cartesian(const int &ik) return qmod; } + complex* WF_igk::get_sk(const int ik, const int it, const int ia)const { timer::tick("WF_igk","get_sk"); @@ -196,6 +197,7 @@ complex* WF_igk::get_sk(const int ik, const int it, const int ia)const return sk; } + complex* WF_igk::get_skq(int ik, const int it, const int ia, Vector3 q) //pengfei 2016-11-23 { complex *skq = new complex[ kv.ngk[ik] ]; diff --git a/ABACUS.develop/source/src_pw/wf_igk.h b/ABACUS.develop/source/src_pw/wf_igk.h index e2cd38c638..420a367d02 100644 --- a/ABACUS.develop/source/src_pw/wf_igk.h +++ b/ABACUS.develop/source/src_pw/wf_igk.h @@ -7,24 +7,38 @@ class WF_igk { public: + WF_igk(); ~WF_igk(); - // for each k point , find the number of pws - int setupIndGk(const PW_Basis &pwb,const int nks); - - // g2kin : [npw],kinetic energy for current k point + //--------------------------------------------------- + // npwx: max npw + // npw + // igk: [nks, npw_max] + // g2kin: [npwx],kinetic energy for current k point + //--------------------------------------------------- int npwx; int npw; IntArray igk; double *g2kin; + public: + + // for each k point , find the number of pws + int setupIndGk(const PW_Basis &pwb,const int nks); + + // Calculate kinetic energy void ekin(const int ik); + double* get_qvec_cartesian(const int &ik); + Vector3 get_1qvec_cartesian(const int ik,const int ig)const; + complex* get_sk(const int ik, const int it, const int ia)const; - complex* get_skq(int ik, int it, int ia, Vector3 q); // pengfei 2016-11-23 + + // pengfei 2016-11-23 + complex* get_skq(int ik, int it, int ia, Vector3 q); }; #endif diff --git a/ABACUS.develop/source/src_pw/wf_io.cpp b/ABACUS.develop/source/src_pw/wf_io.cpp deleted file mode 100644 index 448e3ca385..0000000000 --- a/ABACUS.develop/source/src_pw/wf_io.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include "wf_io.h" -#include "../src_pw/global.h" -//#include "../../src_develop/src_wannier/eximport.h" - -void WF_io::write_wfc(const string &fn, const ComplexMatrix *psi) -{ - if (test_wf) TITLE("WF_io","write_wfc"); - - ofstream ofs( fn.c_str() ); - - //eximport exi; - //exi.out_input(ofs); - //exi.out_kpoints(ofs); - //exi.out_igk(ofs); - //exi.out_planewave(ofs); - - ofs << "\n"; - ofs << "\n" << NBANDS << " Number of bands." << endl; - ofs << setprecision(6); - for (int i=0; i"; - - ofs.close(); - return; -} - -void WF_io::write_wfc2(const string &fn, const ComplexMatrix *psi) -{ - if (test_wf) TITLE("WF_io","write_wfc2"); - - ofstream ofs( fn.c_str() ); - - if(MY_RANK==0) - { - ofs.precision(10); - ofs << ucell.lat0 << endl; - - ofs << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; - ofs << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; - ofs << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; - - ofs << ucell.ntype << " ntype" << endl; - for (int it=0; it"; - } - - // (2) - for (int ik=0; ik" << endl; - ofs.close(); - } - - // out put the wave functions in plane wave basis. - for(int ip=0; ip XC_Functional::XC_Functional(){} diff --git a/ABACUS.develop/source/src_pw/gga_pw.cpp b/ABACUS.develop/source/src_pw/xc_gga_pw.cpp similarity index 87% rename from ABACUS.develop/source/src_pw/gga_pw.cpp rename to ABACUS.develop/source/src_pw/xc_gga_pw.cpp index 78be85f822..9b850ef0af 100644 --- a/ABACUS.develop/source/src_pw/gga_pw.cpp +++ b/ABACUS.develop/source/src_pw/xc_gga_pw.cpp @@ -1,4 +1,4 @@ -#include "gga_pw.h" +#include "xc_gga_pw.h" #include "global.h" #include "xc_functional.h" #include "../src_pw/myfunc.h" @@ -6,7 +6,7 @@ // from gradcorr.f90 void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) { - TITLE("GGA::gradcorr"); + TITLE("GGA_PW","gradcorr"); if (xcf.igcx_now == 0 && xcf.igcc_now == 0) { @@ -31,12 +31,12 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) const double fac = 1.0/ nspin0; // doing FFT to get rho in G space: rhog1 - chr.set_rhog(chr.rho[0], chr.rhog[0]); + CHR.set_rhog(CHR.rho[0], CHR.rhog[0]); if(NSPIN==2)//mohan fix bug 2012-05-28 { - chr.set_rhog(chr.rho[1], chr.rhog[1]); + CHR.set_rhog(CHR.rho[1], CHR.rhog[1]); } - chr.set_rhog(chr.rho_core, chr.rhog_core); + CHR.set_rhog(CHR.rho_core, CHR.rhog_core); // sum up (rho_core+rho) for each spin in real space // and reciprocal space. @@ -58,8 +58,8 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) rhogsum1 = new complex[pw.ngmc]; ZEROS(rhotmp1, pw.nrxx); ZEROS(rhogsum1, pw.ngmc); - for(int ir=0; ir[pw.nrxx]; h1 = new Vector3[pw.nrxx]; @@ -74,8 +74,8 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) rhogsum2 = new complex[pw.ngmc]; ZEROS(rhotmp2, pw.nrxx); ZEROS(rhogsum2, pw.ngmc); - for(int ir=0; ir[pw.nrxx]; h2 = new Vector3[pw.nrxx]; @@ -106,17 +106,17 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) rhogsum2 = new complex[pw.ngmc]; ZEROS(rhogsum2, pw.ngmc); - chr.set_rhog(rhotmp1, rhogsum1); - chr.set_rhog(rhotmp2, rhogsum2); + CHR.set_rhog(rhotmp1, rhogsum1); + CHR.set_rhog(rhotmp2, rhogsum2); for(int ir=0; ir[pw.nrxx]; @@ -186,7 +186,7 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) if( rhotmp1[ir] < 0.0 ) segno = -1.0; XC_Functional::gcxc( arho, grho2a, sx, sc, v1x, v2x, v1c, v2c); - + // first term of the gradient correction: // D(rho*Exc)/D(rho) v(0, ir) += e2 * ( v1x + v1c ); @@ -195,7 +195,7 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) // D(rho*Exc) / D(|grad rho|) * (grad rho) / |grad rho| h1[ir] = e2 * ( v2x + v2c ) * gdr1[ir]; - vtxcgc += e2*( v1x + v1c ) * ( rhotmp1[ir] - chr.rho_core[ir] ); + vtxcgc += e2*( v1x + v1c ) * ( rhotmp1[ir] - CHR.rho_core[ir] ); etxcgc += e2*( sx + sc ) * segno; } } // end arho > epsr @@ -251,7 +251,6 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) v2cud = 0.0; } - // first term of the gradient correction : D(rho*Exc)/D(rho) v(0,ir) = v(0,ir) + e2 * ( v1xup + v1cup ); v(1,ir) = v(1,ir) + e2 * ( v1xdw + v1cdw ); @@ -262,8 +261,8 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) h1[ir] = e2 * ( ( v2xup + v2cup ) * gdr1[ir] + v2cud * gdr2[ir] ); h2[ir] = e2 * ( ( v2xdw + v2cdw ) * gdr2[ir] + v2cud * gdr1[ir] ); - vtxcgc = vtxcgc + e2 * ( v1xup + v1cup ) * ( rhotmp1[ir] - chr.rho_core[ir] * fac ); - vtxcgc = vtxcgc + e2 * ( v1xdw + v1cdw ) * ( rhotmp2[ir] - chr.rho_core[ir] * fac ); + vtxcgc = vtxcgc + e2 * ( v1xup + v1cup ) * ( rhotmp1[ir] - CHR.rho_core[ir] * fac ); + vtxcgc = vtxcgc + e2 * ( v1xdw + v1cdw ) * ( rhotmp2[ir] - CHR.rho_core[ir] * fac ); etxcgc = etxcgc + e2 * ( sx + sc ); @@ -274,8 +273,8 @@ void GGA_PW::gradcorr(double &etxc, double &vtxc, matrix &v) //cout << "\n vtxcgc=" << vtxcgc; //cout << "\n etxcgc=" << etxcgc << endl; - for(int ir=0; ir1e-12) { for(int i=1;i<4;i++) - v(i,ir)+= neg[ir] * 0.5 *(vgg[0][ir]-vgg[1][ir])*chr.rho[i][ir]/amag; + v(i,ir)+= neg[ir] * 0.5 *(vgg[0][ir]-vgg[1][ir])*CHR.rho[i][ir]/amag; } } } @@ -461,15 +459,15 @@ void GGA_PW::noncolin_rho(double *rhoout1,double *rhoout2, double *neg) { for(int ir = 0;ir0) neg[ir] = 1.0; + if(CHR.rho[1][ir]*soc.ux[0] + CHR.rho[2][ir]*soc.ux[1] + CHR.rho[3][ir]*soc.ux[2]>0) neg[ir] = 1.0; else neg[ir] = -1.0; } } for(int ir = 0;ir *rhog, Vector3 *gdr ); void grad_dot( const Vector3 *h, double *dh); void noncolin_rho(double *rhoout1,double *rhoout2,double *seg); - } #endif diff --git a/ABACUS.develop/source/src_pw/functional.cpp b/ABACUS.develop/source/src_pw/xc_type.cpp similarity index 90% rename from ABACUS.develop/source/src_pw/functional.cpp rename to ABACUS.develop/source/src_pw/xc_type.cpp index b1311192a4..0299cc1877 100644 --- a/ABACUS.develop/source/src_pw/functional.cpp +++ b/ABACUS.develop/source/src_pw/xc_type.cpp @@ -2,7 +2,10 @@ // AUTHOR : Lixin He ,mohan // DATE : 2008-11-08 //========================================================== -#include "functional.h" +#include "xc_type.h" +#include "src_global/global_function.h" +#include "src_pw/global.h" +#include "src_pw/exx_global.h" xcfunc::xcfunc() { @@ -211,6 +214,8 @@ void xcfunc::which_dft(const string *dft) // WRITE( stdout,'(a)') dftout copy_to_now(); + + hybrid_first(); return; } // end subroutine which_dft @@ -277,4 +282,26 @@ void xcfunc::copy_to_now() icorr_now = icorr; igcx_now = igcx ; igcc_now = igcc ; -} \ No newline at end of file +} + +// Peize Lin add 2016-12-03 +void xcfunc::hybrid_first() +{ + // may do something + WARNING("functional","file "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)+" may error "); + if(Exx_Global::Hybrid_Type::HF==exx_global.info.hybrid_type) + { + iexch_now = 1; + igcx_now = 3; + } + else if(Exx_Global::Hybrid_Type::PBE0==exx_global.info.hybrid_type) + { + iexch_now = 1; + igcx_now = 3; + } + else if(Exx_Global::Hybrid_Type::HSE==exx_global.info.hybrid_type) + { + iexch_now = 1; + igcx_now = 3; + } +} diff --git a/ABACUS.develop/source/src_pw/functional.h b/ABACUS.develop/source/src_pw/xc_type.h similarity index 67% rename from ABACUS.develop/source/src_pw/functional.h rename to ABACUS.develop/source/src_pw/xc_type.h index b5b5f14e17..8299aa1dcc 100644 --- a/ABACUS.develop/source/src_pw/functional.h +++ b/ABACUS.develop/source/src_pw/xc_type.h @@ -8,7 +8,9 @@ #include "tools.h" class xcfunc { -public: + + public: + //module funct // char dft[20]; // dft is the exchange-correlation functional, described by @@ -22,6 +24,9 @@ class xcfunc // "oep" Optimized Effective Potential iexch=4 // "hf" Hartree-Fock iexch=5 // "pb0x" PBE0 iexch=6 + // "b3lpx" B3LYP iexch=7 + // "kzk" Finite-size corrections iexch=8 + // "hsex" HSE06 iexch=9 // // Correlation: "noc" none icorr=0 // "pz" Perdew-Zunger icorr=1 (default) @@ -44,6 +49,10 @@ class xcfunc // "optx" Handy's exchange functional igcx =6 // "meta" meta-gga igcx =7 // "pb0x" PBE0 igcx =8 + // "b3lp" B3LYP igcx =9 + // "psx" PBEsol exchange igcx =10 + // "wcx" Wu-Cohen igcx =11 + // "hsex" HSE06 igcx =12 // // Gradient Correction on Correlation: // "nogc" none igcc =0 (default) @@ -55,20 +64,27 @@ class xcfunc // "meta" meta-gga igcc =6 // // Special cases: - // "bp" = "b88+p86" = Becke-Perdew grad.corr. - // "pw91" = "pw +ggx+ggc" = PW91 (aka GGA) - // "blyp" = "sla+b88+lyp+blyp"= BLYP - // "pbe" = "sla+pw+pbx+pbc" = PBE - // "revpbe"="sla+pw+rpb+pbc" = revPBE (Zhang-Yang) - // "hcth" = "nox+noc+hcth+hcth"=HCTH/120 - // "olyp" = "nox+lyp+optx+blyp" ////// UNTESTED ////// - + // "bp" = "b88+p86" = Becke-Perdew grad.corr. + // "pw91" = "pw +ggx+ggc" = PW91 (aka GGA) + // "blyp" = "sla+b88+lyp+blyp" = BLYP + // "pbe" = "sla+pw+pbx+pbc" = PBE + // "revpbe"= "sla+pw+rpb+pbc" = revPBE (Zhang-Yang) + // "pbesol"= "sla+pw+psx+psc" = PBEsol + // "hcth" = "nox+noc+hcth+hcth" = HCTH/120 + // "olyp" = "nox+lyp+optx+blyp"!!! UNTESTED !!! + // "tpss" = "sla+pw+meta+meta" = TPSS Meta-GGA + // "wc" = "sla+pw+wcx+pbc" = Wu-Cohen + // "pbe0" = "pb0x+pw+pb0x+pbc" = PBE0 + // "b3lyp" = "b3lp+vwn+b3lp+b3lp"= B3LYP + // "hse" = "hsex+pw+hsex+pbc" = HSE + + // References: // pz J.P.Perdew and A.Zunger, PRB 23, 5048 (1981) // vwn S.H.Vosko, L.Wilk, M.Nusair, Can.J.Phys. 58,1200(1980) - // wig E.P.Wigner, Trans. Faraday Soc. 34, 67 (1938) - // hl L.Hedin and B.I.Lundqvist, J. Phys. C4, 2064 (1971) - // gl O.Gunnarsson and B.I.Lundqvist, PRB 13, 4274 (1976) + // wig E.P.Wigner, Trans. Faraday Soc. 34, 67 (1938) + // hl L.Hedin and B.I.Lundqvist, J. Phys. C4, 2064 (1971) + // gl O.Gunnarsson and B.I.Lundqvist, PRB 13, 4274 (1976) // pw J.P.Perdew and Y.Wang, PRB 45, 13244 (1992) // obpz G.Ortiz and P.Ballone, PRB 50, 1391 (1994) // obpw as above @@ -76,10 +92,17 @@ class xcfunc // p86 J.P.Perdew, PRB 33, 8822 (1986) // pbe J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996) // pw91 J.P.Perdew and Y. Wang, PRB 46, 6671 (1992) - // blyp C.Lee, W.Yang, R.G.Parr, PRB 37, 785 (1988) + // blyp C.Lee, W.Yang, R.G.Parr, PRB 37, 785 (1988) // hcth Handy et al, JCP 109, 6264 (1998) // olyp Handy et al, JCP 116, 5411 (2002) // revPBE Zhang and Yang, PRL 80, 890 (1998) + // meta J.Tao, J.P.Perdew, V.N.Staroverov, G.E. Scuseria,PRL 91, 146401 (2003) + // kzk H.Kwee, S. Zhang, H. Krakauer, PRL 100, 126404 (2008) + // pbe0 J.P.Perdew, M. Ernzerhof, K.Burke, JCP 105, 9982 (1996) + // b3lyp P.J. Stephens,F.J. Devlin,C.F. Chabalowski,M.J. Frisch J.Phys.Chem 98, 11623 (1994) + // pbesol J.P. Perdew et al., PRL 100, 136406 (2008) + // wc Z. Wu and R. E. Cohen, PRB 73, 235116 (2006) + // hse Paier J, Marsman M, Hummer K, et al, JPC 124(15): 154709 (2006) int iexch; int icorr; @@ -109,6 +132,7 @@ class xcfunc void set_dft_value(int &m,const int i); bool match_one(const string* dft, const string &name)const; void copy_to_now(); // Peize Lin add 2016-12-03 + void hybrid_first(); // Peize Lin add 2016-12-03 }; #endif //FUNCTION_H diff --git a/ABACUS.develop/source/src_ri/abfs-template.h b/ABACUS.develop/source/src_ri/abfs-template.h new file mode 100644 index 0000000000..2c644c8624 --- /dev/null +++ b/ABACUS.develop/source/src_ri/abfs-template.h @@ -0,0 +1,113 @@ +#ifndef ABFS_TEMPLATE_H +#define ABFS_TEMPLATE_H + +#include "abfs.h" + +template +void Abfs::delete_empty_ptrs( map>>> &ptrs ) +{ + TITLE("Abfs","delete_empty_ptrs"); + for( auto iter1=ptrs.begin(); iter1!=ptrs.end(); ) + { + for( auto iter2=iter1->second.begin(); iter2!=iter1->second.end(); ) + { + for( auto iter3=iter2->second.begin(); iter3!=iter2->second.end(); ) + { + if( iter3->second.expired() ) iter2->second.erase(iter3++); + else ++iter3; + } + if( iter2->second.empty() ) iter1->second.erase(iter2++); + else ++iter2; + } + if( iter1->second.empty() ) ptrs.erase(iter1++); + else ++iter1; + } +} + +template +void Abfs::delete_threshold_ptrs( map &ptrs, const double threshold ) +{ + for( auto iter=ptrs.begin(); iter!=ptrs.end(); ) + { + if( iter->second.absmax()<=threshold ) ptrs.erase(iter++); + else ++iter; + } +} + +template +void Abfs::delete_threshold_ptrs( map> &ptrs, const double threshold ) +{ + for( auto iter=ptrs.begin(); iter!=ptrs.end(); ) + { + if( iter->second->absmax()<=threshold ) ptrs.erase(iter++); + else ++iter; + } +} + + +template +void Abfs::delete_threshold_ptrs( map> &ptrs, const double threshold ) +{ + for( auto iter=ptrs.begin(); iter!=ptrs.end(); ) + { + delete_threshold_ptrs(iter->second, threshold); + if( iter->second.empty() ) ptrs.erase(iter++); + else ++iter; + } +} + +/* +template +void Abfs::delete_threshold_ptrs( map>>> &ptrs, const double threshold) +{ + TITLE("Abfs","delete_threshold_ptrs"); + for( auto iter1=ptrs.begin(); iter1!=ptrs.end(); ) + { + for( auto iter2=iter1->second.begin(); iter2!=iter1->second.end(); ) + { + for( auto iter3=iter2->second.begin(); iter3!=iter2->second.end(); ) + { + if( iter3->second->absmax()<=threshold ) iter2->second.erase(iter3++); + else ++iter3; + } + if( iter2->second.empty() ) iter1->second.erase(iter2++); + else ++iter2; + } + if( iter1->second.empty() ) ptrs.erase(iter1++); + else ++iter1; + } +} + +template +void Abfs::delete_threshold_ptrs( map>> &ptrs, const double threshold) +{ + TITLE("Abfs","delete_threshold_ptrs"); + for( auto iter1=ptrs.begin(); iter1!=ptrs.end(); ) + { + for( auto iter2=iter1->second.begin(); iter2!=iter1->second.end(); ) + { + for( auto iter3=iter2->second.begin(); iter3!=iter2->second.end(); ) + { + if( iter3->second.absmax()<=threshold ) iter2->second.erase(iter3++); + else ++iter3; + } + if( iter2->second.empty() ) iter1->second.erase(iter2++); + else ++iter2; + } + if( iter1->second.empty() ) ptrs.erase(iter1++); + else ++iter1; + } +} +*/ + +template +vector> Abfs::get_atom_pair(const map> &m) +{ + vector> atom_pairs; + for(const auto &mA : m) + for(const auto &mB : mA.second) + atom_pairs.push_back({mA.first,mB.first}); + return atom_pairs; +} + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/abfs-vector3_order.cpp b/ABACUS.develop/source/src_ri/abfs-vector3_order.cpp new file mode 100644 index 0000000000..4400d77a0f --- /dev/null +++ b/ABACUS.develop/source/src_ri/abfs-vector3_order.cpp @@ -0,0 +1,26 @@ +#include "abfs-vector3_order.h" + +template<> +bool operator< ( const Abfs::Vector3_Order &v1, const Abfs::Vector3_Order &v2 ) +{ + constexpr double threshold = 1E-8; + if ( v1.x < v2.x - threshold ) return true; + else if ( v1.x > v2.x + threshold ) return false; + if ( v1.y < v2.y - threshold ) return true; + else if ( v1.y > v2.y + threshold ) return false; + if ( v1.z < v2.z - threshold ) return true; + else if ( v1.z > v2.z + threshold ) return false; + return false; +} + +template<> +bool operator< ( const Abfs::Vector3_Order &v1, const Abfs::Vector3_Order &v2 ) +{ + if ( v1.x < v2.x ) return true; + else if ( v1.x > v2.x ) return false; + if ( v1.y < v2.y ) return true; + else if ( v1.y > v2.y ) return false; + if ( v1.z < v2.z ) return true; + else if ( v1.z > v2.z ) return false; + return false; +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/abfs-vector3_order.h b/ABACUS.develop/source/src_ri/abfs-vector3_order.h new file mode 100644 index 0000000000..510d751e74 --- /dev/null +++ b/ABACUS.develop/source/src_ri/abfs-vector3_order.h @@ -0,0 +1,73 @@ +//========================================================== +// AUTHOR : Peize Lin +// DATE : 2017-01-10 +//========================================================== + +#ifndef ABFS_VECTOR3_ORDER_H +#define ABFS_VECTOR3_ORDER_H + +#include "src_ri/abfs.h" + +// mohan comment out 2021-02-06 +//#include +//#include + +template class Abfs::Vector3_Order: public Vector3 +{ +public: + Vector3_Order(const Vector3 &v):Vector3(v){} + Vector3_Order(const T &x,const T &y,const T &z):Vector3(x,y,z){} + Vector3_Order()=default; +}; + +template +bool operator< ( const Abfs::Vector3_Order &v1, const Abfs::Vector3_Order &v2 ); + +/* +template +bool operator> ( const Abfs::Vector3_Order &v1, const Abfs::Vector3_Order &v2 ) +{ + if( v1.x>v2.x ) return true; + else if ( v1.xv2.y ) return true; + else if ( v1.yv2.z ) return true; + else if ( v1.z +bool operator<= ( const Abfs::Vector3_Order &v1, const Abfs::Vector3_Order &v2 ) +{ + if( v1.xv2.x ) return false; + if( v1.yv2.y ) return false; + if( v1.zv2.z ) return false; + return true; +} + +template +bool operator>= ( const Abfs::Vector3_Order &v1, const Abfs::Vector3_Order &v2 ) +{ + if( v1.x>v2.x ) return true; + else if ( v1.xv2.y ) return true; + else if ( v1.yv2.z ) return true; + else if ( v1.z +Abfs::Vector3_Order operator% ( const Abfs::Vector3_Order &v1, const Abfs::Vector3_Order &v2 ) +{ + auto mod = [](const int i, const int n){ return (i%n+3*n/2)%n-n/2; }; // [-n/2,n/2] +// auto mod = [](const int i, const int n){ return (i%n+n)%n; }; // [0,n] + return Abfs::Vector3_Order{ mod(v1.x,v2.x), mod(v1.y,v2.y), mod(v1.z,v2.z) }; +} + +#endif // ABFS_VECTOR3_ORDER_H diff --git a/ABACUS.develop/source/src_ri/abfs.cpp b/ABACUS.develop/source/src_ri/abfs.cpp new file mode 100644 index 0000000000..9de7dd25c2 --- /dev/null +++ b/ABACUS.develop/source/src_ri/abfs.cpp @@ -0,0 +1,638 @@ +#include "abfs.h" +#include "abfs-vector3_order.h" +#include "abfs-template.h" + +#include "exx_abfs-inverse_matrix_double.h" +#include "src_pw/global.h" +#include "src_global/global_function.h" +#include +#include + +#include // Peize Lin test +#include // Peize Lin test +#include "src_external/src_test/src_global/matrix-test.h" // Peize Lin test +#include"src_external/src_test/test_function.h" + +map,shared_ptr>>> Abfs::cal_Cs( + const set &atom_centres, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Exx_Abfs::Matrix_Orbs21 &m_abfslcaos_lcaos, + const Element_Basis_Index::IndexLNM &index_abfs, + const Element_Basis_Index::IndexLNM &index_lcaos, + const double threshold, + map,weak_ptr>>> &Cws, + map,weak_ptr>>> &Vws ) +{ + TITLE("Abfs","cal_Cs"); + pthread_rwlock_t rwlock_Cw; pthread_rwlock_init(&rwlock_Cw,NULL); + pthread_rwlock_t rwlock_Vw; pthread_rwlock_init(&rwlock_Vw,NULL); + + const vector atom_centres_vector( atom_centres.begin(), atom_centres.end() ); + const vector>>> adjs = get_adjs(); + + // pre-cal Vws on same atom, speed up DPcal_V() in DPcal_C() + vector> Vs_same_atom(ucell.ntype); + for(size_t it=0; it!=ucell.ntype; ++it) + Vs_same_atom[it] = DPcal_V( it,it,{0,0,0}, m_abfs_abfs, index_abfs, 0,true, rwlock_Vw,Vws ); + + const int mkl_threads = mkl_get_max_threads(); + mkl_set_num_threads(std::max(1UL,mkl_threads/atom_centres_vector.size())); + + map,shared_ptr>>> Cs; + #pragma omp parallel for + for( int i_iat1=0; i_iat1 tau1( ucell.atoms[it1].tau[ia1] ); + + for( const auto & atom2 : adjs[iat1] ) + { + const int iat2 = atom2.first; + const int it2 = ucell.iat2it[iat2]; + const int ia2 = ucell.iat2ia[iat2]; + const Vector3_Order tau2( ucell.atoms[it2].tau[ia2] ); + for( const Vector3 &box2 : atom2.second ) + { +// cout<<"cal_Cs\t"< C = DPcal_C( + it1, it2, -tau1+tau2+(box2*ucell.latvec), + m_abfs_abfs, m_abfslcaos_lcaos, index_abfs, index_lcaos, + threshold, true, rwlock_Cw, rwlock_Vw, Cws, Vws ); + #pragma omp critical(Abfs_cal_Cs) + Cs[iat1][iat2][box2] = C; + } + } + } + mkl_set_num_threads(mkl_threads); + Abfs::delete_threshold_ptrs( Cs, threshold ); + Vs_same_atom.clear(); + Abfs::delete_empty_ptrs( Vws ); + pthread_rwlock_destroy(&rwlock_Cw); + pthread_rwlock_destroy(&rwlock_Vw); + return Cs; +} + +/*map>> + Abfs::cal_Vps( + const set> &atom_pairs, + const vector> &Coulomb_potential_boxes, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Element_Basis_Index::Index &index_abfs, + map,shared_ptr>>> &Vs, + map,weak_ptr>>> &Vws ) +{ + map>> Vps; + + for( const pair & atom_pair : atom_pairs ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + const size_t it1 = ucell.iat2it[iat1]; + const size_t ia1 = ucell.iat2ia[iat1]; + const size_t it2 = ucell.iat2it[iat2]; + const size_t ia2 = ucell.iat2ia[iat2]; + const Vector3_Order tau1 = ucell.atoms[it1].tau[ia1]; + const Vector3_Order tau2 = ucell.atoms[it2].tau[ia2]; + + for( const Vector3_Order &box2 : Coulomb_potential_boxes ) + { + const vector> Vs_tmp = DPcal_V( it1, it2, -tau1+tau2+(box2*ucell.latvec), m_abfs_abfs, index_abfs, Vws ); + Vs[iat1][iat2][box2] = Vs_tmp[0]; Vs[iat2][iat1][-box2] = Vs_tmp[1]; + } + + Vps[iat1][iat2] = make_shared( Vs[iat1][iat2][{0,0,0}]->nr, Vs[iat1][iat2][{0,0,0}]->nc ); + for( const Vector3_Order &box2 : Coulomb_potential_boxes ) + *Vps[iat1][iat2] += *Vs[iat1][iat2][box2]; + } + return Vps; +} +*/ + +/* +map,shared_ptr>>> + Abfs::cal_Vps( + const vector> &atom_pairs, + const vector> &Coulomb_potential_boxes, + const vector> &Born_von_Karman_boxes, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Element_Basis_Index::IndexLNM &index_abfs, + map,shared_ptr>>> &Vs, + map,weak_ptr>>> &Vws ) +{ + TITLE("Abfs","cal_Vps"); + + map,shared_ptr>>> Vps; + + for( const pair & atom_pair : atom_pairs ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + const size_t it1 = ucell.iat2it[iat1]; + const size_t ia1 = ucell.iat2ia[iat1]; + const size_t it2 = ucell.iat2it[iat2]; + const size_t ia2 = ucell.iat2ia[iat2]; + const Vector3_Order tau1 = ucell.atoms[it1].tau[ia1]; + const Vector3_Order tau2 = ucell.atoms[it2].tau[ia2]; + + for( const Vector3_Order &box2 : Coulomb_potential_boxes ) + { +cout<<"cal_Vs\t"<> Vs_tmp = DPcal_V( it1, it2, -tau1+tau2+(box2*ucell.latvec), m_abfs_abfs, index_abfs, Vws ); + Vs[iat1][iat2][box2] = Vs_tmp[0]; Vs[iat2][iat1][-box2] = Vs_tmp[1]; + } + + vector Vkps( kv.nks/NSPIN, {Vs[iat1][iat2][{0,0,0}]->nr, Vs[iat1][iat2][{0,0,0}]->nc} ); + for( size_t ik=0; ik!=kv.nks/NSPIN; ++ik ) + for( const Vector3_Order &box2 : Coulomb_potential_boxes ) + Vkps[ik] += static_cast(*Vs[iat1][iat2][box2]) * exp(-TWO_PI*IMAG_UNIT*(kv.kvec_c[ik]*(box2*ucell.latvec))); + + for( const Vector3_Order &box2 : Born_von_Karman_boxes ) + { + ComplexMatrix Vps_tmp ( Vkps[0].nr, Vkps[0].nc ); + for( size_t ik=0; ik!=kv.nks/NSPIN; ++ik ) + Vps_tmp += Vkps[ik] * kv.wk[ik]*(0.5*NSPIN) * exp(TWO_PI*IMAG_UNIT*(kv.kvec_c[ik]*(box2*ucell.latvec))); + Vps[iat1][iat2][box2] = make_shared( Vps_tmp.real() ); + } + } + return Vps; +} +*/ + +map,shared_ptr>>> Abfs::cal_Vs( + const vector> &atom_pairs, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Element_Basis_Index::IndexLNM &index_abfs, + const double rmesh_times, + const double threshold, + map,weak_ptr>>> &Vws ) +{ + TITLE("Abfs","cal_Vs"); + pthread_rwlock_t rwlock_Vw; pthread_rwlock_init(&rwlock_Vw,NULL); + vector> Coulomb_potential_boxes = get_Coulomb_potential_boxes(rmesh_times); + + map,shared_ptr>>> Vs; + #pragma omp parallel for + for( int i_atom_pair=0; i_atom_pair tau1 = ucell.atoms[it1].tau[ia1]; + const Vector3_Order tau2 = ucell.atoms[it2].tau[ia2]; + const double Rcut = std::min( ORB.Phi[it1].getRcut()*rmesh_times+ORB.Phi[it2].getRcut(), ORB.Phi[it1].getRcut()+ORB.Phi[it2].getRcut()*rmesh_times ); + + for( const Vector3_Order &box2 : Coulomb_potential_boxes ) + { + const Vector3_Order delta_R = -tau1+tau2+(box2*ucell.latvec); + if( delta_R.norm()*ucell.lat0 < Rcut ) + { +// cout<<"cal_Vs\t"< V = DPcal_V( + it1, it2, delta_R, + m_abfs_abfs, index_abfs, + threshold, true, rwlock_Vw, Vws ); + #pragma omp critical(Abfs_cal_Vs) + Vs[iat1][iat2][box2] = V; + } + } + } + Abfs::delete_threshold_ptrs( Vs, threshold ); + pthread_rwlock_destroy(&rwlock_Vw); + return Vs; +} + +map,shared_ptr> Abfs::cal_mps( + const Abfs::Vector3_Order &Born_von_Karman_period, + const map,shared_ptr> &ms ) +{ + map< Vector3_Order, vector> > indexs; + for( const auto & m : ms ) + { + const Vector3_Order & box = m.first; + indexs[box%Born_von_Karman_period].push_back(box); + } + + #if TEST_EXX_LCAO==1 + { + static int istep=0; + ofstream ofs( "mps_index_"+TO_STRING(iat1)+"_"+TO_STRING(iat2)+"_"+TO_STRING(istep++) ); + for( const auto index : indexs ) + { + ofs< & box : index.second ) + ofs<<"\t"<,shared_ptr> mps; + for( const auto & index : indexs ) + { + const Vector3_Order & boxp = index.first; + assert(index.second.size()>=1); + if( index.second.size()==1 ) + mps[boxp] = ms.at(index.second[0]); + else + { + mps[boxp] = make_shared(); + *mps[boxp] = *ms.at(index.second[0]); + for( size_t i=1; i,shared_ptr>>> Abfs::cal_mps( + const Abfs::Vector3_Order &Born_von_Karman_period, + const map,shared_ptr>>> &ms ) +{ + TITLE("Abfs","cal_mps"); + map,shared_ptr>>> mps; + for( const auto & m1s : ms ) + for( const auto & m12s : m1s.second ) + mps[m1s.first][m12s.first] = cal_mps( Born_von_Karman_period, m12s.second ); + return mps; +} + + +shared_ptr Abfs::DPcal_C( + const size_t &it1, + const size_t &it2, + const Vector3_Order &R, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Exx_Abfs::Matrix_Orbs21 &m_abfslcaos_lcaos, + const Element_Basis_Index::IndexLNM &index_abfs, + const Element_Basis_Index::IndexLNM &index_lcaos, + const double threshold, + const bool writable, + pthread_rwlock_t &rwlock_Cw, + pthread_rwlock_t &rwlock_Vw, + map,weak_ptr>>> &Cws, + map,weak_ptr>>> &Vws ) +{ + // Attention: + // 在计算 C[it1,it1,0][it2,R] 后,额外计算 C[it2,it2,0][it1,-R] 几乎不耗时。 + // if 仅保存 C[it1,it1,0][it2,R],不保存 C[it2,it2,0][it1,-R]: + // if C[it2,it2,0][it1,-R] 在本核上亦需计算: + // 浪费时间重算一遍 + // if C[it2,it2,0][it1,-R] 在本核上不需计算: + // 好 + // if 同时保存 C[it1,it1,0][it2,R]、C[it2,it2,0][it1,-R]: + // if C[it2,it2,0][it1,-R] 在本核上亦需计算: + // 好 + // if C[it2,it2,0][it1,-R] 在本核上不需计算: + // 浪费空间(可在算完全部Cs后根据需要删除无需的Cs,释放空间?) + // 根据后续情况选择权衡。 + +// TITLE("Abfs","DPcal_C"); + pthread_rwlock_rdlock(&rwlock_Cw); + const weak_ptr * const Cws_ptr = static_cast * const>( MAP_EXIST( Cws, it1, it2, R ) ); + pthread_rwlock_unlock(&rwlock_Cw); + + if( Cws_ptr && !Cws_ptr->expired() ) + return Cws_ptr->lock(); + else + { +// cout<<"DPcal_C\t"<(0,0,0)==R) && (it1==it2) ) + { + const shared_ptr A = + make_shared( m_abfslcaos_lcaos.cal_overlap_matrix( it1,it2,0,0,index_abfs,index_lcaos,index_lcaos,Exx_Abfs::Matrix_Orbs21::Matrix_Order::A2B_A1 ) ); + const shared_ptr V = DPcal_V(it1,it2,{0,0,0}, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const shared_ptr L = cal_I(V); + shared_ptr C = make_shared( 0.5 * *A * *L ); + if(C->absmax()<=threshold) C->create(0,0); + if(writable) + { + pthread_rwlock_wrlock(&rwlock_Cw); + Cws[it1][it2][R] = C; + pthread_rwlock_unlock(&rwlock_Cw); + } + return C; + } + else + { + const vector> A = + { make_shared( m_abfslcaos_lcaos.cal_overlap_matrix(it1,it2,0,R ,index_abfs,index_lcaos,index_lcaos,Exx_Abfs::Matrix_Orbs21::Matrix_Order::A2B_A1) ) , + make_shared( m_abfslcaos_lcaos.cal_overlap_matrix(it2,it1,0,-R,index_abfs,index_lcaos,index_lcaos,Exx_Abfs::Matrix_Orbs21::Matrix_Order::BA2_A1) ) }; + + const shared_ptr V_00 = DPcal_V(it1,it1,{0,0,0}, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const shared_ptr V_01 = DPcal_V(it1,it2,R, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const shared_ptr V_10 = DPcal_V(it2,it1,-R, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const shared_ptr V_11 = DPcal_V(it2,it2,{0,0,0}, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const vector>> V = + {{ V_00, V_01 }, + { V_10, V_11 }}; + + const vector>> L = cal_I(V); + + shared_ptr C = make_shared( *A[0] * *L[0][0] + *A[1] * *L[1][0] ); + if(C->absmax()<=threshold) C->create(0,0); + if(writable) + { + pthread_rwlock_wrlock(&rwlock_Cw); + Cws[it1][it2][R] = C; + pthread_rwlock_unlock(&rwlock_Cw); + } + return C; + } + } +} + +shared_ptr Abfs::DPcal_V( + const size_t &it1, + const size_t &it2, + const Vector3_Order &R, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Element_Basis_Index::IndexLNM &index_abfs, + const double threshold, + const bool writable, + pthread_rwlock_t &rwlock_Vw, + map,weak_ptr>>> &Vws) +{ +// TITLE("Abfs","DPcal_V"); + pthread_rwlock_rdlock(&rwlock_Vw); + const weak_ptr * const Vws12_ptr = static_cast * const>( MAP_EXIST( Vws, it1, it2, R ) ); + const weak_ptr * const Vws21_ptr = static_cast * const>( MAP_EXIST( Vws, it2, it1, -R ) ); + pthread_rwlock_unlock(&rwlock_Vw); + + if( Vws12_ptr && !Vws12_ptr->expired() ) + return Vws12_ptr->lock(); + else if( Vws21_ptr && !Vws21_ptr->expired() ) + { + shared_ptr VT = make_shared( transpose(*Vws21_ptr->lock()) ); + if(VT->absmax()<=threshold) VT->create(0,0); + if(writable) + { + pthread_rwlock_wrlock(&rwlock_Vw); + Vws[it1][it2][R] = VT; + pthread_rwlock_unlock(&rwlock_Vw); + } + return VT; + } + else + { +// cout<<"DPcal_V\t"< V = make_shared( m_abfs_abfs.cal_overlap_matrix(it1,it2,0,R,index_abfs,index_abfs) ); + if(V->absmax()<=threshold) V->create(0,0); + if(writable) + { + pthread_rwlock_wrlock(&rwlock_Vw); + Vws[it1][it2][R] = V; + pthread_rwlock_unlock(&rwlock_Vw); + } + return V; + } +} + +map>> Abfs::get_adjs( const size_t &iat ) +{ +// TITLE("Abfs","get_adjs"); + const int it = ucell.iat2it[iat]; + const int ia = ucell.iat2ia[iat]; + const Vector3 &tau = ucell.atoms[it].tau[ia]; + + map>> adjs; + GridD.Find_atom( tau, it, ia ); + for( int ad=0; ad box_ad = GridD.getBox(ad); + const Vector3 tau_ad = GridD.getAdjacentTau(ad); + + if( (tau-tau_ad).norm()*ucell.lat0 < ORB.Phi[it].getRcut()+ORB.Phi[it_ad].getRcut() ) + adjs[iat_ad].push_back(box_ad); + } + return adjs; +} + +vector>>> Abfs::get_adjs() +{ + vector>>> adjs(ucell.nat); + for( size_t iat=0; iat!=ucell.nat; ++iat ) + adjs[iat] = Abfs::get_adjs(iat); + return adjs; +} + +/* +set> Abfs::get_H_pairs_core( const vector> &atom_pairs ) +{ + TITLE("Exx_Lcao","allocate_Hexx"); + + set> H_atom_pairs_core; + for( const pair & atom_pair : atom_pairs ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + + const map>> adj1s = Abfs::get_adjs(iat1); + const map>> adj2s = Abfs::get_adjs(iat2); + + H_atom_pairs_core.insert({iat1,iat2}); + for( const auto & atom3 : adj1s ) + { + const size_t iat3 = atom3.first; + H_atom_pairs_core.insert({iat3,iat2}); + for( const auto & atom4 : adj2s ) + { + const size_t iat4 = atom4.first; + H_atom_pairs_core.insert({iat1,iat4}); + H_atom_pairs_core.insert({iat3,iat4}); + } + } + } + return H_atom_pairs_core; +} +*/ + +map,set> Abfs::get_H_pairs_core_group( const vector> &atom_pairs ) +{ + TITLE("Abfs","get_H_pairs_core_group"); + + const vector>>> adjs = Abfs::get_adjs(); + + auto get_set_adjs = [&adjs]( const set &as ) -> set + { + set aRs; + for( const size_t a : as ) + for( const auto &aR : adjs[a] ) + aRs.insert(aR.first); + return aRs; + }; + + // {(0,1),(3,5),(0,4),(7,8),(6,5)} + const vector> & a1_a2 = atom_pairs; + + // => {1:{0}, 5:{3,6}, 4:{0}, 8:{7}} + map> a2_a1s; + for( const auto & a1_a2_i : a1_a2 ) + a2_a1s[ a1_a2_i.second ].insert( a1_a2_i.first ); + + // => {{0}:{1,4}, {3,6}:{5}, {7}:{8}} + map,set> a1s_a2s; + for( const auto & a2_a1s_i : a2_a1s ) + a1s_a2s[ a2_a1s_i.second ].insert( a2_a1s_i.first ); + a2_a1s.clear(); + + // => {R(0):R(1)UR(4), R(3)UR(6):R(5), R(7):R(8)} + // imaging R(0)==R(3)UR(6): + // => {R(0):R(1)UR(4)UR(5), R(7):R(8)} + map,set> a1Rs_a2s; + for( const auto & a1s_a2s_i : a1s_a2s ) + { + const set a1Rs_i = get_set_adjs(a1s_a2s_i.first); + const set a2Rs_i = get_set_adjs(a1s_a2s_i.second); + a1Rs_a2s[a1Rs_i].insert(a2Rs_i.begin(), a2Rs_i.end()); + } + a1s_a2s.clear(); + + return a1Rs_a2s; +} + +set> Abfs::get_H_pairs_core( const vector> &atom_pairs ) +{ + TITLE("Exx_Lcao","get_H_pairs_core"); + + const vector>>> adjs = Abfs::get_adjs(); + + auto get_set_adjs = [&adjs]( const set &as ) -> set + { + set aRs; + for( const size_t a : as ) + for( const auto &aR : adjs[a] ) + aRs.insert(aR.first); + return aRs; + }; + + // {(0,1),(3,5),(0,4),(7,8),(6,5)} + const vector> & a1_a2 = atom_pairs; + + // => {1:{0}, 5:{3,6}, 4:{0}, 8:{7}} + map> a2_a1s; + for( const auto & a1_a2_i : a1_a2 ) + a2_a1s[ a1_a2_i.second ].insert( a1_a2_i.first ); + + // => {{0}:{1,4}, {3,6}:{5}, {7}:{8}} + map,set> a1s_a2s; + for( const auto & a2_a1s_i : a2_a1s ) + a1s_a2s[ a2_a1s_i.second ].insert( a2_a1s_i.first ); + a2_a1s.clear(); + + // => {R(0):{1,4}, R(3)UR(6):{5}, R(7):{8}} + // imaging R(0)==R(3)UR(6): + // => {R(0):{1,4,5}, R(7):{8}} + map,set> a1Rs_a2s; + for( const auto & a1s_a2s_i : a1s_a2s ) + { + const set a1Rs_i = get_set_adjs(a1s_a2s_i.first); + a1Rs_a2s[a1Rs_i].insert(a1s_a2s_i.second.begin(), a1s_a2s_i.second.end()); + } + a1s_a2s.clear(); + + // => {R(0):R(1)UR(4)UR(5), R(7):R(8)} + set> a1Rs_a2Rs; + for( const auto & a1Rs_a2s_i : a1Rs_a2s ) + { + const set a2Rs_i = get_set_adjs(a1Rs_a2s_i.second); + for( const size_t a1R_i : a1Rs_a2s_i.first ) + for( const size_t a2R_i : a2Rs_i ) + a1Rs_a2Rs.insert({a1R_i,a2R_i}); + } + a1Rs_a2s.clear(); + + return a1Rs_a2Rs; +} + +vector> Abfs::get_Coulomb_potential_boxes( const double rmesh_times ) +{ + vector> Coulomb_potential_boxes; + const double Rcut = ORB.get_Rmax() * rmesh_times; + const int nx = std::ceil(Rcut/std::abs((ucell.a2^ucell.a3).normalize()*ucell.a1*ucell.lat0)); + const int ny = std::ceil(Rcut/std::abs((ucell.a1^ucell.a3).normalize()*ucell.a2*ucell.lat0)); + const int nz = std::ceil(Rcut/std::abs((ucell.a1^ucell.a2).normalize()*ucell.a3*ucell.lat0)); + for(int x=-nx; x<=nx; ++x) + for(int y=-ny; y<=ny; ++y) + for(int z=-nz; z<=nz; ++z) + Coulomb_potential_boxes.push_back({x,y,z}); + return Coulomb_potential_boxes; +} + +vector> Abfs::get_Born_von_Karmen_boxes( const Abfs::Vector3_Order &Born_von_Karman_period ) +{ + vector> Born_von_Karman_boxes; + for( int ix=0; ix{ix,iy,iz} % Born_von_Karman_period ); + return Born_von_Karman_boxes; +} + +shared_ptr Abfs::cal_I( const shared_ptr &m ) +{ +// TITLE("Abfs","cal_I1"); + Exx_Abfs::Inverse_Matrix_Double I; + I.init( m->nc ); + I.input( m ); + + #if TEST_EXX_LCAO==1 + ofstream ofs("I.dat",ofstream::app); + ofs<<"@"< m_new = make_shared(m->nr,m->nc); + I.output( m_new ); + return m_new; +} + +vector>> Abfs::cal_I( const vector>> &ms ) +{ +// TITLE("Abfs","cal_I4"); + Exx_Abfs::Inverse_Matrix_Double I; + I.init( ms[0][0]->nc + ms[0][1]->nc ); + I.input( ms[0][0], ms[0][1], ms[1][0], ms[1][1] ); + + #if TEST_EXX_LCAO==1 + ofstream ofs("I.dat",ofstream::app); + ofs<<"@"<>> ms_new( 2, vector>(2) ); + for( size_t i=0; i!=2; ++i ) + for(size_t j=0; j!=2; ++j ) + ms_new[i][j] = make_shared( ms[i][j]->nr, ms[i][j]->nc ); + I.output( ms_new[0][0], ms_new[0][1], ms_new[1][0], ms_new[1][1] ); + return ms_new; +} diff --git a/ABACUS.develop/source/src_ri/abfs.h b/ABACUS.develop/source/src_ri/abfs.h new file mode 100644 index 0000000000..7e23c99445 --- /dev/null +++ b/ABACUS.develop/source/src_ri/abfs.h @@ -0,0 +1,112 @@ +#ifndef ABFS_H +#define ABFS_H + +#include "src_global/vector3.h" +#include "src_global/matrix.h" +#include "src_ri/exx_abfs.h" + +#include +#include +#include +#include +#include + +class Abfs +{ +public: + + template class Vector3_Order; + + // Cs[iat1][iat2][box2] + // Cws[it1,it1,0][it2,R] + // Vws[it1,0][it2,R] + static map,shared_ptr>>> cal_Cs( + const set &atom_centres, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Exx_Abfs::Matrix_Orbs21 &m_abfslcaos_lcaos, + const Element_Basis_Index::IndexLNM &index_abfs, + const Element_Basis_Index::IndexLNM &index_lcaos, + const double threshold, + map,weak_ptr>>> &Cws, + map,weak_ptr>>> &Vws ); + + // Vs[iat1][iat2][box2] + // Vws[it1,0][it2,R] + static map,shared_ptr>>> cal_Vs( + const vector> &atom_pairs, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Element_Basis_Index::IndexLNM &index_abfs, + const double rmesh_times, + const double threshold, + map,weak_ptr>>> &Vws ); + + // use matrixes ms to get period mps + static map,shared_ptr> + cal_mps( + const Abfs::Vector3_Order &Born_von_Karman_period, + const map,shared_ptr> &ms ); + // mps[iat1][iat2][box2] + static map,shared_ptr>>> + cal_mps( + const Abfs::Vector3_Order &Born_von_Karman_period, + const map,shared_ptr>>> &ms ); + + // C[it1,it1,0][it2,R] + static shared_ptr DPcal_C( + const size_t &it1, + const size_t &it2, + const Vector3_Order &R, // unit: ucell.lat0 + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Exx_Abfs::Matrix_Orbs21 &m_abfslcaos_lcaos, + const Element_Basis_Index::IndexLNM &index_abfs, + const Element_Basis_Index::IndexLNM &index_lcaos, + const double threshold, + const bool writable, + pthread_rwlock_t &rwlock_Cw, + pthread_rwlock_t &rwlock_Vw, + map,weak_ptr>>> &Cws, + map,weak_ptr>>> &Vws ); + + // V[it1,0][it2,R] + static shared_ptr DPcal_V( + const size_t &it1, + const size_t &it2, + const Vector3_Order &R, // unit: ucell.lat0 + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Element_Basis_Index::IndexLNM &index_abfs, + const double threshold, + const bool writable, + pthread_rwlock_t &rwlock_Vw, + map,weak_ptr>>> &Vws ); + +// static map>> get_adjs( const size_t &T, const Vector3 &tau_cartesian ); + static map>> get_adjs( const size_t &iat ); + static vector>>> get_adjs(); + static map,set> get_H_pairs_core_group( const vector> &atom_pairs ); + static set> get_H_pairs_core( const vector> &atom_pairs ); + static vector> get_Coulomb_potential_boxes( const double rmesh_times ); + static vector> get_Born_von_Karmen_boxes( const Abfs::Vector3_Order &Born_von_Karman_period ); + + static shared_ptr cal_I( const shared_ptr &m ); + static vector>> cal_I( const vector>> &ms ); + + template + static void delete_empty_ptrs( map>>> &ptrs ); +// template +// static void delete_threshold_ptrs( map>>> &ptrs, const double threshold); +// template +// static void delete_threshold_ptrs( map>> &ptrs, const double threshold); + template + static void delete_threshold_ptrs( map &ptrs, const double threshold ); + template + static void delete_threshold_ptrs( map> &ptrs, const double threshold ); + template + static void delete_threshold_ptrs( map> &ptrs, const double threshold ); +// template +// static void delete_threshold_ptrs( map &ptrs, const double threshold ); + + template + static vector> get_atom_pair(const map> &m); +}; + +#endif // ABFS_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/conv_coulomb_pot-inl.h b/ABACUS.develop/source/src_ri/conv_coulomb_pot-inl.h new file mode 100644 index 0000000000..ea6d8e41ae --- /dev/null +++ b/ABACUS.develop/source/src_ri/conv_coulomb_pot-inl.h @@ -0,0 +1,37 @@ +#ifndef CONV_COULOMB_POT_INL_H +#define CONV_COULOMB_POT_INL_H + +#include "conv_coulomb_pot.h" +#include "../src_global/global_function.h" + +#include "../src_external/src_test/test_function.h" // Peize Lin test + +inline double Conv_Coulomb_Pot::get_r_radial_outofrange( size_t ir ) const +{ + return orb.getRadial(conv_coulomb_pot.size()-1) + + orb.getRab(conv_coulomb_pot.size()-1) + * ( ir - conv_coulomb_pot.size() + 1 ) ; +} + +template< typename T > +void Conv_Coulomb_Pot::cal_orbs_ccp( + const T & orbs, + T & orbs_ccp, + size_t rmesh_times, + size_t kmesh_times ) +{ + orbs_ccp.resize(orbs.size()); + for( int i=0; i!=orbs.size(); ++i ) + { + cal_orbs_ccp( orbs[i], orbs_ccp[i], rmesh_times, kmesh_times ); + } +} + +template<> +void Conv_Coulomb_Pot::cal_orbs_ccp( + const Numerical_Orbital_Lm & orbs, + Numerical_Orbital_Lm & orbs_ccp, + size_t rmesh_times, + size_t kmesh_times ); + +#endif diff --git a/ABACUS.develop/source/src_ri/conv_coulomb_pot.cpp b/ABACUS.develop/source/src_ri/conv_coulomb_pot.cpp new file mode 100644 index 0000000000..ef87663767 --- /dev/null +++ b/ABACUS.develop/source/src_ri/conv_coulomb_pot.cpp @@ -0,0 +1,123 @@ +#include "conv_coulomb_pot.h" +#include "conv_coulomb_pot-inl.h" +#include "src_global/mathzone.h" +#include "src_global/constants.h" +#include "src_global/global_function.h" + +#include "src_external/src_test/test_function.h" + +Conv_Coulomb_Pot::Conv_Coulomb_Pot(const Numerical_Orbital_Lm &orb_in) + :orb(orb_in) +{ + conv_coulomb_pot.resize(orb.getNr()); +} + + +double Conv_Coulomb_Pot::get_conv_coulomb_pot(const size_t &ir) const +{ + if( ir < conv_coulomb_pot.size() ) + { + return conv_coulomb_pot[ir]; + } + else + { + double r_radial = get_r_radial_outofrange( ir ); + return conv_coulomb_pot_extra / pow(r_radial,orb.getL()+1); + } +} + + +void Conv_Coulomb_Pot::cal_conv_coulomb_pot() +{ + vector tmp_func( orb.getNr() ); + vector tmp_integral( orb.getNr() ); + + // \int_{r'=0}^{r} dr' f(r') * r'^{L+2} / r^{L+1} + for( size_t ir=0; ir!=orb.getNr(); ++ir ) + { + tmp_func[ir] = orb.getPsi(ir) * pow( orb.getRadial(ir), orb.getL()+2 ); + } + Mathzone::Simpson_Integral_0toall( orb.getNr(), VECTOR_TO_PTR(tmp_func), orb.getRab(), VECTOR_TO_PTR(tmp_integral) ); + conv_coulomb_pot[0]=0; + for( size_t ir=1; ir!=orb.getNr(); ++ir ) + { + conv_coulomb_pot[ir] = tmp_integral[ir] / pow( orb.getRadial(ir), orb.getL()+1 ); + } + + // \int_{r'=0}^{Rcut} dr' f(r') * r'^{L+2} + conv_coulomb_pot_extra = tmp_integral.back(); + + // \int_{r'=r}^{+\infty} dr' f(r') * r^{L} / r'^{L-1} + tmp_func[0]=0; + for( size_t ir=1; ir!=orb.getNr(); ++ir ) + { + tmp_func[ir] = orb.getPsi(ir) / pow( orb.getRadial(ir), orb.getL()-1 ); + } + Mathzone::Simpson_Integral_alltoinf( orb.getNr(), VECTOR_TO_PTR(tmp_func), orb.getRab(), VECTOR_TO_PTR(tmp_integral) ); + for( size_t ir=0; ir!=orb.getNr(); ++ir ) + { + conv_coulomb_pot[ir] += tmp_integral[ir] * pow( orb.getRadial(ir), orb.getL() ); + } + + // 4pi/(2L+1) + const double coefficient = 4*PI/(2*orb.getL()+1); + for( size_t ir=0; ir!=orb.getNr(); ++ir ) + { + conv_coulomb_pot[ir] *= coefficient; + } + conv_coulomb_pot_extra *= coefficient; +} + + +template<> +void Conv_Coulomb_Pot::cal_orbs_ccp( + const Numerical_Orbital_Lm & orbs, + Numerical_Orbital_Lm & orbs_ccp, + size_t rmesh_times, + size_t kmesh_times ) +{ + Conv_Coulomb_Pot ccp( orbs ); + ccp.cal_conv_coulomb_pot(); + + const size_t mesh = (rmesh_times * orbs.getNr()) | 1; // mesh must be odd for simspon integral + vector psi( mesh ); + for( size_t ir=0; ir!=mesh ; ++ir) + { + psi[ir] = ccp.get_conv_coulomb_pot(ir); + } + + vector rab( mesh ); + for( size_t ir=0; ir!=mesh ; ++ir) + { + if( ir r_radial( mesh ); + for( size_t ir=0; ir!=mesh ; ++ir) + { + if( ir +using std::vector; + +#include "../src_lcao/ORB_atomic_lm.h" + +// out of conv_coulomb_pot.size(), imagine all rab(i.e. dr) are equal to rab[conv_coulomb_pot.size()-1] +class Conv_Coulomb_Pot +{ +public: + Conv_Coulomb_Pot(const Numerical_Orbital_Lm &orb_in); + + const vector &get_conv_coulomb_pot() const { return conv_coulomb_pot; } + double get_conv_coulomb_pot(const size_t &ir) const; + + void cal_conv_coulomb_pot(); + +public: + // only for > ... > + // the number of "vector" can be 0 to any + template< typename T > + static void cal_orbs_ccp( const T & orb, T & orb_ccp, size_t rmesh_times=1, size_t kmesh_times=1 ); + +private: + const Numerical_Orbital_Lm &orb; + vector conv_coulomb_pot; + double conv_coulomb_pot_extra; + + inline double get_r_radial_outofrange( size_t ir ) const; +}; + +#endif diff --git a/ABACUS.develop/source/src_ri/conv_coulomb_pot_k-template.h b/ABACUS.develop/source/src_ri/conv_coulomb_pot_k-template.h new file mode 100644 index 0000000000..656bd00740 --- /dev/null +++ b/ABACUS.develop/source/src_ri/conv_coulomb_pot_k-template.h @@ -0,0 +1,65 @@ +#ifndef CONV_COULOMB_POT_K_TEMPLATE_H +#define CONV_COULOMB_POT_K_TEMPLATE_H + +#include "conv_coulomb_pot_k.h" +#include +#include + +#include "src_external/src_test/src_ri/exx_abfs-construct_orbs-test.h" + +template +T Conv_Coulomb_Pot_K::cal_orbs_ccp_rmesh( + const T & orbs, + const Ccp_Type &ccp_type, + const std::map ¶meter, + const double psi_threshold, + double &rmesh_times) +{ + const double rmesh_times_trial = 10; // Peize Lin test + const T orbs_ccp_trial = cal_orbs_ccp(orbs, ccp_type, parameter, rmesh_times_trial); + rmesh_times = std::max(1.0, get_rmesh_proportion(orbs_ccp_trial, psi_threshold) * rmesh_times_trial); + const T orbs_ccp = cal_orbs_ccp(orbs, ccp_type, parameter, rmesh_times); + return orbs_ccp; +} + + + +template< typename T > +T Conv_Coulomb_Pot_K::cal_orbs_ccp( + const T & orbs, + const Ccp_Type &ccp_type, + const std::map ¶meter, + const double rmesh_times) +{ + T orbs_ccp(orbs.size()); + for( size_t i=0; i!=orbs.size(); ++i ) + orbs_ccp[i] = cal_orbs_ccp( orbs[i], ccp_type, parameter, rmesh_times ); + return orbs_ccp; +} + +extern template +Numerical_Orbital_Lm Conv_Coulomb_Pot_K::cal_orbs_ccp( + const Numerical_Orbital_Lm & orbs, + const Ccp_Type &ccp_type, + const std::map ¶meter, + const double rmesh_times); + + + +template< typename T > +double Conv_Coulomb_Pot_K::get_rmesh_proportion( + const T & orbs, + const double psi_threshold) +{ + double rmesh_proportion=0; + for( const auto &orb : orbs ) + rmesh_proportion = std::max(rmesh_proportion, get_rmesh_proportion(orb,psi_threshold)); + return rmesh_proportion; +} + +extern template +double Conv_Coulomb_Pot_K::get_rmesh_proportion( + const Numerical_Orbital_Lm & orbs, + const double psi_threshold); + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/conv_coulomb_pot_k.cpp b/ABACUS.develop/source/src_ri/conv_coulomb_pot_k.cpp new file mode 100644 index 0000000000..9d4c4a237c --- /dev/null +++ b/ABACUS.develop/source/src_ri/conv_coulomb_pot_k.cpp @@ -0,0 +1,87 @@ +#include "conv_coulomb_pot_k.h" +#include "src_global/constants.h" +#include "src_lcao/ORB_atomic_lm.h" + +std::vector Conv_Coulomb_Pot_K::cal_psi_ccp( const std::vector & psif ) +{ + std::vector psik2_ccp(psif.size()); + for( size_t ik=0; ik Conv_Coulomb_Pot_K::cal_psi_hse( + const std::vector & psif, + const std::vector & k_radial, + const double omega) +{ + std::vector psik2_ccp(psif.size()); + for( size_t ik=0; ik +Numerical_Orbital_Lm Conv_Coulomb_Pot_K::cal_orbs_ccp( + const Numerical_Orbital_Lm &orbs, + const Ccp_Type &ccp_type, + const std::map ¶meter, + const double rmesh_times) +{ + std::vector psik2_ccp; + switch(ccp_type) + { + case Ccp_Type::Ccp: + psik2_ccp = cal_psi_ccp( orbs.get_psif() ); break; + case Ccp_Type::Hse: + psik2_ccp = cal_psi_hse( orbs.get_psif(), orbs.get_k_radial(), parameter.at("hse_omega") ); break; + default: + throw( TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__) ); break; + } + + const double dr = orbs.get_rab().back(); + const int Nr = (static_cast(orbs.getNr()*rmesh_times)) | 1; + std::vector rab(Nr); + for( size_t ir=0; ir r_radial(Nr); + for( size_t ir=0; ir +double Conv_Coulomb_Pot_K::get_rmesh_proportion( + const Numerical_Orbital_Lm &orbs, + const double psi_threshold) +{ + for(int ir=orbs.getNr()-1; ir>=0; --ir) + { + if(std::abs(orbs.getPsi(ir))>=psi_threshold) + return static_cast(ir)/orbs.getNr(); + } + return 0.0; +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/conv_coulomb_pot_k.h b/ABACUS.develop/source/src_ri/conv_coulomb_pot_k.h new file mode 100644 index 0000000000..66e577b67e --- /dev/null +++ b/ABACUS.develop/source/src_ri/conv_coulomb_pot_k.h @@ -0,0 +1,45 @@ +#ifndef CONV_COULOMB_POT_K_H +#define CONV_COULOMB_POT_K_H + +#include +#include +#include + +class Conv_Coulomb_Pot_K +{ +public: + + enum class Ccp_Type{ // parameter: + Ccp, // + Hse}; // "hse_omega" + + template static T cal_orbs_ccp( + const T &orbs, + const Ccp_Type &ccp_type, + const std::map ¶meter, + const double rmesh_times); + + template static T cal_orbs_ccp_rmesh( + const T & orbs, + const Ccp_Type &ccp_type, + const std::map ¶meter, + const double psi_threshold, + double &rmesh_times); + +private: + + template< typename T > static double get_rmesh_proportion( + const T &orbs, + const double psi_threshold); + +private: + + static std::vector cal_psi_ccp( const std::vector & psif ); + + static std::vector cal_psi_hse( + const std::vector & psif, + const std::vector & k_radial, + const double omega); +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-abfs_index.cpp b/ABACUS.develop/source/src_ri/exx_abfs-abfs_index.cpp new file mode 100644 index 0000000000..a8763279b5 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-abfs_index.cpp @@ -0,0 +1,37 @@ +#include "exx_abfs-abfs_index.h" +#include "src_lcao/ORB_read.h" + +Element_Basis_Index::Range + Exx_Abfs::Abfs_Index::construct_range( const LCAO_Orbitals &orb ) +{ + Element_Basis_Index::Range range; + range.resize( orb.get_ntype() ); + for( size_t T=0; T!=range.size(); ++T ) + { + range[T].resize( orb.Phi[T].getLmax()+1 ); + for( size_t L=0; L!=range[T].size(); ++L ) + { + range[T][L].N = orb.Phi[T].getNchi(L); + range[T][L].M = 2*L+1; + } + } + return range; +} + + +Element_Basis_Index::Range + Exx_Abfs::Abfs_Index::construct_range( const vector>> &orb ) +{ + Element_Basis_Index::Range range; + range.resize( orb.size() ); + for( size_t T=0; T!=range.size(); ++T ) + { + range[T].resize( orb[T].size() ); + for( size_t L=0; L!=range[T].size(); ++L ) + { + range[T][L].N = orb[T][L].size(); + range[T][L].M = 2*L+1; + } + } + return range; +} diff --git a/ABACUS.develop/source/src_ri/exx_abfs-abfs_index.h b/ABACUS.develop/source/src_ri/exx_abfs-abfs_index.h new file mode 100644 index 0000000000..ff36084333 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-abfs_index.h @@ -0,0 +1,23 @@ +#ifndef EXX_ABFS_ABFS_INDEX_H +#define EXX_ABFS_ABFS_INDEX_H + +#include "exx_abfs.h" + +#include +#include "src_global/element_basis_index.h" +#include "src_lcao/ORB_atomic_lm.h" + +class LCAO_Orbitals; + +class Exx_Abfs::Abfs_Index +{ +public: + static size_t get_index_index( + const Element_Basis_Index::IndexLNM &index_A, const size_t &TA, const size_t &LA, const size_t &NA, const size_t &MA, + const Element_Basis_Index::IndexLNM &index_B, const size_t &TB, const size_t &LB, const size_t &NB, const size_t &MB ) + { return index_A[TA][LA][NA][MA] * index_B[TB].count_size + index_B[TB][LB][NB][MB]; } + static Element_Basis_Index::Range construct_range( const LCAO_Orbitals &orb ); + static Element_Basis_Index::Range construct_range( const vector>> &orb ); +}; + +#endif // EXX_ABFS_ABFS_INDEX_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-construct_orbs.cpp b/ABACUS.develop/source/src_ri/exx_abfs-construct_orbs.cpp new file mode 100644 index 0000000000..59daf83038 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-construct_orbs.cpp @@ -0,0 +1,480 @@ +#include "exx_abfs-construct_orbs.h" +#include "exx_abfs-pca.h" + +#include "src_lcao/ORB_read.h" +#include "src_global/gram_schmidt_orth.h" +#include "src_global/gram_schmidt_orth-inl.h" + +#include "src_external/src_test/src_ri/exx_abfs-construct_orbs-test.h" // Peize Lin test +#include "src_lcao/global_fp.h" + +vector>> Exx_Abfs::Construct_Orbs::change_orbs( + const LCAO_Orbitals &orbs_in, + const double kmesh_times ) +{ + TITLE("Exx_Abfs::Construct_Orbs::change_orbs"); + + vector>> orbs; + orbs.resize( orbs_in.get_ntype() ); + for (int T = 0; T < orbs_in.get_ntype() ; T++) + { + orbs[T].resize( orbs_in.Phi[T].getLmax()+1 ); + for (int L=0; L <= orbs_in.Phi[T].getLmax() ; L++) + { + orbs[T][L].resize( orbs_in.Phi[T].getNchi(L) ); + for (int N = 0; N < orbs_in.Phi[T].getNchi(L); ++N) + { + const auto &orb_origin = orbs_in.Phi[T].PhiLN(L,N); + orbs[T][L][N].set_orbital_info( + orb_origin.getLabel(), + orb_origin.getType(), + orb_origin.getL(), + orb_origin.getChi(), + orb_origin.getNr(), + orb_origin.getRab(), + orb_origin.getRadial(), + Numerical_Orbital_Lm::Psi_Type::Psi, + orb_origin.getPsi(), + static_cast(orb_origin.getNk() * kmesh_times) | 1, // Nk must be odd + orb_origin.getDk(), // Peize Lin change 2017-04-16 +// orb_origin.getDk() / kmesh_times, + orb_origin.getDruniform(), + false, + true); + } + } + } + return orbs; +} + +vector>> Exx_Abfs::Construct_Orbs::change_orbs( + const vector>> &orbs_in, + const double kmesh_times ) +{ + TITLE("Exx_Abfs::Construct_Orbs::change_orbs"); + return orbital( get_psi(orbs_in), orbs_in, kmesh_times ); +} + +// P = u/r * Y +/* +template +vector>> Exx_Abfs::Construct_Orbs::abfs_same_atom( + const Orbs_Type &orbs, + const double kmesh_times, + const double norm_threshold ) +{ + const vector>>> + &&abfs_same_atom_psir = psir_mult_psir( orbs ); + const vector>>> + &&abfs_same_atom_psir_orth = orth( abfs_same_atom_psir, orbs, norm_threshold ); + const vector>>> + &&abfs_same_atom_psi_orth = div_r( abfs_same_atom_psir_orth, orbs.get_r_radial ); + const vector>> + &&abfs_same_atom = orbital( abfs_same_atom_psi_orth, orbs, kmesh_times ); + return abfs_same_atom; +} +*/ + +// P = f * Y +vector>> Exx_Abfs::Construct_Orbs::abfs_same_atom( + const vector>> &orbs, + const double kmesh_times_mot, + const double times_threshold ) +{ + TITLE("Exx_Abfs::Construct_Orbs::abfs_same_atom"); + + const vector>>> + abfs_same_atom_psi = psi_mult_psi( orbs ); + + const vector>>> + abfs_same_atom_orth_psi = orth( abfs_same_atom_psi, orbs ); + const vector>> + abfs_same_atom = orbital( abfs_same_atom_orth_psi, orbs, 1 ); + + #if TEST_EXX_LCAO==1 + print_orbs(abfs_same_atom_psi,"abfs_same_atom_psi.dat"); + print_orbs(abfs_same_atom_orth_psi,"abfs_same_atom_orth_psi.dat"); + #elif TEST_EXX_LCAO==-1 + #error "TEST_EXX_LCAO" + #endif + + const vector>>> + abfs_same_atom_pca_psi = pca( abfs_same_atom, orbs, kmesh_times_mot, times_threshold ); + + #if TEST_EXX_LCAO==1 + print_orbs(abfs_same_atom_pca_psi,"abfs_same_atom_pca_psi.dat"); + #elif TEST_EXX_LCAO==-1 + #error "TEST_EXX_LCAO" + #endif + + const vector>> + &&abfs_same_atom_pca = orbital( abfs_same_atom_pca_psi, orbs, 1 ); + return abfs_same_atom_pca; +} + +vector>> Exx_Abfs::Construct_Orbs::orth_orbs( + const vector>> &orbs, + const double norm_threshold ) +{ + TITLE("Exx_Abfs::Construct_Orbs::orth_orbs"); + const vector>>> + orbs_psi = get_psi( orbs ); + const vector>>> + orbs_psi_orth = orth( orbs_psi, orbs, norm_threshold ); + const vector>> + orbs_new = orbital( orbs_psi_orth, orbs, 1 ); + return orbs_new; +} + +/* +template<> +vector>>> Exx_Abfs::Construct_Orbs::psi_mult_psi( + const LCAO_Orbitals &orbs ) +{ + vector>>> psi_mult_psi( orbs.get_ntype() ); + for( int T=0; T!=orbs.get_ntype(); ++T ) + { + psi_mult_psi[T].resize( 2*orbs.Phi[T].getLmax()+1 ); + for( int L1=0; L1<=orbs.Phi[T].getLmax(); ++L1 ) + { + for( int N1=0; N1!=orbs.Phi[T].getNchi(L1); ++N1 ) + { + for( int L2=L1; L2<=orbs.Phi[T].getLmax(); ++L2 ) + { + for( int N2=((L2==L1)?N1:0); N2!=orbs.Phi[T].getNchi(L2); ++N2 ) + { + assert( orbs.Phi[T].PhiLN(L1,N1).getNr()==orbs.Phi[T].PhiLN(L2,N2).getNr() ); + + vector mult_psir( orbs.Phi[T].PhiLN(L1,N1).getNr() ); + for( int ir=0; ir!=orbs.Phi[T].PhiLN(L1,N1).getNr(); ++ir) + { + mult_psir[ir] = orbs.Phi[T].PhiLN(L1,N1).getPsi(ir) * orbs.Phi[T].PhiLN(L2,N2).getPsi(ir) ; + } + for( int L_new=std::abs(L2-L1); L_new<=L1+L2; ++L_new ) + { + psi_mult_psi[T][L_new].push_back(mult_psir); + } + } + } + } + } + } + return psi_mult_psi; +} +*/ + +vector>>> Exx_Abfs::Construct_Orbs::psi_mult_psi( + const vector>> &orbs ) +{ + vector>>> psi_mult_psi( orbs.size() ); + for( int T=0; T!=orbs.size(); ++T ) + { + psi_mult_psi[T].resize( 2*orbs[T].size()-1 ); + for( int L1=0; L1!=orbs[T].size(); ++L1 ) + { + for( int N1=0; N1!=orbs[T][L1].size(); ++N1 ) + { + for( int L2=L1; L2!=orbs[T].size(); ++L2 ) + { + for( int N2=((L2==L1)?N1:0); N2!=orbs[T][L2].size(); ++N2 ) + { + assert( orbs[T][L1][N1].getNr()==orbs[T][L2][N2].getNr() ); + + vector mult_psir( orbs[T][L1][N1].getNr() ); + for( int ir=0; ir!=orbs[T][L1][N1].getNr(); ++ir) + { + mult_psir[ir] = orbs[T][L1][N1].getPsi(ir) * orbs[T][L2][N2].getPsi(ir) ; + } + for( int L_new=std::abs(L1-L2); L_new<=L1+L2; ++L_new ) + { + psi_mult_psi[T][L_new].push_back(mult_psir); + } + } + } + } + } + } + return psi_mult_psi; +} + +/* +template<> +vector>>> Exx_Abfs::Construct_Orbs::psir_mult_psir( + const LCAO_Orbitals &orbs ) +{ + vector>>> psir_mult_psir( orbs.get_ntype() ); + for( int T=0; T!=orbs.get_ntype(); ++T ) + { + psir_mult_psir[T].resize( 2*orbs.Phi[T].getLmax()+1 ); + for( int L1=0; L1<=orbs.Phi[T].getLmax(); ++L1 ) + { + for( int N1=0; N1!=orbs.Phi[T].getNchi(L1); ++N1 ) + { + for( int L2=L1; L2<=orbs.Phi[T].getLmax(); ++L2 ) + { + for( int N2=((L2==L1)?N1:0); N2!=orbs.Phi[T].getNchi(L2); ++N2 ) + { + assert( orbs.Phi[T].PhiLN(L1,N1).getNr()==orbs.Phi[T].PhiLN(L2,N2).getNr() ); + + vector mult_psir( orbs.Phi[T].PhiLN(L1,N1).getNr() ); + for( int ir=0; ir!=orbs.Phi[T].PhiLN(L1,N1).getNr(); ++ir) + { + mult_psir[ir] = orbs.Phi[T].PhiLN(L1,N1).getPsi_r(ir) * orbs.Phi[T].PhiLN(L2,N2).getPsi_r(ir) ; + } + for( int L_new=std::abs(L1-L2); L_new<=L1+L2; ++L_new ) + { + psir_mult_psir[T][L_new].push_back(mult_psir); + } + } + } + } + } + } + return psir_mult_psir; +} +*/ + +vector>>> Exx_Abfs::Construct_Orbs::psir_mult_psir( + const vector>> &orbs ) +{ + vector>>> psir_mult_psir( orbs.size() ); + for( int T=0; T!=orbs.size(); ++T ) + { + psir_mult_psir[T].resize( 2*orbs[T].size()-1 ); + for( int L1=0; L1!=orbs[T].size(); ++L1 ) + { + for( int N1=0; N1!=orbs[T][L1].size(); ++N1 ) + { + for( int L2=L1; L2!=orbs[T].size(); ++L2 ) + { + for( int N2=((L2==L1)?N1:0); N2!=orbs[T][L2].size(); ++N2 ) + { + assert( orbs[T][L1][N1].getNr()==orbs[T][L2][N2].getNr() ); + + vector mult_psir( orbs[T][L1][N1].getNr() ); + for( int ir=0; ir!=orbs[T][L1][N1].getNr(); ++ir) + { + mult_psir[ir] = orbs[T][L1][N1].getPsi_r(ir) * orbs[T][L2][N2].getPsi_r(ir) ; + } + for( int L_new=std::abs(L1-L2); L_new<=L1+L2; ++L_new ) + { + psir_mult_psir[T][L_new].push_back(mult_psir); + } + } + } + } + } + } + return psir_mult_psir; +} + +vector>>> Exx_Abfs::Construct_Orbs::pca( + const vector>> &abfs, + const vector>> &orbs, + const double kmesh_times_mot, + const double times_threshold ) +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); + if(times_threshold>1) + return vector>>>(abfs.size()); + + const vector,matrix>>> && eig = Exx_Abfs::PCA::cal_PCA( orbs, abfs, kmesh_times_mot ); + + const vector>>> && psis = get_psi( abfs ); + vector>>> psis_new( psis.size() ); + + for( size_t T=0; T!=eig.size(); ++T ) + { + double eig_value_max = 0; + for( size_t L=0; L!=eig[T].size(); ++L ) + for( size_t M=0; M!=eig[T][L].first.size(); ++M ) + { +ofs< &eig_value = eig[T][L].first; + const matrix &eig_vec = eig[T][L].second; + for( size_t M=0; M!=eig_value.size(); ++M ) + { + if( eig_value[M] > eig_value_threshold ) + { + vector psi_new( psis[T][L][0].size() ); + for( size_t N=0; N!=psis[T][L].size(); ++N ) + for( size_t ir=0; ir!=psi_new.size(); ++ir ) + psi_new[ir] += eig_vec(M,N) * psis[T][L][N][ir]; + psis_new[T][L].push_back( psi_new ); + } + } + } + } + else + { + WARNING(TO_STRING(__FILE__), + "Element "+TO_STRING(T)+" , all training data (lcao[i]*lcao[j]) are all the same. So PCA randomly choose an abf as the result."); + psis_new[T].resize( psis[T].size() ); + for( size_t L=0; L!=psis[T].size(); ++L ) + if( !psis[T][L].empty() ) + { + psis_new[T][L].push_back(psis[T][L][0]); + break; + } + } + } +ofs.close(); + return psis_new; +} + + +vector>>> Exx_Abfs::Construct_Orbs::orth( + const vector>>> &psis, + const vector>> &orbs, + const double norm_threshold ) +{ + vector>>> psis_orth( psis.size() ); + for( int T=0; T!=psis.size(); ++T ) + { + const Numerical_Orbital_Lm &orb = orbs[T][0][0]; + Gram_Schmidt_Orth gso( + orb.get_rab(), + Gram_Schmidt_Orth::Coordinate::Sphere ); + psis_orth[T].resize( psis[T].size() ); + for( int L=0; L!=psis[T].size(); ++L ) + { + psis_orth[T][L] = gso.cal_orth( psis[T][L], norm_threshold ); // Peize Lin test 2016-10-08 +// psis_orth[T][L] = gso.cal_orth( psis[T][L] ); // Peize Lin test 2016-10-08 + } + } + return psis_orth; +} + +vector>>> Exx_Abfs::Construct_Orbs::div_r( + const vector>>> &psirs, + const vector &r_radial ) +{ + vector>>> psis( psirs.size() ); + for( int T=0; T!=psirs.size(); ++T ) + { + psis[T].resize( psirs[T].size() ); + for( int L=0; L!=psirs[T].size(); ++L ) + { + psis[T][L].resize( psirs[T][L].size() ); + for( int N=0; N!=psirs[T][L].size(); ++N ) + { + psis[T][L][N].resize( psirs[T][L][N].size() ); + psis[T][L][N][0] = 0; + for( int ir=1; ir!=psirs[T][L][N].size(); ++ir ) + { + psis[T][L][N][ir] = psirs[T][L][N][ir] / r_radial[ir]; + } + } + } + } + return psis; +} + +vector>>> Exx_Abfs::Construct_Orbs::get_psi( + const vector>> &orbs ) +{ + vector>>> orbs_psi( orbs.size() ); + for( int T=0; T!=orbs.size(); ++T ) + { + orbs_psi[T].resize( orbs[T].size() ); + for( int L=0; L!=orbs[T].size(); ++L ) + { + orbs_psi[T][L].resize( orbs[T][L].size() ); + for( int N=0; N!=orbs[T][L].size(); ++N ) + { + orbs_psi[T][L][N] = orbs[T][L][N].get_psi(); + } + } + } + return orbs_psi; +} + +vector>> Exx_Abfs::Construct_Orbs::orbital( + const vector>>> &psis, + const vector>> &orbs_info, + const double kmesh_times) +{ + vector>> orbs_new( psis.size() ); + for( int T=0; T!=psis.size(); ++T ) + { + const Numerical_Orbital_Lm &orb_info = orbs_info[T][0][0]; + orbs_new[T].resize( psis[T].size() ); + for( int L=0; L!=psis[T].size(); ++L ) + { + orbs_new[T][L].resize( psis[T][L].size() ); + for( int N=0; N!=psis[T][L].size(); ++N ) + { + orbs_new[T][L][N].set_orbital_info( + orb_info.getLabel(), + T, + L, + N, + orb_info.getNr(), + orb_info.getRab(), + orb_info.getRadial(), + Numerical_Orbital_Lm::Psi_Type::Psi, + VECTOR_TO_PTR(psis[T][L][N]), + static_cast(orb_info.getNk() * kmesh_times) | 1, // Nk must be odd + orb_info.getDk(), // Peize Lin test 2017-04-16 +// orb_info.getDk() / kmesh_times, + orb_info.getDruniform(), + false, + true); + } + } + } + return orbs_new; +} + +/* +vector>>> Exx_Abfs::Construct_Orbs::get_psi( + const LCAO_Orbitals &orbs ) +{ + vector>>> orbs_psi( orbs.get_ntype() ); + for( int T=0; T!=orbs.get_ntype(); ++T ) + { + orbs_psi[T].resize( orbs.Phi[T].getLmax()+1 ); + for( int L=0; L<=orbs.Phi[T].getLmax(); ++L ) + { + orbs_psi[T][L].resize( orbs.Phi[T].getNchi(L) ); + for( int N=0; N!=orbs.Phi[T].getNchi(L); ++N ) + { + orbs_psi[T][L][N] = orbs.Phi[T].PhiLN(L,N).get_psi(); + } + } + } + return orbs_psi; +} +*/ + +/* +template<> +inline const Numerical_Orbital_Lm &Exx_Abfs::Construct_Orbs::get_orbital( + const LCAO_Orbitals &orbs, + const size_t T, const size_t L, const size_t N) +{ + return orbs.Phi[T].PhiLN(L,N); +} +*/ + +/* +template<> +inline const Numerical_Orbital_Lm &Exx_Abfs::Construct_Orbs::get_orbital( + const vector>> &orbs, + const size_t T, const size_t L, const size_t N) +{ + return orbs[T][L][N]; +} +*/ diff --git a/ABACUS.develop/source/src_ri/exx_abfs-construct_orbs.h b/ABACUS.develop/source/src_ri/exx_abfs-construct_orbs.h new file mode 100644 index 0000000000..ff8aff1be0 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-construct_orbs.h @@ -0,0 +1,61 @@ +#ifndef EXX_ABFS_CONSTRUCT_ORBS_H +#define EXX_ABFS_CONSTRUCT_ORBS_H + +#include "exx_abfs.h" + +#include +#include "src_lcao/ORB_atomic_lm.h" + +class LCAO_Orbitals; + +class Exx_Abfs::Construct_Orbs +{ +public: + static vector>> change_orbs( + const LCAO_Orbitals &orb_in, + const double kmesh_times ); + static vector>> change_orbs( + const vector>> &orb_in, + const double kmesh_times ); + + static vector>> abfs_same_atom( + const vector>> &lcaos, + const double kmesh_times_mot, + const double times_threshold=0); + + static vector>> orth_orbs( + const vector>> &orbs, + const double norm_threshold=std::numeric_limits::min() ); + +private: + static vector>>> psi_mult_psi( + const vector>> &lcaos ); + + static vector>>> psir_mult_psir( + const vector>> &lcaos ); + + static vector>>> orth( + const vector>>> &psis, + const vector>> &lcaos, + const double norm_threshold = std::numeric_limits::min() ); + + static vector>>> pca( + const vector>> &abfs, + const vector>> &orbs, + const double kmesh_times_mot, + const double times_threshold ); + + static vector>>> div_r( + const vector>>> &psirs, + const vector &r_radial ); + + static vector>> orbital( + const vector>>> &psis, + const vector>> &orbs_info, + const double kmesh_times); + + static vector>>> get_psi( + const vector>> &orbs ); +}; + +#endif // EXX_ABFS_IO_ASA_H diff --git a/ABACUS.develop/source/src_ri/exx_abfs-dm.cpp b/ABACUS.develop/source/src_ri/exx_abfs-dm.cpp new file mode 100644 index 0000000000..afb50a6b08 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-dm.cpp @@ -0,0 +1,225 @@ +#include "exx_abfs.h" + +#include "src_pw/global.h" +#include "src_global/mathzone.h" +#include "src_pw/charge_pulay.h" +#include "src_global/container_operator.h" + +#include "src_external/src_test/src_global/matrix-test.h" +#include "src_external/src_test/src_global/complexmatrix-test.h" +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "src_external/src_test/src_ri/exx_abfs-dm-test.h" + +void Exx_Abfs::DM::cal_DM( + const set> &atom_pairs, + const vector> &Born_von_Karman_boxes) +{ + TITLE("Exx_Abfs::DM::cal_DM"); + + cal_DMk_mixing( CHR, atom_pairs ); + + for( const pair & atom_pair : atom_pairs ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + const size_t it1 = ucell.iat2it[iat1]; + const size_t it2 = ucell.iat2it[iat2]; + + for( const Vector3 &box : Born_von_Karman_boxes ) + { + DMr[iat1][iat2][box] = vector( NSPIN, {ucell.atoms[it1].nw,ucell.atoms[it2].nw} ); + for( size_t ik=0; ik!=kv.nks; ++ik ) + { + DMr[iat1][iat2][box][kv.isk[ik]] += ( DMk[iat1][iat2][ik] * exp( -TWO_PI*IMAG_UNIT* (kv.kvec_c[ik]* (box*ucell.latvec)) ) ).real(); + } + } + } +} + + + +void Exx_Abfs::DM::cal_DMk_mixing( + const Charge_Broyden &charge, + const set> &atom_pairs ) +{ + TITLE("Exx_Abfs::DM::cal_DMk_mixing"); + + if(flag_mix) + { + if ( charge.mixing_mode == "plain" ) + { + plain_mixing( charge, atom_pairs ); + } + else if ( charge.mixing_mode == "kerker" ) + { + throw invalid_argument("mixing density matrix can't be kerker. In "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + else if ( charge.mixing_mode == "pulay" ) + { + pulay_mixing( charge, atom_pairs ); + } + else if ( charge.mixing_mode == "pulay-kerker" ) + { + throw invalid_argument("mixing density matrix can't be pulay-kerker. In "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + else + { + throw invalid_argument("mixing density matrix error. In "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + } + else + { + DMk = cal_DMk_raw(atom_pairs); +// DMk = Exx_Abfs_DM_Test::cal_DMk_raw_readfile(atom_pairs); // Peize Lin test 2018-03-27 + + #if TEST_EXX_LCAO==1 + static int istep=0; + ofs_matrixes("DMk_"+TO_STRING(istep++)+".dat(@Exx_Abfs::DM::cal_DMk_mixing)",DMk); + #elif TEST_EXX_LCAO==-1 + #error + #endif + } +} + + + +map>> Exx_Abfs::DM::cal_DMk_raw( const set> &atom_pairs ) const +{ + TITLE("Exx_Abfs::DM::cal_DMk_raw"); + + const double SPIN_multiple = 0.5*NSPIN; + + map>> DMk_raw; + for( const pair & atom_pair : atom_pairs ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + const size_t it1 = ucell.iat2it[iat1]; + const size_t it2 = ucell.iat2it[iat2]; + const size_t ia1 = ucell.iat2ia[iat1]; + const size_t ia2 = ucell.iat2ia[iat2]; + + DMk_raw[iat1][iat2] = vector( kv.nks, {ucell.atoms[it1].nw,ucell.atoms[it2].nw} ); + for( size_t ik=0; ik!=kv.nks; ++ik ) + { + for( size_t iw1=0; iw1!=ucell.atoms[it1].nw; ++iw1 ) + { + for( size_t iw2=0; iw2!=ucell.atoms[it2].nw; ++iw2 ) + { + for( size_t ib=0; ib!=NBANDS; ++ib ) + { + if( GAMMA_ONLY_LOCAL ) + { + //--------------------------------------------------------- + // LOWF.WFC_GAMMA has been replaced by wfc_dm_2d.cpp + // we need to fix this function in near future. + // -- mohan add 2021-02-09 + //--------------------------------------------------------- + WARNING_QUIT("Exx_Abfs::DM::cal_DMk_raw","need to update LOWF.WFC_GAMMA"); +// DMk_raw[iat1][iat2][ik](iw1,iw2) += wf.wg(ik,ib) +// * LOWF.WFC_GAMMA[ik][ib][ucell.itiaiw2iwt(it1,ia1,iw1)] +// * LOWF.WFC_GAMMA[ik][ib][ucell.itiaiw2iwt(it2,ia2,iw2)]; + } + else + { + DMk_raw[iat1][iat2][ik](iw1,iw2) += wf.wg(ik,ib) + * LOWF.WFC_K[ik][ib][ucell.itiaiw2iwt(it1,ia1,iw1)] + * conj(LOWF.WFC_K[ik][ib][ucell.itiaiw2iwt(it2,ia2,iw2)]); + } + } + } + } + DMk_raw[iat1][iat2][ik] *= SPIN_multiple; + } + } + + #if TEST_EXX_LCAO==1 + static int istep=0; + ofs_matrixes("DMk_raw_"+TO_STRING(istep++)+".dat(@Exx_Abfs::DM::cal_DMk_raw)",DMk_raw); + #elif TEST_EXX_LCAO==-1 + #error + #endif + return DMk_raw; +} + + + +void Exx_Abfs::DM::plain_mixing( + const Charge_Broyden &charge, + const set> &atom_pairs) +{ + TITLE("Exx_Abfs::DM::plain_mixing"); + + if(DMk.empty()) + DMk = cal_DMk_raw(atom_pairs); + else + DMk = charge.mixing_beta * cal_DMk_raw(atom_pairs) + (1-charge.mixing_beta) * DMk; +} + + + +void Exx_Abfs::DM::pulay_mixing( + const Charge_Broyden &charge, + const set> &atom_pairs) +{ + if( 1==charge.totstep ) + { + DMk_pulay_seq.clear(); + } + + DMk_pulay_seq.push_back( charge.mixing_beta * cal_DMk_raw(atom_pairs) + (1-charge.mixing_beta) * DMk ); + if( charge.totstep > charge.rstep ) + DMk_pulay_seq.pop_front(); + + if( 1==charge.totstep ) + { + DMk = DMk_pulay_seq.front(); + } + else + { + const int alpha_size = DMk_pulay_seq.size()-1; + const int alpha_end = charge.idstep; + const int alpha_begin = alpha_end - alpha_size; + auto alpha_index = [&](const int i){ return ((alpha_begin+i)%charge.dstep+charge.dstep)%charge.dstep; }; + + DMk = (1+charge.alpha[alpha_index(alpha_size-1)]) * DMk_pulay_seq.back(); + for( size_t i=1; i +#include +#include + +class Charge_Broyden; + +class Exx_Abfs::DM +{ +public: + map>> DMk; // DMk[iat1][iat2][ik](iw1,iw2) + map,vector>>> DMr; // DMr[iat1][iat2][box][is](iw1,iw2) + deque>>> DMk_pulay_seq; // DMk_pulay_seq[istep][iat1][iat2][ik](iw1,iw2) +// double DM_threshold = std::numeric_limits::min(); + bool flag_mix; + +public: + void cal_DM( + const set> &atom_pairs, + const vector> &Born_von_Karman_boxes); + map>> cal_DMk_raw( const set> &atom_pairs ) const; + +private: + void cal_DMk_mixing( + const Charge_Broyden &charge, + const set> &atom_pairs ); + void plain_mixing( + const Charge_Broyden &charge, + const set> &atom_pairs); + void pulay_mixing( + const Charge_Broyden &charge, + const set> &atom_pairs); + +// double cal_DM_delta(); + +// void set_DM_threshold(double DM_threshold_in) { DM_threshold = DM_threshold_in; } +// double get_DM_threshold() const { return DM_threshold; } +}; + +#endif // EXX_ABFS_DM_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-inl.h b/ABACUS.develop/source/src_ri/exx_abfs-inl.h new file mode 100644 index 0000000000..c8c4c2ee22 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-inl.h @@ -0,0 +1,73 @@ +#ifndef EXX_ABFS_INL_H +#define EXX_ABFS_INL_H + +#include "exx_abfs.h" + +template +void Exx_Abfs::minus_matrixes( + map &A, + const map &B) const +{ + for( auto & a : A ) + { + const T1 i = a.first; + minus_matrixes( a.second, B.at(i) ); + } + return A; +} + +template +void Exx_Abfs::minus_matrixes( + vector &A, + const vector &B) const +{ + for( size_t i=0; i!=A.size(); ++i ) + minus_matrixes( A[i], B[i] ); + return A; +} + +template<> +void Exx_Abfs::minus_matrixes( + matrix &A, + const matrix &B) const +{ + A -= B; +} + + +/* +map>>> &Exx_Abfs::minus_matrixes( + map>>> &mAs, + const map>>> & mBs) const +{ + for( const auto m1 : mBs ) + { + const size_t i1 = m1.first; + for( const auto m2 : m1.second ) + { + const size_t i2 = m2.first; + for( const auto m3 : m2.second ) + { + const size_t i3 = m3.first; + for( const auto m4 : m3.second ) + { + const size_t i4 = m4.first; + + // Peize Lin test + cout< + +#include "src_external/src_test/src_global/matrix-test.h" // Peize Lin test + +void Exx_Abfs::Inverse_Matrix_Double::init(const int &dim_in) +{ + this->dim = dim_in; + assert(dim>0); + + this->info = 0; + this->A.create(dim, dim,false); +} + +void Exx_Abfs::Inverse_Matrix_Double::cal_inverse( const Method &method ) +{ + #if TEST_EXX_LCAO==1 + static int i=0; + ofstream ofs("inverse_matrix_"+TO_STRING(i)); + ofs<threshold) ? (1.0/eigen_value[i]) : 0; + A = transpose(A) * eigen_value_inverse * A; + */ + + matrix eA( A.nr, A.nc ); + int ie=0; + for( int i=0; i!=A.nr; ++i ) + if( eigen_value[i] > threshold ) + { + LapackConnector::axpy( A.nc, sqrt(1.0/eigen_value[i]), A.c+i*A.nc,1, eA.c+ie*eA.nc,1 ); + ++ie; + } + LapackConnector::gemm( 'T','N', eA.nc,eA.nc,ie, 1, eA.c,eA.nc, eA.c,eA.nc, 0, A.c,A.nc ); +} + + +void Exx_Abfs::Inverse_Matrix_Double::input( const matrix &m ) +{ + for( size_t ir=0; ir!=m.nr; ++ir ) + for( size_t ic=0; ic!=m.nc; ++ic ) + A(ir,ic) = m(ir,ic); +} + +void Exx_Abfs::Inverse_Matrix_Double::input( + const matrix &m_00, + const matrix &m_01, + const matrix &m_10, + const matrix &m_11) +{ + const size_t delta_nr = m_00.nr, delta_nc = m_00.nc; + + for( size_t ir=0; ir!=m_00.nr; ++ir ) + for( size_t ic=0; ic!=m_00.nc; ++ic ) + A(ir,ic) = m_00(ir,ic); + for( size_t ir=0; ir!=m_01.nr; ++ir ) + for( size_t ic=0; ic!=m_01.nc; ++ic ) + A(ir,ic+delta_nc) = m_01(ir,ic); + for( size_t ir=0; ir!=m_10.nr; ++ir ) + for( size_t ic=0; ic!=m_10.nc; ++ic ) + A(ir+delta_nr,ic) = m_10(ir,ic); + for( size_t ir=0; ir!=m_11.nr; ++ir ) + for( size_t ic=0; ic!=m_11.nc; ++ic ) + A(ir+delta_nr,ic+delta_nc) = m_11(ir,ic); +} + +void Exx_Abfs::Inverse_Matrix_Double::output( matrix &m ) const +{ + for( size_t ir=0; ir!=m.nr; ++ir ) + for( size_t ic=0; ic!=m.nc; ++ic ) + m(ir,ic) = A(ir,ic); +} + +void Exx_Abfs::Inverse_Matrix_Double::output( + matrix &m_00, + matrix &m_01, + matrix &m_10, + matrix &m_11) const +{ + const size_t delta_nr = m_00.nr, delta_nc = m_00.nc; + + for( size_t ir=0; ir!=m_00.nr; ++ir ) + for( size_t ic=0; ic!=m_00.nc; ++ic ) + m_00(ir,ic) = A(ir,ic); + for( size_t ir=0; ir!=m_01.nr; ++ir ) + for( size_t ic=0; ic!=m_01.nc; ++ic ) + m_01(ir,ic) = A(ir,ic+delta_nc); + for( size_t ir=0; ir!=m_10.nr; ++ir ) + for( size_t ic=0; ic!=m_10.nc; ++ic ) + m_10(ir,ic) = A(ir+delta_nr,ic); + for( size_t ir=0; ir!=m_11.nr; ++ir ) + for( size_t ic=0; ic!=m_11.nc; ++ic ) + m_11(ir,ic) = A(ir+delta_nr,ic+delta_nc); +} + +void Exx_Abfs::Inverse_Matrix_Double::copy_down_triangle() +{ + for( size_t ir=0; ir!=A.nr; ++ir ) + for( size_t ic=0; ic!=ir; ++ic ) + A(ir,ic) = A(ic,ir); +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-inverse_matrix_double.h b/ABACUS.develop/source/src_ri/exx_abfs-inverse_matrix_double.h new file mode 100644 index 0000000000..c4e9cbd478 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-inverse_matrix_double.h @@ -0,0 +1,57 @@ +#ifndef EXX_ABFS_INVERSE_MATRIX_DOUBLE_H +#define EXX_ABFS_INVERSE_MATRIX_DOUBLE_H + +#include "exx_abfs.h" + +#include "src_global/matrix.h" + +#include + +class Exx_Abfs::Inverse_Matrix_Double +{ +public: + enum class Method{dpotrf,dsyev}; + + matrix A; + void init( const int &dim_in); + + void input( const matrix &m ); + void input( const shared_ptr &pm ) { input(*pm); } + void input( + const matrix &m_00, + const matrix &m_01, + const matrix &m_10, + const matrix &m_11); + void input( + const shared_ptr &pm_00, + const shared_ptr &pm_01, + const shared_ptr &pm_10, + const shared_ptr &pm_11) { input( *pm_00, *pm_01, *pm_10, *pm_11 ); } + + void cal_inverse( const Method &method ); + + void output( matrix &m ) const; + void output( const shared_ptr &pm ) const { output(*pm); } + void output( + matrix &m_00, + matrix &m_01, + matrix &m_10, + matrix &m_11) const; + void output( + const shared_ptr &pm_00, + const shared_ptr &pm_01, + const shared_ptr &pm_10, + const shared_ptr &pm_11) const { output( *pm_00, *pm_01, *pm_10, *pm_11 ); } + +private: + + void using_dpotrf(); + void using_dsyev( const double &threshold_condition_number = 0 ); + + void copy_down_triangle(); + + int dim; + int info; +}; + +#endif // EXX_ABFS_INVERSE_MATRIX_DOUBLE_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-io-template.h b/ABACUS.develop/source/src_ri/exx_abfs-io-template.h new file mode 100644 index 0000000000..a5782ea357 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-io-template.h @@ -0,0 +1,109 @@ +#ifndef EXX_ABFS_IO_TEMPLATE_H +#define EXX_ABFS_IO_TEMPLATE_H + +#include "src_ri/exx_abfs-io.h" +#include +#include + +#ifdef USE_BOOST_SERIALIZATION + #include "src_global/serialization_boost.h" +#elif defined USE_CEREAL_SERIALIZATION + #include "src_global/serialization_cereal.h" +#endif + +template +void Exx_Abfs::IO::output_binary( const T &data, const std::string &file_name ) +{ + std::ofstream ofs(file_name,std::ios::binary); + #ifdef USE_BOOST_SERIALIZATION + boost::archive::binary_oarchive oa(ofs); + oa << data; + #elif defined USE_CEREAL_SERIALIZATION + cereal::BinaryOutputArchive ar(ofs); + ar(data); + #else + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + #endif + ofs.close(); +} + +template +T Exx_Abfs::IO::input_binary( const std::string &file_name ) +{ + T data; + std::ifstream ifs(file_name,std::ios::binary); + #ifdef USE_BOOST_SERIALIZATION + boost::archive::binary_iarchive ia(ifs); + ia >> data; + #elif defined USE_CEREAL_SERIALIZATION + cereal::BinaryInputArchive ar(ifs); + ar(data); + #else + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + #endif + ifs.close(); + return data; +} + +template +void Exx_Abfs::IO::output_text( const T &data, const std::string &file_name ) +{ + std::ofstream ofs(file_name); + #ifdef USE_BOOST_SERIALIZATION + boost::archive::text_oarchive oa(ofs); + oa << std::move(data); + #elif defined USE_CEREAL_SERIALIZATION + cereal::JSONOutputArchive ar(ofs); + ar(data); + #else + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + #endif + ofs.close(); +} + +template +T Exx_Abfs::IO::input_text( const std::string &file_name ) +{ + T data; + std::ifstream ifs(file_name); + #ifdef USE_BOOST_SERIALIZATION + boost::archive::text_iarchive ia(ifs); + ia >> data; + #elif defined USE_CEREAL_SERIALIZATION + cereal::JSONInputArchive ar(ifs); + ar(data); + #else + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + #endif + ifs.close(); + return data; +} + +template +void Exx_Abfs::IO::bcast( T &data, const int rank_src, MPI_Comm mpi_comm ) +{ + int my_rank; MPI_Comm_rank( mpi_comm, &my_rank ); + #ifdef USE_BOOST_SERIALIZATION + if(MY_RANK==rank_src) + { + boost::mpi::packed_oarchive oar(mpi_comm); + oar << data; + const int data_size = oar.size(); + MPI_Bcast( const_cast(&data_size), 1, MPI_INT, rank_src, mpi_comm ); + MPI_Bcast( const_cast(oar.address()), oar.size(), MPI_PACKED, rank_src, mpi_comm ); + } + else + { + int data_size; + MPI_Bcast( &data_size, 1, MPI_INT, rank_src, mpi_comm ); + boost::mpi::packed_iarchive iar(mpi_comm); + iar.resize(data_size); + MPI_Bcast( iar.address(), data_size, MPI_PACKED, rank_src, mpi_comm ); + iar >> data; + } + #else + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + #endif +} + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-io.cpp b/ABACUS.develop/source/src_ri/exx_abfs-io.cpp new file mode 100644 index 0000000000..d390bcb293 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-io.cpp @@ -0,0 +1,513 @@ +#include +#include + +#include "exx_abfs-io.h" +#include "exx_abfs-jle.h" +#include "exx_abfs-abfs_index.h" +#include "src_pw/global.h" +#include "src_lcao/ORB_read.h" +#include "src_global/global_function.h" + + +vector>> Exx_Abfs::IO::construct_abfs( + const LCAO_Orbitals &orbs, + const vector &files_abfs, + const double kmesh_times ) +{ + vector>> abfs( files_abfs.size() ); + for( size_t T=0; T!=files_abfs.size(); ++T ) + abfs[T] = construct_abfs_T( + files_abfs[T], + T, + static_cast(orbs.get_kmesh() * kmesh_times) | 1, // Nk must be odd +// orbs.get_dk() / kmesh_times, + orbs.get_dk(), // Peize Lin change 2017-04-16 + orbs.get_dr_uniform() ); + + return abfs; +} + +vector>> Exx_Abfs::IO::construct_abfs( + const vector>> & abfs_pre, + const LCAO_Orbitals &orbs, + const vector &files_abfs, + const double kmesh_times ) +{ + vector>> + &&abfs = construct_abfs( orbs, files_abfs, kmesh_times ); + + assert( abfs.size() == abfs_pre.size() ); + for( size_t T=0; T!=abfs.size(); ++T ) + { + if( abfs[T].size() < abfs_pre[T].size() ) + abfs[T].resize( abfs_pre[T].size() ); + for( size_t L=0; L!=abfs_pre[T].size(); ++L ) + { + abfs[T][L].insert( abfs[T][L].begin(), abfs_pre[T][L].begin(), abfs_pre[T][L].end() ); + } + } + + return abfs; +} + +vector> Exx_Abfs::IO::construct_abfs_T( + const string & file_name, + const int &T, + const int &nk, + const double &dk, + const double &dr_uniform) +{ + string label; + size_t L_size; + map N_size; + size_t meshr; + double dr; + map>> psis; + + /*---------------------- + 1.read abfs + ----------------------*/ + string word; + + ifstream ifs( file_name.c_str() ); + if(!ifs) + throw runtime_error(" Can't find the abfs ORBITAL file."); + + while( ifs.good() ) + { + ifs >> word; + + if( "Element"==word ) + { + READ_VALUE( ifs, label ); + } + else if ( "Lmax"==word ) + { + READ_VALUE( ifs, L_size ); + + if( L_size>=9 ) + { + stringstream ss; + ss<<"Lmax>=9 error in "<<__FILE__<<" line "<<__LINE__; + throw invalid_argument(ss.str()); + } + } + else if ( "Sorbital-->"==word ) + { + READ_VALUE( ifs, N_size[0] ); + } + else if ( "Porbital-->"==word ) + { + READ_VALUE( ifs, N_size[1] ); + } + else if ( "Dorbital-->"==word ) + { + READ_VALUE( ifs, N_size[2] ); + } + else if ( "Forbital-->"==word ) + { + READ_VALUE( ifs, N_size[3] ); + } + else if ( "Gorbital-->"==word ) + { + READ_VALUE( ifs, N_size[4] ); + } + else if ( "Horbital-->"==word ) + { + READ_VALUE( ifs, N_size[5] ); + } + else if ( "Iorbital-->"==word ) + { + READ_VALUE( ifs, N_size[6] ); + } + else if ( "Jorbital-->"==word ) + { + READ_VALUE( ifs, N_size[7] ); + } + else if ( "Korbital-->"==word ) + { + READ_VALUE( ifs, N_size[8] ); + } + else if ( "END"==word ) + { + break; + } + } + + CHECK_NAME(ifs, "Mesh"); + ifs >> meshr; + + CHECK_NAME(ifs, "dr"); + ifs >> dr; + + while(ifs.good()) + { + ifs >> word; + if(word=="Type") + { + string s_L, s_N; + ifs >> s_L >> s_N; + + size_t T,L,N; + ifs >> T >> L >> N; + + psis[L][N].resize(meshr); + for(int ir=0; ir!=meshr; ir++) + { + ifs >> psis[L][N][ir]; + } + } + + } + ifs.close(); + + + /*---------------------- + 2.check L,N orbital + ----------------------*/ + for( size_t L=0; L<=L_size; ++L ) + if( N_size.find(L) == N_size.end() ) + { + stringstream ss; + ss<<"Can't find N of L="< rab(meshr); + vector radial(meshr); + for( int ir=0; ir!=meshr; ++ir ) + { + rab[ir] = dr; + radial[ir] = ir*dr; //mohan 2010-04-19 + } + + + /*---------------------- + 4.normalize psi + ----------------------*/ + for( size_t L=0; L<=L_size; ++L ) + { + for( size_t N=0; N!=N_size[L]; ++N ) + { + vector psir(meshr); + vector inner(meshr); + psis[L][N].resize(meshr); + for( int ir=0; ir!=meshr; ++ir ) + { + psir[ir] = psis[L][N][ir] * radial[ir]; + inner[ir] = psir[ir] * psir[ir]; + } + double unit = 0.0; + Mathzone::Simpson_Integral(meshr, VECTOR_TO_PTR(inner), VECTOR_TO_PTR(rab), unit); + for( int ir=0; ir!=meshr; ++ir ) + { + psis[L][N][ir] /= sqrt(unit); + } + } + } + + + /*---------------------- + 5.construct abfs + ----------------------*/ + vector> abfs_T; + + abfs_T.resize(L_size+1); + for( size_t L=0; L<=L_size; ++L ) + { + abfs_T[L].resize(N_size[L]); + for( size_t N=0; N!=N_size[L]; ++N ) + { + abfs_T[L][N].set_orbital_info( + label, + T, //type + L, //angular momentum L + N, // number of orbitals of this L + meshr, // number of radial mesh + VECTOR_TO_PTR(rab), + VECTOR_TO_PTR(radial),// radial mesh value(a.u.) + Numerical_Orbital_Lm::Psi_Type::Psi, + VECTOR_TO_PTR(psis[L][N]), // radial wave function + nk, + dk, + dr_uniform, + false, + true); + } + } + + return abfs_T; +} + +void Exx_Abfs::IO::print_matrix( + const string &file_name_prefix, + const map>>>> &matrixes_Q, + const map>>> &matrixes_S, + const map>>> &matrixes_V, + const Element_Basis_Index::Range &range_jles, + const Element_Basis_Index::IndexLNM &index_jles, + const Element_Basis_Index::Range &range_lcaos, + const Element_Basis_Index::IndexLNM &index_lcaos ) +{ + auto print_header = [&]( ofstream &ofs, size_t TA, size_t IA, size_t TB, size_t IB ) + { + ofs << ucell.lat0 << endl; + + ofs << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; + ofs << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; + ofs << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; + + if( TA==TB ) + { + ofs << 1 << " ntype" << endl; + ofs << ucell.atoms[TA].label << " label" << endl; + if( IA==IB ) + { + ofs << 1 << " na" << endl; + ofs << ucell.atoms[TA].tau[IA].x << " " + << ucell.atoms[TA].tau[IA].y << " " + << ucell.atoms[TA].tau[IA].z << endl; + } + else + { + ofs << 2 << " na" << endl; + ofs << ucell.atoms[TA].tau[IA].x << " " + << ucell.atoms[TA].tau[IA].y << " " + << ucell.atoms[TA].tau[IA].z << endl; + ofs << ucell.atoms[TB].tau[IB].x << " " + << ucell.atoms[TB].tau[IB].y << " " + << ucell.atoms[TB].tau[IB].z << endl; + } + } + else + { + ofs << 2 << " ntype" << endl; + ofs << ucell.atoms[TA].label << " label" << endl; + ofs << 1 << " na" << endl; + ofs << ucell.atoms[TA].tau[IA].x << " " + << ucell.atoms[TA].tau[IA].y << " " + << ucell.atoms[TA].tau[IA].z << endl; + ofs << ucell.atoms[TB].label << " label" << endl; + ofs << 1 << " na" << endl; + ofs << ucell.atoms[TB].tau[IB].x << " " + << ucell.atoms[TB].tau[IB].y << " " + << ucell.atoms[TB].tau[IB].z << endl; + } + + // ecutwfc_jlq determine the jlq corresponding to plane wave calculation. + ofs << Exx_Abfs::Jle::Ecut_exx << " ecutwfc" << endl; // mohan add 2009-09-08 + + // this parameter determine the total number of jlq. + ofs << Exx_Abfs::Jle::Ecut_exx << " ecutwfc_jlq" << endl;//mohan modify 2009-09-08 + + assert( ORB.Phi[TA].getRcut() == ORB.Phi[TB].getRcut() ); + ofs << ORB.Phi[TA].getRcut() << " rcut_Jlq" << endl; + + // mohan add 'smooth' and 'sigma' 2009-08-28 + ofs << 0 << " smooth" << endl; + ofs << 0 << " sigma" << endl; + + ofs << Exx_Abfs::Jle::tolerence << " tolerence" << endl; + + ofs << Exx_Abfs::Jle::Lmax << " lmax" << endl; + + ofs << kv.nkstot << " nks" << endl; + ofs << index_lcaos[TA].count_size * index_lcaos[TB].count_size << " nbands" << endl; + + auto cal_sum_M = [&range_jles](size_t T) -> size_t + { + size_t sum_M = 0; + for( size_t L = 0; L!=range_jles[T].size(); ++L ) + sum_M += range_jles[T][L].M; + return sum_M; + }; + const size_t nwfc = (TA==TB && IA==IB) ? cal_sum_M(TA) : cal_sum_M(TA)+cal_sum_M(TB); + ofs << nwfc << " nwfc" << endl; + + const size_t ecut_numberA = static_cast( sqrt( Exx_Abfs::Jle::Ecut_exx ) * ORB.Phi[TA].getRcut() / PI ); // Rydberg Unit + const size_t ecut_numberB = static_cast( sqrt( Exx_Abfs::Jle::Ecut_exx ) * ORB.Phi[TB].getRcut() / PI ); // Rydberg Unit + assert( ecut_numberA == ecut_numberB ); + ofs << ecut_numberA << " ne" << endl; + + ofs << "" << endl; + for( int ik=0; ik!=kv.nkstot; ++ik ) + { + ofs << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y << " " << kv.kvec_c[ik].z; + ofs << " " << kv.wk[ik] * 0.5 << endl; + } + ofs << "" << endl; + + ofs << endl; + }; + + auto print_Q = [&]( ofstream &ofs, const size_t TA, const size_t IA, const size_t TB, const size_t IB, const double scale=1 ) + { + /*--------------------- + < jY | Psi > + ---------------------*/ + + ofs<< "" << std::endl; + + for( int ik=0; ik!=kv.nkstot; ++ik ) + for( size_t LA=0; LA!=range_lcaos[TA].size(); ++LA ) + for( size_t NA=0; NA!=range_lcaos[TA][LA].N; ++NA ) + for( size_t MA=0; MA!=range_lcaos[TA][LA].M; ++MA ) + for( size_t LB=0; LB!=range_lcaos[TB].size(); ++LB ) + for( size_t NB=0; NB!=range_lcaos[TB][LB].N; ++NB ) + for( size_t MB=0; MB!=range_lcaos[TB][LB].M; ++MB ) + { + const vector & matrix_Q = matrixes_Q.at(TA).at(IA).at(TB).at(IB); + const size_t index_lcao + = Exx_Abfs::Abfs_Index::get_index_index( + index_lcaos,TA,LA,NA,MA, + index_lcaos,TB,LB,NB,MB ); + + auto f = [&]( size_t Tj, size_t Ij ) + { + for( size_t Lj=0; Lj!=range_jles[Tj].size(); ++Lj ) + for( size_t Mj=0; Mj!=range_jles[Tj][Lj].M; ++Mj ) // attention! M first N second + for( size_t Nj=0; Nj!=range_jles[Tj][Lj].N; ++Nj ) + ofs << matrix_Q[Ij]( + index_lcao, + index_jles[Tj][Lj][Nj][Mj] ) + * scale << "\t" + << 0.0 * scale << std::endl; + }; + + if( TA==TB && IA==IB ) + { + f(TA,0); + } + else + { + f(TA,0); + f(TB,1); + } + } + + + ofs<< "" << std::endl << std::endl; + }; + + + auto print_S = [&]( ofstream &ofs, const size_t TA, const size_t IA, const size_t TB, const size_t IB, const double scale=1 ) + { + /*--------------------- + < jY | jY > + ---------------------*/ + auto q1q2 = [&]( size_t T1, size_t I1, size_t T2, size_t I2, size_t L1, size_t M1, size_t L2, size_t M2) + { + const matrix & matrix_S = matrixes_S.at(T1).at(I1).at(T2).at(I2); + for( size_t N1=0; N1!=range_jles[T1][L1].N; ++N1) + for( size_t N2=0; N2!=range_jles[T2][L2].N; ++N2) + ofs<< matrix_S( index_jles[T1][L1][N1][M1], index_jles[T2][L2][N2][M2] ) * scale << "\t" << 0.0 * scale << std::endl; + }; + + auto atom2 = [&]( size_t T1, size_t I1, size_t T2, size_t I2, size_t L1, size_t M1) + { + for( size_t L2=0; L2!=range_jles[T2].size(); ++L2 ) + for( size_t M2=0; M2!=range_jles[T2][L2].M; ++M2 ) + q1q2(T1,I1,T2,I2,L1,M1,L2,M2); + }; + + auto atom1 = [&]( size_t T1, size_t I1) + { + for( size_t L1=0; L1!=range_jles[T1].size(); ++L1 ) + for( size_t M1=0; M1!=range_jles[T1][L1].M; ++M1 ) + { + if( TA==TB && IA==IB ) + { + atom2(T1,I1,TA,IA,L1,M1); + } + else + { + atom2(T1,I1,TA,IA,L1,M1); + atom2(T1,I1,TB,IB,L1,M1); + } + } + }; + + ofs<< "" <" << std::endl << std::endl; + }; + + + auto print_V = [&]( ofstream &ofs, const size_t TA, const size_t IA, const size_t TB, const size_t IB, const double scale=1 ) + { + /*--------------------- + < Psi | Psi > + ---------------------*/ + ofs << "" << std::endl; + + const matrix & matrix_V = matrixes_V.at(TA).at(IA).at(TB).at(IB); + + for( int ik=0; ik!=kv.nkstot; ++ik ) + // for ib = 0 to NBANDS + for( size_t LA=0; LA!=range_lcaos[TA].size(); ++LA ) + for( size_t NA=0; NA!=range_lcaos[TA][LA].N; ++NA ) + for( size_t MA=0; MA!=range_lcaos[TA][LA].M; ++MA ) + for( size_t LB=0; LB!=range_lcaos[TB].size(); ++LB ) + for( size_t NB=0; NB!=range_lcaos[TB][LB].N; ++NB ) + for( size_t MB=0; MB!=range_lcaos[TB][LB].M; ++MB ) + ofs << matrix_V( index_lcaos[TA][LA][NA][MA], index_lcaos[TB][LB][NB][MB] ) * scale << std::endl; + + ofs << "" << std::endl << std::endl; + }; + + + auto cal_R2 = []( const size_t TA, const size_t IA, const size_t TB, const size_t IB ) ->double + { + Numerical_Orbital::set_position( ucell.atoms[TA].tau[IA], ucell.atoms[TB].tau[IB] ); + const double R = Numerical_Orbital::get_distance()*ucell.lat0; + return R*R; + }; + + for( size_t TA=0; TA!=ucell.ntype; ++TA ) + { + for( size_t IA=0; IA!=ucell.atoms[TA].na; ++IA ) + { + for( size_t TB=TA; TB!=ucell.ntype; ++TB ) + { + for( size_t IB=((TB==TA)?IA:0); IB!=ucell.atoms[TB].na; ++IB ) + { + ofstream ofs(( file_name_prefix+"matrix_"+TO_STRING(TA)+"_"+TO_STRING(IA)+"_"+TO_STRING(TB)+"_"+TO_STRING(IB) ).c_str()); + print_header( ofs, TA, IA, TB, IB ); +// const double scale = 1.0 / max( matrixes_V.at(TA).at(IA).at(TB).at(IB) ); + const double scale = 1; // Peize Lin test +// const double scale = cal_R2(TA,IA,TB,IB); + print_Q( ofs, TA, IA, TB, IB, sqrt(scale) ); + print_S( ofs, TA, IA, TB, IB ); + print_V( ofs, TA, IA, TB, IB, scale ); + } + } + } + } +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-io.h b/ABACUS.develop/source/src_ri/exx_abfs-io.h new file mode 100644 index 0000000000..cbe6feca28 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-io.h @@ -0,0 +1,58 @@ +#ifndef EXX_ABFS_IO_H +#define EXX_ABFS_IO_H + +#include "exx_abfs.h" + +#include +#include +#include "src_lcao/ORB_atomic_lm.h" +#include "src_global/matrix.h" +#include "src_global/element_basis_index.h" + +class LCAO_Orbitals; + +class Exx_Abfs::IO +{ +public: + static void print_matrix( + const string &file_name_prefix, + const map>>>> &matrixes_Q, + const map>>> &matrixes_S, + const map>>> &matrixes_V, + const Element_Basis_Index::Range &range_jles, + const Element_Basis_Index::IndexLNM &index_jles, + const Element_Basis_Index::Range &range_lcaos, + const Element_Basis_Index::IndexLNM &index_lcaos ); + + static vector>> construct_abfs( + const LCAO_Orbitals &orbs, + const vector &files_abfs, + const double kmesh_times=1 ); // close dK, keep Kcut + + static vector>> construct_abfs( + const vector>> &abfs_pre, + const LCAO_Orbitals &orbs, + const vector &files_abfs, + const double kmesh_times=1 ); // close dK, keep Kcut + + template + static void output_binary( const T &data, const string &file_name ); + template + static T input_binary( const string &file_name ); + template + static void output_text( const T &data, const string &file_name ); + template + static T input_text( const string &file_name ); + template + static void bcast( T &data, const int rank_src, MPI_Comm mpi_comm ); + +private: + static vector> construct_abfs_T( + const string & file_name, + const int &T, + const int &nk, + const double &dk, + const double &dr_uniform); +}; + +#endif // EXX_ABFS_IO_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-jle.cpp b/ABACUS.develop/source/src_ri/exx_abfs-jle.cpp new file mode 100644 index 0000000000..cc0d707b9d --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-jle.cpp @@ -0,0 +1,56 @@ +#include "exx_abfs-jle.h" + +#include "../src_pw/global.h" +#include "src_lcao/ORB_read.h" +#include "../src_global/global_function.h" +#include "../src_global/mathzone.h" + +int Exx_Abfs::Jle::Lmax = 2; +double Exx_Abfs::Jle::Ecut_exx = 60; +double Exx_Abfs::Jle::tolerence = 1.0e-12; + +void Exx_Abfs::Jle::init_jle( const double kmesh_times ) +{ + jle.resize( ucell.ntype ); + + for (int T = 0; T < ucell.ntype ; T++) + { + jle[T].resize( Lmax+1 ); + for (int L=0; L <= Lmax ; ++L) + { + const size_t ecut_number + = static_cast( sqrt( Ecut_exx ) * ORB.Phi[T].getRcut() / PI ); // Rydberg Unit. + + jle[T][L].resize( ecut_number ); + + vector en(ecut_number, 0.0); + Mathzone::Spherical_Bessel_Roots(ecut_number, L, tolerence, VECTOR_TO_PTR(en), ORB.Phi[T].getRcut()); + + for(size_t E=0; E!=ecut_number; ++E) + { + vector jle_r( ORB.Phi[T].PhiLN(0,0).getNr() ); + Mathzone::Spherical_Bessel( + ORB.Phi[T].PhiLN(0,0).getNr(), + ORB.Phi[T].PhiLN(0,0).getRadial(), + en[E], + L, + VECTOR_TO_PTR(jle_r)); + jle[T][L][E].set_orbital_info( + ORB.Phi[T].PhiLN(0,0).getLabel(), + ORB.Phi[T].PhiLN(0,0).getType(), + L, + E, // N? + ORB.Phi[T].PhiLN(0,0).getNr(), + ORB.Phi[T].PhiLN(0,0).getRab(), + ORB.Phi[T].PhiLN(0,0).getRadial(), + Numerical_Orbital_Lm::Psi_Type::Psi, + VECTOR_TO_PTR(jle_r), + static_cast(ORB.Phi[T].PhiLN(0,0).getNk() * kmesh_times) | 1, + ORB.Phi[T].PhiLN(0,0).getDk(), + ORB.Phi[T].PhiLN(0,0).getDruniform(), + false, + true); + } + } + } +} diff --git a/ABACUS.develop/source/src_ri/exx_abfs-jle.h b/ABACUS.develop/source/src_ri/exx_abfs-jle.h new file mode 100644 index 0000000000..f85c643ef3 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-jle.h @@ -0,0 +1,25 @@ +#ifndef EXX_ABFS_JLE_H +#define EXX_ABFS_JLE_H + +#include "exx_abfs.h" + +#include +#include "src_lcao/ORB_atomic_lm.h" + +class Exx_Abfs::Jle +{ +public: + + vector< + vector< + vector< + Numerical_Orbital_Lm>>> jle; + + void init_jle( const double kmesh_times ); + + static int Lmax; + static double Ecut_exx; + static double tolerence; +}; + +#endif // EXX_ABFS_JLE_H diff --git a/ABACUS.develop/source/src_ri/exx_abfs-matrix_lcaoslcaos_lcaoslcaos.cpp b/ABACUS.develop/source/src_ri/exx_abfs-matrix_lcaoslcaos_lcaoslcaos.cpp new file mode 100644 index 0000000000..763692cab3 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-matrix_lcaoslcaos_lcaoslcaos.cpp @@ -0,0 +1,308 @@ +#include "exx_abfs-matrix_lcaoslcaos_lcaoslcaos.h" +#include "src_pw/global.h" +#include "src_lcao/ORB_read.h" +#include "src_global/ylm.h" +#include "src_external/src_test/test_function.h" // Peize Lin test 2016-04-05 + +void Exx_Abfs::Matrix_Lcaoslcaos_Lcaoslcaos::init( + const int mode, + const double kmesh_times, + const double rmesh_times) +{ + //========================================= + // (1) MOT: make overlap table. + //========================================= + MOT.allocate( + ORB.get_ntype(), // number of atom types + ORB.get_lmax(), // max L used to calculate overlap + static_cast(ORB.get_kmesh() * kmesh_times) | 1, // kpoints, for integration in k space + ORB.get_Rmax() * rmesh_times, // max value of radial table + ORB.get_dR(), // delta R, for making radial table +// ORB.get_dk() / kmesh_times); // delta k, for integration in k space + ORB.get_dk()); // Peize Lin change 2017-04-16 + int Lmax_used, Lmax; + MOT.init_Table_Spherical_Bessel (4,mode, Lmax_used, Lmax); +// MOT.init_OV_Tpair(); // for MOT.OV_L2plus1 +// MOT.Destroy_Table_Spherical_Bessel (Lmax_used); // why? + + //========================================= + // (2) init Ylm Coef + //========================================= + Ylm::set_coefficients (); + + //========================================= + // (3) make Gaunt coefficients table + //========================================= + MGT.init_Gaunt_CH( 2*Lmax+1 ); // why +1 + MGT.init_Gaunt( 2*Lmax+1 ); +} + +void Exx_Abfs::Matrix_Lcaoslcaos_Lcaoslcaos::init_radial( + const vector>> &orb_A, + const vector>> &orb_B ) +{ + for( size_t TA = 0; TA!=orb_A.size(); ++TA ) + for( size_t TB=0; TB!=orb_B.size(); ++TB ) + for( size_t LA=0; LA!=orb_A[TA].size(); ++LA ) + for( size_t NA=0; NA!=orb_A[TA][LA].size(); ++NA ) + for( size_t LB=0; LB!=orb_B[TB].size(); ++LB ) + for( size_t NB=0; NB!=orb_B[TB][LB].size(); ++NB ) + center2_orb22_s[TA][TB][LA][NA][LB].insert( + make_pair(NB, Center2_Orb::Orb22( + orb_A[TA][LA][NA], + orb_A[TA][LA][NA], + orb_B[TB][LB][NB], + orb_B[TB][LB][NB], + MOT, MGT))); +} + +void Exx_Abfs::Matrix_Lcaoslcaos_Lcaoslcaos::init_radial( + const LCAO_Orbitals &orb_A, + const LCAO_Orbitals &orb_B ) +{ + for( size_t TA = 0; TA!=orb_A.get_ntype(); ++TA ) + for( size_t TB=0; TB!=orb_B.get_ntype(); ++TB ) + for( size_t LA=0; LA<=orb_A.Phi[TA].getLmax(); ++LA ) + for( size_t NA=0; NA!=orb_A.Phi[TA].getNchi(LA); ++NA ) + for( size_t LB=0; LB<=orb_B.Phi[TB].getLmax(); ++LB ) + for( size_t NB=0; NB!=orb_B.Phi[TB].getNchi(LB); ++NB ) + center2_orb22_s[TA][TB][LA][NA][LB].insert( + make_pair(NB, Center2_Orb::Orb22( + orb_A.Phi[TA].PhiLN(LA,NA), + orb_A.Phi[TA].PhiLN(LA,NA), + orb_B.Phi[TB].PhiLN(LB,NB), + orb_B.Phi[TB].PhiLN(LB,NB), + MOT, MGT))); +} + +void Exx_Abfs::Matrix_Lcaoslcaos_Lcaoslcaos::init_radial_table() +{ + for( auto &co1 : center2_orb22_s ) + for( auto &co2 : co1.second ) + for( auto &co3 : co2.second ) + for( auto &co4 : co3.second ) + for( auto &co5 : co4.second ) + for( auto &co6 : co5.second ) + co6.second.init_radial_table(); +} + +void Exx_Abfs::Matrix_Lcaoslcaos_Lcaoslcaos::init_radial_table( map>> &Rs ) +{ + for( auto &co1 : center2_orb22_s ) + for( auto &co2 : co1.second ) + { + set radials; + for( const double &R : Rs[co1.first][co2.first] ) + { + const double position = R * ucell.lat0 / MOT.dr; + const size_t iq = static_cast(position); + for( size_t i=0; i!=4; ++i ) + radials.insert(iq+i); + } + + for( auto &co3 : co2.second ) + for( auto &co4 : co3.second ) + for( auto &co5 : co4.second ) + for( auto &co6 : co5.second ) + co6.second.init_radial_table(radials); + } +} + +/*void Matrix_Phiphi_Phiphi::cal_overlap_matrix() +{ + for( auto &co1 : center2_orb22_s ) + { + const size_t T = co1.first; + for (size_t IA=0; IA!=ucell.atoms[T].na; ++IA) + { + const Vector3 &tauA( ucell.atoms[T].tau[IA] ); + GridD.Find_atom(tauA); + + for( auto &co2 : co1.second ) + { + const size_t LA = co2.first; + for( size_t MA=0; MA!=2*LA+1; ++MA) + { + for( auto &co3 : co2.second ) + { + + for (int ad = 0; ad < GridD.getAdjacentNum()+1; ++ad) + { + if( T != GridD.getType(ad) ) + continue; + const Vector3 &tauB( GridD.getAdjacentTau(ad) ); + + for( auto &co4 : co3.second ) + { + const size_t LB = co4.first; + for( size_t MB=0; MB!=2*LB+1; ++MB) + { + for( auto &co5 : co4.second ) + { + co5.second.cal_ST_Phi12_R(tauA, tauB, MA, MA, MB, MB); + + } + } + + } + } + } + } + } + } + } +}*/ + +map>>> Exx_Abfs::Matrix_Lcaoslcaos_Lcaoslcaos::cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_r, + const Element_Basis_Index::IndexLNM &index_c ) +{ + map>>> matrixes; + + for( auto &co1 : center2_orb22_s ) + { + const int TA = co1.first; + for (int IA=0; IA!=ucell.atoms[TA].na; ++IA) + { + const Vector3 &tauA( ucell.atoms[TA].tau[IA] ); + + for( auto &co2 : co1.second ) + { + const size_t TB = co2.first; + for ( int IB=0; IB!=ucell.atoms[TB].na; ++IB ) + { + const Vector3 &tauB( ucell.atoms[TB].tau[IB] ); + + matrixes[TA][IA][TB][IB].create( index_r[TA].count_size, index_c[TB].count_size ); + + for( auto &co3 : co2.second ) + { + const int LA = co3.first; + for( auto &co4 : co3.second ) + { + const size_t NA = co4.first; + for( int MA=0; MA!=2*LA+1; ++MA) + { + for( auto &co5 : co4.second ) + { + const int LB = co5.first; + for( auto &co6 : co5.second ) + { + const size_t NB = co6.first; + for( int MB=0; MB!=2*LB+1; ++MB) + { + matrixes[TA][IA][TB][IB]( index_r[TA][LA][NA][MA], index_c[TB][LB][NB][MB] ) + = co6.second.cal_overlap( tauA*ucell.lat0, tauB*ucell.lat0, MA, MA, MB, MB ); + + // Peize Lin test +// cout< &tauA( ucell.atoms[T].tau[IA] ); + + for( auto &co2 : co1.second ) + { + const int LA = co2.first; +// Peize Lin test 2015-04-05 +{ + stringstream ss; + ss<<" "< &tauB( ucell.atoms[T].tau[IB] ); + + for( auto &co4 : co3.second ) + { + const int LB = co4.first; +// Peize Lin test 2015-04-05 +{ + stringstream ss; + ss<<" "< +using std::vector; +#include +using std::map; +#include +using std::set; + +#include "exx_abfs.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/center2_orb-orb22.h" + +class LCAO_Orbitals; + +class Exx_Abfs::Matrix_Lcaoslcaos_Lcaoslcaos +{ +public: + // mode: + // 1: + void init( + const int mode, + const double kmesh_times=1, // extend Kcut, keep dK + const double rmesh_times=1); // extend Rcut, keep dR + + void init_radial( + const vector>> &orb_A, + const vector>> &orb_B ); + void init_radial( + const LCAO_Orbitals &orb_A, + const LCAO_Orbitals &orb_B ); + + void init_radial_table(); + void init_radial_table( map>> &Rs ); // unit is ucell.lat0 + + map>>> cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_r, + const Element_Basis_Index::IndexLNM &index_c ); + +private: + + ORB_table_phi MOT; + ORB_gaunt_table MGT; + + map>>>>> center2_orb22_s; +}; +#endif diff --git a/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs11.cpp b/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs11.cpp new file mode 100644 index 0000000000..b4b11c5e0c --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs11.cpp @@ -0,0 +1,326 @@ +#include "exx_abfs-matrix_orbs11.h" + +#include +#include +#include "src_pw/global.h" +#include "src_lcao/ORB_read.h" +#include "src_global/ylm.h" +#include "src_global/global_function.h" + +#include // Peize Lin test +#include "src_external/src_test/test_function.h" // Peize Lin test 2016-04-05 +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "src_lcao/global_fp.h" + +void Exx_Abfs::Matrix_Orbs11::init( + const int mode, + const double kmesh_times, + const double rmesh_times) +{ + TITLE("Exx_Abfs::Matrix_Orbs11","init"); + //========================================= + // (1) MOT: make overlap table. + //========================================= + +//ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +//timeval t_start; +//gettimeofday( &t_start, NULL); + MOT.allocate( + ORB.get_ntype(), // number of atom types + std::max( ORB.get_lmax(), Exx_Abfs::Lmax ), // max L used to calculate overlap + static_cast(ORB.get_kmesh() * kmesh_times) | 1, // kpoints, for integration in k space + ORB.get_Rmax() * rmesh_times, // max value of radial table + ORB.get_dR(), // delta R, for making radial table +// ORB.get_dk() / kmesh_times); // delta k, for integration in k space + ORB.get_dk()); // Peize Lin change 2017-04-16 +//ofs<<"TIME@Exx_Abfs::Matrix_Orbs11::init::MOT.allocate\t"<>> &orb_A, + const vector>> &orb_B) +{ +//ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +//timeval t_start; +//gettimeofday( &t_start, NULL); + TITLE("Exx_Abfs::Matrix_Orbs11","init_radial"); + for( size_t TA = 0; TA!=orb_A.size(); ++TA ) + for( size_t TB=0; TB!=orb_B.size(); ++TB ) + for( int LA=0; LA!=orb_A[TA].size(); ++LA ) + for( size_t NA=0; NA!=orb_A[TA][LA].size(); ++NA ) + for( int LB=0; LB!=orb_B[TB].size(); ++LB ) + for( size_t NB=0; NB!=orb_B[TB][LB].size(); ++NB ) + center2_orb11_s[TA][TB][LA][NA][LB].insert( + make_pair(NB, Center2_Orb::Orb11( + orb_A[TA][LA][NA], + orb_B[TB][LB][NB], + MOT, MGT))); +//ofs<<"TIME@Exx_Abfs::Matrix_Orbs11::init_radial\t"<>> &Rs ) +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday( &t_start, NULL); + TITLE("Exx_Abfs::Matrix_Orbs11","init_radial_table_Rs"); + for( const auto &RsA : Rs ) + for( const auto &RsB : RsA.second ) + { + if( auto* const center2_orb11_sAB = static_cast>>>*const>( + MAP_EXIST(center2_orb11_s, RsA.first, RsB.first)) ) + { +timeval t_small; +gettimeofday(&t_small, NULL); + set radials; + for( const double &R : RsB.second ) + { + const double position = R * ucell.lat0 / MOT.dr; + const size_t iq = static_cast(position); + for( size_t i=0; i!=4; ++i ) + radials.insert(iq+i); + } +ofs<<"\t"<>>> Matrix_Orbs11::cal_overlap_matrix( + const Exx_Abfs::Abfs_Index::Index &index_r, + const Exx_Abfs::Abfs_Index::Index &index_c ) +{ + map>>> matrix_V; + + for( auto &co1 : center2_orb11_s ) + { + const size_t TA = co1.first; + for (size_t IA=0; IA!=ucell.atoms[TA].na; ++IA) + { + const Vector3 &tauA( ucell.atoms[TA].tau[IA] ); + GridD.Find_atom(tauA); + + for( auto &co2 : co1.second ) + { + const int LA = co2.first; + for( size_t MA=0; MA!=2*LA+1; ++MA) + { + for( auto &co3 : co2.second ) + { + const size_t NA = co3.first; + for (int ad = 0; ad < GridD.getAdjacentNum()+1; ++ad) + { + for( auto &co4 : co3.second ) + { + const size_t TB = co4.first; + if( TB != GridD.getType(ad) ) + continue; + const Vector3 &tauB( GridD.getAdjacentTau(ad) ); + const size_t IB = GridD.getNatom(ad); + + for( auto &co5 : co4.second ) + { + const int LB = co5.first; + for( size_t MB=0; MB!=2*LB+1; ++MB) + { + for( auto &co6 : co5.second ) + { + const size_t NB = co6.firs; + co6.second.cal_ST_Phi12_R(tauA, tauB, MA, MB); + + matrix_V[TA][IA][TB][IB]( index_r[TA][LA][MA][NA], index_c[TB][LB][MB][NB] ) = co6.second.olm[0]; + } + } + } + } + } + } + } + } + } + } + return matrix_V; +} +*/ + +matrix Exx_Abfs::Matrix_Orbs11::cal_overlap_matrix( + const size_t TA, + const size_t TB, + const Vector3 &tauA, + const Vector3 &tauB, + const Element_Basis_Index::IndexLNM &index_r, + const Element_Basis_Index::IndexLNM &index_c ) const +{ +// TITLE("Exx_Abfs::Matrix_Orbs11","cal_overlap_matrix"); + + matrix m( index_r[TA].count_size, index_c[TB].count_size ); + + for( const auto &co3 : center2_orb11_s.at(TA).at(TB) ) + { + const int LA = co3.first; + for( const auto &co4 : co3.second ) + { + const size_t NA = co4.first; + for( size_t MA=0; MA!=2*LA+1; ++MA ) + { + for( const auto &co5 : co4.second ) + { + const int LB = co5.first; + for( const auto &co6 : co5.second ) + { + const size_t NB = co6.first; + for( size_t MB=0; MB!=2*LB+1; ++MB ) + { +//if(TA==TB&&LA==LB&&NA==NB&&MA==MB) {exx_cout_flag=true; cout<>>> Exx_Abfs::Matrix_Orbs11::cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_r, + const Element_Basis_Index::IndexLNM &index_c ) const +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday( &t_start, NULL); + TITLE("Exx_Abfs::Matrix_Orbs11","cal_overlap_matrix"); + + map>>> matrixes; + + for( const auto &co1 : center2_orb11_s ) + { + const size_t TA = co1.first; + for (size_t IA=0; IA!=ucell.atoms[TA].na; ++IA) + { + const Vector3 &tauA( ucell.atoms[TA].tau[IA] ); + + for( const auto &co2 : co1.second ) + { + const size_t TB = co2.first; + for (size_t IB=0; IB!=ucell.atoms[TB].na; ++IB) + { + const Vector3 &tauB( ucell.atoms[TB].tau[IB] ); + + matrixes[TA][IA][TB][IB] = cal_overlap_matrix( TA, TB, tauA, tauB, index_r, index_c ); + } + } + } + } +ofs<<"TIME@Exx_Abfs::Matrix_Orbs11::cal_overlap_matrix\t"< +using std::vector; +#include +using std::map; +#include +using std::set; + +#include "exx_abfs.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/center2_orb-orb11.h" + +class LCAO_Orbitals; + +class Exx_Abfs::Matrix_Orbs11 +{ +public: + // mode: + // 1: + // 2: + void init( + const int mode, + const double kmesh_times=1, // extend Kcut, keep dK + const double rmesh_times=1); // extend Rcut, keep dR + + void init_radial( + const vector>> &orb_A, + const vector>> &orb_B); + void init_radial( + const LCAO_Orbitals &orb_A, + const LCAO_Orbitals &orb_B); + + void init_radial_table(); + void init_radial_table( const map>> &Rs ); // unit: ucell.lat0 + + matrix cal_overlap_matrix( + const size_t TA, + const size_t TB, + const Vector3 &tauA, // unit: ucell.lat0 + const Vector3 &tauB, // unit: ucell.lat0 + const Element_Basis_Index::IndexLNM &index_r, + const Element_Basis_Index::IndexLNM &index_c ) const; + map>>> cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_r, + const Element_Basis_Index::IndexLNM &index_c ) const; + +protected: + ORB_table_phi MOT; + ORB_gaunt_table MGT; + + map>>>>> center2_orb11_s; +}; + +// this->center2_orb11_s[TA][TB][LA][NA][LB][NB] + +#endif diff --git a/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs21.cpp b/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs21.cpp new file mode 100644 index 0000000000..c270afc72b --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs21.cpp @@ -0,0 +1,524 @@ +#include "exx_abfs-matrix_orbs21.h" + +#include "exx_abfs.h" +#include "exx_abfs-abfs_index.h" + +#include +#include +#include "src_pw/global.h" +#include "src_lcao/ORB_read.h" +#include "src_global/ylm.h" + +#include // Peize Lin test +#include "src_external/src_test/test_function.h" // Peize Lin test 2016-04-05 +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "src_lcao/global_fp.h" + +void Exx_Abfs::Matrix_Orbs21::init( + const int mode, + const double kmesh_times, + const double rmesh_times) +{ + TITLE("Exx_Abfs::Matrix_Orbs21","init"); + //========================================= + // (1) MOT: make overlap table. + //========================================= +//ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +//timeval t_start; +//gettimeofday( &t_start, NULL); + MOT.allocate( + ORB.get_ntype(), // number of atom types + std::max( ORB.get_lmax(), Exx_Abfs::Lmax ), // max L used to calculate overlap + static_cast(ORB.get_kmesh() * kmesh_times) | 1, // kpoints, for integration in k space + ORB.get_Rmax() * rmesh_times, // max value of radial table + ORB.get_dR(), // delta R, for making radial table +// ORB.get_dk() / kmesh_times); // delta k, for integration in k space + ORB.get_dk()); // Peize Lin change 2017-04-16 +//ofs<<"TIME@Exx_Abfs::Matrix_Orbs21::init::MOT.allocate\t"<>> &orb_A1, + const vector>> &orb_A2, + const vector>> &orb_B ) +{ +//ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +//timeval t_start; +//gettimeofday( &t_start, NULL); + + TITLE("Exx_Abfs::Matrix_Orbs21","init_radial"); + + assert(orb_A1.size()==orb_A2.size()); + for( size_t TA=0; TA!=orb_A1.size(); ++TA ) + for( size_t TB=0; TB!=orb_B.size(); ++TB ) + for( int LA1=0; LA1!=orb_A1[TA].size(); ++LA1 ) + for( size_t NA1=0; NA1!=orb_A1[TA][LA1].size(); ++NA1 ) + for( int LA2=0; LA2!=orb_A2[TA].size(); ++LA2 ) + for( size_t NA2=0; NA2!=orb_A2[TA][LA2].size(); ++NA2 ) + for( int LB=0; LB!=orb_B[TB].size(); ++LB ) + for( size_t NB=0; NB!=orb_B[TB][LB].size(); ++NB ) + center2_orb21_s[TA][TB][LA1][NA1][LA2][NA2][LB].insert( + make_pair(NB, Center2_Orb::Orb21( + orb_A1[TA][LA1][NA1], + orb_A2[TA][LA2][NA2], + orb_B[TB][LB][NB], + MOT, MGT))); +//ofs<<"TIME@Exx_Abfs::Matrix_Orbs21::init_radial\t"<>> &orb_A1, + const LCAO_Orbitals &orb_A2, + const LCAO_Orbitals &orb_B ) +{ +//ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +//timeval t_start; +//gettimeofday( &t_start, NULL); + + TITLE("Exx_Abfs::Matrix_Orbs21","init_radial"); + + assert( orb_A1.size() == orb_A2.get_ntype() ); + for( size_t TA=0; TA!=orb_A1.size(); ++TA ) + for( size_t TB=0; TB!=orb_B.get_ntype(); ++TB) + for( int LA1=0; LA1!=orb_A1[TA].size(); ++LA1 ) + for( size_t NA1=0; NA1!=orb_A1[TA][LA1].size(); ++NA1 ) + for( int LA2=0; LA2<=orb_A2.Phi[TA].getLmax(); ++LA2 ) + for( size_t NA2=0; NA2!=orb_A2.Phi[TA].getNchi(LA2); ++NA2 ) + for( int LB=0; LB<=orb_B.Phi[TB].getLmax(); ++LB ) + for( size_t NB=0; NB!=orb_B.Phi[TB].getNchi(LB); ++NB ) + center2_orb21_s[TA][TB][LA1][NA1][LA2][NA2][LB].insert( + make_pair(NB, Center2_Orb::Orb21( + orb_A1[TA][LA1][NA1], + orb_A2.Phi[TA].PhiLN(LA2,NA2), + orb_B.Phi[TB].PhiLN(LB,NB), + MOT, MGT))); +//ofs<<"TIME@Exx_Abfs::Matrix_Orbs21::init_radial\t"<>> &Rs ) +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday(&t_start, NULL); + + TITLE("Exx_Abfs::Matrix_Orbs21","init_radial_table_Rs"); + + for( const auto &RsA : Rs ) + for( const auto &RsB : RsA.second ) + { + if( auto* const center2_orb21_sAB = static_cast>>>>>*const>( + MAP_EXIST(center2_orb21_s, RsA.first, RsB.first)) ) + { +timeval t_small; +gettimeofday(&t_small, NULL); + set radials; + for( const double &R : RsB.second ) + { + const double position = R * ucell.lat0 / MOT.dr; + const size_t iq = static_cast(position); + for( size_t i=0; i!=4; ++i ) + radials.insert(iq+i); + } +ofs<<"\t"<>>>> Matrix_Abfsphi_Phi::cal_overlap_matrix( + const Exx_Abfs::Abfs_Index::Index &index_abfs, + const Exx_Abfs::Abfs_Index::Index &index_orb ) +{ + map>>>> matrix_A; + + for( auto &co1 : center2_orb21_s ) + { + const size_t TA = co1.first; + for (size_t IA=0; IA!=ucell.atoms[TA].na; ++IA) + { + const Vector3 &tauA( ucell.atoms[TA].tau[IA] ); + GridD.Find_atom(tauA); + + for( auto &co2 : co1.second ) + { + const int LA1 = co2.first; + for( size_t MA1=0; MA1!=2*LA1+1; ++MA1) + { + for( auto &co3 : co2.second ) + { + const size_t NA1 = co3.first; + for( auto &co4 : co3.second ) + { + const int LA2 = co4.first; + for( size_t MA2=0; MA2!=2*LA2+1; ++MA2) + { + for( auto &co5 : co4.second ) + { + const size_t NA2 = co4.first; + for (int ad = 0; ad < GridD.getAdjacentNum()+1; ++ad) + { + for( auto &co6 : co5.second ) + { + const size_t TB = co6.first; + if( TB != GridD.getType(ad) ) + continue; + const Vector3 &tauB( GridD.getAdjacentTau(ad) ); + const size_t IB = GridD.getNatom(ad); + + for( auto &co7 : co6.second ) + { + const int LB = co7.first; + for( size_t MB=0; MB!=2*LB+1; ++MB) + { + for( auto &co8 : co7.second ) + { + const size_t NB = co8.first; + co8.second.cal_ST_Phi12_R(tauA, tauB, MA1, MA2, MB); + + matrix_A[TA][IA][TB][IB][0]( Exx_Abfs::Abfs_Index::get_index_index( index_orb,TA,LA2,MA2,NA2, index_orb,TB,LB,MB,NB ), index_abfs[TA][LA1][MA1][NA1] ) + = matrix_A[TB][IB][TA][IA][1]( Exx_Abfs::Abfs_Index::get_index_index( index_orb,TB,LB,MB,NB, index_orb,TA,LA2,MA2,NA2 ), index_abfs[TA][LA1][MA1][NA1] ) + = co8.second.olm[0]; + } + } + } + } + } + } + } + } + } + } + } + } + } + return matrix_A; +}*/ + +matrix Exx_Abfs::Matrix_Orbs21::cal_overlap_matrix( + const size_t TA, + const size_t TB, + const Vector3 &tauA, + const Vector3 &tauB, + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B, + const Matrix_Order &matrix_order) const +{ + matrix m; + switch(matrix_order) + { + case Matrix_Order::A2B_A1: m.create( index_A2[TA].count_size*index_B [TB].count_size, index_A1[TA].count_size ); break; + case Matrix_Order::BA2_A1: m.create( index_B [TB].count_size*index_A2[TA].count_size, index_A1[TA].count_size ); break; + default: throw invalid_argument( "Matrix_Order wrong in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__) ); + } + + for( const auto &co3 : center2_orb21_s.at(TA).at(TB) ) + { + const int LA1 = co3.first; + for( const auto &co4 : co3.second ) + { + const size_t NA1 = co4.first; + for( size_t MA1=0; MA1!=2*LA1+1; ++MA1 ) + { + for( const auto &co5 : co4.second ) + { + const int LA2 = co5.first; + for( const auto &co6 : co5.second ) + { + const size_t NA2 = co6.first; + for( size_t MA2=0; MA2!=2*LA2+1; ++MA2 ) + { + for( const auto &co7 : co6.second ) + { + const int LB = co7.first; + for( const auto &co8 : co7.second ) + { + const size_t NB = co8.first; + for( size_t MB=0; MB!=2*LB+1; ++MB ) + { + const double overlap = co8.second.cal_overlap( tauA*ucell.lat0, tauB*ucell.lat0, MA1, MA2, MB ); + + switch(matrix_order) + { + case Matrix_Order::A2B_A1: + m( + Exx_Abfs::Abfs_Index::get_index_index( + index_A2,TA,LA2,NA2,MA2, + index_B,TB,LB,NB,MB ), + index_A1[TA][LA1][NA1][MA1] ) + = overlap; + break; + case Matrix_Order::BA2_A1: + m( + Exx_Abfs::Abfs_Index::get_index_index( + index_B,TB,LB,NB,MB, + index_A2,TA,LA2,NA2,MA2), + index_A1[TA][LA1][NA1][MA1] ) + = overlap; + break; + default: throw invalid_argument( "Matrix_Order wrong in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__) ); + } + } + } + } + } + } + } + } + } + } + return m; +} + +vector Exx_Abfs::Matrix_Orbs21::cal_overlap_matrix( + const size_t TA, + const size_t TB, + const Vector3 &tauA, + const Vector3 &tauB, + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B) const +{ + matrix m_A2B_A1( index_A2[TA].count_size*index_B[TB].count_size, index_A1[TA].count_size ); + matrix m_BA2_A1( index_B[TB].count_size*index_A2[TA].count_size, index_A1[TA].count_size ); + + for( const auto &co3 : center2_orb21_s.at(TA).at(TB) ) + { + const int LA1 = co3.first; + for( const auto &co4 : co3.second ) + { + const size_t NA1 = co4.first; + for( size_t MA1=0; MA1!=2*LA1+1; ++MA1 ) + { + for( const auto &co5 : co4.second ) + { + const int LA2 = co5.first; + for( const auto &co6 : co5.second ) + { + const size_t NA2 = co6.first; + for( size_t MA2=0; MA2!=2*LA2+1; ++MA2 ) + { + for( const auto &co7 : co6.second ) + { + const int LB = co7.first; + for( const auto &co8 : co7.second ) + { + const size_t NB = co8.first; + for( size_t MB=0; MB!=2*LB+1; ++MB ) + { + const double overlap = co8.second.cal_overlap( tauA*ucell.lat0, tauB*ucell.lat0, MA1, MA2, MB ); + + m_A2B_A1( + Exx_Abfs::Abfs_Index::get_index_index( + index_A2,TA,LA2,NA2,MA2, + index_B,TB,LB,NB,MB ), + index_A1[TA][LA1][NA1][MA1] ) + = m_BA2_A1( + Exx_Abfs::Abfs_Index::get_index_index( + index_B,TB,LB,NB,MB, + index_A2,TA,LA2,NA2,MA2), + index_A1[TA][LA1][NA1][MA1] ) + = overlap; + } + } + } + } + } + } + } + } + } + return vector{ std::move(m_A2B_A1), std::move(m_BA2_A1) }; +} + +map>>>> Exx_Abfs::Matrix_Orbs21::cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B) const +{ +//ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +//timeval t_start; +//gettimeofday( &t_start, NULL); + + TITLE("Exx_Abfs::Matrix_Orbs21","cal_overlap_matrix"); + + map>>>> matrixes; + + for( const auto &co1 : center2_orb21_s ) + { + const size_t TA = co1.first; + for( size_t IA=0; IA!=ucell.atoms[TA].na; ++IA ) + { + const Vector3 &tauA( ucell.atoms[TA].tau[IA] ); + + for( const auto &co2 : co1.second ) + { + const size_t TB = co2.first; + for( size_t IB=0; IB!=ucell.atoms[TB].na; ++IB ) + { + const Vector3 &tauB( ucell.atoms[TB].tau[IB] ); + + const vector &&m = cal_overlap_matrix( TA, TB, tauA, tauB, index_A1, index_A2, index_B ); + matrixes[TA][IA][TB][IB].resize(2); + matrixes[TA][IA][TB][IB][0] = std::move(m[0]); + matrixes[TB][IB][TA][IA].resize(2); + matrixes[TB][IB][TA][IA][1] = std::move(m[1]); +/* + matrixes[TA][IA][TB][IB].resize(2); + matrixes[TA][IA][TB][IB][0].create( index_A2[TA].count_size*index_B[TB].count_size, index_A1[TA].count_size ); + matrixes[TB][IB][TA][IA].resize(2); + matrixes[TB][IB][TA][IA][1].create( index_B[TB].count_size*index_A2[TA].count_size, index_A1[TA].count_size ); + + for( const auto &co3 : co2.second ) + { + const size_t LA1 = co3.first; + for( const auto &co4 : co3.second ) + { + const size_t NA1 = co4.first; + for( size_t MA1=0; MA1!=2*LA1+1; ++MA1 ) + { + for( const auto &co5 : co4.second ) + { + const size_t LA2 = co5.first; + for( const auto &co6 : co5.second ) + { + const size_t NA2 = co6.first; + for( size_t MA2=0; MA2!=2*LA2+1; ++MA2 ) + { + for( const auto &co7 : co6.second ) + { + const size_t LB = co7.first; + for( const auto &co8 : co7.second ) + { + const size_t NB = co8.first; + for( size_t MB=0; MB!=2*LB+1; ++MB ) + { + + // Peize Lin test // Peize Lin test +// { +// ofstream ofs("orb11-i_exp",ofstream::app); +// ofs< +using std::vector; +#include +using std::map; +#include +using std::set; + +#include "exx_abfs.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/center2_orb-orb21.h" + +class LCAO_Orbitals; + +class Exx_Abfs::Matrix_Orbs21 +{ +public: + // mode: + // 1: + void init( + const int mode, + const double kmesh_times=1, // extend Kcut, keep dK + const double rmesh_times=1); // extend Rcut, keep dR + + void init_radial( + const vector>> &orb_A1, + const vector>> &orb_A2, + const vector>> &orb_B ); + void init_radial( + const vector>> &orb_A1, + const LCAO_Orbitals &orb_A2, + const LCAO_Orbitals &orb_B ); + + void init_radial_table(); + void init_radial_table( const map>> &Rs ); // unit: ucell.lat0 + + enum class Matrix_Order{A2B_A1,BA2_A1}; + matrix cal_overlap_matrix( + const size_t TA, + const size_t TB, + const Vector3 &tauA, // unit: ucell.lat0 + const Vector3 &tauB, // unit: ucell.lat0 + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B, + const Matrix_Order &matrix_order) const; + vector cal_overlap_matrix( + const size_t TA, + const size_t TB, + const Vector3 &tauA, // unit: ucell.lat0 + const Vector3 &tauB, // unit: ucell.lat0 + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B) const; + map>>>> cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B) const; + +protected: + ORB_table_phi MOT; + ORB_gaunt_table MGT; + + map>>>>>>> center2_orb21_s; +}; + +// this->center2_orb21_s[TA][TB][LA1][NA1][LA2][NA2][LB][NB] + +#endif diff --git a/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs22.cpp b/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs22.cpp new file mode 100644 index 0000000000..ce9da0d84e --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-matrix_orbs22.cpp @@ -0,0 +1,312 @@ +#include "exx_abfs-matrix_orbs22.h" + +#include "exx_abfs.h" +#include "exx_abfs-abfs_index.h" + +#include "src_pw/global.h" +#include "src_lcao/ORB_read.h" +#include "src_global/ylm.h" + +#include "src_external/src_test/test_function.h" // Peize Lin test 2016-04-05 +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "src_lcao/global_fp.h" + +void Exx_Abfs::Matrix_Orbs22::init( + const int mode, + const double kmesh_times, + const double rmesh_times) +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday( &t_start, NULL); + + //========================================= + // (1) MOT: make overlap table. + //========================================= + MOT.allocate( + ORB.get_ntype(), // number of atom types + ORB.get_lmax(), // max L used to calculate overlap + static_cast(ORB.get_kmesh() * kmesh_times) | 1, // kpoints, for integration in k space + ORB.get_Rmax() * rmesh_times, // max value of radial table + ORB.get_dR(), // delta R, for making radial table +// ORB.get_dk() / kmesh_times); // delta k, for integration in k space + ORB.get_dk()); // Peize Lin change 2017-04-16 + int Lmax_used, Lmax; + MOT.init_Table_Spherical_Bessel (4,mode, Lmax_used, Lmax); +// MOT.init_OV_Tpair(); // for MOT.OV_L2plus1 +// MOT.Destroy_Table_Spherical_Bessel (Lmax_used); // why? + + //========================================= + // (2) init Ylm Coef + //========================================= + Ylm::set_coefficients (); + + //========================================= + // (3) make Gaunt coefficients table + //========================================= + MGT.init_Gaunt_CH( 2*Lmax+1 ); // why +1 + MGT.init_Gaunt( 2*Lmax+1 ); +ofs<<"TIME@Exx_Abfs::Matrix_Orbs22::init\t"<>> &orb_A1, + const vector>> &orb_A2, + const vector>> &orb_B1, + const vector>> &orb_B2 ) +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday( &t_start, NULL); + TITLE("Exx_Abfs::Matrix_Orbs22","init_radial"); + + assert(orb_A1.size()==orb_A2.size()); + assert(orb_B1.size()==orb_B2.size()); + for( size_t TA = 0; TA!=orb_A1.size(); ++TA ) + for( size_t TB=0; TB!=orb_B1.size(); ++TB ) + for( int LA1=0; LA1!=orb_A1[TA].size(); ++LA1 ) + for( size_t NA1=0; NA1!=orb_A1[TA][LA1].size(); ++NA1 ) + for( int LA2=0; LA2!=orb_A2[TA].size(); ++LA2 ) + for( size_t NA2=0; NA2!=orb_A2[TA][LA2].size(); ++NA2 ) + for( int LB1=0; LB1!=orb_B1[TB].size(); ++LB1 ) + for( size_t NB1=0; NB1!=orb_B1[TB][LB1].size(); ++NB1 ) + for( size_t LB2=0; LB2!=orb_B2[TB].size(); ++LB2 ) + for( size_t NB2=0; NB2!=orb_B2[TB][LB2].size(); ++NB2 ) + center2_orb22_s[TA][TB][LA1][NA1][LA2][NA2][LB1][NB1][LB2].insert( + make_pair(NB2, Center2_Orb::Orb22( + orb_A1[TA][LA1][NA1], + orb_A2[TA][LA2][NA2], + orb_B1[TB][LB1][NB1], + orb_B2[TB][LB2][NB2], + MOT, MGT))); +ofs<<"TIME@Exx_Abfs::Matrix_Orbs22::init_radial\t"<>> &Rs ) +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday( &t_start, NULL); + TITLE("Exx_Abfs::Matrix_Orbs22","init_radial_table_Rs"); + + for( const auto &RsA : Rs ) + for( const auto &RsB : RsA.second ) + { + if( auto* center2_orb22_sAB = static_cast>>>>>>>*>( + MAP_EXIST(center2_orb22_s, RsA.first, RsB.first)) ) + { +timeval t_small; +gettimeofday(&t_small, NULL); + set radials; + for( const double &R : RsB.second ) + { + const double position = R * ucell.lat0 / MOT.dr; + const size_t iq = static_cast(position); + for( size_t i=0; i!=4; ++i ) + radials.insert(iq+i); + } +ofs<<"\t"< &tauA, + const Vector3 &tauB, + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B1, + const Element_Basis_Index::IndexLNM &index_B2, + const Matrix_Order &matrix_order) const +{ + TITLE("Exx_Abfs::Matrix_Orbs22","cal_overlap_matrix"); + + matrix m; + switch(matrix_order) + { + case Matrix_Order::A1B1_A2B2: m.create( index_A1[TA].count_size*index_B1[TB].count_size, index_A2[TA].count_size*index_B2[TB].count_size ); break; + default: throw invalid_argument( "Matrix_Order wrong in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__) ); + } + + for( const auto &co3 : center2_orb22_s.at(TA).at(TB) ) + { + const int LA1 = co3.first; + for( const auto &co4 : co3.second ) + { + const size_t NA1 = co4.first; + for( size_t MA1=0; MA1!=2*LA1+1; ++MA1 ) + { + for( const auto &co5 : co4.second ) + { + const int LA2 = co5.first; + for( const auto &co6 : co5.second ) + { + const size_t NA2 = co6.first; + for( size_t MA2=0; MA2!=2*LA2+1; ++MA2 ) + { + for( const auto &co7 : co6.second ) + { + const int LB1 = co7.first; + for( const auto &co8 : co7.second ) + { + const size_t NB1 = co8.first; + for( size_t MB1=0; MB1!=2*LB1+1; ++MB1 ) + { + for( const auto &co9 : co8.second ) + { + const int LB2 = co9.first; + for( const auto & co10 : co9.second ) + { + const size_t NB2 = co10.first; + for( size_t MB2=0; MB2!=2*LB2+1; ++MB2 ) + { + + const double overlap = co10.second.cal_overlap( tauA*ucell.lat0, tauB*ucell.lat0, MA1, MA2, MB1, MB2 ); + + switch(matrix_order) + { + case Matrix_Order::A1B1_A2B2: + m( + Exx_Abfs::Abfs_Index::get_index_index( + index_A1,TA,LA1,NA1,MA1, + index_B1,TB,LB1,NB1,MB1 ), + Exx_Abfs::Abfs_Index::get_index_index( + index_A2,TA,LA2,NA2,MA2, + index_B2,TB,LB2,NB2,MB2 ) ) + = overlap; + break; + default: throw invalid_argument( "Matrix_Order wrong in "+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__) ); + } + } + } + } + } + } + } + } + } + } + } + } + } + return m; +} + + +map>>> Exx_Abfs::Matrix_Orbs22::cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B1, + const Element_Basis_Index::IndexLNM &index_B2 ) const +{ +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday( &t_start, NULL); + map>>> matrixes; + + for( const auto &co1 : center2_orb22_s ) + { + const size_t TA = co1.first; + for( size_t IA=0; IA!=ucell.atoms[TA].na; ++IA ) + { + const Vector3 &tauA( ucell.atoms[TA].tau[IA] ); + + for( const auto &co2 : co1.second ) + { + const size_t TB = co2.first; + for( size_t IB=0; IB!=ucell.atoms[TB].na; ++IB ) + { + const Vector3 &tauB( ucell.atoms[TB].tau[IB] ); + + matrixes[TA][IA][TB][IB] = cal_overlap_matrix( + TA, + TB, + ucell.atoms[TA].tau[IA], + ucell.atoms[TB].tau[IB], + index_A1, + index_A2, + index_B1, + index_B2, + Matrix_Order::A1B1_A2B2); + } + } + } + } +ofs<<"TIME@Exx_Abfs::Matrix_Orbs22::cal_overlap_matrix\t"< +using std::map; + +#include "exx_abfs.h" +#include "src_lcao/ORB_table_phi.h" +#include "src_lcao/ORB_gaunt_table.h" +#include "src_lcao/center2_orb-orb22.h" + +class LCAO_Orbitals; + +class Exx_Abfs::Matrix_Orbs22 +{ +public: + // mode: + // 1: + void init( + const int mode, + const double kmesh_times=1, // extend Kcut, keep dK + const double rmesh_times=1); // extend Rcut, keep dR + + void init_radial( + const vector>> &orb_A1, + const vector>> &orb_A2, + const vector>> &orb_B1, + const vector>> &orb_B2 ); + void init_radial( + const LCAO_Orbitals &orb_A1, + const LCAO_Orbitals &orb_A2, + const LCAO_Orbitals &orb_B1, + const LCAO_Orbitals &orb_B2 ); + + void init_radial_table(); + void init_radial_table( const map>> &Rs ); // unit is ucell.lat0 + + enum class Matrix_Order{A1B1_A2B2}; + matrix cal_overlap_matrix( + const size_t TA, + const size_t TB, + const Vector3 &tauA, + const Vector3 &tauB, + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B1, + const Element_Basis_Index::IndexLNM &index_B2, + const Matrix_Order &matrix_order) const; + map>>> cal_overlap_matrix( + const Element_Basis_Index::IndexLNM &index_A1, + const Element_Basis_Index::IndexLNM &index_A2, + const Element_Basis_Index::IndexLNM &index_B1, + const Element_Basis_Index::IndexLNM &index_B2 ) const; + +private: + + ORB_table_phi MOT; + ORB_gaunt_table MGT; + + map>>>>>>>>> center2_orb22_s; +}; +#endif diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-allreduce-template.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-allreduce-template.h new file mode 100644 index 0000000000..e60ed17ef8 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-allreduce-template.h @@ -0,0 +1,167 @@ +#ifndef EXX_ABFS_PARALLEL_COMMUNICATE_ALLREDUCE_TEMPLATE_H +#define EXX_ABFS_PARALLEL_COMMUNICATE_ALLREDUCE_TEMPLATE_H + +#include "exx_abfs-parallel-communicate-allreduce.h" + +#include + +#include +#include +#include "src_global/serialization_boost.h" + +#include +#include + +#ifdef _OPENMP +#include +#endif + +#include "src_external/src_test/src_ri/exx_lcao-test.h" + + +template< typename T > +T Exx_Abfs::Parallel::Communicate::Allreduce::allreduce( + T & data_local, + std::function & insert_function) +{ +ofstream ofs_mpi( "allreduce_"+TO_STRING(my_rank), ofstream::app ); +timeval t_start; +double t_probe=0, t_recv=0; + + vector threads; + atomic_flag insert_lock = ATOMIC_FLAG_INIT; + atomic rank_delta=1; + for( int i=0; i<2; ++i ) + ask(rank_delta++); + +gettimeofday(&t_start,NULL); + boost::mpi::packed_oarchive oar(mpi_comm); + oar << data_local; +ofs_mpi<<"sizeof_oar:\t"< request_isends(comm_sz); + boost::dynamic_bitset<> flag_isends(comm_sz,false); + flag_isends[my_rank] = true; + +gettimeofday(&t_start,NULL); + T data_all; + insert_function( data_all, data_local ); + boost::dynamic_bitset<> flag_irecvs(comm_sz,false); + flag_irecvs[my_rank] = true; +ofs_mpi<<"insert\t"< iarps( comm_sz ); + for( auto &iarp : iarps ) + iarp = new boost::mpi::packed_iarchive{MPI_COMM_WORLD}; + + #ifdef _OPENMP + const int omp_threads = omp_get_max_threads(); + omp_set_num_threads(1); + #endif + + while( !flag_irecvs.all() || !flag_isends.all() ) + { + MPI_Status status; +gettimeofday(&t_start,NULL); + MPI_Probe( MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &status ); +t_probe+=time_during(t_start); + switch(status.MPI_TAG) + { + case tag_ask: + { + const int rank_send = status.MPI_SOURCE; + int message_ignore; +gettimeofday(&t_start,NULL); + MPI_Recv( &message_ignore, 1, MPI_INT, rank_send, tag_ask, mpi_comm, MPI_STATUS_IGNORE ); +t_recv+=time_during(t_start); + MPI_Isend( oar.address(), oar.size(), MPI_PACKED, rank_send, tag_data, mpi_comm, &request_isends[rank_send] ); + flag_isends[rank_send] = true; + break; + } + case tag_data: + { + const int rank_recv = status.MPI_SOURCE; + + int data_size; + MPI_Get_count( &status, MPI_PACKED, &data_size ); + boost::mpi::packed_iarchive & iar = *iarps[rank_recv]; + iar.resize(data_size); + +gettimeofday(&t_start,NULL); + MPI_Recv( iar.address(), data_size, MPI_PACKED, rank_recv, tag_data, mpi_comm, MPI_STATUS_IGNORE ); +t_recv+=time_during(t_start); + + threads.push_back(std::thread( + &Exx_Abfs::Parallel::Communicate::Allreduce::allreduce_thread, this, + std::ref(iar), std::ref(insert_function), std::ref(data_all), + std::ref(rank_delta), std::ref(insert_lock) )); + flag_irecvs[rank_recv] = true; +ofs_mpi< +void Exx_Abfs::Parallel::Communicate::Allreduce::allreduce_thread( + boost::mpi::packed_iarchive &iar, + std::function &insert_function, + T &data_all, + atomic &rank_delta, + atomic_flag &insert_lock ) +{ +ofstream ofs_mpi( "allreduce_"+TO_STRING(my_rank)+"_"+TO_STRING(this_thread::get_id()), ofstream::app ); +timeval t_start; + +ofs_mpi<<"sizeof_iar:\t"<> data_rank; +ofs_mpi<>\t"< + +Exx_Abfs::Parallel::Communicate::Allreduce::Allreduce( const MPI_Comm & mpi_comm_in ) + :mpi_comm(mpi_comm_in) +{ + MPI_Comm_size( mpi_comm, &comm_sz ); + MPI_Comm_rank( mpi_comm, &my_rank ); +} + + +void Exx_Abfs::Parallel::Communicate::Allreduce::ask( const int rank_delta_now ) const +{ + if( rank_delta_now < comm_sz ) + { + const int rank_ask = ( my_rank + rank_delta_now ) % comm_sz; + MPI_Request request_ask; + MPI_Isend( &tag_ask, 1, MPI_INT, rank_ask, tag_ask, mpi_comm, &request_ask ); + } +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-allreduce.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-allreduce.h new file mode 100644 index 0000000000..28be739a47 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-allreduce.h @@ -0,0 +1,48 @@ +#ifndef EXX_ABFS_PARALLEL_COMMUNICATE_ALLREDUCE_H +#define EXX_ABFS_PARALLEL_COMMUNICATE_ALLREDUCE_H + +#include "exx_abfs-parallel.h" +#include +#include +#include + +/* + Here are 3 kinds of parallel: + 1. exx + 2. 2D for diag + 3. grid +*/ +class Exx_Abfs::Parallel::Communicate::Allreduce +{ +public: + + Allreduce( const MPI_Comm & mpi_comm_in ); + + template< typename T > + T allreduce( + T & data_local, + std::function & insert_function); // insert_function( data_all, data_rank ) + + +private: + + void ask( const int rank_delta_now ) const; + + template< typename T > + void allreduce_thread( + boost::mpi::packed_iarchive &iar, + std::function & insert_function, + T &data_all, + atomic &rank_delta, + atomic_flag &insert_lock ); + + int comm_sz; + int my_rank; + const MPI_Comm & mpi_comm; + + static constexpr int tag_ask = 1; + static constexpr int tag_data = 2; +}; + + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm-allreduce.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm-allreduce.cpp new file mode 100644 index 0000000000..f4f34895b0 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm-allreduce.cpp @@ -0,0 +1,591 @@ +#include "exx_abfs-parallel-communicate-dm.h" +#include "src_global/serialization_boost.h" + +#include +#ifdef _OPENMP +#include +#endif + +#include "src_external/src_test/src_ri/exx_lcao-test.h" + +Exx_Abfs::Parallel::Communicate::DM::Allreduce::Allreduce( + const MPI_Comm & mpi_comm_in, + vector,matrix>>>> &data_local_in, + const Abfs::Vector3_Order &Born_von_Karman_period, + const set> &H_atom_pairs_core) + :mpi_comm(mpi_comm_in), + data_local(data_local_in), + lock_insert(ATOMIC_FLAG_INIT), + lock_atom_unset_read(0) +{ + data_all.resize(NSPIN); + + set> Born_Von_Karman_boxes; + for( int ix=0; ix!=Born_von_Karman_period.x; ++ix ) + for( int iy=0; iy!=Born_von_Karman_period.y; ++iy ) + for( int iz=0; iz!=Born_von_Karman_period.z; ++iz ) + Born_Von_Karman_boxes.insert({ix,iy,iz}); + for( const auto pair : H_atom_pairs_core ) + atom_unset[pair.first][pair.second] = Born_Von_Karman_boxes; + + MPI_Comm_size( mpi_comm, &comm_sz ); + MPI_Comm_rank( mpi_comm, &my_rank ); + + rank_delta = 1; + + oarps_isend_data.resize( comm_sz ); + for( auto &oarp_isend_data : oarps_isend_data ) + oarp_isend_data = new boost::mpi::packed_oarchive{mpi_comm}; + oarps_atom_unset.resize( comm_sz ); + for( auto &oarp_atom_unset : oarps_atom_unset ) + oarp_atom_unset = new boost::mpi::packed_oarchive{mpi_comm}; + iarps_recv_data.resize( comm_sz ); + for( auto &iarp_recv_data : iarps_recv_data ) + iarp_recv_data = new boost::mpi::packed_iarchive{mpi_comm}; + iarps_atom_asked.resize( comm_sz ); + for( auto &iarp_atom_asked : iarps_atom_asked ) + iarp_atom_asked = new boost::mpi::packed_iarchive{mpi_comm}; + + // 0: undo 1: thread finish 2: MPI begin + flags_isend_data.resize(comm_sz); + for( int irank=0; irank!=comm_sz; ++irank ) + flags_isend_data[irank] = new atomic(0); + *flags_isend_data[my_rank] = 2; + + flags_ask_atom.resize(comm_sz); + for( int irank=0; irank!=comm_sz; ++irank ) + flags_ask_atom[irank] = new atomic(0); + *flags_ask_atom[my_rank] = 2; + + flags_recv_data.resize(comm_sz,false); + flags_recv_data[my_rank] = true; +} + + +Exx_Abfs::Parallel::Communicate::DM::Allreduce::~Allreduce() +{ +//ofstream ofs_mpi("allreduce_"+TO_STRING(MY_RANK),ofstream::app); +//ofs_mpi<<"delete_begin\t"<<__FILE__<<__LINE__<,matrix>>>> +Exx_Abfs::Parallel::Communicate::DM::Allreduce::grid_to_exx() +{ +timeval t_start; +ofstream ofs_mpi("allreduce_"+TO_STRING(MY_RANK),ofstream::app); + + auto clear_oars = [&]( vector &requests, boost::dynamic_bitset<> &flags, vector &oarps, const string &s ) + { + if( flags.none() ) return; + for( int irank=0; irank!=comm_sz; ++irank ) + { + if( flags[irank] ) + { + int flag_finish; + if(MPI_SUCCESS!=MPI_Test( &requests[irank], &flag_finish, MPI_STATUS_IGNORE )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + if( flag_finish ) + { +//ofs_mpi<<"delete_begin\t"<*> &flags ) -> bool + { + int sum=0; + for( size_t i=0; i threads; + + vector requests_isend_data(comm_sz); + vector requests_ask(comm_sz); + boost::dynamic_bitset<> flags_request_isend_data(comm_sz,false); + boost::dynamic_bitset<> flags_request_ask(comm_sz,false); + + #ifdef _OPENMP + const int omp_threads = omp_get_max_threads(); + omp_set_num_threads(1); + #endif + + while( !if_finish(flags_ask_atom) || !if_finish(flags_isend_data) || !flags_recv_data.all() ) + { + MPI_Status status; + int flag_message; + if(MPI_SUCCESS!=MPI_Iprobe( MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag_message, &status )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + if(flag_message) + { + int message_size; + if(MPI_SUCCESS!=MPI_Get_count( &status, MPI_PACKED, &message_size )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + + switch(status.MPI_TAG) + { + case tag_ask: + { + const int rank_asked = status.MPI_SOURCE; + +gettimeofday(&t_start, NULL); + iarps_atom_asked[rank_asked]->resize(message_size); + if(MPI_SUCCESS!=MPI_Recv( iarps_atom_asked[rank_asked]->address(), message_size, MPI_PACKED, rank_asked, tag_ask, mpi_comm, MPI_STATUS_IGNORE )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); +ofs_mpi<<"TIME@ MPI_Recv tag_ask\t"<resize(message_size); + if(MPI_SUCCESS!=MPI_Recv( iarps_recv_data[rank_data]->address(), message_size, MPI_PACKED, rank_data, tag_data, mpi_comm, MPI_STATUS_IGNORE )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + flags_recv_data[rank_data] = true; +ofs_mpi<<"TIME@ MPI_Recv tag_data\t"<address(), oarps_atom_unset[rank_ask]->size(), MPI_PACKED, rank_ask, tag_ask, mpi_comm, &requests_ask[rank_ask] )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + flags_request_ask[rank_ask] = true; + *flags_ask_atom[rank_ask] = 2; +ofs_mpi<<"TIME@ MPI_Isend atom_unset\t"<address(), oarps_isend_data[rank_asked]->size(), MPI_PACKED, rank_asked, tag_data, mpi_comm, &requests_isend_data[rank_asked] )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + flags_request_isend_data[rank_asked] = true; + *flags_isend_data[rank_asked] = 2; +ofs_mpi<<"TIME@ MPI_Isend isend_data\t"<size()<,Matrix_Wrapper>>>> & v ) -> bool + { + for( const auto &i : v ) + if(!i.empty()) return false; + return true; + }; +timeval t_start; +ofstream ofs_thread("allreduce_"+TO_STRING(MY_RANK)+"_"+TO_STRING(this_thread::get_id()),ofstream::app); +ofs_thread<<"recv\t"<,Matrix_Wrapper>>>> data_rank; +gettimeofday(&t_start, NULL); + *iarps_recv_data[rank_data] >> data_rank; +ofs_thread<<"finish iarps_recv_data >>\t"<size()<>\t"<size()<resize(0); +//ofs_thread<<"delete_end\t"<<"iarps_recv_data\t"<,matrix>>>> &data_rank ) +{ + vector,matrix>>*> data_rank_Ap(NSPIN,nullptr); + vector,matrix>*> data_rank_Bp(NSPIN,nullptr); + vector data_rank_Cp(NSPIN,nullptr); +ofstream ofs_mpi("allreduce_"+TO_STRING(MY_RANK),ofstream::app); +ofs_mpi<<"insert_data"<first; + for( int is=0; is!=NSPIN; ++is ) data_rank_Ap[is] = static_cast,matrix>>*>( MAP_EXIST( data_rank[is], iat1 ) ); + if( !data_rank_Ap[0] ){ ++atom_unset_Ap; continue; } +//ofs_mpi<<" "<second.begin(); atom_unset_Bp!=atom_unset_Ap->second.end(); ) + { + const size_t iat2 = atom_unset_Bp->first; + for( int is=0; is!=NSPIN; ++is ) data_rank_Bp[is] = static_cast,matrix>*>( MAP_EXIST( *data_rank_Ap[is], iat2 ) ); + if( !data_rank_Bp[0] ){ ++atom_unset_Bp; continue; } +//ofs_mpi<<" "<second.begin(); atom_unset_Cp!=atom_unset_Bp->second.end(); ) + { + const Abfs::Vector3_Order &box2 = *atom_unset_Cp; + for( int is=0; is!=NSPIN; ++is ) data_rank_Cp[is] = static_cast( MAP_EXIST( *data_rank_Bp[is], box2 ) ); + if( !data_rank_Cp[0] ){ ++atom_unset_Cp; continue; } +//ofs_mpi<<" "<c ) + { + auto &data_all_C = data_all[is][iat1][iat2][box2]; + if(!data_all_C.c) + data_all_C = std::move(*data_rank_Cp[is]); + } + + atom_unset_Bp->second.erase( atom_unset_Cp++ ); + } + if( atom_unset_Bp->second.empty() ) + atom_unset_Ap->second.erase( atom_unset_Bp++ ); + else + ++atom_unset_Bp; + } + if( atom_unset_Ap->second.empty() ) + atom_unset.erase( atom_unset_Ap++ ); + else + ++atom_unset_Ap; + } +ofs_mpi<<"finish insert"<,Matrix_Wrapper>>>> &data_rank ) +{ + vector,Matrix_Wrapper>>*> data_rank_Ap(NSPIN,nullptr); + vector,Matrix_Wrapper>*> data_rank_Bp(NSPIN,nullptr); + vector data_rank_Cp(NSPIN,nullptr); +ofstream ofs_thread("allreduce_"+TO_STRING(MY_RANK)+"_"+TO_STRING(this_thread::get_id()),ofstream::app); +ofs_thread<<"insert_data"<first; + for( int is=0; is!=NSPIN; ++is ) data_rank_Ap[is] = static_cast,Matrix_Wrapper>>*>(MAP_EXIST( data_rank[is], iat1 )); + if( !data_rank_Ap[0] ){ ++atom_unset_Ap; continue; } +//ofs_thread<<" "<second.begin(); atom_unset_Bp!=atom_unset_Ap->second.end(); ) + { + const size_t iat2 = atom_unset_Bp->first; + for( int is=0; is!=NSPIN; ++is ) data_rank_Bp[is] = static_cast,Matrix_Wrapper>*>(MAP_EXIST( *data_rank_Ap[is], iat2 )); + if( !data_rank_Bp[0] ){ ++atom_unset_Bp; continue; } +//ofs_thread<<" "<second.begin(); atom_unset_Cp!=atom_unset_Bp->second.end(); ) + { + const Abfs::Vector3_Order &box2 = *atom_unset_Cp; + for( int is=0; is!=NSPIN; ++is ) data_rank_Cp[is] = static_cast(MAP_EXIST( *data_rank_Bp[is], box2 )); + if( !data_rank_Cp[0] ){ ++atom_unset_Cp; continue; } +//ofs_thread<<" "<c ) + { + auto & data_all_C = data_all[is][iat1][iat2][box2]; + if( !data_all_C.c ) + data_all_C = data_rank_Cp[is]->to_matrix(); + } + + atom_unset_Bp->second.erase( atom_unset_Cp++ ); + } + if( atom_unset_Bp->second.empty() ) + atom_unset_Ap->second.erase( atom_unset_Bp++ ); + else + ++atom_unset_Bp; + } + if( atom_unset_Ap->second.empty() ) + atom_unset.erase( atom_unset_Ap++ ); + else + ++atom_unset_Ap; + } +ofs_thread<<"finish insert"<>>> atom_asked; +gettimeofday(&t_start, NULL); + *iarps_atom_asked[rank_asked] >> atom_asked; +ofs_thread<<"finish iarps_atom_asked >>\t"<size()<>\t"<resize(0); +//ofs_thread<<"delete_end\t"<<"iarps_atom_asked\t"<,Matrix_Wrapper>>>> matrix_wrapped = get_data_local_wrapper(atom_asked); +ofs_thread<<"finish get_data_local_wrapper"<size()<,Matrix_Wrapper>>>> +Exx_Abfs::Parallel::Communicate::DM::Allreduce::get_data_local_wrapper( + const map>>> & atom_asked ) const +{ +//ofstream ofs_thread("allreduce_"+TO_STRING(MY_RANK)+"_"+TO_STRING(this_thread::get_id()),ofstream::app); +//ofs_thread<<"get_data_local_wrapper"<,Matrix_Wrapper>>>> mw(NSPIN); + for( int is=0; is!=NSPIN; ++is ) + { + auto &mw_is = mw[is]; + const auto &data_local_is = data_local[is]; + for( const auto & atom_asked_A : atom_asked ) + { + const size_t iat1 = atom_asked_A.first; + if( auto data_local_A = static_cast,matrix>> * const>(MAP_EXIST( data_local_is, iat1 )) ) + { + auto &mw_A = mw_is[iat1]; + for( const auto & atom_asked_B : atom_asked_A.second ) + { + const size_t iat2 = atom_asked_B.first; + if( auto data_local_B = static_cast,matrix> * const>(MAP_EXIST( *data_local_A, iat2 )) ) + { + auto &mw_B = mw_A[iat2]; + for( const auto & atom_asked_C : atom_asked_B.second ) + { + const Abfs::Vector3_Order &box2 = atom_asked_C; + if( auto data_local_C = static_cast(MAP_EXIST( *data_local_B, box2 )) ) + { + mw_B[box2] = *data_local_C; + } + } + } + } + } + } + } +//ofs_thread.close(); + return mw; +} +*/ + +vector,Matrix_Wrapper>>>> +Exx_Abfs::Parallel::Communicate::DM::Allreduce::get_data_local_wrapper( + const map>>> & atom_asked ) const +{ +ofstream ofs_thread("allreduce_"+TO_STRING(MY_RANK)+"_"+TO_STRING(this_thread::get_id()),ofstream::app); +ofs_thread<<"get_data_local_wrapper"<,Matrix_Wrapper>>>> mw(NSPIN); + for( int is=0; is!=NSPIN; ++is ) + { + auto &mw_is = mw[is]; + const auto &data_localw_is = data_localw[is]; + for( const auto & atom_asked_A : atom_asked ) + { + const size_t iat1 = atom_asked_A.first; + if( auto data_localw_A = static_cast,Matrix_Wrapper>> * const>(MAP_EXIST( data_localw_is, iat1 )) ) + { + auto &mw_A = mw_is[iat1]; + for( const auto & atom_asked_B : atom_asked_A.second ) + { + const size_t iat2 = atom_asked_B.first; + if( auto data_localw_B = static_cast,Matrix_Wrapper> * const>(MAP_EXIST( *data_localw_A, iat2 )) ) + { + auto &mw_B = mw_A[iat2]; + for( const auto & atom_asked_C : atom_asked_B.second ) + { + const Abfs::Vector3_Order &box2 = atom_asked_C; + if( auto data_localw_C = static_cast(MAP_EXIST( *data_localw_B, box2 )) ) + { + mw_B[box2] = *data_localw_C; + } + } + } + } + } + } + } +ofs_thread.close(); + return mw; +} + +vector,Matrix_Wrapper>>>> +Exx_Abfs::Parallel::Communicate::DM::Allreduce::get_data_local_wrapper() const +{ +ofstream ofs_thread("allreduce_"+TO_STRING(MY_RANK)+"_"+TO_STRING(this_thread::get_id()),ofstream::app); +ofs_thread<<"get_data_local_wrapper"<,Matrix_Wrapper>>>> mw(NSPIN); + for( int is=0; is!=NSPIN; ++is ) + { + const auto &data_local_is = data_local[is]; + auto &mw_is = mw[is]; + for( const auto &data_local_A : data_local_is ) + { + const size_t iat1 = data_local_A.first; + auto &mw_A = mw_is[iat1]; + for( const auto &data_local_B : data_local_A.second ) + { + const size_t iat2 = data_local_B.first; + auto &mw_B = mw_A[iat2]; + for( const auto &data_local_C : data_local_B.second ) + { + const Abfs::Vector3_Order &box2 = data_local_C.first; + mw_B[box2] = data_local_C.second; + } + } + } + } +ofs_thread.close(); + return mw; +} diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm.cpp new file mode 100644 index 0000000000..1090133487 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm.cpp @@ -0,0 +1,294 @@ +#include "exx_abfs-parallel-communicate-dm.h" +#include "src_lcao/global_fp.h" +#include "src_pw/global.h" +#include "src_lcao/record_adj.h" + +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "lcao_nnr.h" +//#include + +/* +void Exx_Abfs::Parallel::Communicate::DM::set_atom_in_exx( const set> &H_atom_pairs_core ) +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM::set_atom_in_exx"); + + atom_in_exx.row.resize(ucell.nat); + atom_in_exx.col.resize(ucell.nat); + for( const auto pair : H_atom_pairs_core ) + { + atom_in_exx.row[pair.first] = true; + atom_in_exx.col[pair.second] = true; + } +} +*/ + +/* +map,matrix>>> +Exx_Abfs::Parallel::Communicate::DM::m2D_to_a2Dexx( + const matrix &DM_m2D, + const int iwt1_index_begin, + const int iwt2_index_begin) const +{ + map,matrix>>> DM_a2Dexx; + for( int iwt1_m2D=0; iwt1_m2D(0,0,0))(iw1,iw2) = DM_m2D(iwt1_m2D,iwt2_m2D); + } + catch(const std::out_of_range&) + { + DM_a2Dexx[iat1][iat2][Abfs::Vector3_Order(0,0,0)].creat( + ucell.atoms[ucell.iat2it[iat1]].nw, + ucell.atoms[ucell.iat2it[iat2]].nw); + DM_a2Dexx[iat1][iat2][Abfs::Vector3_Order(0,0,0)](iw1,iw2) = DM_m2D(iwt1_m2D,iwt2_m2D); + } + } + } + return DM_a2Dexx; +} + + +Exx_Abfs::Parallel::Communicate::DM::a2Dexx_to_exx( + map,matrix>>> & m_exx, + map,matrix>>> & m_a2Dexx ) const +{ + for( size_t is=0; is!=NSPIN; ++is ) + { + for( auto & m_a2DexxA : m_a2Dexx[is] ) + { + const size_t iat1 = m_a2DexxA.first; + for( auto & m_a2DexxB : m_a2DexxA.second ) + { + const size_t iat2 = m_a2DexxB.first; + for( auto & m_a2DexxC : m_a2DexxB.second ) + { + const Abfs::Vector3_Order & box2 = m_a2DexxC.first; + if( m_a2DexxC.second.absmax() < threshold ) continue; + try { m_exx[is].at(iat1).at(iat2).at(box2) += m_a2DexxC.second ; } + catch(std::out_of_range&) { m_exx[is] [iat1] [iat2] [box2] = std::move(m_a2DexxC.second); } + } + } + } + m_a2Dexx[is].clear(); + } +} + + +Exx_Abfs::Parallel::Communicate::DM::f( + const matrix &DM_m2D, + const int iwt1_index_begin, + const int iwt2_index_begin) +{ + map,matrix>>> & DM_a2Dexx = + m2D_to_a2Dexx( DM_m2D, iwt1_index_begin, iwt2_index_begin ); + a2Dexx_to_exx( this->DMr, DM_a2Dexx ); +} +*/ + +void Exx_Abfs::Parallel::Communicate::DM::cal_DM( + const Abfs::Vector3_Order &Born_von_Karman_period, + const set> &H_atom_pairs_core, + const double threshold ) +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM::cal_DM"); + +ofstream ofs_time("time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +//gettimeofday( &t_start, NULL); +#if false + vector,matrix>>>> DM_grid = LOC_to_grid( Born_von_Karman_period, threshold ); +//ofs_time<<"TIME@ Exx_Abfs::Parallel::Communicate::DM::LOC_to_grid\t"<DMr = allreduce.grid_to_exx(); +//ofs_time<<"TIME@ Exx_Abfs::Parallel::Communicate::DM::Allreduce::grid_to_exx\t"< vector,matrix>>>> + { + vector> Born_von_Karman_boxes; + for( int ix=0; ix,matrix>>>> DM_grid(NSPIN); + for( const auto &DMrA : dm_my.DMr ) + { + const size_t iat1 = DMrA.first; + for( const auto &DMrB : DMrA.second ) + { + const size_t iat2 = DMrB.first; + for( const auto &DMrC : DMrB.second ) + { + const auto box2 = DMrC.first; + for( size_t is=0; is!=DMrC.second.size(); ++is ) + DM_grid[is][iat1][iat2][box2] = std::move(DMrC.second[is]); + } + } + } + return DM_grid; + }; +//gettimeofday( &t_start, NULL); + this->DMr = cal_dm_my(); +//ofs_time<<"TIME@ Exx_Abfs::Parallel::Communicate::DM::Allreduce::cal_dm_my\t"<,matrix>>>> +Exx_Abfs::Parallel::Communicate::DM::LOC_to_grid( + const Abfs::Vector3_Order &Born_von_Karman_period, + const double threshold ) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM::LOC_to_grid"); + + const double SPIN_multiple = 0.5*NSPIN; + + vector,matrix>>>> DM_grid(NSPIN); + if(GAMMA_ONLY_LOCAL) + { +{ + ofstream ofs("LOC.DM_"+TO_STRING(MY_RANK)); + for( int is=0; is!=NSPIN; ++is ) + { + for( int i1=0; i1!=GridT.lgd; ++i1 ) + { + for( int i2=0; i2!=GridT.lgd; ++i2 ) + ofs<= threshold ) + DM_grid[is][iat1][iat2][{0,0,0}] = DM_grid_2D * SPIN_multiple; + else + DM_grid[is][iat1][iat2][{0,0,0}]; // to erase atom_unset + iwt2_index += nw2; + } + iwt1_index += nw1; + } + + /* + for( int iwt1_grid=0; iwt1_grid box2( RA.info[iat1][iat2_2D][0], RA.info[iat1][iat2_2D][1], RA.info[iat1][iat2_2D][2] ); + const Abfs::Vector3_Order boxp2 = box2%Born_von_Karman_period; + const int nw1 = ucell.atoms[ucell.iat2it[iat1]].nw; + const int nw2 = ucell.atoms[ucell.iat2it[iat2]].nw; +{ + ofs_LOC_DM<<"@\t"<= threshold ) + DM_grid[is][iat1][iat2][boxp2] = DM_grid_2D * SPIN_multiple; + else + DM_grid[is][iat1][iat2][boxp2]; // to erase atom_unset + } + iw_index += nw1*nw2; + } + } + } +ofs_LOC_DM.close(); + } + return DM_grid; +} + diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm.h new file mode 100644 index 0000000000..d15182a39f --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm.h @@ -0,0 +1,93 @@ +#ifndef EXX_ABFS_PARALLEL_COMMUNICATE_DM_H +#define EXX_ABFS_PARALLEL_COMMUNICATE_DM_H + +#include "exx_abfs-parallel.h" +#include "src_global/matrix.h" +#include "src_global/matrix_wrapper.h" +#include "src_ri/abfs-vector3_order.h" +#include +#include +#include +#include +#include +#include +#include + +class Exx_Abfs::Parallel::Communicate::DM +{ +public: + + void cal_DM( + const Abfs::Vector3_Order &Born_von_Karman_period, + const set> &H_atom_pairs_core, + const double threshold ); + + vector,matrix>>>> DMr; + +private: + + vector,matrix>>>> LOC_to_grid( + const Abfs::Vector3_Order &Born_von_Karman_period, + const double threshold ) const; + + class Allreduce + { + public: + Allreduce( + const MPI_Comm & mpi_comm_in, + vector,matrix>>>> &data_local_in, + const Abfs::Vector3_Order &Born_von_Karman_period, + const set> &H_atom_pairs_core); + ~Allreduce(); + vector,matrix>>>> grid_to_exx(); + + private: + void ask( const int rank_delta_now ); + void recv_data_process( const int rank_data ); + void insert_data( vector,matrix>>>> &data_rank ); + void insert_data( vector,Matrix_Wrapper>>>> &data_rank ); + void send_data_process( const int rank_asked ); + vector,Matrix_Wrapper>>>> get_data_local_wrapper( const map>>> & atom_asked ) const; + vector,Matrix_Wrapper>>>> get_data_local_wrapper() const; + + private: + vector,matrix>>>> data_all; + vector,matrix>>>> &data_local; + vector,Matrix_Wrapper>>>> data_localw; + + map>>> atom_unset; + + const MPI_Comm & mpi_comm; + int comm_sz; + int my_rank; + + static constexpr int tag_ask = 1; + static constexpr int tag_data = 2; + + atomic_flag lock_insert; + atomic lock_atom_unset_read; + atomic rank_delta; + + vector oarps_isend_data; + vector oarps_atom_unset; + vector iarps_recv_data; + vector iarps_atom_asked; + + vector*> flags_isend_data; + vector*> flags_ask_atom; + boost::dynamic_bitset<> flags_recv_data; + }; + + +/* +private: + struct + { + vector row; + vector col; + }atom_in_exx; + void set_atom_in_exx( const set> &H_atom_pairs_core ); +*/ +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm2.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm2.cpp new file mode 100644 index 0000000000..c0bf158a29 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm2.cpp @@ -0,0 +1,122 @@ +#include "exx_abfs-parallel-communicate-dm2.h" +#include "src_pw/global.h" + + +void Exx_Abfs::Parallel::Communicate::DM2::init( + const set> &H_atom_pairs_core, + const double threshold_in) +{ + threshold = threshold_in; + + atom_in_exx.row.resize(ucell.nat,false); + atom_in_exx.col.resize(ucell.nat,false); + atom_in_exx.row_col.resize(ucell.nat,vector(ucell.nat,false)); + + for( const auto &pair : H_atom_pairs_core ) + { + atom_in_exx.row[pair.first] = true; + atom_in_exx.col[pair.second] = true; + atom_in_exx.row_col[pair.first][pair.second] = true; + } +} + +void Exx_Abfs::Parallel::Communicate::DM2::clear_DMr() +{ + DMr.clear(); + DMr.resize(NSPIN); +} + +void Exx_Abfs::Parallel::Communicate::DM2::set_DM_gamma( const matrix &DM_2D, const int is, const pair &index_begin ) +{ + auto get_iats = []( const int n, const int i_begin, const vector &in_exx ) -> map> + { + map> iats; + for( int i=0; i=0; --i ) + { + const int iat = ucell.iwt2iat[i+i_begin]; + if( in_exx[iat] ) + iats[iat].first=i; + } + return iats; + }; + const map> iat1s = get_iats( DM_2D.nr, index_begin.first, atom_in_exx.row ); + const map> iat2s = get_iats( DM_2D.nc, index_begin.second, atom_in_exx.col ); + + const double SPIN_multiple = 0.5*NSPIN; + for( const auto &iat1sA : iat1s ) + { + const int iat1 = iat1sA.first; + const auto &iat1_range = iat1sA.second; + for( const auto &iat2sA : iat2s ) + { + const int iat2 = iat2sA.first; + const auto &iat2_range = iat2sA.second; + if( !atom_in_exx.row_col[iat1][iat2] ) continue; + + matrix DM_local( ucell.atoms[ucell.iat2it[iat1]].nw, ucell.atoms[ucell.iat2it[iat2]].nw ); + const int iw2_begin = ucell.iwt2iw[ iat2_range.first + index_begin.second ]; + for( int iw1_2D=iat1_range.first; iw1_2D<=iat1_range.second; ++iw1_2D ) + { + const int iw1 = ucell.iwt2iw[ iw1_2D + index_begin.first ]; + memcpy( + &DM_local( iw1, iw2_begin ), + &DM_2D( iw1_2D, iat2_range.first ), + ( iat2_range.second - iat2_range.first + 1 )*sizeof(double) ); + } + DM_local *= SPIN_multiple; + + if( DM_local.absmax() < threshold ) continue; + + if( matrix*const DM_ptr = static_cast(MAP_EXIST( DMr[is], iat1, iat2, Abfs::Vector3_Order{0,0,0} )) ) + *DM_ptr += DM_local; + else + DMr[is][iat1][iat2][{0,0,0}] = std::move(DM_local); + } + } +} + + + + +void Exx_Abfs::Parallel::Communicate::DM2::cal_DM_k( + const Abfs::Vector3_Order &Born_von_Karman_period, + const set> &H_atom_pairs_core, + const double threshold ) +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM::cal_DM"); + + vector> Born_von_Karman_boxes; + for( int ix=0; ix{ix,iy,iz} % Born_von_Karman_period ); + + Exx_Abfs::DM dm_my; + dm_my.flag_mix = false; + dm_my.cal_DM( H_atom_pairs_core, Born_von_Karman_boxes ); + + this->DMr.clear(); + this->DMr.resize(NSPIN); + for( const auto &DMrA : dm_my.DMr ) + { + const size_t iat1 = DMrA.first; + for( const auto &DMrB : DMrA.second ) + { + const size_t iat2 = DMrB.first; + for( const auto &DMrC : DMrB.second ) + { + const auto box2 = DMrC.first; + for( size_t is=0; is!=DMrC.second.size(); ++is ) + if( DMrC.second[is].absmax() >= threshold ) + DMr[is][iat1][iat2][box2] = std::move(DMrC.second[is]); + } + } + } + +} diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm2.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm2.h new file mode 100644 index 0000000000..80f9d7f19d --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm2.h @@ -0,0 +1,39 @@ +#ifndef EXX_ABFS_PARALLEL_COMMUNICATE_DM2_H +#define EXX_ABFS_PARALLEL_COMMUNICATE_DM2_H + +#include "exx_abfs-parallel.h" +#include "src_global/matrix.h" +#include "src_ri/abfs-vector3_order.h" +#include +#include + +class Exx_Abfs::Parallel::Communicate::DM2 +{ +public: + + void init( + const set> &H_atom_pairs_core, + const double threshold_in); + void clear_DMr(); + void set_DM_gamma( const matrix &DM_2D, const int is, const pair &index_begin ); + + void cal_DM_k( + const Abfs::Vector3_Order &Born_von_Karman_period, + const set> &H_atom_pairs_core, + const double threshold ); + + vector,matrix>>>> DMr; + +private: + + double threshold; + + struct + { + vector row; + vector col; + vector> row_col; + }atom_in_exx; +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm3-allreduce.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm3-allreduce.cpp new file mode 100644 index 0000000000..79e6f31e2f --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm3-allreduce.cpp @@ -0,0 +1,615 @@ +#include "exx_abfs-parallel-communicate-dm3.h" +#include "exx_abfs-parallel-communicate-function.h" + +#include "src_pw/global.h" +#include "src_global/global_function.h" + +#ifdef USE_CEREAL_SERIALIZATION + #include "src_global/serialization_cereal.h" +#endif + +#include +#include +#include + + +#include "src_external/src_test/test_function.h" + + +void Exx_Abfs::Parallel::Communicate::DM3::Allreduce::init( + const MPI_Comm &mpi_comm_in, + const map,set> &H_atom_pairs_group) +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM3::Allreduce::init"); + + mpi_comm = mpi_comm_in; + MPI_Comm_size(mpi_comm, &comm_sz); + MPI_Comm_rank(mpi_comm, &my_rank); + +// const vector> atom_in_2D = get_atom_in_2D(); + H_atom_pairs_group_rank = get_H_atom_pairs_group_rank(H_atom_pairs_group); + get_send_recv_size(H_atom_pairs_group_rank, H_atom_pairs_group, send_size_list, recv_size); + +ofstream ofs(exx_lcao.test_dir.process+"dm3_"+TO_STRING(my_rank)); +//ofs<,matrix>>>> + Exx_Abfs::Parallel::Communicate::DM3::Allreduce::a2D_to_exx( + vector,matrix>>>> &data_local) const +{ +ofstream ofs(exx_lcao.test_dir.process+"dm3_"+TO_STRING(my_rank), ofstream::app); +//ofs<,matrix>>>> data_all(NSPIN); + + vector> flags_send(comm_sz); + vector> flags_recv(comm_sz); + init_flags(flags_send, flags_recv); + + vector> oarps_isend(comm_sz); + vector> iarps_irecv(comm_sz); + + int rank_send_now = my_rank; + auto rank_send_next = [&]()->int{ return (rank_send_now+1)%comm_sz; }; + + atomic_flag lock_insert = ATOMIC_FLAG_INIT; + vector threads; + vectorrequests_isend(comm_sz); + vectorrequests_irecv(comm_sz); +ofs<<__LINE__<,matrix*>>>> data_intersection = get_intersection(my_rank, data_local); + while( lock_insert.test_and_set() ); + insert_data(data_intersection, data_all); + lock_insert.clear(); +ofs<<__LINE__<> Exx_Abfs::Parallel::Communicate::DM3::Allreduce::get_atom_in_2D() const +{ + vector> atom_in_2D(ucell.nat,{false,false}); + for(int iwt=0; iwt=0) + atom_in_2D[iat].first = true; + if(ParaO.trace_loc_row[iwt]>=0) + atom_in_2D[iat].second = true; + } + else + throw domain_error(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + return atom_in_2D; +} +*/ + + +/* +vector>>> Exx_Abfs::Parallel::Communicate::DM3::Allreduce::get_H_atom_pairs_group_rank( + const map,set> &H_atom_pairs_group, + const vector> &atom_in_2D) const +{ + vector H_atom_pairs_group_vector; + for(const auto &pairs : H_atom_pairs_group) + { + H_atom_pairs_group_vector.push_back(pairs.first.size()); + H_atom_pairs_group_vector.push_back(pairs.second.size()); + H_atom_pairs_group_vector.insert(H_atom_pairs_group_vector.end(), pairs.first.begin(), pairs.first.end()); + H_atom_pairs_group_vector.insert(H_atom_pairs_group_vector.end(), pairs.second.begin(), pairs.second.end()); + } + + vector rank_size(comm_sz); + vector rank_index(comm_sz); + for(size_t i=0; i(comm_sz,1)), VECTOR_TO_PTR(rank_index), MPI_INT, + mpi_comm ); + + size_t index_accumulate = 0; + for(size_t i=0; i H_atom_pairs_group_rank_vector(index_accumulate); + MPI_Allgatherv( + VECTOR_TO_PTR(H_atom_pairs_group_vector), H_atom_pairs_group_vector.size(), MPI_INT, + VECTOR_TO_PTR(H_atom_pairs_group_rank_vector), VECTOR_TO_PTR(rank_size), VECTOR_TO_PTR(rank_index), MPI_INT, + mpi_comm); + + vector>>> H_atom_pairs_group_rank(comm_sz); + auto ptr = H_atom_pairs_group_rank_vector.begin(); + for(int rank=0; rank!=comm_sz; ++rank) + { + const auto ptr_begin = ptr; + while(ptr < ptr_begin+rank_size[rank]) + { + const size_t atoms1_size = *ptr++; + const size_t atoms2_size = *ptr++; + if(atoms1_size&&atoms2_size) + { + shared_ptr> atoms2 = make_shared>(); + for(int i=0; iinsert(atom_require); + } + } + else + { + ptr += atoms1_size + atoms2_size; + } + } + } + return H_atom_pairs_group_rank; +} +*/ + + +vector>> Exx_Abfs::Parallel::Communicate::DM3::Allreduce::get_H_atom_pairs_group_rank( + const map,set> &H_atom_pairs_group) const +{ + constexpr int tag = 0; + + const vector,vector>> atom_in_2D_list = Exx_Abfs::Parallel::Communicate::Function::get_atom_in_2D_list(mpi_comm); + + vector request(comm_sz); + vector atom_send_str(comm_sz); + for(int rank_tmp=my_rank; rank_tmp!=comm_sz+my_rank; ++rank_tmp) + { + const int rank = rank_tmp%comm_sz; + map> atom_required; + for(const auto & H_atom_pairs : H_atom_pairs_group) + for(const size_t iat1 : H_atom_pairs.first) + if(atom_in_2D_list[rank].first[iat1]) + for(const size_t iat2 : H_atom_pairs.second) + if(atom_in_2D_list[rank].second[iat2]) + atom_required[iat1].insert(iat2); + + #ifdef USE_CEREAL_SERIALIZATION + { + stringstream atom_send_ss; + cereal::BinaryOutputArchive ar(atom_send_ss); + ar(atom_required); + atom_send_str[rank] = atom_send_ss.str(); + } + #else + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + #endif + if( MPI_Isend( atom_send_str[rank].c_str(), atom_send_str[rank].size(), MPI_CHAR, rank, tag, mpi_comm, &request[rank] ) !=MPI_SUCCESS) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + } + + vector>> H_atom_pairs_group_rank(comm_sz); + for(int i=0; i!=comm_sz; ++i) + { + MPI_Status status; + if( MPI_Probe( MPI_ANY_SOURCE, tag, mpi_comm, &status ) !=MPI_SUCCESS) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + int size_recv; + if( MPI_Get_count( &status, MPI_CHAR, &size_recv) !=MPI_SUCCESS) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + + vector ss_buffer(size_recv); + if( MPI_Recv( ss_buffer.data(), size_recv, MPI_CHAR, status.MPI_SOURCE, tag, mpi_comm, MPI_STATUS_IGNORE ) !=MPI_SUCCESS) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + stringstream atom_recv_ss; + atom_recv_ss.rdbuf()->pubsetbuf(ss_buffer.data(),size_recv); + #ifdef USE_CEREAL_SERIALIZATION + { + cereal::BinaryInputArchive ar(atom_recv_ss); + ar(H_atom_pairs_group_rank[status.MPI_SOURCE]); + } + #else + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + #endif + } + + if( MPI_Waitall( comm_sz, request.data(), MPI_STATUSES_IGNORE ) !=MPI_SUCCESS) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + return H_atom_pairs_group_rank; +} + +void Exx_Abfs::Parallel::Communicate::DM3::Allreduce::get_send_recv_size( + const vector>> &H_atom_pairs_group_rank, + const map,set> &H_atom_pairs_group, + vector &send_size_list, size_t &recv_size) const +{ + send_size_list.resize(comm_sz,0); + for(int rank=0; rank!=comm_sz; ++rank) + { + for(const auto &H_pairs_tmp : H_atom_pairs_group_rank[rank]) + { + const size_t iat1 = H_pairs_tmp.first; + for(const size_t iat2 : H_pairs_tmp.second) + send_size_list[rank] += ucell.atoms[ucell.iat2it[iat1]].nw * ucell.atoms[ucell.iat2it[iat2]].nw; + } + send_size_list[rank] *= sizeof(double); + } + + recv_size = 0; + for(const auto &pairs : H_atom_pairs_group) + { + size_t nw1=0, nw2=0; + for(size_t iat1 : pairs.first) + nw1 += ucell.atoms[ucell.iat2it[iat1]].nw; + for(size_t iat2 : pairs.second) + nw2 += ucell.atoms[ucell.iat2it[iat2]].nw; + recv_size += nw1*nw1; + } + recv_size *= sizeof(double); +} + + +void Exx_Abfs::Parallel::Communicate::DM3::Allreduce::init_flags( + vector> &flags_send, + vector> &flags_recv) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM3::Allreduce::init_flags"); + + for(atomic &flag_send : flags_send) + flag_send = Flag_Send::undo; + flags_send[my_rank] = Flag_Send::finish_isend; + + for(atomic &flag_recv : flags_recv) + flag_recv = Flag_Recv::undo; + flags_recv[my_rank] = Flag_Recv::finish_iar; +} + + +bool Exx_Abfs::Parallel::Communicate::DM3::Allreduce::finish_judge( + const vector> &flags_send, + const vector> &flags_recv) const +{ + for(int rank_send=0; rank_send!=comm_sz; ++rank_send) + if((flags_send[rank_send]!=Flag_Send::begin_isend) && (flags_send[rank_send]!=Flag_Send::finish_isend)) + return false; + for(int rank_recv=0; rank_recv!=comm_sz; ++rank_recv) + if((flags_recv[rank_recv]!=Flag_Recv::begin_iar) && (flags_recv[rank_recv]!=Flag_Recv::finish_iar)) + return false; + return true; +} + + +bool Exx_Abfs::Parallel::Communicate::DM3::Allreduce::memory_enough( + const int rank_send_next, + const vector> &flags_send) const +{ + size_t memory_need = recv_size; + for(int rank_send=0; rank_sendsend_size_list[rank_send_next]) ? true : false; +} + + +/* +void Exx_Abfs::Parallel::Communicate::DM3::Allreduce::send_data_process( + const int rank_send_now, + const vector,matrix>>>> &data_local, + vector> &oarps_isend, + vector> &flags_send) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM3::Allreduce::send_data_process"); + + vector &oarp = oarps_isend[rank_send_now]; + for( int is=0; is!=NSPIN; ++is ) + { + oarp.push_back(-999); const size_t index_size = oarp.size()-1; + auto ptr_data_A = data_local[is].begin(); + auto ptr_atom_A = H_atom_pairs_group_rank[rank_send_now].begin(); + while(ptr_data_A!=data_local[is].end() && ptr_atom_A!=H_atom_pairs_group_rank[rank_send_now].end()) + { + if(ptr_data_A->first < ptr_atom_A->first) ++ptr_data_A; + else if(ptr_data_A->first > ptr_atom_A->first) ++ptr_atom_A; + else + { + const size_t iat1 = ptr_data_A->first; + auto ptr_data_B = ptr_data_A->second.begin(); + auto ptr_atom_B = ptr_atom_A->second->begin(); + while(ptr_data_B!=ptr_data_A->second.end() && ptr_atom_B!=ptr_atom_A->second->end()) + { + const size_t iat2 = ptr_data_B->first; + if(ptr_data_B->first < *ptr_atom_B) ++ptr_data_B; + else if(ptr_data_B->first > *ptr_atom_B) ++ptr_atom_B; + else + { + for(const auto &data_C : ptr_data_B->second) + { + const Abfs::Vector3_Order &box2 = data_C.first; + const matrix &m = data_C.second; + oarp.push_back(iat1); + oarp.push_back(iat2); + oarp.push_back(box2.x); oarp.push_back(box2.y); oarp.push_back(box2.z); + oarp.push_back(m.nr); oarp.push_back(m.nc); + oarp.insert(oarp.end(), m.c, m.c+m.nr*m.nc); + } + ++ptr_data_B; ++ptr_atom_B; + } + } + ++ptr_data_A; ++ptr_atom_A; + } + } + oarp[index_size] = oarp.size() - (index_size+1); + } + flags_send[rank_send_now] = Flag_Send::finish_oar; +} +*/ + +void Exx_Abfs::Parallel::Communicate::DM3::Allreduce::send_data_process( + const int rank_send_now, + const vector,matrix>>>> &data_local, + vector> &oarps_isend, + vector> &flags_send) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM3::Allreduce::send_data_process"); + + const vector,matrix*>>>> data_intersection = get_intersection( + rank_send_now, + const_cast,matrix>>>>&>(data_local)); + + vector &oarp = oarps_isend[rank_send_now]; + for( int is=0; is!=NSPIN; ++is ) + { + oarp.push_back(-999); const size_t index_size = oarp.size()-1; + for(const auto data_A : data_intersection[is]) + { + const size_t iat1 = data_A.first; + for(const auto data_B : data_A.second) + { + const size_t iat2 = data_B.first; + for(const auto data_C : data_B.second) + { + const Abfs::Vector3_Order &box2 = data_C.first; + const matrix &m = *data_C.second; + oarp.push_back(iat1); + oarp.push_back(iat2); + oarp.push_back(box2.x); oarp.push_back(box2.y); oarp.push_back(box2.z); + oarp.push_back(m.nr); oarp.push_back(m.nc); + oarp.insert(oarp.end(), m.c, m.c+m.nr*m.nc); + } + } + } + oarp[index_size] = oarp.size() - (index_size+1); + } + flags_send[rank_send_now] = Flag_Send::finish_oar; +} + +vector,matrix*>>>> Exx_Abfs::Parallel::Communicate::DM3::Allreduce::get_intersection( + const int rank_send_now, + vector,matrix>>>> &data_local) const +{ + vector,matrix*>>>> data_intersection(NSPIN); + for( int is=0; is!=NSPIN; ++is ) + { + auto ptr_data_A = data_local[is].begin(); + auto ptr_atom_A = H_atom_pairs_group_rank[rank_send_now].begin(); + while(ptr_data_A!=data_local[is].end() && ptr_atom_A!=H_atom_pairs_group_rank[rank_send_now].end()) + { + if(ptr_data_A->first < ptr_atom_A->first) ++ptr_data_A; + else if(ptr_data_A->first > ptr_atom_A->first) ++ptr_atom_A; + else + { + const size_t iat1 = ptr_data_A->first; + auto ptr_data_B = ptr_data_A->second.begin(); + auto ptr_atom_B = ptr_atom_A->second.begin(); + while(ptr_data_B!=ptr_data_A->second.end() && ptr_atom_B!=ptr_atom_A->second.end()) + { + const size_t iat2 = ptr_data_B->first; + if(ptr_data_B->first < *ptr_atom_B) ++ptr_data_B; + else if(ptr_data_B->first > *ptr_atom_B) ++ptr_atom_B; + else + { + for(auto &data_C : ptr_data_B->second) + { + const Abfs::Vector3_Order &box2 = data_C.first; + data_intersection[is][iat1][iat2][box2] = &data_C.second; + } + ++ptr_data_B; ++ptr_atom_B; + } + } + ++ptr_data_A; ++ptr_atom_A; + } + } + } + return data_intersection; +} + +void Exx_Abfs::Parallel::Communicate::DM3::Allreduce::recv_data_process( + const int rank_recv, + vector,matrix>>>> &data_all, + vector> &iarps_irecv, + vector> &flags_recv, + atomic_flag &lock_insert) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM3::Allreduce::recv_data_process"); + + auto vector_empty = []( const vector,matrix>>>> &v ) -> bool + { + for( const auto &i : v ) + if(!i.empty()) return false; + return true; + }; + + vector,matrix>>>> data_rank(NSPIN); + auto ptr = iarps_irecv[rank_recv].begin(); + for( int is=0; is!=NSPIN; ++is ) + { + const size_t recv_size = ptr[0]; + ptr += 1; + auto ptr_end = ptr + recv_size; + while(ptr box2 = {ptr[2],ptr[3],ptr[4]}; + const int nr=ptr[5], nc=ptr[6]; + matrix &m = data_rank[is][iat1][iat2][box2]; + m.create(nr,nc); + copy( ptr+7, ptr+7+nr*nc, m.c ); + ptr += 7+nr*nc; + } + } + iarps_irecv[rank_recv].resize(0); iarps_irecv[rank_recv].shrink_to_fit(); + flags_recv[rank_recv] = Flag_Recv::finish_iar; + + if(!vector_empty(data_rank)) + { + while( lock_insert.test_and_set() ); + insert_data(data_rank, data_all); + lock_insert.clear(); + } +} + + +matrix& Exx_Abfs::Parallel::Communicate::DM3::Allreduce::get_matrix(matrix&m)const{ return m; } +matrix& Exx_Abfs::Parallel::Communicate::DM3::Allreduce::get_matrix(matrix*pm)const{ return *pm; } + + +template +void Exx_Abfs::Parallel::Communicate::DM3::Allreduce::insert_data( + vector,M>>>> &data_rank, + vector,matrix>>>> &data_all) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM3::Allreduce::insert_data"); + for( int is=0; is!=NSPIN; ++is ) + { + auto &data_rank_is = data_rank[is]; + auto &data_all_is = data_all[is]; + for( auto &data_rank_A : data_rank_is ) + { + const size_t iat1 = data_rank_A.first; + auto &data_all_A = data_all_is[iat1]; + for( auto &data_rank_B : data_rank_A.second ) + { + const size_t iat2 = data_rank_B.first; + auto &data_all_B = data_all_A[iat2]; + for( auto &data_rank_C : data_rank_B.second ) + { + const Abfs::Vector3_Order &box2 = data_rank_C.first; + auto &data_all_C = data_all_B[box2]; + matrix &m = get_matrix(data_rank_C.second); + if( data_all_C.c ) + data_all_C += m; + else + data_all_C = std::move(m); + } + } + } + } +} diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm3-template.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm3-template.h new file mode 100644 index 0000000000..7e838730bc --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-dm3-template.h @@ -0,0 +1,96 @@ +#include "exx_abfs-parallel-communicate-dm3.h" +#include "src_pw/global.h" + +const matrix &Exx_Abfs::Parallel::Communicate::DM3::D_phase( + const matrix &DK, const int ik, const Abfs::Vector3_Order &box2) const +{ + assert(box2 == Abfs::Vector3_Order(0,0,0)); + return DK; +} + +matrix Exx_Abfs::Parallel::Communicate::DM3::D_phase( + const ComplexMatrix &DK, const int ik, const Abfs::Vector3_Order &box2) const +{ + return (DK * exp( -TWO_PI*IMAG_UNIT * (kv.kvec_c[ik] * (box2*ucell.latvec)) )).real(); +} + + +template vector,matrix>>>> +Exx_Abfs::Parallel::Communicate::DM3::K_to_R(const vector &DK_2D, const double threshold_D) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::DM3::K_to_R"); + + /*{ + static int istep=0; + ofstream ofs("DK_2D_"+TO_STRING(istep++)+"_"+TO_STRING(MY_RANK)); + ofs<,matrix>>>> DR_a2D(NSPIN); + + const map nspin_2D = {{1,1}, {2,2}, {4,1}}; + const map SPIN_multiple = {{1,0.5}, {2,1}, {4,1}}; // ??? + const Abfs::Vector3_Order Born_von_Karman_period = Vector3{kv.nmp[0],kv.nmp[1],kv.nmp[2]}; + const vector> supercell_boxes = Abfs::get_Born_von_Karmen_boxes(Born_von_Karman_period); + for(const Abfs::Vector3_Order &box2 : supercell_boxes) + { + vector DR_2D( nspin_2D.at(NSPIN), + {DK_2D[0].nr, DK_2D[0].nc} ); + for(int ik=0; ik!=DK_2D.size(); ++ik) + DR_2D[kv.isk[ik]] += D_phase( DK_2D[ik], ik, box2); + + // C++: 0 1 + // 2 3 + vector>> DR_a2D_box2(NSPIN); + for(int is_2D=0; is_2D!=nspin_2D.at(NSPIN); ++is_2D) + { + for(int iwt1_local=0; iwt1_local!=DR_2D[is_2D].nr; ++iwt1_local) + { + const int iwt1 = ParaO.MatrixInfo.col_set[iwt1_local]; + const int iat1 = ucell.iwt2iat[iwt1]; + const int iw1 = ucell.iwt2iw[iwt1]; + for(int iwt2_local=0; iwt2_local!=DR_2D[is_2D].nc; ++iwt2_local) + { + const int iwt2 = ParaO.MatrixInfo.row_set[iwt2_local]; + const int iat2 = ucell.iwt2iat[iwt2]; + const int iw2 = ucell.iwt2iw[iwt2]; + + int is_R=is_2D, iw1_R=iw1, iw2_R=iw2; + if(NSPIN==4) + { + iw1_R = iw1/2; + iw2_R = iw2/2; + is_R = iw1%2*2 + iw2%2; + } + matrix &DR_a2D_tmp = DR_a2D_box2[is_R][iat1][iat2]; + if(!DR_a2D_tmp.c) + DR_a2D_tmp.create(ucell.atoms[ucell.iat2it[iat1]].nw, ucell.atoms[ucell.iat2it[iat2]].nw); + DR_a2D_tmp(iw1_R,iw2_R) = DR_2D[is_2D](iwt1_local,iwt2_local) * SPIN_multiple.at(NSPIN); + } + } + } + + for(auto &DR_a2D_box2_is : DR_a2D_box2) + Abfs::delete_threshold_ptrs(DR_a2D_box2_is,threshold_D); + + for(int is=0; is!=NSPIN; ++is) + { + for(auto & DR_a2D_box2_A : DR_a2D_box2[is]) + { + const size_t iat1 = DR_a2D_box2_A.first; + for(auto & DR_a2D_box2_B : DR_a2D_box2_A.second) + { + const size_t iat2 = DR_a2D_box2_B.first; + DR_a2D[is][iat1][iat2][box2] = std::move(DR_a2D_box2_B.second); + } + } + } + } + + /*{ + static int istep=0; + ofstream ofs("DR_a2D_"+TO_STRING(istep++)+"_"+TO_STRING(MY_RANK)); + ofs< vector,matrix>>>> +Exx_Abfs::Parallel::Communicate::DM3::K_to_R(const vector &DK_2D, const double threshold_D) const +{ + + TITLE("Exx_Abfs::Parallel::Communicate::DM3::K_to_R"); + assert(DK_2D.size()==NSPIN); + const double SPIN_multiple = 0.5*NSPIN; + + vector,matrix>>>> DR_a2D(NSPIN); + for(int is=0; is!=NSPIN; ++is) + { + for(int iwt1_local=0; iwt1_local!=DK_2D[is].nr; ++iwt1_local) + { + const int iwt1 = ParaO.MatrixInfo.col_set[iwt1_local]; + const int iat1 = ucell.iwt2iat[iwt1]; + const int iw1 = ucell.iwt2iw[iwt1]; + for(int iwt2_local=0; iwt2_local!=DK_2D[is].nc; ++iwt2_local) + { + const int iwt2 = ParaO.MatrixInfo.row_set[iwt2_local]; + const int iat2 = ucell.iwt2iat[iwt2]; + const int iw2 = ucell.iwt2iw[iwt2]; + const double dm = DK_2D[is](iwt1_local,iwt2_local); + if(abs(dm) > threshold_D) + { + matrix &DR_a2D_box2 = DR_a2D[is][iat1][iat2][{0,0,0}]; + if(!DR_a2D_box2.c) + DR_a2D_box2.create(ucell.atoms[ucell.iat2it[iat1]].nw, ucell.atoms[ucell.iat2it[iat2]].nw); + DR_a2D_box2(iw1,iw2) = DK_2D[is](iwt1_local,iwt2_local) * SPIN_multiple; + } + } + } + } + return DR_a2D; +} +*/ + +/* +template<> vector,matrix>>>> +Exx_Abfs::Parallel::Communicate::DM3::K_to_R(const vector &DK_2D, const double threshold_D) const +{ + { + static int istep=0; + ofstream ofs("DK_2D_"+TO_STRING(istep++)+"_"+TO_STRING(MY_RANK)); + ofs< Born_von_Karman_period = Vector3{kv.nmp[0],kv.nmp[1],kv.nmp[2]}; + const vector> supercell_boxes = Abfs::get_Born_von_Karmen_boxes(Born_von_Karman_period); + + vector,matrix>>>> DR_a2D(NSPIN); + for(int ik=0; ik!=DK_2D.size(); ++ik) + { + for(int iwt1_local=0; iwt1_local!=DK_2D[ik].nr; ++iwt1_local) + { + const int iwt1 = ParaO.MatrixInfo.col_set[iwt1_local]; + const int iat1 = ucell.iwt2iat[iwt1]; + const int iw1 = ucell.iwt2iw[iwt1]; + for(int iwt2_local=0; iwt2_local!=DK_2D[ik].nc; ++iwt2_local) + { + const int iwt2 = ParaO.MatrixInfo.row_set[iwt2_local]; + const int iat2 = ucell.iwt2iat[iwt2]; + const int iw2 = ucell.iwt2iw[iwt2]; + for(const Abfs::Vector3_Order &box2 : supercell_boxes) + { + matrix &DR_a2D_box2 = DR_a2D[kv.isk[ik]][iat1][iat2][box2]; + if(!DR_a2D_box2.c) + DR_a2D_box2.create(ucell.atoms[ucell.iat2it[iat1]].nw, ucell.atoms[ucell.iat2it[iat2]].nw); + DR_a2D_box2(iw1,iw2) += real( DK_2D[ik](iwt1_local,iwt2_local) * exp(-TWO_PI*IMAG_UNIT*(kv.kvec_c[ik]*(box2*ucell.latvec))) ) * SPIN_multiple; + } + } + } + } + for(auto &DR_a2D_is : DR_a2D) + Abfs::delete_threshold_ptrs(DR_a2D_is,threshold_D); + + { + static int istep=0; + ofstream ofs("DR_a2D_"+TO_STRING(istep++)+"_"+TO_STRING(MY_RANK)); + ofs<,matrix>>>> DR_a2D = GAMMA_ONLY_LOCAL + ? K_to_R(LOC.wfc_dm_2d.dm_gamma, threshold_D) + : K_to_R(LOC.wfc_dm_2d.dm_k, threshold_D); + DMr = allreduce.a2D_to_exx(DR_a2D); + + /*{ + static int istep=0; + ofstream ofs("DMr_"+TO_STRING(istep++)+"_"+TO_STRING(MY_RANK)); + ofs< +#include +#include +#include +#include + +using namespace std; + +class Exx_Abfs::Parallel::Communicate::DM3 +{ +public: + void cal_DM(const double threshold_D); + + vector,matrix>>>> DMr; + +private: + template vector,matrix>>>> + K_to_R(const vector &DK_2D, const double threshold_D) const; + const matrix &D_phase( const matrix &DK, const int ik, const Abfs::Vector3_Order &box2) const; + matrix D_phase( const ComplexMatrix &DK, const int ik, const Abfs::Vector3_Order &box2) const; +// vector,matrix>>>> +// allreduce(const vector,matrix>>>> &DR_a2D); + + class Allreduce + { + public: + void init( + const MPI_Comm &mpi_comm_in, + const map,set> &H_atom_pairs_group); + vector,matrix>>>> a2D_to_exx( + vector,matrix>>>> &data_local) const; + + private: + vector>> H_atom_pairs_group_rank; //H_atom_pairs_group_rank[rank][iat1][iat2] + vector send_size_list; + size_t recv_size; + + MPI_Comm mpi_comm; + int comm_sz; + int my_rank; + + enum class Flag_Send {undo, begin_oar, finish_oar, begin_isend, finish_isend}; + enum class Flag_Recv {undo, begin_irecv, begin_iar, finish_iar}; + + //vector> get_atom_in_2D() const; + vector>> get_H_atom_pairs_group_rank( + const map,set> &H_atom_pairs_group) const; + void get_send_recv_size( + const vector>> &H_atom_pairs_group_rank, + const map,set> &H_atom_pairs_group, + vector &send_size_list, size_t &recv_size) const; + void init_flags( + vector> &flags_send, + vector> &flags_recv) const; + bool finish_judge( + const vector> &flags_send, + const vector> &flags_recv) const; + bool memory_enough( + const int rank_send_next, + const vector> &flags_send) const; + void send_data_process( + const int rank_send_now, + const vector,matrix>>>> &data_local, + vector> &oarps_isend, + vector> &flags_send) const; + vector,matrix*>>>> get_intersection( + const int rank_send_now, + vector,matrix>>>> &data_local) const; + void recv_data_process( + const int rank_recv, + vector,matrix>>>> &data_all, + vector> &iarps_irecv, + vector> &flags_recv, + atomic_flag &lock_insert) const; + template void insert_data( + vector,M>>>> &data_rank, + vector,matrix>>>> &data_all) const; + matrix& get_matrix(matrix&m) const; + matrix& get_matrix(matrix*pm) const; + }; + +public: + Allreduce allreduce; +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-function.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-function.cpp new file mode 100644 index 0000000000..d504337a97 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-function.cpp @@ -0,0 +1,34 @@ +#include "exx_abfs-parallel-communicate-function.h" +#include "src_pw/global.h" +#include "src_lcao/global_fp.h" + +vector,vector>> +Exx_Abfs::Parallel::Communicate::Function::get_atom_in_2D_list(const MPI_Comm &mpi_comm) +{ + TITLE("Exx_Abfs::Parallel::Communicate::Functions::get_atom_in_2D_list"); + int comm_sz; MPI_Comm_size(mpi_comm, &comm_sz); + + bool atom_in_2D[ucell.nat*2]; + for(int i=0; i=0 ) + atom_in_2D[iat] = true; + if( ParaO.trace_loc_col[iwt]>=0 ) + atom_in_2D[ucell.nat+iat] = true; + } + + bool atom_in_2D_list_tmp[ucell.nat*2*comm_sz]; + if(MPI_Allgather( atom_in_2D, ucell.nat*2, MPI_BYTE, atom_in_2D_list_tmp, ucell.nat*2, MPI_BYTE, mpi_comm )!=MPI_SUCCESS) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + + vector,vector>> atom_in_2D_list(comm_sz, {vector(ucell.nat),vector(ucell.nat)}); + for(int rank=0; rank +#include +#include +using namespace std; + +class Exx_Abfs::Parallel::Communicate::Function +{ +public: + static vector,vector>> get_atom_in_2D_list(const MPI_Comm &mpi_comm); +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-allreduce.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-allreduce.cpp new file mode 100644 index 0000000000..32235375b3 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-allreduce.cpp @@ -0,0 +1,369 @@ +#include "exx_abfs-parallel-communicate-hexx.h" +#include "src_global/serialization_boost.h" + +#include "src_pw/global.h" +#include "src_lcao/global_fp.h" + +#include +#ifdef _OPENMP +#include +#endif + +Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::Allreduce( + const MPI_Comm & mpi_comm_in, + vector,matrix>>>> &data_local_in ) + :mpi_comm(mpi_comm_in), + data_local(data_local_in), + lock_insert(ATOMIC_FLAG_INIT) +{ + data_all.resize(NSPIN); + + MPI_Comm_size( mpi_comm, &comm_sz ); + MPI_Comm_rank( mpi_comm, &my_rank ); + + rank_delta = 1; + + set_atom_in_2D(); + oarp_atom_in_2D = new boost::mpi::packed_oarchive{mpi_comm}; + *oarp_atom_in_2D << atom_in_2D; + + oarps_isend_data.resize( comm_sz ); + for( auto &oarp_isend_data : oarps_isend_data ) + oarp_isend_data = new boost::mpi::packed_oarchive{mpi_comm}; + iarps_recv_data.resize( comm_sz ); + for( auto &iarp_recv_data : iarps_recv_data ) + iarp_recv_data = new boost::mpi::packed_iarchive{mpi_comm}; + iarps_atom_asked.resize( comm_sz ); + for( auto &iarp_atom_asked : iarps_atom_asked ) + iarp_atom_asked = new boost::mpi::packed_iarchive{mpi_comm}; + + // 0: undo 1: thread finish 2: MPI begin + flags_isend_data.resize(comm_sz); + for( int irank=0; irank!=comm_sz; ++irank ) + flags_isend_data[irank] = new atomic(0); + *flags_isend_data[my_rank] = 2; + + flags_ask_atom.resize(comm_sz); + for( int irank=0; irank!=comm_sz; ++irank ) + flags_ask_atom[irank] = new atomic(0); + *flags_ask_atom[my_rank] = 2; + + flags_recv_data.resize(comm_sz,false); + flags_recv_data[my_rank] = true; +} + + +Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::~Allreduce() +{ + delete oarp_atom_in_2D; + for( auto &oarp_isend_data : oarps_isend_data ) + if(oarp_isend_data) + delete oarp_isend_data; + for( auto &iarp_recv_data : iarps_recv_data ) + if(iarp_recv_data) + delete iarp_recv_data; + for( auto &iarp_atom_asked : iarps_atom_asked ) + if(iarp_atom_asked) + delete iarp_atom_asked; + for( int irank=0; irank!=comm_sz; ++irank ) + delete flags_isend_data[irank]; + for( int irank=0; irank!=comm_sz; ++irank ) + delete flags_ask_atom[irank]; +} + + + +vector,matrix>>>> +Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::exx_to_a2D() +{ + auto clear_oars = [&]( vector &requests, boost::dynamic_bitset<> &flags, vector &oarps, const string &s ) + { + if( flags.none() ) return; + for( int irank=0; irank!=comm_sz; ++irank ) + { + if( flags[irank] ) + { + int flag_finish; + if(MPI_SUCCESS!=MPI_Test( &requests[irank], &flag_finish, MPI_STATUS_IGNORE )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + if( flag_finish ) + { + delete oarps[irank]; + oarps[irank] = nullptr; + } + flags[irank] = false; + } + } + }; + + auto if_finish = []( const vector*> &flags ) -> bool + { + int sum=0; + for( size_t i=0; i threads; + + vector requests_isend_data(comm_sz); + vector requests_ask(comm_sz); + boost::dynamic_bitset<> flags_request_isend_data(comm_sz,false); + + #ifdef _OPENMP + const int omp_threads = omp_get_max_threads(); + omp_set_num_threads(1); + #endif + + while( !if_finish(flags_ask_atom) || !if_finish(flags_isend_data) || !flags_recv_data.all() ) + { + MPI_Status status; + int flag_message; + if(MPI_SUCCESS!=MPI_Iprobe( MPI_ANY_SOURCE, MPI_ANY_TAG, mpi_comm, &flag_message, &status )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + if(flag_message) + { + int message_size; + if(MPI_SUCCESS!=MPI_Get_count( &status, MPI_PACKED, &message_size )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + + switch(status.MPI_TAG) + { + case tag_ask: + { + const int rank_asked = status.MPI_SOURCE; + + iarps_atom_asked[rank_asked]->resize(message_size); + if(MPI_SUCCESS!=MPI_Recv( iarps_atom_asked[rank_asked]->address(), message_size, MPI_PACKED, rank_asked, tag_ask, mpi_comm, MPI_STATUS_IGNORE )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + + threads.push_back(std::thread( + &Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::send_data_process, this, + rank_asked )); + break; + } + case tag_data: + { + const int rank_data = status.MPI_SOURCE; + + iarps_recv_data[rank_data]->resize(message_size); + if(MPI_SUCCESS!=MPI_Recv( iarps_recv_data[rank_data]->address(), message_size, MPI_PACKED, rank_data, tag_data, mpi_comm, MPI_STATUS_IGNORE )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + flags_recv_data[rank_data] = true; + + threads.push_back(std::thread( + &Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::recv_data_process, this, + rank_data )); + break; + } + default: + throw invalid_argument(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } + } + + for( int rank_ask=0; rank_ask!=comm_sz; ++rank_ask ) + if( *flags_ask_atom[rank_ask] == 1 ) + { + if(MPI_SUCCESS!=MPI_Isend( oarp_atom_in_2D->address(), oarp_atom_in_2D->size(), MPI_PACKED, rank_ask, tag_ask, mpi_comm, &requests_ask[rank_ask] )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + *flags_ask_atom[rank_ask] = 2; + } + for( int rank_asked=0; rank_asked!=comm_sz; ++rank_asked ) + if( *flags_isend_data[rank_asked] == 1 ) + { + if(MPI_SUCCESS!=MPI_Isend( oarps_isend_data[rank_asked]->address(), oarps_isend_data[rank_asked]->size(), MPI_PACKED, rank_asked, tag_data, mpi_comm, &requests_isend_data[rank_asked] )) throw runtime_error(TO_STRING(__FILE__)+TO_STRING(__LINE__)); + flags_request_isend_data[rank_asked] = true; + *flags_isend_data[rank_asked] = 2; + } + + clear_oars( requests_isend_data, flags_request_isend_data, oarps_isend_data, "oarps_isend_data" ); + } + + while( lock_insert.test_and_set() ); + insert_data(); + lock_insert.clear(); + + for( std::thread & t : threads ) + t.join(); + for( int i_rank=0; i_rank=0 ) + atom_in_2D.first[iat] = true; + if( ParaO.trace_loc_col[iwt]>=0 ) + atom_in_2D.second[iat] = true; + } + } + } +} + + +void Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::ask( const int rank_delta_now ) +{ + if( rank_delta_now < comm_sz ) + { + const int rank_ask = ( my_rank + rank_delta_now ) % comm_sz; + *flags_ask_atom[rank_ask] = 1; + } +} + + + +void Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::recv_data_process( const int rank_data ) +{ + auto vector_empty = []( const vector,Matrix_Wrapper>>>> & v ) -> bool + { + for( const auto &i : v ) + if(!i.empty()) return false; + return true; + }; + + vector,Matrix_Wrapper>>>> data_rank; + *iarps_recv_data[rank_data] >> data_rank; + iarps_recv_data[rank_data]->resize(0); + + if(!vector_empty(data_rank)) + { + while( lock_insert.test_and_set() ); + insert_data(data_rank); + lock_insert.clear(); + } + + ask(rank_delta++); + + #ifdef MATRIX_WRAPPER_TIANHE2 + for( auto &data_rank_is : data_rank ) + for( auto &data_rank_A : data_rank_is ) + for( auto &data_rank_B : data_rank_A.second ) + for( auto &data_rank_C : data_rank_B.second ) + if(!data_rank_C.second.c) + delete[] data_rank_C.second.c; + #endif +} + + +void Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::insert_data( + vector,Matrix_Wrapper>>>> &data_rank ) +{ + for( int is=0; is!=NSPIN; ++is ) + { + auto &data_rank_is = data_rank[is]; + auto &data_all_is = data_all[is]; + for( auto &data_rank_A : data_rank_is ) + { + const size_t iat1 = data_rank_A.first; + auto &data_all_A = data_all_is[iat1]; + for( auto &data_rank_B : data_rank_A.second ) + { + const size_t iat2 = data_rank_B.first; + auto &data_all_B = data_all_A[iat2]; + for( auto &data_rank_C : data_rank_B.second ) + { + const Abfs::Vector3_Order &box2 = data_rank_C.first; + auto &data_all_C = data_all_B[box2]; + if(data_all_C.c) + data_all_C += data_rank_C.second.to_matrix(); + else + data_all_C = data_rank_C.second.to_matrix(); + } + } + } + } +} + + +void Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::insert_data() +{ + for( int is=0; is!=NSPIN; ++is ) + { + auto &data_local_is = data_local[is]; + auto &data_all_is = data_all[is]; + for( auto &data_local_A : data_local_is ) + { + const size_t iat1 = data_local_A.first; + if( !atom_in_2D.first[iat1] ) continue; + auto &data_all_A = data_all_is[iat1]; + for( auto &data_local_B : data_local_A.second ) + { + const size_t iat2 = data_local_B.first; + if( !atom_in_2D.second[iat2] ) continue; + auto &data_all_B = data_all_A[iat2]; + for( auto &data_local_C : data_local_B.second ) + { + const Abfs::Vector3_Order &box2 = data_local_C.first; + auto &data_all_C = data_all_B[box2]; + if( data_all_C.c ) + data_all_C += data_local_C.second; + else + data_all_C = std::move(data_local_C.second); + } + } + } + } +} + + + +void Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::send_data_process( const int rank_asked ) +{ + pair< vector, vector > atom_asked; + *iarps_atom_asked[rank_asked] >> atom_asked; + iarps_atom_asked[rank_asked]->resize(0); + + const vector,Matrix_Wrapper>>>> matrix_wrapped = get_data_local_wrapper(atom_asked); + *oarps_isend_data[rank_asked] << matrix_wrapped; + + *flags_isend_data[rank_asked] = 1; +} + + +vector,Matrix_Wrapper>>>> +Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::get_data_local_wrapper( const pair,vector> &atom_asked ) const +{ + vector,Matrix_Wrapper>>>> mw(NSPIN); + for( int is=0; is!=NSPIN; ++is ) + { + auto &data_local_is = data_local[is]; + auto &mw_is = mw[is]; + for( auto &data_local_A : data_local_is ) + { + const size_t iat1 = data_local_A.first; + if( !atom_asked.first[iat1] ) continue; + auto &mw_A = mw_is[iat1]; + for( auto &data_local_B : data_local_A.second ) + { + const size_t iat2 = data_local_B.first; + if( !atom_asked.second[iat2] ) continue; + auto &mw_B = mw_A[iat2]; + for( auto &data_local_C : data_local_B.second ) + { + const Abfs::Vector3_Order &box2 = data_local_C.first; + mw_B[box2] = data_local_C.second; + } + } + } + } + return mw; +} diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-allreduce2.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-allreduce2.cpp new file mode 100644 index 0000000000..af9192925a --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-allreduce2.cpp @@ -0,0 +1,362 @@ +#include "exx_abfs-parallel-communicate-hexx.h" +#include "exx_abfs-parallel-communicate-function.h" + +#include "src_pw/global.h" +#include "src_lcao/global_fp.h" + +#include +#include + + +#include "src_external/src_test/test_function.h" + +void Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::init( + const MPI_Comm &mpi_comm_in, + const set> &H_atom_pairs_core) +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::init"); + + mpi_comm = mpi_comm_in; + MPI_Comm_size(mpi_comm, &comm_sz); + MPI_Comm_rank(mpi_comm, &my_rank); + + atom_in_2D_list = Exx_Abfs::Parallel::Communicate::Function::get_atom_in_2D_list(mpi_comm); + send_size_list = get_send_size_list(H_atom_pairs_core, atom_in_2D_list); + recv_size = ParaO.nrow * ParaO.ncol * sizeof(double); +} + +vector,matrix>>>> +Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::exx_to_a2D( + vector,matrix>>>> &data_local) const +{ +ofstream ofs(exx_lcao.test_dir.process+"Hmpi_"+TO_STRING(my_rank), ofstream::app); +timeval t_all; gettimeofday(&t_all,NULL); + + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::exx_to_a2D"); + + vector,matrix>>>> data_all(NSPIN); +//ofs<<__LINE__<> flags_send(comm_sz); + vector> flags_recv(comm_sz); + init_flags(flags_send, flags_recv); +//ofs<<__LINE__<> oarps_isend(comm_sz); + vector> iarps_irecv(comm_sz); +//ofs<<__LINE__<int{ return (rank_send_now+1)%comm_sz; }; +//ofs<<__LINE__< threads; + vectorrequests_isend(comm_sz); + vectorrequests_irecv(comm_sz); +//ofs<<__LINE__<t_send(comm_sz); +vectort_recv(comm_sz); + while(!finish_judge(flags_send, flags_recv)) + { +//ofs<<__LINE__< Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::get_send_size_list( + const set> &H_atom_pairs_core, + const vector,vector>> &atom_in_2D_list) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::get_send_size_list"); + vector send_size_list(comm_sz,0); + for(const auto &H_atom_pair : H_atom_pairs_core) + { + const size_t iat1 = H_atom_pair.first; + const size_t iat2 = H_atom_pair.second; + for(int rank_send=0; rank_send> &flags_send, + vector> &flags_recv) const +{ + for(atomic &flag_send : flags_send) + flag_send = Flag_Send::undo; + flags_send[my_rank] = Flag_Send::finish_isend; + + for(atomic &flag_recv : flags_recv) + flag_recv = Flag_Recv::undo; + flags_recv[my_rank] = Flag_Recv::finish_iar; +} + +bool Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::finish_judge( + const vector> &flags_send, + const vector> &flags_recv) const +{ + for(int rank_send=0; rank_send!=comm_sz; ++rank_send) + if((flags_send[rank_send]!=Flag_Send::begin_isend) && (flags_send[rank_send]!=Flag_Send::finish_isend)) + return false; + for(int rank_recv=0; rank_recv!=comm_sz; ++rank_recv) + if((flags_recv[rank_recv]!=Flag_Recv::begin_iar) && (flags_recv[rank_recv]!=Flag_Recv::finish_iar)) + return false; + return true; +} + +bool Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::memory_enough( + const int rank_send_next, + const vector> &flags_send) const +{ + size_t memory_need = recv_size; + for(int rank_send=0; rank_sendsend_size_list[rank_send_next]) ? true : false; +} + +void Exx_Abfs::Parallel::Communicate::Hexx::Allreduce2::send_data_process( + const int rank_send_now, + const vector,matrix>>>> &data_local, + vector> &oarps_isend, + vector> &flags_send) const +{ +ofstream ofs(exx_lcao.test_dir.process+"Hmpi_"+TO_STRING(my_rank), ofstream::app); +timeval t; gettimeofday(&t, NULL); + valarray send_size(NSPIN); + vector,const matrix*>>>> mw(NSPIN); + for( int is=0; is!=NSPIN; ++is ) + { + send_size[is]=0; + auto &data_local_is = data_local[is]; + auto &mw_is = mw[is]; + for( auto &data_local_A : data_local_is ) + { + const size_t iat1 = data_local_A.first; + if( !atom_in_2D_list[rank_send_now].first[iat1] ) continue; + auto &mw_A = mw_is[iat1]; + for( auto &data_local_B : data_local_A.second ) + { + const size_t iat2 = data_local_B.first; + if( !atom_in_2D_list[rank_send_now].second[iat2] ) continue; + auto &mw_B = mw_A[iat2]; + for( auto &data_local_C : data_local_B.second ) + { + const Abfs::Vector3_Order &box2 = data_local_C.first; + mw_B[box2] = &data_local_C.second; + send_size[is] += 7 + data_local_C.second.nr * data_local_C.second.nc; + } + } + } + } +ofs<<"get_send_data_wrapper\t"<,matrix>>>> &data_all, + vector> &iarps_irecv, + vector> &flags_recv, + atomic_flag &lock_insert) const +{ +ofstream ofs(exx_lcao.test_dir.process+"Hmpi_"+TO_STRING(my_rank), ofstream::app); +timeval t; gettimeofday(&t, NULL); + auto vector_empty = []( const vector,matrix>>>> &v ) -> bool + { + for( const auto &i : v ) + if(!i.empty()) return false; + return true; + }; + + vector,matrix>>>> data_rank(NSPIN); + double *ptr = VECTOR_TO_PTR(iarps_irecv[rank_recv]); + for( int is=0; is!=NSPIN; ++is ) + { + const size_t recv_size = ptr[0]; + ptr += 1; + const double * const ptr_end = ptr + recv_size; + while(ptr box2 = {ptr[2],ptr[3],ptr[4]}; + const int nr=ptr[5], nc=ptr[6]; + matrix &m = data_rank[is][iat1][iat2][box2]; + m.create(nr,nc); + memcpy( m.c, ptr+7, nr*nc*sizeof(double) ); + ptr += 7+nr*nc; + } + } + iarps_irecv[rank_recv].resize(0); + flags_recv[rank_recv] = Flag_Recv::finish_iar; +ofs<<"iar>>\t"<,matrix>>>> &data_rank, + vector,matrix>>>> &data_all) const +{ + for( int is=0; is!=NSPIN; ++is ) + { + auto &data_rank_is = data_rank[is]; + auto &data_all_is = data_all[is]; + for( auto &data_rank_A : data_rank_is ) + { + const size_t iat1 = data_rank_A.first; + if( !atom_in_2D_list[my_rank].first[iat1] ) continue; + auto &data_all_A = data_all_is[iat1]; + for( auto &data_rank_B : data_rank_A.second ) + { + const size_t iat2 = data_rank_B.first; + if( !atom_in_2D_list[my_rank].second[iat2] ) continue; + auto &data_all_B = data_all_A[iat2]; + for( auto &data_rank_C : data_rank_B.second ) + { + const Abfs::Vector3_Order &box2 = data_rank_C.first; + auto &data_all_C = data_all_B[box2]; + if( data_all_C.c ) + data_all_C += data_rank_C.second; + else + data_all_C = std::move(data_rank_C.second); + } + } + } + } +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-template.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-template.h new file mode 100644 index 0000000000..f1f48d10fc --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx-template.h @@ -0,0 +1,214 @@ +#ifndef EXX_ABFS_PARALLEL_COMMUNICATE_HEXX_TEMPLATE_H +#define EXX_ABFS_PARALLEL_COMMUNICATE_HEXX_TEMPLATE_H + +#include "exx_abfs-parallel-communicate-hexx.h" +#include "src_pw/global.h" +#include "src_lcao/global_fp.h" +#include + +/* +template< typename T > +T Exx_Abfs::Parallel::Communicate::Hexx::a2D_to_m2D( const map> & H_a2D ) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::a2D_to_m2D"); + + T H_m2D; + if(KS_SOLVER=="genelpa") + H_m2D.create( ParaO.ncol, ParaO.nrow ); + else + H_m2D.create( ParaO.nrow, ParaO.ncol ); + + for( const auto H_a2DA : H_a2D ) + { + const size_t iat1 = H_a2DA.first; + for( const auto H_a2DB : H_a2DA.second ) + { + const size_t iat2 = H_a2DB.first; + const T & H = H_a2DB.second; + + for( int iw1=0; iw1!=H.nr; ++iw1 ) + { + const int iwt1 = ucell.itiaiw2iwt( ucell.iat2it[iat1], ucell.iat2ia[iat1], iw1 ); + const int iwt1_m2D = ParaO.trace_loc_row[iwt1]; + if( iwt1_m2D == -1 ) continue; + + for( int iw2=0; iw2!=H.nc; ++iw2 ) + { + const int iwt2 = ucell.itiaiw2iwt( ucell.iat2it[iat2], ucell.iat2ia[iat2], iw2 ); + const int iwt2_m2D = ParaO.trace_loc_col[iwt2]; + if( iwt2_m2D == -1 ) continue; + + if(KS_SOLVER=="genelpa") + H_m2D( iwt2_m2D, iwt1_m2D ) = H(iw1,iw2); + else + H_m2D( iwt1_m2D, iwt2_m2D ) = H(iw1,iw2); + } + } + } + } + return H_m2D; +} +*/ + +template<> +matrix Exx_Abfs::Parallel::Communicate::Hexx::H_phase( + matrix &&HR, const int ik, const Abfs::Vector3_Order &box2) const +{ + assert(box2 == Abfs::Vector3_Order(0,0,0)); + return std::forward(HR); +} + +template<> +ComplexMatrix Exx_Abfs::Parallel::Communicate::Hexx::H_phase( + matrix &&HR, const int ik, const Abfs::Vector3_Order &box2) const +{ + return ComplexMatrix(HR) * exp( TWO_PI*IMAG_UNIT * (kv.kvec_c[ik] * (box2*ucell.latvec)) ); +} + +template +Tmatrix Exx_Abfs::Parallel::Communicate::Hexx::Ra2D_to_Km2D( + vector,matrix>>>> &HR_a2D, const int ik) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::Ra2D_to_Km2D"); + + Tmatrix HK_m2D; + if(KS_SOLVER=="genelpa") + HK_m2D.create( ParaO.ncol, ParaO.nrow ); + else + HK_m2D.create( ParaO.nrow, ParaO.ncol ); + + const int is_begin = (NSPIN==4) ? 0 : kv.isk[ik]; + const int is_end = (NSPIN==4) ? 4 : kv.isk[ik]+1; + for(int is=is_begin; is!=is_end; ++is) + { + for(auto & HR_a2D_A : HR_a2D[is]) + { + const size_t iat1 = HR_a2D_A.first; + const size_t it1 = ucell.iat2it[iat1]; + const size_t ia1 = ucell.iat2ia[iat1]; + for(auto & HR_a2D_B : HR_a2D_A.second) + { + const size_t iat2 = HR_a2D_B.first; + const size_t it2 = ucell.iat2it[iat2]; + const size_t ia2 = ucell.iat2ia[iat2]; + + Tmatrix HK_a2D; + for(auto & HR_a2D_C : HR_a2D_B.second) + { + const Abfs::Vector3_Order &box2 = HR_a2D_C.first; + if(HK_a2D.c) + HK_a2D += H_phase(std::forward(HR_a2D_C.second), ik, box2); + else + HK_a2D = H_phase(std::forward(HR_a2D_C.second), ik, box2); + } + + for(int iw1=0; iw1!=HK_a2D.nr; ++iw1) + { + const int iw1_tmp = (NSPIN==4) + ? (iw1*2+is/2) + : iw1; + const int iwt1 = ucell.itiaiw2iwt(it1,ia1,iw1_tmp); + const int iwt1_m2D = ParaO.trace_loc_row[iwt1]; + if(iwt1_m2D<0) continue; + for(int iw2=0; iw2!=HK_a2D.nc; ++iw2) + { + const int iw2_tmp = (NSPIN==4) + ? (iw2*2+is%2) + : iw2; + const int iwt2 = ucell.itiaiw2iwt(it2,ia2,iw2_tmp); + const int iwt2_m2D = ParaO.trace_loc_col[iwt2]; + if(iwt2_m2D<0) continue; + + if(KS_SOLVER=="genelpa" || KS_SOLVER=="scalapack_gvx") + HK_m2D(iwt2_m2D,iwt1_m2D) = HK_a2D(iw1,iw2); + else + HK_m2D(iwt1_m2D,iwt2_m2D) = HK_a2D(iw1,iw2); + } + } + } + } + } + return HK_m2D; +} + +template +void Exx_Abfs::Parallel::Communicate::Hexx::Ra2D_to_Km2D_mixing( + vector,matrix>>>> &HR_a2D, + vector &HK_m2D, + vector> &HK_m2D_pulay_seq) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::Ra2D_to_Km2D_mixing"); + + HK_m2D.resize(kv.nks); + HK_m2D_pulay_seq.resize(kv.nks); + for( int ik=0; ik!=kv.nks; ++ik ) + { +//gettimeofday( &t_start, NULL); +// const map> HK_a2D = R_to_K(HR_a2D[ik]); +//ofs_time<<"TIME@ Exx_Abfs::Parallel::Communicate::Hexx::R_to_K\t"<(HR_a2D, ik); + break; + case Mixing_Mode::Plain: + if( HK_m2D[ik].nr && HK_m2D[ik].nc ) + HK_m2D[ik] = (1-mixing_beta) * HK_m2D[ik] + mixing_beta * Ra2D_to_Km2D(HR_a2D, ik); + else + HK_m2D[ik] = Ra2D_to_Km2D(HR_a2D, ik); + break; + case Mixing_Mode::Pulay: + HK_m2D[ik] = pulay_mixing( HK_m2D[ik], HK_m2D_pulay_seq[ik], Ra2D_to_Km2D(HR_a2D, ik) ); + break; + default: + throw domain_error(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); break; + } +//ofs_time<<"TIME@ Exx_Abfs::Parallel::Communicate::Hexx::a2D_to_m2D\t"< +Tmatrix Exx_Abfs::Parallel::Communicate::Hexx::pulay_mixing( + const Tmatrix &H_pulay_old, deque &H_seq, const Tmatrix &H_new ) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::pulay_mixing"); + + Tmatrix H_pulay; + if( 0==CHR.totstep ) + { + H_seq.clear(); + H_pulay = H_new; + } + else + { + H_seq.push_back( + (1-CHR.mixing_beta) * H_pulay_old + CHR.mixing_beta * H_new ); + if( H_seq.size() > CHR.dstep+1 ) + H_seq.pop_front(); + + if( 1==H_seq.size() ) + { + H_pulay = H_seq[0]; + } + else + { + auto pos_mod = [](const int i, const int N){ return (i%N+N)%N; }; + auto index = [&](const int i) -> int + { + const int alpha_size = H_seq.size()-1; + const int alpha_begin = CHR.idstep - alpha_size; + return pos_mod( alpha_begin+i, CHR.dstep ); + }; + H_pulay = (1+CHR.alpha[index(H_seq.size()-2)]) * H_seq[H_seq.size()-1]; + for( int i=1; i<=H_seq.size()-2; ++i ) + H_pulay += ( CHR.alpha[index(i-1)] - CHR.alpha[index(i)] ) * H_seq[i]; + H_pulay -= CHR.alpha[index(0)] * H_seq[0]; + } + } + return H_pulay; +} + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx.cpp new file mode 100644 index 0000000000..41a5b5b8b2 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx.cpp @@ -0,0 +1,130 @@ +#include "exx_abfs-parallel-communicate-hexx.h" +#include "exx_abfs-parallel-communicate-hexx-template.h" +#include "src_pw/global.h" +#include "src_global/global_function.h" +#include "exx_abfs-io.h" + +#if EXX_H_COMM==1 +#include "exx_abfs-parallel-communicate-allreduce-template.h" +#endif + +#include "exx_abfs-io-template.h" + +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "src_external/src_test/test_function.h" +//#include + +void Exx_Abfs::Parallel::Communicate::Hexx::Rexx_to_Km2D( + vector,matrix>>>> &HR_exx, + const pair &io_HR_a2D ) +{ + /*{ + static int istep=0; + ofstream ofs("HR_exx_"+TO_STRING(istep++)+"_"+TO_STRING(MY_RANK)); + ofs<,matrix>>>> HR_a2D; + if(io_HR_a2D.first) + HR_a2D = Exx_Abfs::IO::input_binary,matrix>>>>>( + global_out_dir+"HR_exx_"+TO_STRING(MY_RANK)); + else + { + #if EXX_H_COMM==1 + Allreduce allreduce(MPI_COMM_WORLD,HR_exx); + HR_a2D = allreduce.exx_to_a2D(); + #elif EXX_H_COMM==2 + HR_a2D = allreduce2.exx_to_a2D(HR_exx); + #else + #error "EXX_H_COMM" + #endif + } + if(io_HR_a2D.second) + Exx_Abfs::IO::output_binary( HR_a2D, global_out_dir+"HR_exx_"+TO_STRING(MY_RANK) ); +//ofs_time<<"TIME@ Exx_Abfs::Parallel::Communicate::Hexx::Allreduce::exx_to_a2D\t"<> Exx_Abfs::Parallel::Communicate::Hexx::R_to_K( + map,matrix>>> & HR) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::R_to_K"); + + map> HK; + for( auto & HR1 : HR ) + { + const size_t iat1 = HR1.first; + for( auto & HR2 : HR1.second ) + { + const size_t iat2 = HR2.first; + assert(HR2.second.size()==1); + HK[iat1][iat2] = std::move( HR2.second.at(Vector3{0,0,0}) ); + } + } + return HK; +} +*/ + +/* +map> Exx_Abfs::Parallel::Communicate::Hexx::R_to_K( + const map,matrix>>> & HR, + const size_t ik) const +{ + TITLE("Exx_Abfs::Parallel::Communicate::Hexx::R_to_K"); + + map> HK; + for( auto & HRA : HR ) + { + const size_t iat1 = HRA.first; + for( auto & HRB : HRA.second ) + { + const size_t iat2 = HRB.first; + + ComplexMatrix HK_tmp( + ucell.atoms[ucell.iat2it[iat1]].nw, + ucell.atoms[ucell.iat2it[iat2]].nw); + for( auto & HRC : HRB.second ) + { + const Abfs::Vector3_Order & box2 = HRC.first; + HK_tmp += ComplexMatrix(HRC.second) * exp( TWO_PI*IMAG_UNIT * (kv.kvec_c[ik] * (box2*ucell.latvec)) ); + } + HK[iat1][iat2] = std::move(HK_tmp); + } + } + return HK; +} +*/ + diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx.h new file mode 100644 index 0000000000..b41cf01bed --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-communicate-hexx.h @@ -0,0 +1,159 @@ +#ifndef EXX_ABFS_PARALLEL_COMMUNICATE_HEXX_H +#define EXX_ABFS_PARALLEL_COMMUNICATE_HEXX_H + +#include "exx_abfs-parallel.h" +#include "src_global/matrix.h" +#include "src_global/matrix_wrapper.h" +#include "src_global/complexmatrix.h" +#include "src_ri/abfs-vector3_order.h" +#include +#include +#include +#include +#include +#include + +// mohan comment out 2021-02-06 +//#include +//##include + +class Exx_Abfs::Parallel::Communicate::Hexx +{ +public: + void Rexx_to_Km2D( + vector,matrix>>>> &HR_exx, + const pair &io_HR_a2D ); + +private: +// map> R_to_K( +// map,matrix>>> & HR) const; +// map> R_to_K( +// const map,matrix>>> & HR, +// const size_t ik) const; +// template< typename T > +// T a2D_to_m2D( const map> & H_a2D ) const; + template + inline T H_phase(matrix &&HR, const int ik, const Abfs::Vector3_Order &box2) const; + template + Tmatrix Ra2D_to_Km2D( + vector,matrix>>>> &HR_a2D, const int ik) const; + template + void Ra2D_to_Km2D_mixing( + vector,matrix>>>> &HR_a2D, + vector &HK_m2D, + vector> &HK_m2D_pulay_seq) const; + template + T pulay_mixing( const T &H_pulay_old, deque &H_seq, const T &H_new ) const; + + #if EXX_H_COMM==1 + class Allreduce + { + public: + Allreduce( + const MPI_Comm &mpi_comm_in, + vector,matrix>>>> &data_local_in ); + ~Allreduce(); + vector,matrix>>>> exx_to_a2D(); + + private: + void set_atom_in_2D(); + void ask( const int rank_delta_now ); + void recv_data_process( const int rank_data ); + void insert_data( vector,Matrix_Wrapper>>>> &data_rank ); + void insert_data(); + void send_data_process( const int rank_asked ); + vector,Matrix_Wrapper>>>> get_data_local_wrapper( + const pair,vector> &atom_asked ) const; + + private: + vector,matrix>>>> data_all; + vector,matrix>>>> &data_local; + + pair< vector, vector > atom_in_2D; + + const MPI_Comm & mpi_comm; + int comm_sz; + int my_rank; + + static constexpr int tag_ask = 1; + static constexpr int tag_data = 2; + + atomic_flag lock_insert; + atomic rank_delta; + + boost::mpi::packed_oarchive *oarp_atom_in_2D; + vector oarps_isend_data; + vector iarps_recv_data; + vector iarps_atom_asked; + + vector*> flags_isend_data; + vector*> flags_ask_atom; + boost::dynamic_bitset<> flags_recv_data; + }; + #elif EXX_H_COMM==2 + class Allreduce2 + { + public: + void init( + const MPI_Comm &mpi_comm_in, + const set> &H_atom_pairs_core); + vector,matrix>>>> exx_to_a2D( + vector,matrix>>>> &data_local) const; + + private: + enum class Flag_Send {undo, begin_oar, finish_oar, begin_isend, finish_isend}; + enum class Flag_Recv {undo, begin_irecv, begin_iar, finish_iar}; + + //vector,vector>> get_atom_in_2D_list() const; + vector get_send_size_list( + const set> &H_atom_pairs_core, + const vector,vector>> &atom_in_2D_list) const; + void init_flags( + vector> &flags_send, + vector> &flags_recv) const; + bool finish_judge( + const vector> &flags_send, + const vector> &flags_recv) const; + bool memory_enough( + const int rank_send_next, + const vector> &flags_send) const; + void send_data_process( + const int rank_send_now, + const vector,matrix>>>> &data_local, + vector> &oars_isend, + vector> &flags_send) const; + void recv_data_process( + const int rank_recv, + vector,matrix>>>> &data_all, + vector> &iarps_irecv, + vector> &flags_recv, + atomic_flag &lock_insert) const; + void insert_data( + vector,matrix>>>> &data_rank, + vector,matrix>>>> &data_all) const; + + private: + MPI_Comm mpi_comm; + int comm_sz; + int my_rank; + + vector,vector>> atom_in_2D_list; + vector send_size_list; + size_t recv_size; + }; + #endif + +public: + vector HK_Gamma_m2D; + vector HK_K_m2D; + vector> HK_Gamma_m2D_pulay_seq; + vector> HK_K_m2D_pulay_seq; + + enum class Mixing_Mode{ No, Plain, Pulay }; + Mixing_Mode mixing_mode; + double mixing_beta; + + Allreduce2 allreduce2; +}; + +#endif diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-htime.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-htime.cpp new file mode 100644 index 0000000000..385d167380 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-htime.cpp @@ -0,0 +1,115 @@ +#include "exx_abfs-parallel-distribute-htime.h" + +#include "src_pw/global.h" +#include "src_ri/abfs.h" +#include + +vector> Exx_Abfs::Parallel::Distribute::Htime::distribute( + const Abfs::Vector3_Order & Born_von_Karman_period, + const double rmesh_times ) +{ +//ofstream ofs("htime_"+TO_STRING(MY_RANK)); +//ofs< Nadj = cal_Nadj(Born_von_Karman_period); +//ofs<>> pair_costs = cal_pair_costs(Nadj, rmesh_times); +//ofs<>> rank_work = cal_rank_work(pair_costs); +//for( size_t irank=0; irank!=rank_work.size(); ++irank ) +// ofs< Exx_Abfs::Parallel::Distribute::Htime::cal_Nadj( + const Abfs::Vector3_Order & Born_von_Karman_period ) +{ + TITLE("Exx_Abfs::Parallel::Distribute::Htime::cal_Nadj"); + vector Nadj(ucell.nat); + for( size_t iat=0; iat!=ucell.nat; ++iat ) + { + const map>> + adjs = Abfs::get_adjs(iat); + for( const auto & adj_i : adjs ) + { + set> boxp; + for( const auto & box : adj_i.second ) + boxp.insert( box % Born_von_Karman_period ); + Nadj[iat] += boxp.size(); + } + } + return Nadj; +} + +// { Ni*Nj, {i,j} } +vector>> Exx_Abfs::Parallel::Distribute::Htime::cal_pair_costs( + const vector &Nadj, + const double rmesh_times ) +{ + TITLE("Exx_Abfs::Parallel::Distribute::Htime::cal_pair_costs"); + + const vector> Coulomb_potential_boxes = Abfs::get_Coulomb_potential_boxes(rmesh_times); + auto neighbour = [&](const size_t iat1, const size_t iat2) -> int + { + const int it1 = ucell.iat2it[iat1]; + const int it2 = ucell.iat2it[iat2]; + const Vector3 tau1 = ucell.atoms[it1].tau[ucell.iat2ia[iat1]]; + const Vector3 tau2 = ucell.atoms[it2].tau[ucell.iat2ia[iat2]]; + const double Rcut = std::min( ORB.Phi[it1].getRcut()*rmesh_times+ORB.Phi[it2].getRcut(), ORB.Phi[it1].getRcut()+ORB.Phi[it2].getRcut()*rmesh_times ); + int Nadj_box = 0; + for(const Vector3 box2 : Coulomb_potential_boxes) + { + const double R = (-tau1 + tau2 + box2 * ucell.latvec).norm(); + if(R*ucell.lat0 < Rcut) + ++Nadj_box; + } + return Nadj_box; + }; + + vector>> pair_costs; + for( size_t iat1=0; iat1> & pair_cost1, + const pair> & pair_cost2 ) -> bool + { return pair_cost1.first > pair_cost2.first; }; + std::sort( pair_costs.begin(), pair_costs.end(), comp ); + return pair_costs; +} + +vector>> Exx_Abfs::Parallel::Distribute::Htime::cal_rank_work( + const vector>> & pair_costs ) +{ + TITLE("Exx_Abfs::Parallel::Distribute::Htime::cal_rank_work"); + vector> rank_cost(NPROC); // rank_cost[i] = { irank, cost } + for( size_t irank=0; irank!=NPROC; ++irank ) + rank_cost[irank] = { irank, 0 }; + + auto comp = []( + const pair & rank_cost1, + const pair & rank_cost2 ) + { return rank_cost1.second > rank_cost2.second; }; + + vector>> rank_work(NPROC); // rank_work[irank] = { {iat1,iat2}, {iat1,iat2}, ... } + for( const auto pair_cost : pair_costs ) + { + pop_heap( rank_cost.begin(), rank_cost.end(), comp ); +//cout< +#include + +class Exx_Abfs::Parallel::Distribute::Htime +{ +public: + static vector> distribute( + const Abfs::Vector3_Order & Born_von_Karman_period, + const double rmesh_times ); +private: + static vector cal_Nadj( + const Abfs::Vector3_Order & Born_von_Karman_period ); + static vector>> cal_pair_costs( + const vector &Nadj, + const double rmesh_times ); + static vector>> cal_rank_work( + const vector>> & pair_costs ); +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-kmeans.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-kmeans.cpp new file mode 100644 index 0000000000..5c99e689d4 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-kmeans.cpp @@ -0,0 +1,344 @@ +#include "exx_abfs-parallel-distribute-kmeans.h" +#include "src_pw/global.h" +#include + +#include "src_external/src_test/test_function.h" + +pair< vector, vector > +Exx_Abfs::Parallel::Distribute::Kmeans::cluster( const int Nc ) +{ + TITLE("Exx_Abfs::Parallel::Distribute::Kmeans::cluster"); + + vector clusters(Nc+1); // clusters[Nc] just for atoms init + vector atoms(ucell.nat); + +//ofstream ofs_mpi(exx_lcao.test_dir.process+"kmeans_"+TO_STRING(Nc)+"_"+TO_STRING(MY_RANK),ofstream::app); + + auto init = [&]() -> void + { +//ofs_mpi< flag_is_center(Nx*Ny*Nz,true); + for( int ic_big=Nc/2; ic_big flag_is_center(Nc,true); +// flag_is_center.resize(Nx*Ny*Nz,false); +// std::shuffle( flag_is_center.begin(), flag_is_center.end(), std::default_random_engine(Nc*Nx*Ny*Nz) ); // Nc*Nx*Ny*Nz is just a seed, for all thread be the same + + +//for( int ic_big=0; ic_big taud_max = {0,0,0}, + taud_min = {1,1,1}; + for( int iat=0; iat & taud = ucell.atoms[ ucell.iat2it[iat] ].taud[ ucell.iat2ia[iat] ]; + taud_max.x = max( taud.x, taud_max.x ); + taud_max.y = max( taud.y, taud_max.y ); + taud_max.z = max( taud.z, taud_max.z ); + taud_min.x = min( taud.x, taud_min.x ); + taud_min.y = min( taud.y, taud_min.y ); + taud_min.z = min( taud.z, taud_min.z ); + } + const Vector3 taud_delta( + (taud_max.x-taud_min.x)/Nx, + (taud_max.y-taud_min.y)/Ny, + (taud_max.z-taud_min.z)/Nz); +//ofs_mpi< uniform(0,1); + for( int ic=0; ic::max(); + } +//for( int ic=0; ic bool + { +//ofs_mpi<<__FILE__<<__LINE__<(cluster.size); + +//for( int ic=0; ic> +Exx_Abfs::Parallel::Distribute::Kmeans::distribute_kmeans2( const MPI_Comm & mpi_comm, const int multiple_core ) +{ + TITLE("Exx_Abfs::Parallel::Distribute::Kmeans::distribute"); + + assert(multiple_core>=1); + int comm_size; MPI_Comm_size( mpi_comm, &comm_size ); + int my_rank; MPI_Comm_rank( mpi_comm, &my_rank ); + const int comm_size_nominal = comm_size * multiple_core; + + { + auto classify_atom = []( const int Ng, const vector &atoms ) -> vector> + { + vector> clusters_atoms(Ng); + for( size_t iat=0; iat &cluster_atoms) -> vector> + { + vector> rank_work; + for( size_t i1=0; i1 &cluster_atoms1, const vector &cluster_atoms2 ) -> vector> + { + vector> rank_work; + for( const size_t iat1 : cluster_atoms1 ) + for( const size_t iat2 : cluster_atoms2 ) + rank_work.push_back({iat1,iat2}); + return rank_work; + }; + + const int Ng = static_cast(sqrt(2*comm_size_nominal)); + if( Ng*(Ng+1)/2 == comm_size_nominal ) + { + + vector> rank_work; + const vector atoms = cluster(Ng).first; + const vector> clusters_atoms = classify_atom(Ng,atoms); + for( size_t ig1=0, rank_tmp=0; ig1> rank_work_tmp = + (ig1==ig2) ? + g_same_cluster(clusters_atoms[ig1]) : + g_different_cluster(clusters_atoms[ig1],clusters_atoms[ig2]); + rank_work.insert( rank_work.end(), rank_work_tmp.begin(), rank_work_tmp.end() ); + } + return rank_work; + } + } + { + int N1 = static_cast(sqrt(comm_size_nominal)); + while(comm_size_nominal%N1) --N1; + const int N2=comm_size_nominal/N1; + + auto f = [&]( const vector &atoms1, const vector &atoms2 ) -> vector> + { + auto index = [&](const int ic1, const int ic2){ return (ic1*N2+ic2)%comm_size; }; + + vector>> rank_work(comm_size); + for( size_t iatA=0; iatA> & rank_work1 = rank_work[index(atoms1[iatA].center, atoms2[iatB].center)]; + vector> & rank_work2 = rank_work[index(atoms1[iatB].center, atoms2[iatA].center)]; + if( rank_work1.size() < rank_work2.size() ) + rank_work1.push_back({iatA,iatB}); + else + rank_work2.push_back({iatB,iatA}); + } + return rank_work[my_rank]; + }; + + if(N1==N2) + { + const vector atoms = cluster(N1).first; + return f(atoms,atoms); + } + else + { + const vector atoms1 = cluster(N1).first; + const vector atoms2 = cluster(N2).first; + return f(atoms1,atoms2); + } + } +} + + +vector> +Exx_Abfs::Parallel::Distribute::Kmeans::distribute_kmeans1( const MPI_Comm & mpi_comm, const double rmesh_times ) +{ + int comm_size; MPI_Comm_size( mpi_comm, &comm_size ); + int my_rank; MPI_Comm_rank( mpi_comm, &my_rank ); +ofstream ofs_mpi(exx_lcao.test_dir.process+"kmeans_"+TO_STRING(my_rank),ofstream::app); + + auto classify_atom = []( const int Ng, const vector &atoms ) -> vector> + { + vector> clusters_atoms(Ng); + for( size_t iat=0; iat> boxes; + for(const int ix:{-1,0,1}) + for(const int iy:{-1,0,1}) + for(const int iz:{-1,0,1}) + boxes.push_back({ix,iy,iz}); + + const auto atoms_clusters_tmp = Exx_Abfs::Parallel::Distribute::Kmeans::cluster(comm_size); + const vector &atoms = atoms_clusters_tmp.first; + const vector &clusters = atoms_clusters_tmp.second; + const vector> clusters_atoms = classify_atom(comm_size,atoms); + +for(const auto cluster_atoms : clusters_atoms) + ofs_mpi<> rank_work; + for(const size_t iat1 : clusters_atoms[my_rank]) + { + const int it1 = ucell.iat2it[iat1]; + const Vector3 tau1 = ucell.atoms[it1].tau[ucell.iat2ia[iat1]]; + const int ic1 = atoms[iat1].center; + for(size_t iat2=0; iat2!=ucell.nat; ++iat2) + { + const int it2 = ucell.iat2it[iat2]; + const Vector3 tau2 = ucell.atoms[it2].tau[ucell.iat2ia[iat2]]; + const int ic2 = atoms[iat2].center; + + double R_min = std::numeric_limits::max(); + Vector3 tau2_box2_min; + Vector3 box2_min; // test + for(const Vector3 box2 : boxes) + { + const Vector3 tau2_box2 = tau2 + box2 * ucell.latvec; + const double R = (-tau1+tau2_box2).norm(); + if(R middle = (tau1 + tau2_box2_min)/2.0; + if( (middle-clusters[ic1].tau).norm() < (middle-clusters[ic2].tau-box2_min*ucell.latvec).norm() - epsilon ) + { + rank_work.push_back({iat1,iat2}); + } + else if( std::abs( (middle-clusters[ic1].tau).norm() - (middle-clusters[ic2].tau-box2_min*ucell.latvec).norm() )<=epsilon ) + { + if(iat1 +#include +#include + +class Exx_Abfs::Parallel::Distribute::Kmeans +{ +public: + + static vector> distribute_kmeans2( const MPI_Comm & mpi_comm, const int multiple_core=1 ); + static vector> distribute_kmeans1( const MPI_Comm & mpi_comm, const double rmesh_times ); + +private: + + struct Cluster + { + Vector3 tau; + size_t size; + Vector3 tau_sum; + }; + + struct Atom + { + Vector3 tau; + int center; + double distance; + }; + + static pair< vector, vector > + cluster( const int Nc ); +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-order.cpp b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-order.cpp new file mode 100644 index 0000000000..385ffb7a35 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-order.cpp @@ -0,0 +1,37 @@ +#include "exx_abfs-parallel-distribute-order.h" + +#include "src_pw/global.h" +#include "src_ri/abfs.h" +#include + +vector> Exx_Abfs::Parallel::Distribute::Order::distribute( + const double rmesh_times ) +{ + const vector> Coulomb_potential_boxes = Abfs::get_Coulomb_potential_boxes(rmesh_times); + auto neighbour = [&](const size_t iat1, const size_t iat2) -> bool + { + const int it1 = ucell.iat2it[iat1]; + const int it2 = ucell.iat2it[iat2]; + const Vector3 tau1 = ucell.atoms[it1].tau[ucell.iat2ia[iat1]]; + const Vector3 tau2 = ucell.atoms[it2].tau[ucell.iat2ia[iat2]]; + const double Rcut = std::min( ORB.Phi[it1].getRcut()*rmesh_times+ORB.Phi[it2].getRcut(), ORB.Phi[it1].getRcut()+ORB.Phi[it2].getRcut()*rmesh_times ); + for(const Vector3 box2 : Coulomb_potential_boxes) + { + const double R = (-tau1 + tau2 + box2 * ucell.latvec).norm(); + if(R*ucell.lat0 < Rcut) + return true; + } + return false; + }; + + vector> pairs; + for( size_t iat1=0; iat1(pairs.size())/NPROC); + return vector>{ + std::min( pairs.begin()+ MY_RANK *work, pairs.end() ), + std::min( pairs.begin()+(MY_RANK+1)*work, pairs.end() )}; +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-order.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-order.h new file mode 100644 index 0000000000..57242093ad --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel-distribute-order.h @@ -0,0 +1,18 @@ +#ifndef EXX_ABFS_PARALLEL_DISTRIBUTE_ORDER_H +#define EXX_ABFS_PARALLEL_DISTRIBUTE_ORDER_H + +#include "exx_abfs-parallel.h" + +#include "src_ri/abfs.h" + +#include +#include + +class Exx_Abfs::Parallel::Distribute::Order +{ +public: + static vector> distribute( + const double rmesh_times ); +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-parallel.h b/ABACUS.develop/source/src_ri/exx_abfs-parallel.h new file mode 100644 index 0000000000..a95b71d4a0 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-parallel.h @@ -0,0 +1,34 @@ +#ifndef EXX_ABFS_PARALLEL_H +#define EXX_ABFS_PARALLEL_H + +#include "exx_abfs.h" + +class Exx_Abfs::Parallel +{ + public: + + class Distribute + { + public: + class Htime; + class Kmeans; + class Order; + }; + + class Communicate + { + public: + class Allreduce; + class Function; + class Hexx; + #if EXX_DM==1 + class DM; + #elif EXX_DM==2 + class DM2; + #elif EXX_DM==3 + class DM3; + #endif + }; +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-pca.cpp b/ABACUS.develop/source/src_ri/exx_abfs-pca.cpp new file mode 100644 index 0000000000..7feaa03e81 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-pca.cpp @@ -0,0 +1,145 @@ +#include "exx_abfs-pca.h" + +#include "exx_abfs-abfs_index.h" +#include "exx_abfs-matrix_orbs11.h" +#include "exx_abfs-matrix_orbs21.h" +#include "exx_abfs-inverse_matrix_double.h" + +#include "src_global/lapack_connector.h" +#include "src_global/global_function.h" + +#include +#include + +#include "src_external/src_test/src_global/element_basis_index-test.h" // Peize Lin test +#include "src_external/src_test/src_ri/exx_lcao-test.h" // Peize Lin test +#include // Peize Lin test +#include "src_lcao/global_fp.h" // Peize Lin test + +vector,matrix>>> Exx_Abfs::PCA::cal_PCA( + const vector>> &lcaos, + const vector>> &abfs, + const double kmesh_times ) +{ + TITLE("Exx_Abfs::PCA::cal_PCA"); +ofstream ofs(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; + + const Element_Basis_Index::Range + && range_lcaos = Exx_Abfs::Abfs_Index::construct_range( lcaos ); + const Element_Basis_Index::IndexLNM + && index_lcaos = Element_Basis_Index::construct_index( range_lcaos ); + + const Element_Basis_Index::Range + && range_abfs = Exx_Abfs::Abfs_Index::construct_range( abfs ); + const Element_Basis_Index::IndexLNM + && index_abfs = Element_Basis_Index::construct_index( range_abfs ); + +ofs<::min(); + for( size_t T=0; T!=abfs.size(); ++T ) + Exx_Abfs::Lmax = std::max( Exx_Abfs::Lmax, static_cast(abfs[T].size())-1 ); + + Exx_Abfs::Matrix_Orbs21 m_abfslcaos_lcaos; +//gettimeofday( &t_start, NULL); + m_abfslcaos_lcaos.init( 1, kmesh_times, 1 ); +//ofs<<"TIME@m_abfslcaos_lcaos.init\t"<>> delta_R; + for( size_t it=0; it!=abfs.size(); ++it ) + delta_R[it][it] = {0.0}; +//gettimeofday( &t_start, NULL); + m_abfslcaos_lcaos.init_radial_table(delta_R); +//ofs<<"TIME@m_abfslcaos_lcaos.init_radial_table\t"<,matrix>>> eig(abfs.size()); + for( size_t T=0; T!=abfs.size(); ++T ) + { + const matrix && A = m_abfslcaos_lcaos.cal_overlap_matrix( + T, + T, + Vector3{0,0,0}, + Vector3{0,0,0}, + index_abfs, + index_lcaos, + index_lcaos, + Exx_Abfs::Matrix_Orbs21::Matrix_Order::A2B_A1); +//ofs<<"A:"< eig_value(mm.nr); + + int info; +gettimeofday( &t_start, NULL); + LapackConnector::dsyev( 'V', 'U', mm, VECTOR_TO_PTR(eig_value), info ); +ofs<<"TIME@LapackConnector::dsyev\t"< + +// training data: lcaos[i] * lcaos[j] +// old basis: abfs +// new basis: to be constructed +// ( all lcaos and abfs on same atom ) + +class Exx_Abfs::PCA +{ +public: + static vector,matrix>>> cal_PCA( + const vector>> &lcaos, + const vector>> &abfs, // abfs must be orthonormal + const double kmesh_times ); +private: + static matrix get_sub_matrix( + const matrix & m, + const size_t & T, + const size_t & L, + const Element_Basis_Index::Range & range, + const Element_Basis_Index::IndexLNM & index ); + static matrix get_column_mean0_matrix( const matrix & m ); +}; + +#endif // EXX_ABFS_PCA_H \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-screen-cauchy.cpp b/ABACUS.develop/source/src_ri/exx_abfs-screen-cauchy.cpp new file mode 100644 index 0000000000..bdb3470033 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-screen-cauchy.cpp @@ -0,0 +1,307 @@ +#include "exx_abfs-screen-cauchy.h" + +#include "src_pw/global.h" + +#include "src_external/src_test/src_ri/exx_abfs-screen-test.h" +//double Exx_Abfs::Screen::Cauchy::num_screen1 = 0; +//double Exx_Abfs::Screen::Cauchy::num_screen2 = 0; +//double Exx_Abfs::Screen::Cauchy::num_screen3 = 0; +//double Exx_Abfs::Screen::Cauchy::num_cal = 0; + +void Exx_Abfs::Screen::Cauchy::init( + const bool flag_screen_cauchy_in, + const double threshold_in, + const Abfs::Vector3_Order Born_von_Karman_period_in) +{ + TITLE("Exx_Abfs::Screen::Cauchy::init"); + flag_screen_cauchy = flag_screen_cauchy_in; + threshold = threshold_in; + Born_von_Karman_period = Born_von_Karman_period_in; +} + +void Exx_Abfs::Screen::Cauchy::cal_norm_C_max( + const map,shared_ptr>>> & Cs, + const Element_Basis_Index::IndexLNM & index_lcaos, + const Element_Basis_Index::IndexLNM & index_abfs) +{ + if(!flag_screen_cauchy) return; + TITLE("Exx_Abfs::Screen::Cauchy::cal_norm_C_max"); + + for( const auto & Cs1 : Cs ) + { + const size_t iat1 = Cs1.first; + const size_t it1 = ucell.iat2it[iat1]; + for( const auto & Cs2 : Cs1.second ) + { + const size_t iat2 = Cs2.first; + const size_t it2 = ucell.iat2it[iat2]; + for( const auto & Cs3 : Cs2.second ) + { + const Abfs::Vector3_Order &box2 = Cs3.first; + const matrix & C = *Cs3.second; + + const size_t nw1 = index_lcaos[it1].count_size, + nw2 = index_lcaos[it2].count_size, + nw3 = index_abfs[it1].count_size; + + { // || C(i) || || C(i) C^+(i) || + valarray C_norm2_outer(nw1); + valarray C_norm4_outer(nw1); + for( size_t iw1=0; iw1!=nw1; ++iw1 ) + { + // C_outer( iw2, iw3 ) = C( iw1, iw2, iw3 ) + matrix C_outer( nw2, nw3 ); +// for( size_t iw2=0; iw2!=nw2; ++iw2 ) +// memcpy( C_outer.c+iw2*nw3, C.c+(iw1*nw2+iw2)*nw3, sizeof(double)*nw3 ); + memcpy( C_outer.c, C.c+iw1*nw2*nw3, sizeof(double)*nw2*nw3 ); + + C_norm2_outer[iw1] = C_outer.norm(); // || C || + C_norm4_outer[iw1] = m_mT(C_outer).norm(); // || C C^+ || + } + C_norm2_outer_max[iat1][iat2][box2] = C_norm2_outer.max(); // || C || + C_norm4_outer_max[iat1][iat2][box2] = sqrt( C_norm4_outer.max() ); // sqrt{ || C C^+ || } + } + + { // || C(j) || || C(j) C^+(j) || + valarray C_norm2_inner(nw2); + valarray C_norm4_inner(nw2); + for( size_t iw2=0; iw2!=nw2; ++iw2 ) + { + // C_inner( iw1, iw3 ) = C( iw1, iw2, iw3 ) + matrix C_inner( nw1, nw3 ); +// for( size_t iw1=0; iw1!=nw1; ++iw1 ) +// memcpy( C_inner.c+iw1*nw3, C.c+(iw1*nw2+iw2)*nw3, sizeof(double)*nw3 ); + const size_t nw23 = nw2*nw3; + const auto length = sizeof(double)*nw3; + double * C_inner_ptr = C_inner.c; + const double * C_ptr = C.c+iw2*nw3; + for( size_t iw1=0; iw1!=nw1; ++iw1, C_inner_ptr+=nw3, C_ptr+=nw23 ) + memcpy( C_inner_ptr, C_ptr, length ); + + C_norm2_inner[iw2] = C_inner.norm(); // || C || + C_norm4_inner[iw2] = m_mT(C_inner).norm(); // || C C^+ || + } + C_norm2_inner_max[iat1][iat2][box2] = C_norm2_inner.max(); // || C || + C_norm4_inner_max[iat1][iat2][box2] = sqrt( C_norm4_inner.max() ); // sqrt{ || C C^+ || } + } + + /* + matrix C_norm2_12( nw1, nw2 ); + for( size_t iw1=0; iw1!=nw1; ++iw1 ) + for( size_t iw2=0; iw2!=nw2; ++iw2 ) + C_norm2_12(iw1,iw2) = nrm2( nw3, C+iw1+iw2, 1 ); + valarray C_norm2_1(nw1); + for( size_t iw1=0; iw1!=nw1; ++iw1 ) + C_norm2_1(iw1) = nrm2( nw2, C_norm2_12+iw1, 1 ); + valarray C_norm2_2(nw2); + for( size_t iw2=0; iw2!=nw2; ++iw2 ) + C_norm2_2(iw2) = nrm2( nw1, C_norm2_12+iw2, 1 ); + + C_norm2_1_max[iat1][iat2][box2] = C_norm2_1.max(); + C_norm2_2_max[iat1][iat2][box2] = C_norm2_2.max(); + */ + } + } + } +} + +void Exx_Abfs::Screen::Cauchy::cal_norm_V( const map,shared_ptr>>> & Vs ) +{ + if(!flag_screen_cauchy) return; + TITLE("Exx_Abfs::Screen::Cauchy::cal_norm_V"); + + for( const auto & Vs1 : Vs ) + { + const size_t iat1 = Vs1.first; + for( const auto & Vs2 : Vs1.second ) + { + const size_t iat2 = Vs2.first; + for( const auto & Vs3 : Vs2.second ) + { + const Abfs::Vector3_Order &box2 = Vs3.first; + const matrix & V = *Vs3.second; + + V_norm4[iat1][iat2][box2] = sqrt( m_mT(V).norm() ); // \sqrt{ || V V^+ || } + } + } + } +} + +void Exx_Abfs::Screen::Cauchy::cal_norm_D_max( const vector,matrix>>>> & Ds ) +{ + if(!flag_screen_cauchy) return; + TITLE("Exx_Abfs::Screen::Cauchy::cal_norm_D_max"); + + for( size_t is=0; is!=NSPIN; ++is ) + { + for( const auto & DsA : Ds[is] ) + { + const size_t iat1 = DsA.first; + for( const auto & DsB : DsA.second ) + { + const size_t iat2 = DsB.first; + for( const auto & DsC : DsB.second ) + { + const Abfs::Vector3_Order &box2 = DsC.first; + const matrix & D = DsC.second; + const double D_norm4 = sqrt( m_mT(D).norm() ); // \sqrt{ || D D^+ || } + D_norm4_max[iat1][iat2][box2] = max( D_norm4, D_norm4_max[iat1][iat2][box2] ); // \sqrt{ || D D^+ || } + } + } + } + } +} + +Exx_Abfs::Screen::Cauchy::Info_Step Exx_Abfs::Screen::Cauchy::input_info( + const size_t iat1, const size_t iat2, const size_t iat3, const size_t iat4, + const Abfs::Vector3_Order & box2, + const Abfs::Vector3_Order & box3, + const Abfs::Vector3_Order & box4 ) const +{ + if(!flag_screen_cauchy) return Info_Step(); + + Info_Step info_step; + + info_step.C1_norm4_max = C_norm4_outer_max.at(iat1).at(iat3).at(box3); + info_step.C3_norm4_max = C_norm4_inner_max.at(iat1).at(iat3).at(box3); + info_step.C2_norm4_max = C_norm4_outer_max.at(iat2).at(iat4).at(box4); + info_step.C4_norm4_max = C_norm4_inner_max.at(iat2).at(iat4).at(box4); + + info_step.C1_norm2_max = C_norm2_outer_max.at(iat1).at(iat3).at(box3); + info_step.C3_norm2_max = C_norm2_inner_max.at(iat1).at(iat3).at(box3); + + info_step.V_norm4 = V_norm4.at(iat1).at(iat2).at(box2); + + if( const double*const D_ptr = static_cast(MAP_EXIST( D_norm4_max, iat3, iat4, Abfs::Vector3_Order(box2-box3+box4)%Born_von_Karman_period )) ) + info_step.D34_norm4_max = *D_ptr; + else + info_step.D34_norm4_max = 0; + if( const double*const D_ptr = static_cast(MAP_EXIST( D_norm4_max, iat3, iat2, Abfs::Vector3_Order(box2-box3 )%Born_von_Karman_period )) ) + info_step.D32_norm4_max = *D_ptr; + else + info_step.D32_norm4_max = 0; + if( const double*const D_ptr = static_cast(MAP_EXIST( D_norm4_max, iat1, iat4, Abfs::Vector3_Order(box2 +box4)%Born_von_Karman_period )) ) + info_step.D14_norm4_max = *D_ptr; + else + info_step.D14_norm4_max = 0; + if( const double*const D_ptr = static_cast(MAP_EXIST( D_norm4_max, iat1, iat2, Abfs::Vector3_Order(box2 )%Born_von_Karman_period )) ) + info_step.D12_norm4_max = *D_ptr; + else + info_step.D12_norm4_max = 0; + + return info_step; +} + +int Exx_Abfs::Screen::Cauchy::postcalA( const Info_Step & info_step ) const +{ + if( !flag_screen_cauchy ) return 4; + if( info_step.C1_norm4_max * info_step.V_norm4 * info_step.C2_norm4_max * info_step.D34_norm4_max > threshold ) return 4; + if( info_step.C3_norm4_max * info_step.V_norm4 * info_step.C2_norm4_max * info_step.D14_norm4_max > threshold ) return 3; + if( info_step.C1_norm4_max * info_step.V_norm4 * info_step.C4_norm4_max * info_step.D32_norm4_max > threshold ) return 2; + if( info_step.C3_norm4_max * info_step.V_norm4 * info_step.C4_norm4_max * info_step.D12_norm4_max > threshold ) return 1; +// ++num_screen1; + return 0; +} + +int Exx_Abfs::Screen::Cauchy::postcalB( + const Info_Step & info_step, + const matrix & VC_T, // iw2, \mu1, iw4 + const size_t range_iw2, + const size_t range_mu1, + const size_t range_iw4, + const int postcal_in) const +{ + if( !flag_screen_cauchy ) return 4; + switch(postcal_in) // Attention: case and go on calculating + { + case 4: case 3: + { + const double VC2_norm2_max = cal_matrix_outer_max( VC_T, range_iw2, range_mu1 * range_iw4 ); + if( info_step.C1_norm4_max * VC2_norm2_max * info_step.D34_norm4_max > threshold ) return 4; // H_{12} + if( info_step.C3_norm4_max * VC2_norm2_max * info_step.D14_norm4_max > threshold ) return 3; // H_{32} + } + case 2: case 1: + { + const double VC4_norm2_max = cal_matrix_inner_max( VC_T, range_iw2 * range_mu1, range_iw4 ); + if( info_step.C1_norm4_max * VC4_norm2_max * info_step.D32_norm4_max > threshold ) return 2; // H_{14} + if( info_step.C3_norm4_max * VC4_norm2_max * info_step.D12_norm4_max > threshold ) return 1; // H_{34} + } + } +// ++num_screen2; + return 0; +} + +bool Exx_Abfs::Screen::Cauchy::postcalC( + const Info_Step & info_step, + const matrix & DVC, // iw1/iw3, \mu1, iw2/iw4 + const size_t range_iw13, + const size_t range_mu1, + const size_t range_iw24, + const size_t iw13H) const +{ + if( !flag_screen_cauchy ) return true; + const double DVC24_norm2_max = cal_matrix_inner_max( DVC, range_iw13 * range_mu1, range_iw24 ); + switch(iw13H) + { + case 1: + if( info_step.C1_norm2_max * DVC24_norm2_max > threshold ) + { +// num_cal += 0.25/NSPIN; + return true; + } + else + { +// num_screen3 += 0.25/NSPIN; + return false; + } + break; + case 3: + if( info_step.C3_norm2_max * DVC24_norm2_max > threshold ) + { +// num_cal += 0.25/NSPIN; + return true; + } + else + { +// num_screen3 += 0.25/NSPIN; + return false; + } + break; + default: + throw domain_error(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); + } +} + +// max_j \sqrt{ \sum_i m(i,j)^2 } +double Exx_Abfs::Screen::Cauchy::cal_matrix_inner_max( const matrix & m, const size_t ni, const size_t nj ) const +{ + assert( m.nr*m.nc == ni*nj ); + valarray m_inner(0.0,nj); + double * const m_inner_ptr = &m_inner[0]; + for( size_t i=0; i m_outer(ni); + for( size_t i=0; i +#include + +class Exx_Abfs::Screen::Cauchy +{ +public: + struct Info_Step + { + double C1_norm4_max = 0.0; + double C3_norm4_max = 0.0; + double C2_norm4_max = 0.0; + double C4_norm4_max = 0.0; + + double C1_norm2_max = 0.0; + double C3_norm2_max = 0.0; + + double V_norm4 = 0.0; + + double D34_norm4_max = 0.0; + double D32_norm4_max = 0.0; + double D14_norm4_max = 0.0; + double D12_norm4_max = 0.0; + }; + +public: + + void init( + const bool flag_screen_cauchy_in, + const double threshold_in, + const Abfs::Vector3_Order Born_von_Karman_period_in); + void cal_norm_C_max( + const map,shared_ptr>>> & Cs, + const Element_Basis_Index::IndexLNM & index_lcaos, + const Element_Basis_Index::IndexLNM & index_abfs); + void cal_norm_V( const map,shared_ptr>>> & Vs ); + void cal_norm_D_max( const vector,matrix>>>> & Ds ); + + Info_Step input_info( + const size_t iat1, const size_t iat2, const size_t iat3, const size_t iat4, + const Abfs::Vector3_Order & box2, + const Abfs::Vector3_Order & box3, + const Abfs::Vector3_Order & box4 ) const; + int postcalA( const Info_Step & info_step ) const; + int postcalB( + const Info_Step & info_step, + const matrix & VC_T, // iw2, \mu1, iw4 + const size_t range_iw2, + const size_t range_mu1, + const size_t range_iw4, + const int postcal_in) const; + bool postcalC( + const Info_Step & info_step, + const matrix & DVC, // iw1/iw3, \mu1, iw2/iw4 + const size_t range_iw13, + const size_t range_mu1, + const size_t range_iw24, + const size_t iw13H) const; + bool postcalD( const matrix & H ) const { return (H.absmax()>threshold) ? true : false; } + +private: + // max_j \sqrt{ \sum_i m(i,j)^2 } + double cal_matrix_inner_max( const matrix & m, const size_t ni, const size_t nj ) const; + // max_i \sqrt{ \sum_j m(i,j)^2 } + double cal_matrix_outer_max( const matrix & m, const size_t ni, const size_t nj ) const; + // m m^+ + matrix m_mT( const matrix & m ) const; + +private: + + bool flag_screen_cauchy = false; + double threshold = 0; + Abfs::Vector3_Order Born_von_Karman_period; + +private: + + // \sqrt{ || C C^+ || } for C_{ I i \mu, K k } + map,double>>> C_norm4_outer_max; // max_i \sqrt{ || C_i C_i^+ || } + map,double>>> C_norm4_inner_max; // max_k \sqrt{ || C_k C_k^+ || } + + // \sqrt{ || V V^+ || } for V_{ U \mu, V \nu } + map,double>>> V_norm4; + + // \sqrt{ || m m^+ || } for D_{ K k, L l } + map,double>>> D_norm4_max; // max_is \sqrt{ || m m^+ || } + + // || C || for C_{ I i \mu, K k } + map,double>>> C_norm2_outer_max; // max_i || C_i || + map,double>>> C_norm2_inner_max; // max_k || C_k || + +//public: +// static double num_screen1; +// static double num_screen2; +// static double num_screen3; +// static double num_cal; +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-screen-schwarz.cpp b/ABACUS.develop/source/src_ri/exx_abfs-screen-schwarz.cpp new file mode 100644 index 0000000000..7b79bf8dd8 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-screen-schwarz.cpp @@ -0,0 +1,139 @@ +#include "exx_abfs-screen-schwarz.h" +#include "src_pw/global.h" +#include "src_global/lapack_connector.h" +#include +#include +#include +#include + +#include "src_external/src_test/src_ri/exx_abfs-screen-test.h" +#include "src_external/src_test/src_ri/exx_lcao-test.h" +//double Exx_Abfs::Screen::Schwarz::num_screen = 0; +//double Exx_Abfs::Screen::Schwarz::num_cal = 0; + +void Exx_Abfs::Screen::Schwarz::init( + const bool flag_screen_schwarz_in, + const double threshold_in ) +{ + flag_screen_schwarz = flag_screen_schwarz_in; + threshold = threshold_in * threshold_in; +} + + +void Exx_Abfs::Screen::Schwarz::cal_max_pair_fock( + const set &atom_centres, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Exx_Abfs::Matrix_Orbs21 &m_abfslcaos_lcaos, + const Element_Basis_Index::IndexLNM &index_abfs, + const Element_Basis_Index::IndexLNM &index_lcaos, + const Abfs::Vector3_Order &Born_von_Karman_period, + map,weak_ptr>>> &Cws, + map,weak_ptr>>> &Vws ) +{ + if(!flag_screen_schwarz) return; + TITLE("Exx_Abfs::Screen::Schwarz::cal_max_pair_fock"); + pthread_rwlock_t rwlock_Cw; pthread_rwlock_init(&rwlock_Cw,NULL); + pthread_rwlock_t rwlock_Vw; pthread_rwlock_init(&rwlock_Vw,NULL); + + // pre-cal Vws on same atom, speed up DPcal_V() + vector> Vs_same_atom(ucell.ntype); + for(size_t it=0; it!=ucell.ntype; ++it) + Vs_same_atom[it] = Abfs::DPcal_V( it,it,{0,0,0}, m_abfs_abfs, index_abfs, 0,true, rwlock_Vw,Vws ); + + // m_out( i1, i2, i3 ) = m_in( i2, i1, i3 ) + auto change_matrix_order =[]( const matrix &m_in, const size_t n1 ) -> matrix + { + assert( m_in.nr%n1 == 0 ); + matrix m_out( m_in.nr, m_in.nc, false ); + const size_t n2 = m_in.nr/n1, + n3 = m_in.nc, + n13 = n1*n3; + const auto length = n3*sizeof(double); + double * m_out_ptr = m_out.c; + for( size_t i1=0; i1!=n1; ++i1 ) + { + const double * m_in_ptr = m_in.c + i1*n3; + for( size_t i2=0; i2!=n2; ++i2, m_in_ptr+=n13, m_out_ptr+=n3 ) + memcpy( m_out_ptr, m_in_ptr, length ); + } + return m_out; + }; + + // max_i m(i,i) + auto max_diagnal = []( const matrix & m ) -> double + { + assert(m.nr==m.nc); + double diagnal = -std::numeric_limits::max(); + for( size_t i=0; i!=m.nr; ++i ) + diagnal = max( diagnal, m(i,i) ); + return diagnal; + }; + + // m * m.T + auto m_mT = []( const matrix & m1, const matrix & m2 ) -> matrix + { + assert( m1.nc == m2.nc ); + matrix mm( m1.nr, m2.nr, false ); + LapackConnector::gemm( 'N','T', m1.nr,m2.nr,m1.nc, 1, m1.c,m1.nc, m2.c,m2.nc, 0, mm.c,mm.nc ); + return mm; + }; + + map,double>>> max_pair_fock_DP; + for(const size_t iat1 : atom_centres) + { + const size_t it1 = ucell.iat2it[iat1]; + const size_t ia1 = ucell.iat2ia[iat1]; + const Abfs::Vector3_Order tau1( ucell.atoms[it1].tau[ia1] ); + + const map>> adj = Abfs::get_adjs(iat1); + for( const auto & atom2 : adj ) + { + const int iat2 = atom2.first; + const int it2 = ucell.iat2it[iat2]; + const int ia2 = ucell.iat2ia[iat2]; + const Abfs::Vector3_Order tau2( ucell.atoms[it2].tau[ia2] ); + + map,shared_ptr> pair_fock_s; + for( const Abfs::Vector3_Order &box2 : atom2.second ) + { + const Abfs::Vector3_Order box2p = box2%Born_von_Karman_period; + if(const double*max_pair_fock_ptr=static_cast(MAP_EXIST(max_pair_fock_DP,it1,it2,-tau1+tau2+box2p*ucell.latvec))) + max_pair_fock[iat1][iat2][box2p] = *max_pair_fock_ptr; + else + { + const Abfs::Vector3_Order R = -tau1+tau2+box2*ucell.latvec; + const matrix C_12 = *Abfs::DPcal_C( it1,it2,R, m_abfs_abfs,m_abfslcaos_lcaos, index_abfs,index_lcaos, 0,false, rwlock_Cw,rwlock_Vw,Cws,Vws ); + const matrix C_21 = change_matrix_order( + *Abfs::DPcal_C( it2,it1,-R, m_abfs_abfs,m_abfslcaos_lcaos, index_abfs,index_lcaos, 0,false, rwlock_Cw,rwlock_Vw,Cws,Vws ), + index_lcaos[it1].count_size); + + const matrix V_11 = *Abfs::DPcal_V(it1,it1,{0,0,0}, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const matrix V_12 = *Abfs::DPcal_V(it1,it2,R, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const matrix V_21 = *Abfs::DPcal_V(it2,it1,-R, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + const matrix V_22 = *Abfs::DPcal_V(it2,it2,{0,0,0}, m_abfs_abfs,index_abfs, 0,false, rwlock_Vw,Vws); + + pair_fock_s[box2] = make_shared( + m_mT( C_12 * V_11, C_12 ) + + m_mT( C_12 * V_12, C_21 ) + + m_mT( C_21 * V_21, C_12 ) + + m_mT( C_21 * V_22, C_21 )); + } + } + + const map,shared_ptr> pair_fock_ps = Abfs::cal_mps( Born_von_Karman_period, pair_fock_s ); + + for( const auto & pair_fock_p : pair_fock_ps ) + { + const Abfs::Vector3_Order & box2p = pair_fock_p.first; + max_pair_fock[iat1][iat2][box2p] = max_pair_fock_DP[it1][it2][-tau1+tau2+box2p*ucell.latvec] = max_diagnal(*pair_fock_p.second); + } + } + } + + Vs_same_atom.clear(); + Abfs::delete_empty_ptrs( Vws ); + pthread_rwlock_destroy(&rwlock_Cw); + pthread_rwlock_destroy(&rwlock_Vw); + +//test_screen("schwarz-max_pair_fock.dat",max_pair_fock); +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-screen-schwarz.h b/ABACUS.develop/source/src_ri/exx_abfs-screen-schwarz.h new file mode 100644 index 0000000000..722747bb62 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-screen-schwarz.h @@ -0,0 +1,60 @@ +#ifndef EXX_ABFS_SCREEN_SCHWARZ +#define EXX_ABFS_SCREEN_SCHWARZ + +#include "exx_abfs.h" +#include "abfs.h" +#include "src_global/matrix.h" +#include +#include + +// |\braket{ik|jl}| \leq \sqrt{ \braket{ik|ik} \braket{jl|jl} } + +class Exx_Abfs::Screen::Schwarz +{ +public: + void init( + const bool flag_screen_schwarz_in, + const double threshold_in); + void cal_max_pair_fock( + const set &atom_centres, + const Exx_Abfs::Matrix_Orbs11 &m_abfs_abfs, + const Exx_Abfs::Matrix_Orbs21 &m_abfslcaos_lcaos, + const Element_Basis_Index::IndexLNM &index_abfs, + const Element_Basis_Index::IndexLNM &index_lcaos, + const Abfs::Vector3_Order &Born_von_Karman_period, + map,weak_ptr>>> &Cws, + map,weak_ptr>>> &Vws ); + inline bool screen( + const size_t iat1, const size_t iat2, const size_t iat3, const size_t iat4, + const Abfs::Vector3_Order & box3, const Abfs::Vector3_Order & box4 ) const; + +private: + bool flag_screen_schwarz = false; + double threshold = 0; + map,double>>> max_pair_fock; + +public: +// static double num_screen; +// static double num_cal; +}; + + +bool Exx_Abfs::Screen::Schwarz::screen( + const size_t iat1, const size_t iat2, const size_t iat3, const size_t iat4, + const Abfs::Vector3_Order & box3, const Abfs::Vector3_Order & box4 ) const +{ + if(!flag_screen_schwarz) + return false; + if( max_pair_fock.at(iat1).at(iat3).at(box3) * max_pair_fock.at(iat2).at(iat4).at(box4) > threshold ) + { +// num_cal += 1; + return false; + } + else + { +// num_screen += 1; + return true; + } +} + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs-util.cpp b/ABACUS.develop/source/src_ri/exx_abfs-util.cpp new file mode 100644 index 0000000000..fd9a5fd3fc --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs-util.cpp @@ -0,0 +1,42 @@ +#include "exx_abfs-util.h" +#include +#include + +void Exx_Abfs::Util::bcast( vector &v, const int rank_src, const MPI_Comm &mpi_comm ) +{ + int my_rank; MPI_Comm_rank( mpi_comm, &my_rank ); + if(my_rank==rank_src) + { + int size_v = v.size(); + MPI_Bcast( &size_v, 1, MPI_INT, rank_src, mpi_comm ); + + vector size_s(size_v); + transform( v.begin(), v.end(), size_s.begin(), [](const string &s){return s.size();} ); + MPI_Bcast( VECTOR_TO_PTR(size_s), size_s.size(), MPI_INT, rank_src, mpi_comm ); + + string s_all = accumulate( v.begin(), v.end(), string() ); + MPI_Bcast( const_cast(s_all.c_str()), s_all.size(), MPI_CHAR, rank_src, mpi_comm ); + } + else + { + int size_v; + MPI_Bcast( &size_v, 1, MPI_INT, rank_src, mpi_comm ); + v.resize(size_v); + + vector size_s(size_v); + MPI_Bcast( VECTOR_TO_PTR(size_s), size_s.size(), MPI_INT, rank_src, mpi_comm ); + + const int size_all = accumulate( size_s.begin(), size_s.end(), 0 ); + char *s_all_tmp = new char[size_all]; + MPI_Bcast( s_all_tmp, size_all, MPI_CHAR, rank_src, mpi_comm ); + string s_all(s_all_tmp, size_all); + delete[]s_all_tmp; + + deque index_begin(size_v); + partial_sum( size_s.begin(), size_s.end(), index_begin.begin() ); + index_begin.push_front(0); + + for(int i=0; i +#include + +class Exx_Abfs::Util +{ +public: + static void bcast( vector &v, const int rank_src, const MPI_Comm &mpi_comm ); +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_abfs.cpp b/ABACUS.develop/source/src_ri/exx_abfs.cpp new file mode 100644 index 0000000000..0582e07384 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs.cpp @@ -0,0 +1,1080 @@ +#include "exx_abfs.h" + +#include "exx_abfs-abfs_index.h" +#include "exx_abfs-jle.h" +#include "exx_abfs-inverse_matrix_double.h" +#include "exx_abfs-io.h" +#include "exx_abfs-construct_orbs.h" + +#include "exx_abfs-matrix_orbs11.h" +#include "exx_abfs-matrix_orbs21.h" +#include "exx_abfs-matrix_lcaoslcaos_lcaoslcaos.h" + +#include "src_lcao/ORB_read.h" +#include "conv_coulomb_pot.h" +#include "conv_coulomb_pot-inl.h" + +#include "src_global/global_function.h" + +#include "src_external/src_test/test_function.h" // Peize Lin test +#include "src_external/src_test/src_ri/exx_abfs-unittest.h" +#include "src_external/src_test/src_ri/make_gaunt_table-unittest.h" +#include "src_external/src_test/src_global/element_basis_index-test.h" // Peize Lin test 2016-04-05 +#include "src_pw/global.h" +#include // Peize Lin test + +int Exx_Abfs::Lmax = 0; // Peize Lin test + +void Exx_Abfs::test_all() const +{ + auto test_MGT = []() + { + const int Lmax = 3; + ORB_gaunt_table MGT; + MGT.init_Gaunt_CH( Lmax ); + MGT.init_Gaunt( Lmax ); + cout_MGT(MGT,Lmax); + }; + + auto test_abfs = []() + { + const vector>> + &&lcaos = Construct_Orbs::change_orbs( ORB, 1 ); + const vector>> + &&abfs = Construct_Orbs::abfs_same_atom( lcaos, 1 ); + + for( size_t T=0; T!=abfs.size(); ++T ) + Lmax = std::max( Lmax, static_cast(abfs[T].size())-1 ); + + const Element_Basis_Index::Range + &&range_abfs = Abfs_Index::construct_range( abfs ); + const Element_Basis_Index::IndexLNM + &&index_abfs = Element_Basis_Index::construct_index( range_abfs ); + + Matrix_Orbs11 m_abfs_abfs; + cout<<"D1"<>>> + &&ms_abfs_abfs = m_abfs_abfs.cal_overlap_matrix( index_abfs, index_abfs ); + ofs_ms("ms_abfs_abfs",ms_abfs_abfs); + }; + + auto test_svd = []() + { + const vector>> + &&lcaos = Construct_Orbs::change_orbs( ORB, 1 ); + const vector>> + &&abfs = Construct_Orbs::abfs_same_atom( lcaos, 1 ); + + for( size_t T=0; T!=abfs.size(); ++T ) + Lmax = std::max( Lmax, static_cast(abfs[T].size())-1 ); + + const Element_Basis_Index::Range + &&range_abfs = Abfs_Index::construct_range( abfs ); + const Element_Basis_Index::IndexLNM + &&index_abfs = Element_Basis_Index::construct_index( range_abfs ); + + const Element_Basis_Index::Range + &&range_lcaos = Abfs_Index::construct_range( ORB ); + const Element_Basis_Index::IndexLNM + &&index_lcaos = Element_Basis_Index::construct_index( range_lcaos ); + + Matrix_Orbs21 m_abfslcaos_lcaos; + m_abfslcaos_lcaos.init( 1, 1, 1 ); + m_abfslcaos_lcaos.init_radial( abfs, ORB, ORB ); + m_abfslcaos_lcaos.init_radial_table(); + const map>>>> + &&ms_lcaos2_abfs = m_abfslcaos_lcaos.cal_overlap_matrix( index_abfs, index_lcaos, index_lcaos ); + ofs_ms("ms_lcaos2_abfs",ms_lcaos2_abfs); + }; + + auto test_GriD = []() + { + for (int T1 = 0; T1 < ucell.ntype; ++T1) + for (int I1 = 0; I1 < ucell.atoms[T1].na; ++I1) + { + cout<<"@\t"<>> +// &&abfs_same_atom = Construct_Orbs::abfs_same_atom( ORB ); + + Exx_Abfs::Lmax = Jle::Lmax; +// for( size_t T=0; T!=abfs_same_atom.size(); ++T ) +// Exx_Abfs::Lmax = std::max( Exx_Abfs::Lmax, static_cast(abfs_same_atom[T].size()) ); + +cout<>>> + &&ms_jys_jys = m_jys_jys.cal_overlap_matrix( index_jys, index_jys ); + +ofs_ms("ms_jys_jys",ms_jys_jys); + + map>>>> + &&ms_lcaos2_jys = m_jyslcaos_lcaos.cal_overlap_matrix( index_jys, index_lcaos, index_lcaos ); + +ofs_ms("ms_lcaos2_jys",ms_lcaos2_jys); + +cout<<"G2"<>>> + &&ms_lcaos2_lcaos2 = mllll.cal_overlap_matrix( index_lcaos, index_lcaos ); + +ofs_ms("ms_lcaos2_lcaos2",ms_lcaos2_lcaos2); + +cout<<"G3"<>>>> +// &&ms_lcaos2_asa = m_asalcaos_lcaos.cal_overlap_matrix( index_asa, index_lcaos, index_lcaos ); + +//ofs_ms("ms_lcaos2_asa",ms_lcaos2_asa); + +cout<<"G4"<>>> +// &&ms_asa_asa = m_asa_asa.cal_overlap_matrix( index_asa, index_asa ); + +//ofs_ms("ms_asa_asa",ms_asa_asa); + +cout<<"G5"<>>>>> +// &&ms_asa_asa_I = cal_I( ms_asa_asa, index_asa ); + +//ofs_ms("ms_asa_asa_I",ms_asa_asa_I); + +cout<<"G6"<>>> +// &&ms_asa_jys = m_asa_jys.cal_overlap_matrix( index_asa, index_jys ); + +//ofs_ms("ms_asa_jys",ms_asa_jys); + +// const map>>> +// &&ms_lcaos2_lcaos2_proj_asa = cal_lcaos2_lcaos2_proj_asa( ms_lcaos2_asa, ms_asa_asa_I, range_lcaos, index_lcaos ); + +//ofs_ms("ms_lcaos2_lcaos2_proj_asa",ms_lcaos2_lcaos2_proj_asa); + +// const map>>>> +// &&ms_lcaos2_jys_proj_asa = cal_lcaos2_jys_proj_asa( ms_lcaos2_asa, ms_asa_asa_I, ms_asa_jys ); + +//ofs_ms("ms_lcaos2_jys_proj_asa",ms_lcaos2_jys_proj_asa); + +cout<<"G7"< +// minus_matrix = []( matrix &mA, const matrix &mB ){ mA-=mB; }; +// // ms_lcaos2_lcaos2 -= ms_lcaos2_lcaos2_proj_asa +// FUNC_EACH_2( ms_lcaos2_lcaos2, ms_lcaos2_lcaos2_proj_asa, minus_matrix ); +// // ms_lcaos2_jys -= ms_lcaos2_jys_proj_asa +// FUNC_EACH_2( ms_lcaos2_jys, ms_lcaos2_jys_proj_asa, minus_matrix ); + +//ofs_ms("ms_lcaos2_lcaos2_new",ms_lcaos2_lcaos2); +//ofs_ms("ms_lcaos2_jys_new",ms_lcaos2_jys); + +cout<<"H"<files_abfs) +// cout<>> + &&lcaos = Construct_Orbs::change_orbs( ORB, this->kmesh_times ); + const vector>> + &&abfs_same_atom = Construct_Orbs::abfs_same_atom( lcaos, this->kmesh_times ); + // Peize Lin test +// vector>> +// &&abfs_same_atom = IO::Abfs_Same_Atom::construct( ORB ); +// for( size_t T=0; T!=abfs_same_atom.size(); ++T ) +// if( abfs_same_atom[T].size()>4 ) +// abfs_same_atom[T].resize(4); + +const Element_Basis_Index::Range + &&range_asa = Abfs_Index::construct_range( abfs_same_atom ); +cout<>> +// &&abfs = IO::construct_abfs( ORB, this->files_abfs, this->kmesh_times ); // Peize Lin test +// &&abfs = IO::construct_abfs( abfs_same_atom, ORB, this->files_abfs, this->kmesh_times ); // Peize Lin test + &abfs = abfs_same_atom; + + for( size_t T=0; T!=abfs.size(); ++T ) + this->Lmax = std::max( this->Lmax, static_cast(abfs[T].size())-1 ); + +cout<kmesh_times); +cout<<"D12"<kmesh_times); +cout<<"D22"<>>> + &&ms_lcaos2_lcaos2 = mllll.cal_overlap_matrix( index_lcaos, index_lcaos ); + +ofs_ms("ms_lcaos2_lcaos2",ms_lcaos2_lcaos2); + +cout<<"G3"<>>>> + &&ms_lcaos2_abfs = m_abfslcaos_lcaos.cal_overlap_matrix( index_abfs, index_lcaos, index_lcaos ); + +ofs_ms("ms_lcaos2_abfs",ms_lcaos2_abfs); + +cout<<"G4"<>>> + &&ms_abfs_abfs = m_abfs_abfs.cal_overlap_matrix( index_abfs, index_abfs ); + +ofs_ms("ms_abfs_abfs",ms_abfs_abfs); + +cout<<"G5"<>>>>> + &&ms_abfs_abfs_I = cal_I( ms_abfs_abfs, index_abfs ); + +ofs_ms("ms_abfs_abfs_I",ms_abfs_abfs_I); + +cout<<"G6"<>>> + &&ms_lcaos2_lcaos2_proj_abfs = cal_lcaos2_lcaos2_proj_asa( ms_lcaos2_abfs, ms_abfs_abfs_I, range_lcaos, index_lcaos ); + +ofs_ms("ms_lcaos2_lcaos2_proj_abfs",ms_lcaos2_lcaos2_proj_abfs); + +cout<<"G7"< + minus_matrix = []( matrix &mA, const matrix &mB ){ mA-=mB; }; + // ms_lcaos2_lcaos2 -= ms_lcaos2_lcaos2_proj_asa + FUNC_EACH_2( ms_lcaos2_lcaos2, ms_lcaos2_lcaos2_proj_abfs, minus_matrix ); + +ofs_ms("ms_lcaos2_lcaos2_new",ms_lcaos2_lcaos2); + +cout<<"H"<>> + &&lcaos = Construct_Orbs::change_orbs( ORB, this->kmesh_times ); +// &&lcaos = Construct_Orbs::change_orbs( ORB, 1 ); + +cout<<"A1"<>> + &&abfs_same_atom = Construct_Orbs::abfs_same_atom( lcaos, this->kmesh_times ); +cout<<"A2"<>> +// &&abfs_origin = IO::construct_abfs( abfs_same_atom, ORB, this->files_abfs, this->kmesh_times ); // Peize Lin test +// &&abfs = IO::construct_abfs( ORB, this->files_abfs, this->kmesh_times ); // Peize Lin test +cout<<"A3"<>> +// &&abfs = Construct_Orbs::orth_orbs( abfs_origin ); // Peize Lin test + &&abfs = Construct_Orbs::orth_orbs( abfs_same_atom ); // Peize Lin test +cout<<"A4"<>> abfs_ccp; + Conv_Coulomb_Pot::cal_orbs_ccp( abfs, abfs_ccp, this->rmesh_times, 1 ); + + for( size_t T=0; T!=abfs.size(); ++T ) + this->Lmax = std::max( this->Lmax, static_cast(abfs[T].size())-1 ); + +cout<<"B"<>>> + &&matrix_V = m_lcaos_lcaos.cal_overlap_matrix(index_lcaos,index_lcaos); + + ofstream ofs("S_matrix.dat"); + for( const auto & m1 : matrix_V ) + { + const size_t TA = m1.first; + for( const auto & m2 : m1.second ) + { + const size_t IA = m2.first; + for( const auto & m3 : m2.second ) + { + const size_t TB = m3.first; + for( const auto & m4 : m3.second ) + { + const size_t IB = m4.first; + ofs<kmesh_times); + m_lcaos_lcaos.init_radial( lcaos, lcaos ); + m_lcaos_lcaos.init_radial_table(); + const map>>> + &&matrix_V = m_lcaos_lcaos.cal_overlap_matrix(index_lcaos,index_lcaos); + + ofstream ofs("S_matrix.dat"); + for( const auto & m1 : matrix_V ) + { + const size_t TA = m1.first; + for( const auto & m2 : m1.second ) + { + const size_t IA = m2.first; + for( const auto & m3 : m2.second ) + { + const size_t TB = m3.first; + for( const auto & m4 : m3.second ) + { + const size_t IB = m4.first; + ofs< m_ll2_ll2; +cout<<"D0"<kmesh_times, this->rmesh_times ); +cout<<"D1"<>>> + &&ms_ll2_ll2 = m_ll2_ll2.cal_overlap_matrix(index_lcaos,index_lcaos); +cout<<"D4"<kmesh_times, this->rmesh_times ); +cout<<"D2"<kmesh_times, this->rmesh_times ); + m_abfslcaos_lcaos.init_radial( abfs_ccp, lcaos, lcaos ); + m_abfslcaos_lcaos.init_radial_table(); + +cout<<"F"<>>> + &&ms_abfs_abfs = m_abfs_abfs.cal_overlap_matrix( index_abfs, index_abfs ); +ofs_ms("ms_abfs_abfs",ms_abfs_abfs); + + const map>>>> + &&ms_lcaos2_abfs = m_abfslcaos_lcaos.cal_overlap_matrix( index_abfs, index_lcaos, index_lcaos ); +ofs_ms("ms_lcaos2_abfs",ms_lcaos2_abfs); + +cout<<"G"<>>>>> + &&ms_abfs_abfs_I = cal_I( ms_abfs_abfs, index_abfs ); +ofs_ms("ms_abfs_abfs_I",ms_abfs_abfs_I); + +cout<<"G1"<>>>> + &&ms_C = cal_C( ms_lcaos2_abfs, ms_abfs_abfs_I ); +ofs_ms("ms_C",ms_C); + +cout<<"H"< .I +// & +// +// .I +map>>>>> Exx_Abfs::cal_I( + const map>>> &ms, + const Element_Basis_Index::IndexLNM &index ) +{ + map>>>>> ms_I; + + for( const auto &m1 : ms ) + { + const size_t TA = m1.first; + for( const auto &m2 : m1.second ) + { + const size_t IA = m2.first; + for( const auto &m3 : m2.second ) + { + const size_t TB = m3.first; + for( const auto &m4 : m3.second ) + { + const size_t IB = m4.first; + + Inverse_Matrix_Double ms_tmp; + + if( TA==TB && IA==IB ) + { + const size_t size_A = index[TA].count_size; + + ms_tmp.init( size_A ); + ms_tmp.input( + ms.at(TA).at(IA).at(TA).at(IA) ); + } + else + { + const size_t size_A = index[TA].count_size; + const size_t size_B = index[TB].count_size; + + ms_tmp.init( size_A + size_B ); + ms_tmp.input( + ms.at(TA).at(IA).at(TA).at(IA), + ms.at(TA).at(IA).at(TB).at(IB), + ms.at(TB).at(IB).at(TA).at(IA), + ms.at(TB).at(IB).at(TB).at(IB)); + } + + // Peize Lin test +// cout<(1) ); + ms_I[TA][IA][TB][IB][0][0].create( size_A, size_A ); + + ms_tmp.output( + ms_I[TA][IA][TB][IB][0][0]); + } + else + { + const size_t size_A = index[TA].count_size; + const size_t size_B = index[TB].count_size; + + ms_I[TA][IA][TB][IB].resize( 2, vector(2) ); + ms_I[TA][IA][TB][IB][0][0].create( size_A, size_A ); + ms_I[TA][IA][TB][IB][0][1].create( size_A, size_B ); + ms_I[TA][IA][TB][IB][1][0].create( size_B, size_A ); + ms_I[TA][IA][TB][IB][1][1].create( size_B, size_B ); + + ms_tmp.output( + ms_I[TA][IA][TB][IB][0][0], + ms_I[TA][IA][TB][IB][0][1], + ms_I[TA][IA][TB][IB][1][0], + ms_I[TA][IA][TB][IB][1][1]); + } + } + } + } + } + return ms_I; +} + +// * .I +map>>>> Exx_Abfs::cal_C( + const map>>>> &ms_lcaos2_abfs, + const map>>>>> &ms_abfs_abfs_I ) +{ + map>>>> ms_C; + + for( const auto & m1 : ms_lcaos2_abfs ) + { + const size_t TA = m1.first; + for( const auto & m2 : m1.second ) + { + const size_t IA = m2.first; + for( const auto &m3 : m2.second ) + { + const size_t TB = m3.first; + for( const auto &m4 : m3.second ) + { + const size_t IB = m4.first; + + if( TA==TB && IA==IB ) + { + ms_C[TA][IA][TB][IB].resize(1); + ms_C[TA][IA][TB][IB][0].create( m4.second[0].nr, m4.second[0].nc ); + + const auto &m_lcaos2_abfs = m4.second; + const auto &m_abfs_abfs_I = ms_abfs_abfs_I.at(TA).at(IA).at(TB).at(IB); + + ms_C[TA][IA][TB][IB][0] = m_lcaos2_abfs[0] * m_abfs_abfs_I[0][0]; + } + else + { + ms_C[TA][IA][TB][IB].resize(2); + for( size_t i=0; i<2; ++i ) + ms_C[TA][IA][TB][IB][i].create( m4.second[i].nr, m4.second[i].nc ); + + const auto &m_lcaos2_abfs = m4.second; + const auto &m_abfs_abfs_I = ms_abfs_abfs_I.at(TA).at(IA).at(TB).at(IB); + ms_C[TA][IA][TB][IB][0] = m_lcaos2_abfs[0] * m_abfs_abfs_I[0][0] + + m_lcaos2_abfs[1] * m_abfs_abfs_I[1][0]; + ms_C[TA][IA][TB][IB][1] = m_lcaos2_abfs[0] * m_abfs_abfs_I[0][1] + + m_lcaos2_abfs[1] * m_abfs_abfs_I[1][1]; + } + } + } + } + } + return ms_C; +} + +// (*.I) * * (.I*) +void Exx_Abfs::cal_CVC( + const map>>>> &ms_C, + const map>>> &ms_abfs_abfs ) const +{ + ofstream ofs("ms_CVC"); + + for( const auto & m11 : ms_C ) + { + const size_t TA = m11.first; + for( const auto & m12 : m11.second ) + { + const size_t IA = m12.first; + for( const auto & m13 : m12.second ) + { + const size_t TB = m13.first; + for( const auto & m14 : m13.second ) + { + const size_t IB = m14.first; + for( const auto & m21 : ms_C ) + { + const size_t TC = m21.first; + for( const auto & m22 : m21.second ) + { + const size_t IC = m22.first; + for( const auto & m23 : m22.second ) + { + const size_t TD = m23.first; + for( const auto & m24 : m23.second ) + { + const size_t ID = m24.first; + + auto m_00 = [&](){ return m14.second[0] * ms_abfs_abfs.at(TA).at(IA).at(TC).at(IC) * transpose(m24.second[0]); }; + auto m_01 = [&](){ return m14.second[0] * ms_abfs_abfs.at(TA).at(IA).at(TD).at(ID) * transpose(m24.second[1]); }; + auto m_10 = [&](){ return m14.second[1] * ms_abfs_abfs.at(TB).at(IB).at(TC).at(IC) * transpose(m24.second[0]); }; + auto m_11 = [&](){ return m14.second[1] * ms_abfs_abfs.at(TB).at(IB).at(TD).at(ID) * transpose(m24.second[1]); }; + + //matrix_CVC[TA][IA][TB][IB]|[TC][IC][TD][ID] = + matrix mm; // Peize Lin test + + if( TA==TB && IA==IB ) + { + if( TC==TD && IC==ID ) + { + mm = m_00(); + } + else + { + mm = m_00()+m_01(); + } + } + else + { + if( TC==TD && IC==ID ) + { + mm = m_00()+m_10(); + } + else + { + mm = m_00()+m_01()+m_10()+m_11(); + } + } + + // Peize Lin test + ofs< * .I * +map>>> Exx_Abfs::cal_lcaos2_lcaos2_proj_asa( + const map>>>> &ms_lcaos2_asa, + const map>>>>> &ms_asa_asa_I, + const Element_Basis_Index::Range &range, + const Element_Basis_Index::IndexLNM &index) +{ + map>>> ms_lcaos2_lcaos2_proj_asa; + for( const auto &m1 : ms_lcaos2_asa ) + { + const size_t TA = m1.first; + for( const auto & m2 : m1.second ) + { + const size_t IA = m2.first; + for( const auto & m3 : m2.second ) + { + const size_t TB = m3.first; + for( const auto & m4 : m3.second ) + { + const size_t IB = m4.first; + const auto & m_lcaos2_asa = m4.second; + const auto & m_abfs_abfs_I = ms_asa_asa_I.at(TA).at(IA).at(TB).at(IB); + + vector mql(2); + size_t matrix_num; + if( TA==TB && IA==IB ) + { + matrix_num = 1; + mql[0] = m_lcaos2_asa[0] * m_abfs_abfs_I[0][0]; + } + else + { + matrix_num = 2; + mql[0] = m_lcaos2_asa[0] * m_abfs_abfs_I[0][0] + m_lcaos2_asa[1] * m_abfs_abfs_I[1][0]; + mql[1] = m_lcaos2_asa[0] * m_abfs_abfs_I[0][1] + m_lcaos2_asa[1] * m_abfs_abfs_I[1][1]; + } + + ms_lcaos2_lcaos2_proj_asa[TA][IA][TB][IB].create( + index[TA].count_size, + index[TB].count_size ); + for( size_t LA=0; LA!=range[TA].size(); ++LA ) + for( size_t NA=0; NA!=range[TA][LA].N; ++NA ) + for( size_t MA=0; MA!=range[TA][LA].M; ++MA ) + for( size_t LB=0; LB!=range[TB].size(); ++LB ) + for( size_t NB=0; NB!=range[TB][LB].N; ++NB ) + for( size_t MB=0; MB!=range[TB][LB].M; ++MB ) + { + double mv_sas = 0.0; + for( size_t im=0; im!=matrix_num; ++im ) + { + assert( mql[im].nc==m_lcaos2_asa[im].nc ); + for( size_t ic=0; ic!=mql[im].nc; ++ic ) + { + mv_sas + += mql[im]( + Exx_Abfs::Abfs_Index::get_index_index( + index,TA,LA,NA,MA, + index,TB,LB,NB,MB ), + ic) + * m_lcaos2_asa[im]( + Exx_Abfs::Abfs_Index::get_index_index( + index,TA,LA,NA,MA, + index,TB,LB,NB,MB ), + ic); + } + } + ms_lcaos2_lcaos2_proj_asa[TA][IA][TB][IB]( + index[TA][LA][NA][MA], + index[TB][LB][NB][MB] ) + = mv_sas; + } + } + } + } + } + return ms_lcaos2_lcaos2_proj_asa; +} + +// * .I * +map>>>> Exx_Abfs::cal_lcaos2_jys_proj_asa( + const map>>>> &ms_lcaos2_asa, + const map>>>>> &ms_asa_asa_I, + const map>>> &ms_asa_jys) +{ + map>>>> ms_lcaos2_jys_proj_asa; + + for( const auto & m1 : ms_lcaos2_asa ) + { + const size_t TA = m1.first; + for( const auto & m2 : m1.second ) + { + const size_t IA = m2.first; + for( const auto &m3 : m2.second ) + { + const size_t TB = m3.first; + for( const auto &m4 : m3.second ) + { + const size_t IB = m4.first; + + if( TA==TB && IA==IB ) + { + ms_lcaos2_jys_proj_asa[TA][IA][TB][IB].resize(1); + + ms_lcaos2_jys_proj_asa[TA][IA][TB][IB][0] + = ms_lcaos2_asa.at(TA).at(IA).at(TB).at(IB)[0] + * ms_asa_asa_I.at(TA).at(IA).at(TB).at(IB)[0][0] + * ms_asa_jys.at(TA).at(IA).at(TA).at(IA); + } + else + { + vector ms_tmp(2); + for( size_t i=0; i<2; ++i ) + ms_tmp[i] + = ms_lcaos2_asa.at(TA).at(IA).at(TB).at(IB)[0] + * ms_asa_asa_I.at(TA).at(IA).at(TB).at(IB)[0][i] + + ms_lcaos2_asa.at(TA).at(IA).at(TB).at(IB)[1] + * ms_asa_asa_I.at(TA).at(IA).at(TB).at(IB)[1][i]; + + ms_lcaos2_jys_proj_asa[TA][IA][TB][IB].resize(2); + + ms_lcaos2_jys_proj_asa[TA][IA][TB][IB][0] + = ms_tmp[0] + * ms_asa_jys.at(TA).at(IA).at(TA).at(IA) + + ms_tmp[1] + * ms_asa_jys.at(TB).at(IB).at(TA).at(IA); + + ms_lcaos2_jys_proj_asa[TA][IA][TB][IB][1] + = ms_tmp[0] + * ms_asa_jys.at(TA).at(IA).at(TB).at(IB) + + ms_tmp[1] + * ms_asa_jys.at(TB).at(IB).at(TB).at(IB); + } + } + } + } + } + return ms_lcaos2_jys_proj_asa; +} + +/* +void cal_R_supercell() +{ + vector R_supercell; + for( size_t x=0; x!=kv.nmp[0]; ++x) + for( size_t y=0; y!=kv.nmp[1]; ++y ) + for( size_t z=0; z!=kv.nmp[2]; ++z ) + R_supercell.push_back(Vector3_Exx(x,y,z)); +} +*/ +/* +void density_matrix() +{ + vector DM_k(kv.nks); + for( size_t ik=0; ik!=kv.nks; ++ik ) + { + for( size_t ib=0; ib!=NBANDS; ++ib ) + { + for( size_t iw1=0; iw1!=NLOCAL; ++iw1 ) + { + for( size_t iw2=0; iw2!=NLOCAL; ++iw2 ) + { + DM_k[ik](iw1,iw2) += wf.wg(ik,ib) * conj(LOWF.WFC_K[ik][ib][iw1]) * LOWF.WFC_K[ik][ib][iw2]; + } + } + } + } + + vector> DM_R( NSPIN, vector(R_supercell.size()) ); + for( size_t is=0; is!=NSPIN; ++is ) + { + const size_t k_start = (NSPIN==1) ? 0 : ((is==0) ? 0 : (kv.nks/2)); + const size_t k_end = (NSPIN==1) ? kv.nks : ((is==0) ? (kv.nks/2) : kv.nks); + for( size_it iR=0; iR!=R_supercell.size(); ++iR ) + { + for( size_t ik=k_start; ik!=k_end; ++ik ) + { + DM_R[is][iR] += exp(TWO_PI*IMAG_UNIT*dot(kv.kvec_d[ik],R_supercell[iR])) * DM[ik]; + } + } + } +} +*/ diff --git a/ABACUS.develop/source/src_ri/exx_abfs.h b/ABACUS.develop/source/src_ri/exx_abfs.h new file mode 100644 index 0000000000..8a0587268a --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_abfs.h @@ -0,0 +1,77 @@ +#ifndef EXX_ABFS_H +#define EXX_ABFS_H + +#include +using std::vector; +#include +using std::map; +#include + +#include "src_lcao/ORB_atomic_lm.h" +#include "src_global/element_basis_index.h" +#include "src_global/matrix.h" +#include "src_global/vector3.h" + +class Exx_Abfs +{ +public: + + void test_all() const; + void generate_matrix() const; + void test_abfs1() const; + void test_abfs2() const; + void cal_exx() const; + + class Util; + class Abfs_Index; + class Jle; + class Inverse_Matrix_Double; + class IO; + class Construct_Orbs; + class PCA; + class DM; + class Parallel; + class Screen + {public: + class Schwarz; + class Cauchy; + }; + + class Matrix_Orbs11; + class Matrix_Orbs21; + class Matrix_Orbs22; + + class Matrix_Lcaoslcaos_Lcaoslcaos; +// template< typename type_Orb22 > class Matrix_Lcaoslcaos_Lcaoslcaos2; // Peize Lin test + + int rmesh_times = 5; // Peize Lin test + int kmesh_times = 1; // Peize Lin test + static int Lmax; // Peize Lin test + +public: + + static map>>>>> cal_I( + const map>>> &ms, + const Element_Basis_Index::IndexLNM &index ); + + static map>>>> cal_C( + const map>>>> &matrix_A, + const map>>>>> &matrix_L ); + + void cal_CVC( + const map>>>> &matrix_C, + const map>>> &matrix_V ) const; + + static map>>> cal_lcaos2_lcaos2_proj_asa( + const map>>>> &ms_lcaos2_asa, + const map>>>>> &ms_asa_asa_I, + const Element_Basis_Index::Range &range, + const Element_Basis_Index::IndexLNM &index); + + static map>>>> cal_lcaos2_jys_proj_asa( + const map>>>> &ms_lcaos2_asa, + const map>>>>> &ms_asa_asa_I, + const map>>> &ms_asa_jys); +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_lcao.cpp b/ABACUS.develop/source/src_ri/exx_lcao.cpp new file mode 100644 index 0000000000..78f6b55085 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_lcao.cpp @@ -0,0 +1,1777 @@ +#include "exx_lcao.h" + +#include "src_pw/global.h" +#include "src_global/global_function.h" + +#include "conv_coulomb_pot.h" +#include "conv_coulomb_pot-inl.h" +#include "conv_coulomb_pot_k.h" +#include "conv_coulomb_pot_k-template.h" + +#include "abfs-template.h" +#include "exx_abfs.h" +#include "exx_abfs-construct_orbs.h" +#include "exx_abfs-abfs_index.h" +#include "exx_abfs-screen-schwarz.h" +#include "exx_abfs-io.h" +//#include "exx_abfs-io-template.h" +#include "exx_abfs-util.h" +#include "exx_abfs-parallel.h" +#include "exx_abfs-parallel-distribute-htime.h" +#include "exx_abfs-parallel-distribute-kmeans.h" +#include "exx_abfs-parallel-distribute-order.h" + +#include +#include + +// Peize Lin test +#include +#include +#include "src_external/src_test/src_global/element_basis_index-test.h" +#include "src_external/src_test/src_global/matrix-test.h" +#include "src_external/src_test/print_tmp.h" +#include "src_external/src_test/src_global/sph_bessel-unittest.h" +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "src_external/src_test/src_ri/abfs-test.h" +#include "src_lcao/LCAO_nnr.h" + +/* +// m_new( i2*n1+i1, i3 ) = m( i1*n2+i2, i3 ) +static matrix transform ( + const matrix & m, + const size_t n1, const size_t n2, const size_t n3 ) +{ + assert( n1*n2*n3 == m.nr*m.nc ); + const auto length = sizeof(double)*n3; + matrix m_new( n1*n2, n3, false ); + for( size_t i1=0; i1!=n1; ++i1 ) + { + for( size_t i2=0; i2!=n2; ++i2 ) + memcpy( m_new.c+(i2*n1+i1)*n3, m.c+(i1*n2+i2)*n3, length ); + } + return m_new; +} +*/ + + +// Peize Lin test +Exx_Lcao::Exx_Lcao( const Exx_Global::Exx_Info &info_global ) + :kmesh_times(4), + info(info_global) +{ + auto test_gemm = []() + { + auto init_matrix = [](const int nr, const int nc, const double add) -> matrix + { + matrix m(nr,nc); + for(int i=0; i matrix + { + matrix mT(m.nc,m.nr); + for(int ir=0; ir!=m.nr; ++ir) + for(int ic=0; ic!=m.nc; ++ic) + mT(ic,ir) = m(ir,ic); + return mT; + }; + auto print_matrix = [](const matrix &m1,const matrix &m2,const matrix &m3) + { + cout< & v ) + { + ofstream ofs(file); + for( size_t i=0; i!=v.size(); ++i ) + { + ofs<BvK_period( kv.nmp[0], kv.nmp[1], kv.nmp[2] ); + vector> boxes; + for( int x=0; x!=BvK_period.x; ++x ) + { + for( int y=0; y!=BvK_period.y; ++y ) + { + for( int z=0; z!=BvK_period.z; ++z ) + { + boxes.push_back({x,y,z}); + } + } + } + + cout<<"boxes:"<>(boxes[i])<<"\t"; + } + cout<>(boxes[i])) )<<"\t"; + } + cout< x = {1,2,3}; + cout<> y = { {1.1,2.2}, {3.3,-4.4}, {-5.5,-6.6} }; + cout< z = {1,2,3,4,5,6}; + cout<lcaos = Exx_Abfs::Construct_Orbs::change_orbs( ORB, this->kmesh_times ); +ofs_mpi<<"TIME@ Exx_Abfs::Construct_Orbs::change_orbs\t"<>> + abfs_same_atom = Exx_Abfs::Construct_Orbs::abfs_same_atom( lcaos, this->kmesh_times, info.pca_threshold ); // Peize Lin test + if(info.files_abfs.empty()) + { + this->abfs = abfs_same_atom; + } + else + { + this->abfs = Exx_Abfs::IO::construct_abfs( abfs_same_atom, ORB, info.files_abfs, this->kmesh_times ); + } +// this->abfs = Exx_Abfs::Construct_Orbs::orth_orbs( abfs_origin ); // Peize Lin test +ofs_mpi<<"TIME@ Exx_Abfs::Construct_Orbs::abfs\t"<>> &orbs) + { + for(size_t N=0; N!=orbs[0][0].size(); ++N) + { + for(size_t ir=0; ir!=orbs[0][0][N].getNr(); ++ir) + { + cout<>> &orbs) + { + ofstream ofs(file_name); + for( size_t T=0; T!=orbs.size(); ++T ) + { + for( size_t L=0; L!=orbs[T].size(); ++L ) + { + for( size_t N=0; N!=orbs[T][L].size(); ++N ) + { +// ofs<::type>(exx_lcao.info.hybrid_type)<abfs, Conv_Coulomb_Pot_K::Ccp_Type::Ccp, {}, info.ccp_rmesh_times ); break; + case Exx_Global::Hybrid_Type::HSE: + abfs_ccp = Conv_Coulomb_Pot_K::cal_orbs_ccp( this->abfs, Conv_Coulomb_Pot_K::Ccp_Type::Hse, {{"hse_omega",info.hse_omega}}, info.ccp_rmesh_times ); break; + default: + throw domain_error(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); break; + } +ofs_mpi<<"TIME@ Conv_Coulomb_Pot_K::cal_orbs_ccp\t"<>> & orbs, + const int power ) + { + for( size_t i=0; i!=orbs.size(); ++i ) + { + for( size_t j=0; j!=orbs[i].size(); ++j ) + { + for( size_t k=0; k!=orbs[i][j].size(); ++k ) + { + const Numerical_Orbital_Lm & orb = orbs[i][j][k]; + ofstream ofs(file_name+"_"+TO_STRING(i)+"_"+TO_STRING(j)+"_"+TO_STRING(k)); + for( size_t ik=0; ik!=orb.getNk(); ++ik ) + { + ofs<(abfs[T].size())-1 ); + } + +ofs_mpi<<"Exx_Abfs::Lmax:\t"<kmesh_times, (1+info.ccp_rmesh_times)/2.0 ); +ofs_mpi<<"TIME@ m_abfs_abfs.init\t"<kmesh_times, 1 ); +ofs_mpi<<"TIME@ m_abfslcaos_lcaos.init\t"<{kv.nmp[0],kv.nmp[1],kv.nmp[2]}; +ofs_mpi<<"TIME@ Exx_Lcao::init\t"<kmesh_times, 1 ); + m_abfs_abfs.init_radial( abfs, abfs ); + m_abfs_abfs.init_radial_table(); + + Exx_Abfs::Matrix_Orbs21 m_abfslcaos_lcaos; + m_abfslcaos_lcaos.init( 1, this->kmesh_times, 1 ); + m_abfslcaos_lcaos.init_radial( abfs, lcaos, lcaos ); + m_abfslcaos_lcaos.init_radial_table(); + + pthread_rwlock_t rwlock_Cw; pthread_rwlock_init(&rwlock_Cw,NULL); + pthread_rwlock_t rwlock_Vw; pthread_rwlock_init(&rwlock_Vw,NULL); + + map,weak_ptr>>> Cws; + map,weak_ptr>>> Vws; + shared_ptr C = Abfs::DPcal_C( + 0, + 0, + {0,0,0}, + m_abfs_abfs, + m_abfslcaos_lcaos, + index_abfs, + index_lcaos, + 0, + true, + rwlock_Cw, + rwlock_Vw, + Cws, + Vws); + cout<<*C<>> lcaos_ccp; + Conv_Coulomb_Pot::cal_orbs_ccp( lcaos, lcaos_ccp ); + Exx_Abfs::Matrix_Orbs11 m_lcaos_ccp; + m_lcaos_ccp.init(1,1,1); + m_lcaos_ccp.init_radial(lcaos,lcaos_ccp); + m_lcaos_ccp.init_radial_table(); + const matrix m_overlap_coulomb = m_lcaos_ccp.cal_overlap_matrix( 0,0, {0,0,0},{0,0,0}, index_lcaos,index_lcaos ); + + ofstream ofs("matrix_overlap.dat"); + ofs<> &atom_pairs_core) -> set + { + set atom_centres_core; + for( const pair & atom_pair : atom_pairs_core ) + { + atom_centres_core.insert(atom_pair.first); + atom_centres_core.insert(atom_pair.second); + } + return atom_centres_core; + }; + +gettimeofday( &t_start, NULL); + if(atom_pairs_core_origin.empty()) + switch(this->info.distribute_type) + { + case Exx_Lcao::Distribute_Type::Htime: + atom_pairs_core_origin = Exx_Abfs::Parallel::Distribute::Htime::distribute( Born_von_Karman_period, info.ccp_rmesh_times ); break; + case Exx_Lcao::Distribute_Type::Kmeans2: + atom_pairs_core_origin = Exx_Abfs::Parallel::Distribute::Kmeans::distribute_kmeans2( MPI_COMM_WORLD ); break; + case Exx_Lcao::Distribute_Type::Kmeans1: + atom_pairs_core_origin = Exx_Abfs::Parallel::Distribute::Kmeans::distribute_kmeans1( MPI_COMM_WORLD, info.ccp_rmesh_times ); break; + case Exx_Lcao::Distribute_Type::Order: + atom_pairs_core_origin = Exx_Abfs::Parallel::Distribute::Order::distribute( info.ccp_rmesh_times ); break; + default: + throw domain_error(TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); break; + //throw domain_error(TO_STRING(static_cast::type>(info.distribute_type))+"\t"+TO_STRING(__FILE__)+" line "+TO_STRING(__LINE__)); break; + } +ofs_mpi<<"atom_pairs_core_origin\t"< atom_centres_core = cal_atom_centres_core(atom_pairs_core); +ofs_mpi<<"atom_centres_core\t"<DM_para.cal_DM( Born_von_Karman_period, H_atom_pairs_core, info.dm_threshold ); +ofs_mpi<<"TIME@ Exx_Lcao::cal_DM\t"<DM_para.cal_DM_k( Born_von_Karman_period, H_atom_pairs_core, info.dm_threshold ); +ofs_mpi<<"TIME@ Exx_Lcao::cal_DM\t"<DM_para.cal_DM(info.dm_threshold); +ofs_mpi<<"TIME@ Exx_Lcao::cal_DM\t"<,matrix>>>> HexxR = cal_Hexx(); +ofs_mpi<<"TIME@ Exx_Lcao::cal_Hexx\t"<energy = cal_energy(HexxR); +ofs_mpi<<"TIME@ Exx_Lcao::cal_energy\t"< & box2 : atom2.second ) + { + ofs<<"@\t"<,matrix>>>> HexxR; + Hexx_para.Rexx_to_Km2D( HexxR, {pot.start_pot=="file",CHR.out_charge} ); +} + +/* +void Exx_Lcao::cal_Hexx_gamma( const set> &atom_pairs ) +{ + for( const pair & atom_pair : atom_pairs ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + const size_t it1 = ucell.iat2it[iat1]; + const size_t it2 = ucell.iat2it[iat2]; + + const vector adj1s = Abfs::get_adjs( ucell.atoms[it1].tau[ucell.iat2ia[iat2]] ); + const vector adj2s = Abfs::get_adjs( ucell.atoms[it2].tau[ucell.iat2ia[iat2]] ); + for( const Abfs::Atom_Info & atom3 : adj1s ) + { + const size_t iat3 = ucell.itia2iat( atom3.T, atom3.I ); + for( const Abfs::Atom_Info & atom4 : adj2s ) + { + const size_t iat4 = ucell.itia2iat( atom4.T, atom4.I ); + const matrix matrix_1342 = *Cs[iat1][iat3][atom3.box] * *Vps_gamma[iat1][iat2] * *Cs[iat2][iat4][atom4.box]; + + for( size_t iw1=0; iw1!=ucell.atoms[it1].nw; ++iw1 ) + for( size_t iw2=0; iw2!=ucell.atoms[it2].nw; ++iw2 ) + for( size_t iw3=0; iw3!=ucell.atoms[atom3.T].nw; ++iw3 ) + for( size_t iw4=0; iw4!=ucell.atoms[atom4.T].nw; ++iw4 ) + { + const double matrix_element_1342 = matrix_1342( iw1*ucell.atoms[atom3.T].nw+iw3, iw2*ucell.atoms[atom4.T].nw+iw4 ); + for( size_t is=0; is!=NSPIN; ++is ) + { + Hexx_gamma[iat1][iat2][is](iw1,iw2) = matrix_element_1342 * DM_Gamma[iat3][iat4][is](iw3,iw4); + Hexx_gamma[iat1][iat4][is](iw1,iw4) = matrix_element_1342 * DM_Gamma[iat3][iat2][is](iw3,iw2); + Hexx_gamma[iat3][iat2][is](iw3,iw2) = matrix_element_1342 * DM_Gamma[iat1][iat4][is](iw1,iw4); + Hexx_gamma[iat3][iat4][is](iw3,iw4) = matrix_element_1342 * DM_Gamma[iat1][iat2][is](iw1,iw2); + } + } + } + } + } +} +*/ + +double Exx_Lcao::cal_energy( + const vector,matrix>>>> &HexxR ) const +{ + TITLE("Exx_Lcao","cal_energy"); +ofstream ofs_mpi(test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; +gettimeofday( &t_start, NULL); + + double energy = 0; + for( size_t is=0; is!=NSPIN; ++is ) + { + for( const auto & HA : HexxR[is] ) + { + const size_t iat1 = HA.first; + for( const auto & HB : HA.second ) + { + const size_t iat2 = HB.first; + for( const auto & HC : HB.second ) + { + const Abfs::Vector3_Order & box2 = HC.first; + if( const matrix*const DMr_ptr = static_cast(MAP_EXIST( DM_para.DMr[is], iat1, iat2, box2 )) ) + { + const matrix & H = HC.second; + assert(DMr_ptr->nr == H.nr); + assert(DMr_ptr->nc == H.nc); + energy += LapackConnector::dot( H.nr*H.nc, DMr_ptr->c,1, H.c,1 ); + } + } + } + } + } + const map SPIN_multiple = {{1,2}, {2,1}, {4,1}}; // ??? + energy *= SPIN_multiple.at(NSPIN); // ? + energy /= 2; // /2 for Ry + +ofs_mpi<<"TIME@ Exx_Lcao::cal_energy_cal\t"< &atom_centres_core, const vector> &atom_pairs_core ) +{ + TITLE("Exx_Lcao::init_radial_table_ions"); + +ofstream ofs_mpi(test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); +timeval t_start; + + map>> radial_R; + + auto print_atom = [&](ostream &os) + { + os<<"atom_centres_core:"<<"\t"; + for(const auto &a : atom_centres_core) + { + os< tau1 = ucell.atoms[it1].tau[ia1]; + + const map>> adjs = Abfs::get_adjs(iat1); + for( const auto & atom2 : adjs ) + { + const size_t iat2 = atom2.first; + const size_t it2 = ucell.iat2it[iat2]; + const size_t ia2 = ucell.iat2ia[iat2]; + const Vector3 &tau2 = ucell.atoms[it2].tau[ia2]; + for( const Abfs::Vector3_Order &box2 : atom2.second ) + { + const double delta_R = (-tau1+tau2+(box2*ucell.latvec)).norm(); +// const double delta_R = (-tau1+tau2).norm(); + + #if TEST_EXX_LCAO==1 + ofs_C<<-tau1+tau2+(box2*ucell.latvec)<<"\t"<=1 + m_abfslcaos_lcaos.init_radial_table(radial_R); +#else + m_abfslcaos_lcaos.init_radial_table(); +#endif +ofs_mpi<<"TIME@ m_abfslcaos_lcaos.init_radial_table\t"<> Coulomb_potential_boxes = Abfs::get_Coulomb_potential_boxes(info.ccp_rmesh_times); + for( const pair & atom_pair : atom_pairs_core ) + { + const size_t iat1 = atom_pair.first; + const size_t iat2 = atom_pair.second; + const size_t it1 = ucell.iat2it[iat1]; + const size_t ia1 = ucell.iat2ia[iat1]; + const size_t it2 = ucell.iat2it[iat2]; + const size_t ia2 = ucell.iat2ia[iat2]; + const Vector3 &tau1 = ucell.atoms[it1].tau[ia1]; + const Vector3 &tau2 = ucell.atoms[it2].tau[ia2]; + const double Rcut = std::min( ORB.Phi[it1].getRcut()*info.ccp_rmesh_times+ORB.Phi[it2].getRcut(), ORB.Phi[it1].getRcut()+ORB.Phi[it2].getRcut()*info.ccp_rmesh_times ); + + for( const Vector3 &box2 : Coulomb_potential_boxes ) + { + const double delta_R = (-tau1+tau2+(box2*ucell.latvec)).norm(); + + #if TEST_EXX_LCAO==1 + ofs_V<<-tau1+tau2+(box2*ucell.latvec)<<"\t"<=1 + m_abfs_abfs.init_radial_table(radial_R); +#else + m_abfs_abfs.init_radial_table(); +#endif +ofs_mpi<<"TIME@ m_abfs_abfs.init_radial_table\t"<,matrix>>>> Exx_Lcao::cal_Hexx() const +{ + const int mkl_threads = mkl_get_max_threads(); + mkl_set_num_threads(std::max(1UL,mkl_threads/atom_pairs_core.size())); + + vector,matrix>>>> HexxR(NSPIN); + omp_lock_t Hexx_lock; + omp_init_lock(&Hexx_lock); + + #pragma omp parallel + { + // m_new( i2, i1, i3 ) = m( i1, i2, i3 ) + auto transform = []( + const matrix & m, + const size_t n1, const size_t n2, const size_t n3 ) -> matrix + { + assert( n1*n2*n3 == m.nr*m.nc ); + const auto length = sizeof(double)*n3; + const auto n13 = n1*n3; + const double *m_ptr = m.c; + matrix m_new( n1*n2, n3, false ); + for( size_t i1=0; i1!=n1; ++i1 ) + { + double *m_new_ptr = m_new.c+i1*n3; + for( size_t i2=0; i2!=n2; ++i2, m_ptr+=n3, m_new_ptr+=n13 ) + memcpy( m_new_ptr, m_ptr, length ); + } + return m_new; + }; + + // C = alpha * A.? * B.? + auto gemm = []( + const char transA, // A / A.T / A.C + const char transB, // B / B.T / B.C + const int M, // A.?.nr = C.nr + const int N, // B.?.nc = C.nc + const int K, // A.?.nc = B.?.nr + const double alpha, + const matrix & A, + const matrix & B) -> matrix + { + matrix C(M,N,false); + LapackConnector::gemm( + transA, transB, + M, N, K, + alpha, + A.c, (transA=='N')?K:M, + B.c, (transB=='N')?N:K, + 0, + C.c, N ); + return C; + }; + + // insert m_tmp into m_all + auto insert_matrixes = []( + vector,matrix>>>> & m_all, + vector,matrix>>>> & m_tmp) + { + for( size_t is=0; is!=NSPIN; ++is ) + { + for( auto & m_tmp1 : m_tmp[is] ) + { + const size_t iat1 = m_tmp1.first; + for( auto & m_tmp2 : m_tmp1.second ) + { + const size_t iat2 = m_tmp2.first; + for( auto & m_tmp3 : m_tmp2.second ) + { + const Abfs::Vector3_Order & box2 = m_tmp3.first; + if( matrix*const m_all_ptr = static_cast(MAP_EXIST( m_all[is], iat1, iat2, box2 )) ) + { + *m_all_ptr += m_tmp3.second; + } + else + { + m_all[is][iat1][iat2][box2] = std::move(m_tmp3.second); + } + } + } + } + m_tmp[is].clear(); + } + }; + + auto vector_empty = []( const vector,matrix>>>> & v ) -> bool + { + for( const auto &i : v ) + { + if(!i.empty()) return false; + } + return true; + }; + + vector,matrix>>>> HexxR_tmp(NSPIN); + + #pragma omp for + for(size_t i_atom_pair=0; i_atom_pair & box3 = Cp1.first; + const auto & Cp13 = Cp1.second; + + for( const auto & Cp2 : Cp2s.second ) + { + const Abfs::Vector3_Order & box4 = Cp2.first; + const auto & Cp24 = Cp2.second; + + if( schwarz.screen( iat1,iat2,iat3,iat4, box3,box4 ) ) continue; + + for( const auto &Vp : Vps.at(iat1).at(iat2) ) + { + const Abfs::Vector3_Order & box2 = Vp.first; + + const matrix & C_13 = *Cp13, // iw1*iw3, \mu1 + & V = *Vp.second, // \mu1, \mu2 + & C_24 = *Cp24; // iw2*iw4, \mu2 + + const Exx_Abfs::Screen::Cauchy::Info_Step info_step = cauchy.input_info( iat1, iat2, iat3, iat4, box2, box3, box4 ); + int cauchy_postcal; + if(!( cauchy_postcal = cauchy.postcalA( info_step ) )) continue; + + // assert( V.nc==C_24.nc ); + const matrix VC_24 = gemm( // \mu1, iw2*iw4 + 'N', 'T', + index_abfs[it1].count_size, + index_lcaos[it2].count_size * index_lcaos[it4].count_size, + index_abfs[it2].count_size, + 1, V, C_24 ); + const matrix VC_24_T = transform( VC_24, // iw2*\mu1, iw4 + index_abfs[it1].count_size, + index_lcaos[it2].count_size, + index_lcaos[it4].count_size ); + if(!( cauchy_postcal = cauchy.postcalB( info_step, VC_24_T, index_lcaos[it2].count_size, index_abfs[it1].count_size, index_lcaos[it4].count_size, cauchy_postcal ) )) continue; + + const matrix C_13_T = transform( C_13, // iw3*iw1, \mu1 + index_lcaos[it1].count_size, + index_lcaos[it3].count_size, + index_abfs[it1].count_size ); + + for( size_t is=0; is!=NSPIN; ++is ) + { + switch( cauchy_postcal ) // Attention: case and go on calculating + { + case 4: + { + const matrix * const DM_ptr = static_cast(MAP_EXIST( DM_para.DMr[is], iat3, iat4, Abfs::Vector3_Order(box2-box3+box4)%Born_von_Karman_period )); + if( DM_ptr ) + { + const matrix DVC_32 = gemm( // iw3, \mu1*iw2 + 'N', 'T', + index_lcaos[it3].count_size, + index_abfs[it1].count_size * index_lcaos[it2].count_size, + index_lcaos[it4].count_size, + 1, + *DM_ptr, + VC_24 ); + if( cauchy.postcalC( info_step, DVC_32, index_lcaos[it3].count_size, index_abfs[it1].count_size, index_lcaos[it2].count_size, 1 ) ) + { + const matrix Hexx_12 = gemm( // iw1, iw2 + 'N', 'N', + index_lcaos[it1].count_size, + index_lcaos[it2].count_size, + index_lcaos[it3].count_size * index_abfs[it1].count_size, + -2, C_13, DVC_32 ); + if( cauchy.postcalD( Hexx_12 ) ) + { + if(iat1!=iat2) + { + const matrix Hexx_21 = transpose(Hexx_12); + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat2, iat1, Abfs::Vector3_Order(-box2)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_21; + else + HexxR_tmp[is][iat2][iat1][Abfs::Vector3_Order(-box2)%Born_von_Karman_period] = std::move(Hexx_21); + } + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat1, iat2, Abfs::Vector3_Order(box2)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_12; + else + HexxR_tmp[is][iat1][iat2][Abfs::Vector3_Order(box2)%Born_von_Karman_period] = std::move(Hexx_12); + } + } + } + } // end case 4 + case 3: + { + if( const matrix * const DM_ptr = static_cast(MAP_EXIST( DM_para.DMr[is], iat1, iat4, Abfs::Vector3_Order(box2+box4)%Born_von_Karman_period )) ) + { + const matrix DVC_12 = gemm( // iw1, \mu1*iw2 + 'N', 'T', + index_lcaos[it1].count_size, + index_abfs[it1].count_size * index_lcaos[it2].count_size, + index_lcaos[it4].count_size, + 1, + *DM_ptr, + VC_24 ); + if( cauchy.postcalC( info_step, DVC_12, index_lcaos[it1].count_size, index_abfs[it1].count_size, index_lcaos[it2].count_size, 3 ) ) + { + const matrix Hexx_32 = gemm( // iw3, iw2 + 'N', 'N', + index_lcaos[it3].count_size, + index_lcaos[it2].count_size, + index_lcaos[it1].count_size * index_abfs[it1].count_size, + -2, C_13_T, DVC_12 ); + if( cauchy.postcalD( Hexx_32 ) ) + { + if(iat1!=iat2) + { + const matrix Hexx_23 = transpose(Hexx_32); + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat2, iat3, Abfs::Vector3_Order(-box2+box3)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_23; + else + HexxR_tmp[is][iat2][iat3][Abfs::Vector3_Order(-box2+box3)%Born_von_Karman_period] = std::move(Hexx_23); + } + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat3, iat2, Abfs::Vector3_Order(box2-box3)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_32; + else + HexxR_tmp[is][iat3][iat2][Abfs::Vector3_Order(box2-box3)%Born_von_Karman_period] = std::move(Hexx_32); + } + } + } + } // end case 3 + case 2: + { + if( const matrix * const DM_ptr = static_cast(MAP_EXIST( DM_para.DMr[is], iat3, iat2, Abfs::Vector3_Order(box2-box3)%Born_von_Karman_period )) ) + { + const matrix DVC_34 = gemm( // iw3, \mu1*iw4 + 'N', 'N', + index_lcaos[it3].count_size, + index_abfs[it1].count_size * index_lcaos[it4].count_size, + index_lcaos[it2].count_size, + 1, + *DM_ptr, + VC_24_T ); + if( cauchy.postcalC( info_step, DVC_34, index_lcaos[it3].count_size, index_abfs[it1].count_size, index_lcaos[it4].count_size, 1 ) ) + { + const matrix Hexx_14 = gemm( // iw1, iw4 + 'N', 'N', + index_lcaos[it1].count_size, + index_lcaos[it4].count_size, + index_lcaos[it3].count_size * index_abfs[it1].count_size, + -2, C_13, DVC_34 ); + if( cauchy.postcalD( Hexx_14 ) ) + { + if(iat1!=iat2) + { + const matrix Hexx_41 = transpose(Hexx_14); + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat4, iat1, Abfs::Vector3_Order(-box2-box4)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_41; + else + HexxR_tmp[is][iat4][iat1][Abfs::Vector3_Order(-box2-box4)%Born_von_Karman_period] = std::move(Hexx_41); + } + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat1, iat4, Abfs::Vector3_Order(box2+box4)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_14; + else + HexxR_tmp[is][iat1][iat4][Abfs::Vector3_Order(box2+box4)%Born_von_Karman_period] = std::move(Hexx_14); + } + } + } + } // end case 2 + case 1: + { + if( const matrix * const DM_ptr = static_cast(MAP_EXIST( DM_para.DMr[is], iat1, iat2, Abfs::Vector3_Order(box2)%Born_von_Karman_period )) ) + { + const matrix DVC_14 = gemm( // iw1, \mu1*iw4 + 'N', 'N', + index_lcaos[it1].count_size, + index_abfs[it1].count_size * index_lcaos[it4].count_size, + index_lcaos[it2].count_size, + 1, + *DM_ptr, + VC_24_T ); + if( cauchy.postcalC( info_step, DVC_14, index_lcaos[it1].count_size, index_abfs[it1].count_size, index_lcaos[it4].count_size, 3 ) ) + { + const matrix Hexx_34 = gemm( // iw3, iw4 + 'N', 'N', + index_lcaos[it3].count_size, + index_lcaos[it4].count_size, + index_lcaos[it1].count_size * index_abfs[it1].count_size, + -2, C_13_T, DVC_14 ); + if( cauchy.postcalD( Hexx_34 ) ) + { + if(iat1!=iat2) + { + const matrix Hexx_43 = transpose(Hexx_34); + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat4, iat3, Abfs::Vector3_Order(-box2+box3-box4)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_43; + else + HexxR_tmp[is][iat4][iat3][Abfs::Vector3_Order(-box2+box3-box4)%Born_von_Karman_period] = std::move(Hexx_43); + } + if( matrix * const HexxR_ptr = static_cast(MAP_EXIST( HexxR_tmp[is], iat3, iat4, Abfs::Vector3_Order(box2-box3+box4)%Born_von_Karman_period )) ) + *HexxR_ptr += Hexx_34; + else + HexxR_tmp[is][iat3][iat4][Abfs::Vector3_Order(box2-box3+box4)%Born_von_Karman_period] = std::move(Hexx_34); + } + } + } + } // end case 1 + case 0: ; + } // end switch cauchy_postcal + } // end for is + } // end for box2 + } // end for box4 + } // end for box3 + + if( !vector_empty(HexxR_tmp) && omp_test_lock(&Hexx_lock) ) + { + insert_matrixes(HexxR,HexxR_tmp); + omp_unset_lock(&Hexx_lock); + } + } // end for iat4 + } // end for iat3 + } // end omp for i_atom_pair + + if(!vector_empty(HexxR_tmp)) + { + omp_set_lock(&Hexx_lock); + insert_matrixes(HexxR,HexxR_tmp); + omp_unset_lock(&Hexx_lock); + } + } // end omp parallel + + omp_destroy_lock(&Hexx_lock); + mkl_set_num_threads(mkl_threads); + + return HexxR; +} diff --git a/ABACUS.develop/source/src_ri/exx_lcao.h b/ABACUS.develop/source/src_ri/exx_lcao.h new file mode 100644 index 0000000000..509a72269e --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_lcao.h @@ -0,0 +1,119 @@ +#ifndef EXX_LCAO_H +#define EXX_LCAO_H + +#include "src_ri/abfs.h" +#include "src_ri/abfs-vector3_order.h" +#include "src_ri/exx_abfs-matrix_orbs11.h" +#include "src_ri/exx_abfs-matrix_orbs21.h" +#include "src_ri/exx_abfs-dm.h" +#include "src_ri/exx_abfs-parallel-communicate-hexx.h" +#include "src_ri/exx_abfs-screen-schwarz.h" +#include "src_ri/exx_abfs-screen-cauchy.h" +#include "src_global/element_basis_index.h" +#include "src_pw/xc_type.h" +#include "src_pw/exx_global.h" + +#if EXX_DM==1 +#include "src_ri/exx_abfs-parallel-communicate-dm.h" +#elif EXX_DM==2 +#include "src_ri/exx_abfs-parallel-communicate-dm2.h" +#elif EXX_DM==3 +#include "src_ri/exx_abfs-parallel-communicate-dm3.h" +#endif + +#include +#include +#include +#include +#include +#include +#include + +class Exx_Lcao +{ +public: + struct{ string process; string thread; string matrix; } test_dir; // Peize Lin test + Exx_Lcao( const Exx_Global::Exx_Info &info_global ); // Peize Lin test +public: + void init(); + void cal_exx_ions(); + void cal_exx_elec(); + void cal_exx_elec_nscf(); + void add_Hexx(const size_t ik, const double alpha) const; +private: + vector,matrix>>>> cal_Hexx() const; + double cal_energy( + const vector,matrix>>>> &HexxR ) const; + void init_radial_table_ions( const set &atom_centres_core, const vector> &atom_pairs_core ); + +public: + enum class Distribute_Type {Htime,Kmeans2,Kmeans1,Order}; + +public: + double get_energy() const { return energy; } + +private: + + int kmesh_times = 4; // Peize Lin test + +#if EXX_DM==1 + Exx_Abfs::Parallel::Communicate::DM DM_para; +#elif EXX_DM==2 + Exx_Abfs::Parallel::Communicate::DM2 DM_para; +#elif EXX_DM==3 + Exx_Abfs::Parallel::Communicate::DM3 DM_para; +#endif + Exx_Abfs::Parallel::Communicate::Hexx Hexx_para; + double energy = 0.0; + + vector>> lcaos; + vector>> abfs; + vector>> abfs_ccp; + Element_Basis_Index::IndexLNM index_lcaos; + Element_Basis_Index::IndexLNM index_abfs; + + Exx_Abfs::Matrix_Orbs11 m_abfs_abfs; + Exx_Abfs::Matrix_Orbs21 m_abfslcaos_lcaos; + + map,weak_ptr>>> Cws; // Cws[it1][it2][R] + map,weak_ptr>>> Vws; // Vws[it1][it2][R] + map,shared_ptr>>> Cs; // Cs[iat1][iat2][box2] + map,shared_ptr>>> Cps; // Cs[iat1][iat2][box2] + map,shared_ptr>>> Vs; // Vs[iat1][iat2][box2] + map,shared_ptr>>> Vps; // Vps[iat1][iat2][box2] + + vector> atom_pairs_core_origin; + vector> atom_pairs_core; + set> H_atom_pairs_core; + Abfs::Vector3_Order Born_von_Karman_period; + + Exx_Abfs::Screen::Schwarz schwarz; + Exx_Abfs::Screen::Cauchy cauchy; + +public: + struct Exx_Info + { + const Exx_Global::Hybrid_Type &hybrid_type; + + const double &hse_omega; + + double pca_threshold = 0; + vector files_abfs; + double c_threshold = 0; + double v_threshold = 0; + double dm_threshold = 0; + double schwarz_threshold = 0; + double cauchy_threshold = 0; + double ccp_threshold = 0; + double ccp_rmesh_times = 10; + + Exx_Lcao::Distribute_Type distribute_type; + + Exx_Info( const Exx_Global::Exx_Info &info_global ); + }; + Exx_Info info; + + friend class Local_Orbital_Charge; +}; + +#endif // EXX_LCAO_H diff --git a/ABACUS.develop/source/src_ri/exx_opt_orb-print.cpp b/ABACUS.develop/source/src_ri/exx_opt_orb-print.cpp new file mode 100644 index 0000000000..31efc75646 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_opt_orb-print.cpp @@ -0,0 +1,204 @@ +#include "exx_opt_orb.h" +#include "src_pw/global.h" +#include "src_ri/exx_abfs-jle.h" + +void Exx_Opt_Orb::print_matrix( + const string &file_name, + const vector &matrix_Q, + const vector> &matrix_S, + const matrix &matrix_V, + const size_t TA, const size_t IA, const size_t TB, const size_t IB, + const Element_Basis_Index::Range &range_jles, + const Element_Basis_Index::IndexLNM &index_jles) const +{ + auto print_header = [&]( ofstream &ofs ) + { + ofs << ucell.lat0 << endl; + + ofs << ucell.latvec.e11 << " " << ucell.latvec.e12 << " " << ucell.latvec.e13 << endl; + ofs << ucell.latvec.e21 << " " << ucell.latvec.e22 << " " << ucell.latvec.e23 << endl; + ofs << ucell.latvec.e31 << " " << ucell.latvec.e32 << " " << ucell.latvec.e33 << endl; + + if( TA==TB ) + { + ofs << 1 << " ntype" << endl; + ofs << ucell.atoms[TA].label << " label" << endl; + if( IA==IB ) + { + ofs << 1 << " na" << endl; + ofs << ucell.atoms[TA].tau[IA].x << " " + << ucell.atoms[TA].tau[IA].y << " " + << ucell.atoms[TA].tau[IA].z << endl; + } + else + { + ofs << 2 << " na" << endl; + ofs << ucell.atoms[TA].tau[IA].x << " " + << ucell.atoms[TA].tau[IA].y << " " + << ucell.atoms[TA].tau[IA].z << endl; + ofs << ucell.atoms[TB].tau[IB].x << " " + << ucell.atoms[TB].tau[IB].y << " " + << ucell.atoms[TB].tau[IB].z << endl; + } + } + else + { + ofs << 2 << " ntype" << endl; + ofs << ucell.atoms[TA].label << " label" << endl; + ofs << 1 << " na" << endl; + ofs << ucell.atoms[TA].tau[IA].x << " " + << ucell.atoms[TA].tau[IA].y << " " + << ucell.atoms[TA].tau[IA].z << endl; + ofs << ucell.atoms[TB].label << " label" << endl; + ofs << 1 << " na" << endl; + ofs << ucell.atoms[TB].tau[IB].x << " " + << ucell.atoms[TB].tau[IB].y << " " + << ucell.atoms[TB].tau[IB].z << endl; + } + + // ecutwfc_jlq determine the jlq corresponding to plane wave calculation. + ofs << Exx_Abfs::Jle::Ecut_exx << " ecutwfc" << endl; // mohan add 2009-09-08 + + // this parameter determine the total number of jlq. + ofs << Exx_Abfs::Jle::Ecut_exx << " ecutwfc_jlq" << endl;//mohan modify 2009-09-08 + + if(TA==TB) + ofs << ORB.Phi[TA].getRcut() << " rcut_Jlq" << endl; + else + ofs << ORB.Phi[TA].getRcut() << " " << ORB.Phi[TB].getRcut() << " rcut_Jlq" << endl; + + // mohan add 'smooth' and 'sigma' 2009-08-28 + ofs << 0 << " smooth" << endl; + ofs << 0 << " sigma" << endl; + + ofs << Exx_Abfs::Jle::tolerence << " tolerence" << endl; + + ofs << Exx_Abfs::Jle::Lmax << " lmax" << endl; + + ofs << kv.nkstot << " nks" << endl; + assert( matrix_V.nr == matrix_V.nc ); + ofs << matrix_V.nr << " nbands" << endl; + + auto cal_sum_M = [&range_jles](size_t T) -> size_t + { + size_t sum_M = 0; + for( size_t L = 0; L!=range_jles[T].size(); ++L ) + sum_M += range_jles[T][L].M; + return sum_M; + }; + const size_t nwfc = (TA==TB && IA==IB) ? cal_sum_M(TA) : cal_sum_M(TA)+cal_sum_M(TB); + ofs << nwfc << " nwfc" << endl; + + const size_t ecut_numberA = static_cast( sqrt( Exx_Abfs::Jle::Ecut_exx ) * ORB.Phi[TA].getRcut() / PI ); // Rydberg Unit + const size_t ecut_numberB = static_cast( sqrt( Exx_Abfs::Jle::Ecut_exx ) * ORB.Phi[TB].getRcut() / PI ); // Rydberg Unit + if(TA==TB) + ofs << ecut_numberA << " ne" << endl; + else + ofs << ecut_numberA << " " << ecut_numberB << " ne" << endl; + + ofs << "" << endl; + for( int ik=0; ik!=kv.nkstot; ++ik ) + { + ofs << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y << " " << kv.kvec_c[ik].z; + ofs << " " << kv.wk[ik] * 0.5 << endl; + } + ofs << "" << endl; + + ofs << endl; + }; + + + auto print_Q = [&]( ofstream &ofs ) + { + //--------------------- + // < Psi | jY > + //--------------------- + ofs<< "" << std::endl; + + for( size_t ib=0; ib!=matrix_V.nr; ++ib ) + { + for( size_t iat=0; iat!=matrix_Q.size(); ++iat ) + { + const size_t it = (iat==0) ? TA : TB; + for( size_t il=0; il!=range_jles[it].size(); ++il ) + { + for( size_t im=0; im!=range_jles[it][il].M; ++im ) + { + for( size_t iq=0; iq!=range_jles[it][il].N; ++iq ) + { + ofs<" << std::endl << std::endl; + }; + + + auto print_S = [&]( ofstream &ofs, const double scale=1 ) + { + //--------------------- + // < jY | jY > + //--------------------- + ofs<< "" <" << std::endl << std::endl; + }; + + + auto print_V = [&]( ofstream &ofs, const double scale=1 ) + { + //--------------------- + // < Psi | Psi > + //--------------------- + ofs << "" << std::endl; + + for( size_t ib1=0; ib1!=matrix_V.nr; ++ib1 ) + { + for( size_t ib2=0; ib2!=matrix_V.nc; ++ib2 ) + { + ofs<" << std::endl << std::endl; + }; + + ofstream ofs(file_name+"_"+TO_STRING(TA)+"_"+TO_STRING(IA)+"_"+TO_STRING(TB)+"_"+TO_STRING(IB)); + print_header(ofs); + print_Q(ofs); + print_S(ofs); + print_V(ofs); + ofs.close(); +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_opt_orb.cpp b/ABACUS.develop/source/src_ri/exx_opt_orb.cpp new file mode 100644 index 0000000000..a72fa66c0e --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_opt_orb.cpp @@ -0,0 +1,377 @@ +#include "exx_opt_orb.h" +#include "src_pw/global.h" +#include "src_lcao/ORB_atomic_lm.h" +#include "src_ri/exx_abfs.h" +#include "src_ri/exx_abfs-abfs_index.h" +#include "src_ri/exx_abfs-construct_orbs.h" +#include "src_ri/exx_abfs-inverse_matrix_double.h" +#include "src_ri/exx_abfs-jle.h" +#include "src_lcao/ORB_read.h" +#include "src_ri/exx_abfs-matrix_orbs11.h" +#include "src_ri/exx_abfs-matrix_orbs21.h" +#include "src_ri/exx_abfs-matrix_orbs22.h" + +#include "src_external/src_test/src_ri/exx_abfs-unittest.h" +#include "src_external/src_test/src_ri/exx_lcao-test.h" +#include "src_external/src_test/src_global/element_basis_index-test.h" +#include "src_external/src_test/test_function.h" + +void Exx_Opt_Orb::generate_matrix() const +{ +ofstream ofs_mpi(exx_lcao.test_dir.process+"time_"+TO_STRING(MY_RANK),ofstream::app); + + TITLE("Exx_Opt_Orb::generate_matrix"); +ofs_mpi<<"memory:\t"<>> lcaos = Exx_Abfs::Construct_Orbs::change_orbs( ORB, this->kmesh_times ); + + const vector>> abfs = Exx_Abfs::Construct_Orbs::abfs_same_atom( lcaos, this->kmesh_times, exx_lcao.info.pca_threshold ); + +ofs_mpi<<"memory:\t"<kmesh_times ); + +ofs_mpi<<"memory:\t"<(abfs[T].size())-1 ); + + const Element_Basis_Index::Range range_lcaos = Exx_Abfs::Abfs_Index::construct_range( lcaos ); + const Element_Basis_Index::IndexLNM index_lcaos = Element_Basis_Index::construct_index( range_lcaos ); + + const Element_Basis_Index::Range range_abfs = Exx_Abfs::Abfs_Index::construct_range( abfs ); + const Element_Basis_Index::IndexLNM index_abfs = Element_Basis_Index::construct_index( range_abfs ); + + const Element_Basis_Index::Range range_jys = Exx_Abfs::Abfs_Index::construct_range( jle.jle ); + const Element_Basis_Index::IndexLNM index_jys = Element_Basis_Index::construct_index( range_jys ); + +ofs_mpi<>> radial_R = get_radial_R(); +#if TEST_EXX_RADIAL==2 + { + for(const auto & rA : radial_R) + for(const auto & rB : rA.second) + { + ofs_mpi< + const auto ms_lcaoslcaos_lcaoslcaos = [&]() -> map>>> + { + Exx_Abfs::Matrix_Orbs22 m_lcaoslcaos_lcaoslcaos; + m_lcaoslcaos_lcaoslcaos.init( 1, this->kmesh_times, 1 ); + m_lcaoslcaos_lcaoslcaos.init_radial( lcaos, lcaos, lcaos, lcaos ); + #if TEST_EXX_RADIAL>=1 + m_lcaoslcaos_lcaoslcaos.init_radial_table(radial_R); + #else + m_lcaoslcaos_lcaoslcaos.init_radial_table(); + #endif + return m_lcaoslcaos_lcaoslcaos.cal_overlap_matrix( index_lcaos, index_lcaos, index_lcaos, index_lcaos); + }(); + +ofs_mpi<<"memory:\t"< + const auto ms_lcaoslcaos_jys = [&]() -> map>>>> + { + Exx_Abfs::Matrix_Orbs21 m_jyslcaos_lcaos; + m_jyslcaos_lcaos.init( 1, this->kmesh_times, 1 ); + m_jyslcaos_lcaos.init_radial( jle.jle, lcaos, lcaos ); + #if TEST_EXX_RADIAL>=1 + m_jyslcaos_lcaos.init_radial_table(radial_R); + #else + m_jyslcaos_lcaos.init_radial_table(); + #endif + return m_jyslcaos_lcaos.cal_overlap_matrix( index_jys, index_lcaos, index_lcaos ); + }(); + +ofs_mpi<<"memory:\t"< + const auto ms_jys_jys = [&]() -> map>>> + { + Exx_Abfs::Matrix_Orbs11 m_jys_jys; + m_jys_jys.init( 2, this->kmesh_times, 1 ); + m_jys_jys.init_radial( jle.jle, jle.jle ); + #if TEST_EXX_RADIAL>=1 + m_jys_jys.init_radial_table(radial_R); + #else + m_jys_jys.init_radial_table(); + #endif + return m_jys_jys.cal_overlap_matrix( index_jys, index_jys ); + }(); + +ofs_mpi<<"memory:\t"< + const auto ms_abfs_abfs = [&]() -> map>>> + { + Exx_Abfs::Matrix_Orbs11 m_abfs_abfs; + m_abfs_abfs.init( 2, this->kmesh_times, 1 ); + m_abfs_abfs.init_radial( abfs, abfs ); + #if TEST_EXX_RADIAL>=1 + m_abfs_abfs.init_radial_table(radial_R); + #else + m_abfs_abfs.init_radial_table(); + #endif + return m_abfs_abfs.cal_overlap_matrix( index_abfs, index_abfs ); + }(); + +ofs_mpi<<"memory:\t"< + const auto ms_lcaoslcaos_abfs = [&]() -> map>>>> + { + Exx_Abfs::Matrix_Orbs21 m_abfslcaos_lcaos; + m_abfslcaos_lcaos.init( 1, this->kmesh_times, 1 ); + m_abfslcaos_lcaos.init_radial( abfs, lcaos, lcaos ); + #if TEST_EXX_RADIAL>=1 + m_abfslcaos_lcaos.init_radial_table(radial_R); + #else + m_abfslcaos_lcaos.init_radial_table(); + #endif + return m_abfslcaos_lcaos.cal_overlap_matrix( index_abfs, index_lcaos, index_lcaos ); + }(); + +ofs_mpi<<"memory:\t"< + const auto ms_jys_abfs = [&]() -> map>>> + { + Exx_Abfs::Matrix_Orbs11 m_jys_abfs; + m_jys_abfs.init( 2, this->kmesh_times, 1 ); + m_jys_abfs.init_radial( jle.jle, abfs ); + #if TEST_EXX_RADIAL>=1 + m_jys_abfs.init_radial_table(radial_R); + #else + m_jys_abfs.init_radial_table(); + #endif + return m_jys_abfs.cal_overlap_matrix( index_jys, index_abfs ); + }(); + +ofs_mpi<<"memory:\t"<.I + const vector> ms_abfs_abfs_I = cal_I( ms_abfs_abfs, T,I,T,I ); + // < lcaos lcaos | lcaos lcaos > - < lcaos lcaos | abfs > * < abfs | abfs >.I * < abfs | lcaos lcaos > + const matrix m_lcaoslcaos_lcaoslcaos_proj = + cal_proj( + ms_lcaoslcaos_lcaoslcaos.at(T).at(I).at(T).at(I), + ms_lcaoslcaos_abfs.at(T).at(I).at(T).at(I), + ms_abfs_abfs_I, + ms_lcaoslcaos_abfs.at(T).at(I).at(T).at(I)); + // < lcaos lcaos | jys > - < lcaos lcaos | abfs > * < abfs | abfs >.I * < abfs | jys > + const vector m_lcaoslcaos_jys_proj = + {cal_proj( + ms_lcaoslcaos_jys.at(T).at(I).at(T).at(I)[0], + ms_lcaoslcaos_abfs.at(T).at(I).at(T).at(I), + ms_abfs_abfs_I, + {ms_jys_abfs.at(T).at(I).at(T).at(I)})}; + // < jys | jys > - < jys | abfs > * < abfs | abfs >.I * < abfs | jys > + const vector> m_jys_jys_proj = + {{cal_proj( + ms_jys_jys.at(T).at(I).at(T).at(I), + {ms_jys_abfs.at(T).at(I).at(T).at(I)}, + ms_abfs_abfs_I, + {ms_jys_abfs.at(T).at(I).at(T).at(I)})}}; + print_matrix( + "matrix", + m_lcaoslcaos_jys_proj, + m_jys_jys_proj, + m_lcaoslcaos_lcaoslcaos_proj, + TA, IA, TB, IB, + range_jys, index_jys ); + } + else + { + print_matrix( + "matrix", + ms_lcaoslcaos_jys.at(T).at(I).at(T).at(I), + {{ms_jys_jys.at(T).at(I).at(T).at(I)}}, + ms_lcaoslcaos_lcaoslcaos.at(T).at(I).at(T).at(I), + TA, IA, TB, IB, + range_jys, index_jys ); + } + } + else + { + if(exx_lcao.info.pca_threshold<=1) + { + // < abfs | abfs >.I + const vector> ms_abfs_abfs_I = cal_I( ms_abfs_abfs, TA,IA,TB,IB ); + // < lcaos lcaos | lcaos lcaos > - < lcaos lcaos | abfs > * < abfs | abfs >.I * < abfs | lcaos lcaos > + const matrix m_lcaoslcaos_lcaoslcaos_proj = + cal_proj( + ms_lcaoslcaos_lcaoslcaos.at(TA).at(IA).at(TB).at(IB), + ms_lcaoslcaos_abfs.at(TA).at(IA).at(TB).at(IB), + ms_abfs_abfs_I, + ms_lcaoslcaos_abfs.at(TA).at(IA).at(TB).at(IB)); + // < lcaos lcaos | jys > - < lcaos lcaos | abfs > * < abfs | abfs >.I * < abfs | jys > + const vector m_lcaoslcaos_jys_proj = + {cal_proj( + ms_lcaoslcaos_jys.at(TA).at(IA).at(TB).at(IB)[0], + ms_lcaoslcaos_abfs.at(TA).at(IA).at(TB).at(IB), + ms_abfs_abfs_I, + { ms_jys_abfs.at(TA).at(IA).at(TA).at(IA), ms_jys_abfs.at(TA).at(IA).at(TB).at(IB) }), + cal_proj( + ms_lcaoslcaos_jys.at(TA).at(IA).at(TB).at(IB)[1], + ms_lcaoslcaos_abfs.at(TA).at(IA).at(TB).at(IB), + ms_abfs_abfs_I, + { ms_jys_abfs.at(TB).at(IB).at(TA).at(IA), ms_jys_abfs.at(TB).at(IB).at(TB).at(IB) })}; + // < jys | jys > - < jys | abfs > * < abfs | abfs >.I * < abfs | jys > + const vector> m_jys_jys_proj = + {{cal_proj( + ms_jys_jys.at(TA).at(IA).at(TA).at(IA), + { ms_jys_abfs.at(TA).at(IA).at(TA).at(IA), ms_jys_abfs.at(TA).at(IA).at(TB).at(IB) }, + ms_abfs_abfs_I, + { ms_jys_abfs.at(TA).at(IA).at(TA).at(IA), ms_jys_abfs.at(TA).at(IA).at(TB).at(IB) }), + cal_proj( + ms_jys_jys.at(TA).at(IA).at(TB).at(IB), + { ms_jys_abfs.at(TA).at(IA).at(TA).at(IA), ms_jys_abfs.at(TA).at(IA).at(TB).at(IB) }, + ms_abfs_abfs_I, + { ms_jys_abfs.at(TB).at(IB).at(TA).at(IA), ms_jys_abfs.at(TB).at(IB).at(TB).at(IB) }) }, + {cal_proj( + ms_jys_jys.at(TB).at(IB).at(TA).at(IA), + { ms_jys_abfs.at(TB).at(IB).at(TA).at(IA), ms_jys_abfs.at(TB).at(IB).at(TB).at(IB) }, + ms_abfs_abfs_I, + { ms_jys_abfs.at(TA).at(IA).at(TA).at(IA), ms_jys_abfs.at(TA).at(IA).at(TB).at(IB) }), + cal_proj( + ms_jys_jys.at(TB).at(IB).at(TB).at(IB), + { ms_jys_abfs.at(TB).at(IB).at(TA).at(IA), ms_jys_abfs.at(TB).at(IB).at(TB).at(IB) }, + ms_abfs_abfs_I, + { ms_jys_abfs.at(TB).at(IB).at(TA).at(IA), ms_jys_abfs.at(TB).at(IB).at(TB).at(IB) }) }}; + print_matrix( + "matrix", + m_lcaoslcaos_jys_proj, + m_jys_jys_proj, + m_lcaoslcaos_lcaoslcaos_proj, + TA, IA, TB, IB, + range_jys, index_jys ); + } + else + { + print_matrix( + "matrix", + ms_lcaoslcaos_jys.at(TA).at(IA).at(TB).at(IB), + {{ms_jys_jys.at(TA).at(IA).at(TA).at(IA), ms_jys_jys.at(TA).at(IA).at(TB).at(IB)}, + {ms_jys_jys.at(TB).at(IB).at(TA).at(IA), ms_jys_jys.at(TB).at(IB).at(TB).at(IB)}}, + ms_lcaoslcaos_lcaoslcaos.at(TA).at(IA).at(TB).at(IB), + TA, IA, TB, IB, + range_jys, index_jys ); + } + } + } + } + } + } +} + +// m_big - m_left * m_middle * m_right.T +matrix Exx_Opt_Orb::cal_proj( + const matrix & m_big, + const vector & m_left, + const vector> & m_middle, + const vector & m_right ) const +{ + TITLE("Exx_Opt_Orb::cal_proj"); + +//auto print_nrc = [](const matrix & m){ cout<<"\t"<> Exx_Opt_Orb::cal_I( + const map>>> &ms, + const size_t TA, const size_t IA, const size_t TB, const size_t IB ) const +{ + TITLE("Exx_Opt_Orb::cal_I"); + + if( TA==TB && IA==IB ) + { + vector> m_I + {{ {ms.at(TA).at(IA).at(TA).at(IA).nr, ms.at(TA).at(IA).at(TA).at(IA).nc} }}; + Exx_Abfs::Inverse_Matrix_Double inv; + inv.init( ms.at(TA).at(IA).at(TA).at(IA).nr ); + inv.input( ms.at(TA).at(IA).at(TA).at(IA) ); + inv.cal_inverse( Exx_Abfs::Inverse_Matrix_Double::Method::dsyev ); + inv.output( m_I[0][0] ); + return m_I; + } + else + { + vector> m_I + {{ {ms.at(TA).at(IA).at(TA).at(IA).nr, ms.at(TA).at(IA).at(TA).at(IA).nc}, + {ms.at(TA).at(IA).at(TB).at(IB).nr, ms.at(TA).at(IA).at(TB).at(IB).nc} }, + { {ms.at(TB).at(IB).at(TA).at(IA).nr, ms.at(TB).at(IB).at(TA).at(IA).nc}, + {ms.at(TB).at(IB).at(TB).at(IB).nr, ms.at(TB).at(IB).at(TB).at(IB).nc} }}; + Exx_Abfs::Inverse_Matrix_Double inv; + inv.init( ms.at(TA).at(IA).at(TA).at(IA).nr + ms.at(TB).at(IB).at(TA).at(IA).nr ); + inv.input( ms.at(TA).at(IA).at(TA).at(IA), ms.at(TA).at(IA).at(TB).at(IB), ms.at(TB).at(IB).at(TA).at(IA), ms.at(TB).at(IB).at(TB).at(IB) ); + inv.cal_inverse( Exx_Abfs::Inverse_Matrix_Double::Method::dsyev ); + inv.output( m_I[0][0], m_I[0][1], m_I[1][0], m_I[1][1] ); + return m_I; + } +} + +map>> Exx_Opt_Orb::get_radial_R() const +{ + TITLE("Exx_Opt_Orb::get_radial_R"); + map>> radial_R; + for( size_t TA=0; TA!=ucell.ntype; ++TA ) + for( size_t IA=0; IA!=ucell.atoms[TA].na; ++IA ) + for( size_t TB=0; TB!=ucell.ntype; ++TB ) + for( size_t IB=0; IB!=ucell.atoms[TB].na; ++IB ) + { + const Vector3 &tauA = ucell.atoms[TA].tau[IA]; + const Vector3 &tauB = ucell.atoms[TB].tau[IB]; + const double delta_R = (-tauA+tauB).norm(); + radial_R[TA][TB].insert( delta_R ); + radial_R[TB][TA].insert( delta_R ); + } + return radial_R; +} \ No newline at end of file diff --git a/ABACUS.develop/source/src_ri/exx_opt_orb.h b/ABACUS.develop/source/src_ri/exx_opt_orb.h new file mode 100644 index 0000000000..2e56e8bfe2 --- /dev/null +++ b/ABACUS.develop/source/src_ri/exx_opt_orb.h @@ -0,0 +1,37 @@ +#ifndef EXX_OPT_ORB_H +#define EXX_OPT_ORB_H + +#include "src_global/matrix.h" +#include "src_global/element_basis_index.h" +#include +#include +#include +using namespace std; + +class Exx_Opt_Orb +{ +public: + void generate_matrix() const; +private: + vector> cal_I( + const map>>> &ms, + const size_t TA, const size_t IA, const size_t TB, const size_t IB ) const; + matrix cal_proj( + const matrix & m_big, + const vector & m_left, + const vector> & m_middle, + const vector & m_right ) const; + void print_matrix( + const string &file_name, + const vector &matrix_Q, + const vector> &matrix_S, + const matrix &matrix_V, + const size_t TA, const size_t IA, const size_t TB, const size_t IB, + const Element_Basis_Index::Range &range_jles, + const Element_Basis_Index::IndexLNM &index_jles) const; + map>> get_radial_R() const; + + int kmesh_times = 4; +}; + +#endif \ No newline at end of file diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/__init__.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 465aaf6213..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/func_C.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/func_C.cpython-36.pyc deleted file mode 100644 index 2a8638f246..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/func_C.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/print_QSV.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/print_QSV.cpython-36.pyc deleted file mode 100644 index cb169d6c16..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/print_QSV.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/print_orbital.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/print_orbital.cpython-36.pyc deleted file mode 100644 index 657d955f01..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/print_orbital.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/read_QSV.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/read_QSV.cpython-36.pyc deleted file mode 100644 index 9748542c2e..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/read_QSV.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/read_json.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/read_json.cpython-36.pyc deleted file mode 100644 index 78d3c48651..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/IO/__pycache__/read_json.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/inverse.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/inverse.cpython-36.pyc deleted file mode 100644 index 0ed353672e..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/inverse.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/opt_orbital.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/opt_orbital.cpython-36.pyc deleted file mode 100644 index e7cb3626b1..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/opt_orbital.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/orbital.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/orbital.cpython-36.pyc deleted file mode 100644 index 657d04221d..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/orbital.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/torch_complex.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/torch_complex.cpython-36.pyc deleted file mode 100644 index 1560a87f60..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/torch_complex.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/util.cpython-36.pyc b/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/util.cpython-36.pyc deleted file mode 100644 index acf9774662..0000000000 Binary files a/ABACUS.develop/tools/SIAB/PyTorchGradient/source/__pycache__/util.cpython-36.pyc and /dev/null differ diff --git a/ABACUS.develop/tools/SIAB/SimulatedAnnealing/source/src_spillage/main.cpp b/ABACUS.develop/tools/SIAB/SimulatedAnnealing/source/src_spillage/main.cpp index 5b9a271258..a5033b34f1 100644 --- a/ABACUS.develop/tools/SIAB/SimulatedAnnealing/source/src_spillage/main.cpp +++ b/ABACUS.develop/tools/SIAB/SimulatedAnnealing/source/src_spillage/main.cpp @@ -16,6 +16,7 @@ int main(int argc, char **argv) time_t time_start = time(NULL); timer::start(); cout <<" Start Time : " << ctime(&time_start); + std::srand(std::time(nullptr)); // (2) if parallel, prepare. cout << " First read in the parameters from INPUT." << endl; diff --git a/ABACUS.develop/bin/README b/ABACUS.develop/tools/opt_abfs_bash/__init__.py similarity index 100% rename from ABACUS.develop/bin/README rename to ABACUS.develop/tools/opt_abfs_bash/__init__.py diff --git a/ABACUS.develop/tools/opt_abfs_bash/exx.py b/ABACUS.develop/tools/opt_abfs_bash/exx.py new file mode 100644 index 0000000000..9f0306a11e --- /dev/null +++ b/ABACUS.develop/tools/opt_abfs_bash/exx.py @@ -0,0 +1,74 @@ +import os +import re +import textwrap +import pathlib +import utils +import read_stru + +def cal(): + pathlib.Path(utils.folder_exx).mkdir(parents=True,exist_ok=False) + + os.system(f"cp INPUT {utils.folder_exx}/") + os.system(f"cp KPT {utils.folder_exx}/") + + with open(f"{utils.folder_exx}/INPUT","w") as file: + input_dict = read_stru.get_input_dict() + input_dict["pseudo_dir"] = os.path.abspath(input_dict.get("pseudo_dir",r"./")) + read_stru.print_input(file,input_dict,1) + + with open("STRU","r") as file: + strus = re.compile("LATTICE_CONSTANT").split(file.read()) + with open(f"{utils.folder_exx}/STRU","w") as file: + Ts = read_stru.get_T() + file.write("ATOMIC_SPECIES\n") + pseudo_path = read_stru.get_pseudo_path() + for T in Ts: + file.write(f"{T} 12 {pseudo_path[T]}\n") + file.write("\nNUMERICAL_ORBITAL\n") + lcao_path = read_stru.get_lcao_path() + for T in Ts: + file.write(f"{lcao_path[T]}\n") + file.write("\nABFS_ORBITAL\n") + for T in read_stru.get_T(): + file.write(f"../{utils.folder_opt}/orb_{T}.dat\n") + file.write("\nLATTICE_CONSTANT") + file.write(strus[1]) + + info = utils.read_info() + if utils.sub=="qsub": + with open(f"{utils.folder_exx}/sub.sh","w") as file: + file.write(textwrap.dedent(f"""\ + #!/bin/bash + #PBS -q gold5120 + #PBS -l nodes=2:ppn=28 + #PBS -l walltime=99:99:99 + #PBS -o job.log + #PBS -e job.err + ulimit -s unlimited + cd $PBS_O_WORKDIR + EXEC={info["ABACUS"]} + mpirun -n 2 -env OMP_NUM_THREADS=28 $EXEC + """)) + elif utils.sub=="bsub": + with open(f"{utils.folder_exx}/sub.sh","w") as file: + file.write(textwrap.dedent(f"""\ + #!/bin/sh + #BSUB -q renxg + #BSUB -o job.log -e job.err + #BSUB -n 6 + mpirun -n 2 -env OMP_NUM_THREADS=28 {info['ABACUS']} + """)) + + os.chdir(utils.folder_exx) + if utils.sub=="qsub": + os.system("qsub sub.sh") + elif utils.sub=="bsub": + os.system(f"bsub < sub.sh") + elif utils.sub=="tianhe2": + os.system(f'yhrun -N 1 -n 1 -c 24 -t 1440 {info["ABACUS"]} >Log.txt 2>&1 &') + else: + raise ValueError("utils.sub") + os.chdir("../") + +if __name__=="__main__": + cal() diff --git a/ABACUS.develop/tools/opt_abfs_bash/opt_orb.py b/ABACUS.develop/tools/opt_abfs_bash/opt_orb.py new file mode 100644 index 0000000000..53ba04eaa5 --- /dev/null +++ b/ABACUS.develop/tools/opt_abfs_bash/opt_orb.py @@ -0,0 +1,101 @@ +import json +import os +import re +import textwrap +import pathlib +import read_stru +import utils + +def cp_matrix(folders_matrix): + pathlib.Path(utils.folder_opt+"/"+utils.folder_opt_matrix).mkdir(parents=True,exist_ok=False) + folders_same_atom = set() + for folder_matrix in folders_matrix: + T1,T2 = folder_matrix.split("_")[0].split("-") + dis = float(folder_matrix.split("_")[1]) + if dis: + if T1==T2: + matrix_file = "matrix_0_0_0_1" + else: + matrix_file = "matrix_0_0_1_0" + else: + matrix_file = "matrix_0_0_0_0" + os.system(f"cp {folder_matrix}/{matrix_file} {utils.folder_opt}/{utils.folder_opt_matrix}/{folder_matrix}") + +def add_nbands(folders_matrix): + for folder_matrix in folders_matrix: + with open(f"{utils.folder_opt}/{utils.folder_opt_matrix}/{folder_matrix}","r") as file: + nband = int(re.compile(r"(\d+)\s+nbands").search(file.read()).group(1)) + folders_matrix[folder_matrix] = (folders_matrix[folder_matrix], nband) + +def set_input(folders_matrix): + Ts = read_stru.get_T() + input_dict = read_stru.get_input_dict() + Ecut = float(input_dict["ecutwfc"]) + info = utils.read_info() + input = { + "file_list": [f"{utils.folder_opt_matrix}/"+folder_matrix for folder_matrix in folders_matrix], + "info": + { + "Nt_all": Ts, + "Nu": {T:info["Nu"] for T in Ts}, + "Nb_true": [nbands for weight,nbands in folders_matrix.values()], + "weight": [weight for weight,nbands in folders_matrix.values()], + "Rcut": read_stru.get_Rcut(), + "dr": {T:utils.dr for T in Ts}, + "Ecut": {T:Ecut for T in Ts}, + "lr": utils.lr + }, + "C_init_info":{ "init_from_file": False }, + "V_info": + { + "init_from_file": True, + "same_band": False + } + } + return json.dumps(input,indent=4) + +def cal(input): + info = utils.read_info() + with open(f"{utils.folder_opt}/input.json","w") as file: + file.write(input) + if utils.sub=="qsub": + with open(f"{utils.folder_opt}/sub.sh","w") as file: + file.write(textwrap.dedent(f"""\ + #!/bin/bash + #PBS -q gold5120 + #PBS -l nodes=1:ppn=1 + #PBS -l walltime=2:00:00 + #PBS -o job.log + #PBS -e job.err + ulimit -s unlimited + cd $PBS_O_WORKDIR + export OMP_NUM_THREADS=1 + EXEC={info["opt_orb"]} + python3 -u $EXEC + """)) + elif utils.sub=="tianhe2": + with open(f"{utils.folder_opt}/sub.sh","w") as file: + file.write(textwrap.dedent(f"""\ + #!/bin/bash + EXEC={info["opt_orb"]} + python3 -u $EXEC >Log.txt + """)) + os.chdir(utils.folder_opt) + if utils.sub=="qsub": + os.system("qsub sub.sh") + elif utils.sub=="tianhe2": + os.system("yhbatch -N 1 sub.sh") +# os.system(f'python3 -u {info["opt_orb"]}') + os.chdir("../") + +def all(): + pathlib.Path(utils.folder_opt).mkdir(parents=True,exist_ok=False) + with open("folders","r") as file: + folders_matrix = json.loads(file.read()) + cp_matrix(folders_matrix.keys()) + add_nbands(folders_matrix) + input = set_input(folders_matrix) + cal(input) + +if __name__=="__main__": + all() \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_abfs_bash/read_stru.py b/ABACUS.develop/tools/opt_abfs_bash/read_stru.py new file mode 100644 index 0000000000..da7cf3c34f --- /dev/null +++ b/ABACUS.develop/tools/opt_abfs_bash/read_stru.py @@ -0,0 +1,235 @@ +import re +import numpy as np +import itertools +import numba +import functools +import operator +import os +import collections +import decimal +import json +import utils + +def skip_notes(line): + line = re.compile(r"#.*").sub("",line) + line = re.compile(r"//.*").sub("",line) + line = line.strip() + return line + +@functools.lru_cache(maxsize=None) +def get_input_dict(): + input_dict = dict() + with open("INPUT","r") as file: + for line in file: + line = skip_notes(line) + if not line or line=="INPUT_PARAMETERS": + continue + label, value = re.compile(r"\s+").split( line, maxsplit=1 ) + input_dict[label] = value + return input_dict + +def print_input(file,input_dict,tag=0): + print("INPUT_PARAMETERS",file=file) + max_len = max([len(label) for label in input_dict]) + for label,value in input_dict.items(): + if tag==0 and label in ["nelec", "ocp", "ocp_set"]: + continue + print( label, " "*(max_len-len(label)+4), value, file=file) + + +""" +@functools.lru_cache(maxsize=None) +def search_in_input(label): + with open("INPUT","r") as file: + regex = label+"\s+(\d+)" + value = re.compile(regex).search(file.read()).group(1) + return value +""" + +@functools.lru_cache(maxsize=None) +def get_k(): + with open("KPT","r") as file: + utils.search_sentence(file,"Gamma") + return list(map(int,skip_notes(file.readline()).split()[:3])) + +@functools.lru_cache(maxsize=None) +def get_T(): + ntype = int(get_input_dict()["ntype"]) + T = [] + with open("STRU","r") as file: + utils.search_sentence(file,"ATOMIC_SPECIES") + for it in range(ntype): + line = skip_notes(file.readline()) + T.append(line.split()[0]) + return T + +@functools.lru_cache(maxsize=None) +def get_Rcut(): + Ts = get_T() + lcao_path = get_lcao_path() + Rcut = dict() + for T in Ts: + with open(lcao_path[T],"r") as file: + for line in file: + line = skip_notes(line) + if line.startswith("Radius Cutoff(a.u.)"): + Rcut[T] = float(line.split()[-1]) + break + return Rcut + +@functools.lru_cache(maxsize=None) +def get_pseudo_path(): + Ts = get_T() + path = dict() + with open("STRU","r") as file: + utils.search_sentence(file,"ATOMIC_SPECIES") + for T in Ts: + path[T] = skip_notes(file.readline()).split()[-1] + return path + +@functools.lru_cache(maxsize=None) +def get_lcao_path(): + Ts = get_T() + path = dict() + with open("STRU","r") as file: + utils.search_sentence(file,"NUMERICAL_ORBITAL") + for T in Ts: + path[T] = os.path.abspath(skip_notes(file.readline())) + return path + +@functools.lru_cache(maxsize=None) +def get_lattice(): + with open("STRU","r") as file: + utils.search_sentence(file,"LATTICE_CONSTANT") + lat0 = float(skip_notes(file.readline()).split()[0]) + with open("STRU","r") as file: + utils.search_sentence(file,"LATTICE_VECTORS") + lat_vec = [] + for i in range(3): + lat_vec.append(list(map(float,skip_notes(file.readline()).split()))) + lat_vec = np.array(lat_vec) + with open("STRU","r") as file: + utils.search_sentence(file,"ATOMIC_POSITIONS") + position = skip_notes(file.readline()) + return lat0, lat_vec, position + +@functools.lru_cache(maxsize=None) +def get_lcao(): + lcao = collections.defaultdict(list) + lcao_path = get_lcao_path() + for T in lcao_path: + with open(lcao_path[T],"r") as file: + for line in file: + line = skip_notes(line) + if line.startswith("Number of"): + lcao[T].append(int(line.split()[-1])) + return dict(lcao) + +@functools.lru_cache(maxsize=None) +def get_nw(): + nw = dict() + lcao = get_lcao() + for T in lcao: + nw[T] = functools.reduce(operator.add,((2*l+1)*n for l,n in enumerate(lcao[T]))) + return nw + +# R[T] = [..., [xi,yi,zi], ...] +def get_R(): + Ts = get_T() + R = dict() + with open("STRU","r") as file: + for T in Ts: + utils.search_sentence(file,T) + utils.ignore_lines(file,1) + na = int(skip_notes(file.readline()).split()[0]) + R_tmp = [] + for i in range(na): + R_tmp.append(list(map(float,skip_notes(file.readline()).split()[:3]))) + R[T] = np.array(R_tmp) + return R + +def change_R(R): + lat0, lat_vec, position = get_lattice() + if position == "Direct": + for T in R: + R[T] = np.dot(R[T],lat_vec) + elif position == "Cartesian_angstrom": + for T in R: + R[T] /= 0.529166 + for T in R: + R[T] *= lat0 + + nx,ny,nz = get_k() + lat_vec *= lat0 + for T in R: + R_new = [] + for ix in range(nx): + for iy in range(ny): + for iz in range(nz): + R_new.append( R[T] + np.dot(np.array([ix,iy,iz]), lat_vec) ) + R[T] = np.concatenate(R_new) + + return R + +# dis[T1,T2] = {..., i_dis:num, ...} +def cal_dis(R): + dis = dict() + for T1,T2 in itertools.combinations_with_replacement(R,2): + dis_TT = collections.defaultdict(int) + for ia1,ia2 in itertools.product(R[T1],R[T2]): + i_dis = np.linalg.norm(ia1-ia2) + dis_TT[i_dis] += 1 + dis[T1,T2] = dict(dis_TT) + return dis + +def round_dis(dis,precision): + dis_round = dict() + for T1,T2 in dis: + dis_TT = collections.defaultdict(int) + for i_dis,num in dis[T1,T2].items(): + i_dis = float(decimal.Decimal(i_dis).quantize(decimal.Decimal(str(precision)), rounding=decimal.ROUND_HALF_UP)) # test + dis_TT[i_dis] += num + dis_round[T1,T2] = dict(dis_TT) + return dis_round + +def cut_dis(dis): + Rcut = get_Rcut() + for T1,T2 in dis: + Rcut_sum = Rcut[T1]+Rcut[T2] + dis[T1,T2] = { i_dis:num for i_dis,num in dis[T1,T2].items() if i_disRcut_sum): + norm = np.linalg.norm(delta) + if norm>0 and normLog.txt') + os.chdir("../") + +# dis_opt[T1,T2] = [..., dis, ...] +def get_dis_opt(dis): + opt_mode = "kmeans" + dis_opt = dict() + info = utils.read_info() + for T1,T2 in dis: + dis_tmp = read_stru.delete_zero(dis[T1,T2]) + if len(dis_tmp)<=info["dimer_num"]: + dis_opt[T1,T2] = list(dis_tmp.keys()) + else: + if opt_mode=="linspace": + dis_opt[T1,T2] = np.linspace( min(dis_tmp), max(dis_tmp), info["dimer_num"] ) + elif opt_mode=="kmeans": + kmeans = KMeans(n_clusters=info["dimer_num"]) + label = kmeans.fit_predict( + np.array(list(dis_tmp.keys())).reshape(-1,1), + sample_weight = [num/i_dis**2 for i_dis,num in dis_tmp.items()]) + dis_opt[T1,T2] = list(kmeans.cluster_centers_.reshape(-1)) + pprint.pprint(dict(zip(dis_tmp.keys(),label))) + if T1==T2: + dis_opt[T1,T2].append(0.0) + return dis_opt + +# dis_weight[T1,T2] = {..., i_dis_opt:weight, ...} +def cal_dis_weight(dis_opt,dis_all): + def weight_func(x,D): + return (2/D**3)*x**3 + (-3/D**2)*x**2 + 1 + dis_weight = collections.defaultdict(dict) + for T1,T2 in dis_opt: + dis_opt_TT = sorted(dis_opt[T1,T2]) + for index,i_dis_opt in enumerate(dis_opt_TT): + i_weight = 0 + i_dis_low = dis_opt_TT[index-1] if index>0 else -np.infty + i_dis_up = dis_opt_TT[index+1] if index + 1 // smooth or not + 0.1 // sigma + {info["input"]["ecut"]} // energy cutoff for spherical bessel functions(Ry) + {info["input"]["rcut"]} // cutoff of wavefunctions(a.u.) + 1.0e-12 // tolerence + + """)) + + + + with open("STRU","w") as file: + file.write("ATOMIC_SPECIES\n") + file.write(f'{info["input"]["element"]} 1 {info["input"]["pseudo"]}\n') + file.write(textwrap.dedent(f"""\ + LATTICE_CONSTANT + {utils.lat0}\n + LATTICE_VECTORS + 1 0 0 + 0 1 0 + 0 0 1\n + ATOMIC_POSITIONS + Cartesian_angstrom + """)) + if info["input"]["element"] in ["Na","Li","K","Ca"]: + file.write(textwrap.dedent(f"""\ + {info["input"]["element"]} + 0.0 + 3 + 0 0 0 0 0 0 + 0 0 {dis} 0 0 0 + 0 {dis*0.86603} {dis*0.5} 0 0 0 + """)) + else: + file.write(textwrap.dedent(f"""\ + {info["input"]["element"]} + 0.0 + 2 + 0 0 0 0 0 0 + 0 0 {dis} 0 0 0 + """)) + + + + with open("KPT","w") as file: + file.write(textwrap.dedent(f"""\ + K_POINTS + 0 + Gamma + 1 1 1 0 0 0 + """)) + + + + if utils.sub=="qsub": + with open("sub.sh","w") as file: + core = info["exe"]["qsub"][0]*info["exe"]["qsub"][1] + file.write(textwrap.dedent(f"""\ + #!/bin/bash + #PBS -q gold5120 + #PBS -l nodes={info["exe"]["qsub"][0]}:ppn={info["exe"]["qsub"][1]} + #PBS -l walltime=1:00:00 + #PBS -o job.log + #PBS -e job.err + ulimit -s unlimited + cd $PBS_O_WORKDIR + EXEC={info["exe"]["exe_pw"]} + mpirun -n {core} -env OMP_NUM_THREADS=1 $EXEC + """)) + elif utils.sub=="bsub": + with open("sub.sh","w") as file: + core = info["exe"]["qsub"][0]*info["exe"]["qsub"][1] + file.write(textwrap.dedent(f"""\ + #!/bin/sh + #BSUB -q renxg + #BSUB -o job.log -e job.err + #BSUB -n {core} + EXEC={info["exe"]["exe_pw"]} + mpirun -n {core} -env OMP_NUM_THREADS=1 $EXEC + """)) + else: + raise KeyError("utils.sub = ",utils.sub) + + + + + +def print_file_opt(info,dis): + + with open("input.json","w") as file: + input = { + "file_list": [ f'../{info["input"]["element"]}-{info["input"]["rcut"]}-{distance}/test.{utils.lat0}.dat' for distance in dis[info["input"]["element"]] ], + "info": { + "Nt_all": [info["input"]["element"]], + "Nu": {info["input"]["element"] : info["orbital"]}, + "Nb_true": info["input"]["ref_bands"] if isinstance(info["input"]["ref_bands"],list) else [info["input"]["ref_bands"]] * len(dis[info["input"]["element"]]), + "weight": [1] * len(dis[info["input"]["element"]]), + "Rcut": {info["input"]["element"] : info["input"]["rcut"]}, + "dr": {info["input"]["element"] : utils.dr}, + "Ecut": {info["input"]["element"] : info["input"]["ecut"]}, + "lr": utils.lr + }, + "C_init_info": { + "init_from_file": False + }, + "V_info": { + "same_band": True, + "init_from_file": False + } + } + file.write(json.dumps(input,indent=4)) + + + if utils.sub=="qsub": + with open("sub.sh","w") as file: + file.write(textwrap.dedent(f"""\ + #!/bin/bash + #PBS -q gold5120 + #PBS -l nodes=1:ppn=1 + #PBS -l walltime=1:00:00 + #PBS -o job.log + #PBS -e job.err + ulimit -s unlimited + cd $PBS_O_WORKDIR + export OMP_NUM_THREADS=1 + EXEC={info["exe"]["exe_orbital"]} + python3 $EXEC + """)) + elif utils.sub=="bsub": + with open("sub.sh","w") as file: + file.write(textwrap.dedent(f"""\ + #!/bin/sh + #BSUB -q renxg + #BSUB -o job.log -e job.err + #BSUB -n 1 + export OMP_NUM_THREADS=1 + EXEC={info["exe"]["exe_orbital"]} + python3 $EXEC + """)) + else: + raise KeyError("utils.sub = ",utils.sub) \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_lcao_bash/read_info.py b/ABACUS.develop/tools/opt_lcao_bash/read_info.py new file mode 100644 index 0000000000..17f5ccbce8 --- /dev/null +++ b/ABACUS.develop/tools/opt_lcao_bash/read_info.py @@ -0,0 +1,34 @@ +import json +import os + +def read_info(file_name): + with open(file_name,"r") as file: + info = file.read() + info = json.loads(info) + info["input"]["pseudo_dir"] = os.path.abspath(info["input"].get("pseudo_dir","./")) + info["exe"]["qsub"] = info["exe"].get("qsub",[1,1]) + return info + +""" info.json +{ + "exe": + { + "exe_pw": "/home/linpz/ABACUS/ABACUS.1.0.1_2016-12-19/bin/ABACUS.mpi.1.0.0", + "exe_orbital": "/home/linpz/ABACUS/ABACUS_RI_git/tools/opt_orb_pytorch/main.py", + "qsub": [1,8] + }, + "input": + { + "element": "N", + "ref_bands": 5, or [5,5,5,5,5], + "nbands": 8, + "ecut": 50, + "rcut": 6, + "pseudo_dir": "../", + "pseudo": "N_ONCV_PBE-1.0.upf", + "sigma": 0.01 + }, + "orbital": [2,2,1] +} +""" + diff --git a/ABACUS.develop/tools/opt_lcao_bash/utils.py b/ABACUS.develop/tools/opt_lcao_bash/utils.py new file mode 100644 index 0000000000..57713d026f --- /dev/null +++ b/ABACUS.develop/tools/opt_lcao_bash/utils.py @@ -0,0 +1,4 @@ +lat0 = 30 +dr = 0.01 +lr = 0.01 +sub = "qsub" \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/IO/__init__.py b/ABACUS.develop/tools/opt_orb_pytorch/IO/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ABACUS.develop/tools/opt_orb_pytorch/IO/func_C.py b/ABACUS.develop/tools/opt_orb_pytorch/IO/func_C.py new file mode 100644 index 0000000000..2e28b1c3df --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/IO/func_C.py @@ -0,0 +1,85 @@ +from util import * +import torch +import numpy as np + +def random_C_init(info): + """ C[it][il][ie,iu] """ + C = dict() + for it in info.Nt_all: + C[it] = ND_list(info.Nl[it]) + for il in range(info.Nl[it]): + C[it][il] = torch.tensor(np.random.uniform(-1,1, (info.Ne[it], info.Nu[it][il])), dtype=torch.float32, requires_grad=True) + return C + + + +def read_C_init(file_name,info): + """ C[it][il][ie,iu] """ + C = random_C_init(info) + + with open(file_name,"r") as file: + + for line in file: + if line.strip() == "": + line=None + break + ignore_line(file,1) + + while True: + line = file.readline().strip() + if line.startswith("Type"): + it,il,iu = list(map(int,file.readline().split())); + it=info.Nt_all[it-1]; iu-=1 + line = file.readline().split() + for ie in range(info.Ne[it]): + if not line: line = file.readline().split() + C[it][il].data[ie,iu] = float(line.pop(0)) + elif line.startswith(""): + break; + else: + raise IOError("unknown line in read_C_init "+file_name+"\n"+line) + return C + + + +def copy_C(C,info): + C_copy = dict() + for it in info.Nt_all: + C_copy[it] = ND_list(info.Nl[it]) + for il in range(info.Nl[it]): + C_copy[it][il] = C[it][il].clone() + return C_copy + + + +def write_C(file_name,info,C): + with open(file_name,"w") as file: + print("", file=file) + print("\tTotal number of radial orbitals.", file=file) + for it,C_t in C.items(): + for il,C_tl in enumerate(C_t): + for iu in range(C_tl.size()[1]): + print("\tType\tL\tZeta-Orbital", file=file) + print(f"\t {info.Nt_all.index(it)+1} \t{il}\t {iu+1}", file=file) + for ie in range(C_tl.size()[0]): + print("\t", C_tl[ie,iu].item(), file=file) + print("", file=file) + + +#def init_C(info): +# """ C[it][il][ie,iu] """ +# C = ND_list(max(info.Nt)) +# for it in range(len(C)): +# C[it] = ND_list(info.Nl[it]) +# for il in range(info.Nl[it]): +# C[it][il] = torch.autograd.Variable( torch.Tensor( info.Ne, info.Nu[it][il] ), requires_grad = True ) +# +# with open("C_init.dat","r") as file: +# line = [] +# for it in range(len(C)): +# for il in range(info.Nl[it]): +# for i_n in range(info.Nu[it][il]): +# for ie in range(info.Ne[it]): +# if not line: line=file.readline().split() +# C[it][il].data[ie,i_n] = float(line.pop(0)) +# return C \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/IO/print_QSV.py b/ABACUS.develop/tools/opt_orb_pytorch/IO/print_QSV.py new file mode 100644 index 0000000000..1b0f88c59e --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/IO/print_QSV.py @@ -0,0 +1,29 @@ +def print_V(V,file_name): + """ V[ist][ib] """ + with open(file_name,"w") as file: + for V_s in V: + for V_sb in V_s: + print(1-V_sb.item(),end="\t",file=file) + print(file=file) + +def print_S(S,file_name): + """ S[ist][it1,it2][il1][il2][ia1*im1*in1,ia2*im2*in2] """ + with open(file_name,"w") as file: + for ist,S_s in enumerate(S): + for (it1,it2),S_tt in S_s.items(): + for il1,S_ttl in enumerate(S_tt): + for il2,S_ttll in enumerate(S_ttl): + print(ist,it1,it2,il1,il2,file=file) + print(S_ttll.real.numpy(),file=file) + print(S_ttll.imag.numpy(),"\n",file=file) + +def print_Q(Q,file_name): + """ Q[ist][it][il][ib,ia*im*iu] """ + with open(file_name,"w") as file: + for ist,Q_s in enumerate(Q): + for it,Q_st in Q_s.items(): + for il,Q_stl in enumerate(Q_st): + print(ist,it,il,file=file) + print(Q_stl.real.numpy(),file=file) + print(Q_stl.imag.numpy(),"\n",file=file) + \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/IO/print_orbital.py b/ABACUS.develop/tools/opt_orb_pytorch/IO/print_orbital.py new file mode 100644 index 0000000000..69a68858c4 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/IO/print_orbital.py @@ -0,0 +1,43 @@ +def print_orbital(orb,info): + """ orb[it][il][iu][r] """ + for it,orb_t in orb.items(): + with open("orb_{0}.dat".format(it),"w") as file: + print_orbital_head(file,info,it) + for il,orb_tl in enumerate(orb_t): + for iu,orb_tlu in enumerate(orb_tl): + print(""" Type L N""",file=file) + print(""" 0 {0} {1}""".format(il,iu),file=file) + for ir,orb_tlur in enumerate(orb_tlu): + print(orb_tlur,end="\t",file=file) + if ir%4==3: print(file=file) + print(file=file) + + +def plot_orbital(orb,Rcut,dr): + for it,orb_t in orb.items(): + with open("orb_{0}_plot.dat".format(it),"w") as file: + Nr = int(Rcut[it]/dr[it])+1 + for ir in range(Nr): + print(ir*dr[it],end="\t",file=file) + for il,orb_tl in enumerate(orb_t): + for orb_tlu in orb_tl: + print(orb_tlu[ir],end="\t",file=file) + print(file=file) + + +def print_orbital_head(file,info,it): + print( "---------------------------------------------------------------------------", file=file ) + print( "Element {0}".format(it), file=file ) + print( "Energy Cutoff(Ry) {0}".format(info.Ecut[it]), file=file ) + print( "Radius Cutoff(a.u.) {0}".format(info.Rcut[it]), file=file ) + print( "Lmax {0}".format(info.Nl[it]-1), file=file ) + l_name = ["S","P","D"]+list(map(chr,range(ord('F'),ord('Z')+1))) + for il,iu in enumerate(info.Nu[it]): + print( "Number of {0}orbital--> {1}".format(l_name[il],iu), file=file ) + print( "---------------------------------------------------------------------------", file=file ) + print( "SUMMARY END", file=file ) + print( file=file ) + print( "Mesh {0}".format(int(info.Rcut[it]/info.dr[it])+1), file=file ) + print( "dr {0}".format(info.dr[it]), file=file ) + + \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/IO/read_QSV.py b/ABACUS.develop/tools/opt_orb_pytorch/IO/read_QSV.py new file mode 100644 index 0000000000..761e407e71 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/IO/read_QSV.py @@ -0,0 +1,164 @@ +from util import * +import torch +import torch_complex +import itertools +import numpy as np + +import time + +def read_file(info,file_list,V_info): + """ QI[ist][it][il][ib*ia*im,ie] """ + """ SI[ist][it1][it2][il1][il2][ie1,ia1,im1,ia2,im2,ie2] """ + """ VI[ist][ib] """ + import copy + info_true = copy.deepcopy(info) + info_true.Nst = len(file_list) + info_true.Nt = ND_list(info_true.Nst,element="list()") + info_true.Na = ND_list(info_true.Nst,element="dict()") + info_true.Nb = ND_list(info_true.Nst) + info_true.Nk = ND_list(info_true.Nst) + info_true.Ne = dict() + info_true.weight = ND_list(info_true.Nst,element="list()") + QI=[]; SI=[]; VI=[] + + for ist_true,file_name in enumerate(file_list): + print(file_name) + with open(file_name,"r") as file: + + ignore_line(file,4) + Nt_tmp = int(file.readline().split()[0]) + for it in range(Nt_tmp): + t_tmp = file.readline().split()[0] + assert t_tmp in info.Nt_all + info_true.Nt[ist_true].append( t_tmp ) + info_true.Na[ist_true][t_tmp] = int(file.readline().split()[0]) + ignore_line( file, info_true.Na[ist_true][t_tmp] ) + ignore_line(file,6) + Nl_ist = int(file.readline().split()[0])+1 + for it,Nl_C in info.Nl.items(): + print(it,Nl_ist,Nl_C) + assert Nl_ist>=Nl_C + info_true.Nl[it] = Nl_ist + info_true.Nk[ist_true] = int(file.readline().split()[0]) + info_true.Nb[ist_true] = int(file.readline().split()[0]) + ignore_line(file,1) + Ne_tmp = list(map(int,file.readline().split()[:Nt_tmp])) + for it,Ne in zip(info_true.Nt[ist_true],Ne_tmp): + assert info_true.Ne.setdefault(it,Ne)==Ne + ignore_line(file,1) + for ik in range(info_true.Nk[ist_true]): + info_true.weight[ist_true].append(float(file.readline().split()[-1])) + ignore_line(file,3) + + line = None + for ik in range(info_true.Nk[ist_true]): + print("read QI:",ist_true,ik) + qi,line = read_QI(info_true,ist_true,file,line) + QI.append( qi ) + ignore_line(file,3) + for ik in range(info_true.Nk[ist_true]): + print("read SI:",ist_true,ik) + si,line = read_SI(info_true,ist_true,file,line) + SI.append( si ) + if V_info["init_from_file"]: + ignore_line(file,3) + for ik in range(info_true.Nk[ist_true]): + print("read VI:",ist_true,ik) + vi,line = read_VI(info_true,V_info,ist_true,file,line) + VI.append( vi ) + + info.Nst = sum(info_true.Nk,0) + import itertools + repeat_Nk = lambda x: list( itertools.chain.from_iterable( map( lambda x:itertools.repeat(*x), zip(x,info_true.Nk) ) ) ) + info.Nt = repeat_Nk(info_true.Nt) + info.Na = repeat_Nk(info_true.Na) + info.Nb = repeat_Nk(info_true.Nb) + info.Nb_true = repeat_Nk(info.Nb_true) + info.Ne = info_true.Ne + info.weight = list(itertools.chain.from_iterable([np.array(wk)*ws for wk,ws in zip(info_true.weight,info.weight)])) # info_true.weight[ist][ik] * info.weight[ist] + + return QI,SI,VI + + + + +def read_QI(info,ist,file,line=None): + """ QI[it][il][ib*ia*im,ie] """ + QI = dict() + for it in info.Nt[ist]: + QI[it] = ND_list(info.Nl[it]) + for il in range(info.Nl[it]): + QI[it][il] = torch_complex.ComplexTensor( + np.empty((info.Nb[ist],info.Na[ist][it],info.Nm(il),info.Ne[it]),dtype=np.float32), + np.empty((info.Nb[ist],info.Na[ist][it],info.Nm(il),info.Ne[it]),dtype=np.float32) ) + for ib in range(info.Nb[ist]): + for it in info.Nt[ist]: + for ia in range(info.Na[ist][it]): + for il in range(info.Nl[it]): + for im in range(info.Nm(il)): + for ie in range(info.Ne[it]): + if not line: line = file.readline().split() + QI[it][il].real[ib,ia,im,ie] = float(line.pop(0)) + if not line: line = file.readline().split() + QI[it][il].imag[ib,ia,im,ie] = float(line.pop(0)) + for it in info.Nt[ist]: + for il in range(info.Nl[it]): + QI[it][il] = torch_complex.ComplexTensor( + torch.from_numpy(QI[it][il].real).view(-1,info.Ne[it]), + torch.from_numpy(QI[it][il].imag).view(-1,info.Ne[it])) + return QI,line + + + +def read_SI(info,ist,file,line=None): + """ SI[it1,it2][il1][il2][ie1,ia1,im1,ia2,im2,ie2] """ + SI = dict() + for it1,it2 in itertools.product( info.Nt[ist], info.Nt[ist] ): + SI[it1,it2] = ND_list(info.Nl[it1],info.Nl[it2]) + for il1,il2 in itertools.product( range(info.Nl[it1]), range(info.Nl[it2]) ): + SI[it1,it2][il1][il2] = torch_complex.ComplexTensor( + np.empty((info.Na[ist][it1],info.Nm(il1),info.Ne[it1],info.Na[ist][it2],info.Nm(il2),info.Ne[it2]),dtype=np.float32), + np.empty((info.Na[ist][it1],info.Nm(il1),info.Ne[it1],info.Na[ist][it2],info.Nm(il2),info.Ne[it2]),dtype=np.float32) ) + for it1 in info.Nt[ist]: + for ia1 in range(info.Na[ist][it1]): + for il1 in range(info.Nl[it1]): + for im1 in range(info.Nm(il1)): + for it2 in info.Nt[ist]: + for ia2 in range(info.Na[ist][it2]): + for il2 in range(info.Nl[it2]): + for im2 in range(info.Nm(il2)): + for ie1 in range(info.Ne[it1]): + for ie2 in range(info.Ne[it2]): + if not line: line = file.readline().split() + SI[it1,it2][il1][il2].real[ia1,im1,ie1,ia2,im2,ie2] = float(line.pop(0)) + if not line: line = file.readline().split() + SI[it1,it2][il1][il2].imag[ia1,im1,ie1,ia2,im2,ie2] = float(line.pop(0)) + for it1,it2 in itertools.product( info.Nt[ist], info.Nt[ist] ): + for il1,il2 in itertools.product( range(info.Nl[it1]), range(info.Nl[it2]) ): + SI[it1,it2][il1][il2] = torch_complex.ComplexTensor( + torch.from_numpy(SI[it1,it2][il1][il2].real), + torch.from_numpy(SI[it1,it2][il1][il2].imag)) + return SI,line + + + +def read_VI(info,V_info,ist,file,line=None): + if V_info["same_band"]: + """ VI[ib] """ + if V_info["init_from_file"]: + VI = np.empty(info.Nb[ist],dtype=np.float32) + for ib in range(info.Nb[ist]): + if not line: line = file.readline().split() + VI.data[ib] = float(line.pop(0)) + else: + VI = np.ones(info.Nb[ist],dtype=np.float32) + else: + """ VI[ib1,ib2] """ + if V_info["init_from_file"]: + VI = np.empty((info.Nb[ist],info.Nb[ist]),dtype=np.float32) + for ib1,ib2 in itertools.product( range(info.Nb[ist]), range(info.Nb[ist]) ): + if not line: line = file.readline().split() + VI[ib1,ib2] = float(line.pop(0)) + else: + VI = np.eye(info.Nb[ist],info.Nb[ist],dtype=np.float32) + return torch.from_numpy(VI),line diff --git a/ABACUS.develop/tools/opt_orb_pytorch/IO/read_json.py b/ABACUS.develop/tools/opt_orb_pytorch/IO/read_json.py new file mode 100644 index 0000000000..52887f9775 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/IO/read_json.py @@ -0,0 +1,64 @@ +import json +from util import Info + +def read_json(file_name): + + with open(file_name,"r") as file: + input = file.read() + input = json.loads(input) + + info = Info() + for info_attr,info_value in input["info"].items(): + info.__dict__[info_attr] = info_value + info.Nl = { it:len(Nu) for it,Nu in info.Nu.items() } + + return input["file_list"], info, input["C_init_info"], input["V_info"] + + """ file_name + { + "file_list": + [ + "/public/udata/linpz/try/SIA/pytorch/test/many_atoms/S2/S2.10.dat", + "/public/udata/linpz/try/SIA/pytorch/test/many_atoms/SO2/SO2.10.dat", + "/public/udata/linpz/try/SIA/pytorch/test/many_atoms/SO/SO.10.dat" + ], + "info": + { + "Nt_all": ["S","O"], + "Nu": {"S":[3,3,2],"O":[3,3,2]}, + "Nb_true": [7,9,7], + "weight": [2,3,1.5], + "Rcut": {"S":10,"O":10}, + "dr": {"S":0.01,"O":0.01}, + "Ecut": {"S":100,"O":100}, + "lr": 0.01 + }, + "C_init_info": + { + "init_from_file": false, + "C_init_file": "/public/udata/linpz/try/SIA/pytorch/test/many_atoms/SIA/ORBITAL_RESULTS.txt" + }, + "V_info": + { + "init_from_file": true, + "same_band": false + } + } + """ + + """ info + Nt_all ["S", "O"] + Nu {"S":[3,3,2], "O":[3,3,2]} + Nb_true [7, 9, 7] + weight [2, 3, 1.5] + Rcut {"S":10, "O":10} + dr {"S":0.01, "O":0.01} + Ecut {"S":100, "O":100} + lr 0.01 + Nl {"S":2, "O":2} + Nst 3 + Nt [["S"], ["S","O"], ["S","O"]] + Na [{"S":2}, {"S":1,"O":2}, {"S":1,"O":1}] + Nb [7, 9, 7] + Ne {"S":22, "O":19} + """ \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/__init__.py b/ABACUS.develop/tools/opt_orb_pytorch/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ABACUS.develop/tools/opt_orb_pytorch/inverse.py b/ABACUS.develop/tools/opt_orb_pytorch/inverse.py new file mode 100644 index 0000000000..311519fae1 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/inverse.py @@ -0,0 +1,55 @@ +import torch + + +def inverse_DC(A,B,C,D): + tmp_A = inverse(A) # A^{-1} + #print("tmp_A",tmp_A) + tmp_AB = torch.mm(tmp_A,B) # A^{-1} B + #print("tmp_AB",tmp_AB) + tmp_CA = torch.mm(C,tmp_A) # C A^{-1} + #print("tmp_CA",tmp_CA) + tmp_X = inverse(D-torch.mm(tmp_CA,B)) # ( D - C A^{-1} B )^{-1} + #print("tmp_X",tmp_X) + tmp_ABX = torch.mm(tmp_AB,tmp_X) # A^{-1} B ( D - C A^{-1} B )^{-1} + #print("tmp_ABX",tmp_ABX) + tmp_XCA = torch.mm(tmp_X,tmp_CA) # ( D - C A^{-1} B )^{-1} C A^{-1} + #print("tmp_XCA",tmp_XCA) + tmp_ABXCA = torch.mm(tmp_ABX,tmp_CA) # A^{-1} B ( D - C A^{-1} B )^{-1} C A^{-1} + #print("tmp_ABXCA",tmp_ABXCA) + + tmp_up = torch.cat( [ tmp_A+tmp_ABXCA, -tmp_ABX ], dim=1 ) + tmp_down = torch.cat( [ -tmp_XCA, tmp_X ], dim=1 ) + I = torch.cat( [tmp_up,tmp_down], dim=0 ) + return I + + + +def inverse(M): + +# assert len(M.size()) == 2, "inverse must be 2D" +# assert M.size()[0] == M.size()[1], "inverse row != column" + + L = M.size()[0] + + if L==1: + return 1/M + + elif L==2: + det = torch.cat(list( M[:1,:1]*M[1:,1:] - M[:1,1:]*M[1:,:1] )*4).view(2,2) + I_up = torch.cat([M[1:,1:],-M[:1,1:]],dim=1) + I_down = torch.cat([-M[1:,:1],M[:1,:1]],dim=1) + I_all = torch.cat([I_up,I_down],dim=0) + return I_all/det + + elif L==3: + threshold = 1e-10 + if M[0,0].abs() > threshold: + return inverse_DC( M[:1,:1], M[:1,1:], M[1:,:1], M[1:,1:] ) + elif M[2,2].abs() > threshold: + return inverse_DC( M[:2,:2], M[:2,2:], M[2:,:2], M[2:,2:] ) + else: + raise ZeroDivisionError("matrix inverse") + + else: + L2 = L//2 + return inverse_DC( M[:L2,:L2], M[:L2,L2:], M[L2:,:L2], M[L2:,L2:] ) \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/main.py b/ABACUS.develop/tools/opt_orb_pytorch/main.py new file mode 100644 index 0000000000..49d8753e6b --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/main.py @@ -0,0 +1,72 @@ +import IO.read_QSV +import IO.print_QSV +import IO.func_C +import IO.read_json +import IO.print_orbital +import opt_orbital +import orbital +import torch +import numpy as np +import time + +print("seed:",torch.initial_seed()) +time_start = time.time() + +file_list, info, C_init_info, V_info = IO.read_json.read_json("input.json") + +QI,SI,VI = IO.read_QSV.read_file(info,file_list,V_info) +print(info) + +if C_init_info["init_from_file"]: + C = IO.func_C.read_C_init( C_init_info["C_init_file"], info ) +else: + C = IO.func_C.random_C_init(info) +E = orbital.set_E(info,info.Rcut) +orbital.normalize( orbital.generate_orbital(info,C,E,info.Rcut,info.dr), info.dr,C,flag_norm_C=True) + +opt_orb = opt_orbital.Opt_Orbital() + +#opt = torch.optim.Adam(sum( ([c.real,c.imag] for c in sum(C,[])), []), lr=info.lr, eps=1e-8) +opt = torch.optim.Adam( sum(C.values(),[]), lr=info.lr, eps=1e-20) + +with open("Spillage.dat","w") as S_file: + + loss_old = np.inf + + for i in range(20000): + Q = opt_orb.cal_Q(QI,C,info) + S = opt_orb.cal_S(SI,C,info) + V = opt_orb.cal_V(Q,S,info,V_info) + + V_delta = ( torch.abs(VIi-Vi) for VIi,Vi in zip(VI,V) ) # abs or **2? + if V_info["same_band"]: + Spillage = sum( Vi[:info.Nb_true[ist]].sum() * info.weight[ist] for ist,Vi in enumerate(V_delta) ) / sum( Nb_true*weight for Nb_true,weight in zip(info.Nb_true,info.weight) ) + else: + Spillage = sum( Vi[:info.Nb_true[ist],:info.Nb_true[ist]].sum() * info.weight[ist] for ist,Vi in enumerate(V_delta) ) / sum( Nb_true**2*weight for Nb_true,weight in zip(info.Nb_true,info.weight) ) + T = opt_orb.cal_T(C,E) + if not "TSrate" in vars(): TSrate = torch.abs(0.002*Spillage/T).data[0] + Loss = Spillage + TSrate*T + + print(Spillage.item(),T.item(),Loss.item(),file=S_file) + if Loss.item() < loss_old: + loss_old = Loss.item() + C_old = IO.func_C.copy_C(C,info) + flag_finish = 0 + else: + flag_finish += 1 + if flag_finish > 50: break + + opt.zero_grad() + Loss.backward() + opt.step() +# orbital.normalize( orbital.generate_orbital(info,C,E,info.Rcut,info.dr), info.dr,C,flag_norm_C=True) + + orb = orbital.generate_orbital(info,C_old,E,info.Rcut,info.dr) + orbital.smooth_orbital(orb,info.Rcut,info.dr,0.1) + orbital.orth(orb,info.dr) + IO.print_orbital.print_orbital(orb,info) + IO.print_orbital.plot_orbital(orb,info.Rcut,info.dr) + + IO.func_C.write_C("C.dat",info,C_old) + + print("time:\t",time.time()-time_start) \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/opt_orbital.py b/ABACUS.develop/tools/opt_orb_pytorch/opt_orbital.py new file mode 100644 index 0000000000..6f3a357982 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/opt_orbital.py @@ -0,0 +1,137 @@ +from util import ND_list +import inverse +import torch_complex +import functools +import itertools +import torch + +class Opt_Orbital: + + def cal_Q(self,QI,C,info): + """ + Q[ist][it][il][ib,ia*im*iu] + = sum_{q} QI[ist][it][il][ib*ia*im,ie] * C[it][il][ie,iu] + """ + Q = ND_list(info.Nst,element="dict()") + for ist in range(info.Nst): + for it in info.Nt[ist]: + Q[ist][it] = ND_list(info.Nl[it]) + + for ist in range(info.Nst): + for it in info.Nt[ist]: + for il in range(info.Nl[it]): + Q[ist][it][il] = torch_complex.mm( QI[ist][it][il], C[it][il] ).view(info.Nb[ist],-1) + return Q + + + + def cal_S(self,SI,C,info): + """ + S[ist][it1,it2][il1][il2][ia1*im1*iu1,ia2*im2*iu2] + = sum_{ie1 ie2} C^*[it1][il1][ie1,iu1] * SI[ist][it1,it2][il1][il2][ia1,im1,ie1,ia2,im2,ie2] * C[it2][[il2][ie2,iu2] + """ + S = ND_list(info.Nst,element="dict()") + for ist in range(info.Nst): + for it1,it2 in itertools.product( info.Nt[ist], info.Nt[ist] ): + S[ist][it1,it2] = ND_list(info.Nl[it1],info.Nl[it2]) + + for ist in range(info.Nst): + for it1,it2 in itertools.product( info.Nt[ist], info.Nt[ist] ): + for il1,il2 in itertools.product( range(info.Nl[it1]), range(info.Nl[it2]) ): + # SI_C[ia1*im1*ie1*ia2*im2,iu2] + SI_C = torch_complex.mm( + SI[ist][it1,it2][il1][il2].view(-1,info.Ne[it2]), + C[it2][il2] ) + # SI_C[ia1*im1,ie1,ia2*im2*iu2] + SI_C = SI_C.view( info.Na[ist][it1]*info.Nm(il1), info.Ne[it1], -1 ) + # Ct[iu1,ie1] + Ct = C[it1][il1].t() + C_mm = functools.partial(torch_complex.mm,Ct) + # C_SI_C[ia1*im1][iu1,ia2*im2*iu2] + C_SI_C = list(map( C_mm, SI_C )) + # C_SI_C[ia1*im1*iu1,ia2*im2*iu2] + C_SI_C = torch_complex.cat( C_SI_C, dim=0 ) +#??? C_SI_C = C_SI_C.view(info.Na[ist][it1]*info.Nm(il1)*info.Nu[it1][il1],-1) + S[ist][it1,it2][il1][il2] = C_SI_C + return S + + + + def cal_V(self,Q,S,info,V_info): + """ + V[ist][ib] + = sum_{it1,ia1,il1,im1,iu1} sum_{it2,ia2,il2,im2,iu2} + Q[ist][it1][il1][ib,ia1*im1*iu1] * S[ist]{[it1][it2][il1][il2][ia1*im1*iu1,ia2*im2*iu2]}^{-1} * Q[ist][it2][il2][ib,ia2*im2*iu2] + V[ist][ib1,ib2] + = sum_{it1,ia1,il1,im1,iu1} sum_{it2,ia2,il2,im2,iu2} + Q[ist][it1][il1][ib1,ia1*im1*iu1] * S[ist]{[it1][it2][il1][il2][ia1*im1*iu1,ia2*im2*iu2]}^{-1} * Q[ist][it2][il2][ib2,ia2*im2*iu2] + """ + V = ND_list(info.Nst) + for ist in range(info.Nst): + + # S_s[it1][il1*ia1*im1*iu1,it2*il2*ia2*im2*iu2] + S_s = dict() + for it1 in info.Nt[ist]: + # S_st[it2][il1*ia1*im1*iu1,il2*ia2*im2*iu2] + S_st = dict() + for it2 in info.Nt[ist]: + # S_stt[il1][ia1*im1*iu1,il2*ia2*im2*iu2] + S_stt = ND_list(info.Nl[it1]) + for il1 in range(info.Nl[it1]): + S_stt[il1] = torch_complex.cat( S[ist][it1,it2][il1], dim=1 ) + S_st[it2] = torch_complex.cat( S_stt, dim=0 ) + S_s[it1] = torch_complex.cat( list(S_st.values()), dim=1 ) + # S_cat[it1*il1*iat*im1*iu1,iat2*il2*ia2*im2*iu2] + S_cat = torch_complex.cat( list(S_s.values()), dim=0 ) + S_I = torch_complex.inverse(S_cat) + + if V_info["same_band"]: + # V_s[ib] + V_s = ND_list(info.Nb[ist]) + for ib in range(info.Nb[ist]): + # Q_s[it][il*ia*im*iu] + Q_s = dict() + for it in info.Nt[ist]: + # Q_ts[il][ia*im*iu] + Q_ts = [ Q_stl[ib] for Q_stl in Q[ist][it] ] + Q_s[it] = torch_complex.cat(Q_ts) + # Q_cat[it*il*ia*im*iu] + Q_cat = torch_complex.cat(list(Q_s.values())) + V_s[ib] = torch_complex.dot( Q_cat.conj(), torch_complex.mv( S_I, Q_cat ) ).real.view(-1) + # V[ist][ib] + V[ist] = torch.cat(V_s) + else: + # Q_b[ib][0,it*il*ia*im*iu] + Q_b = ND_list(info.Nb[ist]) + for ib in range(info.Nb[ist]): + # Q_s[it][il*ia*im*iu] + Q_s = dict() + for it in info.Nt[ist]: + # Q_ts[il][ia*im*iu] + Q_ts = [ Q_stl[ib] for Q_stl in Q[ist][it] ] + Q_s[it] = torch_complex.cat(Q_ts) + Q_b[ib] = torch_complex.cat(list(Q_s.values())).view(1,-1) + # Q_cat[ib,it*il*ia*im*iu] + Q_cat = torch_complex.cat( Q_b, dim=0 ) + # V[ist][ib1,ib2] + V[ist] = torch_complex.mm( Q_cat.conj(), torch_complex.mm( S_I, Q_cat.t() ) ).real + + return V + + + def cal_T(self,C,E): + """ T = 0.5* sum_{it,il,iu} sum_{ie} ( E[it][il,ie] * C[it][il][ie,iu] )**2 """ + T = torch.zeros(1) + num = 0 + for it,C_t in C.items(): + for il,C_tl in enumerate(C_t): + for iu in range(C_tl.size()[1]): + T_tlu = torch.zeros(1) + Z_tlu = 0 + for ie in range(C_tl.size()[0]): + T_tlu = T_tlu + ( E[it][il,ie] * C_tl[ie,iu] )**2 + Z_tlu = Z_tlu + E[it][il,ie].item()**2 + T = T + T_tlu/Z_tlu + num += C_tl.size()[1] + T = 0.5 * T / num + return T \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/opt_orbital.py_real b/ABACUS.develop/tools/opt_orb_pytorch/opt_orbital.py_real new file mode 100644 index 0000000000..5ade0f90fc --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/opt_orbital.py_real @@ -0,0 +1,86 @@ +from global_function import ND_list +import inverse +import torch + +class SIA: + + def cal_Q(self,QI,C): + """ + Q[ist][it][il][ib,ia*im*iu] + = sum_{q} QI[ist][it][il][ib*ia*im,ie] * C[it][il][ie,iu] + """ + Q = ND_list(self.Nst) + for ist in range(self.Nst): + Q[ist] = ND_list(self.Nt[ist]) + for it in range(self.Nt[ist]): + Q[ist][it] = ND_list(self.Nl[it]) + + for ist in range(self.Nst): + for it in range(self.Nt[ist]): + for il in range(self.Nl[it]): + Q[ist][it][il] = torch.mm( QI[ist][it][il], C[it][il] ).view(self.Nb[ist],-1) + return Q + + + + def cal_S(self,SI,C): + """ + S[ist][it1][it2][il1][il2][ia1*im1*in1,ia2*im2*in2] + = sum_{ie1 ie2} C[it1][il1][ie1,in1] * SI[ist][it1][it2][il1][il2][ie1,ia1,im1,ia2,im2,ie2] * C[it2][[il2][ie2,in2] + """ + S = ND_list(self.Nst) + for ist in range(self.Nst): + S[ist] = ND_list(self.Nt[ist],self.Nt[ist]) + for it1 in range(self.Nt[ist]): + for it2 in range(self.Nt[ist]): + S[ist][it1][it2] = ND_list(self.Nl[it1],self.Nl[it2]) + + for ist in range(self.Nst): + for it1 in range(self.Nt[ist]): + for it2 in range(self.Nt[ist]): + for il1 in range(self.Nl[it1]): + for il2 in range(self.Nl[it2]): + S[ist][it1][it2][il1][il2] = torch.mm( + C[it1][il1].t(), + torch.mm( SI[ist][it1][it2][il1][il2].view(-1,self.Ne), C[it2][il2] ).view(self.Ne,-1) + ).view(self.Nn[it1][il1],self.Na[ist][it1]*self.Nm[il1],-1).transpose(0,1).view(self.Na[ist][it1]*self.Nm[il1]*self.Nn[it1][il1],-1) + return S + + + + def cal_V(self,Q,S): + """ + V[ist][ib] + = sum_{it1,ia1,il1,im1,in1} sum_{it2,ia2,il2,im2,in2} + Q[ist][it1][il1][ib,ia1*im1*in1] * S[ist]{[it1][it2][il1][il2][ia1*im1*in1,ia2*im2*in2]}^{-1} * Q[ist][it2][il2][ib,ia2*im2*in2] + """ + V = ND_list(self.Nst) + for ist in range(self.Nst): + V[ist] = ND_list(self.Nb[ist]) + + for ist in range(self.Nst): + + S_s = ND_list(self.Nt[ist]) + for it1 in range(self.Nt[ist]): + S_st = ND_list(self.Nt[ist]) + for it2 in range(self.Nt[ist]): + S_stt = ND_list(self.Nl[it1]) + for il1 in range(self.Nl[it1]): + S_stt[il1] = torch.cat( S[ist][it1][it2][il1], dim=1 ) + S_st[it2] = torch.cat( S_stt, dim=0 ) + S_s[it1] = torch.cat( S_st, dim=1 ) + S_cat = torch.cat( S_s, dim=0 ) + + S_I = inverse.inverse(S_cat) +# S_I = 1/S_cat + + for ib in range(self.Nb[ist]): + + Q_s = ND_list(self.Nt[ist]) + for it in range(self.Nt[ist]): + Q_s[it] = torch.cat([ Q_st[ib] for Q_st in Q[ist][it] ]) + Q_cat = torch.cat(Q_s) + + V[ist][ib] = torch.dot( Q_cat, torch.mv( S_I, Q_cat ) ) + + return V \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/orbital.py b/ABACUS.develop/tools/opt_orb_pytorch/orbital.py new file mode 100644 index 0000000000..14c127a0d5 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/orbital.py @@ -0,0 +1,80 @@ +from util import ND_list +import numpy as np +from scipy.special import spherical_jn +from scipy.integrate import simps +from scipy.optimize import fsolve +import functools +import torch + +def generate_orbital(info,C,E,Rcut,dr): + """ C[it][il][ie,iu] """ + """ orb[it][il][iu][r] = \suml_{ie} C[it][il][ie,iu] * jn(il,ie*r) """ + orb = dict() + for it in info.Nt_all: + Nr = int(Rcut[it]/dr[it])+1 + orb[it] = ND_list(info.Nl[it]) + for il in range(info.Nl[it]): + orb[it][il] = ND_list(info.Nu[it][il]) + for iu in range(info.Nu[it][il]): + orb[it][il][iu] = np.zeros(Nr) + for ir in range(Nr): + r = ir * dr[it] + for ie in range(info.Ne[it]): + orb[it][il][iu][ir] += C[it][il][ie,iu].item() * spherical_jn(il,E[it][il,ie].item()*r) + return orb + + +def smooth_orbital(orb,Rcut,dr,sigma): + for it,orb_t in orb.items(): + for orb_tl in orb_t: + for orb_tlu in orb_tl: + for ir in range(orb_tlu.shape[0]): + assert orb_tlu.shape[0] == int(Rcut[it]/dr[it])+1 + r = ir * dr[it] + orb_tlu[ir] *= 1-np.exp( -(r-Rcut[it])**2/(2*sigma**2) ) + + + +def inner_product( orb1, orb2, dr ): + assert orb1.shape == orb2.shape + r = np.array(range(orb1.shape[0]))*dr + return simps( orb1 * orb2 * r * r, dx=dr ) + +def normalize(orb,dr,C=None,flag_norm_orb=False,flag_norm_C=False): + """ C[it][il][ie,iu] """ + """ orb[it][il][iu][r] = \suml_{ie} C[it][il][ie,iu] * jn(il,ie*r) """ + for it,orb_t in orb.items(): + for il,orb_tl in enumerate(orb_t): + for iu,orb_tlu in enumerate(orb_tl): + norm = np.sqrt(inner_product(orb_tlu,orb_tlu,dr[it])) + if flag_norm_orb: orb_tlu[:] = orb_tlu / norm + if flag_norm_C: C[it][il].data[:,iu] = C[it][il].data[:,iu] / norm + +def orth(orb,dr): + """ |n'> = 1/Z ( |n> - \sum_{i=0}^{n-1} |i> ) """ + """ orb[it][il][iu,r] """ + for it,orb_t in orb.items(): + for il,orb_tl in enumerate(orb_t): + for iu1,orb_tlu1 in enumerate(orb_tl): + for iu2 in range(iu1): + orb_tlu1[:] -= orb_tl[iu2] * inner_product(orb_tlu1,orb_tl[iu2],dr[it]) + orb_tlu1[:] = orb_tlu1 / np.sqrt(inner_product(orb_tlu1,orb_tlu1,dr[it])) + +def find_eigenvalue(Nl,Ne): + """ E[il,ie] """ + E = np.zeros((Nl,Ne+Nl+1)) + for ie in range(1,Ne+Nl+1): + E[0,ie] = ie*np.pi + for il in range(1,Nl): + jl = functools.partial(spherical_jn,il) + for ie in range(1,Ne+Nl+1-il): + E[il,ie] = fsolve( jl, (E[il-1,ie]+E[il-1,ie+1])/2 ) + return E[:,1:Ne+1] + +def set_E(info,Rcut): + """ E[it][il,ie] """ + eigenvalue = { it:find_eigenvalue(info.Nl[it],info.Ne[it]) for it in info.Nt_all } + E = dict() + for it in Rcut: + E[it] = torch.from_numpy(( eigenvalue[it]/Rcut[it] ).astype("float32")) + return E \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/pf.py b/ABACUS.develop/tools/opt_orb_pytorch/pf.py new file mode 100644 index 0000000000..e518fa02f7 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/pf.py @@ -0,0 +1,2 @@ +import profile +profile.run("import main","profile.dat") \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/torch_complex.py b/ABACUS.develop/tools/opt_orb_pytorch/torch_complex.py new file mode 100644 index 0000000000..d5f338d5d7 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/torch_complex.py @@ -0,0 +1,83 @@ +import torch + +class ComplexTensor: + def __init__(self,real,imag): + self.real = real + self.imag = imag + + def view(self,*args,**kwargs): + return ComplexTensor( self.real.view(*args,**kwargs), self.imag.view(*args,**kwargs) ) + def t(self,*args,**kwargs): + return ComplexTensor( self.real.t(*args,**kwargs), self.imag.t(*args,**kwargs) ) +# def transpose(self,*args,**kwargs): +# return ComplexTensor( self.real.transpose(*args,**kwargs), self.imag.transpose(*args,**kwargs) ) + def __getitem__(self,*args,**kwargs): + return ComplexTensor( self.real.__getitem__(*args,**kwargs), self.imag.__getitem__(*args,**kwargs) ) + def __str__(self): + return "<{0};{1}>".format(self.real, self.imag) + __repr__=__str__ +# def size(self,*args,**kwargs): +# return ComplexTensor( self.real.size(*args,**kwargs), self.imag.size(*args,**kwargs) ) + + def conj(self): + return ComplexTensor( self.real, -self.imag ) + + + +def dot( x1,x2, *args,**kwargs ): + if isinstance(x1,ComplexTensor): + if isinstance(x2,ComplexTensor): + return ComplexTensor( torch.dot( x1.real,x2.real, *args,**kwargs ) - torch.dot( x1.imag,x2.imag, *args,**kwargs ), torch.dot( x1.real,x2.imag, *args,**kwargs ) + torch.dot( x1.imag,x2.real, *args,**kwargs ) ) + else: + return ComplexTensor( torch.dot( x1.real,x2, *args,**kwargs ), torch.dot( x1.imag,x2, *args,**kwargs ) ) + else: + if isinstance(x2,ComplexTensor): + return ComplexTensor( torch.dot( x1,x2.real, *args,**kwargs ), torch.dot( x1,x2.imag, *args,**kwargs ) ) + else: + return torch.dot( x1,x2, *args,**kwargs ) +def mv( x1,x2, *args,**kwargs ): + if isinstance(x1,ComplexTensor): + if isinstance(x2,ComplexTensor): + return ComplexTensor( torch.mv( x1.real,x2.real, *args,**kwargs ) - torch.mv( x1.imag,x2.imag, *args,**kwargs ), torch.mv( x1.real,x2.imag, *args,**kwargs ) + torch.mv( x1.imag,x2.real, *args,**kwargs ) ) + else: + return ComplexTensor( torch.mv( x1.real,x2, *args,**kwargs ), torch.mv( x1.imag,x2, *args,**kwargs ) ) + else: + if isinstance(x2,ComplexTensor): + return ComplexTensor( torch.mv( x1,x2.real, *args,**kwargs ), torch.mv( x1,x2.imag, *args,**kwargs ) ) + else: + return torch.mv( x1,x2, *args,**kwargs ) +def mm( x1,x2, *args,**kwargs ): + if isinstance(x1,ComplexTensor): + if isinstance(x2,ComplexTensor): + return ComplexTensor( torch.mm( x1.real,x2.real, *args,**kwargs ) - torch.mm( x1.imag,x2.imag, *args,**kwargs ), torch.mm( x1.real,x2.imag, *args,**kwargs ) + torch.mm( x1.imag,x2.real, *args,**kwargs ) ) + else: + return ComplexTensor( torch.mm( x1.real,x2, *args,**kwargs ), torch.mm( x1.imag,x2, *args,**kwargs ) ) + else: + if isinstance(x2,ComplexTensor): + return ComplexTensor( torch.mm( x1,x2.real, *args,**kwargs ), torch.mm( x1,x2.imag, *args,**kwargs ) ) + else: + return torch.mm( x1,x2, *args,**kwargs ) + + +def cat( xs, *args,**kwargs ): + if isinstance(xs[0],ComplexTensor): + xs_real = []; xs_imag = [] + for x in xs: + xs_real.append(x.real) + xs_imag.append(x.imag) + return ComplexTensor( torch.cat(xs_real,*args,**kwargs), torch.cat(xs_imag,*args,**kwargs) ) + else: + return torch.cat(xs,*args,**kwargs) + + + +import inverse as inverse_real +def inverse(M): + if isinstance(M,ComplexTensor): + A=M.real + B=M.imag + tmp_AB = torch.mm(A.inverse(),B) # A^{-1} B + tmp_X = (A+torch.mm(B,tmp_AB)).inverse() # ( A + B A^{-1} B )^{-1} + return ComplexTensor( tmp_X, -torch.mm(tmp_AB,tmp_X) ) + else: + return M.inverse() \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/unittest_inverse.py b/ABACUS.develop/tools/opt_orb_pytorch/unittest_inverse.py new file mode 100644 index 0000000000..f4d4315610 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/unittest_inverse.py @@ -0,0 +1,29 @@ +import unittest +import inverse +import torch + +class unittest_inverse(unittest.TestCase): + + def inverse_test(self,a,ai_true): + + a=torch.Tensor(a) + a=torch.autograd.Variable(a) + + ai_test=inverse.inverse(a) + + ai_true = torch.Tensor(ai_true) + ai_true=torch.autograd.Variable(ai_true) + + self.assertFalse((ai_test!=ai_true).data.sum()) + + def test_inverse_1(self): + self.inverse_test( + [[1,2],[2,3]], + [[-3,2],[2,-1]] ) + def test_inverse_2(self): + self.inverse_test( + [[1,2,3],[2,4,5],[3,5,6]], + [[1,-3,2],[-3,3,-1],[2,-1,0]] ) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/ABACUS.develop/tools/opt_orb_pytorch/util.py b/ABACUS.develop/tools/opt_orb_pytorch/util.py new file mode 100644 index 0000000000..ac05ae2034 --- /dev/null +++ b/ABACUS.develop/tools/opt_orb_pytorch/util.py @@ -0,0 +1,36 @@ +def ND_list(*sizes,element=None): + size_1,*size_other = sizes + l = [element] * size_1 + if size_other: + for i in range(len(l)): + l[i] = ND_list(*size_other,element=element) + else: + if element in ["dict()","list()"]: + for i in range(size_1): + l[i] = eval(element) + return l + + +def ignore_line(file,N): + for _ in range(N): + file.readline() + + +class Info: + def Nm(self,il): return 2*il+1 + def __str__(self): + return "\n".join([name+"\t"+str(value) for name,value in self.__dict__.items()]) + __repr__=__str__ + +def change_to_cuda(s): + if isinstance(s,list): + return [change_to_cuda(x) for x in s] + elif isinstance(s,dict): + return {i:change_to_cuda(x) for i,x in s.items()} + elif isinstance(s,torch.Tensor): + return s.cuda() + elif isinstance(s,torch_complex.ComplexTensor): + return torch_complex.ComplexTensor( change_to_cuda(s.real), change_to_cuda(s.imag) ) + else: + print(s) + raise TypeError("change_to_cuda") \ No newline at end of file