| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
SOMD is an ab-initio molecular dynamics (AIMD) package designed for the SIESTA DFT code. The SOMD code provides some common functionalities to perform standard Born-Oppenheimer molecular dynamics (BOMD) simulations, and contains a simple wrapper to the Neuroevolution Potential (NEP) package. The SOMD code may be used to automatically build NEPs by the mean of the active-learning methodology.
The SOMD code is designed to be maintained by one person, thus many important functionalities may be absent. Besides, the code should be considered EXPERIMENTAL since it has not been extensively tested. So if you would like to perform production runs with SOMD, please take your own risk.
SOMD only runs on GNU/Linux distros. The installation requires a working g++ compiler (with C++11 supports), a Python3 interpreter and four additional Python3 libraries (cython, h5py, mdtraj and toml). You could install SOMD by the following steps.
conda config --add channels conda-forge
conda install cython h5py mdtraj toml -c conda-forgepip install cython h5py mdtraj tomlgit clone https://www.github.com/initqp/somd
cd somd
git submodule update --initpython setup.py installpip install .>>> import somd
>>> print(somd.__version__)somd -vconda install dftd3-python dftd4-python tblite-python py-plumed -c conda-forgepip install dftd3 dftd4 plumedFirst, install the pytest package with:
conda install pytest -c conda-forgeor
pip install pytestThen, enter the somd/tests directory and invoke this command (you need to change the SIESTA_COMMAND variable to the actual path of your siesta binary):
SIESTA_COMMAND='/path/to/siesta' py.testSOMD has a naive command line interface, which reads the TOML format configure file. A typical input file looks like this (which defines a NVT run of a water molecule):
[system]
structure = "H2O.POSCAR"
[[group]]
atom_list = "all"
initial_temperature = 300.0
[[potential]]
type = "SIESTA"
siesta_options = """
xc.functional GGA
xc.authors PBE
PAO.BasisSize DZP
Mesh.Cutoff 300 Ry
"""
siesta_command = "mpirun -np 4 /path/to/siesta"
[[trajectory]]
format = "H5"
file_name = "traj.h5"
interval = 10
[[logger]]
format = "CSV"
file_name = "data.csv"
interval = 10
[integrator]
type = "BAOAB"
timestep = 0.0005
temperatures = 300.0
relaxation_times = 0.1
[run]
n_steps = 500Based on this file (e.g., it is called input.toml), you could run your simulation via the following command:
somd -i input.tomlYou may also invoke SOMD as a library and implement your own simulation protocols. For example, the above configure file equals to the following python script:
import somd
siesta_command = 'mpirun -np 4 /path/to/siesta'
siesta_options = r"""
xc.functional GGA
xc.authors PBE
PAO.BasisSize DZP
Mesh.Cutoff 300 Ry
"""
system = somd.core.systems.create_system_from_poscar('H2O.POSCAR')
g = {
'atom_list': list(range(0, system.n_atoms)),
'has_translations': False
}
system.groups.create_from_dict(g)
system.groups[0].add_velocities_from_temperature(300)
potential = somd.potentials.SIESTA(
range(0, system.n_atoms),
system,
siesta_options,
siesta_command
)
system.potentials.append(potential)
integrator = somd.core.integrators.baoab_integrator(
0.0005,
temperatures=[300],
relaxation_times=[0.1],
thermo_groups=[0]
)
trajectory = somd.apps.trajectories.H5WRITER(
'traj.h5',
write_forces=False,
interval=10
)
logger = somd.apps.loggers.DEFAULTCSVLOGGER('data.csv', interval=10)
simulation = somd.apps.simulations.SIMULATION(
system=system,
integrator=integrator,
trajectories=[trajectory],
loggers=[logger]
)
simulation.run(500)Based on this script (e.g., it is called input.py), you could run your simulation via the following command:
python input.pyA problem-oriented documentation could be found here.
Tutorials of SOMD could be found here. Going through these tutorials is considered as an efficient way to get familiar with SOMD.
Q: How to cite the code?
A: You don't. It's a toy.
| Back | FazBrowse Home | New Git URL |