Installation¶
Amp is python-based and is designed to integrate closely with the Atomic Simulation Environment (ASE). Because of this tight integration, Amp is compatible with every major electronic structure calculator and has ready access to all standard atomistic methods, such as structure optimization or molecular dynamics.
Amp requires:
Python 3.10+
A Fortran compiler (gfortran is recommended)
ASE
NumPy + SciPy
Certain advanced modules may have additional dependencies that will be noted when they are used; for example, matplotlib for the plotting modules.
Amp uses meson-python as its build system. There are three typical installation scenarios described below.
After you install, you should run the tests.
The [test] extra in the commands below installs the packages needed to
run the test suite; you can leave it off if you do not plan to run the tests.
Install directly from the repository¶
To install the latest development version directly from Bitbucket:
pip install "amp-atomistics[test] @ git+https://bitbucket.org/andrewpeterson/amp.git"
Install from a local clone¶
If you prefer to clone the repository:
git clone https://bitbucket.org/andrewpeterson/amp.git
cd amp
pip install "./amp[test]"
Editable (development) install¶
For an editable install where changes to the source are immediately reflected without reinstalling, the build dependencies must be installed first because meson-python requires --no-build-isolation:
pip install meson-python ninja numpy
pip install --no-build-isolation --editable "./amp[test]"
Run the tests¶
We include tests in the package to ensure that it still runs as intended as we continue development.
It is a good idea to run the tests after installing to verify that your installation is working.
The tests are in the tests folder and are designed to run with pytest:
pytest tests/
Note: Grand-canonical learning and ASE trajectories¶
If you plan to use the electronically grand-canonical learning scheme (for electrochemical simulations), Amp expects that 'electrode_potential' and 'excess_electrons' both appear as keys in the results dictionary produced by ASE (calc.results).
If you are using the solvated jellium method (SJM) of GPAW, these are placed there automatically upon potential equilibration.
However, ASE strips them out as it only expects certain pre-defined keywords to appear in the results.
You have two options:
You can manually patch your version of ASE by adding the two entries
'electrode_potential'and'excess_electrons'to theall_propertieslist inase/calculators/calculator.py.We maintain a patch that removes all restrictions on
calc.results. Install it after you install ASE:pip install git+https://gitlab.com/andrew_peterson/ase-patch.git
Note: this change must be in place both when running SJM and when running Amp, so that both writing and reading of calc.results occur properly.