@@ -13,12 +13,15 @@ def print_file_pw(info,dis):
1313 ntype 1
1414 nspin 1
1515 lmaxmax { len (info ["orbital" ])- 1 }
16+ basis_type pw
17+ ks_solver cg
1618
1719 symmetry 0
20+ gamma_only 1
1821 nbands { info ["input" ]["nbands" ]}
1922
2023 ecutwfc { info ["input" ]["ecut" ]}
21- dr2 2 .0e-8 // about iteration
24+ dr2 1 .0e-8 // about iteration
2225 niter 1000
2326
2427 smearing gauss
@@ -46,7 +49,7 @@ def print_file_pw(info,dis):
4649 file .write (textwrap .dedent (f"""\
4750 INPUT_ORBITAL_INFORMATION
4851 <SPHERICAL_BESSEL>
49- 1 // smooth or not
52+ { int ( info [ "input" ][ "smooth" ]) } // smooth or not
5053 0.1 // sigma
5154 { info ["input" ]["ecut" ]} // energy cutoff for spherical bessel functions(Ry)
5255 { info ["input" ]["rcut" ]} // cutoff of wavefunctions(a.u.)
@@ -114,6 +117,18 @@ def print_file_pw(info,dis):
114117 EXEC={ info ["exe" ]["exe_pw" ]}
115118 mpirun -n { core } -env OMP_NUM_THREADS=1 $EXEC
116119 """ ))
120+ elif utils .sub == "sbatch" :
121+ with open ("sub.sh" ,"w" ) as file :
122+ core = info ["exe" ]["qsub" ][0 ]* info ["exe" ]["qsub" ][1 ]
123+ file .write (textwrap .dedent (f"""\
124+ #!/bin/bash
125+ #SBATCH -J { info ["input" ]["element" ]} _{ dis }
126+ #SBATCH -p regular
127+ #SBATCH -N { info ["exe" ]["qsub" ][0 ]}
128+ #SBATCH -o test.out
129+ EXEC={ info ["exe" ]["exe_pw" ]}
130+ mpirun -n { core } -env OMP_NUM_THREADS=1 $EXEC
131+ """ ))
117132 elif utils .sub == "bsub" :
118133 with open ("sub.sh" ,"w" ) as file :
119134 core = info ["exe" ]["qsub" ][0 ]* info ["exe" ]["qsub" ][1 ]
@@ -134,25 +149,33 @@ def print_file_pw(info,dis):
134149
135150def print_file_opt (info ,dis ):
136151
137- with open ("input.json " ,"w" ) as file :
152+ with open ("INPUT " ,"w" ) as file :
138153 input = {
139- "file_list" : [ f'../{ info ["input" ]["element" ]} -{ info ["input" ]["rcut" ]} -{ distance } /test.{ utils .lat0 } .dat' for distance in dis [info ["input" ]["element" ]] ],
154+ "file_list" : {
155+ "origin" : [ f'../{ info ["input" ]["element" ]} -{ info ["input" ]["rcut" ]} -{ distance } /orb_matrix/orb_matrix.0.dat' for distance in dis [info ["input" ]["element" ]] ],
156+ "linear" : [[ f'../{ info ["input" ]["element" ]} -{ info ["input" ]["rcut" ]} -{ distance } /orb_matrix/orb_matrix.1.dat' for distance in dis [info ["input" ]["element" ]] ]]
157+ },
140158 "info" : {
141159 "Nt_all" : [info ["input" ]["element" ]],
142160 "Nu" : {info ["input" ]["element" ] : info ["orbital" ]},
143- "Nb_true" : info ["input" ]["ref_bands" ] if isinstance (info ["input" ]["ref_bands" ],list ) else [info ["input" ]["ref_bands" ]] * len (dis [info ["input" ]["element" ]]),
144- "weight" : [1 ] * len (dis [info ["input" ]["element" ]]),
145161 "Rcut" : {info ["input" ]["element" ] : info ["input" ]["rcut" ]},
146162 "dr" : {info ["input" ]["element" ] : utils .dr },
147163 "Ecut" : {info ["input" ]["element" ] : info ["input" ]["ecut" ]},
148- "lr" : utils .lr
164+ "lr" : utils .lr ,
165+ "cal_T" : False ,
166+ "cal_smooth" : info ["input" ]["smooth" ]
167+ },
168+ "weight" :
169+ {
170+ "stru" : [1 ] * len (dis [info ["input" ]["element" ]]),
171+ "bands_file" : [ f'../{ info ["input" ]["element" ]} -{ info ["input" ]["rcut" ]} -{ distance } /OUT.ABACUS/istate.info' for distance in dis [info ["input" ]["element" ]] ]
149172 },
150173 "C_init_info" : {
151174 "init_from_file" : False
152175 },
153176 "V_info" : {
154177 "same_band" : True ,
155- "init_from_file" : False
178+ "init_from_file" : True
156179 }
157180 }
158181 file .write (json .dumps (input ,indent = 4 ))
@@ -173,6 +196,19 @@ def print_file_opt(info,dis):
173196 EXEC={ info ["exe" ]["exe_orbital" ]}
174197 python3 $EXEC
175198 """ ))
199+ elif utils .sub == "sbatch" :
200+ with open ("sub.sh" ,"w" ) as file :
201+ core = info ["exe" ]["qsub" ][0 ]* info ["exe" ]["qsub" ][1 ]
202+ file .write (textwrap .dedent (f"""\
203+ #!/bin/bash
204+ #SBATCH -J { info ["input" ]["element" ]} _opt-orb
205+ #SBATCH -p regular
206+ #SBATCH -N 1
207+ #SBATCH -o test.out
208+ export OMP_NUM_THREADS={ core }
209+ EXEC={ info ["exe" ]["exe_orbital" ]}
210+ python3 $EXEC
211+ """ ))
176212 elif utils .sub == "bsub" :
177213 with open ("sub.sh" ,"w" ) as file :
178214 file .write (textwrap .dedent (f"""\
0 commit comments