Plotting Metadynamics Colvar with graph.psmp

605 views
Skip to first unread message

Liam H

unread,
Jun 27, 2023, 10:51:45 AM6/27/23
to cp2k
Hello.

I have been running metadynamics simulations with multiple colvar, 6 in this case.

This is because I want to be able to plot different surfaces with different colvar, because I can't visualize a 6 dimensional surface.

graph.psmp -cp2k -file input.restart -ndim 2 -ndw 1 2 -out fes.dat

This works fine to give me the 3D surface, (cv1,cv2,energy)
I would like to plot (cv1,cv3,energy) 

but running the command:
graph.psmp -cp2k -file input.restart -ndim 2 -ndw 1 3 -out fes.dat

Does not work.

graph.psmp -cp2k -file input.restart -ndim 6 -ndw 1 2 3 4 5 6 -out fes.dat

This works but produces such a massive file its not practical to try and plot the 2d surface..
Is there any way to specify which cvs to be used in the plot, without plotting them all at once?


Liam H

unread,
Jun 27, 2023, 11:53:39 AM6/27/23
to cp2k
Nevermind I figured it out, by changing the -ndim to a higher number , it still allows you to map COLVAR -ndw 1 3

graph.psmp -cp2k -file input.restart -ndim 2 -ndw 1  3  -out fes.dat 
Doesnt work

graph.psmp -cp2k -file input.restart -ndim 3 -ndw 1  3  -out fes.dat
works

Liam H

unread,
Jun 27, 2023, 12:01:50 PM6/27/23
to cp2k
My concern now is that the plot I get using

graph.psmp -cp2k -file input.restart -ndim 2 -ndw 1  2  -out fes.dat

Is not identical when doing -ndim 3 and only mapping the first two CV

graph.psmp -cp2k -file input.restart -ndim 3 -ndw 1  2  -out fes.dat

I am not sure how this could be, raw data itself looks correct but when plotting the surface it isn't the same the minimums and saddlepoint are completely different when plotting the same CV

Marcella Iannuzzi

unread,
Jun 27, 2023, 12:25:32 PM6/27/23
to cp2k

Hello,

Both are wrong, the dimension of the sampled space is 6 therefore -ndim 6 is the correct input.
Regards
Marcella

Liam H

unread,
Jun 27, 2023, 2:45:45 PM6/27/23
to cp2k
Yes that's right although it seems to work even though I sampled 6 it will work with  -ndim 2 or  -ndim 3,

However, the issue i'm having now.. when using the -find-minima command:

Also this example is with only 3 CV to simplify, still the same issue with 6.

it works perfectly when using 

graph.psmp -cp2k -file input.restart -find-minima -ndim 2 -ndw 1  2  -out fes.dat

however if I try the same thing even with the same two CV with -ndim 3, it fails for both -ndw 1 2 and -ndw 1 3
Here is an example with the output.

The data gets plotted but the -find-minima fails, it works when i use -ndim 2 , it finds 9 minima, but in this case then i cannot access CV3 -ndw 1 3


graph.psmp -cp2k -file input.restart -find-minima -ndim 3 -ndw 1  2  -out fes.dat

FES|  Parsing file:   <input.restart>

**********************************************************************
FES|  Parameters for FES:

FES|  NDIM         ::           3
FES|  NWD          ::           2
FES|  HILLS        ::         120
FES|  COLVAR #   1 ::     (  2.070 ,  6.416)               (   MAPPED)
FES|  COLVAR #   3 ::     (  0.248 ,  3.076)               (   MAPPED)
FES|  COLVAR #   2 ::     (  1.784 ,  3.636)               (NO MAPPED)
FES|  NGRID        ::         100    100
FES|  DX           ::       0.044  0.029
FES|  CUTOFF       ::     .10000E-05
**********************************************************************


FES|  Computing Free Energy Surface
FES|  Mapping Gaussians ::  10 %
FES|  Mapping Gaussians ::  20 %
FES|  Mapping Gaussians ::  30 %
FES|  Mapping Gaussians ::  40 %
FES|  Mapping Gaussians ::  50 %
FES|  Mapping Gaussians ::  70 %
FES|  Mapping Gaussians ::  80 %
FES|  Mapping Gaussians ::  90 %
FES|  Mapping Gaussians :: 100 %
FES|  Mapping Gaussians :: 100 %
FES|  Dumping FES structure in file: < FES10.dat >
 ABORT in metadyn_tools/graph_methods.F:279 Not implemented for projected FES!
forrtl: error (76): Abort trap signal

Liam H

unread,
Jun 27, 2023, 7:44:11 PM6/27/23
to cp2k
More importantly though, since I do have the minima, I'd like to figure how to use the -find-path option.

graph.psmp -cp2k -file input.restart -find-path -ndim 2 -ndw 1  2  -out fes.dat

gives the output:
 ABORT in metadyn_tools/graph.F:362 -find-path requires the specification of -po
 int-a and -point-b !

So i've attempted a few combinations
graph.psmp -cp2k -file input.restart -find-path -point-a -point-b -ndim 2 -ndw 1  2  -out fes.dat

But I haven't been able to find any examples of the particular format for specifying -point-a and -point-b

ive tried in the format of the COLVAR , specifying XY -point-a  2.070,  6.416 -point-b 0.248,  3.076
ive tried XYZ, ive tried without comma, ive tried line number

If anyone has any information on the format of the -find-path -point-a -point-b function it would be very much appreciated!


Marcella Iannuzzi

unread,
Jun 28, 2023, 4:32:03 AM6/28/23
to cp2k

Dear ...

The search of minima using "graph" is possible only considering the whole metadynamics space, no for projections of it to lower dimension.
ndw=ndim  and ndim should be the actual dimension of the space, otherwise whatever you get is wrong.
Regards
Marcella


Liam H

unread,
Jun 30, 2023, 11:55:06 AM6/30/23
to cp2k
Hi Marcella,

Thank you that makes sense, I see the number of CVs do matter, I've replotted using only 2 ndim=ndw and the data looks much better. I can find the minima as well using -find-minima. 

I also figured out how to make use of the -find-path option by pasting the minima floats obtained from the -find-minima output for -point-a and -point-b, so I'll post it here incase anyone else is wondering.

input:

FES|  Mapping Gaussians :: 100 %
FES|  Dumping FES structure in file: < fes.dat >
 Iteration nr.           1  1.504066111949192E-002

graph.psmp -cp2k -file input.restart -ndim 2 -ndw 1 2 -out fes.dat -find-minima

output:

FES|  Dumping FES structure in file: < fes.dat >
FES| Trust hyper-radius     10    10 which is equivalent to:     0.191530    0.483382
FES| Minimum found (    2.727613    2.186932 ). FES value =    -0.001262 Hartree. Number of Iter:    102
FES| Minimum found (    3.017643    2.627451 ). FES value =    -0.019981 Hartree. Number of Iter:    101


then taking 2 relevant minima and pasting one after another with exact same digits

graph.psmp -cp2k -file input.restart -ndim 2 -ndw 1 2 -out fes.dat -find-path -point-a  2.727613    2.186932 -point-b 3.017643    2.627451

FES|  Mapping Gaussians :: 100 %
FES|  Dumping FES structure in file: < fes.dat >
 Iteration nr.           1  1.504066111949192E-002
...
..
 MEP saved on <mep.data> file.

FES| NORMAL FES TERMINATION.

Best regards,
Liam

Saurabh Negi

unread,
Sep 27, 2024, 2:04:33 AM9/27/24
to cp2k
Hii Liam H

I hope you are doing good.
I tried this and I am getting only 8 points in mep.data
How can we increase number of points in mep.data?

Thank you 
Reply all
Reply to author
Forward
0 new messages