correlation versus distance at equal time

252 views
Skip to first unread message

Saeed Pourasad

unread,
Nov 20, 2021, 5:26:14 AM11/20/21
to PLUMED users
Dear PLUMED users,

I need to calculate the "equal time correlation function for density or Q6 (as bond orientation function) and I was wondering If I can do this with PLUMED?
for example, I need to have a Q6 correlation versus distance! same as what we do for calculating the radial distribution function.

something like the below image:
1024px-Ferromagnetic_correlation_functions_around_Tc.svg.png

I will appreciate your assistance.

Gareth Tribello

unread,
Nov 22, 2021, 4:22:14 AM11/22/21
to plumed...@googlegroups.com
Hello

Calculating this using the release version of PLUMED is (I think) impossible.  I think you can do it with a modified version of PLUMED though that you can get by issuing the following commands:

git checkout hack-the-tree

You then compile in the normal way.

Your input is then going to look something like this:

# Calculate Q6 vectors for all atoms
q6: Q6 SPECIES=1-100 SWITCH={RATIONAL R_0=0.1}
# Now calculate matrix of dot products between Q6 vectors
lq6: LOCAL_Q6 SPECIES=q6 SWITCH={RATIONAL D_0=10 R_0=1}  # Make D_0 equal to the box length here so that the switching function on distance isn’t used
# Now calculate all distances between all points
d1: DISTANCE_MATRIX GROUP=1-100 CUTOFF=10  # This may work without cutoff am not sure
# Now calculate weights histogram.  Heights of kernels here are the values of the dot products
dens_n: KDE HEIGHTS=lq6 ARG1=d1 GRID_BIN=100 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED
# And density of distances
dens_d: KDE ARG1=d1 GRID_BIN=100 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED
# And now calculate average correlation at a particular distance
dens: CUSTOM ARG1=dens_n ARG2=dens_d FUNC=x/y PERIODIC=NO
# And print out the final correlation function
PRINT ARG=dens FILE=corr.grid 

I hope that works.  No one has tried anything like this before.

Let me know how it goes please.

Thanks
Gareth




On 20 Nov 2021, at 10:26, Saeed Pourasad <saeedp...@gmail.com> wrote:

Dear PLUMED users,

I need to calculate the "equal time correlation function for density or Q6 (as bond orientation function) and I was wondering If I can do this with PLUMED?
for example, I need to have a Q6 correlation versus distance! same as what we do for calculating the radial distribution function.

something like the below image:
<1024px-Ferromagnetic_correlation_functions_around_Tc.svg.png>

I will appreciate your assistance.

--
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/4638cc91-88a4-40af-887d-78e5046f5872n%40googlegroups.com.
<1024px-Ferromagnetic_correlation_functions_around_Tc.svg.png>

Saeed Pourasad

unread,
Nov 22, 2021, 5:11:59 AM11/22/21
to PLUMED users
Dear Gareth,

Thanks for your reply.
I was wondering if I can use this Plumed2 version with LAMMPS or not?

Best,
Saeed.

Gareth Tribello

unread,
Nov 22, 2021, 5:13:31 AM11/22/21
to plumed...@googlegroups.com
Yes

This version of PLUMED is still compatible with LAMMPS, gromacs and all the other codes PLUMED works with.

Gareth

Saeed Pourasad

unread,
Nov 23, 2021, 8:13:40 PM11/23/21
to PLUMED users
Dear Gareth,

As you know, by  "make lib-plumed args="-b" in the plumed package installation step on LAMMPS, we can download plumed2 from git and install it in lib/plumed/plumed2.
The libplumed.a library compiled in the plumed2/lib directory would be included in lmp_mpi and installed (More details can be found in lammps-[version]/lib/plumed/Install.py.).

Now, I have done this process but the problem is I don't know how I can call plumed2 by LAMMPS instead of PLUMED itself!

Michele Invernizzi

unread,
Nov 24, 2021, 2:31:33 AM11/24/21
to plumed...@googlegroups.com
Hi Saeed,

Here is the relevant page of the manual https://docs.lammps.org/fix_plumed.html

For practical examples you can check on the PLUMED-NEST, e.g. here the sodium simulation is done with LAMMPS: https://www.plumed-nest.org/eggs/20/022 (follow the git archive link for the LAMMPS input).

Best,
Michele

Saeed Pourasad

unread,
Nov 24, 2021, 3:49:56 AM11/24/21
to plumed...@googlegroups.com
Dear Michele,

Thanks for your reply.
I am familiar with PLUMED and I know how to use it with LAMMPS.
If you check the previous emails, I had a question about correlation versus distance and Gareth gave me an idea about it.
But the thing is I need to use Plumed2 version instead of Plumed! 
As I mentioned in my previous email, I have already installed it (plumed2) in lammps/plumed library but I do not know how I should call it by LAMMPS!

You received this message because you are subscribed to a topic in the Google Groups "PLUMED users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plumed-users/a6B9wN3cEUA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plumed-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/CAGBhpieKudDX7e1nZrp%2BLpaTERCSM%3DGie19adWwmLNKD__WHmw%40mail.gmail.com.


--
Saeed Pourasad

Gareth Tribello

unread,
Nov 24, 2021, 4:08:28 AM11/24/21
to plumed...@googlegroups.com
Hi Saeed

It is difficult to answer your question without knowing how you built PLUMED+LAMMPS the first time that you did it.  The instructions on how to compile these two codes together are here:


If you did the runtime compilation it is simple.  You just change the PLUMED_KERNEL variable in your environment.  You can do this by running source source.sh inside the plumed2 directory.  If you did it any other way then you will need to recompile LAMMPS + PLUMED using the instructions you can find at the link above.  

I hope this helps
Gareth

Message has been deleted
Message has been deleted

Saeed Pourasad

unread,
Nov 25, 2021, 2:46:00 AM11/25/21
to PLUMED users
Dear Gareth,

I am trying to use your suggested plumed input file and I have been faced with this error:  I cannot understand line: DISTANCE_MATRIX LABEL=d1 GROUP=1-100

Do you know how I can get rid of it?!

I appreciate your time and help.
Best,
Saeed.

Gareth Tribello

unread,
Nov 25, 2021, 4:20:47 AM11/25/21
to plumed...@googlegroups.com
Hello Saeed

I am slightly confused as I could swear I received another email about compiling from you but I can’t seem to find it.  In answer to your question the command DISTANCE_MATRIX will only work if you use the hack-the-tree branch.  You should also use the following version of configure when you build PLUMED:

./conigure —enable-modules=all

If neither of those things work then do:

grep DISTANCE_MATRIX src/*/*cpp

in the plumed2 directory to check if the code for that particular command is within the plumed source code.

I hope this helps
Gareth

Saeed Pourasad

unread,
Nov 25, 2021, 4:27:15 AM11/25/21
to plumed...@googlegroups.com
Dear Gareth,

Thanks for your reply.
I am sorry about that! I had faced one other error that I could solve by myself, so I removed my question from the plumed forum!

Best,
Saeed.



--
Saeed Pourasad

Gareth Tribello

unread,
Nov 25, 2021, 4:30:19 AM11/25/21
to plumed...@googlegroups.com
That is no problem.  

Thanks for clearing up the issue

Gareth

Saeed Pourasad

unread,
Nov 29, 2021, 1:04:23 AM11/29/21
to plumed...@googlegroups.com
Dear Gareth,

I am still struggling to install plumed2 and use it by LAMMPS!
Thanks to our supercomputer support team, We installed the Plumed2 (2.8.0-dev)  but the latest, and also 3 Mar 2020 versions of LAMMPS do not support it!
(ERROR: Incompatible API version for PLUMED in fix plumed. Only Plumed 2.4.x, 2.5.x, and 2.6.x are tested and supported. (../fix_plumed.cpp:82))

Can you please let me know which version of LAMMPS is compatible with Plumed2?

Best,
Saeed. 



--
Saeed Pourasad

Gareth Tribello

unread,
Nov 29, 2021, 4:06:41 AM11/29/21
to plumed...@googlegroups.com
Ah yes

Sorry about this.  If you go into the Lammps source code and search for the file fix_plumed.cpp (it should be in src/USER-PLUMED/fix_plumed.cpp).  You then look for this line:

p->cmd("getApiVersion",&api_version);
  if ((api_version < 5) || (api_version > 7))
    error->all(FLERR,"Incompatible API version for PLUMED in fix plumed. "
               "Only Plumed 2.4.x, 2.5.x, and 2.6.x are tested and supported.");

If you comment out the if statement and the error like this:

p->cmd("getApiVersion",&api_version);
//  if ((api_version < 5) || (api_version > 7))
//    error->all(FLERR,"Incompatible API version for PLUMED in fix plumed. "
//               "Only Plumed 2.4.x, 2.5.x, and 2.6.x are tested and supported.");

Then that error message will disappear.  I am pretty sure that this will not cause problems for what you are doing.

Good luck
Gareth



Message has been deleted
Message has been deleted
Message has been deleted

Saeed Pourasad

unread,
Dec 9, 2021, 1:12:30 AM12/9/21
to plumed...@googlegroups.com

Dear Gareth,

I hope you are doing well.
I tried your suggested input file:
--------------------------------------------------------------------------------------------------------------------------------------------------------

# Calculate Q6 vectors for all atoms
q6: Q6 SPECIES=1-100 SWITCH={RATIONAL R_0=0.1}
# Now calculate matrix of dot products between Q6 vectors
lq6: LOCAL_Q6 SPECIES=q6 SWITCH={RATIONAL D_0=10 R_0=1}  # Make D_0 equal to the box length here so that the switching function on distance isn’t used
# Now calculate all distances between all points
d1: DISTANCE_MATRIX GROUP=1-100 CUTOFF=10  # This may work without cutoff am not sure
# Now calculate weights histogram.  Heights of kernels here are the values of the dot products
dens_n: KDE HEIGHTS=lq6 ARG1=d1 GRID_BIN=100 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED
# And density of distances
dens_d: KDE ARG1=d1 GRID_BIN=100 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED
# And now calculate average correlation at a particular distance
dens: CUSTOM ARG1=dens_n ARG2=dens_d FUNC=x/y PERIODIC=NO
# And print out the final correlation function
PRINT ARG=dens FILE=corr.grid 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
and it gives this error:

 +++ PLUMED error
 +++ at Action.cpp:264, function void PLMD::Action::error(const std::basic_string<char, std::char_traits<char>, std::allocator<char>> &) const
 +++ message follows +++
ERROR in input to action KDE_CALC with label dens_n : action d1 has no component named d1 (hint! the components in this actions are: d1.w )


Any help would be appreciated.
Best,
Saeed.

On Tue, Dec 7, 2021 at 4:30 PM Saeed Pourasad <saeedp...@gmail.com> wrote:
Dear Gareth,

I hope you are doing well.
I still have a problem with using Plumed2!
Have you ever used Plumed2 with LAMMPS?
During the installation process of Plumed2 on LAMMPS, I get one strange error that I do not know how to get rid of!
this is the error:
undefined reference to `_intel_fast_memmove'

If you use LAMMPS please let me know which version you use?!

Best,
Saeed.



--
Saeed Pourasad

Gareth Tribello

unread,
Dec 9, 2021, 6:18:01 AM12/9/21
to plumed...@googlegroups.com
Ah  sorry my bad.You need to make the following substitution:

# Now calculate weights histogram.  Heights of kernels here are the values of the dot products
dens_n: KDE HEIGHTS=lq6 ARG1=d1.w GRID_BIN=100 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED
# And density of distances
dens_d: KDE ARG1=d1.w GRID_BIN=100 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED

Good luck
Gareth

Saeed Pourasad

unread,
Dec 9, 2021, 10:05:22 PM12/9/21
to plumed...@googlegroups.com
Dear Gareth,

Thanks for your reply.
I changed the input and Now, I got this error:

PLUMED: +++ PLUMED error
PLUMED: +++ at Action.cpp:264, function void PLMD::Action::error(const std::basic_string<char, std::char_traits<char>, std::allocator<char>> &) const
PLUMED: +++ message follows +++
PLUMED: ERROR in input to action KDE_CALC with label dens_n : mismatch between numbers of values in input arguments and HEIGHTS

Best,
Saeed.




--
Saeed Pourasad

Gareth Tribello

unread,
Dec 10, 2021, 4:29:56 AM12/10/21
to plumed...@googlegroups.com
Ah

That one needs a bit more thought.  Can you possibly send me a couple of frames in xyz format and the plumed  input file and I will see if I can get it running.

Thanks
Gareth

Saeed Pourasad

unread,
Dec 10, 2021, 5:22:51 AM12/10/21
to plumed...@googlegroups.com
Dear Gareth,

I have attached the requested files for your consideration.
Thanks for your attention to this matter.

Best,
Saeed.

--
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.


--
Saeed Pourasad
conf.xyz
plumed.dat

Gareth Tribello

unread,
Dec 10, 2021, 9:40:30 AM12/10/21
to plumed...@googlegroups.com
Hi Saeed

I made a mistake in that input.  If you change to:

KDE HEIGHTS=lq6_dpmat ARG1=d1.w GRID_BIN=10 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_n

the calculation runs.  All the values in your correlation function are zero, however.  I am not sure why this is and would need to do some more investigating to find out.  It may simply be that I have not converted the units correctly in your input file.

Separately, please note that the input file I sent you calculates the correlation function for a single frame only.  I would imagine you want to calculate a time average of this quantity?  If you want to do that then the input is going to be a bit different.

Good luck
Gareth

Saeed Pourasad

unread,
Dec 11, 2021, 7:05:48 AM12/11/21
to plumed...@googlegroups.com
Dear Gareth,
I appreciate your help and attention.
I had already found out that this input can just give me one single frame correlation and Yes! I need the average time for it!

Since the distance unit in PLUMED is nanometer so my settings in the input file are wrong! I will fix it!

Have a great weekend.
Best,
Saeed.



--
Saeed Pourasad

Saeed Pourasad

unread,
Dec 13, 2021, 5:16:46 AM12/13/21
to plumed...@googlegroups.com
Dear Gareth,
 
I followed your suggested input exactly!
#-------------------------------------------------------------------------------------------------
Ow: GROUP ATOMS=1-3072:3

# Calculate Q6 vectors for all atoms
Q6 SPECIES=Ow SWITCH={RATIONAL R_0=0.1} LABEL=q6

# Now calculate matrix of dot products between Q6 vectors
LOCAL_Q6 SPECIES=q6 SWITCH={RATIONAL D_0=2.4 R_0=1} LABEL=lq6  # Make D_0 equal to the box length here so that the switching function on distance isn’t used

# Now calculate all distances between all points
DISTANCE_MATRIX GROUP=Ow  CUTOFF=1.2 LABEL=d1                  # This may work without cutoff am not sure

# Now calculate weights histogram.  Heights of kernels here are the values of the dot products
KDE HEIGHTS=lq6_dpmat ARG1=d1.w GRID_BIN=5 BANDWIDTH=0.05 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_n

# And density of distances
KDE ARG1=d1.w GRID_BIN=5 BANDWIDTH=0.05 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_d

# And now calculate average correlation at a particular distance
CUSTOM ARG1=dens_n ARG2=dens_d FUNC=x/y PERIODIC=NO LABEL=dens

# And print out the final correlation function
PRINT ARG=dens  FILE=corr.grid
#-----------------------------------------------------------------------------------------------------------

Although this input has a PRINT command at the end it doesn't show the file up! Do you have any idea? (The attached file is the log file of the PLUMED that doesn't show any error!)

And one more thing, can you please let me know how I can get the time average of this correlation?
I tried not to ask you and fix it by myself but I couldn't! I am sorry. 

Thanks for your attention.
Best,
Saeed.
--
Saeed Pourasad
log.plumed

Gareth Tribello

unread,
Dec 13, 2021, 6:00:32 AM12/13/21
to plumed...@googlegroups.com
Hello Saeed

Here is a revised input that does the averaging:

Ow: GROUP ATOMS=1-3072:3
# Calculate Q6 vectors for all atoms
Q6 SPECIES=Ow SWITCH={RATIONAL R_0=0.1} LABEL=q6
# Now calculate matrix of dot products between Q6 vectors
LOCAL_Q6 SPECIES=q6 SWITCH={RATIONAL D_0=2.4 R_0=1} LABEL=lq6  # Make D_0 equal to the box length here so that the switching function on distance isn’t used
# Now calculate all distances between all points
DISTANCE_MATRIX GROUP=Ow  CUTOFF=1.2 LABEL=d1                  # This may work without cutoff am not sure
# Now calculate weights histogram.  Heights of kernels here are the values of the dot products
KDE HEIGHTS=lq6_dpmat ARG1=d1.w GRID_BIN=5 BANDWIDTH=0.05 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_n
# And density of distances
KDE ARG1=d1.w GRID_BIN=5 BANDWIDTH=0.05 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_d
# Accumulate numerator and denominator over simulation
numer: AVERAGE ARG=dens_n NORMALISATION=false STRIDE=10 CLEAR=100000 
denom: AVERAGE ARG=dens_d NORMALISATION=false STRIDE=10 CLEAR=100000 
# And now calculate average correlation at a particular distance
CUSTOM ARG1=numer ARG2=denom FUNC=x/y PERIODIC=NO LABEL=dens
# And print out the final correlation function
PRINT ARG=dens  FILE=corr.grid STRIDE=100000

There are two important parameters for you to control here.  The first is the STRIDE on the lines labelled numerous and denom.  The stride values on these two lines should be the same.  They are basically telling how often to calculate the “histograms” and add them to the averages.  I would not set this equal to one if I were you.  I would allow the configuration to decorate between your calculations of this quantity for the ensemble average.  The second is the print frequency (STRIDE on PRINT line and CLEAR values).  The way that I have written this means that you are calculating time averages over blocks of trajectory that are 100000 steps long.  Every 100000 steps the numerator and denominator in the average are set equal to zero (they are cleared) and the averaging starts again.  This happens after the printing has been done.

I hope this gets you on your way.

Good luck
Gareth

Saeed Pourasad

unread,
Dec 13, 2021, 10:56:43 PM12/13/21
to plumed...@googlegroups.com
Dear Gareth,

I appreciate your time and attention.
I tried to run your suggested input with no change!
#------------------------------------------------------------------------------------------------
Ow: GROUP ATOMS=1-3072:3
# Calculate Q6 vectors for all atoms
Q6 SPECIES=Ow SWITCH={RATIONAL R_0=0.1} LABEL=q6
# Now calculate matrix of dot products between Q6 vectors
LOCAL_Q6 SPECIES=q6 SWITCH={RATIONAL D_0=2.4 R_0=1} LABEL=lq6  # Make D_0 equal to the box length here so that the switching function on distance isn’t used
# Now calculate all distances between all points
DISTANCE_MATRIX GROUP=Ow  CUTOFF=1.2 LABEL=d1                  # This may work without cutoff am not sure
# Now calculate weights histogram.  Heights of kernels here are the values of the dot products
KDE HEIGHTS=lq6_dpmat ARG1=d1.w GRID_BIN=5 BANDWIDTH=0.05 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_n
# And density of distances
KDE ARG1=d1.w GRID_BIN=5 BANDWIDTH=0.05 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_d
# Accumulate numerator and denominator over simulation
numer: AVERAGE ARG=dens_n NORMALIZATION=false STRIDE=10 CLEAR=100000
denom: AVERAGE ARG=dens_d NORMALIZATION=false STRIDE=10 CLEAR=100000

# And now calculate average correlation at a particular distance
CUSTOM ARG1=numer ARG2=denom FUNC=x/y PERIODIC=NO LABEL=dens
# And print out the final correlation function
PRINT ARG=dens  FILE=corr.grid STRIDE=100000
#----------------------------------------------------------------------------------------------------------------------------------

But it gave me this error:

+++ PLUMED error
+++ at Value.cpp:295, function double PLMD::Value::get(const unsigned int &, bool) const
+++ assertion failed: ival<data.size()
+++ message follows +++
cannot get value from dens_n_height


I have attached the log.plumed file with this email.
Thanks a lot for your patience.

Best,
Saeed.


You received this message because you are subscribed to a topic in the Google Groups "PLUMED users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plumed-users/a6B9wN3cEUA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plumed-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/55C45994-8E2C-4F4B-8F43-FCB33D9D0A32%40gmail.com.


--
Saeed Pourasad
log.plumed

Gareth Tribello

unread,
Dec 14, 2021, 5:42:57 AM12/14/21
to plumed...@googlegroups.com
Hello

Sorry about that. I was being lazy with the input and my shortcuts appeared to not work.  Here is a fix where I have done things more explicitly.  This runs but it is slow.  Then again though the analysis that you are doing is quite computationally complicated.  You should be able to make it faster if you exploit a parallel computer, which I did not.

Good luck
Gareth

Ow: GROUP ATOMS=1-3072:3
# Calculate Q6 vectors for all atoms
Q6 SPECIES=Ow SWITCH={RATIONAL R_0=0.1} LABEL=q6
# Make normalising matrix
ones: CONSTANT_VALUE VALUES=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
q6_nmat: DOT ARG1=q6_norm ARG2=ones
# Put all elements of (unormalized) Q6 vector in matrix
q6_uvecs: VSTACK ...
  ARG1=q6.rm-[-6]
  ARG2=q6.im-[-6]
  ARG3=q6.rm-[-5]
  ARG4=q6.im-[-5]
  ARG5=q6.rm-[-4]
  ARG6=q6.im-[-4]
  ARG7=q6.rm-[-3]
  ARG8=q6.im-[-3]
  ARG9=q6.rm-[-2]
  ARG10=q6.im-[-2]
  ARG11=q6.rm-[-1]
  ARG12=q6.im-[-1]
  ARG13=q6.rm-[0]
  ARG14=q6.im-[0]
  ARG15=q6.rm-[1]
  ARG16=q6.im-[1]
  ARG17=q6.rm-[2]
  ARG18=q6.im-[2]
  ARG19=q6.rm-[3]
  ARG20=q6.im-[3]
  ARG21=q6.rm-[4]
  ARG22=q6.im-[4]
  ARG23=q6.rm-[5]
  ARG24=q6.im-[5]
  ARG25=q6.rm-[6]
  ARG26=q6.im-[6]
...
# Normalise Q6 values
q6_normed: CUSTOM ARG1=q6_uvecs ARG2=q6_nmat FUNC=x/y PERIODIC=NO
# Take transpose of matrix so we can compute all dot products
q6_normedT: TRANSPOSE ARG=q6_normed
# And now compute matrix of dot products
lq6_dpmat: DOT ARG1=q6_normed ARG2=q6_normedT
# Now calculate all distances between all points
DISTANCE_MATRIX GROUP=Ow  CUTOFF=12 LABEL=d1                  # This may work without cutoff am not sure
# Now calculate weights histogram.  Heights of kernels here are the values of the dot products
KDE HEIGHTS=lq6_dpmat ARG1=d1.w GRID_BIN=10 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_n
# And density of distances
KDE ARG1=d1.w GRID_BIN=10 BANDWIDTH=0.1 GRID_MIN=0 GRID_MAX=2 UNORMALIZED LABEL=dens_d
# Accumulate numerator and denominator over simulation
numer: AVERAGE ARG=dens_n NORMALIZATION=false STRIDE=10 CLEAR=100000
denom: AVERAGE ARG=dens_d NORMALIZATION=false STRIDE=10 CLEAR=100000
# And now calculate average correlation at a particular distance
CUSTOM ARG1=numer ARG2=denom FUNC=x/y PERIODIC=NO LABEL=dens
# And print out the final correlation function
PRINT ARG=dens FILE=corr.grid

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages