molSimplify 1.7.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (651) hide show
  1. docs/source/conf.py +224 -0
  2. molSimplify/Classes/__init__.py +6 -0
  3. molSimplify/Classes/atom3D.py +235 -0
  4. molSimplify/Classes/dft_obs.py +130 -0
  5. molSimplify/Classes/globalvars.py +827 -0
  6. molSimplify/Classes/helpers.py +161 -0
  7. molSimplify/Classes/ligand.py +2330 -0
  8. molSimplify/Classes/mGUI.py +2493 -0
  9. molSimplify/Classes/mWidgets.py +438 -0
  10. molSimplify/Classes/miniGUI.py +41 -0
  11. molSimplify/Classes/mol2D.py +260 -0
  12. molSimplify/Classes/mol3D.py +5846 -0
  13. molSimplify/Classes/monomer3D.py +253 -0
  14. molSimplify/Classes/partialcharges.py +226 -0
  15. molSimplify/Classes/protein3D.py +1178 -0
  16. molSimplify/Classes/rundiag.py +151 -0
  17. molSimplify/Data/ML.dat +212 -0
  18. molSimplify/Data/MLS_FSR_for_inter.dat +23 -0
  19. molSimplify/Data/MLS_FSR_for_inter2.dat +23 -0
  20. molSimplify/Data/MLS_angle_for_click.dat +8 -0
  21. molSimplify/Data/MLS_angle_for_inter.dat +23 -0
  22. molSimplify/Data/MLS_angle_for_inter2.dat +48 -0
  23. molSimplify/Data/MLS_angle_for_intra.dat +10 -0
  24. molSimplify/Data/MLS_angle_for_intra2.dat +6 -0
  25. molSimplify/Data/MLS_angle_for_oa.dat +18 -0
  26. molSimplify/Data/ML_FSR_for_inter.dat +112 -0
  27. molSimplify/Data/ML_FSR_for_inter2.dat +110 -0
  28. molSimplify/Data/ML_bond_for_cat.dat +8 -0
  29. molSimplify/Data/ML_bond_for_click.dat +8 -0
  30. molSimplify/Data/ML_bond_for_inter.dat +48 -0
  31. molSimplify/Data/ML_bond_for_inter2.dat +48 -0
  32. molSimplify/Data/ML_bond_for_intra.dat +10 -0
  33. molSimplify/Data/ML_bond_for_intra2.dat +6 -0
  34. molSimplify/Data/ML_bond_for_oa.dat +18 -0
  35. molSimplify/Data/bp1.dat +21 -0
  36. molSimplify/Data/li.dat +3 -0
  37. molSimplify/Data/no.dat +2 -0
  38. molSimplify/Data/oct.dat +7 -0
  39. molSimplify/Data/pbp.dat +8 -0
  40. molSimplify/Data/spy.dat +6 -0
  41. molSimplify/Data/sqap.dat +9 -0
  42. molSimplify/Data/sqp.dat +5 -0
  43. molSimplify/Data/tbp.dat +6 -0
  44. molSimplify/Data/tdhd.dat +9 -0
  45. molSimplify/Data/thd.dat +5 -0
  46. molSimplify/Data/tpl.dat +4 -0
  47. molSimplify/Data/tpr.dat +7 -0
  48. molSimplify/Informatics/HFXsensitivity/__init__.py +0 -0
  49. molSimplify/Informatics/HFXsensitivity/measure_HFX_sensitivity_oxo_hat_reb_rel.py +443 -0
  50. molSimplify/Informatics/HFXsensitivity/measure_HFX_stable.py +346 -0
  51. molSimplify/Informatics/MOF/Linker_rotation.py +179 -0
  52. molSimplify/Informatics/MOF/MOF_descriptors.py +1299 -0
  53. molSimplify/Informatics/MOF/MOF_descriptors_alternate_functional.py +589 -0
  54. molSimplify/Informatics/MOF/MOF_functionalizer.py +1648 -0
  55. molSimplify/Informatics/MOF/PBC_functions.py +1347 -0
  56. molSimplify/Informatics/MOF/__init__.py +0 -0
  57. molSimplify/Informatics/MOF/atomic.py +267 -0
  58. molSimplify/Informatics/MOF/cluster_extraction.py +388 -0
  59. molSimplify/Informatics/MOF/fragment_MOFs_for_pormake.py +895 -0
  60. molSimplify/Informatics/MOF/monofunctionalized_BDC/index_information.py +10 -0
  61. molSimplify/Informatics/Mol2Parser.py +46 -0
  62. molSimplify/Informatics/RACassemble.py +408 -0
  63. molSimplify/Informatics/__init__.py +0 -0
  64. molSimplify/Informatics/active_learning/__init__.py +0 -0
  65. molSimplify/Informatics/active_learning/expected_improvement.py +269 -0
  66. molSimplify/Informatics/autocorrelation.py +1930 -0
  67. molSimplify/Informatics/clean_autocorrelation.py +778 -0
  68. molSimplify/Informatics/coulomb_analyze.py +67 -0
  69. molSimplify/Informatics/decoration_manager.py +193 -0
  70. molSimplify/Informatics/geo_analyze.py +88 -0
  71. molSimplify/Informatics/geometrics.py +56 -0
  72. molSimplify/Informatics/graph_analyze.py +163 -0
  73. molSimplify/Informatics/graph_racs.py +288 -0
  74. molSimplify/Informatics/jupyter_vis.py +172 -0
  75. molSimplify/Informatics/lacRACAssemble.py +2192 -0
  76. molSimplify/Informatics/lacRACAssemble_bisdithiolenes.py +236 -0
  77. molSimplify/Informatics/misc_descriptors.py +198 -0
  78. molSimplify/Informatics/organic_fingerprints.py +61 -0
  79. molSimplify/Informatics/partialcharges.py +345 -0
  80. molSimplify/Informatics/protein/activesite.py +53 -0
  81. molSimplify/Informatics/protein/pymol_add_hs.py +33 -0
  82. molSimplify/Informatics/rac155_geo.py +48 -0
  83. molSimplify/Ligands/(1_methylbenzimidazol_2_yl)pyridine.xyz +45 -0
  84. molSimplify/Ligands/1-4-dimethyl-1-2-3-triazole.xyz +15 -0
  85. molSimplify/Ligands/12crown4.mol +62 -0
  86. molSimplify/Ligands/Antipyrine.mol +58 -0
  87. molSimplify/Ligands/BPAbipy.mol +106 -0
  88. molSimplify/Ligands/Hpyrrole.mol +26 -0
  89. molSimplify/Ligands/N-quinolinylbutyramidate.xyz +31 -0
  90. molSimplify/Ligands/N-quinolinylmethylmethinylacetamidate.xyz +30 -0
  91. molSimplify/Ligands/NMe2_-1.xyz +11 -0
  92. molSimplify/Ligands/PCy3.mol +111 -0
  93. molSimplify/Ligands/PMe3.xyz +15 -0
  94. molSimplify/Ligands/PPh3.mol +76 -0
  95. molSimplify/Ligands/Propyphenazone.mol +77 -0
  96. molSimplify/Ligands/acac.mol +33 -0
  97. molSimplify/Ligands/acacen.mol +76 -0
  98. molSimplify/Ligands/acetate.smi +1 -0
  99. molSimplify/Ligands/acetate.xyz +9 -0
  100. molSimplify/Ligands/aceticacidbipyridine.mol +70 -0
  101. molSimplify/Ligands/acetonitrile.mol +17 -0
  102. molSimplify/Ligands/alanine.mol +30 -0
  103. molSimplify/Ligands/alphabetizer.py +21 -0
  104. molSimplify/Ligands/amine.mol +11 -0
  105. molSimplify/Ligands/ammonia.mol +12 -0
  106. molSimplify/Ligands/arginine.mol +58 -0
  107. molSimplify/Ligands/asparagine.mol +38 -0
  108. molSimplify/Ligands/aspartic_acid.mol +35 -0
  109. molSimplify/Ligands/azide.mol +11 -0
  110. molSimplify/Ligands/benzene.mol +28 -0
  111. molSimplify/Ligands/benzene_pi.mol +30 -0
  112. molSimplify/Ligands/benzenedithiol.mol +30 -0
  113. molSimplify/Ligands/benzenethiol.mol +30 -0
  114. molSimplify/Ligands/benzylisocy.mol +38 -0
  115. molSimplify/Ligands/bidiazine.mol +42 -0
  116. molSimplify/Ligands/bidiazole.mol +38 -0
  117. molSimplify/Ligands/bifuran.mol +38 -0
  118. molSimplify/Ligands/bihydrodiazine.mol +58 -0
  119. molSimplify/Ligands/bihydrodiazole.mol +46 -0
  120. molSimplify/Ligands/bihydrooxazine.mol +54 -0
  121. molSimplify/Ligands/bihydrooxazole.mol +42 -0
  122. molSimplify/Ligands/bihydrothiazine.mol +54 -0
  123. molSimplify/Ligands/bihydrothiazole.mol +42 -0
  124. molSimplify/Ligands/biimidazole.mol +38 -0
  125. molSimplify/Ligands/bioxazole.mol +34 -0
  126. molSimplify/Ligands/bipy.mol +46 -0
  127. molSimplify/Ligands/bipyrazine.xyz +20 -0
  128. molSimplify/Ligands/bipyrimidine.mol +42 -0
  129. molSimplify/Ligands/bipyrrole.mol +42 -0
  130. molSimplify/Ligands/bisnapthyridylpyridine.mol +111 -0
  131. molSimplify/Ligands/bithiazole.mol +34 -0
  132. molSimplify/Ligands/bromide.mol +7 -0
  133. molSimplify/Ligands/bromide.smi +1 -0
  134. molSimplify/Ligands/c2.mol +9 -0
  135. molSimplify/Ligands/caprolactone.mol +41 -0
  136. molSimplify/Ligands/carbonyl.mol +8 -0
  137. molSimplify/Ligands/carboxyl.mol +13 -0
  138. molSimplify/Ligands/cat.mol +30 -0
  139. molSimplify/Ligands/chloride.mol +7 -0
  140. molSimplify/Ligands/chloride.smi +1 -0
  141. molSimplify/Ligands/chloropyridine.mol +27 -0
  142. molSimplify/Ligands/co2.mol +10 -0
  143. molSimplify/Ligands/corrolazine.mol +72 -0
  144. molSimplify/Ligands/cs.mol +8 -0
  145. molSimplify/Ligands/cyanate.xyz +5 -0
  146. molSimplify/Ligands/cyanide.mol +9 -0
  147. molSimplify/Ligands/cyanoaceticporphyrin.mol +114 -0
  148. molSimplify/Ligands/cyanopyridine.mol +29 -0
  149. molSimplify/Ligands/cyclam.mol +81 -0
  150. molSimplify/Ligands/cyclen.mol +69 -0
  151. molSimplify/Ligands/cyclopentadienyl.mol +26 -0
  152. molSimplify/Ligands/cysteine.mol +32 -0
  153. molSimplify/Ligands/diaminomethyl.mol +19 -0
  154. molSimplify/Ligands/diazine.mol +25 -0
  155. molSimplify/Ligands/diazole.mol +23 -0
  156. molSimplify/Ligands/dicyanamide.mol +15 -0
  157. molSimplify/Ligands/dihydrofuran.mol +27 -0
  158. molSimplify/Ligands/dmap.xyz +35 -0
  159. molSimplify/Ligands/dmf.mol +28 -0
  160. molSimplify/Ligands/dmi.mol +41 -0
  161. molSimplify/Ligands/dmpe.mol +52 -0
  162. molSimplify/Ligands/dpmu.mol +47 -0
  163. molSimplify/Ligands/dppe.mol +112 -0
  164. molSimplify/Ligands/edta.mol +69 -0
  165. molSimplify/Ligands/en.mol +28 -0
  166. molSimplify/Ligands/ethanethiol.mol +21 -0
  167. molSimplify/Ligands/ethanolamine.mol +26 -0
  168. molSimplify/Ligands/ethbipy.mol +70 -0
  169. molSimplify/Ligands/ethyl.mol +19 -0
  170. molSimplify/Ligands/ethylamine.mol +24 -0
  171. molSimplify/Ligands/ethylene.mol +16 -0
  172. molSimplify/Ligands/ethylesteracac.mol +57 -0
  173. molSimplify/Ligands/fluoride.mol +7 -0
  174. molSimplify/Ligands/fluoride.smi +1 -0
  175. molSimplify/Ligands/formaldehyde.mol +12 -0
  176. molSimplify/Ligands/formamidate.xyz +8 -0
  177. molSimplify/Ligands/formate.xyz +6 -0
  178. molSimplify/Ligands/furan.mol +23 -0
  179. molSimplify/Ligands/glutamic_acid.mol +42 -0
  180. molSimplify/Ligands/glutamine.mol +44 -0
  181. molSimplify/Ligands/glycinate.mol +23 -0
  182. molSimplify/Ligands/glycine.mol +24 -0
  183. molSimplify/Ligands/h2s.mol +10 -0
  184. molSimplify/Ligands/helium.mol +6 -0
  185. molSimplify/Ligands/histidine.mol +45 -0
  186. molSimplify/Ligands/hmpa.mol +62 -0
  187. molSimplify/Ligands/hs-.mol +9 -0
  188. molSimplify/Ligands/hydride.mol +7 -0
  189. molSimplify/Ligands/hydrocarboxyacetylide.xyz +8 -0
  190. molSimplify/Ligands/hydrocyanide.mol +10 -0
  191. molSimplify/Ligands/hydrodiazine.mol +33 -0
  192. molSimplify/Ligands/hydrodiazole.mol +27 -0
  193. molSimplify/Ligands/hydrogensulfide.mol +10 -0
  194. molSimplify/Ligands/hydroisocyanide.mol +11 -0
  195. molSimplify/Ligands/hydrooxazine.mol +31 -0
  196. molSimplify/Ligands/hydrooxazole.mol +25 -0
  197. molSimplify/Ligands/hydrothiazine.mol +31 -0
  198. molSimplify/Ligands/hydrothiazole.mol +25 -0
  199. molSimplify/Ligands/hydroxyl.mol +9 -0
  200. molSimplify/Ligands/imidazole.mol +23 -0
  201. molSimplify/Ligands/imidazolidinone.mol +29 -0
  202. molSimplify/Ligands/imine.mol +13 -0
  203. molSimplify/Ligands/iminodiacetic.mol +33 -0
  204. molSimplify/Ligands/iodide.mol +7 -0
  205. molSimplify/Ligands/iodobenzene.xyz +14 -0
  206. molSimplify/Ligands/isoleucine.mol +48 -0
  207. molSimplify/Ligands/isothiocyanate.mol +11 -0
  208. molSimplify/Ligands/leucine.mol +48 -0
  209. molSimplify/Ligands/ligands.dict +257 -0
  210. molSimplify/Ligands/lysine.mol +54 -0
  211. molSimplify/Ligands/mebenzenedithiol.mol +36 -0
  212. molSimplify/Ligands/mebim_py.xyz +29 -0
  213. molSimplify/Ligands/mebim_pz.xyz +28 -0
  214. molSimplify/Ligands/mebipy.mol +58 -0
  215. molSimplify/Ligands/mecat.mol +36 -0
  216. molSimplify/Ligands/methanal.mol +11 -0
  217. molSimplify/Ligands/methanethiol.mol +15 -0
  218. molSimplify/Ligands/methanol.mol +16 -0
  219. molSimplify/Ligands/methionine.mol +44 -0
  220. molSimplify/Ligands/methyl.mol +13 -0
  221. molSimplify/Ligands/methylacetylide.xyz +8 -0
  222. molSimplify/Ligands/methylamine.mol +19 -0
  223. molSimplify/Ligands/methylazide.xyz +9 -0
  224. molSimplify/Ligands/methylisocy.mol +17 -0
  225. molSimplify/Ligands/methylpyridine.mol +33 -0
  226. molSimplify/Ligands/n2.mol +8 -0
  227. molSimplify/Ligands/n4py.xyz +51 -0
  228. molSimplify/Ligands/nch.mol +10 -0
  229. molSimplify/Ligands/nco-.mol +11 -0
  230. molSimplify/Ligands/nethanolamine.mol +26 -0
  231. molSimplify/Ligands/nitrate.mol +14 -0
  232. molSimplify/Ligands/nitrite.mol +11 -0
  233. molSimplify/Ligands/nitro.mol +11 -0
  234. molSimplify/Ligands/nitrobipy.mol +54 -0
  235. molSimplify/Ligands/nitroso.mol +8 -0
  236. molSimplify/Ligands/nme3.mol +30 -0
  237. molSimplify/Ligands/no-.mol +10 -0
  238. molSimplify/Ligands/no2-.mol +11 -0
  239. molSimplify/Ligands/noxygen.mol +8 -0
  240. molSimplify/Ligands/ns-.mol +10 -0
  241. molSimplify/Ligands/o-pyridylbenzene.xyz +23 -0
  242. molSimplify/Ligands/o-pyridylphenylanion.xyz +22 -0
  243. molSimplify/Ligands/o2-.mol +9 -0
  244. molSimplify/Ligands/o2.xyz +4 -0
  245. molSimplify/Ligands/och2.mol +12 -0
  246. molSimplify/Ligands/oethanolamine.mol +26 -0
  247. molSimplify/Ligands/ome2.mol +22 -0
  248. molSimplify/Ligands/ooh.xyz +5 -0
  249. molSimplify/Ligands/oxalate.mol +17 -0
  250. molSimplify/Ligands/oxalate.smi +1 -0
  251. molSimplify/Ligands/oxygen.mol +7 -0
  252. molSimplify/Ligands/pentacyanocyclopentadienide.mol +36 -0
  253. molSimplify/Ligands/ph2-.mol +11 -0
  254. molSimplify/Ligands/ph3.mol +12 -0
  255. molSimplify/Ligands/phen.mol +51 -0
  256. molSimplify/Ligands/phenacac.mol +63 -0
  257. molSimplify/Ligands/phenalalanine.mol +51 -0
  258. molSimplify/Ligands/phendione.mol +51 -0
  259. molSimplify/Ligands/phenphen.mol +75 -0
  260. molSimplify/Ligands/phenylbenzoxazole.mol +54 -0
  261. molSimplify/Ligands/phenylcyc.mol +99 -0
  262. molSimplify/Ligands/phenylenediamine.mol +37 -0
  263. molSimplify/Ligands/phenylisocy.mol +32 -0
  264. molSimplify/Ligands/phosacidbipy.mol +66 -0
  265. molSimplify/Ligands/phosphine.mol +13 -0
  266. molSimplify/Ligands/phosphorine.mol +27 -0
  267. molSimplify/Ligands/phosphorustrifluoride.mol +12 -0
  268. molSimplify/Ligands/phthalocyanine.mol +126 -0
  269. molSimplify/Ligands/pme3o.mol +32 -0
  270. molSimplify/Ligands/porphyrin.mol +82 -0
  271. molSimplify/Ligands/pph3o.mol +77 -0
  272. molSimplify/Ligands/proline.mol +39 -0
  273. molSimplify/Ligands/propdiol.mol +21 -0
  274. molSimplify/Ligands/propylene.mol +23 -0
  275. molSimplify/Ligands/pyridine.mol +27 -0
  276. molSimplify/Ligands/pyrimidone.mol +27 -0
  277. molSimplify/Ligands/pyrrole.mol +24 -0
  278. molSimplify/Ligands/quinoxalinedithiol.mol +39 -0
  279. molSimplify/Ligands/s2-.mol +9 -0
  280. molSimplify/Ligands/salen.mol +75 -0
  281. molSimplify/Ligands/salphen.mol +84 -0
  282. molSimplify/Ligands/serine.mol +32 -0
  283. molSimplify/Ligands/simple_ligands.dict +14 -0
  284. molSimplify/Ligands/sulfacidbipy.mol +63 -0
  285. molSimplify/Ligands/tbucat.mol +54 -0
  286. molSimplify/Ligands/tbuphisocy.mol +56 -0
  287. molSimplify/Ligands/tbutylcyclen.mol +166 -0
  288. molSimplify/Ligands/tbutylisocy.mol +35 -0
  289. molSimplify/Ligands/tbutylthiol.mol +33 -0
  290. molSimplify/Ligands/tcnoet.mol +43 -0
  291. molSimplify/Ligands/tcnoetOH.mol +45 -0
  292. molSimplify/Ligands/terpy.mol +65 -0
  293. molSimplify/Ligands/tetrahydrofuran.mol +31 -0
  294. molSimplify/Ligands/thiane.mol +37 -0
  295. molSimplify/Ligands/thiazole.mol +21 -0
  296. molSimplify/Ligands/thiocyanate.mol +11 -0
  297. molSimplify/Ligands/thiol.mol +9 -0
  298. molSimplify/Ligands/thiophene.mol +23 -0
  299. molSimplify/Ligands/thiopyridine.mol +29 -0
  300. molSimplify/Ligands/threonine.mol +38 -0
  301. molSimplify/Ligands/tpp.mol +165 -0
  302. molSimplify/Ligands/tricyanomethyl.mol +19 -0
  303. molSimplify/Ligands/trifluoromethyl.mol +13 -0
  304. molSimplify/Ligands/tryptophan.mol +60 -0
  305. molSimplify/Ligands/tyrosine.mol +53 -0
  306. molSimplify/Ligands/uthiol.mol +11 -0
  307. molSimplify/Ligands/uthiolme2.mol +23 -0
  308. molSimplify/Ligands/valine.mol +42 -0
  309. molSimplify/Ligands/water.mol +10 -0
  310. molSimplify/Ligands/x.mol +6 -0
  311. molSimplify/Scripts/__init__.py +0 -0
  312. molSimplify/Scripts/addtodb.py +308 -0
  313. molSimplify/Scripts/cellbuilder.py +1592 -0
  314. molSimplify/Scripts/cellbuilder_tools.py +701 -0
  315. molSimplify/Scripts/chains.py +342 -0
  316. molSimplify/Scripts/convert_2to3.py +23 -0
  317. molSimplify/Scripts/dbinteract.py +631 -0
  318. molSimplify/Scripts/distgeom.py +617 -0
  319. molSimplify/Scripts/findcorrelations.py +287 -0
  320. molSimplify/Scripts/generator.py +267 -0
  321. molSimplify/Scripts/geometry.py +1224 -0
  322. molSimplify/Scripts/grabguivars.py +845 -0
  323. molSimplify/Scripts/in_b3lyp_usetc.py +141 -0
  324. molSimplify/Scripts/inparse.py +1673 -0
  325. molSimplify/Scripts/io.py +1149 -0
  326. molSimplify/Scripts/isomers.py +415 -0
  327. molSimplify/Scripts/jobgen.py +247 -0
  328. molSimplify/Scripts/krr_prep.py +1262 -0
  329. molSimplify/Scripts/molSimplify_io.py +18 -0
  330. molSimplify/Scripts/molden2psi4wfn.py +166 -0
  331. molSimplify/Scripts/namegen.py +32 -0
  332. molSimplify/Scripts/nn_prep.py +561 -0
  333. molSimplify/Scripts/oct_check_mols.py +782 -0
  334. molSimplify/Scripts/periodic_QE.py +97 -0
  335. molSimplify/Scripts/postmold.py +304 -0
  336. molSimplify/Scripts/postmwfn.py +709 -0
  337. molSimplify/Scripts/postparse.py +488 -0
  338. molSimplify/Scripts/postproc.py +139 -0
  339. molSimplify/Scripts/qcgen.py +1450 -0
  340. molSimplify/Scripts/rmsd.py +489 -0
  341. molSimplify/Scripts/rungen.py +670 -0
  342. molSimplify/Scripts/structgen.py +3040 -0
  343. molSimplify/Scripts/tf_nn_prep.py +894 -0
  344. molSimplify/Scripts/tsgen.py +295 -0
  345. molSimplify/Scripts/uq_calibration.py +69 -0
  346. molSimplify/__init__.py +0 -0
  347. molSimplify/__main__.py +197 -0
  348. molSimplify/icons/chemdb.png +0 -0
  349. molSimplify/icons/hjklogo.png +0 -0
  350. molSimplify/icons/icon.png +0 -0
  351. molSimplify/icons/logo.png +0 -0
  352. molSimplify/icons/logo_old.png +0 -0
  353. molSimplify/icons/petachem.png +0 -0
  354. molSimplify/icons/petachem2.png +0 -0
  355. molSimplify/icons/petachem_full.png +0 -0
  356. molSimplify/icons/pythonlogo.png +0 -0
  357. molSimplify/icons/sge copy.png +0 -0
  358. molSimplify/icons/sge.png +0 -0
  359. molSimplify/icons/slurm.png +0 -0
  360. molSimplify/icons/wft1.png +0 -0
  361. molSimplify/icons/wft2.png +0 -0
  362. molSimplify/icons/wft3.png +0 -0
  363. molSimplify/ml/__init__.py +0 -0
  364. molSimplify/ml/kernels.py +36 -0
  365. molSimplify/ml/layers.py +29 -0
  366. molSimplify/molscontrol/__init__.py +14 -0
  367. molSimplify/molscontrol/_version.py +521 -0
  368. molSimplify/molscontrol/clf_tools.py +144 -0
  369. molSimplify/molscontrol/data/README.md +21 -0
  370. molSimplify/molscontrol/data/look_and_say.dat +15 -0
  371. molSimplify/molscontrol/dynamic_classifier.py +514 -0
  372. molSimplify/molscontrol/io_tools.py +363 -0
  373. molSimplify/molscontrol/molscontrol.py +49 -0
  374. molSimplify/molscontrol/terachem/jobscript_control.sh +31 -0
  375. molSimplify/molscontrol/terachem/terachem_input +22 -0
  376. molSimplify/python_krr/X_train_TS.csv +535 -0
  377. molSimplify/python_krr/__init__.py +0 -0
  378. molSimplify/python_krr/hat2_X_mean_std.csv +3 -0
  379. molSimplify/python_krr/hat2_feature_names.csv +1 -0
  380. molSimplify/python_krr/hat2_y_mean_std.csv +2 -0
  381. molSimplify/python_krr/hat_X_mean_std.csv +6 -0
  382. molSimplify/python_krr/hat_feature_names.csv +1 -0
  383. molSimplify/python_krr/hat_krr_X_train.csv +5205 -0
  384. molSimplify/python_krr/hat_krr_dual_coef.csv +1 -0
  385. molSimplify/python_krr/hat_y_mean_std.csv +2 -0
  386. molSimplify/python_krr/sklearn_models.py +34 -0
  387. molSimplify/python_krr/y_train_TS.csv +535 -0
  388. molSimplify/python_nn/ANN.py +198 -0
  389. molSimplify/python_nn/__init__.py +0 -0
  390. molSimplify/python_nn/clf_analysis_tool.py +125 -0
  391. molSimplify/python_nn/dictionary_toolbox.py +49 -0
  392. molSimplify/python_nn/ensemble_test.py +309 -0
  393. molSimplify/python_nn/hs_center.csv +26 -0
  394. molSimplify/python_nn/hs_scale.csv +26 -0
  395. molSimplify/python_nn/ls_center.csv +26 -0
  396. molSimplify/python_nn/ls_scale.csv +26 -0
  397. molSimplify/python_nn/ms_hs_b1.csv +50 -0
  398. molSimplify/python_nn/ms_hs_b2.csv +50 -0
  399. molSimplify/python_nn/ms_hs_b3.csv +1 -0
  400. molSimplify/python_nn/ms_hs_w1.csv +50 -0
  401. molSimplify/python_nn/ms_hs_w2.csv +50 -0
  402. molSimplify/python_nn/ms_hs_w3.csv +1 -0
  403. molSimplify/python_nn/ms_ls_b1.csv +50 -0
  404. molSimplify/python_nn/ms_ls_b2.csv +50 -0
  405. molSimplify/python_nn/ms_ls_b3.csv +1 -0
  406. molSimplify/python_nn/ms_ls_w1.csv +50 -0
  407. molSimplify/python_nn/ms_ls_w2.csv +50 -0
  408. molSimplify/python_nn/ms_ls_w3.csv +1 -0
  409. molSimplify/python_nn/ms_slope_b1.csv +50 -0
  410. molSimplify/python_nn/ms_slope_b2.csv +50 -0
  411. molSimplify/python_nn/ms_slope_b3.csv +1 -0
  412. molSimplify/python_nn/ms_slope_w1.csv +50 -0
  413. molSimplify/python_nn/ms_slope_w2.csv +50 -0
  414. molSimplify/python_nn/ms_slope_w3.csv +1 -0
  415. molSimplify/python_nn/ms_split_b1.csv +50 -0
  416. molSimplify/python_nn/ms_split_b2.csv +50 -0
  417. molSimplify/python_nn/ms_split_b3.csv +1 -0
  418. molSimplify/python_nn/ms_split_w1.csv +50 -0
  419. molSimplify/python_nn/ms_split_w2.csv +50 -0
  420. molSimplify/python_nn/ms_split_w3.csv +1 -0
  421. molSimplify/python_nn/slope_center.csv +25 -0
  422. molSimplify/python_nn/slope_scale.csv +25 -0
  423. molSimplify/python_nn/split_center.csv +26 -0
  424. molSimplify/python_nn/split_scale.csv +26 -0
  425. molSimplify/python_nn/tf_ANN.py +762 -0
  426. molSimplify/python_nn/train_data.csv +1211 -0
  427. molSimplify/tf_nn/__init__.py +0 -0
  428. molSimplify/tf_nn/geo_static_clf/geo_static_clf_model.h5 +0 -0
  429. molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_name.csv +1591 -0
  430. molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_x.csv +2790 -0
  431. molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_y.csv +2790 -0
  432. molSimplify/tf_nn/geo_static_clf/geo_static_clf_vars.csv +154 -0
  433. molSimplify/tf_nn/geos/hs_ii_bl_x.csv +1577 -0
  434. molSimplify/tf_nn/geos/hs_ii_bl_y.csv +1577 -0
  435. molSimplify/tf_nn/geos/hs_ii_model.h5 +0 -0
  436. molSimplify/tf_nn/geos/hs_ii_model.json +1 -0
  437. molSimplify/tf_nn/geos/hs_ii_vars.csv +154 -0
  438. molSimplify/tf_nn/geos/hs_iii_bl_x.csv +1659 -0
  439. molSimplify/tf_nn/geos/hs_iii_bl_y.csv +1659 -0
  440. molSimplify/tf_nn/geos/hs_iii_model.h5 +0 -0
  441. molSimplify/tf_nn/geos/hs_iii_model.json +1 -0
  442. molSimplify/tf_nn/geos/hs_iii_vars.csv +154 -0
  443. molSimplify/tf_nn/geos/ls_ii_bl_x.csv +1374 -0
  444. molSimplify/tf_nn/geos/ls_ii_bl_y.csv +1374 -0
  445. molSimplify/tf_nn/geos/ls_ii_model.h5 +0 -0
  446. molSimplify/tf_nn/geos/ls_ii_model.json +1 -0
  447. molSimplify/tf_nn/geos/ls_ii_vars.csv +154 -0
  448. molSimplify/tf_nn/geos/ls_iii_bl_x.csv +1364 -0
  449. molSimplify/tf_nn/geos/ls_iii_bl_y.csv +1364 -0
  450. molSimplify/tf_nn/geos/ls_iii_model.h5 +0 -0
  451. molSimplify/tf_nn/geos/ls_iii_model.json +1 -0
  452. molSimplify/tf_nn/geos/ls_iii_vars.csv +154 -0
  453. molSimplify/tf_nn/homolumo/gap_model.h5 +0 -0
  454. molSimplify/tf_nn/homolumo/gap_model.json +1 -0
  455. molSimplify/tf_nn/homolumo/gap_test_names.csv +175 -0
  456. molSimplify/tf_nn/homolumo/gap_test_x.csv +176 -0
  457. molSimplify/tf_nn/homolumo/gap_test_y.csv +176 -0
  458. molSimplify/tf_nn/homolumo/gap_train_names.csv +699 -0
  459. molSimplify/tf_nn/homolumo/gap_train_x.csv +700 -0
  460. molSimplify/tf_nn/homolumo/gap_train_y.csv +700 -0
  461. molSimplify/tf_nn/homolumo/gap_vars.csv +153 -0
  462. molSimplify/tf_nn/homolumo/homo_model.h5 +0 -0
  463. molSimplify/tf_nn/homolumo/homo_model.json +126 -0
  464. molSimplify/tf_nn/homolumo/homo_test_names.csv +175 -0
  465. molSimplify/tf_nn/homolumo/homo_test_x.csv +176 -0
  466. molSimplify/tf_nn/homolumo/homo_test_y.csv +176 -0
  467. molSimplify/tf_nn/homolumo/homo_train_names.csv +699 -0
  468. molSimplify/tf_nn/homolumo/homo_train_x.csv +700 -0
  469. molSimplify/tf_nn/homolumo/homo_train_y.csv +700 -0
  470. molSimplify/tf_nn/homolumo/homo_vars.csv +153 -0
  471. molSimplify/tf_nn/oxoandhomo/homo_empty_info.json +7 -0
  472. molSimplify/tf_nn/oxoandhomo/homo_empty_model.h5 +0 -0
  473. molSimplify/tf_nn/oxoandhomo/homo_empty_model.json +1 -0
  474. molSimplify/tf_nn/oxoandhomo/homo_empty_test_names.csv +143 -0
  475. molSimplify/tf_nn/oxoandhomo/homo_empty_test_x.csv +144 -0
  476. molSimplify/tf_nn/oxoandhomo/homo_empty_test_y.csv +144 -0
  477. molSimplify/tf_nn/oxoandhomo/homo_empty_train_names.csv +513 -0
  478. molSimplify/tf_nn/oxoandhomo/homo_empty_train_x.csv +514 -0
  479. molSimplify/tf_nn/oxoandhomo/homo_empty_train_y.csv +514 -0
  480. molSimplify/tf_nn/oxoandhomo/homo_empty_val_names.csv +143 -0
  481. molSimplify/tf_nn/oxoandhomo/homo_empty_val_x.csv +58 -0
  482. molSimplify/tf_nn/oxoandhomo/homo_empty_val_y.csv +58 -0
  483. molSimplify/tf_nn/oxoandhomo/homo_empty_vars.csv +155 -0
  484. molSimplify/tf_nn/oxoandhomo/oxo20_info.json +7 -0
  485. molSimplify/tf_nn/oxoandhomo/oxo20_model.h5 +0 -0
  486. molSimplify/tf_nn/oxoandhomo/oxo20_model.json +1 -0
  487. molSimplify/tf_nn/oxoandhomo/oxo20_test_names.csv +143 -0
  488. molSimplify/tf_nn/oxoandhomo/oxo20_test_x.csv +144 -0
  489. molSimplify/tf_nn/oxoandhomo/oxo20_test_y.csv +144 -0
  490. molSimplify/tf_nn/oxoandhomo/oxo20_train_names.csv +513 -0
  491. molSimplify/tf_nn/oxoandhomo/oxo20_train_x.csv +514 -0
  492. molSimplify/tf_nn/oxoandhomo/oxo20_train_y.csv +514 -0
  493. molSimplify/tf_nn/oxoandhomo/oxo20_val_names.csv +143 -0
  494. molSimplify/tf_nn/oxoandhomo/oxo20_val_x.csv +58 -0
  495. molSimplify/tf_nn/oxoandhomo/oxo20_val_y.csv +58 -0
  496. molSimplify/tf_nn/oxoandhomo/oxo20_vars.csv +154 -0
  497. molSimplify/tf_nn/oxocatalysis/hat_model.h5 +0 -0
  498. molSimplify/tf_nn/oxocatalysis/hat_model.json +1 -0
  499. molSimplify/tf_nn/oxocatalysis/hat_test_names.csv +419 -0
  500. molSimplify/tf_nn/oxocatalysis/hat_test_x.csv +420 -0
  501. molSimplify/tf_nn/oxocatalysis/hat_test_y.csv +420 -0
  502. molSimplify/tf_nn/oxocatalysis/hat_train_names.csv +1507 -0
  503. molSimplify/tf_nn/oxocatalysis/hat_train_x.csv +1508 -0
  504. molSimplify/tf_nn/oxocatalysis/hat_train_y.csv +1508 -0
  505. molSimplify/tf_nn/oxocatalysis/hat_val_x.csv +169 -0
  506. molSimplify/tf_nn/oxocatalysis/hat_val_y.csv +169 -0
  507. molSimplify/tf_nn/oxocatalysis/hat_vars.csv +162 -0
  508. molSimplify/tf_nn/oxocatalysis/oxo_model.h5 +0 -0
  509. molSimplify/tf_nn/oxocatalysis/oxo_model.json +1 -0
  510. molSimplify/tf_nn/oxocatalysis/oxo_test_names.csv +527 -0
  511. molSimplify/tf_nn/oxocatalysis/oxo_test_x.csv +528 -0
  512. molSimplify/tf_nn/oxocatalysis/oxo_test_y.csv +528 -0
  513. molSimplify/tf_nn/oxocatalysis/oxo_train_names.csv +1897 -0
  514. molSimplify/tf_nn/oxocatalysis/oxo_train_x.csv +1898 -0
  515. molSimplify/tf_nn/oxocatalysis/oxo_train_y.csv +1898 -0
  516. molSimplify/tf_nn/oxocatalysis/oxo_val_x.csv +212 -0
  517. molSimplify/tf_nn/oxocatalysis/oxo_val_y.csv +212 -0
  518. molSimplify/tf_nn/oxocatalysis/oxo_vars.csv +162 -0
  519. molSimplify/tf_nn/rescaling_data/gap_mean_x.csv +153 -0
  520. molSimplify/tf_nn/rescaling_data/gap_mean_y.csv +1 -0
  521. molSimplify/tf_nn/rescaling_data/gap_var_x.csv +153 -0
  522. molSimplify/tf_nn/rescaling_data/gap_var_y.csv +1 -0
  523. molSimplify/tf_nn/rescaling_data/geo_static_clf_mean_x.csv +154 -0
  524. molSimplify/tf_nn/rescaling_data/geo_static_clf_mean_y.csv +1 -0
  525. molSimplify/tf_nn/rescaling_data/geo_static_clf_var_x.csv +154 -0
  526. molSimplify/tf_nn/rescaling_data/geo_static_clf_var_y.csv +1 -0
  527. molSimplify/tf_nn/rescaling_data/hat_mean_x.csv +162 -0
  528. molSimplify/tf_nn/rescaling_data/hat_mean_y.csv +1 -0
  529. molSimplify/tf_nn/rescaling_data/hat_var_x.csv +162 -0
  530. molSimplify/tf_nn/rescaling_data/hat_var_y.csv +1 -0
  531. molSimplify/tf_nn/rescaling_data/homo_empty_mean_x.csv +155 -0
  532. molSimplify/tf_nn/rescaling_data/homo_empty_mean_y.csv +1 -0
  533. molSimplify/tf_nn/rescaling_data/homo_empty_var_x.csv +155 -0
  534. molSimplify/tf_nn/rescaling_data/homo_empty_var_y.csv +1 -0
  535. molSimplify/tf_nn/rescaling_data/homo_mean_x.csv +153 -0
  536. molSimplify/tf_nn/rescaling_data/homo_mean_y.csv +1 -0
  537. molSimplify/tf_nn/rescaling_data/homo_var_x.csv +153 -0
  538. molSimplify/tf_nn/rescaling_data/homo_var_y.csv +1 -0
  539. molSimplify/tf_nn/rescaling_data/hs_ii_mean_x.csv +154 -0
  540. molSimplify/tf_nn/rescaling_data/hs_ii_mean_y.csv +3 -0
  541. molSimplify/tf_nn/rescaling_data/hs_ii_var_x.csv +154 -0
  542. molSimplify/tf_nn/rescaling_data/hs_ii_var_y.csv +3 -0
  543. molSimplify/tf_nn/rescaling_data/hs_iii_mean_x.csv +154 -0
  544. molSimplify/tf_nn/rescaling_data/hs_iii_mean_y.csv +3 -0
  545. molSimplify/tf_nn/rescaling_data/hs_iii_var_x.csv +154 -0
  546. molSimplify/tf_nn/rescaling_data/hs_iii_var_y.csv +3 -0
  547. molSimplify/tf_nn/rescaling_data/ls_ii_mean_x.csv +154 -0
  548. molSimplify/tf_nn/rescaling_data/ls_ii_mean_y.csv +3 -0
  549. molSimplify/tf_nn/rescaling_data/ls_ii_var_x.csv +154 -0
  550. molSimplify/tf_nn/rescaling_data/ls_ii_var_y.csv +3 -0
  551. molSimplify/tf_nn/rescaling_data/ls_iii_mean_x.csv +154 -0
  552. molSimplify/tf_nn/rescaling_data/ls_iii_mean_y.csv +3 -0
  553. molSimplify/tf_nn/rescaling_data/ls_iii_var_x.csv +154 -0
  554. molSimplify/tf_nn/rescaling_data/ls_iii_var_y.csv +3 -0
  555. molSimplify/tf_nn/rescaling_data/oxo20_mean_x.csv +154 -0
  556. molSimplify/tf_nn/rescaling_data/oxo20_mean_y.csv +1 -0
  557. molSimplify/tf_nn/rescaling_data/oxo20_var_x.csv +154 -0
  558. molSimplify/tf_nn/rescaling_data/oxo20_var_y.csv +1 -0
  559. molSimplify/tf_nn/rescaling_data/oxo_mean_x.csv +162 -0
  560. molSimplify/tf_nn/rescaling_data/oxo_mean_y.csv +1 -0
  561. molSimplify/tf_nn/rescaling_data/oxo_var_x.csv +162 -0
  562. molSimplify/tf_nn/rescaling_data/oxo_var_y.csv +1 -0
  563. molSimplify/tf_nn/rescaling_data/sc_static_clf_mean_x.csv +154 -0
  564. molSimplify/tf_nn/rescaling_data/sc_static_clf_mean_y.csv +1 -0
  565. molSimplify/tf_nn/rescaling_data/sc_static_clf_var_x.csv +154 -0
  566. molSimplify/tf_nn/rescaling_data/sc_static_clf_var_y.csv +1 -0
  567. molSimplify/tf_nn/rescaling_data/split_mean_x.csv +155 -0
  568. molSimplify/tf_nn/rescaling_data/split_mean_y.csv +1 -0
  569. molSimplify/tf_nn/rescaling_data/split_var_x.csv +155 -0
  570. molSimplify/tf_nn/rescaling_data/split_var_y.csv +1 -0
  571. molSimplify/tf_nn/sc_static_clf/sc_static_clf_model.h5 +0 -0
  572. molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_name.csv +1591 -0
  573. molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_x.csv +1592 -0
  574. molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_y.csv +1592 -0
  575. molSimplify/tf_nn/sc_static_clf/sc_static_clf_vars.csv +154 -0
  576. molSimplify/tf_nn/split/split_model.h5 +0 -0
  577. molSimplify/tf_nn/split/split_model.json +1 -0
  578. molSimplify/tf_nn/split/split_vars.csv +155 -0
  579. molSimplify/tf_nn/split/split_x.csv +1902 -0
  580. molSimplify/tf_nn/split/split_y.csv +1902 -0
  581. molSimplify/tf_nn/split/train_names.csv +1901 -0
  582. molSimplify/utils/__init__.py +0 -0
  583. molSimplify/utils/decorators.py +16 -0
  584. molSimplify/utils/metaclasses.py +12 -0
  585. molSimplify/utils/tensorflow.py +23 -0
  586. molSimplify/utils/timer.py +16 -0
  587. molSimplify-1.7.4.dist-info/LICENSE +674 -0
  588. molSimplify-1.7.4.dist-info/METADATA +821 -0
  589. molSimplify-1.7.4.dist-info/RECORD +651 -0
  590. molSimplify-1.7.4.dist-info/WHEEL +5 -0
  591. molSimplify-1.7.4.dist-info/entry_points.txt +3 -0
  592. molSimplify-1.7.4.dist-info/top_level.txt +4 -0
  593. tests/generateTests.py +122 -0
  594. tests/helperFuncs.py +658 -0
  595. tests/informatics/test_MOF_descriptors.py +128 -0
  596. tests/informatics/test_active_learning.py +113 -0
  597. tests/informatics/test_coulomb_analyze.py +24 -0
  598. tests/informatics/test_graph_racs.py +193 -0
  599. tests/ml/test_kernels.py +20 -0
  600. tests/ml/test_layers.py +47 -0
  601. tests/runtest.py +10 -0
  602. tests/test_Mol2D.py +128 -0
  603. tests/test_basic_imports.py +62 -0
  604. tests/test_bidentate.py +25 -0
  605. tests/test_cli.py +20 -0
  606. tests/test_distgeom.py +106 -0
  607. tests/test_example_1.py +29 -0
  608. tests/test_example_3.py +31 -0
  609. tests/test_example_5.py +43 -0
  610. tests/test_example_7.py +28 -0
  611. tests/test_example_8.py +15 -0
  612. tests/test_example_tbp.py +15 -0
  613. tests/test_ff_xtb.py +111 -0
  614. tests/test_geocheck_oct.py +26 -0
  615. tests/test_geocheck_one_empty.py +15 -0
  616. tests/test_geometry.py +44 -0
  617. tests/test_inparse.py +76 -0
  618. tests/test_io.py +84 -0
  619. tests/test_jobgen.py +84 -0
  620. tests/test_joption_pythonic.py +27 -0
  621. tests/test_ligand_assign.py +58 -0
  622. tests/test_ligand_assign_consistent.py +60 -0
  623. tests/test_ligand_class.py +26 -0
  624. tests/test_ligand_from_mol_file.py +35 -0
  625. tests/test_ligands.py +86 -0
  626. tests/test_mol3D.py +337 -0
  627. tests/test_molcas_caspt2.py +15 -0
  628. tests/test_molcas_casscf.py +15 -0
  629. tests/test_old_ANNs.py +68 -0
  630. tests/test_orca_ccsdt.py +15 -0
  631. tests/test_orca_dft.py +15 -0
  632. tests/test_qcgen.py +50 -0
  633. tests/test_racs.py +124 -0
  634. tests/test_rmsd.py +68 -0
  635. tests/test_structgen_functions.py +198 -0
  636. tests/test_tetrahedral.py +29 -0
  637. tests/test_tutorial_10_part_one.py +16 -0
  638. tests/test_tutorial_10_part_two.py +15 -0
  639. tests/test_tutorial_2.py +11 -0
  640. tests/test_tutorial_3.py +15 -0
  641. tests/test_tutorial_4.py +57 -0
  642. tests/test_tutorial_6.py +10 -0
  643. tests/test_tutorial_8.py +29 -0
  644. tests/test_tutorial_9_part_one.py +15 -0
  645. tests/test_tutorial_9_part_two.py +15 -0
  646. tests/test_tutorial_qm9_part_one.py +6 -0
  647. tests/testresources/refs/racs/generate_references.py +85 -0
  648. workflows/NandyJACSAu2022/bridge_functionalizer.py +253 -0
  649. workflows/NandyJACSAu2022/frag_functionalizer.py +242 -0
  650. workflows/NandyJACSAu2022/fragment_classes.py +586 -0
  651. workflows/NandyJACSAu2022/macrocycle_synthesis.py +179 -0
@@ -0,0 +1,1450 @@
1
+ # @file qcgen.py
2
+ # Generates quantum chemistry input files
3
+ #
4
+ # Written by Kulik Group
5
+ #
6
+ # Department of Chemical Engineering, MIT
7
+
8
+ import shutil
9
+ import os
10
+
11
+ from molSimplify.Classes.globalvars import (globalvars,
12
+ romans)
13
+ from molSimplify.Classes.mol3D import mol3D
14
+
15
+
16
+ def multitcgen(args, strfiles):
17
+ """Generate multiple terachem input files at once.
18
+
19
+ Parameters
20
+ ----------
21
+ args : Namespace
22
+ Namespace of input arguments.
23
+ strfiles : list
24
+ List of xyz files produced.
25
+
26
+ Returns
27
+ -------
28
+ jobdirs : list
29
+ List of job directories with terachem input files.
30
+
31
+ """
32
+
33
+ jobdirs = []
34
+ method = False
35
+ if args.method and len(args.method) > 1:
36
+ methods = args.method
37
+ for method in methods:
38
+ jobdirs.append(tcgen(args, strfiles, method))
39
+ else:
40
+ jobdirs.append(tcgen(args, strfiles, method))
41
+ # remove original files
42
+ if not args.jobdir:
43
+ for xyzf in strfiles:
44
+ try:
45
+ os.remove(xyzf+'.molinp')
46
+ os.remove(xyzf+'.report')
47
+ except FileNotFoundError:
48
+ pass
49
+ if not args.reportonly:
50
+ try:
51
+ os.remove(xyzf+'.xyz')
52
+ except FileNotFoundError:
53
+ pass
54
+ return jobdirs
55
+
56
+
57
+ def tcgen(args, strfiles, method):
58
+ """Generate a single terachem input file.
59
+
60
+ Parameters
61
+ ----------
62
+ args : Namespace
63
+ Namespace of input arguments.
64
+ strfiles : list
65
+ List of xyz files produced.
66
+ method : str
67
+ Name of method to use, (e.g. B3LYP).
68
+
69
+ Returns
70
+ -------
71
+ jobdirs : list
72
+ List of job directory with terachem input file.
73
+
74
+ """
75
+
76
+ # global variables
77
+ # print('----- args provided to tc gen --------')
78
+ # print(args)
79
+ globs = globalvars()
80
+ jobdirs = []
81
+ coordfs = []
82
+ # Initialize the jobparams dictionary with mandatory/useful keywords. TG: removed min_coordinates cartesian
83
+ jobparams = {'run': 'minimize',
84
+ 'timings': 'yes',
85
+ 'maxit': '500',
86
+ 'scrdir': './scr',
87
+ 'method': 'b3lyp',
88
+ 'basis': 'lacvps_ecp',
89
+ 'spinmult': '1',
90
+ 'charge': '0',
91
+ 'gpus': '1',
92
+ }
93
+ # if multiple methods requested generate c directories
94
+ # Overwrite plus add any new dictionary keys from commandline input.
95
+ for xyzf in strfiles:
96
+ rdir = xyzf.rsplit('/', 1)[0]
97
+ xyzft = xyzf.rsplit('/', 1)[-1]
98
+ xyzf += '.xyz'
99
+ coordfs.append(xyzf.rsplit('/', 1)[-1])
100
+ coordname = xyzft
101
+ # Setting jobname for files + truncated name for queue.
102
+ if len(coordname) > 10:
103
+ nametrunc = coordname
104
+ else:
105
+ nametrunc = coordname
106
+ if not os.path.exists(rdir+'/'+nametrunc) and not args.jobdir:
107
+ os.makedirs(rdir+'/'+nametrunc)
108
+ mdir = rdir+'/'+nametrunc
109
+ if method:
110
+ if method[0] == 'U' or method[0] == 'u':
111
+ mmd = '/'+method[1:]
112
+ else:
113
+ mmd = '/'+method
114
+ mdir = rdir+'/'+nametrunc+mmd
115
+ if not os.path.exists(mdir):
116
+ os.makedirs(mdir)
117
+ if not args.jobdir:
118
+ jobdirs.append(mdir)
119
+ if not args.reportonly:
120
+ shutil.copy2(xyzf, mdir)
121
+ shutil.copy2(xyzf.replace('.xyz', '.molinp'),
122
+ mdir.replace('.xyz', '.molinp'))
123
+ try:
124
+ shutil.copy2(xyzf.replace('.xyz', '.report'),
125
+ mdir.replace('.xyz', '.report'))
126
+ except FileNotFoundError:
127
+ pass
128
+ elif args.jobdir:
129
+ jobdirs.append(rdir)
130
+ # if report only specified, end here
131
+ if args.reportonly:
132
+ return jobdirs
133
+ # parse extra arguments
134
+ # Method parsing, does not check if a garbage method is used here:
135
+ unrestricted = False
136
+ if method:
137
+ jobparams['method'] = method
138
+ if ('u' or 'U') in method[0]:
139
+ # Unrestricted calculation
140
+ unrestricted = True
141
+ else:
142
+ # Restricted calculation
143
+ unrestricted = False
144
+ if args.spin and int(args.spin) > 1:
145
+ jobparams['method'] = 'u'+method
146
+ unrestricted = True
147
+ else:
148
+ if args.spin and int(args.spin) >= 1:
149
+ jobparams['method'] = 'ub3lyp'
150
+ unrestricted = True
151
+ else:
152
+ jobparams['method'] = 'b3lyp'
153
+ if (args.runtyp and 'energy' in args.runtyp.lower()):
154
+ jobparams['run'] = 'energy'
155
+ elif (args.runtyp and 'ts' in args.runtyp.lower()):
156
+ jobparams['run'] = 'ts'
157
+ elif (args.runtyp and 'gradient' in args.runtyp.lower()):
158
+ jobparams['run'] = 'gradient'
159
+ if (args.gpus):
160
+ jobparams['gpus'] = args.gpus
161
+ if (args.dispersion):
162
+ jobparams['dispersion'] = args.dispersion
163
+ # Just carry over spin and charge keywords if they're set. Could do checks, none for now.
164
+ if args.spin:
165
+ jobparams['spinmult'] = args.spin
166
+ if args.charge:
167
+ if args.bcharge:
168
+ args.charge = int(args.charge)+int(args.bcharge)
169
+ jobparams['charge'] = args.charge
170
+ # Check for existence of basis and sanitize name
171
+ if args.basis:
172
+ # ecp = False # Flag not currently used, for deciding gpus_ecp code or not later. Can always specify with 'extra' command
173
+ if '*' in args.basis:
174
+ jobparams['basis'] = args.basis.replace('*', 's')
175
+ else:
176
+ jobparams['basis'] = args.basis
177
+ # Overwrite plus add any new dictionary keys from commandline input.
178
+ if args.qoption:
179
+ if len(args.qoption) % 2 != 0:
180
+ print('WARNING: wrong number of arguments in -qoption')
181
+ else:
182
+ for elem in range(0, int(0.5*len(args.qoption))):
183
+ key, val = args.qoption[2*elem], args.qoption[2*elem+1]
184
+ jobparams[key] = val
185
+ # Extra keywords for unrestricted.
186
+ if unrestricted:
187
+ # If running unrestricted, assume convergence will be more difficult for now.
188
+ jobparams['scf'] = 'diis+a'
189
+ if 'levelshift' not in jobparams:
190
+ jobparams['levelshift'] = 'yes'
191
+ elif jobparams['levelshift'] != 'yes':
192
+ print(("Warning! You're doing an unrestricted calculation but have set levelshift = %s" % (
193
+ jobparams['levelshift'])))
194
+ if 'levelshiftvala' not in jobparams:
195
+ jobparams['levelshiftvala'] = '0.25'
196
+ if 'levelshiftvalb' not in jobparams:
197
+ jobparams['levelshiftvalb'] = '0.25'
198
+ # Now we're ready to start building the input file
199
+ if not args.jobdir:
200
+ for i, jobd in enumerate(jobdirs):
201
+ with open(jobd+'/terachem_input', 'w') as output:
202
+ output.write('# file created with %s\n' % globs.PROGRAM)
203
+ jobparams['coordinates'] = coordfs[i]
204
+ for keys in list(jobparams.keys()):
205
+ output.write('%s %s\n' % (keys, jobparams[keys]))
206
+ if jobparams['run'] == 'minimize':
207
+ output.write('new_minimizer yes\n')
208
+ # output.write('min_coordinates cartesian\n')
209
+ if args.tc_fix_dihedral:
210
+ temp = mol3D()
211
+ temp.readfromxyz(strfiles[i])
212
+ metal_ind = temp.findMetal()
213
+ fixed_atoms = list()
214
+ fixed_atoms = temp.getBondedAtoms(metal_ind)
215
+ fixed_atoms = [str(int(i)+1)
216
+ for i in fixed_atoms] # 1-based indices
217
+ string_to_write = 'dihedral 0 ' + '_'.join(fixed_atoms)
218
+ # print(string_to_write)
219
+ output.write('$constraint_set \n')
220
+ output.write(string_to_write + '\n')
221
+ output.write('end\n')
222
+ elif args.jobdir:
223
+ for i, jobd in enumerate(jobdirs):
224
+ print(('jobd is ' + jobd))
225
+ if args.name:
226
+ output_filename = jobd + '/'+args.name + '.in'
227
+ else:
228
+ output_filename = jobd+'/terachem_input'
229
+ with open(output_filename, 'w') as output:
230
+ output.write('# file created with %s\n' % globs.PROGRAM)
231
+ jobparams['coordinates'] = coordfs[i]
232
+ for keys in list(jobparams.keys()):
233
+ output.write('%s %s\n' % (keys, jobparams[keys]))
234
+ if jobparams['run'] == 'minimize':
235
+ output.write('new_minimizer yes\n')
236
+ # output.write('min_coordinates cartesian\n')
237
+ if args.tc_fix_dihedral:
238
+ temp = mol3D()
239
+ temp.readfromxyz(strfiles[i])
240
+ metal_ind = temp.findMetal()
241
+ fixed_atoms = list()
242
+ fixed_atoms = temp.getBondedAtoms(metal_ind)
243
+ fixed_atoms = [str(int(i)+1)
244
+ for i in fixed_atoms] # 1-based indices
245
+ string_to_write = 'dihedral 0 ' + '_'.join(fixed_atoms)
246
+ # print(string_to_write)
247
+ output.write('$constraint_set \n')
248
+ output.write(string_to_write + '\n')
249
+ output.write('end\n')
250
+ return jobdirs
251
+
252
+
253
+ def xyz2gxyz(filename):
254
+ """Turn an XYZ file into a GAMESS XYZ file.
255
+
256
+ Parameters
257
+ ----------
258
+ filename : str
259
+ Filename of xyz file.
260
+
261
+ Returns
262
+ -------
263
+ gfilename : str
264
+ Filename of GAMESS xyz file.
265
+
266
+ """
267
+
268
+ mol = mol3D() # create mol3D object
269
+ mol.readfromxyz(filename) # read molecule
270
+ gfilename = filename.replace('.xyz', '.gxyz') # new file name
271
+ mol.writegxyz(gfilename) # write gamess formatted xyz file
272
+ return gfilename.split('.gxyz')[0]
273
+
274
+
275
+ def multigamgen(args, strfiles):
276
+ """Generate multiple GAMESS files, loops over methods.
277
+
278
+ Parameters
279
+ ----------
280
+ args : Namespace
281
+ Namespace of input arguments.
282
+ strfiles : list
283
+ List of xyz files produced.
284
+
285
+ Returns
286
+ -------
287
+ jobdirs : list
288
+ List of job directories with GAMESS input files.
289
+
290
+ """
291
+ method = False
292
+ jobdirs = []
293
+ if args.method and len(args.method) > 1:
294
+ methods = args.method
295
+ for method in methods:
296
+ jobdirs.append(gamgen(args, strfiles, method))
297
+ else:
298
+ jobdirs.append(gamgen(args, strfiles, method))
299
+ # remove original files
300
+ for xyzf in strfiles:
301
+ os.remove(xyzf+'.xyz')
302
+ os.remove(xyzf+'.gxyz')
303
+ os.remove(xyzf+'.molinp')
304
+ return jobdirs
305
+
306
+
307
+ def gamgen(args, strfiles, method):
308
+ """Generate a single GAMESS input file.
309
+
310
+ Parameters
311
+ ----------
312
+ args : Namespace
313
+ Namespace of input arguments.
314
+ strfiles : list
315
+ List of xyz files produced.
316
+ method : str
317
+ Name of method to use, (e.g. B3LYP).
318
+
319
+ Returns
320
+ -------
321
+ jobdirs : list
322
+ List of job directory with GAMESS input file.
323
+
324
+ """
325
+
326
+ globs = globalvars()
327
+ jobdirs = []
328
+ coordfs = []
329
+ # Initialize the jobparams dictionary with mandatory/useful keywords.
330
+ jobparams = {'RUNTYP': 'OPTIMIZE',
331
+ 'GBASIS': 'N21',
332
+ 'MAXIT': '500',
333
+ 'DFTTYP': 'B3LYP',
334
+ 'SCFTYP': 'UHF',
335
+ 'ICHARG': '0',
336
+ 'MULT': '1',
337
+ }
338
+ # Overwrite plus add any new dictionary keys from commandline input.
339
+ for xyzf in strfiles:
340
+ # convert to "gamess format"
341
+ xyzf = xyz2gxyz(xyzf+'.xyz')
342
+ rdir = xyzf.rsplit('/', 1)[0]
343
+ xyzft = xyzf.rsplit('/', 1)[-1]
344
+ xyzf += '.gxyz'
345
+ coordfs.append(xyzf)
346
+ coordname = xyzft
347
+ # Setting jobname for files + truncated name for queue.
348
+ if len(coordname) > 10:
349
+ nametrunc = coordname[0:6]+coordname[-4:]
350
+ else:
351
+ nametrunc = coordname
352
+ if not os.path.exists(rdir+'/'+nametrunc):
353
+ os.mkdir(rdir+'/'+nametrunc)
354
+ mdir = rdir+'/'+nametrunc
355
+ if method:
356
+ if method[0] == 'U' or method[0] == 'u':
357
+ mmd = '/'+method[1:]
358
+ else:
359
+ mmd = '/'+method
360
+ jobparams['SCFTYP'] = 'RHF'
361
+ mdir = rdir+'/'+nametrunc+mmd
362
+ if not os.path.exists(mdir):
363
+ os.mkdir(mdir)
364
+ jobdirs.append(mdir)
365
+ shutil.copy2(xyzf, mdir)
366
+ # Try copying molinp and report file to jobdir
367
+ try:
368
+ shutil.copy2(xyzf.replace('.gxyz', '.molinp'),
369
+ mdir.replace('.gxyz', '.molinp'))
370
+ except FileNotFoundError:
371
+ pass
372
+ try:
373
+ shutil.copy2(xyzf.replace('.xyz', '.report'),
374
+ mdir.replace('.xyz', '.report'))
375
+ except FileNotFoundError:
376
+ pass
377
+
378
+ if method:
379
+ if method[0] == 'U' or method[0] == 'u':
380
+ method = method[1:]
381
+ # Just carry over spin and charge keywords if they're set. Could do checks, none for now.
382
+ if args.spin:
383
+ jobparams['MULT'] = str(args.spin)
384
+ if args.charge:
385
+ jobparams['ICHARG'] = str(args.charge)
386
+ # Check for existence of basis and sanitize name
387
+ if args.gbasis:
388
+ jobparams['GBASIS'] = args.gbasis.upper()
389
+ if args.ngauss:
390
+ jobparams['NGAUSS'] = args.ngauss.upper()
391
+ if method:
392
+ jobparams['DFTTYP'] = method.upper()
393
+ if (args.runtyp and 'en' in args.runtyp.lower()):
394
+ jobparams['run'] = 'ENERGY'
395
+ elif (args.runtyp and 'ts' in args.runtyp.lower()):
396
+ jobparams['run'] = 'SADPOINT'
397
+ # Now we're ready to start building the input file and the job script
398
+ for i, jobd in enumerate(jobdirs):
399
+ output = []
400
+ with open(coordfs[i]) as f:
401
+ s = f.read() # read coordinates
402
+ jobparams['coordinates'] = s
403
+ output.append('! File created using %s\n' % globs.PROGRAM)
404
+ # write $BASIS block
405
+ output.append(' $BASIS ')
406
+ if args.ngauss:
407
+ output.append(' GBASIS='+jobparams['GBASIS'])
408
+ output.append(' NGAUSS='+jobparams['NGAUSS'])
409
+ else:
410
+ output.append(' GBASIS='+jobparams['GBASIS'])
411
+ if args.ndfunc:
412
+ output.append(' NDFUNC='+args.ndfunc)
413
+ if args.npfunc:
414
+ output.append(' NPFUNC='+args.npfunc)
415
+ output.append(' $END\n')
416
+ # write $SYSTEM block
417
+ output.append(' $SYSTEM ')
418
+ # check if MWORDS specified by the user
419
+ if not args.sysoption or not ('MWORDS' in args.sysoption):
420
+ output.append(' MWORDS=16')
421
+ # write additional options
422
+ if (args.sysoption):
423
+ if len(args.sysoption) % 2 > 0:
424
+ print('WARNING: wrong number of arguments in -sysoption')
425
+ else:
426
+ for elem in range(0, int(0.5*len(args.sysoption))):
427
+ key, val = args.sysoption[2*elem], args.sysoption[2*elem+1]
428
+ output.append(' '+key+'='+val+' ')
429
+ output.append(' $END\n')
430
+ # write CONTRL block
431
+ output.append(' $CONTRL SCFTYP='+jobparams['SCFTYP']+' DFTTYP=')
432
+ output.append(jobparams['DFTTYP']+' RUNTYP='+jobparams['RUNTYP'])
433
+ output.append('\n ICHARG='+jobparams['ICHARG']+' MULT=')
434
+ # check if CC basis set specified and add spherical
435
+ if 'CC' in jobparams['GBASIS']:
436
+ output.append(jobparams['MULT']+' ISPHER=1\n')
437
+ else:
438
+ output.append(jobparams['MULT']+'\n')
439
+ # write additional options
440
+ if (args.ctrloption):
441
+ if len(args.ctrloption) % 2 > 0:
442
+ print('WARNING: wrong number of arguments in -ctrloption')
443
+ else:
444
+ for elem in range(0, int(0.5*len(args.ctrloption))):
445
+ key, val = args.ctrloption[2 *
446
+ elem], args.ctrloption[2*elem+1]
447
+ output.append(' '+key+'='+val+' ')
448
+ output.append(' $END\n')
449
+ # write $SCF block
450
+ output.append(' $SCF ')
451
+ # check if options specified by the user
452
+ if not args.scfoption or not ('DIRSCF' in args.scfoption):
453
+ output.append(' DIRSCF=.TRUE.')
454
+ if not args.scfoption or not ('DIIS' in args.scfoption):
455
+ output.append(' DIIS=.TRUE.')
456
+ if not args.scfoption or not ('SHIFT' in args.scfoption):
457
+ output.append(' SHIFT=.TRUE.')
458
+ # write additional options
459
+ if (args.scfoption):
460
+ if len(args.scfoption) % 2 != 0:
461
+ print('WARNING: wrong number of arguments in -scfoption')
462
+ else:
463
+ for elem in range(0, int(0.5*len(args.scfoption))):
464
+ key, val = args.scfoption[2*elem], args.scfoption[2*elem+1]
465
+ output.append(' '+key+'='+val+' ')
466
+ output.append(' $END\n')
467
+ # write $STATPT block
468
+ output.append(' $STATPT ')
469
+ # check if NSTEP specified by the user
470
+ if not args.statoption or not ('NSTEP' in args.statoption):
471
+ output.append(' NSTEP=100')
472
+ # write additional options
473
+ if (args.statoption):
474
+ if len(args.statoption) % 2 > 0:
475
+ print('WARNING: wrong number of arguments in -statoption')
476
+ else:
477
+ for elem in range(0, int(0.5*len(args.statoption))):
478
+ key, val = args.statoption[2 *
479
+ elem], args.statoption[2*elem+1]
480
+ output.append(' '+key+'='+val+' ')
481
+ output.append(' $END\n')
482
+ # write $DATA block
483
+ output.append(' $DATA\n')
484
+ output.append(jobparams['coordinates']+' $END\n')
485
+ with open(jobd+'/gam.inp', 'w') as f:
486
+ f.writelines(output)
487
+ return jobdirs
488
+
489
+
490
+ def multiqgen(args, strfiles):
491
+ """Generate multiple QChem input files at once.
492
+
493
+ Parameters
494
+ ----------
495
+ args : Namespace
496
+ Namespace of input arguments.
497
+ strfiles : list
498
+ List of xyz files produced.
499
+
500
+ Returns
501
+ -------
502
+ jobdirs : list
503
+ List of job directories with QChem input files.
504
+
505
+ """
506
+ method = False
507
+ jobdirs = []
508
+ if args.method and len(args.method) > 1:
509
+ methods = args.exchange
510
+ for method in methods:
511
+ jobdirs.append(qgen(args, strfiles, method))
512
+ else:
513
+ jobdirs.append(qgen(args, strfiles, method))
514
+ # remove original files
515
+ for xyzf in strfiles:
516
+ os.remove(xyzf+'.xyz')
517
+ os.remove(xyzf+'.molinp')
518
+ os.remove(xyzf + '.report')
519
+ return jobdirs
520
+
521
+
522
+ def qgen(args, strfiles, method):
523
+ """Generate a single QChem input file.
524
+
525
+ Parameters
526
+ ----------
527
+ args : Namespace
528
+ Namespace of input arguments.
529
+ strfiles : list
530
+ List of xyz files produced.
531
+ method : str
532
+ Name of method to use, (e.g. B3LYP).
533
+
534
+ Returns
535
+ -------
536
+ jobdirs : list
537
+ List of job directory with QChem input file.
538
+
539
+ """
540
+ jobdirs = []
541
+ coordfs = []
542
+ # Initialize the jobparams dictionary with mandatory/useful keywords.
543
+ jobparams = {'UNRESTRICTED': 'true',
544
+ 'BASIS': 'lanl2dz',
545
+ 'JOBTYPE': 'opt',
546
+ 'EXCHANGE': 'b3lyp',
547
+ 'CORRELATION': 'none',
548
+ 'MAX_SCF_CYCLES': '500',
549
+ 'GEOM_OPT_MAX_CYCLES': '1000',
550
+ 'SYMMETRY': 'off',
551
+ 'PRINT_ORBITALS': 'true',
552
+ 'CHARGE': '1',
553
+ 'SPIN': '1',
554
+ }
555
+ # Overwrite plus add any new dictionary keys from commandline input.
556
+ for xyzf in strfiles:
557
+ rdir = xyzf.rsplit('/', 1)[0]
558
+ xyzft = xyzf.rsplit('/', 1)[-1]
559
+ xyzf += '.xyz'
560
+ coordfs.append(xyzf.rsplit('/', 1)[-1])
561
+ coordname = xyzft
562
+ # Setting jobname for files + truncated name for queue.
563
+ if len(coordname) > 10:
564
+ nametrunc = coordname[0:6]+coordname[-4:]
565
+ else:
566
+ nametrunc = coordname
567
+ if not os.path.exists(rdir+'/'+nametrunc) and not args.jobdir:
568
+ os.makedirs(rdir+'/'+nametrunc)
569
+ mdir = rdir+'/'+nametrunc
570
+ if method:
571
+ mmd = '/'+method
572
+ mdir = rdir+'/'+nametrunc+mmd
573
+ if not os.path.exists(mdir):
574
+ os.makedirs(mdir)
575
+
576
+ jobdirs.append(mdir)
577
+ shutil.copy2(xyzf, mdir)
578
+ # Try copying molinp and report files to the new jobdir
579
+ try:
580
+ shutil.copy2(xyzf.replace('.xyz', '.molinp'),
581
+ mdir.replace('.xyz', '.molinp'))
582
+ except FileNotFoundError:
583
+ pass
584
+ try:
585
+ shutil.copy2(xyzf.replace('.xyz', '.report'),
586
+ mdir.replace('.xyz', '.report'))
587
+ except FileNotFoundError:
588
+ pass
589
+ # Check for existence of basis and sanitize name
590
+ if args.basis and len(args.basis) > 1:
591
+ jobparams['BASIS'] = args.basis
592
+ if args.correlation and len(args.correlation) > 1:
593
+ jobparams['CORRELATION'] = args.correlation
594
+ if method and len(method) > 1:
595
+ jobparams['EXCHANGE'] = method
596
+ if not args.unrestricted:
597
+ jobparams['UNRESTRICTED'] = 'false'
598
+ if (args.runtyp and 'en' in args.runtyp.lower()):
599
+ jobparams['run'] = 'SP'
600
+ elif (args.runtyp and 'ts' in args.runtyp.lower()):
601
+ jobparams['run'] = 'TS'
602
+ # Just carry over spin and charge keywords if they're set. Could do checks, none for now.
603
+ if args.spin:
604
+ jobparams['SPIN'] = args.spin
605
+ if args.charge:
606
+ jobparams['CHARGE'] = args.charge
607
+ # Now we're ready to start building the input file and the job script
608
+ for i, jobd in enumerate(jobdirs):
609
+ output = []
610
+ with open(jobd+'/'+coordfs[i]) as f:
611
+ s0 = f.readlines()[2:] # read coordinates
612
+ # if separate split to two molecules
613
+ if args.bsep and '--' in ''.join(s0):
614
+ idxsplit = [isdx for isdx, ss in enumerate(s0) if '--' in ss][0]
615
+ s = '--\n'+jobparams['CHARGE']+' '+jobparams['SPIN']+'\n'
616
+ s += ''.join(s0[:idxsplit])
617
+ s += '--\n0 1\n'
618
+ s += ''.join(s0[idxsplit+3:])
619
+ else:
620
+ s = s0
621
+ # write rem block
622
+ output.append('$rem\nUNRESTRICTED\t\t' + jobparams['UNRESTRICTED'])
623
+ output.append(
624
+ '\nBASIS\t\t'+jobparams['BASIS']+'\nJOBTYPE\t\t'+jobparams['JOBTYPE'])
625
+ output.append('\nEXCHANGE\t\t' +
626
+ jobparams['EXCHANGE']+'\nCORRELATION\t\t')
627
+ output.append(jobparams['CORRELATION']+'\nMAX_SCF_CYCLES\t\t')
628
+ output.append(jobparams['MAX_SCF_CYCLES']+'\nGEOM_OPT_MAX_CYCLES\t\t')
629
+ output.append(jobparams['GEOM_OPT_MAX_CYCLES'] +
630
+ '\nSYMMETRY\t\t'+jobparams['SYMMETRY'])
631
+ output.append('\nPRINT_ORBITALS\t\t'+jobparams['PRINT_ORBITALS']+'\n')
632
+ # write additional options
633
+ if (args.remoption):
634
+ if len(args.remoption) % 2 > 0:
635
+ print('WARNING: wrong number of arguments in -remoption')
636
+ else:
637
+ for elem in range(0, int(0.5*len(args.remoption))):
638
+ key, val = args.remoption[2*elem], args.remoption[2*elem+1]
639
+ output.append(key+'\t\t'+val+'\n')
640
+ output.append('$end\n\n')
641
+ # write $molecule block
642
+ output.append(
643
+ '$molecule\n'+jobparams['CHARGE']+' '+jobparams['SPIN']+'\n')
644
+ output.append(''.join(s)+'$end\n')
645
+ with open(jobd+'/qch.inp', 'w') as f:
646
+ f.writelines(output)
647
+ return jobdirs
648
+
649
+
650
+ def mlpgen(args, strfiles, rootdir):
651
+ """Generate MOPAC input files.
652
+
653
+ Parameters
654
+ ----------
655
+ args : Namespace
656
+ Namespace of input arguments.
657
+ strfiles : list
658
+ List of xyz files produced.
659
+ rootdir : str
660
+ Path of the root directory.
661
+
662
+ Returns
663
+ -------
664
+ jobdirs : list
665
+ List of job directory with MOPAC input file.
666
+
667
+ """
668
+ jobdirs = []
669
+ coordfs = []
670
+ # Initialize the jobparams dictionary with mandatory/useful keywords.
671
+ jobparams = ['EF', 'PM7', 'XYZ', 'HESSIAN']
672
+ spin_keywords = {1: 'SINGLET',
673
+ 2: 'DOUBLET',
674
+ 3: 'TRIPLET',
675
+ 4: 'QUARTET',
676
+ 5: 'QUINTET',
677
+ 6: 'SEXTET',
678
+ 7: 'SEPTET'}
679
+ # Overwrite plus add any new dictionary keys from commandline input.
680
+ for xyzf in strfiles:
681
+ rdir = xyzf.rsplit('/', 1)[0]
682
+ xyzft = xyzf.rsplit('/', 1)[-1]
683
+ xyzf += '.xyz'
684
+ coordfs.append(xyzf.rsplit('/', 1)[-1])
685
+ coordname = xyzft
686
+ # Setting jobname for files + truncated name for queue.
687
+ nametrunc = coordname
688
+ if not os.path.exists(rdir+'/'+nametrunc) and not args.jobdir:
689
+ os.mkdir(rdir+'/'+nametrunc)
690
+ if args.jobdir:
691
+ mdir = args.jobdir
692
+ else:
693
+ mdir = rdir+'/'+nametrunc
694
+ jobdirs.append(mdir)
695
+
696
+ # Just carry over spin and charge keywords if they're set. Could do checks, none for now.
697
+ if args.spin:
698
+ jobparams.append(spin_keywords[int(args.spin)])
699
+ jobparams.append('UHF')
700
+
701
+ else:
702
+ jobparams.append("SINGLET")
703
+ if args.charge:
704
+ jobparams.append('CHARGE='+str(args.charge))
705
+ # Now we're ready to start building the input file and the job script
706
+ for xyzf in strfiles:
707
+ output = []
708
+ with open(xyzf + '.xyz') as f:
709
+ s = f.readlines()[2:] # read coordinates
710
+ # write rem block
711
+ for terms in jobparams:
712
+ output.append(' ' + terms)
713
+ # write additional options
714
+ if (args.remoption):
715
+ if len(args.remoption) % 2 > 0:
716
+ print('WARNING: wrong number of arguments in -remoption')
717
+ else:
718
+ for elem in range(0, int(0.5*len(args.remoption))):
719
+ key, val = args.remoption[2*elem], args.remoption[2*elem+1]
720
+ output.append(key+'\t\t'+val+'\n')
721
+ output.append('\n' + nametrunc+'\n')
722
+ output.append('\n')
723
+ # write $molecule block
724
+ for lines in s:
725
+ ll = lines.split('\t')
726
+ for i, items in enumerate(ll):
727
+ output.append(' ' + items.strip('\n'))
728
+ if i > 0:
729
+ output.append(' 1')
730
+ if i == 3:
731
+ output.append('\n')
732
+ with open(xyzf + '.mop', 'w') as f:
733
+ f.writelines(output)
734
+ return jobdirs
735
+
736
+
737
+ def multiogen(args, strfiles):
738
+ """Generate ORCA input files.
739
+
740
+ Parameters
741
+ ----------
742
+ args : Namespace
743
+ Namespace of input arguments.
744
+ strfiles : list
745
+ List of xyz files produced.
746
+
747
+ Returns
748
+ -------
749
+ jobdirs : list
750
+ List of job directory with ORCA input files.
751
+
752
+ """
753
+
754
+ method = False
755
+ jobdirs = []
756
+ if args.method and len(args.method) > 0:
757
+ methods = args.method
758
+ for method in methods:
759
+ jobdirs.append(ogen(args, strfiles, method))
760
+ else:
761
+ jobdirs.append(ogen(args, strfiles, method))
762
+ # remove original files
763
+ if not args.jobdir:
764
+ for xyzf in strfiles:
765
+ try:
766
+ os.remove(xyzf+'.xyz')
767
+ os.remove(xyzf+'.molinp')
768
+ os.remove(xyzf + '.report')
769
+ except FileNotFoundError:
770
+ pass
771
+ return jobdirs
772
+
773
+
774
+ def ogen(args, strfiles, method):
775
+ """Generate a single ORCA input file.
776
+
777
+ Parameters
778
+ ----------
779
+ args : Namespace
780
+ Namespace of input arguments.
781
+ strfiles : list
782
+ List of xyz files produced.
783
+ method : str
784
+ Method to be used (e.g. B3LYP)
785
+
786
+ Returns
787
+ -------
788
+ jobdirs : list
789
+ List of job directory with ORCA input file.
790
+
791
+ """
792
+
793
+ # global variables
794
+ globs = globalvars()
795
+ jobdirs = []
796
+ coordfs = []
797
+ # Initialize the jobparams dictionary with mandatory/useful keywords. TG: removed min_coordinates cartesian
798
+ jobparams = {'run': 'Sp',
799
+ 'basis': 'def2-TZVP',
800
+ 'MaxIter': '500',
801
+ 'method': 'B3LYP',
802
+ 'spinmult': '1',
803
+ 'charge': '0',
804
+ 'ERI': 'NORI',
805
+ 'REL': '',
806
+ 'UNO': '',
807
+ 'mdci_maxit': '200',
808
+ 'mdci_shift': '0.2',
809
+ 'HFX': False,
810
+ }
811
+ # if multiple methods requested generate c directories
812
+ # Overwrite plus add any new dictionary keys from commandline input.
813
+ for xyzf in strfiles:
814
+ rdir = xyzf.rsplit('/', 1)[0]
815
+ xyzft = xyzf.rsplit('/', 1)[-1]
816
+ xyzf += '.xyz'
817
+ coordfs.append(xyzf.rsplit('/', 1)[-1])
818
+ coordname = xyzft
819
+ # Setting jobname for files + truncated name for queue.
820
+ if len(coordname) > 10:
821
+ nametrunc = coordname
822
+ else:
823
+ nametrunc = coordname
824
+ if not os.path.exists(rdir+'/'+nametrunc) and not args.jobdir:
825
+ os.mkdir(rdir+'/'+nametrunc)
826
+ mdir = rdir+'/'+nametrunc
827
+ if method:
828
+ if method[0] == 'U' or method[0] == 'u':
829
+ mmd = '/'+method[1:]
830
+ else:
831
+ mmd = '/'+method
832
+ mdir = rdir+'/'+nametrunc+mmd
833
+ if not os.path.exists(mdir):
834
+ try:
835
+ os.makedirs(mdir)
836
+ except FileExistsError:
837
+ pass
838
+ if not args.jobdir:
839
+ jobdirs.append(mdir)
840
+ shutil.copy2(xyzf, mdir)
841
+ shutil.copy2(xyzf.replace('.xyz', '.molinp'),
842
+ mdir.replace('.xyz', '.molinp'))
843
+ try:
844
+ shutil.copy2(xyzf.replace('.xyz', '.report'),
845
+ mdir.replace('.xyz', '.report'))
846
+ except FileNotFoundError:
847
+ pass
848
+ elif args.jobdir:
849
+ jobdirs.append(rdir)
850
+ # parse extra arguments
851
+ # Method parsing, does not check if a garbage method is used here:
852
+ unrestricted = False
853
+ if method:
854
+ jobparams['method'] = method
855
+ if args.spin and int(args.spin) > 1:
856
+ unrestricted = True
857
+ # For ORCA, "ro" or "u" is not needed
858
+ if ('u' or 'U') in method[0]:
859
+ jobparams['method'] = method[1:]
860
+ # Unrestricted calculation
861
+ elif ('ro' or 'RO') in method[0]:
862
+ # Restricted calculation
863
+ unrestricted = False
864
+ jobparams['method'] = method[2:]
865
+ else:
866
+ if args.spin and int(args.spin) >= 1:
867
+ jobparams['method'] = 'B3LYP'
868
+ unrestricted = True
869
+ else:
870
+ jobparams['method'] = 'B3LYP'
871
+ print((args.method, method, jobparams['method']))
872
+ # Check runtype and we accept both ORCA and terachem naming convention
873
+ if (args.runtyp and 'energy' in args.runtyp.lower()):
874
+ jobparams['run'] = 'Sp'
875
+ elif (args.runtyp and 'sp' in args.runtyp.lower()):
876
+ jobparams['run'] = 'Sp'
877
+ elif (args.runtyp and 'opt' in args.runtyp.lower()):
878
+ jobparams['run'] = 'Opt'
879
+ elif (args.runtyp and 'minimize' in args.runtyp.lower()):
880
+ jobparams['run'] = 'Opt'
881
+ elif (args.runtyp and 'gradient' in args.runtyp.lower()):
882
+ jobparams['run'] = 'EnGrad'
883
+ elif (args.runtyp and 'engrad' in args.runtyp.lower()):
884
+ jobparams['run'] = 'EnGrad'
885
+ # Special sanity check for CCSD(T)
886
+ if jobparams['run'] == 'Opt' and 'CC' in jobparams['method']:
887
+ print('''Warning! You requested geometry optimization with Coupled-Cluster methods,
888
+ which is NOT supported. Instead, we will geometry optimize the structure
889
+ with B3LYP and then conduct CCSD(T) energy calculation on the optimized structure''')
890
+ # TODO: check ORCA dispersion
891
+ if (args.dispersion):
892
+ jobparams['dispersion'] = args.dispersion
893
+ # Just carry over spin and charge keywords if they're set. Could do checks, none for now.
894
+ if args.spin:
895
+ jobparams['spinmult'] = args.spin
896
+ if args.charge:
897
+ if args.bcharge:
898
+ args.charge = int(args.charge)+int(args.bcharge)
899
+ jobparams['charge'] = args.charge
900
+ # Check for existence of basis and sanitize name
901
+ # Read in basis name from args only if it's not the default for terachem
902
+ if args.basis and args.basis != 'lacvps_ecp':
903
+ jobparams['basis'] = args.basis
904
+ if 'DIISMaxEq' not in jobparams:
905
+ jobparams['DIISMaxEq'] = 15
906
+ # Overwrite plus add any new dictionary keys from commandline input.
907
+ if args.qoption:
908
+ if len(args.qoption) % 2 != 0:
909
+ print('WARNING: wrong number of arguments in -qoption')
910
+ else:
911
+ for elem in range(0, int(0.5*len(args.qoption))):
912
+ key, val = args.qoption[2*elem], args.qoption[2*elem+1]
913
+ jobparams[key] = val
914
+ # Extra keywords for unrestricted.
915
+ if unrestricted:
916
+ # If running unrestricted, assume convergence will be more difficult for now.
917
+ jobparams['scf'] = 'SlowConv'
918
+ jobparams['UNO'] = 'UNO'
919
+ if 'levelshift' not in jobparams:
920
+ jobparams['levelshift'] = 'yes'
921
+ elif jobparams['levelshift'] != 'yes':
922
+ print(("Warning! You're doing an unrestricted calculation but have set levelshift = %s" % (
923
+ jobparams['levelshift'])))
924
+ if 'levelshiftval' not in jobparams:
925
+ if 'levelshiftvala' in jobparams:
926
+ jobparams['levelshiftval'] = jobparams['levelshiftvala']
927
+ elif 'levelshiftvalb' in jobparams:
928
+ jobparams['levelshiftval'] = jobparams['levelshiftvalb']
929
+ else:
930
+ jobparams['levelshiftval'] = 0.25
931
+ if 'ErrOff' not in jobparams:
932
+ jobparams['ErrOff'] = 0.00001
933
+ # Now we're ready to start building the input file
934
+ if not args.jobdir:
935
+ for i, jobd in enumerate(jobdirs):
936
+ with open(jobd+'/orca.in', 'w') as output:
937
+ output.write('# file created with %s\n' % globs.PROGRAM)
938
+ if 'CC' in jobparams['method'] and jobparams['run'] == 'Opt':
939
+ params0 = jobparams.copy()
940
+ params0['method'] = 'B3LYP'
941
+ ogenwrt(output, params0, coordfs[i])
942
+ output.write('\n$new_job\n')
943
+ jobparams['run'] = 'Sp'
944
+ ogenwrt(output, jobparams, '')
945
+ else:
946
+ ogenwrt(output, jobparams, coordfs[i])
947
+ elif args.jobdir:
948
+ for i, jobd in enumerate(jobdirs):
949
+ print(('jobd is ' + jobd))
950
+ with open(jobd+'/orca.in', 'w') as output:
951
+ output.write('# file created with %s\n' % globs.PROGRAM)
952
+ if 'CC' in jobparams['method'] and jobparams['run'] == 'Opt':
953
+ params0 = jobparams.copy()
954
+ params0['method'] = 'B3LYP'
955
+ ogenwrt(output, params0, coordfs[i])
956
+ output.write('\n$new_job\n')
957
+ jobparams['run'] = 'Sp'
958
+ ogenwrt(output, jobparams, '')
959
+ else:
960
+ ogenwrt(output, jobparams, coordfs[i])
961
+ return jobdirs
962
+
963
+
964
+ def ogenwrt(output, jobparams, xyzf):
965
+ """Generate a single ORCA input file with custom parameters.
966
+
967
+ Parameters
968
+ ----------
969
+ output : str
970
+ Filename for writing the ORCA input.
971
+ jobparams : dict
972
+ Dictionary of ORCA input parameters.
973
+ xyzf : str
974
+ Name for XYZ file.
975
+
976
+ Returns
977
+ -------
978
+ jobdirs : list
979
+ List of job directory with ORCA input file.
980
+
981
+ """
982
+ # write the first line of simple keywords
983
+ output.write('!'+jobparams['method']+' ')
984
+ output.write(jobparams['basis']+' ')
985
+ output.write(jobparams['ERI']+' ')
986
+ if jobparams['REL']:
987
+ output.write(jobparams['REL']+' ')
988
+ output.write(jobparams['UNO']+' ')
989
+ output.write(jobparams['run']+'\n\n')
990
+ # write scf convergence mode
991
+ if 'scf' in jobparams:
992
+ output.write('!'+jobparams['scf']+'\n')
993
+ # write the scf control block
994
+ output.write('%scf\n')
995
+ output.write('MaxIter '+jobparams['MaxIter']+'\n')
996
+ if 'levelshift' in jobparams:
997
+ if jobparams['levelshift'] == 'yes':
998
+ output.write('Shift Shift '+str(jobparams['levelshiftval'])
999
+ + ' ErrOff ' + str(jobparams['ErrOff'])+' end\n')
1000
+ output.write('DIISMaxEq '+str(jobparams['DIISMaxEq'])+'\n')
1001
+ output.write('end\n\n')
1002
+ # write the method block to control HFX
1003
+ if not (('CC' or 'HF') in jobparams['method']):
1004
+ if jobparams['HFX']:
1005
+ output.write('%method\n')
1006
+ output.write('ScalHFX = '+jobparams['HFX']+'\n')
1007
+ output.write('ScalDFX = '+str(1-float(jobparams['HFX']))+'\n')
1008
+ output.write('end\n\n')
1009
+ # write the mdci block for CCSD(T)
1010
+ if 'CCSD' in jobparams['method']:
1011
+ output.write('%mdci\n')
1012
+ if jobparams['UNO']:
1013
+ output.write('UseQROs true\n')
1014
+ output.write('maxiter '+jobparams['mdci_maxit']+'\n')
1015
+ output.write('Lshift '+jobparams['mdci_shift']+'\n')
1016
+ output.write('end\n\n')
1017
+ # write the coordinate block
1018
+ output.write(
1019
+ '*xyzfile '+str(jobparams['charge'])+' '+str(jobparams['spinmult'])+' '+xyzf+'\n')
1020
+ # output.write(''.join(s0)+'*\n')
1021
+
1022
+
1023
+ def molcgen(args, strfiles, method):
1024
+ """Generate a single MOLCAS input file.
1025
+
1026
+ Parameters
1027
+ ----------
1028
+ args : Namespace
1029
+ Namespace of input arguments.
1030
+ strfiles : list
1031
+ List of xyz files produced.
1032
+ method : str
1033
+ Method to be used (e.g. B3LYP)
1034
+
1035
+ Returns
1036
+ -------
1037
+ jobdirs : list
1038
+ List of job directory with MOLCAS input file.
1039
+
1040
+ """
1041
+ # global variables
1042
+ globs = globalvars()
1043
+ jobdirs = []
1044
+ coordfs = []
1045
+ # Initialize the jobparams dictionary with mandatory/useful keywords. TG: removed min_coordinates cartesian
1046
+ jobparams = {'Group': 'Nosym',
1047
+ 'method': 'CASSCF',
1048
+ 'spin': '1',
1049
+ 'charge': '0',
1050
+ # 'nactel':'2',
1051
+ # 'frozen':'0',
1052
+ # 'ras2':'12',
1053
+ 'ciroot': '1 1 ;1',
1054
+ 'ITER': '1000,100',
1055
+ 'multistate': '1 1',
1056
+ 'imaginary': '0.1',
1057
+ 'ipeashift': '0.25',
1058
+ 'density': 'no',
1059
+ 'grid_it': 'no',
1060
+ 'gridtype': 'TOTAL',
1061
+ 'NPOINTS': '100 100 100',
1062
+ }
1063
+ # if multiple methods requested generate c directories
1064
+ # Overwrite plus add any new dictionary keys from commandline input.
1065
+ for xyzf in strfiles:
1066
+ rdir = xyzf.rsplit('/', 1)[0]
1067
+ xyzft = xyzf.rsplit('/', 1)[-1]
1068
+ xyzf += '.xyz'
1069
+ coordfs.append(xyzf.rsplit('/', 1)[-1])
1070
+ coordname = xyzft
1071
+ # Setting jobname for files + truncated name for queue.
1072
+ if len(coordname) > 10:
1073
+ nametrunc = coordname
1074
+ else:
1075
+ nametrunc = coordname
1076
+ if not os.path.exists(rdir+'/'+nametrunc) and not args.jobdir:
1077
+ os.mkdir(rdir+'/'+nametrunc)
1078
+ mdir = rdir+'/'+nametrunc
1079
+ if method:
1080
+ if method[0] == 'U' or method[0] == 'u':
1081
+ mmd = '/'+method[1:]
1082
+ else:
1083
+ mmd = '/'+method
1084
+ mdir = rdir+'/'+nametrunc+mmd
1085
+ if not os.path.exists(mdir):
1086
+ try:
1087
+ os.makedirs(mdir)
1088
+ except FileExistsError:
1089
+ pass
1090
+ if not args.jobdir:
1091
+ jobdirs.append(mdir)
1092
+ shutil.copy2(xyzf, mdir)
1093
+ shutil.copy2(xyzf.replace('.xyz', '.molinp'),
1094
+ mdir.replace('.xyz', '.molinp'))
1095
+ try:
1096
+ shutil.copy2(xyzf.replace('.xyz', '.report'),
1097
+ mdir.replace('.xyz', '.report'))
1098
+ except FileNotFoundError:
1099
+ pass
1100
+ elif args.jobdir:
1101
+ jobdirs.append(rdir)
1102
+ # parse extra arguments
1103
+ # Method parsing, does not check if a garbage method is used here:
1104
+ if method:
1105
+ jobparams['method'] = method
1106
+ else:
1107
+ jobparams['method'] = 'CASSCF'
1108
+ print((args.method, method, jobparams['method']))
1109
+ # Check runtype
1110
+ if (args.runtyp and 'energy' in args.runtyp.lower()):
1111
+ jobparams['run'] = 'energy'
1112
+ else:
1113
+ print('''Warning! Currently MOLCAS input file generation is only supported for
1114
+ single point energy. For other types of calculation requested, the input
1115
+ file is generated for single point energy instead''')
1116
+ # Just carry over spin and charge keywords if they're set. Could do checks, none for now.
1117
+ if args.spin:
1118
+ jobparams['spin'] = str(args.spin)
1119
+ if args.charge:
1120
+ if args.bcharge:
1121
+ args.charge = int(args.charge)+int(args.bcharge)
1122
+ jobparams['charge'] = str(args.charge)
1123
+ # Check for existence of basis and sanitize name
1124
+ # Automatically assign basis based on element
1125
+ if args.basis and args.basis != 'lacvps_ecp':
1126
+ jobparams['basis'] = args.basis
1127
+ elif (not args.basis) or args.basis == 'lacvps_ecp':
1128
+ jobparams['basis'] = molcbasis(strfiles, 'ANO-rcc')
1129
+ # Overwrite plus add any new dictionary keys from commandline input.
1130
+ if args.qoption:
1131
+ if len(args.qoption) % 2 != 0:
1132
+ print('WARNING: wrong number of arguments in -qoption')
1133
+ else:
1134
+ for elem in range(0, int(0.5*len(args.qoption))):
1135
+ key, val = args.qoption[2*elem], args.qoption[2*elem+1]
1136
+ jobparams[key] = val
1137
+ # Check which paramters are missing
1138
+ # Check and automatically assign number of active electrons
1139
+ if 'nactel' not in jobparams:
1140
+ oxnum = 0 # oxidation state number
1141
+ if args.oxstate in list(romans.keys()):
1142
+ oxnum = int(romans[args.oxstate])
1143
+ else:
1144
+ oxnum = int(args.oxstate)
1145
+ jobparams['nactel'] = molcnactels(strfiles, oxnum)
1146
+ else:
1147
+ nactel = int(jobparams['nactel'])
1148
+ jobparams['nactel'] = [nactel for i in range(0, len(strfiles))]
1149
+ # Check and automatically assign number of frozen orbitals for CASSCF
1150
+ if 'frozen' not in jobparams:
1151
+ jobparams['frozen'] = molcfrozens(strfiles)
1152
+ else:
1153
+ frozen = int(jobparams['frozen'])
1154
+ jobparams['frozen'] = [frozen for i in range(0, len(strfiles))]
1155
+ # Check and automatically assign number of frozen orbitals for ras2
1156
+ if 'ras2' not in jobparams:
1157
+ jobparams['ras2'] = molcras2s(strfiles)
1158
+ else:
1159
+ ras2 = int(jobparams['ras2'])
1160
+ jobparams['ras2'] = [ras2 for i in range(0, len(strfiles))]
1161
+ # Check key for grid_it. Overwrite the default in case
1162
+ # the command line input is in different case
1163
+ for key in list(jobparams.keys()):
1164
+ if 'grid_it' in key.lower() and key != 'grid_it':
1165
+ jobparams['grid_it'] = jobparams[key]
1166
+ break
1167
+
1168
+ # Now we're ready to start building the input file
1169
+ if not args.jobdir:
1170
+ for i, jobd in enumerate(jobdirs):
1171
+ with open(jobd+'/molcas.input', 'w') as output:
1172
+ output.write('# file created with %s\n' % globs.PROGRAM)
1173
+ molcwrt(output, jobparams, coordfs[i], i)
1174
+ elif args.jobdir:
1175
+ for i, jobd in enumerate(jobdirs):
1176
+ print(('jobd is ' + jobd))
1177
+ with open(jobd+'/molcas.input', 'w') as output:
1178
+ output.write('# file created with %s\n' % globs.PROGRAM)
1179
+ molcwrt(output, jobparams, coordfs[i], i)
1180
+ return jobdirs
1181
+
1182
+
1183
+ def molcwrt(output, jobparams, xyzf, xyzind):
1184
+ """Generate a single MOLCAS input file with custom parameters.
1185
+
1186
+ Parameters
1187
+ ----------
1188
+ output : str
1189
+ Filename for writing the ORCA input.
1190
+ jobparams : dict
1191
+ Dictionary of ORCA input parameters.
1192
+ xyzf : str
1193
+ Name for XYZ file.
1194
+ xyzind : int
1195
+ Index for xyz file in all generated xyz files
1196
+
1197
+ Returns
1198
+ -------
1199
+ jobdirs : list
1200
+ List of job directory with ORCA input file.
1201
+
1202
+ """
1203
+ # write the gateway block
1204
+ output.write('&gateway\n')
1205
+ output.write('Coord='+xyzf+'\n')
1206
+ output.write('basis='+jobparams['basis']+'\n')
1207
+ output.write('Group='+jobparams['Group']+'\n')
1208
+ # write SEWARD block. Hardcode for now
1209
+ output.write('&SEWARD\nCHOL\nR02O\n')
1210
+ # write RASSCF block
1211
+ output.write('&RASSCF\n')
1212
+ output.write(' charge='+jobparams['charge']+'\n')
1213
+ output.write(' spin='+jobparams['spin']+'\n')
1214
+ output.write(' nactel='+str(jobparams['nactel'][xyzind])+' 0 0\n')
1215
+ output.write(' frozen='+str(jobparams['frozen'][xyzind])+'\n')
1216
+ output.write(' ciroot='+jobparams['ciroot']+'\n')
1217
+ output.write(' ras2='+str(jobparams['ras2'][xyzind])+'\n')
1218
+ output.write(' ITER='+jobparams['ITER']+'\n')
1219
+ # write the CASPT2 block
1220
+ if 'pt2' in jobparams['method'].lower():
1221
+ output.write('&CASPT2\n')
1222
+ output.write(' multistate='+jobparams['multistate']+'\n')
1223
+ output.write(' imaginary='+jobparams['imaginary']+'\n')
1224
+ output.write(' ipeashift='+jobparams['ipeashift']+'\n')
1225
+ if jobparams['density'] == 'yes':
1226
+ output.write(' density\n')
1227
+ # write the GRID_IT block
1228
+ if jobparams['grid_it'] == 'yes':
1229
+ output.write('&GRID_IT\n')
1230
+ output.write(jobparams['gridtype']+'\n')
1231
+ output.write('NPOINTS\n'+jobparams['NPOINTS']+'\n')
1232
+
1233
+
1234
+ def multimolcgen(args, strfiles):
1235
+ """Generate MOLCAS input files.
1236
+
1237
+ Parameters
1238
+ ----------
1239
+ args : Namespace
1240
+ Namespace of input arguments.
1241
+ strfiles : list
1242
+ List of xyz files produced.
1243
+
1244
+ Returns
1245
+ -------
1246
+ jobdirs : list
1247
+ List of job directory with ORCA input files.
1248
+
1249
+ """
1250
+ method = False
1251
+ jobdirs = []
1252
+ if args.method and len(args.method) > 0:
1253
+ methods = args.method
1254
+ for method in methods:
1255
+ jobdirs.append(molcgen(args, strfiles, method))
1256
+ else:
1257
+ jobdirs.append(molcgen(args, strfiles, method))
1258
+ # remove original files
1259
+ if not args.jobdir:
1260
+ for xyzf in strfiles:
1261
+ try:
1262
+ os.remove(xyzf+'.xyz')
1263
+ os.remove(xyzf+'.molinp')
1264
+ os.remove(xyzf + '.report')
1265
+ except FileNotFoundError:
1266
+ pass
1267
+ return jobdirs
1268
+
1269
+
1270
+ def molcbasis(strfiles, basistyp):
1271
+ """Generate MOLCAS basis keyword for a given mol3D.
1272
+
1273
+ Parameters
1274
+ ----------
1275
+ strfiles : list
1276
+ List of XYZ files produced
1277
+ basistyp : str
1278
+ The basis set.
1279
+
1280
+ Returns
1281
+ -------
1282
+ basis : str
1283
+ String of basis specification.
1284
+
1285
+ """
1286
+ # List of Sets for elem
1287
+ # elems[i] contains elements for i-th row
1288
+ elems = []
1289
+ for i in range(0, 8):
1290
+ elems.append(set())
1291
+ # collect elements by rows in the periodic table
1292
+ for i in range(0, len(strfiles)):
1293
+ temp = mol3D()
1294
+ temp.readfromxyz(f"{strfiles[i]}.xyz")
1295
+ for atom in temp.getAtoms():
1296
+ atno = atom.atno
1297
+ sym = atom.symbol()
1298
+ if atno <= 2:
1299
+ elems[1].add(sym)
1300
+ elif atno <= 10:
1301
+ elems[2].add(sym)
1302
+ elif atno <= 18:
1303
+ elems[3].add(sym)
1304
+ elif atno <= 36:
1305
+ elems[4].add(sym)
1306
+ elif atno <= 54:
1307
+ elems[5].add(sym)
1308
+ elif atno <= 86:
1309
+ elems[6].add(sym)
1310
+ else:
1311
+ elems[7].add(sym)
1312
+ basis = ''
1313
+ # First check whether very heavy elems exist
1314
+ for i in range(5, 8):
1315
+ if len(elems[i]) > 0:
1316
+ unsupported = ''
1317
+ while len(elems[i]) > 0:
1318
+ unsupported += (elems[i].pop()+',')
1319
+ print(
1320
+ 'Warning! Automatic basis generation not available for heavy elemts in row >4 yet!')
1321
+ print(('Basis was not generated for '+unsupported))
1322
+ break
1323
+ if basistyp == 'ANO-rcc':
1324
+ while len(elems[1]) > 0:
1325
+ elem = elems[1].pop()
1326
+ if basis != '':
1327
+ basis += ','
1328
+ basis += elem+'.'+basistyp+'...3s1p.'
1329
+ while len(elems[2]) > 0:
1330
+ elem = elems[2].pop()
1331
+ if basis != '':
1332
+ basis += ','
1333
+ basis += elem+'.'+basistyp+'...4s3p2d1f.'
1334
+ while len(elems[3]) > 0:
1335
+ elem = elems[3].pop()
1336
+ if basis != '':
1337
+ basis += ','
1338
+ basis += elem+'.'+basistyp+'... 5s4p3d2f.'
1339
+ while len(elems[4]) > 0:
1340
+ elem = elems[4].pop()
1341
+ if basis != '':
1342
+ basis += ','
1343
+ basis += elem+'.'+basistyp+'...7s6p5d3f2g1h.'
1344
+ else:
1345
+ print('''Automatic Basis generation for basis type
1346
+ other than ANO-rcc is not supported yet''')
1347
+ return basis
1348
+
1349
+
1350
+ def molcras2s(strfiles):
1351
+ """Determine MOLCAS CASSCF active space for a given mol3D.
1352
+
1353
+ Parameters
1354
+ ----------
1355
+ strfiles : list
1356
+ List of XYZ files produced
1357
+
1358
+ Returns
1359
+ -------
1360
+ ras2s : list
1361
+ List of the active spaces
1362
+
1363
+ """
1364
+ print('Warning! "ras2" active space is automatically generated and may need adjustment! ')
1365
+ ras2s = []
1366
+ for i in range(0, len(strfiles)):
1367
+ temp = mol3D()
1368
+ temp.readfromxyz(f"{strfiles[i]}.xyz")
1369
+ metal_ind = temp.findMetal()
1370
+ ras2 = 0
1371
+ for ind in metal_ind:
1372
+ metal = temp.getAtom(ind)
1373
+ atno = metal.atno
1374
+ if (atno > 24 and atno < 31) or (atno > 42 and atno < 49):
1375
+ ras2 += 12 # double d shell+2 bonding
1376
+ else:
1377
+ ras2 += 7 # single d shell + bonding
1378
+ ras2s.append(ras2)
1379
+ return ras2s
1380
+
1381
+
1382
+ def molcnactels(strfiles, oxnum):
1383
+ """Determine MOLCAS CASSCF active electrons for a given mol3D.
1384
+
1385
+ Parameters
1386
+ ----------
1387
+ strfiles : list
1388
+ List of XYZ files produced
1389
+ oxnum : int
1390
+ Oxidation state.
1391
+
1392
+ Returns
1393
+ -------
1394
+ nactels : list
1395
+ List of the active electrons
1396
+
1397
+ """
1398
+ print('Warning! "nactel" is automatically generated and may need adjustment! ')
1399
+ nactels = []
1400
+ for i in range(0, len(strfiles)):
1401
+ temp = mol3D()
1402
+ temp.readfromxyz(f"{strfiles[i]}.xyz")
1403
+ metal_ind = temp.findMetal()
1404
+ nactel = 0
1405
+ for ind in metal_ind:
1406
+ metal = temp.getAtom(ind)
1407
+ atno = metal.atno
1408
+ if atno > 20 and atno < 31: # 1st row TM
1409
+ nactel += atno-18-oxnum+4 # 4s3d electron + 4 bonding orbital electrons
1410
+ else:
1411
+ print('Warning! Automatic assignment of "nactel"is not available')
1412
+ print(('for heavy atom like ' + temp.getAtom(ind).symbol()+'yet'))
1413
+ nactels.append(nactel)
1414
+ return nactels
1415
+
1416
+
1417
+ def molcfrozens(strfiles):
1418
+ """Determine MOLCAS CASSCF frozen orbitals for a given mol3D
1419
+
1420
+ Parameters
1421
+ ----------
1422
+ strfiles : list
1423
+ List of XYZ files produced
1424
+
1425
+ Returns
1426
+ -------
1427
+ frozens : list
1428
+ List of the frozen orbitals
1429
+
1430
+ """
1431
+ frozens = []
1432
+ for i in range(0, len(strfiles)):
1433
+ frozen = 0
1434
+ temp = mol3D()
1435
+ temp.readfromxyz(f"{strfiles[i]}.xyz")
1436
+ for atom in temp.getAtoms():
1437
+ atno = atom.atno
1438
+ if atno > 2 and atno <= 10:
1439
+ frozen += 1 # 1s
1440
+ elif atno > 10 and atno <= 18:
1441
+ frozen += 5 # 1s2s2p Not super sure about the 3rd row
1442
+ elif atno > 18 and atno <= 36:
1443
+ frozen += 5 # 1s2s2p
1444
+ elif atno > 36 and atno <= 54:
1445
+ frozen += 9 # 1s2s2p3s3p
1446
+ elif atno > 54:
1447
+ print('Warning! Automatic assignment of "frozen"is not available')
1448
+ print(('for heavy atom like ' + atom.symbol()+'yet'))
1449
+ frozens.append(frozen)
1450
+ return frozens