Examples¶
In this chapter we present example PLAMS scripts covering various applications, from very simple tasks (like running the same calculation for multiple molecules) to more advanced dynamic workflows.
The example scripts use computational engines from the Amsterdam Modeling Suite, and you will need a license to run them. Contact license@scm.com for further questions.
In order to run the examples, the AMSBIN
environment variable should be properly set. You can test this by typing $AMSBIN/plams -h
in a terminal: this should print PLAMS’ help message. If this is not the case (e.g. you get ‘No such file or directory’), you need to set up the environmental variable $AMSBIN
(see the Linux Quickstart guide for details).
Getting Started¶
- Geometry optimization of water
- Initial imports
- Initial structure
- Calculation settings
- Create an AMSJob
- Run the job
- Main results files: ams.rkf and dftb.rkf
- Optimized coordinates
- Optimized bond lengths and angle
- Calculation timing
- Energy
- Vibrational frequencies
- Dipole moment
- HOMO, LUMO, and HOMO-LUMO gap
- Read results directly from binary .rkf files
- Finish PLAMS
- AMS Settings: Chemical System (Molecule)
- Helium dimer dissociation curve
- Many jobs in parallel
Molecule analysis¶
- PLAMS Molecule: store/load many file formats, convert to/from ASE, RDKit, pymatgen, and more
- Worked Example
- Complete guide to storing and converting PLAMS Molecules between Python libraries and file formats
- SMILES
- .xyz files
- .cif files
- AMS .in system block format
- POSCAR/CONTCAR (VASP input format)
- ASE Atoms Python class
- RDKit Mol Python class
- SCM libbase UnifiedChemicalSystem Python class
- pymatgen Structure and Molecule Python classes
- Complete Python code
- Worked Example
- Extract frames from ams.rkf trajectory
- Table molecule counts and bond count from reactive MD ams.rkf
- Molecule substitution: Attach ligands to substrates
- Convert to ams.rkf trajectory with bond guessing
- Correlation plots for output from different AMS jobs
- Convert RKF to DCD while mapping all atoms into molecules
- Hydrogen bonds from MD
MD trajectory analysis¶
- Ionic conductivity from ams.rkf trajectory
- IR spectrum from MD
- Initial imports
- Molecule
- Engine settings
- Some general parameters
- Equilibration
- NVE production simulation
- Dipole derivative autocorrelation function
- IR spectrum
- Tapering function for autocorrelation function
- Compare to IR spectrum calculated from harmonic approximation
- View the trajectory in AMSmovie
- View the normal modes in AMSspectra
- Appendix: Average over multiple short NVE simulations
- Complete Python code
- IR spectrum H2O dimer from MD
Benchmarks¶
Workflows¶
COSMO-RS and property prediction¶
For more examples, see the COSMO-RS documentation.
Packmol and AMS-ASE interfaces¶
- Packmol example
- Initial imports
- Helper functions
- Liquid water (fluid with 1 component)
- Water-acetonitrile mixture (fluid with 2 or more components)
- Pack inside sphere
- Packing ions, total system charge
- Microsolvation
- Solid-liquid or solid-gas interfaces
- Pack inside voids in crystals
- Bonds, atom properties (force field types, regions, …)
- Complete Python code
- Engine ASE: AMS geometry optimizer with forces from any ASE calculator
- AMSCalculator: ASE geometry optimizer with AMS forces
- AMSCalculator: Access results files & Charged systems
- i-PI path integral MD with AMS
- Sella transition state search with AMS
ParAMS, Simple Active Learning, and pyZacros¶
See the respective documentation pages:
Other AMS calculations¶
Pymatgen¶
Pre-made recipes¶
The examples presented in here are simple job types built using basic PLAMS elements.
They are shipped with PLAMS in the recipes
subpackage and can be directly used in your scripts.
In other words, the code presented there is already included in PLAMS and (unlike examples from two other sections) does not need to be copied to your script.
The source code of recipes
modules is presented here to demonstrate how easy it is to build on top of existing PLAMS elements and create your own fully customized job types.
- ADF: Task COSMO-RS Compound
- Generating multiple conformers for use with COSMO-RS
- AMS Molecular Dynamics PLAMS jobs
- ADF fragment job
- Reorganization Energy
- NBO with ADF
- Numerical gradients
- Numerical Hessian
- Vibronic Density of States using the AH-FC method
- Vibronic Density of States with ADF
- Reuse force field atom types and charges