ipi 2.6.3__tar.gz → 3.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 (163) hide show
  1. {ipi-2.6.3 → ipi-3.0}/PKG-INFO +20 -5
  2. {ipi-2.6.3 → ipi-3.0}/README.md +19 -4
  3. {ipi-2.6.3 → ipi-3.0}/bin/i-pi +4 -1
  4. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-committee-reweight +33 -17
  5. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-driver-py +15 -2
  6. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-py_driver +15 -2
  7. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-remdsort +9 -3
  8. {ipi-2.6.3 → ipi-3.0}/drivers/py/driver.py +15 -2
  9. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/__init__.py +6 -1
  10. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/ase.py +2 -2
  11. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/doubledoublewell.py +4 -7
  12. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/doublewell.py +2 -5
  13. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/doublewell_with_bath.py +6 -6
  14. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/doublewell_with_friction.py +3 -4
  15. ipi-3.0/drivers/py/pes/driverdipole.py +269 -0
  16. ipi-3.0/drivers/py/pes/elphmod.py +32 -0
  17. ipi-3.0/drivers/py/pes/metatensor.py +94 -0
  18. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/pet.py +26 -9
  19. {ipi-2.6.3 → ipi-3.0}/ipi/engine/atoms.py +2 -2
  20. {ipi-2.6.3 → ipi-3.0}/ipi/engine/ensembles.py +1 -2
  21. {ipi-2.6.3 → ipi-3.0}/ipi/engine/forcefields.py +79 -26
  22. {ipi-2.6.3 → ipi-3.0}/ipi/engine/forces.py +50 -46
  23. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/__init__.py +1 -0
  24. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/al6xxx_kmc.py +1 -1
  25. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/alchemy.py +4 -4
  26. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/atomswap.py +4 -4
  27. ipi-3.0/ipi/engine/motion/driven_dynamics.py +408 -0
  28. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/dynamics.py +3 -2
  29. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/instanton.py +26 -22
  30. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/motion.py +1 -1
  31. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/replay.py +4 -2
  32. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/scphonons.py +2 -2
  33. {ipi-2.6.3 → ipi-3.0}/ipi/engine/outputs.py +42 -9
  34. {ipi-2.6.3 → ipi-3.0}/ipi/engine/properties.py +149 -24
  35. {ipi-2.6.3 → ipi-3.0}/ipi/engine/simulation.py +13 -1
  36. {ipi-2.6.3 → ipi-3.0}/ipi/engine/thermostats.py +3 -3
  37. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/__init__.py +1 -0
  38. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/forcefields.py +18 -3
  39. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/forces.py +3 -3
  40. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/interface.py +2 -1
  41. ipi-3.0/ipi/inputs/motion/driven_dynamics.py +217 -0
  42. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/dynamics.py +10 -1
  43. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/motion.py +22 -3
  44. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/planetary.py +1 -1
  45. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/outputs.py +1 -1
  46. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/simulation.py +16 -3
  47. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/system.py +3 -3
  48. {ipi-2.6.3 → ipi-3.0}/ipi/interfaces/sockets.py +5 -3
  49. {ipi-2.6.3 → ipi-3.0}/ipi/utils/hesstools.py +1 -2
  50. {ipi-2.6.3 → ipi-3.0}/ipi/utils/inputvalue.py +5 -3
  51. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/__init__.py +40 -2
  52. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/backends/io_ase.py +18 -2
  53. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/io_units.py +5 -1
  54. {ipi-2.6.3 → ipi-3.0}/ipi/utils/messages.py +1 -2
  55. {ipi-2.6.3 → ipi-3.0}/ipi/utils/nmtransform.py +3 -0
  56. {ipi-2.6.3 → ipi-3.0}/ipi/utils/parsing.py +10 -3
  57. {ipi-2.6.3 → ipi-3.0}/ipi/utils/prng.py +50 -2
  58. {ipi-2.6.3 → ipi-3.0}/ipi/utils/units.py +62 -0
  59. {ipi-2.6.3 → ipi-3.0}/ipi.egg-info/PKG-INFO +20 -5
  60. {ipi-2.6.3 → ipi-3.0}/ipi.egg-info/SOURCES.txt +4 -0
  61. {ipi-2.6.3 → ipi-3.0}/setup.cfg +1 -1
  62. ipi-2.6.3/drivers/py/pes/metatensor.py +0 -44
  63. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-contract-trajectory +0 -0
  64. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-get_Ascp +0 -0
  65. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-getacf +0 -0
  66. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-getproperty +0 -0
  67. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-gleacf +0 -0
  68. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-kinetic2tag +0 -0
  69. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-mergebeadspdb +0 -0
  70. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-mux-positions +0 -0
  71. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-paraweights +0 -0
  72. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-planetary +0 -0
  73. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-posforce2kinetic +0 -0
  74. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-style +0 -0
  75. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-tests +0 -0
  76. {ipi-2.6.3 → ipi-3.0}/bin/i-pi-trimsim +0 -0
  77. {ipi-2.6.3 → ipi-3.0}/drivers/py/__init__.py +0 -0
  78. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/bath.py +0 -0
  79. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/dummy.py +0 -0
  80. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/harmonic.py +0 -0
  81. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/mace.py +0 -0
  82. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/rascal.py +0 -0
  83. {ipi-2.6.3 → ipi-3.0}/drivers/py/pes/spline.py +0 -0
  84. {ipi-2.6.3 → ipi-3.0}/ipi/__init__.py +0 -0
  85. {ipi-2.6.3 → ipi-3.0}/ipi/engine/__init__.py +0 -0
  86. {ipi-2.6.3 → ipi-3.0}/ipi/engine/barostats.py +0 -0
  87. {ipi-2.6.3 → ipi-3.0}/ipi/engine/beads.py +0 -0
  88. {ipi-2.6.3 → ipi-3.0}/ipi/engine/cell.py +0 -0
  89. {ipi-2.6.3 → ipi-3.0}/ipi/engine/initializer.py +0 -0
  90. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/constrained_dynamics.py +0 -0
  91. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/geop.py +0 -0
  92. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/multi.py +0 -0
  93. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/neb.py +0 -0
  94. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/phonons.py +0 -0
  95. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/planetary.py +0 -0
  96. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/ramp.py +0 -0
  97. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/stringmep.py +0 -0
  98. {ipi-2.6.3 → ipi-3.0}/ipi/engine/motion/vscf.py +0 -0
  99. {ipi-2.6.3 → ipi-3.0}/ipi/engine/normalmodes.py +0 -0
  100. {ipi-2.6.3 → ipi-3.0}/ipi/engine/smotion/__init__.py +0 -0
  101. {ipi-2.6.3 → ipi-3.0}/ipi/engine/smotion/dmd.py +0 -0
  102. {ipi-2.6.3 → ipi-3.0}/ipi/engine/smotion/metad.py +0 -0
  103. {ipi-2.6.3 → ipi-3.0}/ipi/engine/smotion/multi.py +0 -0
  104. {ipi-2.6.3 → ipi-3.0}/ipi/engine/smotion/remd.py +0 -0
  105. {ipi-2.6.3 → ipi-3.0}/ipi/engine/smotion/smotion.py +0 -0
  106. {ipi-2.6.3 → ipi-3.0}/ipi/engine/system.py +0 -0
  107. {ipi-2.6.3 → ipi-3.0}/ipi/external/__init__.py +0 -0
  108. {ipi-2.6.3 → ipi-3.0}/ipi/external/importlib/__init__.py +0 -0
  109. {ipi-2.6.3 → ipi-3.0}/ipi/external/importlib/bundledimportlib.py +0 -0
  110. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/atoms.py +0 -0
  111. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/barostats.py +0 -0
  112. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/beads.py +0 -0
  113. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/cell.py +0 -0
  114. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/ensembles.py +0 -0
  115. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/initializer.py +0 -0
  116. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/__init__.py +0 -0
  117. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/al6xxx_kmc.py +0 -0
  118. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/alchemy.py +0 -0
  119. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/atomswap.py +0 -0
  120. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/constrained_dynamics.py +0 -0
  121. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/geop.py +0 -0
  122. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/instanton.py +0 -0
  123. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/neb.py +0 -0
  124. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/phonons.py +0 -0
  125. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/ramp.py +0 -0
  126. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/scphonons.py +0 -0
  127. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/stringmep.py +0 -0
  128. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/motion/vscf.py +0 -0
  129. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/normalmodes.py +0 -0
  130. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/prng.py +0 -0
  131. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/smotion/__init__.py +0 -0
  132. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/smotion/dmd.py +0 -0
  133. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/smotion/metad.py +0 -0
  134. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/smotion/remd.py +0 -0
  135. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/smotion/smotion.py +0 -0
  136. {ipi-2.6.3 → ipi-3.0}/ipi/inputs/thermostats.py +0 -0
  137. {ipi-2.6.3 → ipi-3.0}/ipi/interfaces/__init__.py +0 -0
  138. {ipi-2.6.3 → ipi-3.0}/ipi/utils/__init__.py +0 -0
  139. {ipi-2.6.3 → ipi-3.0}/ipi/utils/constrtools.py +0 -0
  140. {ipi-2.6.3 → ipi-3.0}/ipi/utils/decorators.py +0 -0
  141. {ipi-2.6.3 → ipi-3.0}/ipi/utils/depend.py +0 -0
  142. {ipi-2.6.3 → ipi-3.0}/ipi/utils/distance.py +0 -0
  143. {ipi-2.6.3 → ipi-3.0}/ipi/utils/exchange.py +0 -0
  144. {ipi-2.6.3 → ipi-3.0}/ipi/utils/instools.py +0 -0
  145. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/backends/__init__.py +0 -0
  146. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/backends/io_binary.py +0 -0
  147. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/backends/io_json.py +0 -0
  148. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/backends/io_pdb.py +0 -0
  149. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/backends/io_xyz.py +0 -0
  150. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/inputs/__init__.py +0 -0
  151. {ipi-2.6.3 → ipi-3.0}/ipi/utils/io/inputs/io_xml.py +0 -0
  152. {ipi-2.6.3 → ipi-3.0}/ipi/utils/mathtools.py +0 -0
  153. {ipi-2.6.3 → ipi-3.0}/ipi/utils/mintools.py +0 -0
  154. {ipi-2.6.3 → ipi-3.0}/ipi/utils/phonontools.py +0 -0
  155. {ipi-2.6.3 → ipi-3.0}/ipi/utils/softexit.py +0 -0
  156. {ipi-2.6.3 → ipi-3.0}/ipi/utils/sparse.py +0 -0
  157. {ipi-2.6.3 → ipi-3.0}/ipi.egg-info/dependency_links.txt +0 -0
  158. {ipi-2.6.3 → ipi-3.0}/ipi.egg-info/requires.txt +0 -0
  159. {ipi-2.6.3 → ipi-3.0}/ipi.egg-info/top_level.txt +0 -0
  160. {ipi-2.6.3 → ipi-3.0}/licenses/license_GPL.txt +0 -0
  161. {ipi-2.6.3 → ipi-3.0}/licenses/license_MIT.txt +0 -0
  162. {ipi-2.6.3 → ipi-3.0}/pyproject.toml +0 -0
  163. {ipi-2.6.3 → ipi-3.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ipi
3
- Version: 2.6.3
3
+ Version: 3.0
4
4
  Summary: A Python interface for ab initio path integral molecular dynamics simulations
5
5
  Home-page: http://ipi-code.org
6
6
  Author: The i-PI developers
@@ -45,6 +45,21 @@ and it implements most of the state-of-the-art methods to accelerate this kind o
45
45
  calculations. It has since grown to also provide all sorts of simulation
46
46
  strategies, from replica exchange to geometry optimization.
47
47
 
48
+ If you use i-PI in your research, please cite the accompanying publication:
49
+ for version 3, the relevant paper is
50
+ [Litman et al., *J. Chem. Phys.* 161, 062504 (2024)](https://doi.org/10.1063/5.0215869)
51
+
52
+ ```
53
+ @article{litman2024ipi,
54
+ title={i-PI 3.0: a flexible and efficient framework for advanced atomistic simulations},
55
+ author={Yair Litman and Venkat Kapil and Yotam M. Y. Feldman and Davide Tisi and Tomislav Begušić and Karen Fidanyan and Guillaume Fraux and Jacob Higer and Matthias Kellner and Tao E. Li and Eszter S. Pós and Elia Stocco and George Trenins and Barak Hirshberg and Mariana Rossi and Michele Ceriotti},
56
+ journal = {J. Chem. Phys.},
57
+ pages = {062505},
58
+ volume = {161},
59
+ year = {2024}
60
+ }
61
+ ```
62
+
48
63
  Quick Setup
49
64
  -----------
50
65
 
@@ -62,8 +77,8 @@ Last Release:
62
77
  pip install -U ipi
63
78
  ```
64
79
 
65
- Full installation
66
- -----------------
80
+ Source installation
81
+ -------------------
67
82
 
68
83
  To develop i-PI or test it with the self-contained driver, follow these
69
84
  instructions. It is assumed that i-PI will
@@ -111,8 +126,8 @@ else if you want to keep the i-PI directory clean. For example
111
126
  ```bash
112
127
  cd demos/para-h2-tutorial/tutorial-1/
113
128
  i-pi tutorial-1.xml > log &
114
- i-pi-driver -h localhost -p 31415 -m sg -o 15 &
115
- i-pi-driver -h localhost -p 31415 -m sg -o 15 &
129
+ i-pi-driver -a localhost -p 31415 -m sg -o 15 &
130
+ i-pi-driver -a localhost -p 31415 -m sg -o 15 &
116
131
  tail -f log
117
132
  ```
118
133
 
@@ -17,6 +17,21 @@ and it implements most of the state-of-the-art methods to accelerate this kind o
17
17
  calculations. It has since grown to also provide all sorts of simulation
18
18
  strategies, from replica exchange to geometry optimization.
19
19
 
20
+ If you use i-PI in your research, please cite the accompanying publication:
21
+ for version 3, the relevant paper is
22
+ [Litman et al., *J. Chem. Phys.* 161, 062504 (2024)](https://doi.org/10.1063/5.0215869)
23
+
24
+ ```
25
+ @article{litman2024ipi,
26
+ title={i-PI 3.0: a flexible and efficient framework for advanced atomistic simulations},
27
+ author={Yair Litman and Venkat Kapil and Yotam M. Y. Feldman and Davide Tisi and Tomislav Begušić and Karen Fidanyan and Guillaume Fraux and Jacob Higer and Matthias Kellner and Tao E. Li and Eszter S. Pós and Elia Stocco and George Trenins and Barak Hirshberg and Mariana Rossi and Michele Ceriotti},
28
+ journal = {J. Chem. Phys.},
29
+ pages = {062505},
30
+ volume = {161},
31
+ year = {2024}
32
+ }
33
+ ```
34
+
20
35
  Quick Setup
21
36
  -----------
22
37
 
@@ -34,8 +49,8 @@ Last Release:
34
49
  pip install -U ipi
35
50
  ```
36
51
 
37
- Full installation
38
- -----------------
52
+ Source installation
53
+ -------------------
39
54
 
40
55
  To develop i-PI or test it with the self-contained driver, follow these
41
56
  instructions. It is assumed that i-PI will
@@ -83,8 +98,8 @@ else if you want to keep the i-PI directory clean. For example
83
98
  ```bash
84
99
  cd demos/para-h2-tutorial/tutorial-1/
85
100
  i-pi tutorial-1.xml > log &
86
- i-pi-driver -h localhost -p 31415 -m sg -o 15 &
87
- i-pi-driver -h localhost -p 31415 -m sg -o 15 &
101
+ i-pi-driver -a localhost -p 31415 -m sg -o 15 &
102
+ i-pi-driver -a localhost -p 31415 -m sg -o 15 &
88
103
  tail -f log
89
104
  ```
90
105
 
@@ -58,7 +58,7 @@ def main(fn_input, options):
58
58
  raise ImportError('Profiling requires the `yappi` package.')
59
59
 
60
60
  # construct simulation based on input file
61
- simulation = Simulation.load_from_xml(fn_input, request_banner=True, custom_verbosity=options.verbosity)
61
+ simulation = Simulation.load_from_xml(fn_input, request_banner=True, custom_verbosity=options.verbosity, sockets_prefix=options.sockets_prefix)
62
62
 
63
63
  # run the simulation
64
64
  simulation.run()
@@ -96,6 +96,9 @@ if __name__ == '__main__':
96
96
  choices=['quiet', 'low', 'medium', 'high', 'debug'],
97
97
  help='Define the verbosity level.')
98
98
 
99
+ parser.add_option('-S', '--sockets_prefix', dest='sockets_prefix', default=None,
100
+ help='Prefix for profiler files.')
101
+
99
102
  options, args = parser.parse_args()
100
103
 
101
104
  # make sure that we have exactly one input file and it exists
@@ -23,6 +23,7 @@ def direct_reweight(pot, obs, kbT):
23
23
  obs_avg_rew : the observable reweighted for each potential
24
24
  weights : the weights computed for each model and frame
25
25
  """
26
+
26
27
  beta = 1.0 / kbT
27
28
  num_pot_frames = pot.shape[0]
28
29
  num_obs_frames = obs.shape[0]
@@ -133,7 +134,7 @@ def uncertainty_CEA_multiple_models(pot, obs, kbT):
133
134
 
134
135
 
135
136
  def commitee_reweight(
136
- path2ixml, pot_file, obs_file, stride=1, index=-1, direct=False, multi_models=False
137
+ pot_file, obs_file, kt, stride=1, index=-1, direct=False, multi_models=False
137
138
  ):
138
139
  """
139
140
  Parameters
@@ -145,6 +146,8 @@ def commitee_reweight(
145
146
  A file containing the value of the observable for each frame.
146
147
  It is assumed that lines correspond to frames, while columns to properties.
147
148
  Multiple properties can be reweighted at the same time.
149
+ kt : float, mandatory
150
+ The thermal energy, in the same units as pot_file
148
151
  stride : integer, [1]
149
152
  The frequency of sampling of pot_file, if different from that of prop_file (e.g. --stride 10 if
150
153
  the potential was printed 10 times more often than the observable. --stride -10 must be used if
@@ -175,15 +178,9 @@ def commitee_reweight(
175
178
  else:
176
179
  raise ValueError("Stride value cannot be zero")
177
180
 
178
- # Load kbT from i-PI, we could make it into a small function
179
- simul = Simulation.load_from_xml(
180
- path2ixml, custom_verbosity="quiet", read_only=True
181
- )
182
- kbT = float(simul.syslist[0].ensemble.temp)
183
-
184
181
  if multi_models:
185
182
  mean_value, sigma2_a, sigma2_aV, sigma2_tilde = uncertainty_CEA_multiple_models(
186
- potentials, obs, kbT
183
+ potentials, obs, kt
187
184
  )
188
185
  print("# Mean Error sigma_a sigma_aV")
189
186
  print(
@@ -194,9 +191,9 @@ def commitee_reweight(
194
191
  else:
195
192
  # CEA is the default choice. The weights or h_matrix are
196
193
  if direct:
197
- rw_obs, _weights = direct_reweight(potentials, obs, kbT)
194
+ rw_obs, _weights = direct_reweight(potentials, obs, kt)
198
195
  else:
199
- rw_obs, _h_matrix = CEA(potentials, obs, kbT)
196
+ rw_obs, _h_matrix = CEA(potentials, obs, kt)
200
197
  print(
201
198
  "# Mean Error <committee_1> .... <committee_N>"
202
199
  )
@@ -215,21 +212,28 @@ if __name__ == "__main__":
215
212
  The full methodology is described in: https://doi.org/10.1063/5.0036522"""
216
213
  )
217
214
 
218
- parser.add_argument(
219
- "input_xml",
220
- type=str,
221
- help="The path to the input file used to run the simulation (usually input.xml)",
222
- )
223
215
  parser.add_argument(
224
216
  "pot_file",
225
217
  type=str,
226
- help="The file containing the potentials. Rows = frames, columns = potentials",
218
+ help="The file containing the potentials, in units of kT (default: Hartree). Rows = frames, columns = potentials",
227
219
  )
228
220
  parser.add_argument(
229
221
  "obs_file",
230
222
  type=str,
231
223
  help="The file containing the properties. Rows = frames, columns = property/ies",
232
224
  )
225
+ parser.add_argument(
226
+ "--kt",
227
+ type=float,
228
+ default=0.0,
229
+ help="The thermal energy. Should be in the same units of the potentials, typically Hartree",
230
+ )
231
+ parser.add_argument(
232
+ "--input",
233
+ type=str,
234
+ default="",
235
+ help="The path to the input file used to run the simulation (usually input.xml). Used just to extract kT.",
236
+ )
233
237
  parser.add_argument(
234
238
  "--stride",
235
239
  type=int,
@@ -254,11 +258,23 @@ if __name__ == "__main__":
254
258
  )
255
259
 
256
260
  args = parser.parse_args()
261
+
262
+ # Load kbT from i-PI, we could make it into a small function
263
+ if args.input != "":
264
+ simul = Simulation.load_from_xml(
265
+ args.input, custom_verbosity="quiet", read_only=True
266
+ )
267
+ kt = float(simul.syslist[0].ensemble.temp)
268
+ else:
269
+ kt = args.kt
270
+ if kt <= 0:
271
+ raise ValueError("Must specify either --kt or --input")
272
+
257
273
  sys.exit(
258
274
  commitee_reweight(
259
- args.input_xml,
260
275
  args.pot_file,
261
276
  args.obs_file,
277
+ kt,
262
278
  args.stride,
263
279
  args.index,
264
280
  args.direct,
@@ -59,14 +59,19 @@ def Message(mystr):
59
59
 
60
60
 
61
61
  def run_driver(
62
- unix=False, address="", port=12345, driver=Dummy_driver(), f_verbose=False
62
+ unix=False,
63
+ address="",
64
+ port=12345,
65
+ driver=Dummy_driver(),
66
+ f_verbose=False,
67
+ sockets_prefix="/tmp/ipi_",
63
68
  ):
64
69
  """Minimal socket client for i-PI."""
65
70
 
66
71
  # Opens a socket to i-PI
67
72
  if unix:
68
73
  sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
69
- sock.connect("/tmp/ipi_" + address)
74
+ sock.connect(sockets_prefix + address)
70
75
  else:
71
76
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
72
77
  # this reduces latency for the small messages passed by the i-PI protocol
@@ -181,6 +186,13 @@ if __name__ == "__main__":
181
186
  default="localhost",
182
187
  help="Host name (for INET sockets) or name of the UNIX domain socket to connect to.",
183
188
  )
189
+ parser.add_argument(
190
+ "-S",
191
+ "--sockets_prefix",
192
+ type=str,
193
+ default="/tmp/ipi_",
194
+ help="Prefix used for the unix domain sockets. Ignored when using TCP/IP sockets.",
195
+ )
184
196
  parser.add_argument(
185
197
  "-p",
186
198
  "--port",
@@ -228,4 +240,5 @@ if __name__ == "__main__":
228
240
  port=args.port,
229
241
  driver=d_f,
230
242
  f_verbose=args.verbose,
243
+ sockets_prefix=args.sockets_prefix,
231
244
  )
@@ -59,14 +59,19 @@ def Message(mystr):
59
59
 
60
60
 
61
61
  def run_driver(
62
- unix=False, address="", port=12345, driver=Dummy_driver(), f_verbose=False
62
+ unix=False,
63
+ address="",
64
+ port=12345,
65
+ driver=Dummy_driver(),
66
+ f_verbose=False,
67
+ sockets_prefix="/tmp/ipi_",
63
68
  ):
64
69
  """Minimal socket client for i-PI."""
65
70
 
66
71
  # Opens a socket to i-PI
67
72
  if unix:
68
73
  sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
69
- sock.connect("/tmp/ipi_" + address)
74
+ sock.connect(sockets_prefix + address)
70
75
  else:
71
76
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
72
77
  # this reduces latency for the small messages passed by the i-PI protocol
@@ -181,6 +186,13 @@ if __name__ == "__main__":
181
186
  default="localhost",
182
187
  help="Host name (for INET sockets) or name of the UNIX domain socket to connect to.",
183
188
  )
189
+ parser.add_argument(
190
+ "-S",
191
+ "--sockets_prefix",
192
+ type=str,
193
+ default="/tmp/ipi_",
194
+ help="Prefix used for the unix domain sockets. Ignored when using TCP/IP sockets.",
195
+ )
184
196
  parser.add_argument(
185
197
  "-p",
186
198
  "--port",
@@ -228,4 +240,5 @@ if __name__ == "__main__":
228
240
  port=args.port,
229
241
  driver=d_f,
230
242
  f_verbose=args.verbose,
243
+ sockets_prefix=args.sockets_prefix,
231
244
  )
@@ -140,8 +140,11 @@ def main(inputfile, prefix="SRT_"):
140
140
  }
141
141
  )
142
142
  else:
143
- filename = filename + "_" + padb + "." + o.format
144
- ofilename = ofilename + "_" + padb + "." + o.format
143
+ extension = o.format
144
+ if extension == "ase": # special case
145
+ extension = "extxyz"
146
+ filename = filename + "_" + padb + "." + extension
147
+ ofilename = ofilename + "_" + padb + "." + extension
145
148
  ntraj.append(
146
149
  {
147
150
  "filename": filename,
@@ -164,7 +167,10 @@ def main(inputfile, prefix="SRT_"):
164
167
  filename = s.prefix + "_" + o.filename
165
168
  else:
166
169
  filename = o.filename
167
- filename = filename + "." + o.format
170
+ extension = o.format
171
+ if extension == "ase": # special case
172
+ extension = "extxyz"
173
+ filename = filename + "." + extension
168
174
  ofilename = prefix + filename
169
175
  ntraj.append(
170
176
  {
@@ -59,14 +59,19 @@ def Message(mystr):
59
59
 
60
60
 
61
61
  def run_driver(
62
- unix=False, address="", port=12345, driver=Dummy_driver(), f_verbose=False
62
+ unix=False,
63
+ address="",
64
+ port=12345,
65
+ driver=Dummy_driver(),
66
+ f_verbose=False,
67
+ sockets_prefix="/tmp/ipi_",
63
68
  ):
64
69
  """Minimal socket client for i-PI."""
65
70
 
66
71
  # Opens a socket to i-PI
67
72
  if unix:
68
73
  sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
69
- sock.connect("/tmp/ipi_" + address)
74
+ sock.connect(sockets_prefix + address)
70
75
  else:
71
76
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
72
77
  # this reduces latency for the small messages passed by the i-PI protocol
@@ -181,6 +186,13 @@ if __name__ == "__main__":
181
186
  default="localhost",
182
187
  help="Host name (for INET sockets) or name of the UNIX domain socket to connect to.",
183
188
  )
189
+ parser.add_argument(
190
+ "-S",
191
+ "--sockets_prefix",
192
+ type=str,
193
+ default="/tmp/ipi_",
194
+ help="Prefix used for the unix domain sockets. Ignored when using TCP/IP sockets.",
195
+ )
184
196
  parser.add_argument(
185
197
  "-p",
186
198
  "--port",
@@ -228,4 +240,5 @@ if __name__ == "__main__":
228
240
  port=args.port,
229
241
  driver=d_f,
230
242
  f_verbose=args.verbose,
243
+ sockets_prefix=args.sockets_prefix,
231
244
  )
@@ -2,6 +2,7 @@
2
2
 
3
3
  import pkgutil
4
4
  import importlib
5
+ import traceback
5
6
 
6
7
  __all__ = []
7
8
 
@@ -11,7 +12,11 @@ __drivers__ = {}
11
12
  # Iterate through all modules in the current package folder
12
13
  for loader, module_name, is_pkg in pkgutil.iter_modules(__path__):
13
14
  # Import the module
14
- module = importlib.import_module("." + module_name, __package__)
15
+ try:
16
+ module = importlib.import_module("." + module_name, __package__)
17
+ except Exception:
18
+ print(f"!! Could not import PES module {module_name} !!")
19
+ traceback.print_exc()
15
20
 
16
21
  # Get the driver class and name from the module
17
22
  driver_class = getattr(module, "__DRIVER_CLASS__", None)
@@ -18,9 +18,9 @@ __DRIVER_CLASS__ = "ASEDriver"
18
18
 
19
19
  ERROR_MSG = """
20
20
  This ASE driver requires specification of and ASE calculator
21
- and an ASE-readable template file that describes the chemical makeup of the structure.
21
+ and an ASE-readable template file that describes the chemical makeup of the structure.
22
22
 
23
- Example: python driver.py -m ase -u -o template.xyz,model_parameters
23
+ Example: python driver.py -m ase -u -o template.xyz,model_parameters
24
24
  """
25
25
 
26
26
 
@@ -14,7 +14,6 @@ from ipi.utils import units
14
14
  __DRIVER_NAME__ = "double_double_well"
15
15
  __DRIVER_CLASS__ = "DDW_with_explicit_bath_driver"
16
16
 
17
- # np.set_printoptions(precision=14, suppress=True,threshold='nan',linewidth=1000)
18
17
 
19
18
  invcm2au = units.unit_to_internal("frequency", "inversecm", 1.0)
20
19
  A2au = units.unit_to_internal("length", "angstrom", 1.0)
@@ -54,16 +53,16 @@ class DDW_with_explicit_bath_driver(Dummy_driver):
54
53
  self.error_msg = """\nDW+explicit_bath driver expects 11 arguments.\n
55
54
  Example: python driver.py -m DoubleWell_with_explicit_bath -o wb1 (cm^-1) V1 (cm^-1) wb2 (cm^-1) V2 (cm^-1) coupling(au) mass delta(\AA) eta0 eps1 eps2 deltaQ omega_c(cm^-1) \n
56
55
  python driver.py -m DoubleWell -o 500,2085,500,2085,0.1,1837,0.00,1,0,0,1,500\n"""
57
- self.args = args
58
- self.check_arguments()
56
+ super(DDW_with_explicit_bath_driver, self).__init__(
57
+ args, error_msg=self.error_msg
58
+ )
59
59
  self.init = False
60
60
 
61
61
  def check_arguments(self):
62
62
  """Function that checks the arguments required to run the driver"""
63
63
 
64
64
  try:
65
- arglist = self.args.split(",")
66
- param = list(map(float, arglist))
65
+ param = list(map(float, self.args))
67
66
  assert len(param) == 12
68
67
  wb1 = param[0] * invcm2au
69
68
  v1 = param[1] * invcm2au
@@ -109,8 +108,6 @@ class DDW_with_explicit_bath_driver(Dummy_driver):
109
108
  y = pos.reshape(-1, 1)[self.ndof // 2 + 1 :]
110
109
  assert self.ndof == q1.size + q2.size + x.size + y.size
111
110
 
112
- # fq1 = np.zeros(q1.shape)
113
- # fq2 = np.zeros(q2.shape)
114
111
  fx = np.zeros(x.shape)
115
112
  fy = np.zeros(x.shape)
116
113
 
@@ -15,8 +15,6 @@ __DRIVER_NAME__ = "DW"
15
15
  __DRIVER_CLASS__ = "DoubleWell_driver"
16
16
 
17
17
 
18
- # np.set_printoptions(precision=14, suppress=True,threshold='nan',linewidth=1000)
19
-
20
18
  invcm2au = units.unit_to_internal("frequency", "inversecm", 1.0)
21
19
  A2au = units.unit_to_internal("length", "angstrom", 1.0)
22
20
 
@@ -33,7 +31,7 @@ class DoubleWell_driver(Dummy_driver):
33
31
  def __init__(self, args=None, verbose=None):
34
32
  self.error_msg = """\nDW driver accepts 0 or 4 arguments.\nExample: python driver.py -m DoubleWell -o omega_b (cm^-1) V0 (cm^-1) mass(a.u) delta(angs) \n
35
33
  python driver.py -m DoubleWell -o 500,2085,1837,0.00 \n"""
36
- super(DoubleWell_driver, self).__init__(args)
34
+ super(DoubleWell_driver, self).__init__(args, error_msg=self.error_msg)
37
35
 
38
36
  def check_arguments(self):
39
37
  """Function that checks the arguments required to run the driver"""
@@ -46,8 +44,7 @@ class DoubleWell_driver(Dummy_driver):
46
44
  self.delta = 00
47
45
  else:
48
46
  try:
49
- arglist = self.args.split(",")
50
- param = list(map(float, arglist))
47
+ param = list(map(float, self.args))
51
48
  assert len(param) == 4
52
49
  w_b = param[0] * invcm2au
53
50
  v0 = param[1] * invcm2au
@@ -16,7 +16,6 @@ from ipi.utils import units
16
16
  __DRIVER_NAME__ = "DW_bath"
17
17
  __DRIVER_CLASS__ = "DoubleWell_with_explicit_bath_driver"
18
18
 
19
- # np.set_printoptions(precision=14, suppress=True,threshold='nan',linewidth=1000)
20
19
 
21
20
  invcm2au = units.unit_to_internal("frequency", "inversecm", 1.0)
22
21
  A2au = units.unit_to_internal("length", "angstrom", 1.0)
@@ -44,16 +43,17 @@ class DoubleWell_with_explicit_bath_driver(Dummy_driver):
44
43
  self.error_msg = """\nDW+explicit_bath driver expects 9 arguments.\n
45
44
  Example: python driver.py -m DoubleWell_with_explicit_bath -o omega_b (cm^-1) V0 (cm^-1) mass delta(\AA) eta0 eps1 eps2 deltaQ omega_c(cm^-1) \n
46
45
  python driver.py -m DoubleWell -o 500,2085,1837,0.00,1,0,0,1,500\n"""
47
- self.args = args
48
- self.check_arguments()
46
+ super(DoubleWell_with_explicit_bath_driver, self).__init__(
47
+ args, error_msg=self.error_msg
48
+ )
49
+
49
50
  self.init = False
50
51
 
51
52
  def check_arguments(self):
52
53
  """Function that checks the arguments required to run the driver"""
53
54
 
54
55
  try:
55
- arglist = self.args.split(",")
56
- param = list(map(float, arglist))
56
+ param = list(map(float, self.args))
57
57
  assert len(param) == 9
58
58
  w_b = param[0] * invcm2au
59
59
  v0 = param[1] * invcm2au
@@ -62,7 +62,7 @@ class DoubleWell_with_explicit_bath_driver(Dummy_driver):
62
62
 
63
63
  self.bath_parameters = {}
64
64
  self.bath_parameters["m"] = param[2]
65
- # self.bath_parameters["delta"] = param[3] * A2au
65
+
66
66
  self.bath_parameters["eta0"] = param[4]
67
67
  self.bath_parameters["eps1"] = param[5]
68
68
  self.bath_parameters["eps2"] = param[6]
@@ -15,7 +15,6 @@ import json
15
15
  __DRIVER_NAME__ = "DW_friction"
16
16
  __DRIVER_CLASS__ = "DoubleWell_with_friction_driver"
17
17
 
18
- # np.set_printoptions(precision=14, suppress=True,threshold='nan',linewidth=1000)
19
18
 
20
19
  invcm2au = units.unit_to_internal("frequency", "inversecm", 1.0)
21
20
  A2au = units.unit_to_internal("length", "angstrom", 1.0)
@@ -42,7 +41,8 @@ class DoubleWell_with_friction_driver(DoubleWell_driver):
42
41
  self.error_msg = """\nDW+fric driver expects 8 arguments.\n
43
42
  Example: python driver.py -m DoubleWell_with_fric -o omega_b (cm^-1) V0 (cm^-1) mass delta(\AA) eta0 eps1 eps2 deltaQ \n
44
43
  python driver.py -m DoubleWell -o 500,2085,1837,0.00,1,0,0,1\n"""
45
- self.args = args
44
+ self.args = args.split(",")
45
+ self.verbose = verbose
46
46
  self.check_arguments()
47
47
 
48
48
  def check_arguments(self):
@@ -50,8 +50,7 @@ class DoubleWell_with_friction_driver(DoubleWell_driver):
50
50
 
51
51
  self.k = 1837.36223469 * (3800.0 / 219323.0) ** 2
52
52
  try:
53
- arglist = self.args.split(",")
54
- param = list(map(float, arglist))
53
+ param = list(map(float, self.args))
55
54
  assert len(param) == 8
56
55
  w_b = param[0] * invcm2au
57
56
  v0 = param[1] * invcm2au