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,701 @@
1
+ # @file cellbuilder_tools.py
2
+ # Contains routines for building unit cells with adsorbed species.
3
+ #
4
+ # Written by JP Janet for HJK Group
5
+ #
6
+ # Dpt of Chemical Engineering, MIT
7
+
8
+ import re
9
+
10
+ import numpy
11
+ try:
12
+ from openbabel import openbabel # version 3 style import
13
+ except ImportError:
14
+ import openbabel # fallback to version 2
15
+ import copy
16
+ from math import sqrt, pi
17
+ from molSimplify.Classes.globalvars import globalvars
18
+ from molSimplify.Classes.mol3D import mol3D
19
+ from molSimplify.Scripts.geometry import distance
20
+ # from scipy.spatial import Delaunay, ConvexHull
21
+ # import networkx as nx
22
+
23
+
24
+ ###############################
25
+ # Main cell FF opt routine
26
+ #
27
+ # optimize complexes placed on cell to avoid clashes. Will use UFF for speed
28
+ #
29
+ # @param ff Force field to use, available MMFF94, UFF, Ghemical, GAFF,
30
+ # @param mol mol3D of cell to be optimized
31
+ # @param frozenats List of frozen atom indicies, will usually be the cell
32
+ # @return FF-calculated energy, mol3D of optimized cell
33
+
34
+
35
+ def cell_ffopt(ff, mol, frozenats):
36
+ ### FORCE FIELD OPTIMIZATION ##
37
+ # INPUT
38
+ # - ff: force field to use, available MMFF94, UFF< Ghemical, GAFF
39
+ # - mol: mol3D to be ff optimized
40
+ # OUTPUT
41
+ # - mol: force field optimized mol3D
42
+ metals = list(range(21, 31))+list(range(39, 49))+list(range(72, 81))
43
+ # check requested force field
44
+ ffav = 'mmff94, uff, ghemical, gaff, mmff94s' # force fields
45
+ if ff.lower() not in ffav:
46
+ print('Requested force field not available. Defaulting to UFF')
47
+ ff = 'UFF'
48
+ # convert mol3D to OBMol via xyz file, because AFTER/END option have coordinates
49
+ backup_mol = mol3D()
50
+ backup_mol.copymol3D(mol)
51
+ # print('bck ' + str(backup_mol.getAtom(0).coords()))
52
+ # print('mol_ibf ' + str(mol.getAtom(0).coords()))
53
+ mol.convert2OBMol()
54
+ # initialize constraints
55
+ constr = openbabel.OBFFConstraints()
56
+ # openbabel indexing starts at 1 ### !!!
57
+ # convert metals to carbons for FF
58
+ indmtls = []
59
+ mtlsnums = []
60
+ for iiat, atom in enumerate(openbabel.OBMolAtomIter(mol.OBMol)):
61
+ if atom.GetAtomicNum() in metals:
62
+ indmtls.append(iiat)
63
+ mtlsnums.append(atom.GetAtomicNum())
64
+ atom.SetAtomicNum(6)
65
+ for cat in frozenats:
66
+ constr.AddAtomConstraint(cat+1) # indexing babel
67
+ # set up forcefield
68
+ forcefield = openbabel.OBForceField.FindForceField(ff)
69
+ forcefield.Setup(mol.OBMol, constr)
70
+ # force field optimize structure
71
+ forcefield.ConjugateGradients(2500)
72
+ forcefield.GetCoordinates(mol.OBMol)
73
+ # reset atomic number to metal
74
+ for i, iiat in enumerate(indmtls):
75
+ mol.OBMol.GetAtomById(iiat).SetAtomicNum(mtlsnums[i])
76
+ mol.convert2mol3D()
77
+ en = forcefield.Energy()
78
+
79
+ del forcefield, constr
80
+ return mol, en
81
+ ################################
82
+ ###############################
83
+ # Import CIF to mol3D
84
+ #
85
+ # @param fst string of .cif file path
86
+ # @return mol3D of unit cell, cell vector
87
+
88
+
89
+ def import_from_cif(fst, return_extra_cif_info=False):
90
+ # INPUT:
91
+ # fst: filename of cif file
92
+ # OUTPUT:
93
+ # unit_cell: mol3D class of a single unit cell
94
+ # cell_vector: list of lists of floats, each
95
+ # corresponds to one of the defining cell
96
+ # vectors
97
+ cell_vector = list()
98
+ unit_cell = mol3D()
99
+ A = 0
100
+ B = 0
101
+ C = 0
102
+ alpha = 0
103
+ beta = 0
104
+ emsg = list()
105
+ exit_status = 0
106
+ gamma = 0
107
+ obConversion = openbabel.OBConversion()
108
+ obConversion.SetInAndOutFormats("cif", "xyz")
109
+ mol = openbabel.OBMol()
110
+ if obConversion.ReadFile(mol, fst):
111
+ fillUC = openbabel.OBOp.FindType("fillUC")
112
+ fillUC.Do(mol, "strict")
113
+ unit_cell.OBMol = mol
114
+ unit_cell.convert2mol3D()
115
+ else:
116
+ emsg.append("Error in reading of cif file by openbabel")
117
+ exit_status = 1
118
+ with open(fst, errors='ignore') as f: # ignore takes care of unicode errors in some cifs
119
+ lines = f.readlines()
120
+ for line in lines:
121
+ linesplit = line.split()
122
+ if len(linesplit) != 0:
123
+ if linesplit[0] == "_cell_length_a":
124
+ A = float((re.sub(r'\([^)]*\)', '',
125
+ ''.join(c for c in linesplit[1]))))
126
+ if linesplit[0] == "_cell_length_b":
127
+ B = float((re.sub(r'\([^)]*\)', '',
128
+ ''.join(c for c in linesplit[1]))))
129
+ if linesplit[0] == "_cell_length_c":
130
+ C = float((re.sub(r'\([^)]*\)', '',
131
+ ''.join(c for c in linesplit[1]))))
132
+
133
+ if linesplit[0] == "_cell_angle_alpha":
134
+ alpha = float(
135
+ ''.join(c for c in linesplit[1] if c not in '()').rstrip('.'))
136
+ if linesplit[0] == "_cell_angle_beta":
137
+ beta = float(
138
+ ''.join(c for c in linesplit[1] if c not in '()').rstrip('.'))
139
+ if linesplit[0] == "_cell_angle_gamma":
140
+ gamma = float(
141
+ ''.join(c for c in linesplit[1] if c not in '()').rstrip('.'))
142
+ # create cell vectors
143
+ print(('cell vectors: ', 'alpha, beta, gamma = ' + str(alpha) +
144
+ ', ' + str(beta) + ', ' + str(gamma)))
145
+ try:
146
+ cell_vector.append([A, 0, 0])
147
+ cell_vector.append([B*numpy.cos((gamma*pi)/180),
148
+ B*numpy.sin((gamma*pi)/180), 0])
149
+ cx = C*numpy.cos((beta*pi)/180)
150
+ cy = C*(numpy.cos((alpha*pi)/180)-numpy.cos((beta*pi)/180) *
151
+ numpy.cos((gamma*pi/180)))/numpy.sin((gamma*pi)/180)
152
+ cz = sqrt(C*C - cx*cx - cy*cy)
153
+ cell_vector.append([cx, cy, cz])
154
+ except ValueError: # Negative number in sqrt
155
+ emsg = emsg.append('Error in creating unit cell from cif informtation')
156
+ exit_status = 2
157
+ for i, rows in enumerate(cell_vector):
158
+ for j, elements in enumerate(rows):
159
+ if abs(elements) <= 1e-8:
160
+ cell_vector[i][j] = 0
161
+ if exit_status != 0:
162
+ return emsg
163
+ elif return_extra_cif_info:
164
+ return unit_cell, cell_vector, alpha, beta, gamma
165
+ else:
166
+ return unit_cell, cell_vector
167
+ ##################################
168
+ # get center_of_sym CIF to mol3D
169
+ #
170
+ # @param list_of_points list of points
171
+ # @return csym center of sym
172
+
173
+
174
+ def center_of_sym(list_of_points):
175
+ n = len(list_of_points)
176
+ # print('lop = ' + str(list_of_points))
177
+ csym = [float(sum(x)/n) for x in zip(*list_of_points)]
178
+ return csym
179
+ # get sets min z coord of mol3D to zero
180
+ #
181
+ # @param super_cell mol3D of cell
182
+
183
+
184
+ def zero_z_csm(super_cell):
185
+ # puts center of sym
186
+ # at z = 0
187
+ csm = super_cell.centersym()
188
+ vec = [0, 0, 0]
189
+ vec[2] = -1*csm[2]
190
+ super_cell.translate(vec)
191
+ ##################################
192
+
193
+
194
+ def xgcd(b, n):
195
+ # calculate x,y such that b*x + n*y = gcd(b,n)
196
+ # by extended Euclidean algorithm
197
+ x0, x1, y0, y1 = 1, 0, 0, 1
198
+ while n != 0:
199
+ q, b, n = b // n, n, b % n
200
+ x0, x1 = x1, x0 - q * x1
201
+ y0, y1 = y1, y0 - q * y1
202
+ return b, x0, y0
203
+ #
204
+ ##################################
205
+
206
+
207
+ def distance_zw(r1, r2):
208
+ dx = r1[0] - r2[0]
209
+ dy = r1[1] - r2[1]
210
+ dz = 150*(r1[2] - r2[2])
211
+ d = sqrt(dx**2+dy**2+dz**2)
212
+ return d
213
+ ##################################
214
+
215
+
216
+ def mdistance(r1, r2):
217
+ dx = r1[0] - r2[0]
218
+ dy = r1[1] - r2[1]
219
+ dz = r1[2] - r2[2]
220
+ d = sqrt(numpy.power(dx, 2) + numpy.power(dy, 2) + numpy.power(dz, 2))
221
+ return d
222
+ ###################################
223
+
224
+
225
+ def get_basis_coefficients(point, basis):
226
+ # function to get basis set coefficients
227
+ # for an arbitrary point in a given (complete)
228
+ # basis set
229
+ coefficients = numpy.linalg.solve(
230
+ numpy.transpose(numpy.asarray(basis)), point)
231
+ return coefficients
232
+ ###################################
233
+
234
+
235
+ def evaluate_basis_coefficients(coefficients, basis):
236
+ # get cartessian coords from basis set and
237
+ # coefficients
238
+
239
+ recons = [0, 0, 0]
240
+ for j in [0, 1, 2]:
241
+ recons = numpy.add(
242
+ recons, [coefficients[j]*numpy.asarray(basis[j][i]) for i in [0, 1, 2]])
243
+ return recons
244
+ ###################################
245
+
246
+
247
+ def change_basis(mol, old_basis, new_basis):
248
+ new_mol = mol3D()
249
+ new_mol.copymol3D(mol)
250
+ point_coefficients = [get_basis_coefficients(
251
+ at.coords(), old_basis) for at in new_mol.getAtoms()]
252
+ new_points = [get_basis_coefficients(
253
+ point, new_basis) for point in point_coefficients]
254
+ for i, at in enumerate(new_mol.getAtoms()):
255
+ at.setcoords(new_points[i])
256
+ return new_mol
257
+ ###################################
258
+
259
+
260
+ def normalize_vector(v):
261
+ length = distance(v, [0, 0, 0])
262
+ if length:
263
+ nv = [float(i)/length for i in v]
264
+ else:
265
+ nv = [0, 0, 0]
266
+ return nv
267
+ ##############################
268
+
269
+
270
+ def threshold_basis(basis, threshold):
271
+ new_basis = [threshold_vector(i, threshold) for i in basis]
272
+ return new_basis
273
+ ##############################
274
+
275
+
276
+ def threshold_vector(v, threshold):
277
+ nv = copy.copy(v)
278
+ for i, vi in enumerate(v):
279
+ if abs(vi) < threshold:
280
+ nv[i] = 0
281
+ return nv
282
+ ##############################
283
+
284
+
285
+ def find_all_surface_atoms(super_cell, tol=1e-2, type_of_atom=False):
286
+ # Get all atoms on the tope surface - NB, this will
287
+ # not handle complex (2 or more) atom-type surfaces
288
+ # if the atoms are 'layered', e.g. TiO2 - Ti under O2,
289
+ # no Ti will be found. This can be overcome by using \
290
+ # a looser tolerance, such that the interlayer differences
291
+ # are smaller than tol, but not so large as to conflate
292
+ # different layers!
293
+ # INPUT:
294
+ # - super_cell: mol3D class that contains the super cell
295
+ # - tol: float, max distance from extent plane to look
296
+ # - type_of_atom: optional, string, gets atoms of the given type on the face plane
297
+ # if left out, will not care about types of atoms
298
+ # OUPUT
299
+ # - avail_sites_list: list of int, indices of atoms on the surface
300
+ #
301
+ extents = find_extents(super_cell)
302
+ target_height = extents[2]
303
+ avail_sites_list = list()
304
+ if type_of_atom:
305
+ possible_atom_inds = super_cell.findAtomsbySymbol(type_of_atom)
306
+ else:
307
+ possible_atom_inds = list(range(0, super_cell.natoms))
308
+ for indices in possible_atom_inds:
309
+ z_dist = abs(super_cell.getAtom(indices).coords()[2] - target_height)
310
+ if (z_dist <= tol):
311
+ avail_sites_list.append(indices)
312
+
313
+ return avail_sites_list
314
+
315
+ ###################################
316
+
317
+
318
+ def distance_2d_torus(R1, R2, dim):
319
+ # distance between points in Euclidean torus
320
+ dx = abs(R1[0] - R2[0])
321
+ dy = abs(R1[1] - R2[1])
322
+ dz = abs((R1[2] - R2[2]))
323
+ d1 = sqrt(numpy.power(dim[0] - dx, 2)
324
+ + numpy.power(dim[1] - dy, 2)
325
+ + numpy.power(dz, 2))
326
+ d2 = sqrt(numpy.power(dim[0] - dx, 2)
327
+ + numpy.power(dy, 2)
328
+ + numpy.power(dz, 2))
329
+ d3 = sqrt(numpy.power(dx, 2)
330
+ + numpy.power(dim[1] - dy, 2)
331
+ + numpy.power(dz, 2))
332
+ d4 = sqrt(numpy.power(dx, 2)
333
+ + numpy.power(dy, 2)
334
+ + numpy.power(dz, 2))
335
+ d = min(d1, d2, d3, d4)
336
+ return d
337
+ ###################################
338
+
339
+
340
+ def distance_2d_torus_next_only(R1, R2, dim):
341
+ # distance between points in Euclidean torus
342
+ dx = abs(R1[0] - R2[0])
343
+ dy = abs(R1[1] - R2[1])
344
+ dz = abs((R1[2] - R2[2]))
345
+ # print('dx,dy,dz'+str([dx,dy,dz]))
346
+ d1 = sqrt(numpy.power(dim[0] - dx, 2)
347
+ + numpy.power(dim[1] - dy, 2)
348
+ + numpy.power(dz, 2))
349
+ d2 = sqrt(numpy.power(dim[0] - dx, 2)
350
+ + numpy.power(dy, 2)
351
+ + numpy.power(dz, 2))
352
+ d3 = sqrt(numpy.power(dx, 2)
353
+ + numpy.power(dim[1] - dy, 2)
354
+ + numpy.power(dz, 2))
355
+ # print('d1,d2,d3'+str([dx,dy,dz]))
356
+
357
+ d = min(d1, d2, d3)
358
+ return d
359
+ #
360
+ ################################################################
361
+
362
+
363
+ def periodic_2d_distance(R1, R2, cell_vector):
364
+ # distance between points in Euclidean torus
365
+ # STILL UNDER CONSTRUCTION, WIP WIP WIP ***
366
+ dx = abs(R1[0] - R2[0])
367
+ dy = abs(R1[1] - R2[1])
368
+ dz = abs((R1[2] - R2[2]))
369
+ for v1shifts in [-1, 0, 1]:
370
+ for v1shifts in [-1, 0, 1]:
371
+ for yshifts in [-1, 0, 0]:
372
+ pass
373
+ d1 = sqrt(numpy.power(dim[0] - dx, 2) # noqa: F821 (under construction)
374
+ + numpy.power(dim[1] - dy, 2) # noqa: F821 (under construction)
375
+ + numpy.power(dz, 2))
376
+ d2 = sqrt(numpy.power(dim[0] - dx, 2) # noqa: F821 (under construction)
377
+ + numpy.power(dy, 2)
378
+ + numpy.power(dz, 2))
379
+ d3 = sqrt(numpy.power(dx, 2)
380
+ + numpy.power(dim[1] - dy, 2) # noqa: F821 (under construction)
381
+ + numpy.power(dz, 2))
382
+ d = min(d1, d2, d3)
383
+ return d
384
+ ################################################################
385
+
386
+
387
+ def periodic_mindist(mol, surf, dim):
388
+ ### calculates minimum distance between atoms in 2 molecules ###
389
+ # INPUT
390
+ # - mol: mol3D class, molecule
391
+ # - surf: mol3D class, the surface
392
+ # - dim: list of float, replication
393
+ # OUTPUT
394
+ # - mind: minimum distance between atoms of the 2 mol objects
395
+ mind = 1000
396
+ for atom1 in mol.getAtoms():
397
+ for atom0 in surf.getAtoms():
398
+ if (distance_2d_torus(atom1.coords(), atom0.coords(), dim) < mind):
399
+ mind = distance(atom1.coords(), atom0.coords())
400
+ return mind
401
+ ################################################################
402
+
403
+
404
+ def periodic_selfdist(mol, dim):
405
+ ### calculates minimum distance between atoms in 2 molecules ##
406
+ # INPUT
407
+ # - mol: mol3D class, molecule
408
+ # - dim: list of floats, replication
409
+ # OUTPUT
410
+ # - mind: minimum distance between atoms of the 2 mol and periodic
411
+ # images
412
+ mind = 1000
413
+ for ii, atom1 in enumerate(mol.getAtoms()):
414
+ for jj, atom0 in enumerate(mol.getAtoms()):
415
+ if (distance_2d_torus(atom1.coords(), atom0.coords(), dim) < mind) and (ii != jj):
416
+ mind = distance(atom1.coords(), atom0.coords())
417
+ return mind
418
+
419
+ ##################################
420
+
421
+
422
+ def closest_torus_point(mol, dim):
423
+ min_dist = 1000
424
+ for atom1 in mol.getAtoms():
425
+ R1 = atom1.coords()
426
+ for atom2 in mol.getAtoms():
427
+ R2 = atom2.coords()
428
+ d = distance_2d_torus_next_only(R1, R2, dim)
429
+ if (d < min_dist):
430
+ min_dist = d
431
+ return min_dist
432
+ #################################
433
+
434
+
435
+ def check_top_layer_correct(super_cell, atom_type):
436
+ # remove the layer on
437
+ # top of the cell if
438
+ # wrong material is exposed
439
+ trimmed_cell = mol3D()
440
+ trimmed_cell.copymol3D(super_cell)
441
+ globs = globalvars()
442
+ elements = globs.elementsbynum()
443
+ print(('chekcing surface for ' + atom_type + '\n'))
444
+ if atom_type not in elements:
445
+ print("unkown surface type, unable to trim ")
446
+ return trimmed_cell
447
+ else:
448
+ stop_flag = False
449
+ counter = 0 # 3 tries max
450
+ while not stop_flag:
451
+ atom_type_surf = find_all_surface_atoms(
452
+ trimmed_cell, tol=1e-3, type_of_atom=atom_type)
453
+ top_surf = find_all_surface_atoms(
454
+ trimmed_cell, tol=1e-3, type_of_atom=False)
455
+ # print("top surf",top_surf)
456
+ # print("atom top surf",atom_type_surf)
457
+ if set(atom_type_surf) == set(top_surf):
458
+ print('match')
459
+ stop_flag = True
460
+ else:
461
+ counter += 1
462
+ trimmed_cell = shave_surface_layer(trimmed_cell, 1e-3)
463
+ if counter == 3:
464
+ print('unable to find target atom in 3 cuts')
465
+ stop_flag = True
466
+ return trimmed_cell
467
+ ###############################
468
+
469
+
470
+ def shave_surface_layer(super_cell, TOL=1e-1):
471
+ # dlist = fractionate_points_by_plane(super_cell,n)
472
+ # points_below_plane(point,n,refd)
473
+
474
+ shaved_cell = mol3D()
475
+ shaved_cell.copymol3D(super_cell)
476
+ extents = find_extents(super_cell)
477
+ zmax = extents[2]
478
+ del_list = list()
479
+ for i, atoms in enumerate(super_cell.getAtoms()):
480
+ coords = atoms.coords()
481
+ if abs(coords[2] - zmax) < TOL:
482
+ del_list.append(i)
483
+ shaved_cell.deleteatoms(del_list)
484
+ return shaved_cell
485
+ ###############################
486
+
487
+
488
+ def shave_under_layer(super_cell):
489
+ shaved_cell = mol3D()
490
+ shaved_cell.copymol3D(super_cell)
491
+ TOL = 1e-1
492
+ zmin = 1000
493
+ for i, atoms in enumerate(super_cell.getAtoms()):
494
+ coords = atoms.coords()
495
+ if (coords[2] < zmin):
496
+ zmin = coords[2]
497
+ del_list = list()
498
+ for i, atoms in enumerate(super_cell.getAtoms()):
499
+ coords = atoms.coords()
500
+ if abs(coords[2] - zmin) < TOL:
501
+ del_list.append(i)
502
+ shaved_cell.deleteatoms(del_list)
503
+ return shaved_cell
504
+ ###############################
505
+
506
+
507
+ def shave__type(super_cell, dim, mode):
508
+ ## dim = 0,1,2
509
+ # x,y,z
510
+ # mode = 1 for max, -1 for min
511
+ shaved_cell = mol3D()
512
+ shaved_cell.copymol3D(super_cell)
513
+ TOL = 1e-1
514
+
515
+ dim_ref = 1000
516
+
517
+ del_list = []
518
+ if (mode == -1):
519
+ for i, atoms in enumerate(super_cell.getAtoms()):
520
+ coords = atoms.coords()
521
+ if (coords[dim] < dim_ref):
522
+ dim_ref = coords[dim]
523
+ for i, atoms in enumerate(super_cell.getAtoms()):
524
+ coords = atoms.coords()
525
+ if abs(coords[dim] - dim_ref) < TOL:
526
+ del_list.append(i)
527
+ elif (mode == 1):
528
+ extents = find_extents(super_cell)
529
+ dim_max = extents[dim]
530
+ for i, atoms in enumerate(super_cell.getAtoms()):
531
+ coords = atoms.coords()
532
+ if abs(coords[dim] - dim_max) < TOL:
533
+ del_list.append(i)
534
+ # return
535
+ shaved_cell.deleteatoms(del_list)
536
+ return shaved_cell
537
+ ###############################
538
+
539
+
540
+ def zero_z(super_cell):
541
+ zeroed_cell = mol3D()
542
+ zeroed_cell.copymol3D(super_cell)
543
+ zmin = 1000
544
+ for i, atoms in enumerate(super_cell.getAtoms()):
545
+ coords = atoms.coords()
546
+ if (coords[2] < zmin):
547
+ zmin = coords[2]
548
+ zeroed_cell.translate([0, 0, -1*zmin])
549
+ return zeroed_cell
550
+
551
+
552
+ def zero_x(super_cell):
553
+ zeroed_cell = mol3D()
554
+ zeroed_cell.copymol3D(super_cell)
555
+ xmin = 1000
556
+ for i, atoms in enumerate(super_cell.getAtoms()):
557
+ coords = atoms.coords()
558
+ if (coords[0] < xmin):
559
+ xmin = coords[0]
560
+ zeroed_cell.translate([-1*xmin, 0, 0])
561
+ return zeroed_cell
562
+
563
+
564
+ def zero_y(super_cell):
565
+ zeroed_cell = mol3D()
566
+ zeroed_cell.copymol3D(super_cell)
567
+ ymin = 1000
568
+ for i, atoms in enumerate(super_cell.getAtoms()):
569
+ coords = atoms.coords()
570
+ if (coords[1] < ymin):
571
+ ymin = coords[1]
572
+ zeroed_cell.translate([0, -1*ymin, 0])
573
+ return zeroed_cell
574
+
575
+ ###############################
576
+
577
+
578
+ def point_in_box(point, box):
579
+ outcome = False
580
+ fx = (box[0][0] <= point[0])*(point[0] < box[0][1])
581
+ fy = (box[1][0] <= point[1])*(point[1] < box[1][1])
582
+ fz = (box[2][0] <= point[2])*(point[2] < box[2][1])
583
+ if fz and fy and fx:
584
+ outcome = True
585
+ return outcome
586
+ ##############################
587
+
588
+
589
+ def apply_plane_to_point(point, n):
590
+ dplane = sum([n[i]*point[i] for i in [0, 1, 2]])
591
+ return dplane
592
+ ##############################
593
+
594
+
595
+ def fractionate_points_by_plane(super_cell, n, tol=1E-8):
596
+ vals = list()
597
+ for i, atoms in enumerate(super_cell.getAtoms()):
598
+ coords = atoms.coords()
599
+ this_frac = apply_plane_to_point(coords, n)
600
+ if len(vals) > 0:
601
+ # compare to seen values
602
+ these_dists = [abs(this_frac-j) for j in vals]
603
+ if min(these_dists) < tol:
604
+ pass
605
+ # print('have this point')
606
+ else:
607
+ vals.append(this_frac)
608
+ print(('new point at ' + str(this_frac)))
609
+ else:
610
+ vals.append(this_frac)
611
+ return vals
612
+ ##############################
613
+
614
+
615
+ def points_below_plane(point, n, refd):
616
+ dplane = apply_plane_to_point(point, n) # noqa: F841 (under construction)
617
+ if abs(d-refd) < 1E-6: # noqa: F821 (under construction)
618
+ outcome = False
619
+ elif d < dref: # noqa: F821 (under construction)
620
+ outcome = True
621
+ else:
622
+ outcome = False
623
+ return outcome
624
+ #################################
625
+
626
+
627
+ def freeze_bottom_n_layers(super_cell, n):
628
+ frozen_cell = mol3D()
629
+ frozen_cell.copymol3D(super_cell)
630
+ counter = 0
631
+ while counter < n:
632
+ frozen_cell_new = freeze_under_layer(frozen_cell)
633
+ frozen_cell = mol3D()
634
+ frozen_cell.copymol3D(frozen_cell_new)
635
+ counter += 1
636
+ return frozen_cell
637
+ ###############################
638
+
639
+
640
+ def freeze_under_layer(super_cell):
641
+ frozen_cell = mol3D()
642
+ frozen_cell.copymol3D(super_cell)
643
+ TOL = 1.5
644
+ zmin = 1000
645
+ for i, atoms in enumerate(super_cell.getAtoms()):
646
+ coords = atoms.coords()
647
+ if not atoms.frozen:
648
+ if (coords[2] < zmin):
649
+ zmin = coords[2]
650
+ freeze_list = list()
651
+ # print('lowest ' + str(zmin))
652
+ for i, atoms in enumerate(super_cell.getAtoms()):
653
+ coords = atoms.coords()
654
+ if not atoms.frozen:
655
+ if abs(coords[2] - zmin) < TOL:
656
+ freeze_list.append(i)
657
+ # print("freezing at " + str(coords))
658
+ frozen_cell.freezeatoms(freeze_list)
659
+ return frozen_cell
660
+ ##############################
661
+
662
+
663
+ def find_extents(super_cell):
664
+ # INPUT
665
+ # - super_cell: mol3D class that contains the super cell
666
+ # OUPUT
667
+ # - extents: list of max coords of atoms on the surface
668
+ xmax = 0
669
+ zmax = 0
670
+ ymax = 0
671
+ for atoms in super_cell.getAtoms():
672
+ coords = atoms.coords()
673
+ x_ext = coords[0] # + atoms.rad
674
+ y_ext = coords[1] # + atoms.rad
675
+ z_ext = coords[2] # + atoms.rad
676
+ xmax = max(xmax, x_ext)
677
+ ymax = max(ymax, y_ext)
678
+ zmax = max(zmax, z_ext)
679
+ extents = [xmax, ymax, zmax]
680
+ return extents
681
+ #####################################
682
+
683
+
684
+ def find_extents_cv(super_cell_vector):
685
+ # INPUT
686
+ # - super_cell_vector: matrix of the three vectors that define the super cell
687
+ # OUPUT
688
+ # - extents: list of max coords of the super cell
689
+ xmax = 0
690
+ zmax = 0
691
+ ymax = 0
692
+ for columns in super_cell_vector:
693
+ xmax = max(xmax, abs(columns[0]))
694
+ ymax = max(ymax, abs(columns[1]))
695
+ zmax = max(zmax, abs(columns[2]))
696
+ xmax = numpy.linalg.norm(super_cell_vector[0])
697
+ ymax = numpy.linalg.norm(super_cell_vector[1])
698
+ zmax = numpy.linalg.norm(super_cell_vector[2])
699
+
700
+ extents = [xmax, ymax, zmax]
701
+ return extents