mlatom 3.4.0__tar.gz → 3.5.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 (118) hide show
  1. {mlatom-3.4.0/src/mlatom.egg-info → mlatom-3.5.0}/PKG-INFO +3 -3
  2. {mlatom-3.4.0 → mlatom-3.5.0}/README.md +2 -2
  3. {mlatom-3.4.0 → mlatom-3.5.0}/setup.py +1 -1
  4. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatom.py +2 -2
  5. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLtasks.py +1 -0
  6. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/initial_conditions.py +169 -1
  7. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/md_cmd.py +67 -21
  8. {mlatom-3.4.0 → mlatom-3.5.0/src/mlatom.egg-info}/PKG-INFO +3 -3
  9. {mlatom-3.4.0 → mlatom-3.5.0}/LICENSE.txt +0 -0
  10. {mlatom-3.4.0 → mlatom-3.5.0}/setup.cfg +0 -0
  11. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLTPA.py +0 -0
  12. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/ML_NEA.py +0 -0
  13. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF +0 -0
  14. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/A_KRR.f90 +0 -0
  15. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/A_KRR_kernel.f90 +0 -0
  16. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/D_CoulombMatrix.f90 +0 -0
  17. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/D_ID.f90 +0 -0
  18. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/D_rel2eq.f90 +0 -0
  19. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/MLatomF.f90 +0 -0
  20. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/MLatomFInfo.f90 +0 -0
  21. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/MLmodel.f90 +0 -0
  22. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/Makefile +0 -0
  23. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/Makefile.intel +0 -0
  24. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/__init__.py +0 -0
  25. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/analyze.f90 +0 -0
  26. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/constants.f90 +0 -0
  27. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/cs.cpp +0 -0
  28. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/dataset.f90 +0 -0
  29. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/mathUtils.f90 +0 -0
  30. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/molDescr.f90 +0 -0
  31. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/optionsModule.f90 +0 -0
  32. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/precision.f90 +0 -0
  33. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/recover.sh +0 -0
  34. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/sampling.f90 +0 -0
  35. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/statistics.f90 +0 -0
  36. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/stopper.f90 +0 -0
  37. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/strings.f90 +0 -0
  38. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/timing.f90 +0 -0
  39. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/MLatomF_src/types.f90 +0 -0
  40. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/__init__.py +0 -0
  41. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1.py +0 -0
  42. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/__init__.py +0 -0
  43. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv0.pt +0 -0
  44. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv1.pt +0 -0
  45. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv2.pt +0 -0
  46. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv3.pt +0 -0
  47. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv4.pt +0 -0
  48. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv5.pt +0 -0
  49. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv6.pt +0 -0
  50. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_cc_cv7.pt +0 -0
  51. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv0.pt +0 -0
  52. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv1.pt +0 -0
  53. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv2.pt +0 -0
  54. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv3.pt +0 -0
  55. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv4.pt +0 -0
  56. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv5.pt +0 -0
  57. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv6.pt +0 -0
  58. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/aiqm1_model/aiqm1_dft_cv7.pt +0 -0
  59. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/args_class.py +0 -0
  60. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/ccsdtstarcbs.py +0 -0
  61. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/composite_methods.py +0 -0
  62. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/constants.py +0 -0
  63. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/conversions.py +0 -0
  64. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/cs.so +0 -0
  65. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/data.py +0 -0
  66. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/decorators.py +0 -0
  67. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/doc.py +0 -0
  68. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/fortran/KREG.f90 +0 -0
  69. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/fortran/__init__.py +0 -0
  70. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/fortran/compile.py +0 -0
  71. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/fortran/mathUtils.f90 +0 -0
  72. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/fortran/stopper.f90 +0 -0
  73. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/header.py +0 -0
  74. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interface_MLatomF.py +0 -0
  75. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/__init__.py +0 -0
  76. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/ase_interface.py +0 -0
  77. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/columbus_interface.py +0 -0
  78. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/dftd4_interface.py +0 -0
  79. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/dpmd_interface.py +0 -0
  80. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/gap_interface.py +0 -0
  81. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/gaussian_interface.py +0 -0
  82. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/mace_interface.py +0 -0
  83. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/mndo_interface.py +0 -0
  84. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/orca_interface.py +0 -0
  85. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/physnet_interface.py +0 -0
  86. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/pyscf_interface.py +0 -0
  87. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/sgdml_interface.py +0 -0
  88. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/sparrow_interface.py +0 -0
  89. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/torchani_interface.py +0 -0
  90. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/turbomole_interface.py +0 -0
  91. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/interfaces/xtb_interface.py +0 -0
  92. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/kreg_api.py +0 -0
  93. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/log.py +0 -0
  94. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/md.py +0 -0
  95. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/md2vibr.py +0 -0
  96. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/md2vibr_cmd.py +0 -0
  97. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/mlatom_gui.py +0 -0
  98. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/mltpa/__init__.py +0 -0
  99. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/mltpa/mff.txt +0 -0
  100. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/mltpa/mltpa2022_2.pkl +0 -0
  101. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/mltpa/mltpa2022_2_new_.pkl +0 -0
  102. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/models.py +0 -0
  103. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/namd.py +0 -0
  104. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/plot.py +0 -0
  105. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/ref.json +0 -0
  106. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/shell_cmd.py +0 -0
  107. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/simulations.py +0 -0
  108. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/sliceData.py +0 -0
  109. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/stats.py +0 -0
  110. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/stopper.py +0 -0
  111. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/thermostat.py +0 -0
  112. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/utils.py +0 -0
  113. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom/xyz.py +0 -0
  114. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom.egg-info/SOURCES.txt +0 -0
  115. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom.egg-info/dependency_links.txt +0 -0
  116. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom.egg-info/entry_points.txt +0 -0
  117. {mlatom-3.4.0 → mlatom-3.5.0}/src/mlatom.egg-info/requires.txt +0 -0
  118. {mlatom-3.4.0 → mlatom-3.5.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.4.0
3
+ Version: 3.5.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.4.0
30
+ Version 3.5.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.4.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.5.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.4.0
4
+ Version 3.5.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.4.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.5.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.4.0",
46
+ version = "3.5.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.4.0 !
7
+ ! MLatom 3.5.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.4.0, Xiamen University, Xiamen, China, 2013-2024. !
39
+ ! version 3.5.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. !
@@ -447,6 +447,7 @@ def freq(args):
447
447
  geomopt = simulations.thermochemistry(model=model,
448
448
  molecule=mol,
449
449
  **kwargs)
450
+ mol.dump(f'freq{mol.number}.json',format='json')
450
451
  print(' %s ' % ('='*78))
451
452
  print(' %s Vibration analysis for molecule %6d' % (' '*20, imol+1))
452
453
  print(' %s ' % ('='*78))
@@ -212,7 +212,9 @@ def generate_initial_conditions(molecule=None, generation_method=None, number_of
212
212
  new_molecule.atoms[iatom].xyz_coordinates = coordinates_all[irepeat][iatom]
213
213
  new_molecule.atoms[iatom].xyz_velocities = velocities_all[irepeat][iatom]
214
214
  init_cond_db.molecules.append(new_molecule)
215
-
215
+ elif generation_method.casefold() == 'harmonic-quantum-boltzmann'.casefold():
216
+ init_cond_db = harmonic_quantum_Boltzmann_sampling.sample(npoints=number_of_initial_conditions,molecule=molecule,temperature=initial_temperature,use_hessian=use_hessian)
217
+
216
218
  if filter_by_energy_window:
217
219
  if iteration == 1:
218
220
  result = excitation_energy_window_filter(init_cond_db,**window_filter_kwargs)
@@ -247,6 +249,10 @@ def generate_initial_conditions(molecule=None, generation_method=None, number_of
247
249
  if len(init_cond_db) > target_number_of_initial_conditions:
248
250
  init_cond_db = init_cond_db[:target_number_of_initial_conditions]
249
251
 
252
+ # Change the random seed so that the user-defined one only affects initial conditions sampling
253
+ if not random_seed is None:
254
+ np.random.seed()
255
+
250
256
  return init_cond_db
251
257
 
252
258
  def read_velocities_from_file(filename):
@@ -573,6 +579,168 @@ class wigner_sampling():
573
579
  q[iatom][icoord] += cn[i][iatom][icoord]*cint[i]*fac
574
580
  v[iatom][icoord] += cn[i][iatom][icoord]*dcint[i]*fac
575
581
  return q,v # Unit: a.u.
582
+
583
+ class harmonic_quantum_Boltzmann_sampling():
584
+ #
585
+ # The harmonic quantum Boltzmann sampling in this class follows what is shown in the following paper (it is called thermal sampling in VENUS manual):
586
+ # J. Phys. Chem. A 1998, 102, 3648-3658
587
+ #
588
+ # The quanta ni of each normal mode is first sampled from the harmonic quantum Boltzman distribution function:
589
+ #
590
+ # p(ni) = exp(-ni * h * vi / kB / T) * (1 - (exp(-h * vi / kB / T)))
591
+ #
592
+ # where vi is the frequency of normal mode i, h is the Planck constant, kB is the Boltzmann constant and T is the temperature
593
+ #
594
+ # The energy of normal mode i is calculated as Ei = (ni + 0.5) * h * vi
595
+ #
596
+ # The mass weighted normal mode coordinates Qi and momenta Pi are
597
+ #
598
+ # Qi = Ai * cos(2 * pi * Ri)
599
+ # Pi = -Ai * wi * sin(2 * pi * Ri)
600
+ #
601
+ # where wi = 2 * pi * vi, Ai = sqrt(2 * Ei) / wi and Ri is a uniform random number on [0,1]
602
+ #
603
+ # The mass weighted momentum Prc of reaction coordinate is chosed from a thermal distribution
604
+ #
605
+ # Prc = ± sqrt(-2 * kB * T * ln(1 - R))
606
+ #
607
+ # where R is a uniform random number on [0,1]
608
+ #
609
+
610
+ def __init__(self):
611
+ pass
612
+
613
+ @classmethod
614
+ def sample(cls,npoints,molecule,temperature,use_hessian):
615
+ if not use_hessian:
616
+ if not ('frequencies' in molecule.__dict__ and 'normal_modes' in molecule[0].__dict__):
617
+ print('Frequencies and normal modes not found, try to calculate them from Hessian matrix')
618
+ if not 'hessian' in molecule.__dict__.keys():
619
+ stopper.stopMLatom('Hessian matrix not found -- cannot do wigner sampling')
620
+ simulations.freq.freq_modified_from_TorchANI(molecule=molecule,normal_mode_normalization='mass deweighted normalized')
621
+ else:
622
+ if not 'hessian' in molecule.__dict__.keys():
623
+ stopper.stopMLatom('Hessian matrix not found -- cannot do wigner sampling')
624
+ simulations.freq.freq_modified_from_TorchANI(molecule=molecule,normal_mode_normalization='mass deweighted normalized')
625
+ freq = molecule.frequencies
626
+ nm_masses = molecule.reduced_masses
627
+ Natoms = len(molecule)
628
+
629
+ nnegative = 0
630
+ while freq[nnegative] < 0:
631
+ nnegative += 1
632
+ # freq = freq[nnegative:]
633
+ nm = np.zeros((len(freq),Natoms,3))
634
+
635
+ for imode in range(len(freq)):
636
+ for iatom in range(Natoms):
637
+ nm[imode][iatom] = molecule[iatom].normal_modes[imode]
638
+ nm[imode] /= np.sqrt(np.sum(nm[imode]**2))
639
+
640
+ q_list = np.array([molecule.xyz_coordinates]*npoints)
641
+ v_list = np.zeros((npoints,Natoms,3))
642
+
643
+ for imode in range(nnegative,len(freq)):
644
+ qq,vv = cls.get_vq(temperature,freq[imode],nm_masses[imode],npoints)
645
+ for isample in range(npoints):
646
+ # print(isample)
647
+ q_list[isample] += nm[imode]*qq[isample]
648
+ # print(nm[imode]*vv[isample])
649
+ v_list[isample] += nm[imode]*vv[isample]
650
+
651
+ # Deal with reaction coordinate
652
+ for ii in range(nnegative):
653
+ for isample in range(npoints):
654
+ scale = np.random.choice([-1,1])*np.sqrt(-2*constants.kB_in_Hartree*temperature*np.log(1-np.random.random())) / np.sqrt(nm_masses[ii] * constants.ram2au)/ constants.au2fs * constants.Bohr2Angstrom
655
+ v_list[isample] += scale * nm[ii]
656
+
657
+ init_cond_db = data.molecular_database()
658
+ for isample in range(npoints):
659
+ new_molecule = molecule.copy(atomic_labels=[],molecular_labels=[])
660
+ for iatom in range(Natoms):
661
+ new_molecule.atoms[iatom].xyz_coordinates = q_list[isample][iatom]
662
+ new_molecule.atoms[iatom].xyz_velocities = v_list[isample][iatom]
663
+ init_cond_db.molecules.append(new_molecule)
664
+
665
+ return init_cond_db
666
+
667
+ @classmethod
668
+ def sample_quanta(cls,temperature,freq,nsample):
669
+ hvkT = constants.planck_constant*freq*constants.speed_of_light*100/constants.kB/temperature
670
+
671
+ nn_len = 100
672
+ nn = np.array([ii for ii in range(nn_len)])
673
+ pp = np.array([np.exp(-ii*hvkT)*(1-np.exp(-hvkT)) for ii in nn])
674
+ while 1.0-np.sum(pp) > 1e-10:
675
+ nn_len += 50
676
+ nn = np.array([ii for ii in range(nn_len)])
677
+ pp = np.array([np.exp(-ii*hvkT)*(1-np.exp(-hvkT)) for ii in nn])
678
+ rand = np.random.choice(nn,size=nsample,p=pp)
679
+ return rand
680
+
681
+ @classmethod
682
+ def get_energy(cls,rand,freq):
683
+ return (rand+0.5)*constants.planck_constant*freq*constants.speed_of_light*100/1000*constants.Avogadro_constant*constants.kJpermol2Hartree # Hartree
684
+
685
+ @classmethod
686
+ def get_vq(cls,temperature,freq,mass,nsample):
687
+ energy = cls.get_energy(cls.sample_quanta(temperature,freq,nsample),freq)
688
+ rand = np.random.random(len(energy))
689
+ omega = freq * constants.speed_of_light*100*2*np.pi / 1.0E15 / constants.fs2au # au
690
+ AA = np.sqrt(2*energy)/omega # au
691
+ qq = AA * np.cos(2*np.pi*rand) / np.sqrt(mass*constants.ram2au) * constants.Bohr2Angstrom # Angstrom
692
+ vv = -omega * AA * np.sin(2*np.pi*rand) / np.sqrt(mass*constants.ram2au) * constants.Bohr2Angstrom / constants.au2fs # Angstrom/fs
693
+ return qq,vv
694
+
695
+ # def wignersample(npoints,molecule):
696
+ # qlist = []
697
+ # vlist = []
698
+ # geomEq = np.array([each.xyz_coordinates for each in molecule.atoms])
699
+ # mass = molecule.get_nuclear_masses()
700
+ # mass = mass.reshape(1,len(mass))
701
+ # # Calculate normal modes from Hessian matrix
702
+ # #nm,freq,ele,linear_int = readGaussianNM(nmfile)
703
+ # if not 'hessian' in molecule.__dict__.keys():
704
+ # stopper.stopMLatom('Hessian matrix not found -- cannot do wigner sampling')
705
+
706
+ # linear = molecule.is_it_linear()
707
+ # Natoms = len(molecule.atoms)
708
+ # if linear:
709
+ # ntriv = 5
710
+ # linear_int = 1
711
+ # else:
712
+ # ntriv = 6
713
+ # linear_int = 0
714
+
715
+ # # freq,nm,_,_ = vibrational_analysis(mass,molecule.hessian,mode_type='MDU')
716
+ # simulations.freq.freq_modified_from_TorchANI(molecule=molecule,normal_mode_normalization='mass deweighted unnormalized')
717
+ # freq = molecule.frequencies
718
+ # nm = np.zeros(3*Natoms,Natoms,3)
719
+ # for itriv in range(ntriv):
720
+ # nm[itriv] = 1.0 / np.sqrt(3*Natoms)
721
+ # for imode in range(ntriv,3*Natoms):
722
+ # for iatom in range(Natoms):
723
+ # nm[ntriv+imode][iatom] = molecule[iatom].normal_modes[imode]
724
+
725
+ # numcoo = len(freq)
726
+ # #print(len(nm),len(freq),len(ele),linear)
727
+ # atom_mass = [each.nuclear_mass for each in molecule.atoms]
728
+ # cart_nms, w_nmode = nm2cart(nm,atom_mass)
729
+
730
+ # geomEq_au = np.array(geomEq) / constants.Bohr2Angstrom
731
+
732
+ # anq, amp, freq_au, atmau = rdmol(atom_mass,linear_int,freq)
733
+
734
+ # for ipoint in range(npoints):
735
+ # q,v = inqp(geomEq_au,w_nmode[ntriv:],freq_au,anq,amp,numcoo,atmau)
736
+ # qlist.append(q)
737
+ # vlist.append(v)
738
+
739
+ # # Transform from a.u. to Angstrom & fs
740
+ # qlist = np.array(qlist) * constants.Bohr2Angstrom
741
+ # vlist = np.array(vlist) * constants.Bohr2Angstrom / constants.au2fs
742
+
743
+ # return qlist, vlist, linear_int
576
744
 
577
745
  # generate random velocities without angular momentum for linear molecule
578
746
  def generate_random_velocities_for_linear_molecule(molecule):
@@ -6,6 +6,8 @@ from .initial_conditions import generate_initial_conditions
6
6
  from .md import md
7
7
  from . import constants
8
8
  from . import data
9
+ from . import simulations
10
+ from .interfaces import gaussian_interface
9
11
 
10
12
  class Args(ArgsBase):
11
13
  def __init__(self):
@@ -18,10 +20,12 @@ class Args(ArgsBase):
18
20
  'initXYZ':'', # File containing initial geometry
19
21
  'initVXYZ':'', # File containing initial velocity
20
22
  'initConditions':'', # How to generate initial condition
23
+ 'normalModefile':'', # Gaussian ouput file containing normal modes
21
24
  'trajH5MDout':'traj.h5', # Output file: H5MD format
22
25
  'trajTextOut':'traj', # Output file
23
26
  'MLenergyUnits':'', # Energy unit in ML model
24
27
  'MLdistanceUnits':'', # Distance unit in ML model
28
+ 'randomSeed':'', # Random seed for initial condition sampling
25
29
  'ensemble':'nve',
26
30
  'thermostat':'', # Thermostat
27
31
  'gamma':0.2, # Option for Anderson thermostat
@@ -70,31 +74,32 @@ class MD_CMD():
70
74
  else:
71
75
  stopMLatom('Unknown MLdistanceUnits: %s'%(args.MLenergyUnits))
72
76
 
77
+ if args.randomSeed == '':
78
+ random_seed = None
79
+ else:
80
+ random_seed = int(args.randomSeed)
81
+
73
82
  print(" Propagating molecular dynamics...")
74
83
 
75
84
  # Deal with initial conditions
76
85
  # Check file and get initial molecule
77
- if args.initXYZ == '':
78
- stopMLatom('Please provide initial XYZ file')
79
- if not os.path.exists(args.initXYZ):
80
- stopMLatom('User-defined initial XYZ file %s does not exist'%(args.initXYZ))
81
- mol = data.molecule()
82
- mol.read_from_xyz_file(args.initXYZ)
86
+ if args.initConditions == '' or args.initConditions.lower() == 'user-defined' or args.initConditions.lower() == 'random':
87
+ if args.initXYZ == '':
88
+ stopMLatom('Please provide initial XYZ file')
89
+ if not os.path.exists(args.initXYZ):
90
+ stopMLatom('User-defined initial XYZ file %s does not exist'%(args.initXYZ))
91
+ mol = data.molecule()
92
+ mol.read_from_xyz_file(args.initXYZ)
83
93
 
84
94
  # Deal with degrees of freedom
85
- if mol.is_it_linear():
86
- linear = 1
87
- print(' Linear molecule detected')
88
- else:
89
- linear = 0
90
- Natoms = len(mol.atoms)
91
- if args.initConditions == '' or args.initConditions.lower() == 'user-defined':
92
- # if args.DOF > 0:
93
- # args.DOF = args.DOF - 3*Natoms
94
- DOF = 3*Natoms-6+linear
95
- elif args.initConditions == 'random':
95
+ if args.initConditions.lower() == 'random':
96
+ if mol.is_it_linear():
97
+ linear = 1
98
+ print(' Linear molecule detected')
99
+ else:
100
+ linear = 0
101
+ Natoms = len(mol.atoms)
96
102
  DOF = 3*Natoms-6+linear
97
-
98
103
  # print(' Degrees of freedom: %d'%(DOF))
99
104
 
100
105
  # Generate initial conditions
@@ -112,13 +117,54 @@ class MD_CMD():
112
117
  file_with_initial_xyz_coordinates = args.initXYZ,
113
118
  file_with_initial_xyz_velocities = args.initVXYZ)
114
119
  elif args.initConditions.lower() == 'random':
115
- print(' Use random sampling to generate initial conditon')
120
+ if args.initTemperature == 0:
121
+ initTemperature = 300
122
+ print(' Use random sampling to generate initial condition')
116
123
  print(f' Initial XYZ coordinates file: {args.initXYZ}')
117
- print(f' Initial instantaneous temperature: {args.initTemperature}')
124
+ print(f' Initial instantaneous temperature: {initTemperature}')
118
125
  init_cond_db = generate_initial_conditions(molecule=mol,
119
126
  generation_method='random',
120
127
  degrees_of_freedom = DOF,
121
- initial_temperature = args.initTemperature)
128
+ initial_temperature = initTemperature,
129
+ random_seed = random_seed)
130
+ elif args.initConditions.lower() == 'wigner':
131
+ print(' Use Wigner sampling to generate initial condition')
132
+ if args.normalModefile != '' and os.path.exists(args.normalModefile):
133
+ try:
134
+ if args.normalModefile[-4:] == 'json':
135
+ mol = data.molecule()
136
+ mol.load(args.normalModefile,format='json')
137
+ else:
138
+ mol = data.molecule.from_xyz_file(args.normalModefile)
139
+ except:
140
+ stopMLatom(f'Failed to open normal model file {args.normalModefile}')
141
+ elif args.normalModefile == '':
142
+ stopMLatom('Please provide file with normal modes')
143
+ elif not os.path.exists(args.normalModefile):
144
+ stopMLatom(f'Normal model file {args.normalMode} does not exist')
145
+ init_cond_db = generate_initial_conditions(molecule=mol,
146
+ generation_method='wigner',
147
+ initial_temperature = args.initTemperature,
148
+ random_seed = random_seed)
149
+ elif args.initConditions.lower() == 'harmonic-quantum-boltzmann':
150
+ print(' Use harmonic quantum Boltzmann distribution to generate initial condition')
151
+ if args.normalModefile != '' and os.path.exists(args.normalModefile):
152
+ try:
153
+ if args.normalModefile[-4:] == 'json':
154
+ mol = data.molecule()
155
+ mol.load(args.normalModefile,format='json')
156
+ else:
157
+ mol = data.molecule.from_xyz_file(args.normalModefile)
158
+ except:
159
+ stopMLatom(f'Failed to open normal model file {args.normalModefile}')
160
+ elif args.normalModefile == '':
161
+ stopMLatom('Please provide file with normal modes')
162
+ elif not os.path.exists(args.normalModefile):
163
+ stopMLatom(f'Normal model file {args.normalMode} does not exist')
164
+ init_cond_db = generate_initial_conditions(molecule=mol,
165
+ generation_method='harmonic-quantum-boltzmann',
166
+ initial_temperature = args.initTemperature,
167
+ random_seed = random_seed)
122
168
 
123
169
  init_mol = init_cond_db.molecules[0]
124
170
  print_initial_condition(init_mol)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlatom
3
- Version: 3.4.0
3
+ Version: 3.5.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.4.0
30
+ Version 3.5.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.4.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.5.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