Bohrium
robot
新建

空间站广场

论文
Notebooks
比赛
课程
Apps
我的主页
我的Notebooks
我的论文库
我的足迹

我的工作空间

任务
节点
文件
数据集
镜像
项目
数据库
公开
Hands-on PIMD | a quick guide on how to study nuclear quantum effects
PIMD
DeePMD
H2O
LAMMPS
English
PIMDDeePMDH2OLAMMPSEnglish
Yifan Li
发布于 2023-07-30
推荐镜像 :lammps:20230615-dp2.2.2-notebook
推荐机型 :c2_m4_cpu
赞 10
4
32
Hands-on PIMD | a quick guide on how to study nuclear quantum effects
Contents
0. Overview
1. Preparing A Model
2. Running PIMD
3. Analyzing The Trajectory
3.0 Read The Trajectory
3.1 Radial Distribution Function (RDF)
3.2 Proton Transfer Coordinate And Hydrogen Bond Angle
4. Exercises
4.0 Convergence of number of beads
4.1 Densities of water and ice
4.2 RDFs and hydrogen bonding of ice

Hands-on PIMD | a quick guide on how to study nuclear quantum effects

©️ Copyright 2023 @ Authors
Author: 李一帆 Yifan Li 📨
Date: 2023-07-10
Sharing Protocol: This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
📖 Getting Started Guide
This document can be executed directly on the Bohrium Notebook. To begin, click the Connect button located at the top of the interface, then select the lammps:20230615-dp2.2.2-notebook image and choose your desired machine configuration to proceed.

代码
文本

Picture1.jpeg

代码
文本

0. Overview

In classical molecular dynamics (MD), atomic nuclei are treated as classical particles and described with Newton's equations of motion. This treatment works for most cases, but ignores the fact atomic nuclei are quantum particles. Quantum behaviors include tunneling and zero point energy. For light atomic nuclei (for example, Hydrogen or Lithium), the quantum nature of atomic nuclei have profound effects on the structure, thermodynamics, and dynamics of a system and cannot be neglected. A typical example of nuclear quantum effect (NQE) is the free energy difference between different stable isotopes, which cannot be captured by classical MD.

Path integral molecular dynamics (PIMD) is a powerful technique to study NQEs. You do not need to know how it is derived from Feynman's path integral. In this notebook we will use water as an example to learn how to run PIMD, because water includes hydrogen atom, and there is a strong NQE in water from the competition between the stretching of OH bond and libration of water molecule.

代码
文本

h2o.png

代码
文本

You only need to keep in mind the following features of PIMD :

  1. It captures the quantum effects by mapping a quantum system onto a classical ring-polymer system, which is composed of multiple replicas (also called "beads") of the simulated system. Each beads is an image of the system.

  2. Theoretically, one needs infinite beads to simulate a quantum system. Finite number of beads will lead to truncation error. In practice, one should use a large enough number of beads based convergence test.

  3. Two types of interactions are considered in PIMD: inter-bead interactions and intra-bead interactions.

  • Inter-bead interactions are the spring elastic energies among different beads of the same atom;
  • Intra-bead interactions are the physical interactions of each image of the system.

The potential energy surface of PIMD is

where is the number of beads, is the atomic mass, , , is the atomic coordinates for the th bead.

  1. Different beads are simulated in parallel using the intra-bead interactions (can be calculated with empirical FF, DFT, MLFF, etc). In each step, the inter-bead interactions are considered by performing inter-bead communications.

The aim of this notebook to to teach students how to do PIMD simulations with the Deep Potential model using LAMMPS and DeePMD-kit.

A typical workflow of doing PIMD is:

代码
文本

workflow.png

代码
文本
[7]
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from mpl_toolkits.axes_grid1.inset_locator import inset_axes, InsetPosition, mark_inset
from matplotlib.colors import LogNorm
colors = ["blue", "red", "black", "purple", "seagreen", "orange", "cyan", "olive"]
代码
文本
[5]
%%bash
if [ -d "/data/PIMD_Tutorial" ]; then
git config --global --add safe.directory /data/PIMD_Tutorial
cd /data/PIMD_Tutorial
git pull
cd ..
else
cd /data
git clone https://github.com/Yi-FanLi/PIMD_Tutorial.git
fi
Already up to date.
代码
文本

1. Preparing A Model

To run PIMD, the first step is to construct a DP model (if you want to run PIMD with Deep Potential). It is typical that before running PIMD, one has already had a model for running classical MD. However, different configurations might be encountered in PIMD. The training set sampled from classical MD might not be enough for PIMD. We demonstrate this on a test set with 100 configurations.

代码
文本
[8]
f_qe = np.loadtxt("/data/PIMD_Tutorial/testset/force_DFT_CL.txt")
f_qe_pi = np.loadtxt("/data/PIMD_Tutorial/testset/force_DFT_PI.txt")
代码
文本
[9]
f_dp0 = np.loadtxt("/data/PIMD_Tutorial/testset/force_infer_modelCL.txt")
f_dp0_pi = np.loadtxt("/data/PIMD_Tutorial/testset/force_infer_modelPI.txt")
代码
文本
[11]
plt.figure(figsize=(8, 8))
plt.xticks(fontsize=16)
plt.yticks(fontsize=16)

plt.xlabel("$F_{\mathrm{DFT}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.ylabel("$F_{\mathrm{DP}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.scatter(f_qe.flatten(), f_dp0.flatten(), color=colors[0], label="classical")
plt.legend(fontsize=16)
plt.show()
代码
文本
[12]
plt.figure(figsize=(8, 8))
plt.xticks(fontsize=16)
plt.yticks(fontsize=16)

plt.xlabel("$F_{\mathrm{DFT}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.ylabel("$F_{\mathrm{DP}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.scatter(f_qe_pi.flatten(), f_dp0_pi.flatten(), color=colors[0], label="path integral")
plt.legend(fontsize=16)
plt.show()
代码
文本
[13]
(((f_qe-f_dp0)**2).mean())**0.5
0.0976920424528473
代码
文本
[14]
(((f_qe_pi-f_dp0_pi)**2).mean())**0.5
0.12340050129000131
代码
文本

It is obvious from the figures that the accuracy of this model is not satisfactory for the path integral test set. More precisely, the RMSE of classical test set is 0.098 eV / $\unicode[serif]{xC5}$, while the RMSE of path integral test set is 0.12 eV / $\unicode[serif]{xC5}$. Thus, the model is further refined by using the active learning procedure driven by PIMD. We omit the active learning procedure in this notebook, and only present the accuracy of the final refined model.

代码
文本

The refined model for the use in the next steps is:

代码
文本
[10]
!ls /data/PIMD_Tutorial/model
graph1.pb
代码
文本

We now predict forces with this model on the test set, and take a look at the prediction errors:

代码
文本
[4]
import sys
sys.path.insert(0,"/opt/deepmd-kit-2.2.2/lib/python3.10/site-packages/")
import numpy as np
from deepmd.infer import DeepPot
dp = DeepPot("/data/PIMD_Tutorial/model/graph1.pb")
x_dp = np.loadtxt("/data/PIMD_Tutorial/testset/x_testset_CL.txt").reshape([101, -1])
x_dp_pi = np.loadtxt("/data/PIMD_Tutorial/testset/x_testset_PI.txt")
box_dp = np.loadtxt("/data/PIMD_Tutorial/testset/prd_testset_CL.txt")
cell_dp_ = np.array([np.diag(box_dp[i]) for i in range(101)]).reshape([101, -1])

box_dp_pi = np.loadtxt("/data/PIMD_Tutorial/testset/prd_testset_PI.txt")
cell_dp_pi_ = np.array([np.diag(box_dp_pi[i]) for i in range(101*32)]).reshape([101*32, -1])

type_dp = (np.loadtxt("/data/PIMD_Tutorial/testset/type_testset.txt")-1).astype(int)
type_dp_ = np.array([type_dp for i in range(101)])
#print(x_dp[0].reshape([1, -1]).shape)
#print(cell_dp_[0].reshape([1, -1]).shape)
#print(type_dp.reshape([-1, 1]).shape)
x = x_dp[0].reshape([1, -1])
b = cell_dp_[0].reshape([1, -1])
t = type_dp.tolist()
e, f, v = dp.eval(x_dp, cell_dp_, t)
f_pi = np.zeros([32*101, 192, 3])
for i in range(32):
e_pi, f_pi[i*101:(i+1)*101], v_pi = dp.eval(x_dp_pi[i*101:(i+1)*101], cell_dp_pi_[i*101:(i+1)*101], t)
np.save("f_dp.npy", f)
np.save("f_dp_pi.npy", f_pi)
/opt/deepmd-kit-2.2.2/lib/python3.10/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.2
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
WARNING:tensorflow:From /opt/deepmd-kit-2.2.2/lib/python3.10/site-packages/tensorflow/python/compat/v2_compat.py:107: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
WARNING:root:To get the best performance, it is recommended to adjust the number of threads by setting the environment variables OMP_NUM_THREADS, TF_INTRA_OP_PARALLELISM_THREADS, and TF_INTER_OP_PARALLELISM_THREADS. See https://deepmd.rtfd.io/parallelism/ for more information.
2023-08-09 15:37:53.369915: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-09 15:37:53.700147: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:53.921584: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:53.921847: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.144041: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.144346: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.144558: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.144751: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 31010 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-09 15:37:56.149266: I tensorflow/core/common_runtime/process_util.cc:146] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
2023-08-09 15:37:56.301776: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:354] MLIR V1 optimization pass is not enabled
WARNING:tensorflow:From /opt/deepmd-kit-2.2.2/lib/python3.10/site-packages/deepmd/utils/batch_size.py:61: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
WARNING:tensorflow:From /opt/deepmd-kit-2.2.2/lib/python3.10/site-packages/deepmd/utils/batch_size.py:61: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2023-08-09 15:37:56.399428: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.399782: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.399988: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.400249: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.400437: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:975] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2023-08-09 15:37:56.400594: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /device:GPU:0 with 31010 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
代码
文本
[5]
f_dp = np.load("f_dp.npy")
f_dp_pi = np.load("f_dp_pi.npy")
代码
文本
[16]
plt.figure(figsize=(8, 8))
plt.xticks(fontsize=16)
plt.yticks(fontsize=16)

plt.xlabel("$F_{\mathrm{DFT}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.ylabel("$F_{\mathrm{DP}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.scatter(f_qe.flatten(), f_dp.flatten(), color=colors[0], label="classical")
plt.legend(fontsize=16)
plt.show()
代码
文本
[17]
plt.figure(figsize=(8, 8))
plt.xticks(fontsize=16)
plt.yticks(fontsize=16)

plt.xlabel("$F_{\mathrm{DFT}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.ylabel("$F_{\mathrm{DP}}$ / eV$\cdot\mathrm{\AA}^{-1}$", fontsize=16)
plt.scatter(f_qe_pi.flatten(), (f_dp_pi.reshape(32, 101, -1)[:, 1:]).flatten(), color=colors[0], label="path integral")
plt.legend(fontsize=16)
plt.show()
代码
文本
[18]
(((f_qe-f_dp.reshape(101, -1))**2).mean())**0.5
0.08910775984354499
代码
文本
[19]
(((f_qe_pi-f_dp_pi.reshape(32, 101, -1)[:, 1:].reshape(3200, -1))**2).mean())**0.5
0.09761331679461156
代码
文本

We can tell from the figure that the prediction accuracy is now satisfactory. Also, the RMSE is lowered to 0.089 and 0.098 for classical and path integral test sets, respectively. This model should now be ready to use.

代码
文本

2. Running PIMD

代码
文本

In this session we run classical MD and PIMD with LAMMPS. The classical MD is run with LAMMPS's fix npt command, while PIMD is run with LAMMPS's fix pimd/langevin command. fix npt uses the Nose-Hoover chain thermostat and barostat, while fix pimd/langevin uses the white-noise Langevin thermostat and Bussi-Zykova-Parrinello barostat. The simulations should be quite robust to the choice of thermostats and barostats.

Here we only introduce how to run PIMD with LAMMPS. For a detailed introduction to Molecular Dynamics with the Deep Potential model, you may refer to this notebook Ultra-detailed "Deep Potential Energy" Materials Computation Getting Started Guide | Chapter 1 .

代码
文本

Let's take a look at PIMD's LAMMPS input script:

代码
文本
[11]
%%bash
cd /data/PIMD_Tutorial/run/ice/4beads
cat -n in.lammps
     1	variable        ibead           uloop 99 pad
     2	# bulk water
     3	units           metal
     4	boundary        p p p
     5	atom_style      atomic
     6	atom_modify     map yes
     7	
     8	#neighbor        2.0 bin
     9	neigh_modify    every 10 delay 0 check no
    10	
    11	read_data ../iceInit/conf222
    12	
    13	mass 		1 15.9994
    14	mass		2 1.00794
    15	
    16	pair_style deepmd ../../../model/graph1.pb 
    17	pair_coeff      * *	
    18	
    19	
    20	fix 1 all pimd/langevin fmmode physical ensemble npt integrator obabo thermostat PILE_L 975481 temp 300.0 tau 1.0 scale 1.0 barostat BZP aniso 1.0 taup 1.0
    21	
    22	dump            1 all custom 200 ${ibead}.xyz id type x y z
    23	dump_modify     1 append yes sort id
    24	
    25	timestep        0.0005
    26	thermo_style    custom step temp f_1[1*4] vol
    27	thermo          100
    28	thermo_modify format line "%d %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e"
    29	
    30	run 2000
代码
文本

There are three major differences between this script and the input of classical MD:

  1. Line 1: This line defines a variable for bead id. 99 can be used for up to 99 beads (01, 02, ..., 99). If you want to use more beads (for example, 128), change 99 to 999.
  2. Line 20: This line is the major line of defining parameters of the PIMD task. From this line, we know that we are running PIMD in the npt ensemble at 300 K and 1 bar, using 1 ps as the damping time for both the thermostat and the barostat. For a more detailed explanation, refer to the document of LAMMPS: fix pimd/langevin.
  3. Line 26: This line specifies the output of thermodynamic quantities, which may include quantum estimators from PIMD. For details, refer to the document: fix pimd/langevin.
代码
文本

classical MD for ice:

代码
文本
[12]
%%bash
cd /data/PIMD_Tutorial/run/ice/classical
lmp -in in.lammps
LAMMPS (15 Jun 2023)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
  using 1 OpenMP thread(s) per MPI task
Open of file /opt/deepmd-kit-2.2.2/lib/deepmd_lmp/dpplugin.so failed: /opt/deepmd-kit-2.2.2/lib/deepmd_lmp/dpplugin.so: undefined symbol: _ZTIN9LAMMPS_NS7ComputeE
Loaded 0 plugins from /opt/deepmd-kit-2.2.2/lib/deepmd_lmp
Reading data file ...
  orthogonal box = (0 0 0) to (15.645678 14.707145 18.073037)
  1 by 1 by 1 MPI processor grid
  reading atoms ...
  384 atoms
  read_data CPU = 0.009 seconds
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
Summary of lammps deepmd module ...
  >>> Info of deepmd-kit:
  installed to:       /root/deepmd-kit/dp_c
  source:             
  source branch:       
  source commit:      
  source commit at:   
  surpport model ver.:1.1 
  build variant:      cuda
  build with tf inc:  /usr/local/lib/python3.11/dist-packages/tensorflow/include;/usr/local/lib/python3.11/dist-packages/tensorflow/include
  build with tf lib:  /usr/local/lib/python3.11/dist-packages/tensorflow/libtensorflow_cc.so.2
  set tf intra_op_parallelism_threads: 0
  set tf inter_op_parallelism_threads: 0
  >>> Info of lammps module:
  use deepmd-kit at:  /opt/deepmd-kit-2.2.2
  source:             v2.2.2-75-g4fa54ec6
  source branch:      devel
  source commit:      4fa54ec6
  source commit at:   2023-07-26 09:23:40 +0800
  build float prec:   double
  build with tf inc:  /opt/deepmd-kit-2.2.2/include
  build with tf lib:  
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
2023-08-09 15:59:56.101755: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-09 15:59:56.658797: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.659364: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.659846: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.660304: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.844385: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.844934: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.845407: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.845858: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.846309: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.846749: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.847192: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 15:59:56.847628: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.712088: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.712649: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.713150: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.713622: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.716787: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.717289: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.717754: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.718209: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.718660: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.719168: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 14544 MB memory:  -> device: 0, name: Tesla V100-SXM2-16GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-09 16:00:00.721712: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.722254: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:1 with 14544 MB memory:  -> device: 1, name: Tesla V100-SXM2-16GB, pci bus id: 0000:00:0a.0, compute capability: 7.0
2023-08-09 16:00:00.722576: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.723035: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:2 with 14544 MB memory:  -> device: 2, name: Tesla V100-SXM2-16GB, pci bus id: 0000:00:0b.0, compute capability: 7.0
2023-08-09 16:00:00.723313: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-09 16:00:00.723755: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:3 with 14544 MB memory:  -> device: 3, name: Tesla V100-SXM2-16GB, pci bus id: 0000:00:0c.0, compute capability: 7.0
2023-08-09 16:00:00.855211: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        

CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE

Your simulation uses code contributions which should be cited:
- USER-DEEPMD package:
The log file lists these citations in BibTeX format.

CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE

Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
  update: every = 10 steps, delay = 0 steps, check = no
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 8
  ghost atom cutoff = 8
  binsize = 4, bins = 4 4 5
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair deepmd, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Setting up Verlet run ...
  Unit style    : metal
  Current step  : 0
  Time step     : 0.0005
Per MPI rank memory allocation (min/avg/max) = 2.686 | 2.686 | 2.686 Mbytes
   Step          Temp          PotEng         Volume        Density    
0 0.00000000e+00 -2.09022574e+03 4.15866460e+03 9.20759375e-01
100 2.73513356e+01 -2.09487380e+03 4.04727828e+03 9.46099862e-01
200 3.32208864e+01 -2.09547357e+03 3.75038875e+03 1.02099534e+00
300 9.91644157e+00 -2.09411214e+03 3.57285580e+03 1.07172795e+00
400 1.52263917e+01 -2.09383806e+03 3.54882495e+03 1.07898515e+00
500 5.62471521e+01 -2.09528914e+03 3.73519661e+03 1.02514802e+00
600 3.80802720e+01 -2.09454296e+03 4.04461282e+03 9.46723356e-01
700 1.82695602e+01 -2.09329767e+03 4.16440618e+03 9.19489900e-01
800 4.11602265e+01 -2.09378115e+03 3.97668068e+03 9.62895875e-01
900 3.28557523e+01 -2.09226121e+03 3.69902032e+03 1.03517393e+00
1000 4.23189207e+01 -2.09164224e+03 3.69572674e+03 1.03609647e+00
1100 7.72020015e+01 -2.09235709e+03 4.03414875e+03 9.49179037e-01
1200 8.53711654e+01 -2.09150621e+03 4.07628206e+03 9.39368123e-01
1300 8.34125901e+01 -2.08983715e+03 3.75767858e+03 1.01901462e+00
1400 1.01945242e+02 -2.08914121e+03 3.72302857e+03 1.02849853e+00
1500 1.49296768e+02 -2.08972930e+03 3.99128509e+03 9.59372567e-01
1600 1.59892202e+02 -2.08793294e+03 4.07109646e+03 9.40564652e-01
1700 1.76493815e+02 -2.08646125e+03 3.88158857e+03 9.86485134e-01
1800 1.98331671e+02 -2.08495188e+03 3.82886456e+03 1.00006917e+00
1900 2.16775279e+02 -2.08325221e+03 3.93971771e+03 9.71929895e-01
2000 2.35467778e+02 -2.08138139e+03 4.04931362e+03 9.45624315e-01
Loop time of 8.32625 on 1 procs for 2000 steps with 384 atoms

Performance: 10.377 ns/day, 2.313 hours/ns, 240.204 timesteps/s, 92.238 katom-step/s
116.5% CPU use with 1 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 7.693      | 7.693      | 7.693      |   0.0 | 92.40
Neigh   | 0.53861    | 0.53861    | 0.53861    |   0.0 |  6.47
Comm    | 0.036389   | 0.036389   | 0.036389   |   0.0 |  0.44
Output  | 0.0073376  | 0.0073376  | 0.0073376  |   0.0 |  0.09
Modify  | 0.045519   | 0.045519   | 0.045519   |   0.0 |  0.55
Other   |            | 0.005343   |            |       |  0.06

Nlocal:            384 ave         384 max         384 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:           2650 ave        2650 max        2650 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:              0 ave           0 max           0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs:        76898 ave       76898 max       76898 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 76898
Ave neighs/atom = 200.25521
Neighbor list builds = 200
Dangerous builds not checked
Total wall time: 0:00:17
代码
文本

classical MD for water:

代码
文本
[46]
%%bash
cd /data/PIMD_Tutorial/run/water/classical
lmp -in in.lammps
LAMMPS (15 Jun 2023)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
  using 1 OpenMP thread(s) per MPI task
Open of file /opt/deepmd-kit-2.2.2/lib/deepmd_lmp/dpplugin.so failed: /opt/deepmd-kit-2.2.2/lib/deepmd_lmp/dpplugin.so: undefined symbol: _ZTIN9LAMMPS_NS7ComputeE
Loaded 0 plugins from /opt/deepmd-kit-2.2.2/lib/deepmd_lmp
Reading data file ...
  orthogonal box = (-0.31180958 -0.31180958 -0.31180958) to (15.31181 15.31181 15.31181)
  1 by 1 by 1 MPI processor grid
  reading atoms ...
  384 atoms
  reading velocities ...
  384 velocities
  read_data CPU = 0.004 seconds
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
Summary of lammps deepmd module ...
  >>> Info of deepmd-kit:
  installed to:       /root/deepmd-kit/dp_c
  source:             
  source branch:       
  source commit:      
  source commit at:   
  surpport model ver.:1.1 
  build variant:      cuda
  build with tf inc:  /usr/local/lib/python3.11/dist-packages/tensorflow/include;/usr/local/lib/python3.11/dist-packages/tensorflow/include
  build with tf lib:  /usr/local/lib/python3.11/dist-packages/tensorflow/libtensorflow_cc.so.2
  set tf intra_op_parallelism_threads: 0
  set tf inter_op_parallelism_threads: 0
  >>> Info of lammps module:
  use deepmd-kit at:  /opt/deepmd-kit-2.2.2
  source:             v2.2.2-75-g4fa54ec6
  source branch:      devel
  source commit:      4fa54ec6
  source commit at:   2023-07-26 09:23:40 +0800
  build float prec:   double
  build with tf inc:  /opt/deepmd-kit-2.2.2/include
  build with tf lib:  
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
2023-08-03 06:40:33.259256: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:40:33.260337: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:33.301893: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:33.302125: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:34.173605: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:34.173876: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:34.174058: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:34.174246: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:40:34.296107: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        

CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE

Your simulation uses code contributions which should be cited:
- USER-DEEPMD package:
The log file lists these citations in BibTeX format.

CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE

Generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
  update: every = 10 steps, delay = 0 steps, check = no
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 8
  ghost atom cutoff = 8
  binsize = 4, bins = 4 4 4
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair deepmd, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Setting up Verlet run ...
  Unit style    : metal
  Current step  : 0
  Time step     : 0.0005
Per MPI rank memory allocation (min/avg/max) = 2.696 | 2.696 | 2.696 Mbytes
   Step          Temp          PotEng         Volume        Density    
0 3.29925921e+02 -2.07069826e+03 3.81368600e+03 1.00404947e+00
100 3.06907111e+02 -2.06971743e+03 3.78458842e+03 1.01176905e+00
200 2.78269052e+02 -2.06884027e+03 3.77208866e+03 1.01512180e+00
300 2.94960733e+02 -2.07019125e+03 3.69091734e+03 1.03744654e+00
400 2.94594335e+02 -2.07055118e+03 3.72839089e+03 1.02701931e+00
500 2.79535198e+02 -2.07007110e+03 3.64332904e+03 1.05099742e+00
600 2.99021224e+02 -2.07074250e+03 3.61488044e+03 1.05926862e+00
700 3.04683843e+02 -2.06990418e+03 3.67317958e+03 1.04245636e+00
800 3.01700854e+02 -2.06890132e+03 3.73044519e+03 1.02645374e+00
900 3.05865310e+02 -2.06887411e+03 3.73113933e+03 1.02626278e+00
1000 3.02397382e+02 -2.06875934e+03 3.68667088e+03 1.03864151e+00
1100 3.14120313e+02 -2.06956573e+03 3.64124501e+03 1.05159895e+00
1200 2.99658203e+02 -2.06927024e+03 3.70545838e+03 1.03337537e+00
1300 3.02492696e+02 -2.06991543e+03 3.67843286e+03 1.04096760e+00
1400 2.92479729e+02 -2.06970228e+03 3.68017412e+03 1.04047507e+00
1500 2.90119838e+02 -2.06956615e+03 3.69381058e+03 1.03663394e+00
1600 2.80098580e+02 -2.06858508e+03 3.74241395e+03 1.02317100e+00
1700 3.16458572e+02 -2.06938495e+03 3.77159626e+03 1.01525433e+00
1800 3.10313540e+02 -2.06839799e+03 3.70635875e+03 1.03312434e+00
1900 3.16026446e+02 -2.06860363e+03 3.64928756e+03 1.04928136e+00
2000 3.15215534e+02 -2.06882316e+03 3.62527819e+03 1.05623051e+00
Loop time of 7.72181 on 1 procs for 2000 steps with 384 atoms

Performance: 11.189 ns/day, 2.145 hours/ns, 259.007 timesteps/s, 99.459 katom-step/s
113.7% CPU use with 1 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 6.9919     | 6.9919     | 6.9919     |   0.0 | 90.55
Neigh   | 0.63729    | 0.63729    | 0.63729    |   0.0 |  8.25
Comm    | 0.039279   | 0.039279   | 0.039279   |   0.0 |  0.51
Output  | 0.0074032  | 0.0074032  | 0.0074032  |   0.0 |  0.10
Modify  | 0.040092   | 0.040092   | 0.040092   |   0.0 |  0.52
Other   |            | 0.005827   |            |       |  0.08

Nlocal:            384 ave         384 max         384 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:           2888 ave        2888 max        2888 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:              0 ave           0 max           0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs:        86824 ave       86824 max       86824 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 86824
Ave neighs/atom = 226.10417
Neighbor list builds = 200
Dangerous builds not checked
Total wall time: 0:00:11
代码
文本

PIMD for ice:

代码
文本

Note: In LAMMPS, the number of beads is not specified in the input script. Instead, it is specified when running the task by setting the number of processes of the MPI job and using LAMMPS's partition feature. The following command starts a PIMD job with 4 beads. Refer to the document for detailed explanations: fix pimd/langevin.

代码
文本
[4]
%%bash
cd /data/PIMD_Tutorial/run/ice/4beads
mpirun -np 4 lmp -in in.lammps -p 4x1 -log log
LAMMPS (15 Jun 2023)
Running on 4 partitions of processors
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
2023-08-03 06:24:12.951370: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:24:12.951650: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:24:12.952102: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:24:12.952311: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.952348: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:24:12.952384: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.953106: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.954139: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.994020: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.994019: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.994172: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.994718: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.994764: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:12.994863: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:13.003647: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:13.055450: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.026119: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.026604: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.026834: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.027041: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:24:14.029940: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.030180: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.030361: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.030554: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:24:14.033214: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.033557: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.033861: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.034128: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:24:14.038333: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.038669: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.038957: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:24:14.039213: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:24:14.155084: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
2023-08-03 06:24:14.155723: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
2023-08-03 06:24:14.159384: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
2023-08-03 06:24:14.163901: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
fix pimd/langevin initializing Path-Integral ...
fix pimd/langevin -P/(beta^2 * hbar^2) =        2.5580937E+00 (kcal/mol/A^2)

代码
文本

PIMD for water:

代码
文本
[47]
%%bash
cd /data/PIMD_Tutorial/run/water/4beads
mpirun -np 4 lmp -in in.lammps -p 4x1 -log log
LAMMPS (15 Jun 2023)
Running on 4 partitions of processors
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTRA_OP_PARALLELISM_THREADS is not set. Tune TF_INTRA_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable TF_INTER_OP_PARALLELISM_THREADS is not set. Tune TF_INTER_OP_PARALLELISM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
DeePMD-kit WARNING: Environmental variable OMP_NUM_THREADS is not set. Tune OMP_NUM_THREADS for the best performance. See https://deepmd.rtfd.io/parallelism/ for more information.
2023-08-03 06:40:46.671729: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:40:46.672019: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:40:46.672392: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:40:46.672804: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-08-03 06:40:46.672922: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.673039: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.673333: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.673778: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.714952: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.714952: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.715219: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.715565: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.715610: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.715890: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.716255: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:46.717237: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:47.739871: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:47.740148: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:47.740371: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:47.740634: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:40:47.748898: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:47.749152: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:47.749347: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:47.749549: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:40:47.866776: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
2023-08-03 06:40:47.872118: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
2023-08-03 06:40:48.067786: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:48.068146: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:48.068394: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:48.068623: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
2023-08-03 06:40:48.070849: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:48.071197: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:48.071470: I tensorflow/compiler/xla/stream_executor/cuda/cuda_gpu_executor.cc:996] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero. See more at https://github.com/torvalds/linux/blob/v6.0/Documentation/ABI/testing/sysfs-bus-pci#L344-L355
2023-08-03 06:40:48.071729: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 29259 MB memory:  -> device: 0, name: Tesla V100-SXM2-32GB, pci bus id: 0000:00:09.0, compute capability: 7.0
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
2023-08-03 06:40:48.232984: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
2023-08-03 06:40:48.236062: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:353] MLIR V1 optimization pass is not enabled
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
INVALID_ARGUMENT: Tensor spin_attr/ntypes_spin:0, specified in either feed_devices or fetch_devices was not found in the Graph
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
  >>> Info of model(s):
  using   1 model(s): ../../../model/graph1.pb 
  rcut in model:      6
  ntypes in model:    2
  using compute id:        
fix pimd/langevin initializing Path-Integral ...
fix pimd/langevin -P/(beta^2 * hbar^2) =        2.5580937E+00 (kcal/mol/A^2)

代码
文本

Now we have finished running each of the 4 simulations for 2000 steps. We may moniter the evolution of temperature and potential energy through the simulations. Note that the PIMD algorithm we used controls the temperature to , where is the number of beads, and is the desired temperature. For example, if we want to control the temperature of a system with 4 beads at 300 K, the observed temperatures should fluctuate around 1200 K. When plotting the figures below, we divide the observed temperature with the number of beads to make it easier to observe.

代码
文本
[82]
%%bash
cd /data/PIMD_Tutorial/run/ice/classical
sed -n 121,141p log.lammps > thermo

cd /data/PIMD_Tutorial/run/water/classical
sed -n 123,143p log.lammps > thermo

cd /data/PIMD_Tutorial/run/ice/4beads
for i in {0..3}; do sed -n 134,154p log.$i > thermo.$i; done

cd /data/PIMD_Tutorial/run/water/4beads
for i in {0..3}; do sed -n 136,156p log.$i > thermo.$i; done
代码
文本
[72]
thermo_ice_classical = np.loadtxt("/data/PIMD_Tutorial/run/ice/classical/thermo")
thermo_ice_4beads = []
for i in range(4):
thermo_ice_4beads.append(np.loadtxt("/data/PIMD_Tutorial/run/ice/4beads/thermo."+str(i)))
thermo_ice_4beads = np.array(thermo_ice_4beads)
代码
文本
[73]
thermo_water_classical = np.loadtxt("/data/PIMD_Tutorial/run/water/classical/thermo")
thermo_water_4beads = []
for i in range(4):
thermo_water_4beads.append(np.loadtxt("/data/PIMD_Tutorial/run/water/4beads/thermo."+str(i)))
thermo_water_4beads = np.array(thermo_water_4beads)
代码
文本
[95]
fig, ax = plt.subplots(1, figsize=(9, 6), facecolor="white")
plt.title("Thermo Equilibriation", fontsize=16)
plt.xticks(fontsize=16)
plt.yticks(fontsize=16)
plt.xlim(0, 2000)
plt.ylim(0, 350)
ax.set_xlabel("Step", fontsize=16)
ax.set_ylabel("Instantaneous Temperature $T$ / K", fontsize=16)

plt.plot(thermo_ice_classical[:, 0], thermo_ice_classical[:, 1], label="ice classical MD", color=colors[0])
plt.plot(thermo_ice_4beads[0, :, 0], thermo_ice_4beads[0, :, 1]/4, label="ice PIMD", color=colors[1])

plt.plot(thermo_water_classical[:, 0], thermo_water_classical[:, 1], label="water classical MD", color=colors[0], linestyle="--")
plt.plot(thermo_water_4beads[0, :, 0], thermo_water_4beads[0, :, 1]/4, label="water PIMD", color=colors[1], linestyle="--")

plt.legend(fontsize=12)
plt.show()
代码
文本

You may notice that due to the thermostats, the instantaneous temperatures of the systems (derived from kinetic energies) are moving towards 300 K and finally fluctuate around this value.

代码
文本
[93]
fig, ax = plt.subplots(1, figsize=(9, 6), facecolor="white")
plt.title("Potential Energy", fontsize=16)
plt.xticks(fontsize=16)
plt.yticks(fontsize=16)
plt.xlim(0, 2000)
plt.ylim(-2200, -2040)
ax.set_xlabel("Step", fontsize=16)
ax.set_ylabel("Potential Energy $U$ / eV", fontsize=16)

plt.plot(thermo_ice_classical[:, 0], thermo_ice_classical[:, 2], label="ice classical MD", color=colors[0])
for i in range(4):
plt.plot(thermo_ice_4beads[i, :, 0], thermo_ice_4beads[i, :, 4], label="ice PIMD, bead %d"%(i+1), color=colors[i+1])

plt.plot(thermo_water_classical[:, 0], thermo_water_classical[:, 2], label="water classical MD", color=colors[0], linestyle="--")
for i in range(4):
plt.plot(thermo_water_4beads[i, :, 0], thermo_water_4beads[i, :, 4], label="water PIMD, bead %d"%(i+1), color=colors[i+1], linestyle="--")
plt.legend(fontsize=12, loc="lower right")
plt.show()
代码
文本

You may observe that for both ice and water, PIMD is exploring the part of configuration space with higher potential energy compared to classical MD.

代码
文本

3. Analyzing The Trajectory

代码
文本

In the last session, we ran PIMD for both ice and water with 4 beads to demonstrate how to run PIMD. However, 4 beads is much fewer than the required number to converge and thus the simulations have no physical meaning. Practically, for the ice and water systems to converge with respect to beads, a reasonable choice of number of beads is 32 or even 64. To simplify this pedagogical notebook, I have prepared 10 ps's MD and PIMD trajectories of water and ice. Although 10 ps is still too short for the thermodynamic properties to converge, the trend of NQEs are very clear. In this session, we will demonstrate how to study NQEs on the radial distribution functions (RDFs), proton sharing coordinates, and hydrogen bond angles of liquid water, and leave ice as an exercise.

代码
文本

3.0 Read The Trajectory

This part reads the MD and PIMD trajectory files of liquid water. Each trajectory is dumped every 0.1 ps, so there are 101 frames in each trajectory. For PIMD, the 32 beads result in configurations in the trajectory. Every configuration contains 128 water molecules.

代码
文本
[10]
%%bash
tree /data/PIMD_Tutorial/trajectories/ -L 1
/data/PIMD_Tutorial/trajectories/
├── 32beads
├── classical
└── exercise

3 directories, 0 files
代码
文本

/data/PIMD_Tutorial/trajectories/classical contains a classical MD trajetory of liquid water, and /data/PIMD_Tutorial/trajectories/32beads contains a PIMD trajetory of liquid water. /data/PIMD_Tutorial/trajectories/exercise contains both classical MD and PIMD trajectories of ice. The following script reads the trajectories of liquid water:

代码
文本
[6]
nsamp = 101
nbead = 32
nO=128
nH=256
natom = 384

coord1 = np.zeros([nsamp, natom, 3])
type1 = np.zeros([nsamp, natom])
box1 = np.zeros([nsamp, 9])

coord32 = np.zeros([nbead, nsamp, natom, 3])
type32 = np.zeros([nbead, nsamp, natom])
box32 = np.zeros([nbead, nsamp, 9])

directory = "/data/PIMD_Tutorial/trajectories/"

with open(directory+"classical/%02d"%(1)+".xyz", "r") as f:
for i in range(nsamp):
for j in range(5):
f.readline()
xlohi = np.array(f.readline().split(), dtype="float")
xprd = xlohi[1] - xlohi[0]
ylohi = np.array(f.readline().split(), dtype="float")
yprd = ylohi[1] - ylohi[0]
zlohi = np.array(f.readline().split(), dtype="float")
zprd = zlohi[1] - zlohi[0]
box1[i] = np.diag(np.array([xprd, yprd, zprd])).reshape(1, -1)
f.readline()
for j in range(natom):
line = f.readline().split()
type1[i][j] = int(line[1])
coord1[i][j] = np.array(line[2:5], dtype="float")
prds1 = (np.r_[[box1[:, i] for i in (0, 4, 8)]]).T
coord1_map = coord1 % prds1[:, None, :] # make all atoms inside the box
typeO = np.where(type1[0]==1)[0]
typeH = np.where(type1[0]==2)[0]

for ibead in range(nbead):
with open(directory+"32beads/%02d"%(ibead+1)+".xyz", "r") as f:
for i in range(nsamp):
for j in range(5):
f.readline()
xlohi = np.array(f.readline().split(), dtype="float")
xprd = xlohi[1] - xlohi[0]
ylohi = np.array(f.readline().split(), dtype="float")
yprd = ylohi[1] - ylohi[0]
zlohi = np.array(f.readline().split(), dtype="float")
zprd = zlohi[1] - zlohi[0]
box32[ibead][i] = np.diag(np.array([xprd, yprd, zprd])).reshape(1, -1)
f.readline()
for j in range(natom):
line = f.readline().split()
type32[ibead][i][j] = int(line[1])
coord32[ibead][i][j] = np.array(line[2:5], dtype="float")
prds32 = (np.r_[[box32[0, :, i] for i in (0, 4, 8)]]).T
coord32_map = coord32 % prds32[:, None, :]
代码
文本

3.1 Radial Distribution Function (RDF)

代码
文本

Radial distribution function is a structural property of molecular systems. It is very useful because many observables can be expressed in terms of , including neutron or X-ray scattering intensities and various thermodynamic quantities. In this part, we demonstrate how to calculate RDF and the NQEs on the RDF of water.

A radial distribution function of a system with atoms can be defined as

where is the density of the system. Here we calculate RDFs by using histogram. In PIMD, the overall RDF is the average of the RDFs of all the beads.

Water has 3 RDFs: , , and . Among them, has the most profound NQEs. Therefore, we only compare from classical MD and PIMD in this part.

代码
文本
[5]
rcut=6
nbin=100
dr=rcut/nbin
r_array=np.linspace(0, rcut, num=nbin, endpoint=False)+0.5*dr
代码
文本
[8]
nbatch = 10
nloop = int(nsamp/nbatch)
nsamp_ = nloop*nbatch
idx_O = np.where(type1[0]==1)[0]
idx_H = np.where(type1[0]==2)[0]
coords_O = coord1[:, idx_O]
coords_H = coord1[:, idx_H]
g_r_array = np.zeros([nsamp_, nbin])
dists_array = np.zeros([nsamp_, nO*nH])
prds=(box1[:, [0,4,8]]).reshape(nsamp, 1, 1, 3)

coords_O_32b = coord32[:, :, idx_O]
coords_H_32b = coord32[:, :, idx_H]
g_r_32b_array = np.zeros([nbead, nsamp_, nbin])
dists_32b_array = np.zeros([nbead, nsamp_, nO*nH])
prds_32b=(box32[:, :, [0,4,8]]).reshape(nbead, nsamp, 1, 1, 3)
for iloop in range(nloop):
coords_O_batch = coords_O[iloop*nbatch:(iloop+1)*nbatch]
coords_H_batch = coords_H[iloop*nbatch:(iloop+1)*nbatch]
dist_batch = coords_O_batch[:, None, :] - coords_H_batch[:, :, None]
prds_batch = prds[iloop*nbatch:(iloop+1)*nbatch]
dist_pbc=(dist_batch/prds_batch-np.floor(dist_batch/prds_batch+0.5))*prds_batch
dist_r=np.sqrt((dist_pbc**2).sum(axis=3))
dists_array[iloop*nbatch:(iloop+1)*nbatch] = dist_r.reshape(nbatch, nO*nH)

for ibatch in range(nbatch):
isamp = iloop*nbatch + ibatch
Vol = box1[isamp][0]*box1[isamp][4]*box1[isamp][8]
hist_r = np.histogram(dists_array[isamp], bins=nbin, range=(0, rcut), density=False)
g_r_array[isamp] = hist_r[0]/4/np.pi/r_array**2/dr/nO/nH*Vol

for ibead in range(nbead):
for iloop in range(nloop):
coords_O_batch = coords_O_32b[ibead, iloop*nbatch:(iloop+1)*nbatch]
coords_H_batch = coords_H_32b[ibead, iloop*nbatch:(iloop+1)*nbatch]
dist_batch = coords_O_batch[:, None, :] - coords_H_batch[:, :, None]
prds_batch = prds_32b[ibead, iloop*nbatch:(iloop+1)*nbatch]
dist_pbc=(dist_batch/prds_batch-np.floor(dist_batch/prds_batch+0.5))*prds_batch
dist_r=np.sqrt((dist_pbc**2).sum(axis=3))
dists_array[iloop*nbatch:(iloop+1)*nbatch] = dist_r.reshape(nbatch, nO*nH)

for ibatch in range(nbatch):
isamp = iloop*nbatch + ibatch
Vol = box32[ibead][isamp][0]*box32[ibead][isamp][4]*box32[ibead][isamp][8]
hist_r = np.histogram(dists_array[isamp], bins=nbin, range=(0, rcut), density=False)
g_r_32b_array[ibead][isamp] = hist_r[0]/4/np.pi/r_array**2/dr/nO/nH*Vol

g_r_1b = g_r_array.mean(axis=0)
g_r_32b = (g_r_32b_array.mean(axis=0)).mean(axis=0)
代码
文本
[21]
fig, ax = plt.subplots(1, figsize=(9, 6), facecolor="white")
plt.title("liquid water $g_{\mathrm{OH}(r)}$ at 300 K, 1 bar", fontsize=16)
ax.set_xlim(0.0, 6.0)
ax.set_ylim(-0.01, 4.0)
plt.xticks(fontsize=16)
plt.yticks(fontsize=16)
ax.set_xlabel("$r\ /\ \mathrm{\AA}$", fontsize=16)
ax.set_ylabel("$g_{\mathrm{OH}}(r)$", fontsize=16)

plt.plot(r_array, g_r_1b, label="classical MD", color="blue")
plt.plot(r_array, g_r_32b, label="PIMD", color="red")

plt.legend(fontsize=16)

axins = inset_axes(ax, width=0.8, height=0.6)
ip = InsetPosition(ax, [0.25,0.55,0.4,0.4])
axins.set_axes_locator(ip)
axins.set_xlim(0.8, 1.2)
axins.set_ylim(-0.01, 40.0)

axins.plot(r_array, g_r_1b, color="blue")
axins.plot(r_array, g_r_32b, color="red")

plt.show()
代码
文本

From the this figure we can observe the following NQEs:

  1. The first peak around 1.0 $\unicode[serif]{xC5}$ is the O-H covalent bond. NQEs make this peak of PIMD slightly lower than that of classical MD. This means that the stretching of O-H covalent bond is enhanced in PIMD.
  2. The second peak around 1.8 $\unicode[serif]{xC5}$ is the O-H hydrogen bond. NQEs make this peak move slightly to the left. This means that the strength of the O-H hydrogen bond is enhanced in PIMD.
代码
文本

3.2 Proton Transfer Coordinate And Hydrogen Bond Angle

代码
文本

Water is a hydrogen bonded system. The figure below shows two water molecules which forms a hydrogen bond O-H-O. As we have demonstrated in the last part, a proton in water has two kinds of nearest neighbors: one is the covalently bonded oxygen atom (O), and the other is the hydrogen bonded oxygen atom (O).

Proton transfer cordinate () describes the extent to which the proton is transferred between the donor and acceptor oxygen atoms. It is a measure of the strength of the hydrogen bond. Greater means more profound proton sharing effect and stronger hydrogen bond.

Hydrogen bond angle () describes the bending of the hydrogen bond due to the libration of the water molecules. It is also an important measure of the strength of the hydrogen bond. Greater means more profound bending weaker hydrogen bond.

代码
文本

image.png

代码
文本
[7]
# expand_dims is used for the purpose of reusing the code of calculating O-H distances under PBC
coords_O_batch = np.expand_dims(coord1_map[0, typeO], axis=0)
coords_H_batch = np.expand_dims(coord1_map[0, typeH], axis=0)

# compute O-H distances under PBC: shape of dist_pbc is (nframe, nO, nH, 3) where 3 is the number of dimensions
# dist_pbc is the vector distances, and dist_pbc is the scalar distances
dist_batch = coords_O_batch[:, None, :] - coords_H_batch[:, :, None]
prds_batch = prds1[0].reshape(-1, 1, 1, 3)
dist_pbc=np.swapaxes((dist_batch/prds_batch-np.floor(dist_batch/prds_batch+0.5))*prds_batch, 1, 2)
dist_r=np.sqrt((dist_pbc**2).sum(axis=3))

# bond_idx stores the index of the O-H pairs which have distances between 0.745 and 1.35.
# These O-H pairs are thought to form covalent bonds.
bond_idx = np.where((dist_r>0.745) & (dist_r<1.35))
bond_list_OH = np.array(bond_idx).reshape(3, 1, nH)
H1_list = bond_list_OH[2, :, ::2] # 1st bonded H index for each O
H2_list = bond_list_OH[2, :, 1::2] # 2nd bonded H index for each O
O_list = bond_list_OH[1] # index for each O

H1_list0 = H1_list[0] # 1st bonded H index for each O
H2_list0 = H2_list[0] # 2nd bonded H index for each O

H1_O_list = np.arange(nO)[np.argsort(H1_list[0])]
H2_O_list = np.arange(nO)[np.argsort(H2_list[0])]
# O_bond_list stores the information that for each H, which O it is bonded with
O_bond_list = np.array([[H1_O_list[i], H2_O_list[i]] for i in range(nO)]).flatten()
代码
文本
[8]
# calculate the proton-sharing coordinates and H-bond angles for classical water
nsamp=100 # total number of samples
batch=1 # how many configurations to treat in each loop
nloop=int(nsamp/batch)
OH1 = np.zeros([nsamp, nO, 3])
OH2 = np.zeros([nsamp, nO, 3])
share_r = np.zeros([nsamp, nH])
share_theta = np.zeros([nsamp, nH])
for iloop in range(nloop):
# for the current batch, calculate the O-H distances under PBC
idx = np.arange(iloop*batch, (iloop+1)*batch)
coords_O_batch = (coord1_map[idx])[:, typeO]
coords_H_batch = (coord1_map[idx])[:, typeH]
dist_batch = coords_O_batch[:, None, :] - coords_H_batch[:, :, None]
prds_batch = prds1[idx].reshape(-1, 1, 1, 3)
dist_pbc=np.swapaxes((dist_batch/prds_batch-np.floor(dist_batch/prds_batch+0.5))*prds_batch, 1, 2)
dist_r=np.sqrt((dist_pbc**2).sum(axis=3))
dist_HO = np.swapaxes(dist_r, 1, 2)
# find the 2 nearest O atoms for each H atom
O_HB_list = np.argpartition(dist_HO, kth=1, axis=2)[:, :, :2]
# exclude the bonded O atoms so that the H-bonded O atoms are left
O_share_list = O_HB_list[O_HB_list [:, :, :] != O_bond_list[None, :, None]].reshape(-1, nH)
# calculate O-H distances where O is the bonded one
r_bond = dist_r[:, O_bond_list, np.arange(nH)]
O_extract_idx = np.stack((np.array([np.arange(batch) for i in range(nH)]).T, O_share_list, np.array([np.arange(nH) for i in range(batch)])), axis=-1).reshape(-1, 3)
# calculate O-H distances where O is the H-bonded one
r_shared = dist_r[O_extract_idx[:, 0], O_extract_idx[:, 1], O_extract_idx[:, 2]].reshape(batch, nH)
# proton-share coordinate: \delta = d(O_{bonded}-H) - d(O_{shared}-H)
share_r_batch = r_bond - r_shared
# calculate the angles formed by the vectors O_{bonded}-H and O_{shared}-H
dist_pbc_bond = dist_pbc[:, O_bond_list, np.arange(nH)]
dist_pbc_shared = dist_pbc[O_extract_idx[:, 0], O_extract_idx[:, 1], O_extract_idx[:, 2]].reshape(batch, nH, 3)
share_theta_batch = np.arccos((dist_pbc_bond*dist_pbc_shared).sum(axis=2) / np.linalg.norm(dist_pbc_bond, axis=2) / np.linalg.norm(dist_pbc_shared, axis=2))/np.pi*180
share_r[idx] = share_r_batch
share_theta[idx] = share_theta_batch
OH1_batch = dist_pbc[:, np.arange(nO), H1_list0]
OH2_batch = dist_pbc[:, np.arange(nO), H2_list0]
OH1[idx] = OH1_batch
OH2[idx] = OH2_batch
代码
文本
[9]
# calculate the proton-sharing coordinates and H-bond angles for quantum water
# Most of this is the same as the classical case, except that an additional loop over beads is needed.
nsamp=100
batch=1
nloop=int(nsamp/batch)
OH1_32b = np.zeros([32, nsamp, nO, 3])
OH2_32b = np.zeros([32, nsamp, nO, 3])
share_r_32b = np.zeros([32, nsamp, nH])
share_theta_32b = np.zeros([32, nsamp, nH])
for ibead in range(32):
for iloop in range(nloop):
idx = np.arange(iloop*batch, (iloop+1)*batch)
coords_O_batch = (coord32_map[ibead][idx])[:, typeO]
coords_H_batch = (coord32_map[ibead][idx])[:, typeH]
dist_batch = coords_O_batch[:, None, :] - coords_H_batch[:, :, None]
prds_batch = prds1[idx].reshape(-1, 1, 1, 3)
dist_pbc=np.swapaxes((dist_batch/prds_batch-np.floor(dist_batch/prds_batch+0.5))*prds_batch, 1, 2)
dist_r=np.sqrt((dist_pbc**2).sum(axis=3))
dist_HO = np.swapaxes(dist_r, 1, 2)
O_HB_list = np.argpartition(dist_HO, kth=1, axis=2)[:, :, :2]
O_share_list = O_HB_list[O_HB_list [:, :, :] != O_bond_list[None, :, None]].reshape(-1, nH)
r_bond = dist_r[:, O_bond_list, np.arange(nH)]
O_extract_idx = np.stack((np.array([np.arange(batch) for i in range(nH)]).T, O_share_list, np.array([np.arange(nH) for i in range(batch)])), axis=-1).reshape(-1, 3)
r_shared = dist_r[O_extract_idx[:, 0], O_extract_idx[:, 1], O_extract_idx[:, 2]].reshape(batch, nH)
share_r_batch = r_bond - r_shared
dist_pbc_bond = dist_pbc[:, O_bond_list, np.arange(nH)]
dist_pbc_shared = dist_pbc[O_extract_idx[:, 0], O_extract_idx[:, 1], O_extract_idx[:, 2]].reshape(batch, nH, 3)
share_theta_batch = np.arccos((dist_pbc_bond*dist_pbc_shared).sum(axis=2) / np.linalg.norm(dist_pbc_bond, axis=2) / np.linalg.norm(dist_pbc_shared, axis=2))/np.pi*180
share_r_32b[ibead][idx] = share_r_batch
share_theta_32b[ibead][idx] = share_theta_batch
OH1_batch = dist_pbc[:, np.arange(nO), H1_list0]
OH2_batch = dist_pbc[:, np.arange(nO), H2_list0]
OH1_32b[ibead][idx] = OH1_batch
OH2_32b[ibead][idx] = OH2_batch
代码
文本
[10]
fig, ax = plt.subplots()
share_dist = plt.hist2d(share_r.flatten(), share_theta.flatten(), bins = 100, range=[[-2.5, 0.5], [25, 180]], density=True, cmap=plt.cm.viridis, norm=LogNorm())
share_dist_32b = plt.hist2d(share_r_32b.flatten(), share_theta_32b.flatten(), bins = 100, range=[[-2.5, 1.0], [25, 180]], density=True, cmap=plt.cm.viridis, norm=LogNorm())
plt.close()
代码
文本
[11]
X, Y = np.meshgrid(share_dist[1][1:], share_dist[2][1:])
fig, ax = plt.subplots(figsize=(8, 6))
ax.contourf(X, Y, share_dist[0].T, cmap=plt.cm.viridis, norm=LogNorm())
cbar = fig.colorbar(share_dist_32b[3], ax=ax)
cbar.ax.tick_params(labelsize=20)

ax.set_title("classical MD", fontsize=20)

ax.set_xlim(-1.2, 0.8)
ax.set_ylim(80, 180)

ax.set_xlabel("$\\nu(\mathrm{\AA})$", fontsize=20)
ax.set_ylabel("$\\theta(^{\circ})$", fontsize=20)

ax.tick_params(axis='both', which='major', labelsize=20)

plt.show()
/tmp/ipykernel_302/4224671157.py:3: UserWarning: Log scale: values of z <= 0 have been masked
  ax.contourf(X, Y, share_dist[0].T, cmap=plt.cm.viridis, norm=LogNorm())
代码
文本
[12]
X, Y = np.meshgrid(share_dist_32b[1][1:], share_dist_32b[2][1:])
fig, ax = plt.subplots(figsize=(8, 6))
ax.contourf(X, Y, share_dist_32b[0].T, cmap=plt.cm.viridis, norm=LogNorm())
cbar = fig.colorbar(share_dist_32b[3], ax=ax)
cbar.ax.tick_params(labelsize=20)

ax.set_title("PIMD", fontsize=20)

ax.set_xlim(-1.2, 0.8)
ax.set_ylim(80, 180)

ax.set_xlabel("$\\nu(\mathrm{\AA})$", fontsize=20)
ax.set_ylabel("$\\theta(^{\circ})$", fontsize=20)

ax.tick_params(axis='both', which='major', labelsize=20)

plt.show()
/tmp/ipykernel_302/973599111.py:3: UserWarning: Log scale: values of z <= 0 have been masked
  ax.contourf(X, Y, share_dist_32b[0].T, cmap=plt.cm.viridis, norm=LogNorm())
代码
文本

By comparing the figures from classical MD and PIMD, we realize that both proton sharing coordinate and hydrogen bond angle are enhanced by NQEs. We have already mentioned that these two types of enhancement have contradictory effects on the strength of hydrogen bond. Therefore, the overall result of NQEs depends on the balance between these two effects.

代码
文本

4. Exercises

代码
文本

4.0 Convergence of number of beads

Is 32 beads enough for the PIMD simulation of ice and water? You may use the convergence of the quantum kinetic energy estimator as a measure to check it.

4.1 Densities of water and ice

What are the densities of water and ice at the melting temperature? What are the maximum density temperatures of water and ice? How do they compare with the experiment values?

4.2 RDFs and hydrogen bonding of ice

10 ps MD and PIMD trajectories of ice are provided in PIMD_Tutorial/trajectories/exercise. Analyze them as we did for water in Session 3.

代码
文本
PIMD
DeePMD
H2O
LAMMPS
English
PIMDDeePMDH2OLAMMPSEnglish
已赞10
本文被以下合集收录
测试合集文章列表100篇
xingyanshi@dp.tech很长的名字xingyanshi@dp.tech很长的名字很长的
更新于 2024-08-04
104 篇2 人关注
DeepMD
fshappy
更新于 2024-08-05
11 篇2 人关注
推荐阅读
公开
Introduction to Quantum Simulation Algorithms
Quantum ComputingEnglish
Quantum ComputingEnglish
zhoushuo@dp.tech
发布于 2023-07-19
6 赞11 转存文件
公开
ChemPy | 德拜-休克尔理论
化学信息学ChemPy
化学信息学ChemPy
Weiliang Luo
发布于 2023-06-15
评论
 **You only need to k...

AnguseZhang

2023-08-22
From Zheyong Fan:  in the middle of this section,  "$qi$ is the atomic coordinate for the i-th bead" should be  "$qj$ is the atomic coordinate for the j-th bead", to make the notation consistent.
评论
 ## 1. Preparing A Mo...

914597418@qq.com

2023-08-22
I wonder if I trained a DP model without using PIMD , does it also work when I run LAMMPS with fixing PIMD? By the way, does it describe the solid-solid phase transition more accurately?
评论