Problem with WALLS in PBC

510 views
Skip to first unread message

trac...@natur.cuni.cz

unread,
Dec 9, 2020, 6:18:11 AM12/9/20
to PLUMED users
Dear plumed developers and users,

I am experiencing a weird issue (possibly a bug) I don't fully understand. I am running a metadynamics in Lammps where I want the CV space to be limited using walls (see the plumed.dat file below):

UNITS LENGTH=A TIME=fs ENERGY=kcal/mol
cent: COM ATOMS=481-482
pos: POSITION SCALED_COMPONENTS ATOM=cent
cv1: CUSTOM ARG=pos.a VAR=a FUNC=18.413*a PERIODIC=0,18.413
cv2: CUSTOM ARG=pos.b VAR=b FUNC=18.413*b PERIODIC=0,18.413
cv3: CUSTOM ARG=pos.c VAR=c FUNC=18.413*c PERIODIC=0,18.413
METAD ...
     ARG=cv1,cv2,cv3 PACE=2000 HEIGHT=0.25 SIGMA=0.5,0.5,0.5 FILE=HILLS TEMP=480.0 BIASFACTOR=20
     GRID_MIN=0,0,0 GRID_MAX=18.413,18.413,18.413 GRID_BIN=200,200,200
     LABEL=metad
... METAD
LOWER_WALLS ARG=cv1,cv2,cv3 AT=0.8,0.8,0.8 KAPPA=400.0,400.0,400.0 LABEL=wl
UPPER_WALLS ARG=cv1,cv2,cv3 AT=17.9,8.1,8.1 KAPPA=400.0,400.0,400.0 LABEL=wu
PRINT STRIDE=2000 ARG=cv1,cv2,cv3,metad.bias FILE=COLVAR
PRINT STRIDE=2000 ARG=cv1,cv2,cv3,wl.bias,wu.bias FILE=WALLS

The output WALLS file (see below) indicates, that the upper wall was "active" even though it should not be (the CVs do not exceed the limits). I analyzed the issue and it seems the cv1 value printed in WALLS file and used by the UPPER_WALLS differs by a lattice vector a, the value for UPPER_WALLS thus ignoring the periodicity (cv1 value 3.48824+18.413 is outside the 0 to 18.413 range).

#! FIELDS time cv1 cv2 cv3 wl.bias wu.bias
#! SET min_cv1 0
#! SET max_cv1 18.413
#! SET min_cv2 0
#! SET max_cv2 18.413
#! SET min_cv3 0
#! SET max_cv3 18.413
 0.000000 3.488247 4.939113 4.254889 0.000000 6403.990392

The problem seems to stem from the treatment of the periodic boundary conditions. I am using Lammps (3 Mar 2020) with Plumed (2.6.0). The unit cell is rhombohedral
0  18.4131 xlo xhi
0  18.3539 ylo yhi
0  18.2841 zlo zhi
 -1.4759  -1.4759  -1.5993 xy xz yz
in other format
   18.41312    0.00000    0.00000
   -1.47588   18.35394    0.00000
   -1.47588   -1.59927   18.28408
I observed the issue for both LOWER_WALLS and UPPER_WALLS, but only for the a lattice vector (cv1 variable).

In this moment, I do not know how to solve this. Any advice or suggestion will be appreciated. If needed, I may send the files necessary to replicate the issue by email.

Michal Trachta

unread,
Dec 9, 2020, 7:41:54 AM12/9/20
to PLUMED users
For the time being, I removed the walls from plumed.dat and I will be using walls in Lammps. However, I would still prefer to have all the bias potential handled by only one code.

Dne středa 9. prosince 2020 v 12:18:11 UTC+1 uživatel trac...@natur.cuni.cz napsal:

Omar Valsson

unread,
Dec 9, 2020, 7:56:24 AM12/9/20
to trac...@natur.cuni.cz, plumed...@googlegroups.com
Hello, 

I had similar issue with a distance that was periodic (but with Gromacs+PLUMED) but I solved it by defining CVs with PERIODIC=NO, so they are not periodic and using these CVs for the walls, but only for the walls. I still used the original CVs for the MetaD so the periodicity is correctly taken into account in the MetaD bias/FES. 

You can try something like this (changes in bold)

UNITS LENGTH=A TIME=fs ENERGY=kcal/mol
cent: COM ATOMS=481-482
pos: POSITION SCALED_COMPONENTS ATOM=cent
cv1: CUSTOM ARG=pos.a VAR=a FUNC=18.413*a PERIODIC=0,18.413
cv2: CUSTOM ARG=pos.b VAR=b FUNC=18.413*b PERIODIC=0,18.413
cv3: CUSTOM ARG=pos.c VAR=c FUNC=18.413*c PERIODIC=0,18.413
cv1_nopbc: CUSTOM ARG=pos.a VAR=a FUNC=18.413*a PERIODIC=NO
cv2_nopbc: CUSTOM ARG=pos.b VAR=b FUNC=18.413*b PERIODIC=NO
cv3_nopbc: CUSTOM ARG=pos.c VAR=c FUNC=18.413*c PERIODIC=NO
METAD ...
     ARG=cv1,cv2,cv3 PACE=2000 HEIGHT=0.25 SIGMA=0.5,0.5,0.5 FILE=HILLS TEMP=480.0 BIASFACTOR=20
     GRID_MIN=0,0,0 GRID_MAX=18.413,18.413,18.413 GRID_BIN=200,200,200
     LABEL=metad
... METAD
LOWER_WALLS ARG=cv1_nopbc,cv2_nopbc,cv3_nopbc AT=0.8,0.8,0.8 KAPPA=400.0,400.0,400.0 LABEL=wl
UPPER_WALLS ARG=cv1_nopbc,cv2_nopbc,cv3_nopbc AT=17.9,8.1,8.1 KAPPA=400.0,400.0,400.0 LABEL=wu
PRINT STRIDE=2000 ARG=cv1,cv2,cv3,metad.bias FILE=COLVAR
PRINT STRIDE=2000 ARG=cv1,cv2,cv3,wl.bias,wu.bias FILE=WALLS

You of course need to make sure that the CVs cv1,cv2,cv3 are inside the range defined by the lower and upper wall. 

Best regards,
Omar 
--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/5131a7f0-c809-4c10-8b82-e17877966ec1o%40googlegroups.com.

Michal Trachta

unread,
Dec 9, 2020, 8:31:33 AM12/9/20
to PLUMED users
Thank you very much, Omar. Your solution works nicely!

Dne středa 9. prosince 2020 v 13:56:24 UTC+1 uživatel omar.v...@gmail.com napsal:

Giovanni Bussi

unread,
Dec 9, 2020, 8:43:02 AM12/9/20
to plumed...@googlegroups.com
Thanks!

I think this is a good point. PBCs are now handled by taking the minimal image convention between the current value and the wall value. Given this post, I am not anymore sure we are doing the right thing...


Meanwhile, Omar's solution seems perfect.

Giovanni


Reply all
Reply to author
Forward
0 new messages