HowTo B

Neural Network Potential - Molecular Dynamics

Important Informations

Warning

Links to the Google Sheets with the assigned temperatures and carbon dioxide loadings:

Each student will be assigned two specific temperature values and a specific carbon dioxide loading for the simulations. One temperature will be used for Part B.1 and the other for Part B.2. The carbon dioxide loading will be used for the simulation in Part B.1

Important

Before you run any simulations, please make sure you know your assigned TEMPERATURES and CARBON DIOXIDE LOADING!

Tools and Programs

Tools and Programs

All tools and programs are provided by the HoferLab™. The simulaton engine that will be used is PQ. The analysis tools are written in Python and C, and are partially based on the PQAnalysis library.

The required tools and programs for this exercise are provided by executing the following command:

module load pq

Important

This command needs to be executed only once per terminal session. If you close the terminal, you will need to execute the command again when you open a new terminal.

Tools and Programs

The simulation engine PQ can be executed by running the following command:

PQ <input_file>

The analysis tools are written in an intuitive way and have a help function that can be accessed by running the script with the --help flag. For example:

<analysis_tool> --help

Analysis Tools

The following analysis tools are provided for this exercise:

Tool Description
average_a Averages the lattice parameter a of the provided box files.
average_V Averages the volume of the provided box files.
extract_h2 Extracts the hydrogen molecules of trajectory/velocity-files and calculates the center of mass coordinates/velocities.
msd Calculates the mean squared displacement of the hydrogen molecules from a trajectory. (Note: The hydrogen molecules have to be extracted first using extract_h2).
rdf Calculates the radial distribution function of the hydrogen molecule from a trajectory.
vacf Calculates the velocity autocorrelation function of the hydrogen molecule from a velocity file. (Note: The hydrogen molecules have to be extracted first using extract_h2).
linearfit Fits a linear function to the mean squared displacement data to calculate the diffusion coefficient according to the Einstein relation.
integration Integrates the velocity autocorrelation function to calculate the diffusion coefficient according to the Green-Kubo relation.

Files

The directories encoded in the ZIF_DIR variable contain all necessary files for the simulations. The files are organized in the following way:

File Structure

├── co2
│   └── co2.rst
├── general_input
│   ├── moldescriptor.dat
│   ├── run-01.in
│   ├── run-02.in
│   ├── run-03.in
│   └── run-04.in
└── preeq
    ├── 248
    │   ├── shake_zif8_248.top
    │   └── zif8_preeq_248.rst
    ├── 273
    │   ├── shake_zif8_273.top
    │   └── zif8_preeq_273.rst
    ├── 298
    │   ├── shake_zif8_298.top
    │   └── zif8_preeq_298.rst
    ├── 323
    │   ├── shake_zif8_323.top
    │   └── zif8_preeq_323.rst
    ├── 348
    │   ├── shake_zif8_348.top
    │   └── zif8_preeq_348.rst
    ├── 373
    │   ├── shake_zif8_373.top
    │   └── zif8_preeq_373.rst
    └── 398
        ├── shake_zif8_398.top
        └── zif8_preeq_398.rst

Files

The directories encoded in the ZIF_DIR variable contain all necessary files for the simulations. The files are organized in the following way:

Folder/File Description
co2 Contains the carbon dioxide restart-file (co2.rst)
general_input Contains the input files for the simulations (moldescriptor.dat and run-0?.in).
preeq Contains the pre-equilibrated restart-files (zif8_preeq_*.rst) and associated topology files (shake_zif8_*.top).

Part B.1) Gas simulation in ZIF-8

Part B.1) Gas simulation in ZIF-8

The first part of the exercise is to simulate the diffusion of carbon dioxide molecules in ZIF-8. There are a total of five different temperatures (298.15 K, 323.15 K, 348.15 K, 373.15 K, 398.15 K) and five different CO2 loadings (6, 8, 10, 12, 14). Each student is carrying out one CO2@ZIF-8 simulation at the assigned temperature with the assigned loading.

System Setup

The simulation system is set up by running the following command:

1. Copy the necessary files to the working directory

cp $ZIF_DIR/zif8_files/co2/* .
cp $ZIF_DIR/zif8_files/preeq/<TEMPERATURE>/* .
cp $ZIF_DIR/zif8_files/general_input/* .

2. Add the CO2 loading to restart files (e.g. 32 carbon dioxide molecules and 298 K)

add_molecules zif8_preeq_298.rst co2.rst --rst-mol-desc-file moldescriptor.dat -n 32 > 32xco2-zif8-00.rst

Simulation

1. Edit the input files run-01.in to run-04.in to include your assigned temperature, generated restart file, and topology file.

Important

Please make sure and double check that all input files .in are edited accordingly and no typos are present! Otherwise, PQ won’t be able to read in the input files and the simulation will stop prematurely!

...
# Temperature algorithm (velocity rescaling), Target T in K and Relaxation time in ps
      thermostat = velocity_rescaling; temp = XXX.XX; t_relaxation = 0.1;
...
# Files
      start_file    = XXX-00.rst;
      topology_file = XXX.top;

      file_prefix   = XXX-01;

Simulation

Note

Replace XXX with the assigned temperature value and the corresponding restart and topology files. The file_prefix can be any name you choose. Please make sure to use -00.rst as the start file and -01 as the file prefix in run-01.in and increment the numbers by one for each following input file. This will help to keep track of the different simulation steps.

...
# Temperature algorithm (velocity rescaling), Target T in K and Relaxation time in ps
      thermostat = velocity_rescaling; temp = XXX.XX; t_relaxation = 0.1;
...
# Files
      start_file    = XXX-00.rst;
      topology_file = XXX.top;

      file_prefix   = XXX-01;

Simulation

2. Run NVT equlibration

PQ run-01.in

Start multiple input files one after the other

PQ run-01.in && PQ run-02.in && PQ run-03.in && PQ run-04.in

Important

The overall equilibration is split into two stages. The first stage is a 10 ps NVT equilibration (run-01.in). The second stage is a 10 ps NPT equilibration (run-02.in). After the equilibration, the production run is performed for 1 ns, which is split into 2 runs of 500 ps each (run-03.in and run-04.in).

Extract Carbon Dioxide Molecules

Extract the carbon dioxide molecules from the trajectory and velocity files using the extract_co2 tool:

extract_co2 <trajectory_files>.xyz

and

extract_co2 <velocity_files>.vel

Einstein Relation

1. Calculate the mean squared displacement (MSD) of the carbon dioxide molecule using the msd tool:

msd

2. Fit a linear function to the MSD data using the linearfit tool:

linearfit --window 5

Important

For the assigned carbon dioxide loading, please insert the calculated self-diffusion coefficient value into the Google Sheet.

Green-Kubo Relation

1. Calculate the velocity autocorrelation function (VACF) of the carbon dioxide molecule using the vacf tool:

vacf

2. Integrate the VACF data using the integration tool:

integration

Important

For the assigned carbon dioxide loading, insert the calculated self-diffusion coefficient value into the Google Sheet.

Part B.2) Thermal Expansion of ZIF-8

Part B.2) Thermal Expansion of ZIF-8

The second part of the exercise is to calculate the thermal expansion of the pristine ZIF-8 framework at the assigned temperature value.

System Setup

The simulation system is set up by running the following command:

1. Copy the necessary files to the working directory

cp $ZIF_DIR/zif8_files/preeq/<TEMPERATURE>/* .
cp $ZIF_DIR/zif8_files/general_input/* .

Simulation

1. Edit the input files run-01.in to run-03.in to include your assigned temperature, generated restart file, and topology file. run-04.in is not needed for this part of the exercise.

Important

Please make sure and double check that all input files .in are edited accordingly and no typos are present! Otherwise, PQ won’t be able to read in the input files and the simulation will stop prematurely!

...
# Temperature algorithm (velocity rescaling), Target T in K and Relaxation time in ps
      thermostat = velocity_rescaling; temp = XXX.XX; t_relaxation = 0.1;
...
# Files
      start_file    = zif8_preeq_XXX.rst;
      topology_file = shake_zif8_XXX.top;

      file_prefix   = zif8-01;

Simulation

Note

Replace XXX with the assigned temperature value and the corresponding restart and topology files. The file_prefix can be any name you choose. Please make sure to use -00.rst as the start file and -01 as the file prefix in run-01.in and increment the numbers by one for each following input file. This will help to keep track of the different simulation steps.

...
# Temperature algorithm (velocity rescaling), Target T in K and Relaxation time in ps
      thermostat = velocity_rescaling; temp = XXX.XX; t_relaxation = 0.1;
...
# Files
      start_file    = zif8_preeq_XXX.rst;
      topology_file = shake_zif8_XXX.top;

      file_prefix   = zif8-01;

Simulation

2. Run NVT equlibration

PQ run-01.in

Start multiple input files one after the other

PQ run-01.in && PQ run-02.in && PQ run-03.in

Note

The overall equilibration is split into two stages. The first stage is a 10 ps NVT equilibration (run-01.in). The second stage is a 10 ps NPT equilibration (run-02.in). After the equilibration, the production run is performed for 500 ps (run-03.in). Only the trajectory from the last run run-03.in is used for the thermal expansion coefficient calculation.

Analysis

1. Average the lattice parameter a of the ZIF-8 framework using the average_a tool:

average_a zif8-03.box

2. Average the volume of the ZIF-8 framework using the average_V tool:

average_V zif8-03.box

Important

For the assigned temperature, insert the calculated average lattice parameter and average volume into the Google Sheet.

Analysis

3. Calculate the thermal expansion coefficient using the values from your group and the following formula: thermal expansion

4. Compare the calculated thermal expansion coefficient of ZIF-8 with literature values.

Note

Include the source of the reference on the poster and which method they used to obtain it. Google Scholar is your friend for this research ;)