mlatom 3.16.1__tar.gz → 3.16.2__tar.gz

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 (143) hide show
  1. {mlatom-3.16.1/src/mlatom.egg-info → mlatom-3.16.2}/PKG-INFO +4 -4
  2. {mlatom-3.16.1 → mlatom-3.16.2}/README.md +3 -3
  3. {mlatom-3.16.1 → mlatom-3.16.2}/setup.py +1 -1
  4. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatom.py +3 -2
  5. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLtasks.py +20 -5
  6. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/args_class.py +4 -0
  7. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/data.py +104 -6
  8. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/ase_interface.py +3 -1
  9. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/gaussian_interface.py +106 -6
  10. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/pyscf_interface.py +2 -2
  11. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/torchani_interface.py +20 -10
  12. mlatom-3.16.2/src/mlatom/interfaces/xtb_interface.py +338 -0
  13. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/simulations.py +37 -22
  14. mlatom-3.16.2/src/mlatom/xyz.py +102 -0
  15. {mlatom-3.16.1 → mlatom-3.16.2/src/mlatom.egg-info}/PKG-INFO +4 -4
  16. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom.egg-info/SOURCES.txt +0 -1
  17. mlatom-3.16.1/src/mlatom/interfaces/xtb_interface.py +0 -209
  18. mlatom-3.16.1/src/mlatom/mltpa/__init__.py +0 -0
  19. mlatom-3.16.1/src/mlatom/xyz.py +0 -65
  20. {mlatom-3.16.1 → mlatom-3.16.2}/LICENSE.txt +0 -0
  21. {mlatom-3.16.1 → mlatom-3.16.2}/setup.cfg +0 -0
  22. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/GICnet.py +0 -0
  23. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLTPA.py +0 -0
  24. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/ML_NEA.py +0 -0
  25. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF +0 -0
  26. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/A_KRR.f90 +0 -0
  27. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/A_KRR_kernel.f90 +0 -0
  28. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/D_CoulombMatrix.f90 +0 -0
  29. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/D_ID.f90 +0 -0
  30. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/D_rel2eq.f90 +0 -0
  31. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/MLatomF.f90 +0 -0
  32. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/MLatomFInfo.f90 +0 -0
  33. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/MLmodel.f90 +0 -0
  34. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/Makefile +0 -0
  35. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/Makefile.intel +0 -0
  36. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/__init__.py +0 -0
  37. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/analyze.f90 +0 -0
  38. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/constants.f90 +0 -0
  39. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/cs.cpp +0 -0
  40. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/dataset.f90 +0 -0
  41. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/mathUtils.f90 +0 -0
  42. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/molDescr.f90 +0 -0
  43. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/optionsModule.f90 +0 -0
  44. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/precision.f90 +0 -0
  45. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/recover.sh +0 -0
  46. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/sampling.f90 +0 -0
  47. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/statistics.f90 +0 -0
  48. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/stopper.f90 +0 -0
  49. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/strings.f90 +0 -0
  50. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/timing.f90 +0 -0
  51. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/MLatomF_src/types.f90 +0 -0
  52. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/__init__.py +0 -0
  53. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1.py +0 -0
  54. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/__init__.py +0 -0
  55. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv0.pt +0 -0
  56. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv1.pt +0 -0
  57. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv2.pt +0 -0
  58. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv3.pt +0 -0
  59. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv4.pt +0 -0
  60. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv5.pt +0 -0
  61. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv6.pt +0 -0
  62. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_cc_cv7.pt +0 -0
  63. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv0.pt +0 -0
  64. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv1.pt +0 -0
  65. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv2.pt +0 -0
  66. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv3.pt +0 -0
  67. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv4.pt +0 -0
  68. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv5.pt +0 -0
  69. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv6.pt +0 -0
  70. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm1_model/aiqm1_dft_cv7.pt +0 -0
  71. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2.py +0 -0
  72. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/__init__.py +0 -0
  73. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv0.pt +0 -0
  74. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv1.pt +0 -0
  75. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv2.pt +0 -0
  76. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv3.pt +0 -0
  77. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv4.pt +0 -0
  78. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv5.pt +0 -0
  79. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv6.pt +0 -0
  80. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/aiqm2_model/aiqm2_cv7.pt +0 -0
  81. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/al.py +0 -0
  82. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/al_utils.py +0 -0
  83. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/ccsdtstarcbs.py +0 -0
  84. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/composite_methods.py +0 -0
  85. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/constants.py +0 -0
  86. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/conversions.py +0 -0
  87. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/cs.so +0 -0
  88. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/decorators.py +0 -0
  89. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/dens.py +0 -0
  90. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/doc.py +0 -0
  91. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/fortran/KREG.f90 +0 -0
  92. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/fortran/KREG.so +0 -0
  93. {mlatom-3.16.1/src/mlatom/ani_gelu_model → mlatom-3.16.2/src/mlatom/fortran}/__init__.py +0 -0
  94. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/fortran/compile.py +0 -0
  95. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/fortran/mathUtils.f90 +0 -0
  96. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/fortran/stopper.f90 +0 -0
  97. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/functionsGICnet.py +0 -0
  98. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/gap_md.py +0 -0
  99. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/header.py +0 -0
  100. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/initial_conditions.py +0 -0
  101. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interface_MLatomF.py +0 -0
  102. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/__init__.py +0 -0
  103. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/columbus_interface.py +0 -0
  104. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/dftbplus_interface.py +0 -0
  105. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/dftd3_interface.py +0 -0
  106. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/dftd4_interface.py +0 -0
  107. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/dpmd_interface.py +0 -0
  108. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/gap_interface.py +0 -0
  109. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/mace_interface.py +0 -0
  110. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/mndo_interface.py +0 -0
  111. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/orca_interface.py +0 -0
  112. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/physnet_interface.py +0 -0
  113. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/sgdml_interface.py +0 -0
  114. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/sparrow_interface.py +0 -0
  115. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/turbomole_interface.py +0 -0
  116. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/interfaces/xtb +0 -0
  117. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/kreg_api.py +0 -0
  118. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/log.py +0 -0
  119. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/md.py +0 -0
  120. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/md2vibr.py +0 -0
  121. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/md2vibr_cmd.py +0 -0
  122. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/md_cmd.py +0 -0
  123. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/md_parallel.py +0 -0
  124. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/mlatom_gui.py +0 -0
  125. {mlatom-3.16.1/src/mlatom/fortran → mlatom-3.16.2/src/mlatom/mltpa}/__init__.py +0 -0
  126. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/mltpa/mff.txt +0 -0
  127. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/mltpa/mltpa2022_2.pkl +0 -0
  128. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/mltpa/mltpa2022_2_new_.pkl +0 -0
  129. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/models.py +0 -0
  130. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/namd.py +0 -0
  131. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/plot.py +0 -0
  132. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/ref.json +0 -0
  133. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/shell_cmd.py +0 -0
  134. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/sliceData.py +0 -0
  135. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/spectra.py +0 -0
  136. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/stats.py +0 -0
  137. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/stopper.py +0 -0
  138. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/thermostat.py +0 -0
  139. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom/utils.py +0 -0
  140. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom.egg-info/dependency_links.txt +0 -0
  141. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom.egg-info/entry_points.txt +0 -0
  142. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom.egg-info/requires.txt +0 -0
  143. {mlatom-3.16.1 → mlatom-3.16.2}/src/mlatom.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlatom
3
- Version: 3.16.1
3
+ Version: 3.16.2
4
4
  Summary: A Package for AI-enhanced computational chemistry
5
5
  Home-page: http://mlatom.com
6
6
  Author: Pavlo O. Dral
@@ -27,7 +27,7 @@ Requires-Dist: tqdm
27
27
  # About Program
28
28
  MLatom: a Package for Atomistic Simulations with Machine Learning
29
29
 
30
- Version 3.16.1
30
+ Version 3.16.2
31
31
 
32
32
  **Official website**: http://mlatom.com/
33
33
  **Documentation**: http://mlatom.com/docs/
@@ -56,7 +56,7 @@ When this Software or its derivatives are used in scientific publications, it sh
56
56
  * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Mario Barbatti, Olexandr Isayev, Cheng Wang, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Lina Zhang, Shuang Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou. [MLatom 3: A Platform for Machine Learning-enhanced Computational Chemistry Simulations and Workflows](https://doi.org/10.1021/acs.jctc.3c01203). *J. Chem. Theory Comput.* **2024**, *20*, 1193--1213.
57
57
  * Pavlo O. Dral, Fuchun Ge, Bao-Xin Xue, Yi-Fan Hou, Max Pinheiro Jr, Jianxing Huang, Mario Barbatti. [MLatom 2: An Integrative Platform for Atomistic Machine Learning](http://doi.org/10.1007/s41061-021-00339-5). *Top. Curr. Chem.* **2021**, *379*, 27.
58
58
  * Pavlo O. Dral. [MLatom: A Program Package for Quantum Chemical Research Assisted by Machine Learning](http://dx.doi.org/10.1002/jcc.26004). *J. Comput. Chem.* **2019**, *40*, 2339--2347.
59
- * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Mikolaj Martyka, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, Matheus O. Bispo, Vignesh B. Kumar, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.16.1, Xiamen University, Xiamen, China, 2013-2024.
59
+ * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Mikolaj Martyka, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, Matheus O. Bispo, Vignesh B. Kumar, Xin-Yu Tong, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.16.2, Xiamen University, Xiamen, China, 2013-2024.
60
60
  [MLatom.com](http://mlatom.com).
61
61
 
62
62
  The citations for MLatom's interfaces and features shall be eventually
@@ -105,7 +105,7 @@ Citations mentioned above should be included. For convenience, below we provide
105
105
  }
106
106
 
107
107
  @misc{MLatomProg,
108
- author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Martyka, Mikolaj and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Pios, Sebastian V. and Ou, Yanchi and Bispo, Matheus O. and Kumar, Vignesh B.},
108
+ author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Martyka, Mikolaj and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Pios, Sebastian V. and Ou, Yanchi and Bispo, Matheus O. and Kumar, Vignesh B. and Tong, Xin-Yu},
109
109
  title = {MLatom: A Package for Atomistic Simulations with Machine Learning},
110
110
  year = {2013--2024},
111
111
  type = {Computer Program}
@@ -1,7 +1,7 @@
1
1
  # About Program
2
2
  MLatom: a Package for Atomistic Simulations with Machine Learning
3
3
 
4
- Version 3.16.1
4
+ Version 3.16.2
5
5
 
6
6
  **Official website**: http://mlatom.com/
7
7
  **Documentation**: http://mlatom.com/docs/
@@ -30,7 +30,7 @@ When this Software or its derivatives are used in scientific publications, it sh
30
30
  * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Mario Barbatti, Olexandr Isayev, Cheng Wang, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Lina Zhang, Shuang Zhang, Arif Ullah, Quanhao Zhang, Yanchi Ou. [MLatom 3: A Platform for Machine Learning-enhanced Computational Chemistry Simulations and Workflows](https://doi.org/10.1021/acs.jctc.3c01203). *J. Chem. Theory Comput.* **2024**, *20*, 1193--1213.
31
31
  * Pavlo O. Dral, Fuchun Ge, Bao-Xin Xue, Yi-Fan Hou, Max Pinheiro Jr, Jianxing Huang, Mario Barbatti. [MLatom 2: An Integrative Platform for Atomistic Machine Learning](http://doi.org/10.1007/s41061-021-00339-5). *Top. Curr. Chem.* **2021**, *379*, 27.
32
32
  * Pavlo O. Dral. [MLatom: A Program Package for Quantum Chemical Research Assisted by Machine Learning](http://dx.doi.org/10.1002/jcc.26004). *J. Comput. Chem.* **2019**, *40*, 2339--2347.
33
- * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Mikolaj Martyka, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, Matheus O. Bispo, Vignesh B. Kumar, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.16.1, Xiamen University, Xiamen, China, 2013-2024.
33
+ * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Mikolaj Martyka, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, Matheus O. Bispo, Vignesh B. Kumar, Xin-Yu Tong, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.16.2, Xiamen University, Xiamen, China, 2013-2024.
34
34
  [MLatom.com](http://mlatom.com).
35
35
 
36
36
  The citations for MLatom's interfaces and features shall be eventually
@@ -79,7 +79,7 @@ Citations mentioned above should be included. For convenience, below we provide
79
79
  }
80
80
 
81
81
  @misc{MLatomProg,
82
- author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Martyka, Mikolaj and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Pios, Sebastian V. and Ou, Yanchi and Bispo, Matheus O. and Kumar, Vignesh B.},
82
+ author = {Dral, Pavlo O. and Ge, Fuchun and Hou, Yi-Fan and Zheng, Peikun and Chen, Yuxinxin and Xue, Bao-Xin and Martyka, Mikolaj and Pinheiro Jr, Max and Su, Yuming and Dai, Yiheng and Chen, Yangtao and Zhang, Shuang and Zhang, Lina and Ullah, Arif and Zhang, Quanhao and Pios, Sebastian V. and Ou, Yanchi and Bispo, Matheus O. and Kumar, Vignesh B. and Tong, Xin-Yu},
83
83
  title = {MLatom: A Package for Atomistic Simulations with Machine Learning},
84
84
  year = {2013--2024},
85
85
  type = {Computer Program}
@@ -43,7 +43,7 @@ with open(os.path.join(here, 'README.md')) as f:
43
43
 
44
44
  setup(
45
45
  name = pkg_name,
46
- version = "3.16.1",
46
+ version = "3.16.2",
47
47
  author = "Pavlo O. Dral",
48
48
  author_email = "admin@mlatom.com",
49
49
  license = 'MIT (modified)',
@@ -4,7 +4,7 @@
4
4
  !---------------------------------------------------------------------------!
5
5
  ! !
6
6
  ! MLatom: a Package for Atomistic Simulations with Machine Learning !
7
- ! MLatom 3.16.1 !
7
+ ! MLatom 3.16.2 !
8
8
  ! @ !
9
9
  ! Xiamen Atomistic Computing Suite (XACS) !
10
10
  ! !
@@ -36,8 +36,9 @@
36
36
  ! Bao-Xin Xue, Mikolaj Martyka, Max Pinheiro Jr, Yuming Su, Yiheng Dai, !
37
37
  ! Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, !
38
38
  ! Sebastian V. Pios, Yanchi Ou, Matheus O. Bispo, Vignesh B. Kumar, !
39
+ ! Xin-Yu Tong, !
39
40
  ! MLatom: A Package for Atomistic Simulations with Machine Learning, !
40
- ! version 3.16.1, Xiamen University, Xiamen, China, 2013-2024. !
41
+ ! version 3.16.2, Xiamen University, Xiamen, China, 2013-2024. !
41
42
  ! !
42
43
  ! The citations for MLatom's interfaces and features shall be eventually !
43
44
  ! included too. See header.py, ref.json and http://mlatom.com. !
@@ -364,7 +364,15 @@ def slice(args):
364
364
  from . import sliceData
365
365
  sliceData.sliceDataCls(argsSD = args.args2pass)
366
366
 
367
- def geomopt(args):
367
+ def optfreq(args):
368
+ molDB = geomopt(args, return_moldb=True)
369
+ freq(args, molDB=molDB)
370
+
371
+ def tsfreq(args):
372
+ molDB = ts(args, return_moldb=True)
373
+ freq(args, molDB=molDB)
374
+
375
+ def geomopt(args, return_moldb=False):
368
376
  from . import simulations
369
377
  molDB = loading_data(XYZfile=args.XYZfile, charges=args.charges, multiplicities=args.multiplicities)
370
378
  model = loading_model(args)
@@ -419,13 +427,20 @@ def geomopt(args):
419
427
  else:
420
428
  print('\n Final energy of molecule %6d: %25.13f Hartree\n\n' % (imol+1, geomopt.optimized_molecule.energy))
421
429
  db_opt.write_file_with_xyz_coordinates(filename=fname)
430
+ if return_moldb:
431
+ return db_opt
422
432
 
423
- def ts(args):
424
- geomopt(args)
433
+ def ts(args, return_moldb=False):
434
+ if return_moldb:
435
+ molDB = geomopt(args, return_moldb=return_moldb)
436
+ return molDB
437
+ else:
438
+ geomopt(args, return_moldb=return_moldb)
425
439
 
426
- def freq(args):
440
+ def freq(args, molDB=None):
427
441
  from . import simulations
428
- molDB = loading_data(args.XYZfile, charges=args.charges, multiplicities=args.multiplicities)
442
+ if molDB is None:
443
+ molDB = loading_data(args.XYZfile, charges=args.charges, multiplicities=args.multiplicities)
429
444
  model = loading_model(args)
430
445
  kwargs = {}
431
446
  if args.freqProg: kwargs['program'] = args.freqProg
@@ -695,6 +695,10 @@ class mlatom_args(ArgsBase):
695
695
  elif len(tasks) > 1:
696
696
  if self.selfCorrect:
697
697
  self._task = 'selfCorrect'
698
+ elif 'geomopt' in tasks and 'freq' in tasks:
699
+ self._task = 'optfreq'
700
+ elif 'ts' in tasks and 'freq' in tasks:
701
+ self._task = 'tsfreq'
698
702
  else:
699
703
  if 'useMLmodel' in tasks:
700
704
  tasks.remove('useMLmodel')
@@ -5,7 +5,7 @@
5
5
  !---------------------------------------------------------------------------!
6
6
  ! data: Module for working with data !
7
7
  ! Implementations by: Pavlo O. Dral, Fuchun Ge, !
8
- ! Shuang Zhang, Yi-Fan Hou, Yanchi Ou !
8
+ ! Shuang Zhang, Yi-Fan Hou, Yanchi Ou, Mikołaj Martyka !
9
9
  !---------------------------------------------------------------------------!
10
10
  '''
11
11
 
@@ -13,6 +13,7 @@ from __future__ import annotations
13
13
  from typing import Any, Union, Dict, List, Optional, Iterable
14
14
  import uuid, copy, os, json
15
15
  import numpy as np
16
+ import math
16
17
  import h5py
17
18
  import functools
18
19
  from . import constants
@@ -142,6 +143,10 @@ def load_return_molecule(filename=None, format='json'):
142
143
  jsonfile = open(filename, 'r')
143
144
  moldict = json.load(jsonfile)
144
145
  newmol = dict_to_molecule_class_instance(moldict)
146
+ elif format.casefold() == 'xyz'.casefold():
147
+ newmol = molecule.from_xyz_file(filename)
148
+ elif format.casefold() == 'xyzstring'.casefold():
149
+ newmol = molecule.from_xyz_string(filename)
145
150
  elif format.casefold() == 'gaussian'.casefold():
146
151
  from .interfaces import gaussian_interface
147
152
  newmol = gaussian_interface.parse_gaussian_output(filename=filename)
@@ -663,7 +668,78 @@ class molecule:
663
668
  new_molecule = copy.deepcopy(self)
664
669
  new_molecule.id = str(uuid.uuid4())
665
670
  return new_molecule
671
+ def bond_length(self, a1, a2):
672
+ """Return the distance between atom numbers a1 and a2.
666
673
 
674
+ Atoms are numbered from zero.
675
+
676
+ """
677
+ diff = self.atoms[a1].xyz_coordinates - self.atoms[a2].xyz_coordinates
678
+ return np.linalg.norm(diff)
679
+
680
+ def bond_angle(self, a1, a2, a3, degrees=True):
681
+ """Return the bond angle a1-a2-a3.
682
+
683
+ The angle is defined by the vectors a1-a2 and a2-a3.
684
+ Atoms are numbered from zero.
685
+ based on Tom Keal MNDOtools.py, October 2007
686
+ degrees - if true, return angle in degrees, else radians.
687
+
688
+ """
689
+ # Based on the bond angle routine from geoman.f90 by Eduardo Fabiano
690
+ # vector 1 = 1->2
691
+ v1 = self.atoms[a2].xyz_coordinates - self.atoms[a1].xyz_coordinates
692
+ v1 = v1/np.linalg.norm(v1)
693
+
694
+ # vector 2 = 2->3
695
+ v2 = self.atoms[a3].xyz_coordinates - self.atoms[a2].xyz_coordinates
696
+ v2 = v2/np.linalg.norm(v2)
697
+
698
+ # dot product
699
+ dotp = np.dot(v1, v2)
700
+ # angle in radians
701
+ ang = math.pi - math.acos(dotp)
702
+ if degrees:
703
+ ang *= (180.0 / math.pi)
704
+ return ang
705
+ def dihedral_angle(self, a1, a2, a3, a4, degrees=True):
706
+ """Return the dihedral angle a1-a2-a3-a4.
707
+
708
+ The angle is defined between the planes a1-a2-a3 and a2-a3-a4.
709
+ Atoms are numbered from zero.
710
+ based on Tom Keal MNDOtools.py, October 2007
711
+
712
+ degrees - if true, return angle in degrees, else radians.
713
+
714
+ """
715
+ # Based on the dihedral routine from geoman.f90 by Eduardo Fabiano
716
+ # vector 1 = 1->2
717
+ v1 = self.atoms[a2].xyz_coordinates - self.atoms[a1].xyz_coordinates
718
+ v1 = v1/np.linalg.norm(v1)
719
+
720
+ # vector 2 = 2->3
721
+ v2 = self.atoms[a3].xyz_coordinates - self.atoms[a2].xyz_coordinates
722
+ v2 = v2/np.linalg.norm(v2)
723
+
724
+ # vector 3 = 3->4
725
+ v3 = self.atoms[a4].xyz_coordinates - self.atoms[a3].xyz_coordinates
726
+ v3 = v3/np.linalg.norm(v3)
727
+
728
+ # vector product 1 = v1^v2
729
+ w1 = np.cross(v1,v2)
730
+ w1 = w1/np.linalg.norm(w1)
731
+
732
+ # vector product 2 = v3^v2
733
+ w2 = np.cross(v3,v2)
734
+ w2 = w2/np.linalg.norm(w2)
735
+
736
+ # dot product
737
+ dotp = np.dot(w1,w2)
738
+ # angle in radians
739
+ ang = math.pi - math.acos(dotp)
740
+ if degrees:
741
+ ang *= (180.0 / math.pi)
742
+ return ang
667
743
  def proliferate(
668
744
  self,
669
745
  shifts: Optional[Iterable] = None,
@@ -1663,14 +1739,21 @@ class molecular_database:
1663
1739
  jsonfile = open(filename, 'r')
1664
1740
  data = json.load(jsonfile)
1665
1741
  self.molecules = []
1666
- for molecule in data['molecules']:
1667
- self.molecules.append(dict_to_molecule_class_instance(molecule))
1668
- if format.casefold() == 'npz'.casefold():
1742
+ for mol in data['molecules']:
1743
+ self.molecules.append(dict_to_molecule_class_instance(mol))
1744
+ elif format.casefold() == 'npz'.casefold():
1669
1745
  with np.load(filename, allow_pickle=True) as npz:
1670
1746
  data = dict(npz)
1671
1747
  self.molecules = []
1672
- for molecule in data['molecules']:
1673
- self.molecules.append(dict_to_molecule_class_instance(molecule))
1748
+ for mol in data['molecules']:
1749
+ self.molecules.append(dict_to_molecule_class_instance(mol))
1750
+ elif format.casefold() == 'gaussian'.casefold():
1751
+ mol = molecule.load(filename, format=format)
1752
+ if 'molecular_database' in mol.__dict__.keys():
1753
+ for key in mol.molecular_database.__dict__.keys():
1754
+ self.__dict__[key] = mol.molecular_database.__dict__[key]
1755
+ else:
1756
+ self.molecules.append(mol)
1674
1757
  return self
1675
1758
 
1676
1759
  @classmethod
@@ -1887,6 +1970,14 @@ def dict_to_molecule_class_instance(dd):
1887
1970
  mol.atoms.append(dict_to_atom_class_instance(aa))
1888
1971
  elif key == 'electronic_states':
1889
1972
  mol.electronic_states = [dict_to_molecule_class_instance(state_dict) for state_dict in dd[key]]
1973
+ elif key == 'molecular_database':
1974
+ mol.molecular_database = molecular_database()
1975
+ mol.molecular_database.molecules = [dict_to_molecule_class_instance(state_dict) for state_dict in dd[key]['molecules']]
1976
+ elif key == 'optimization_trajectory':
1977
+ mol.optimization_trajectory = molecular_trajectory()
1978
+ mol.optimization_trajectory.steps = [molecular_trajectory_step(step=state_dict['step'],
1979
+ molecule=dict_to_molecule_class_instance(state_dict['molecule']))
1980
+ for state_dict in dd[key]['steps']]
1890
1981
  elif type(dd[key]) == dict:
1891
1982
  if 'parent' in dd[key].keys():
1892
1983
  dict_to_properties_tree_node_class_instance(dd, key, mol)
@@ -2134,6 +2225,13 @@ class molecular_trajectory():
2134
2225
  if not key in ['step', 'molecule']:
2135
2226
  self.steps[-1].__dict__[key] = step[key]
2136
2227
 
2228
+ elif format.casefold() == 'gaussian'.casefold():
2229
+ mol = molecule.load(filename, format=format)
2230
+ if 'optimization_trajectory' in mol.__dict__.keys():
2231
+ for key in mol.optimization_trajectory.__dict__.keys():
2232
+ self.__dict__[key] = mol.optimization_trajectory.__dict__[key]
2233
+ else:
2234
+ raise ValueError('No optimization trajectory could be parsed from the Gaussian output file')
2137
2235
 
2138
2236
  def get_xyz_string(self) -> str:
2139
2237
  '''
@@ -129,9 +129,11 @@ def dimer_method(initial_molecule, model,
129
129
  atoms.calc = MLatomCalculator(model=model, model_predict_kwargs= model_predict_kwargs, save_optimization_trajectory=True)
130
130
 
131
131
  from ase.dimer import DimerControl, MinModeAtoms, MinModeTranslate
132
+
133
+ random_seed = kwargs.pop('random_seed') if 'random_seed' in kwargs else None
132
134
 
133
135
  with DimerControl(**kwargs) as d_control:
134
- d_atoms = MinModeAtoms(atoms, d_control, random_seed = kwargs['random_seed'] if 'random_seed' in kwargs else 0)
136
+ d_atoms = MinModeAtoms(atoms, d_control, random_seed = random_seed)
135
137
  d_atoms.displace()
136
138
  with MinModeTranslate(d_atoms) as dim_rlx:
137
139
  dim_rlx.run(fmax=convergence_criterion_for_forces,
@@ -381,6 +381,12 @@ def parse_gaussian_output(filename=None, molecule=None):
381
381
  es_mults = []
382
382
  es_contribs = []
383
383
  readES = False
384
+ i_read_input_orientation = -1
385
+ i_read_standard_orientation = -1
386
+ xyz_input_orientation = []
387
+ xyz_standard_orientation = []
388
+ scf_energies = []
389
+ energy_gradients = []
384
390
  # flags to check whether a property was never read before - by default overwrite everything
385
391
  read_already_freq = False
386
392
  read_already_redmass = False
@@ -422,8 +428,35 @@ def parse_gaussian_output(filename=None, molecule=None):
422
428
  chkfilename = line.split('=')[-1].strip()
423
429
  if not '.chk' in chkfilename:
424
430
  chkfilename += '.chk'
431
+ if 'Input orientation:' in line:
432
+ i_read_input_orientation = 0
433
+ xyz_input_orientation.append([])
434
+ continue
435
+ if i_read_input_orientation > -1:
436
+ i_read_input_orientation += 1
437
+ if i_read_input_orientation >= 5:
438
+ if '-------------------------' in line:
439
+ i_read_input_orientation = -1
440
+ continue
441
+ xyz_input_orientation[-1].append([float(xx) for xx in line.split()[-3:]])
442
+ continue
443
+ if 'Standard orientation:' in line:
444
+ i_read_standard_orientation = 0
445
+ xyz_standard_orientation.append([])
446
+ continue
447
+ if i_read_standard_orientation > -1:
448
+ i_read_standard_orientation += 1
449
+ if i_read_standard_orientation >= 5:
450
+ if '-------------------------' in line:
451
+ i_read_standard_orientation = -1
452
+ continue
453
+ xyz_standard_orientation[-1].append([float(xx) for xx in line.split()[-3:]])
454
+ continue
455
+ if 'SCF Done:' in line:
456
+ scf_energies.append(float(line.split()[4]))
425
457
  if 'Forces (Hartrees/Bohr)' in line:
426
458
  forces_iatom = -3
459
+ energy_gradients.append([])
427
460
  continue
428
461
  if forces_iatom > -4:
429
462
  forces_iatom += 1
@@ -431,9 +464,7 @@ def parse_gaussian_output(filename=None, molecule=None):
431
464
  if '------------------' in line:
432
465
  forces_iatom = -4
433
466
  continue
434
- if len(mol.atoms) < forces_iatom+1:
435
- mol.atoms.append(data.atom(atomic_number=int(line.split()[1])))
436
- mol.atoms[forces_iatom].energy_gradients = -data.array([float(each) for each in line.split()[2:]]) / constants.Bohr2Angstrom
467
+ energy_gradients[-1].append(-data.array([float(each) for each in line.split()[2:]]) / constants.Bohr2Angstrom)
437
468
  continue
438
469
  if 'The second derivative matrix:' in line:
439
470
  i_read_hessian = 0
@@ -815,10 +846,13 @@ def parse_gaussian_output(filename=None, molecule=None):
815
846
  break
816
847
  if '\\\\@' in archiveText:
817
848
  break
849
+ optjob = False
818
850
  if archiveText != r'':
819
851
  method_names = ['HF', 'MP2', 'MP3', 'MP4D', 'MP4DQ', 'MP4SDQ', 'MP4SDTQ', 'MP5', 'CISD', 'QCISD', 'QCISD(T)', 'CCSD', 'CCSD(T)']
820
852
  method_energies = []
821
853
  archiveTextSplit = archiveText.split('\\\\') # here it splits with '\\' as a delimiter
854
+ if 'opt'.casefold() in archiveTextSplit[0].casefold():
855
+ optjob = True
822
856
  if 'freq'.casefold() in archiveTextSplit[1].casefold() and chkfilename is not None:
823
857
  dir_path = os.path.dirname(os.path.realpath(filename))
824
858
  if os.path.exists(f'{dir_path}/{chkfilename}'):
@@ -931,10 +965,76 @@ def parse_gaussian_output(filename=None, molecule=None):
931
965
  if 'infrared_intensities' in mol.__dict__.keys():
932
966
  if np.all(mol.infrared_intensities == 0):
933
967
  del mol.__dict__['infrared_intensities']
934
-
935
- # to-do: check whether gradients for electronic states are read correctly
936
- # to-do: check whether the infrared_intensities have the correct length after anharmonic frequencies calculation
937
968
 
969
+ # delete the last geom if there were fewer SCF energies than geometries
970
+ # (can be due to failed SCF calculations or duplicated printing after successful geom opt)
971
+ if len(scf_energies) < len(xyz_input_orientation) and len(xyz_input_orientation) > 1:
972
+ if np.max(np.abs(data.array(xyz_input_orientation[-1]) - data.array(xyz_input_orientation[-2]))) < 1e-6:
973
+ del xyz_input_orientation[-1]
974
+ if len(scf_energies) < len(xyz_standard_orientation) and len(xyz_standard_orientation) > 1:
975
+ if np.max(np.abs(data.array(xyz_standard_orientation[-1]) - data.array(xyz_standard_orientation[-2]))) < 1e-6:
976
+ del xyz_standard_orientation[-1]
977
+ # if it was opt freq job, then geometries and scf energies are duplicated at the end too
978
+ if len(scf_energies) > 1:
979
+ if len(scf_energies) == len(xyz_input_orientation) and len(scf_energies) == len(xyz_standard_orientation):
980
+ if abs(scf_energies[-2] - scf_energies[-1]) < 1e-6 and np.max(np.abs(data.array(xyz_input_orientation[-1]) - data.array(xyz_input_orientation[-2]))) < 1e-6:
981
+ del scf_energies[-1]
982
+ del xyz_input_orientation[-1]
983
+ del xyz_standard_orientation[-1]
984
+ if len(energy_gradients) > len(scf_energies):
985
+ if np.max(np.abs(data.array(energy_gradients[-1]) - data.array(energy_gradients[-2]))) < 1e-6:
986
+ del energy_gradients[-1]
987
+ elif len(scf_energies) == len(xyz_input_orientation):
988
+ if abs(scf_energies[-2] - scf_energies[-1]) < 1e-6 and np.max(np.abs(data.array(xyz_input_orientation[-1]) - data.array(xyz_input_orientation[-2]))) < 1e-6:
989
+ del scf_energies[-1]
990
+ del xyz_input_orientation[-1]
991
+ if len(energy_gradients) > len(scf_energies):
992
+ if np.max(np.abs(data.array(energy_gradients[-1]) - data.array(energy_gradients[-2]))) < 1e-6:
993
+ del energy_gradients[-1]
994
+ elif len(scf_energies) == len(xyz_standard_orientation):
995
+ if abs(scf_energies[-2] - scf_energies[-1]) < 1e-6 and np.max(np.abs(data.array(xyz_standard_orientation[-1]) - data.array(xyz_standard_orientation[-2]))) < 1e-6:
996
+ del scf_energies[-1]
997
+ del xyz_standard_orientation[-1]
998
+ if len(energy_gradients) > len(scf_energies):
999
+ if np.max(np.abs(data.array(energy_gradients[-1]) - data.array(energy_gradients[-2]))) < 1e-6:
1000
+ del energy_gradients[-1]
1001
+
1002
+ # get molecular database for multiple single-point calculations in the output file
1003
+ if len(scf_energies) > 1:
1004
+ db = data.molecular_database()
1005
+ db.molecules = [mol.copy(atomic_labels=[], molecular_labels=[]) for ii in range(len(scf_energies))]
1006
+ for iscf in range(len(scf_energies)):
1007
+ db.molecules[iscf].energy = scf_energies[iscf]
1008
+ if len(scf_energies) == len(xyz_input_orientation):
1009
+ for iscf in range(len(scf_energies)):
1010
+ db.molecules[iscf].xyz_coordinates = data.array(xyz_input_orientation[iscf])
1011
+ # to-do: reorient to input orientation using mol.xyz_coordinates which are already in input orientation for the last geometry
1012
+ #elif len(scf_energies) == len(xyz_standard_orientation)
1013
+ # for iscf in range(len(scf_energies)):
1014
+ # db.molecules[iscf].xyz_coordinates = data.array(xyz_standard_orientation[iscf])
1015
+ if len(scf_energies) == len(energy_gradients):
1016
+ for iscf in range(len(scf_energies)):
1017
+ db.molecules[iscf].energy_gradients = data.array(energy_gradients[iscf])
1018
+ mol.molecular_database = db
1019
+ if optjob:
1020
+ moltraj = data.molecular_trajectory()
1021
+ for istep, mol_step in enumerate(db):
1022
+ moltraj.steps.append(data.molecular_trajectory_step(step=istep, molecule=mol_step))
1023
+ mol.optimization_trajectory = moltraj
1024
+
1025
+ # get energy gradients from the last place they are calculated
1026
+ if len(energy_gradients) > 0:
1027
+ mol.energy_gradients = data.array(energy_gradients[-1])
1028
+
1029
+ if 'molecular_database' in mol.__dict__.keys():
1030
+ if np.max(np.abs(db[-1].xyz_coordinates - mol.xyz_coordinates)) < 1e-6:
1031
+ tmpmol = mol.copy()
1032
+ del tmpmol.__dict__['molecular_database']
1033
+ mol.molecular_database.molecules[-1] = tmpmol
1034
+ if 'optimization_trajectory' in tmpmol.__dict__.keys():
1035
+ del tmpmol.__dict__['optimization_trajectory']
1036
+ mol.optimization_trajectory.steps[-1].molecule = tmpmol
1037
+
938
1038
  if molecule is None:
939
1039
  return mol
940
1040
 
@@ -101,7 +101,7 @@ class pyscf_methods(OMP_pyscf, metaclass=models.meta_method, available_methods=[
101
101
  except:
102
102
  return False
103
103
 
104
- def predict_for_molecule(self, molecule=None, calculate_energy=True, calculate_energy_gradients=True, calculate_hessian=False, calculate_dipole_derivatives=False, nstates=None, current_state=None, **kwargs):
104
+ def predict_for_molecule(self, molecule=None, calculate_energy=True, calculate_energy_gradients=True, calculate_hessian=False, calculate_dipole_derivatives=False, nstates=1, current_state=0, **kwargs):
105
105
  from pyscf import gto, scf
106
106
  from pyscf.dft.libxc import parse_xc
107
107
  pyscf_mol = gto.Mole()
@@ -367,7 +367,7 @@ class pyscf_methods(OMP_pyscf, metaclass=models.meta_method, available_methods=[
367
367
  raise ValueError(errmsg)
368
368
 
369
369
  @doc_inherit
370
- def predict(self, molecule=None, molecular_database=None, calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False, nstates = None, current_state =None, **kwargs):
370
+ def predict(self, molecule=None, molecular_database=None, calculate_energy=True, calculate_energy_gradients=False, calculate_hessian=False, nstates=1, current_state=1, **kwargs):
371
371
  '''
372
372
  **kwargs: ``# needs to be documented``.
373
373
  '''
@@ -1138,9 +1138,11 @@ class msani(models.ml_model, models.torchani_model):
1138
1138
  energy_loss= median(predicted_energies,true_energies)
1139
1139
  else:
1140
1140
  energy_loss = (loss_function(predicted_energies, true_energies, weightings_e) / num_atoms.sqrt()).nanmean()
1141
- auxnumber = int(len(predicted_energies)/self.nstates)
1142
-
1143
- gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[:-auxnumber].sqrt()).nanmean()
1141
+ if self.hyperparameters.gap_coefficient != 0.0:
1142
+ gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[0].sqrt()).nanmean()
1143
+ else:
1144
+ gap_loss = 0
1145
+ # true_forces[true_
1144
1146
  # true_forces[true_forces.isnan()]=forces[true_forces.isnan()]
1145
1147
  force_loss = (loss_function(true_forces, forces, weightings_f).sum(dim=(1, 2)) / num_atoms).nanmean()
1146
1148
  loss = energy_loss + self.hyperparameters.force_coefficient * force_loss + self.hyperparameters.gap_coefficient * gap_loss
@@ -1157,9 +1159,11 @@ class msani(models.ml_model, models.torchani_model):
1157
1159
  predicted_gaps = torch.FloatTensor(predicted_gap_list).to(self.device)
1158
1160
 
1159
1161
  energy_loss = (loss_function(predicted_energies, true_energies, weightings_e) / num_atoms.sqrt()).nanmean()
1160
- auxnumber = int(len(predicted_energies)/self.nstates)
1161
-
1162
- gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[:-auxnumber].sqrt()).nanmean()
1162
+ if self.hyperparameters.gap_coefficient != 0.0:
1163
+ gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[0].sqrt()).nanmean()
1164
+ else:
1165
+ gap_loss = 0
1166
+ # true_forces[true_
1163
1167
  loss = energy_loss + self.hyperparameters.gap_coefficient * gap_loss
1164
1168
  total_mse += loss.item()
1165
1169
  return total_mse
@@ -1234,8 +1238,11 @@ class msani(models.ml_model, models.torchani_model):
1234
1238
  energy_loss = (loss_function(predicted_energies, true_energies, weightings_e) / num_atoms.sqrt()).nanmean()
1235
1239
  # print(predicted_gaps.shape, true_gaps.shape)
1236
1240
  #print(num_atoms.sqrt())
1237
- auxnumber = int(len(predicted_energies)/self.nstates)
1238
- gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[:-auxnumber].sqrt()).nanmean()
1241
+ if self.hyperparameters.gap_coefficient != 0.0:
1242
+ gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[0].sqrt()).nanmean()
1243
+ else:
1244
+ gap_loss = 0
1245
+ # true_forces[true_
1239
1246
  # true_forces[true_forces.isnan()]=forces[true_forces.isnan()]
1240
1247
  force_loss = (loss_function(true_forces, forces, weightings_f).sum(dim=(1, 2)) / num_atoms).nanmean()
1241
1248
  loss = energy_loss + self.hyperparameters.force_coefficient * force_loss + self.hyperparameters.gap_coefficient * gap_loss
@@ -1251,8 +1258,11 @@ class msani(models.ml_model, models.torchani_model):
1251
1258
  #print(predicted_gaps)
1252
1259
 
1253
1260
  energy_loss = (loss_function(predicted_energies, true_energies, weightings_e) / num_atoms.sqrt()).nanmean()
1254
- auxnumber = int(len(predicted_energies)/self.nstates)
1255
- gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[:-auxnumber].sqrt()).nanmean()
1261
+ if self.hyperparameters.gap_coefficient != 0.0:
1262
+ gap_loss = (loss_function(predicted_gaps,true_gaps, 1) / num_atoms[0].sqrt()).nanmean()
1263
+ else:
1264
+ gap_loss = 0
1265
+ # true_forces[true_
1256
1266
  loss = energy_loss + self.hyperparameters.gap_coefficient * gap_loss
1257
1267
 
1258
1268
  self.AdamW.zero_grad()