Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions TDDFT-ris/compound.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# To run TDDFT-ris calculation, first you need a ground state SCF calculation,
# just like what you usually did for any other DFT calculations.
# Then in the TD step, compared to the standard TDDFT calculation, you need two extra setup
# 1) trun off the XC nernel,
# %method
# xckernelx 0
# xckernelc 0
# end
# 2) use RIJK with a minimal aux basis read from external file "ris.bas",
# which can be generated by running the python script "python get_ris_bas.py"
# %basis
# GTOAuxJName = "ris.bas"
# GTOAuxJKName = "ris.bas"
# end




%Compound
# ------------------------------------
# SCF step, setup functional/basis/mutliplicy just like usual
# revise it as need
# ------------------------------------
New_Step

! B3LYP D3BJ def2-TZVP RIJCOSX
%maxcore 2000
%pal
nprocs 4
end

*xyzfile 0 1 example.xyz

Step_End



# ------------------------------------
# TDDFT-ris step, the calculation starts
# from the previous SCF calculation
# (Rtol 1e-3, becasue TDDFT-ris is a semi-empirical method,
# no need to be that much accurate. Default Rtol 1e-6.)
# ------------------------------------
New_Step

! B3LYP D3BJ def2-TZVP RIJK moread noiter
%maxcore 2000
%pal
nprocs 4
end

%tddft
nroots 20
Rtol 1e-3
end

%basis
GTOAuxJName = "ris.bas"
GTOAuxJKName = "ris.bas"
end

%method
xckernelx 0
xckernelc 0
end

Step_End

EndRun
55 changes: 55 additions & 0 deletions TDDFT-ris/get_ris_bas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This script generates the "ris.bas" (or "ris+p.bas") file
# for the fitting basis for TDDFT-ris (or TDDFT-ris+p) method
# Simply run "python get_ris_bas.py" or "python get_ris_bas.py -p True"
# I provided parameters for 106 elements in the "radi_exponent.txt" file, revise as need.



import argparse



def gen_args():
def str2bool(str):
if str.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif str.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Unsupported value encountered.')
parser = argparse.ArgumentParser(description='Davidson')
parser.add_argument('-p', '--pfunc', type=str2bool, default=False, help='extra p function each atom?')
args = parser.parse_args()
return args

args = gen_args()

input_filename = 'radi_exponent.txt'
output_filename = 'ris.bas' if not args.pfunc else 'ris+p.bas'

with open(input_filename, 'r') as file:
lines = file.readlines()

with open(output_filename, 'w') as file:
file.write('$DATA\n\n')

for line in lines:
if line.startswith('#'):
continue
parts = line.split()

element_symbol = parts[1].lower()
theta_value = parts[-1]

file.write(f'{element_symbol}\n')
file.write('S 1\n')
file.write(f'1 {theta_value} 1.0000000\n')
if args.pfunc and element_symbol != 'h':
file.write('P 1\n')
file.write(f'1 {theta_value} 1.0000000\n')

file.write('\n')

file.write('$END')

print(f'Output written to {output_filename}')
105 changes: 105 additions & 0 deletions TDDFT-ris/radi_exponent.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# # # theta=1 theta=0.2(optimal)
#No. Elements Radii(Å) 1/R^2 0.2/R^2
1 H 0.5292 0.999914019 0.199982804
2 He 0.3113 2.889642307 0.577928461
3 Li 1.6283 0.105616916 0.021123383
4 Be 1.0855 0.237652656 0.047530531
5 B 0.8141 0.42251956 0.084503912
6 C 0.6513 0.660146268 0.132029254
7 N 0.5428 0.950435502 0.1900871
8 O 0.4652 1.293966153 0.258793231
9 F 0.4071 1.689663115 0.337932623
10 Ne 0.3618 2.139268042 0.427853608
11 Na 2.165 0.059742931 0.011948586
12 Mg 1.6711 0.100276104 0.020055221
13 Al 1.3608 0.151221565 0.030244313
14 Si 1.1477 0.212591338 0.042518268
15 P 0.9922 0.284448654 0.056889731
16 S 0.8739 0.366672931 0.073334586
17 Cl 0.7808 0.459327787 0.091865557
18 Ar 0.7056 0.562451636 0.112490327
19 K 3.293 0.025823724 0.005164745
20 Ca 2.5419 0.043339651 0.00866793
21 Sc 2.4149 0.048017995 0.009603599
22 Ti 2.2998 0.052944663 0.010588933
23 V 2.1953 0.058105143 0.011621029
24 Cr 2.1 0.06349854 0.012699708
25 Mn 2.0124 0.069147059 0.013829412
26 Fe 1.9319 0.075029671 0.015005934
27 Co 1.8575 0.081160494 0.016232099
28 Ni 1.7888 0.087514246 0.017502849
29 Cu 1.725 0.094107477 0.018821495
30 Zn 1.6654 0.100963688 0.020192738
31 Ga 1.4489 0.133390685 0.026678137
32 Ge 1.2823 0.170303292 0.034060658
33 As 1.145 0.213595134 0.042719027
34 Se 1.0424 0.257711336 0.051542267
35 Br 0.9532 0.308201154 0.061640231
36 Kr 0.8782 0.363090982 0.072618196
37 Rb 3.8487 0.018904892 0.003780978
38 Sr 2.9709 0.031726799 0.00634536
39 Y 2.8224 0.035153227 0.007030645
40 Zr 2.688 0.038756433 0.007751287
41 Nb 2.5658 0.042536008 0.008507202
42 Mo 2.4543 0.046488661 0.009297732
43 Tc 2.352 0.050620647 0.010124129
44 Ru 2.2579 0.054927891 0.010985578
45 Rh 2.1711 0.059407691 0.011881538
46 Pd 2.0907 0.064064714 0.012812943
47 Ag 2.016 0.068900325 0.013780065
48 Cd 1.9465 0.073908351 0.01478167
49 In 1.6934 0.097652467 0.019530493
50 Sn 1.4986 0.124689784 0.024937957
51 Sb 1.344 0.155025732 0.031005146
52 Te 1.2183 0.188666086 0.037733217
53 I 1.1141 0.225607732 0.045121546
54 Xe 1.0263 0.26586041 0.053172082
55 Cs 4.2433 0.015552308 0.003110462
56 Ba 3.2753 0.026103585 0.005220717
57 La 2.6673 0.039360318 0.007872064
58 Ce 2.2494 0.055343796 0.011068759
59 Pr 1.9447 0.074045232 0.014809046
60 Nd 1.7129 0.095441732 0.019088346
61 Pm 1.5303 0.119577418 0.023915484
62 Sm 1.383 0.146405694 0.029281139
63 Eu 1.2615 0.175965618 0.035193124
64 Gd 1.1596 0.208250434 0.041650087
65 Tb 1.073 0.243222016 0.048644403
66 Dy 0.9984 0.280926807 0.056185361
67 Ho 0.9335 0.321346581 0.064269316
68 Er 0.8765 0.364500801 0.07290016
69 Tm 0.8261 0.410333603 0.082066721
70 Yb 0.7812 0.458857526 0.091771505
71 Lu 0.7409 0.510132672 0.102026534
72 Hf 0.7056 0.562451636 0.112490327
73 Ta 0.6716 0.620841806 0.124168361
74 W 0.6416 0.680257937 0.136051587
75 Re 0.6141 0.742547318 0.148509464
76 Os 0.589 0.807182502 0.1614365
77 Ir 0.5657 0.875044161 0.175008832
78 Pt 0.5443 0.945204237 0.189040847
79 Au 0.5244 1.018302857 0.203660571
80 Hg 0.506 1.093707763 0.218741553
81 Tl 1.867 0.080336645 0.016067329
82 Pb 1.6523 0.102570984 0.020514197
83 Bi 1.4818 0.127533168 0.025506634
84 Po 1.3431 0.155233565 0.031046713
85 At 1.2283 0.185606604 0.037121321
86 Rn 1.1315 0.218722374 0.043744475
87 Fr 4.4479 0.014154427 0.002830885
88 Ra 3.4332 0.023757685 0.004751537
89 Ac 3.2615 0.02632495 0.00526499
90 Th 3.1061 0.029024949 0.00580499
91 Pa 2.2756 0.054076737 0.010815347
92 U 1.9767 0.071667261 0.014333452
93 Np 1.7473 0.091720703 0.018344141
94 Pu 1.4496 0.13326189 0.026652378
95 Am 1.2915 0.167885623 0.033577125
96 Cm 1.296 0.166721775 0.033344355
97 Bk 1.1247 0.221375186 0.044275037
98 Cf 1.0465 0.255695958 0.051139192
99 Es 0.9785 0.292469558 0.058493912
100 Fm 0.9188 0.331711368 0.066342274
101 Md 0.8659 0.373479569 0.074695914
102 No 0.8188 0.417682866 0.083536573
103 Lr 0.8086 0.428286963 0.085657393
Loading