-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functionalities to incorporate rotational averaging in i-PI (i-pi#372)
* Added functions to manipulate rotations * Added some utilities for rotational averaging * GenericCell object handling non-triangular cells This in no way allows using generic cells in i-PI, but allows us to handle arbitrary rotations from the forcefield to the socket * Added an example, and options, to use lebedev grids in o3-averaging * Implement defining and storing a separate PRNG for the random rotations * smaller box size for geop examples these make the tests run much faster
- Loading branch information
Showing
51 changed files
with
979 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
O3 rotational averaging. | ||
======================== | ||
|
||
Examples of the averaging module to handle non-equivariant potentials. | ||
The `<ffrotations>` socket allows to evaluate a potential multiple times, | ||
using random rotations or a grid of rotations, to reduce the impact of the | ||
lack of rotational equivariance on the quality of the dynamics. | ||
The examples use the `noo3_h2o` potential, that assumes the structure is | ||
a sequence of H2O molecules and adds a orientation-dependent potential to each | ||
water molecule. | ||
|
||
|
||
`noo3`: no correction is applied. The structure of the liquid will be badly | ||
disrupted. | ||
`random`: the structure is randomly oriented at each evaluation. | ||
This effectively introduces a noise in the forces, that must be contrasted | ||
by an aggressive thermostat. There is a large drift in the conserved quantity | ||
but the mean potential is OK and water molecules do not orient artificially | ||
`grid`: the potential is averaged over a grid of rotations. | ||
This reduces the orientational error, but comes at the cost of many additional | ||
energy evaluations per step. |
42 changes: 42 additions & 0 deletions
42
examples/features/o3_averaging/direct_liquid_water/input.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<simulation verbosity='medium'> | ||
<output prefix='simulation'> | ||
<properties stride='1' filename='out'> [ step, time{picosecond}, conserved{electronvolt}, temperature{kelvin}, kinetic_md{electronvolt}, potential{electronvolt}, pressure_md{megapascal}, stress_md{megapascal} ] </properties> | ||
<trajectory filename='noo3_pots' stride='2' cell_units='angstrom' extra_type="o3grid_pots"> extras_component_raw(1) </trajectory> | ||
<trajectory filename='pos' stride='20' cell_units='angstrom'> positions{angstrom} </trajectory> | ||
<checkpoint stride='200'/> | ||
</output> | ||
<total_steps>1000</total_steps> | ||
<prng> | ||
<seed>31415</seed> | ||
</prng> | ||
<ffsocket name='driver-qtip4pf' mode='unix' pbc='false'> | ||
<address>h2o-base</address> | ||
</ffsocket> | ||
<ffrotations name='driver-noo3' pbc='false'> | ||
<ffdirect name='base-noo3'> | ||
<pes> dummy </pes> <!-- This is just a dummy ff --> | ||
</ffdirect> | ||
<random> True </random> | ||
</ffrotations> | ||
<system> | ||
<initialize nbeads='1'> | ||
<file mode='xyz'> water_216.xyz </file> | ||
<velocities mode='thermal' units='kelvin'> 300 </velocities> | ||
</initialize> | ||
<forces> | ||
<force forcefield='driver-qtip4pf'/> | ||
<force forcefield='driver-noo3' weight="1"/> | ||
</forces> | ||
<motion mode='dynamics'> | ||
<dynamics mode='nvt'> | ||
<timestep units='femtosecond'> 0.5 </timestep> | ||
<thermostat mode='langevin'> | ||
<tau units='femtosecond'> 10 </tau> | ||
</thermostat> | ||
</dynamics> | ||
</motion> | ||
<ensemble> | ||
<temperature units='kelvin'> 300 </temperature> | ||
</ensemble> | ||
</system> | ||
</simulation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ipi=i-pi | ||
driver1="i-pi-driver -m qtip4pf -u -a h2o-base" | ||
sleep_time=4 | ||
|
||
${ipi} input.xml > log.i-pi & | ||
echo "# i-PI is running" | ||
|
||
echo "# Waiting for ${sleep_time} (s) before executing driver" | ||
sleep ${sleep_time} | ||
|
||
${driver1} > /dev/null & | ||
echo "# Driver is running" | ||
|
||
wait | ||
|
||
echo "# Simulation complete" |
3 changes: 3 additions & 0 deletions
3
examples/features/o3_averaging/direct_liquid_water/test_settings.dat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#Settings file for automatic test | ||
driver_model qtip4pf | ||
nsteps 10 |
1 change: 1 addition & 0 deletions
1
examples/features/o3_averaging/direct_liquid_water/water_216.xyz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../init_files/water_216.xyz |
44 changes: 44 additions & 0 deletions
44
examples/features/o3_averaging/grid_liquid_water/input.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<simulation verbosity='medium'> | ||
<output prefix='simulation'> | ||
<properties stride='1' filename='out'> [ step, time{picosecond}, conserved{electronvolt}, temperature{kelvin}, kinetic_md{electronvolt}, potential{electronvolt}, pressure_md{megapascal}, stress_md{megapascal} ] </properties> | ||
<trajectory filename='noo3_pots' stride='2' cell_units='angstrom' extra_type="o3grid_pots"> extras_component_raw(1) </trajectory> | ||
<trajectory filename='pos' stride='20' cell_units='angstrom'> positions{angstrom} </trajectory> | ||
<checkpoint stride='200'/> | ||
</output> | ||
<total_steps>1000</total_steps> | ||
<prng> | ||
<seed>31415</seed> | ||
</prng> | ||
<ffsocket name='driver-qtip4pf' mode='unix' pbc='false'> | ||
<address>h2o-base</address> | ||
</ffsocket> | ||
<ffrotations name='driver-noo3' pbc='false'> | ||
<ffsocket name='base-noo3' mode='unix' pbc='false'> | ||
<address>h2o-noo3</address> | ||
</ffsocket> | ||
<grid_order> 2 </grid_order> | ||
<grid_mode> legendre </grid_mode> | ||
<inversion> True </inversion> | ||
</ffrotations> | ||
<system> | ||
<initialize nbeads='1'> | ||
<file mode='xyz'> water_216.xyz </file> | ||
<velocities mode='thermal' units='kelvin'> 300 </velocities> | ||
</initialize> | ||
<forces> | ||
<force forcefield='driver-qtip4pf'/> | ||
<force forcefield='driver-noo3' weight="1.0"/> | ||
</forces> | ||
<motion mode='dynamics'> | ||
<dynamics mode='nvt'> | ||
<timestep units='femtosecond'> 0.5 </timestep> | ||
<thermostat mode='langevin'> | ||
<tau units='femtosecond'> 100 </tau> | ||
</thermostat> | ||
</dynamics> | ||
</motion> | ||
<ensemble> | ||
<temperature units='kelvin'> 300 </temperature> | ||
</ensemble> | ||
</system> | ||
</simulation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ipi=i-pi | ||
driver1="i-pi-driver -m noo3-h2o -u -a h2o-noo3" | ||
driver2="i-pi-driver -m qtip4pf -u -a h2o-base" | ||
sleep_time=4 | ||
|
||
${ipi} input.xml > log.i-pi & | ||
echo "# i-PI is running" | ||
|
||
echo "# Waiting for ${sleep_time} (s) before executing driver" | ||
sleep ${sleep_time} | ||
|
||
${driver1} > /dev/null & | ||
${driver2} > /dev/null & | ||
echo "# Driver is running" | ||
|
||
wait | ||
|
||
echo "# Simulation complete" |
4 changes: 4 additions & 0 deletions
4
examples/features/o3_averaging/grid_liquid_water/test_settings.dat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#Settings file for automatic test | ||
driver_model qtip4pf | ||
driver_model2 noo3-h2o | ||
nsteps 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../init_files/water_216.xyz |
43 changes: 43 additions & 0 deletions
43
examples/features/o3_averaging/lebedev_liquid_water/input.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<simulation verbosity='high'> | ||
<output prefix='simulation'> | ||
<properties stride='1' filename='out'> [ step, time{picosecond}, conserved{electronvolt}, temperature{kelvin}, kinetic_md{electronvolt}, potential{electronvolt}, pressure_md{megapascal}, stress_md{megapascal} ] </properties> | ||
<trajectory filename='noo3_pots' stride='2' cell_units='angstrom' extra_type="o3grid_pots"> extras_component_raw(1) </trajectory> | ||
<trajectory filename='pos' stride='20' cell_units='angstrom'> positions{angstrom} </trajectory> | ||
<checkpoint stride='200'/> | ||
</output> | ||
<total_steps>1000</total_steps> | ||
<prng> | ||
<seed>31415</seed> | ||
</prng> | ||
<ffsocket name='driver-qtip4pf' mode='unix' pbc='false'> | ||
<address>h2o-base</address> | ||
</ffsocket> | ||
<ffrotations name='driver-noo3' pbc='false'> | ||
<ffsocket name='base-noo3' mode='unix' pbc='false'> | ||
<address>h2o-noo3</address> | ||
</ffsocket> | ||
<grid_order> 3 </grid_order> <grid_mode> lebedev </grid_mode> | ||
<inversion> True </inversion> | ||
</ffrotations> | ||
<system> | ||
<initialize nbeads='1'> | ||
<file mode='xyz'> water_216.xyz </file> | ||
<velocities mode='thermal' units='kelvin'> 300 </velocities> | ||
</initialize> | ||
<forces> | ||
<force forcefield='driver-qtip4pf'/> | ||
<force forcefield='driver-noo3' weight="1.0"/> | ||
</forces> | ||
<motion mode='dynamics'> | ||
<dynamics mode='nvt'> | ||
<timestep units='femtosecond'> 0.5 </timestep> | ||
<thermostat mode='langevin'> | ||
<tau units='femtosecond'> 100 </tau> | ||
</thermostat> | ||
</dynamics> | ||
</motion> | ||
<ensemble> | ||
<temperature units='kelvin'> 300 </temperature> | ||
</ensemble> | ||
</system> | ||
</simulation> |
18 changes: 18 additions & 0 deletions
18
examples/features/o3_averaging/lebedev_liquid_water/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ipi=i-pi | ||
driver1="i-pi-driver -m noo3-h2o -u -a h2o-noo3" | ||
driver2="i-pi-driver -m qtip4pf -u -a h2o-base" | ||
sleep_time=4 | ||
|
||
${ipi} input.xml > log.i-pi & | ||
echo "# i-PI is running" | ||
|
||
echo "# Waiting for ${sleep_time} (s) before executing driver" | ||
sleep ${sleep_time} | ||
|
||
${driver1} > /dev/null & | ||
${driver2} > /dev/null & | ||
echo "# Driver is running" | ||
|
||
wait | ||
|
||
echo "# Simulation complete" |
4 changes: 4 additions & 0 deletions
4
examples/features/o3_averaging/lebedev_liquid_water/test_settings.dat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#Settings file for automatic test | ||
driver_model qtip4pf | ||
driver_model2 noo3-h2o | ||
nsteps 10 |
1 change: 1 addition & 0 deletions
1
examples/features/o3_averaging/lebedev_liquid_water/water_216.xyz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../init_files/water_216.xyz |
Oops, something went wrong.