mlatom 3.8.0__tar.gz → 3.9.0__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 (123) hide show
  1. {mlatom-3.8.0/src/mlatom.egg-info → mlatom-3.9.0}/PKG-INFO +3 -3
  2. {mlatom-3.8.0 → mlatom-3.9.0}/README.md +2 -2
  3. {mlatom-3.8.0 → mlatom-3.9.0}/setup.py +1 -1
  4. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatom.py +2 -2
  5. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/data.py +187 -2
  6. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/functionsGICnet.py +9 -1
  7. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/initial_conditions.py +1 -1
  8. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/torchani_interface.py +21 -4
  9. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/simulations.py +2 -2
  10. {mlatom-3.8.0 → mlatom-3.9.0/src/mlatom.egg-info}/PKG-INFO +3 -3
  11. {mlatom-3.8.0 → mlatom-3.9.0}/LICENSE.txt +0 -0
  12. {mlatom-3.8.0 → mlatom-3.9.0}/setup.cfg +0 -0
  13. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/GICnet.py +0 -0
  14. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLTPA.py +0 -0
  15. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/ML_NEA.py +0 -0
  16. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF +0 -0
  17. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/A_KRR.f90 +0 -0
  18. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/A_KRR_kernel.f90 +0 -0
  19. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/D_CoulombMatrix.f90 +0 -0
  20. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/D_ID.f90 +0 -0
  21. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/D_rel2eq.f90 +0 -0
  22. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/MLatomF.f90 +0 -0
  23. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/MLatomFInfo.f90 +0 -0
  24. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/MLmodel.f90 +0 -0
  25. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/Makefile +0 -0
  26. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/Makefile.intel +0 -0
  27. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/__init__.py +0 -0
  28. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/analyze.f90 +0 -0
  29. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/constants.f90 +0 -0
  30. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/cs.cpp +0 -0
  31. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/dataset.f90 +0 -0
  32. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/mathUtils.f90 +0 -0
  33. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/molDescr.f90 +0 -0
  34. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/optionsModule.f90 +0 -0
  35. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/precision.f90 +0 -0
  36. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/recover.sh +0 -0
  37. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/sampling.f90 +0 -0
  38. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/statistics.f90 +0 -0
  39. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/stopper.f90 +0 -0
  40. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/strings.f90 +0 -0
  41. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/timing.f90 +0 -0
  42. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLatomF_src/types.f90 +0 -0
  43. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/MLtasks.py +0 -0
  44. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/__init__.py +0 -0
  45. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1.py +0 -0
  46. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/__init__.py +0 -0
  47. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv0.pt +0 -0
  48. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv1.pt +0 -0
  49. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv2.pt +0 -0
  50. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv3.pt +0 -0
  51. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv4.pt +0 -0
  52. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv5.pt +0 -0
  53. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv6.pt +0 -0
  54. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv7.pt +0 -0
  55. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv0.pt +0 -0
  56. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv1.pt +0 -0
  57. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv2.pt +0 -0
  58. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv3.pt +0 -0
  59. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv4.pt +0 -0
  60. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv5.pt +0 -0
  61. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv6.pt +0 -0
  62. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv7.pt +0 -0
  63. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/al.py +0 -0
  64. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/al_utils.py +0 -0
  65. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/args_class.py +0 -0
  66. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/ccsdtstarcbs.py +0 -0
  67. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/composite_methods.py +0 -0
  68. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/constants.py +0 -0
  69. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/conversions.py +0 -0
  70. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/cs.so +0 -0
  71. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/decorators.py +0 -0
  72. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/doc.py +0 -0
  73. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/fortran/KREG.f90 +0 -0
  74. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/fortran/__init__.py +0 -0
  75. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/fortran/compile.py +0 -0
  76. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/fortran/mathUtils.f90 +0 -0
  77. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/fortran/stopper.f90 +0 -0
  78. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/header.py +0 -0
  79. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interface_MLatomF.py +0 -0
  80. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/__init__.py +0 -0
  81. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/ase_interface.py +0 -0
  82. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/columbus_interface.py +0 -0
  83. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/dftd4_interface.py +0 -0
  84. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/dpmd_interface.py +0 -0
  85. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/gap_interface.py +0 -0
  86. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/gaussian_interface.py +0 -0
  87. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/mace_interface.py +0 -0
  88. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/mndo_interface.py +0 -0
  89. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/orca_interface.py +0 -0
  90. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/physnet_interface.py +0 -0
  91. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/pyscf_interface.py +0 -0
  92. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/sgdml_interface.py +0 -0
  93. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/sparrow_interface.py +0 -0
  94. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/turbomole_interface.py +0 -0
  95. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/interfaces/xtb_interface.py +0 -0
  96. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/kreg_api.py +0 -0
  97. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/log.py +0 -0
  98. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/md.py +0 -0
  99. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/md2vibr.py +0 -0
  100. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/md2vibr_cmd.py +0 -0
  101. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/md_cmd.py +0 -0
  102. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/md_parallel.py +0 -0
  103. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/mlatom_gui.py +0 -0
  104. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/mltpa/__init__.py +0 -0
  105. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/mltpa/mff.txt +0 -0
  106. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/mltpa/mltpa2022_2.pkl +0 -0
  107. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/mltpa/mltpa2022_2_new_.pkl +0 -0
  108. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/models.py +0 -0
  109. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/namd.py +0 -0
  110. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/plot.py +0 -0
  111. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/ref.json +0 -0
  112. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/shell_cmd.py +0 -0
  113. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/sliceData.py +0 -0
  114. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/stats.py +0 -0
  115. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/stopper.py +0 -0
  116. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/thermostat.py +0 -0
  117. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/utils.py +0 -0
  118. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom/xyz.py +0 -0
  119. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom.egg-info/SOURCES.txt +0 -0
  120. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom.egg-info/dependency_links.txt +0 -0
  121. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom.egg-info/entry_points.txt +0 -0
  122. {mlatom-3.8.0 → mlatom-3.9.0}/src/mlatom.egg-info/requires.txt +0 -0
  123. {mlatom-3.8.0 → mlatom-3.9.0}/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.8.0
3
+ Version: 3.9.0
4
4
  Summary: A Package for Atomistic Simulations with Machine Learning
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.8.0
30
+ Version 3.9.0
31
31
 
32
32
  **Official website**: http://mlatom.com/
33
33
  **Manual**: http://mlatom.com/manual/
@@ -60,7 +60,7 @@ When this Software or its derivatives are used in scientific publications, it sh
60
60
  * 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.
61
61
  * 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.
62
62
  * 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.
63
- * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.8.0, Xiamen University, Xiamen, China, 2013-2024.
63
+ * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.9.0, Xiamen University, Xiamen, China, 2013-2024.
64
64
  [MLatom.com](http://mlatom.com).
65
65
 
66
66
  The citations for MLatom's interfaces and features shall be eventually
@@ -1,7 +1,7 @@
1
1
  # About Program
2
2
  MLatom: a Package for Atomistic Simulations with Machine Learning
3
3
 
4
- Version 3.8.0
4
+ Version 3.9.0
5
5
 
6
6
  **Official website**: http://mlatom.com/
7
7
  **Manual**: http://mlatom.com/manual/
@@ -34,7 +34,7 @@ When this Software or its derivatives are used in scientific publications, it sh
34
34
  * 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.
35
35
  * 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.
36
36
  * 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.
37
- * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.8.0, Xiamen University, Xiamen, China, 2013-2024.
37
+ * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.9.0, Xiamen University, Xiamen, China, 2013-2024.
38
38
  [MLatom.com](http://mlatom.com).
39
39
 
40
40
  The citations for MLatom's interfaces and features shall be eventually
@@ -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.8.0",
46
+ version = "3.9.0",
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.8.0 !
7
+ ! MLatom 3.9.0 !
8
8
  ! @ !
9
9
  ! Xiamen Atomistic Computing Suite (XACS) !
10
10
  ! !
@@ -36,7 +36,7 @@
36
36
  ! Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, !
37
37
  ! Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, !
38
38
  ! MLatom: A Package for Atomistic Simulations with Machine Learning, !
39
- ! version 3.8.0, Xiamen University, Xiamen, China, 2013-2024. !
39
+ ! version 3.9.0, Xiamen University, Xiamen, China, 2013-2024. !
40
40
  ! !
41
41
  ! The citations for MLatom's interfaces and features shall be eventually !
42
42
  ! included too. See header.py, ref.json and http://mlatom.com. !
@@ -10,7 +10,7 @@
10
10
  '''
11
11
 
12
12
  from __future__ import annotations
13
- from typing import Any, Union, Dict, List
13
+ from typing import Any, Union, Dict, List, Optional, Iterable
14
14
  import uuid, copy, os, json
15
15
  import numpy as np
16
16
  from . import constants
@@ -117,16 +117,70 @@ class molecule:
117
117
  multiplicity: The multiplicity of the molecule.
118
118
 
119
119
  '''
120
- def __init__(self, charge: int = 0, multiplicity: int = 1, atoms: List[atom] = None):
120
+ def __init__(self, charge: int = 0, multiplicity: int = 1, atoms: List[atom] = None, pbc: Optional[Union[np.ndarray, bool]] = None, cell: Optional[np.ndarray] = None):
121
121
  self.id = str(uuid.uuid4())
122
122
  self.charge = charge
123
123
  self.multiplicity = multiplicity
124
+ self.pbc = pbc
125
+ self.cell = cell
124
126
  if atoms is None:
125
127
  self.atoms = []
126
128
  else:
127
129
  self.atoms = atoms
128
130
 
129
131
  self.electronic_states = []
132
+
133
+ @property
134
+ def pbc(self):
135
+ '''
136
+ The periodic boundary conditions of the molecule. Setting it with ``mol.pbc = True`` is equal to ``mol.pbc = [True, True, True]``.
137
+ '''
138
+ return self._pbc
139
+
140
+ @pbc.setter
141
+ def pbc(self, pbc):
142
+ if pbc is not None:
143
+ if isinstance(pbc, bool):
144
+ pbc = [pbc] * 3
145
+ pbc = np.array(pbc, bool)
146
+ assert pbc.shape == (3,), 'please provide a valid pbc'
147
+ self._pbc = pbc
148
+
149
+ @property
150
+ def cell(self):
151
+ '''
152
+ The matrix of 3 vectors that defines the unicell. The setter of it simply wraps `ase.geometry.cell.cellpar_to_cell() <https://wiki.fysik.dtu.dk/ase/ase/geometry.html#ase.geometry.cellpar_to_cell>`_.
153
+ '''
154
+ return self._cell
155
+
156
+ @cell.setter
157
+ def cell(self, cell):
158
+ # reinvent the wheel with premade spokes from ASE
159
+ if cell is not None:
160
+ from ase.geometry.cell import cellpar_to_cell
161
+ cell = cellpar_to_cell(cell)
162
+ self._cell = cell
163
+
164
+ @property
165
+ def cell_coordinates(self) -> np.ndarray:
166
+ '''
167
+ The relative coordinates in the cell.
168
+ '''
169
+ assert self.cell is not None, 'make sure this molecule has a valid cell'
170
+ inverse_cell = np.linalg.inv(self.cell)
171
+ return self.xyz_coordinates @ inverse_cell
172
+
173
+ @cell_coordinates.setter
174
+ def cell_coordinates(self, value):
175
+ assert self.cell is not None, 'make sure this molecule has a valid cell'
176
+ self.xyz_coordinates = value @ self.cell
177
+
178
+ def map_to_unicell(self):
179
+ '''
180
+ Map all atoms outside the unicell into it.
181
+ '''
182
+ self.cell_coordinates -= np.floor(self.cell_coordinates) * self.pbc
183
+
130
184
 
131
185
  def read_from_xyz_file(self, filename: str, format: Union[str, None] = None) -> molecule:
132
186
  '''
@@ -509,6 +563,108 @@ class molecule:
509
563
  new_molecule.id = str(uuid.uuid4())
510
564
  return new_molecule
511
565
 
566
+ def proliferate(
567
+ self,
568
+ shifts: Optional[Iterable] = None,
569
+ XYZshifts: Optional[Iterable] = None,
570
+ Xshifts: Optional[Iterable] = [0],
571
+ Yshifts: Optional[Iterable] = [0],
572
+ Zshifts: Optional[Iterable] = [0],
573
+ PBC_constrained: bool = True,
574
+ ) -> molecule:
575
+ '''
576
+ Proliferate the unicell by specified shifts along cell vectors (called X/Y/Z here).
577
+
578
+ Returns a new :class:`molecule` object.
579
+
580
+ Arguments:
581
+ shifts (Iterable, optional): The list of shifts to perform. Each shift should be a 3D vector that indicates the coefficient applies to the corresponding cell vector.
582
+ XYZshifts (Iterable, optional): Generate all possible shifts with given shift coefficients in all three directions when a list is specified. When a list of 3 lists is specified, it's equal to setting X/Y/Zshifts
583
+ Xshifts (Iterable, optional): Specify all possible shift coefficients in the direction of the first cell vector.
584
+ Yshifts (Iterable, optional): Specify all possible shift coefficients in the direction of the second cell vector.
585
+ Zshifts (Iterable, optional): Specify all possible shift coefficients in the direction of the third cell vector.
586
+ PBC_constrained (bool): Controls whether the shifts in some directions are disabled where corresponding PBC is false. Only applies to XYZshifts.
587
+
588
+ .. note::
589
+
590
+ Priorities for different types of shifts:
591
+ ``shifts`` > ``XYZshifts`` > ``X/Y/Zshifts``
592
+
593
+ Examples:
594
+
595
+ Single H atom in the centre of a cubic cell (2x2x2):
596
+
597
+ .. code-block:: python
598
+
599
+ mol = ml.molecule.from_numpy(np.ones((1, 3)), np.array([1]))
600
+ mol.pbc = True
601
+ mol.cell = 2
602
+
603
+ Proliferate to get two periods in all three directions,
604
+ with shifts:
605
+
606
+ .. code-block:: python
607
+
608
+ new_mol = mol.proliferate(
609
+ shifts = [
610
+ [0, 0, 0],
611
+ [1, 0, 0],
612
+ [0, 1, 0],
613
+ [0, 0, 1],
614
+ [1, 1, 0],
615
+ [1, 0, 1],
616
+ [0, 1, 1],
617
+ [1, 1, 1],
618
+ ]
619
+ )
620
+
621
+ with XYZshifts:
622
+
623
+ .. code-block:: python
624
+
625
+ new_mol = mol.proliferate(XYZshifts=range(2))
626
+ # or
627
+ new_mol = mol.proliferate(XYZshifts=[range(2)]*3)
628
+
629
+
630
+ with X/Y/Zshifts:
631
+
632
+ .. code-block:: python
633
+
634
+ new_mol = mol.proliferate(Xshifts=range(2), Yshifts=(0, 1), Zshifts=[0, 1]))
635
+
636
+ All scripts above will make ``new_mol.xyz_coordinates`` be:
637
+
638
+ .. code-block:: python
639
+
640
+ array([[1., 1., 1.],
641
+ [3., 1., 1.],
642
+ [1., 3., 1.],
643
+ [3., 3., 1.],
644
+ [1., 1., 3.],
645
+ [3., 1., 3.],
646
+ [1., 3., 3.],
647
+ [3., 3., 3.]])
648
+
649
+ '''
650
+ if shifts is None:
651
+ if XYZshifts is not None:
652
+ XYZshifts = np.array(XYZshifts)
653
+ if XYZshifts.ndim == 1:
654
+ XYZshifts = np.repeat(XYZshifts[np.newaxis], 3, 0)
655
+ assert XYZshifts.ndim ==2, 'provide valid XYZshifts'
656
+ Xshifts, Yshifts, Zshifts = XYZshifts
657
+ if PBC_constrained:
658
+ Xshifts = Xshifts if self.pbc[0] else [0]
659
+ Yshifts = Yshifts if self.pbc[1] else [0]
660
+ Zshifts = Zshifts if self.pbc[2] else [0]
661
+ shifts = [np.array([i, j, k]) for k in Zshifts for j in Yshifts for i in Xshifts]
662
+
663
+ xyzs = []
664
+ for shift in shifts:
665
+ xyzs.append(self.xyz_coordinates + shift @ self.cell)
666
+ return self.from_numpy(np.concatenate(xyzs, 0), np.repeat(self.atomic_numbers, len(shifts)))
667
+
512
668
  def dump(self, filename=None, format='json'):
513
669
  '''
514
670
  Dump the current molecule object into a file. Only in json format, which is supported now.
@@ -1188,6 +1344,16 @@ class molecular_database:
1188
1344
  def filter_by_property(self, property_name):
1189
1345
  return molecular_database(self[~np.isnan(self.get_properties(property_name))])
1190
1346
 
1347
+ def proliferate(self, *args, **kwargs) -> molecular_database:
1348
+ '''
1349
+ Proliferate the unicell by specified shifts along cell vectors.
1350
+
1351
+ Returns a new :class:`molecular_databse` object.
1352
+
1353
+ Check :meth:`molecule.proliferate` for details on options.
1354
+ '''
1355
+ return molecular_database([mol.proliferate(*args, **kwargs) for mol in self])
1356
+
1191
1357
  def dump(self, filename=None, format=None):
1192
1358
  '''
1193
1359
  Dump the molecular database to a file.
@@ -1280,6 +1446,19 @@ class molecular_database:
1280
1446
  def xyz_coordinates(self, value):
1281
1447
  for i, mol in enumerate(self):
1282
1448
  mol.xyz_coordinates = value[i]
1449
+
1450
+ def _is_uniform_cell(self):
1451
+ cells = self.get_properties('cell')
1452
+ pbcs = self.get_properties('pbc')
1453
+ try:
1454
+ if set(cells) == {None} and set(pbcs) == {None}:
1455
+ return True
1456
+ except:
1457
+ try:
1458
+ if np.max(np.std(cells, 0)) == 0 and np.max(np.std(pbcs, 0)):
1459
+ return True
1460
+ except:
1461
+ return False
1283
1462
 
1284
1463
  def class_instance_to_dict(inst):
1285
1464
  dd = copy.deepcopy(inst.__dict__)
@@ -1578,6 +1757,12 @@ class molecular_trajectory():
1578
1757
  for istep in self.steps:
1579
1758
  xyz_string += istep.molecule.get_xyz_string()
1580
1759
  return xyz_string
1760
+
1761
+ def to_database(self) -> molecular_database:
1762
+ '''
1763
+ Return a molecular database that formed by the molecules in the trajectory.
1764
+ '''
1765
+ return molecular_database([step.molecule for step in self.steps])
1581
1766
 
1582
1767
  class molecular_trajectory_step(object):
1583
1768
  def __init__(self, step=None, molecule=None):
@@ -1,4 +1,4 @@
1
- import tensorflow as tf
1
+
2
2
  import numpy as np
3
3
  import scipy
4
4
  import os
@@ -6,6 +6,14 @@ import sys
6
6
  import rmsd
7
7
  from multiprocessing import Manager, Pool, Process
8
8
 
9
+ if 'TFPATH' in os.environ:
10
+ import importlib
11
+ sys.path.insert(0, os.environ['TFPATH'])
12
+ import tensorflow as tf
13
+ sys.path.pop(0)
14
+ else:
15
+ import tensorflow as tf
16
+
9
17
  refTrio=np.array([[0.,0.,1.],[0.,1.,0.],[1.,0.,0.]],dtype=np.float32)
10
18
  refTrioV=np.zeros((3,3),dtype=np.float32)
11
19
 
@@ -187,7 +187,7 @@ def generate_initial_conditions(molecule=None, generation_method=None, number_of
187
187
  init_cond_db.add_xyz_vectorial_properties_from_file(file_with_initial_xyz_velocities, xyz_vectorial_property='xyz_velocities')
188
188
  elif generation_method.casefold() == 'random'.casefold():
189
189
  for irepeat in range(number_of_initial_conditions):
190
- new_molecule = molecule.copy(atomic_labels = ['xyz_coordinates'], molecular_labels = [])
190
+ new_molecule = molecule.copy()
191
191
  velocities = generate_random_velocities(new_molecule,eliminate_angular_momentum,degrees_of_freedom,temp=initial_temperature,ekin=initial_kinetic_energy)
192
192
  for iatom in range(Natoms):
193
193
  new_molecule.atoms[iatom].xyz_velocities = velocities[iatom]
@@ -434,12 +434,20 @@ class ani(models.ml_model, models.torchani_model):
434
434
  molDB, property_to_predict, xyz_derivative_property_to_predict, hessian_to_predict = \
435
435
  super().predict(molecular_database=molecular_database, molecule=molecule, calculate_energy=calculate_energy, calculate_energy_gradients=calculate_energy_gradients, calculate_hessian=calculate_hessian, property_to_predict = property_to_predict, xyz_derivative_property_to_predict = xyz_derivative_property_to_predict, hessian_to_predict = hessian_to_predict)
436
436
 
437
+ if not molDB._is_uniform_cell():
438
+ batch_size = 1
439
+
437
440
  for batch in molDB.batches(batch_size):
438
441
  for properties in molDB2ANIdata(batch).species_to_indices(self.species_order).collate(batch_size):
439
442
  species = properties['species'].to(self.device)
440
- xyz_coordinates = properties['coordinates'].float().to(self.device).requires_grad_(bool(xyz_derivative_property_to_predict or hessian_to_predict))
443
+ xyz_coordinates = properties['coordinates'].float().to(self.device)
441
444
  break
442
- ANI_NN_energies = self.energy_shifter(self.model((species, xyz_coordinates))).energies
445
+ pbc = torch.tensor(batch[0].pbc).to(self.device) if batch[0].pbc is not None else None
446
+ cell = torch.tensor(batch[0].cell).float().to(self.device) if batch[0].cell is not None else None
447
+ if pbc is not None and cell is not None:
448
+ xyz_coordinates = torchani.utils.map2central(cell, xyz_coordinates, pbc)
449
+ xyz_coordinates = xyz_coordinates.requires_grad_(bool(xyz_derivative_property_to_predict or hessian_to_predict))
450
+ ANI_NN_energies = self.energy_shifter(self.model((species, xyz_coordinates), pbc=pbc, cell=cell)).energies
443
451
  if property_to_predict:
444
452
  batch.add_scalar_properties(ANI_NN_energies.detach().cpu().numpy(), property_to_predict)
445
453
  if xyz_derivative_property_to_predict or hessian_to_predict:
@@ -665,14 +673,23 @@ class ani_child(models.torchani_model):
665
673
  ) -> None:
666
674
  molDB = super().predict(molecular_database=molecular_database, molecule=molecule)
667
675
 
676
+ if not molDB._is_uniform_cell():
677
+ batch_size = 1
678
+
668
679
  for batch in molDB.batches(batch_size):
669
680
  for properties in molDB2ANIdata(batch).species_to_indices('periodic_table').collate(batch_size):
670
681
  species = properties['species'].to(self.device)
671
682
  if torchani.utils.PERIODIC_TABLE[0] == 'H':
672
683
  species += 1
673
- xyz_coordinates = properties['coordinates'].to(self.device).float().to(self.device).requires_grad_(calculate_energy_gradients or calculate_hessian)
684
+ xyz_coordinates = properties['coordinates'].float().to(self.device)
674
685
  break
675
- ANI_NN_energies = self.model((species, xyz_coordinates)).energies
686
+ pbc = torch.tensor(batch[0].pbc).to(self.device) if batch[0].pbc is not None else None
687
+ cell = torch.tensor(batch[0].cell).float().to(self.device) if batch[0].cell is not None else None
688
+ if pbc is not None and cell is not None:
689
+ xyz_coordinates = torchani.utils.map2central(cell, xyz_coordinates, pbc)
690
+ xyz_coordinates = xyz_coordinates.requires_grad_(calculate_energy_gradients or calculate_hessian)
691
+
692
+ ANI_NN_energies = self.model((species, xyz_coordinates), pbc=pbc, cell=cell).energies
676
693
  if calculate_energy:
677
694
  batch.add_scalar_properties(ANI_NN_energies.detach().cpu().numpy(), 'energy')
678
695
  if calculate_energy_gradients or calculate_hessian:
@@ -110,10 +110,10 @@ class optimize_geometry():
110
110
  raise ValueError('molecule and initial_molecule cannot be used at the same time')
111
111
  overwrite = False
112
112
  if not initial_molecule is None:
113
- self.initial_molecule = initial_molecule.copy(atomic_labels=['xyz_coordinates'],molecular_labels=['number'])
113
+ self.initial_molecule = initial_molecule.copy()
114
114
  if not molecule is None:
115
115
  overwrite = True
116
- self.initial_molecule = molecule.copy(atomic_labels=['xyz_coordinates'],molecular_labels=['number'])
116
+ self.initial_molecule = molecule.copy()
117
117
 
118
118
  self.ts = ts
119
119
  if program != None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlatom
3
- Version: 3.8.0
3
+ Version: 3.9.0
4
4
  Summary: A Package for Atomistic Simulations with Machine Learning
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.8.0
30
+ Version 3.9.0
31
31
 
32
32
  **Official website**: http://mlatom.com/
33
33
  **Manual**: http://mlatom.com/manual/
@@ -60,7 +60,7 @@ When this Software or its derivatives are used in scientific publications, it sh
60
60
  * 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.
61
61
  * 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.
62
62
  * 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.
63
- * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.8.0, Xiamen University, Xiamen, China, 2013-2024.
63
+ * Pavlo O. Dral, Fuchun Ge, Yi-Fan Hou, Peikun Zheng, Yuxinxin Chen, Bao-Xin Xue, Max Pinheiro Jr, Yuming Su, Yiheng Dai, Yangtao Chen, Shuang Zhang, Lina Zhang, Arif Ullah, Quanhao Zhang, Sebastian V. Pios, Yanchi Ou, MLatom: A Package for Atomistic Simulations with Machine Learning, version 3.9.0, Xiamen University, Xiamen, China, 2013-2024.
64
64
  [MLatom.com](http://mlatom.com).
65
65
 
66
66
  The citations for MLatom's interfaces and features shall be eventually
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes