A problem I had when using the CUSTOM function to define a CV

360 views
Skip to first unread message

Hang LYU

unread,
Mar 25, 2021, 8:39:28 AM3/25/21
to PLUMED users
Dear developers and users of Plumed,
   I am trying to repeat a metadynamics simulation of a nucleation process of Ge2Sb2Te5 reported in a paper(Adv. Funct. Mater. 2015, 25, 6407–6413). I follow their supporting infomation to define the CV. In their calculation, they used something similar to the local steinhardt order parameter to monitor the crystallinity of the system.

   WeChat Screenshot_20210325195759.png

WeChat Screenshot_20210325195859.png

WeChat Screenshot_20210325194859.png
     The final CV is define in the following way:
    WeChat Screenshot_20210325200006.png
     As shown by the fomula above, they randomly selected an atom i and calculated the switch function between i and j. The final CV is an average sum with the switch function fij as the weight. In order to implement this CV. I wrote the following lines in plumed.dat.

UNITS LENGTH=A TIME=fs

i: GROUP ATOMS=52 
j: GROUP ATOMS=1-72 

### To calculate the local steinhardt parameter ###
q6: Q6 SPECIES=1-72 SWITCH={RATIONAL R_0=3.86 D_0=0 NN=24 MM=48} 
lq6: LOCAL_Q6 SPECIES=q6 SWITCH={RATIONAL R_0=5.52 D_0=0 NN=24 MM=48}
### To calculate the local steinhardt parameter ###

### To get the fij in the final CV ###
con_mat: CONTACT_MATRIX GROUPA=j GROUPB=i SWITCH={RATIONAL R_0=7.82 D_0=0 NN=24 MM=48}
real_con_mat: COORDINATIONNUMBER WEIGHT=con_mat.w
### To get the fij in the final CV ###

### To get the final CV ###
m: CUSTOM ARG1=lq6 ARG2=real_con_mat FUNC=x*y PERIODIC=NO
CV: COMBINE ARG=m PERIODIC=NO
### To get the final CV ###

   However, when I test this input file using plumed driver, the following error was reported. Seems like that I cannot use the CUSTOM function to multiply lq6 and fij. Is there other command in plumed can be applied to obtaine the final CV.
WeChat Screenshot_20210325203148.png

Best wishes,
Hang LYU

Gareth Tribello

unread,
Mar 25, 2021, 9:34:53 AM3/25/21
to plumed...@googlegroups.com
Hello

I am slightly confused by what you are doing here.  First of all are you using the master branch of PLUMED or hack-the-tree?

I don’t understand these lines:

con_mat: CONTACT_MATRIX GROUPA=j GROUPB=i SWITCH={RATIONAL R_0=7.82 D_0=0 NN=24 MM=48}
real_con_mat: COORDINATIONNUMBER WEIGHT=con_mat.w

You take the number of atoms from group i (which contains one atom) that are within the coordination sphere of group j (multiple atoms).   This quantity is a vector that can be 1 or zero.  Is this what you want?

If you send a frame and an example input maybe I can take a look later.  I need more detail though.

Good luck
Gareth

Hang LYU

unread,
Mar 25, 2021, 1:21:47 PM3/25/21
to PLUMED users
Hello,
   Sorry for making the confusion. 
   From the LOCAL_Q6 command, i get a vector lq6 = [lq6.1,  lq6.2,  lq6.3,  lq6.4,  lq6.5,  lq6.6] (assume that there are 6 atoms in the system). 
   微信截图_20210326010508.png
   Following the formula in the paper, I need a vector fij consisting of 1 or 0 depending whether the distance between atom i and atom j is smaller than 7.82 Å. For example, this vector fij  is [1, 0, 0, 1, 1, 0]. Then I can use a dot-product to get the CV. CV = 1 × lq6.1 + 0 × lq6.2 + 0 × lq6.3 + 1 × lq6.4  + 1 × lq6.5  + 0 × lq6.6.
   The frame and the input file are also attach below.

Best wishes,
Hang LYU
GST.pdb
plumed.inp

Gareth Tribello

unread,
Mar 29, 2021, 5:04:59 AM3/29/21
to plumed...@googlegroups.com
Hi 

Sorry for taking a while to get back to you on this one.  I have assumed that you are using the hack-the-tree branch.

Given this I would modify your input to the following:

UNITS LENGTH=A TIME=fs

  

a: GROUP ATOMS=52
o: GROUP ATOMS=1-72

q6: Q6 SPECIES=1-72 SWITCH={RATIONAL R_0=3.86 D_0=0 NN=24 MM=48}
lq6: LOCAL_Q6 SPECIES=q6 SWITCH={RATIONAL R_0=5.52 D_0=0 NN=24 MM=48}

dist: DISTANCES ORIGIN=a ATOMS=o
real_con_mat: LESS_THAN ARG1=dist SWITCH={RATIONAL R_0=7.82 D_0=0 NN=24 MM=48}

m: CUSTOM ARG1=lq6_av ARG2=real_con_mat FUNC=x*y PERIODIC=NO
CV1: COMBINE ARG=m PERIODIC=NO

Look at the log and notice that lq6_av is the normalised version of the local_q6 (i.e. divided by the coordination numbered thus between 0 and 1).  If you want to work with the unormalised version of the local_q6 you can use lq6 in the line labelled m.

I hope this helps
Good luck
Gareth

On 25 Mar 2021, at 17:21, Hang LYU <terryh...@gmail.com> wrote:

<plumed.inp>

Hang LYU

unread,
Mar 31, 2021, 5:14:18 AM3/31/21
to PLUMED users
Dear Gareth,
   Sorry for my late reply. I have tried the code, and it works now.
   Thanks so much for your help.

Best wishes and thanks,
Hang LYU
Reply all
Reply to author
Forward
0 new messages