Skip to content

Commit

Permalink
Merge pull request #3 from chemle/feature_sire
Browse files Browse the repository at this point in the history
Add Sire environment file and OpenMM integration documentation
  • Loading branch information
lohedges authored Jan 11, 2024
2 parents 467ce9d + 4d4a239 commit aaee9a2
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include mlmm/*.mat
include emle/*.mat
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,30 @@ similar to that shown below. The columns specify the current step, the current
50 1.000000000000 -495.725952148438 -0.020683377981 -495.725952148438
```

## OpenMM integration

We provide an interface between `emle-engine` and [OpenMM](https://openmm.org) via the
[Sire](https://sire.openbiosim.org/) molecular simulation framework. This allows QM/MM simulations
to be run with OpenMM using EMLE for the embedding model. This provides improved
performance and flexibility in comparison to the `sander` interface, although
the implementation should currently be treated as being _experimental_.

To use, first create an `emle-sire` conda environment:

```sh
conda env create -f environment_sire.yaml
conda activate emle-sire
```

Next install `emle-engine` into the environment:

```sh
python setup.py install
```

For instructions on how to use the `emle-sire` interface, see the tutorial
documentation [here](https://github.com/OpenBioSim/sire/blob/feature_emle/doc/source/tutorial/part07/01_qmmm.rst).

## Issues

The [DeePMD-kit](https://docs.deepmodeling.com/projects/deepmd/en/master/index.html) conda package pulls in a version of MPI which may cause
Expand Down
8 changes: 4 additions & 4 deletions bin/emle-server
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,11 @@ except:
# Import the EMLE calculator here so that we avoid the import overhead when the
# script is called to check if an existing server is running, e.g. when called
# as a background process by the orca executable.
from emle.emle import EMLECalculator
from emle.calculator import EMLECalculator

# Initialise the EMLE calculator.
print("Initialising EMLE calculator...")
mle_calculator = EMLECalculator(**args)
emle_calculator = EMLECalculator(**args)

while True:
print("Waiting for a connection...")
Expand All @@ -535,7 +535,7 @@ while True:
# Try to run the EMLE calculation.
print("Running EMLE calculation...")
try:
mle_calculator.run(path=path)
emle_calculator.run(path=path)
msg = "7:emlefin"
print("Finished!")
except Exception as e:
Expand All @@ -549,7 +549,7 @@ while True:
# Try to update the interpolation lambda parameter.
print("Updating interpolation lambda...")
try:
mle_calculator.set_lambda_interpolate(float(path))
emle_calculator.set_lambda_interpolate(float(path))
msg = "13:emlelambdaset"
print("Lambda set!")
except Exception as e:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion emle/sander_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def calculate(
# Update the positions.
sander.set_positions(positions)

from .emle import KCAL_MOL_TO_HARTREE, BOHR_TO_ANGSTROM
from .calculator import KCAL_MOL_TO_HARTREE, BOHR_TO_ANGSTROM

# Compute the energy and forces.
energy, forces = sander.energy_forces()
Expand Down
22 changes: 22 additions & 0 deletions environment_sire.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: emle-sire

channels:
- conda-forge
- openbiosim/label/emle

dependencies:
- ambertools
- ase
- compilers
- deepmd-kit
- eigen
- openmm >= 8.1
- pip
- pybind11
- pytorch
- python < 3.11
- sire
- torchani
- xtb-python
- pip:
- git+https://github.com/lab-cosmo/librascal.git

0 comments on commit aaee9a2

Please sign in to comment.