A question about how to define the Debye form of structure factor as a collective variable in plumed

1,372 views
Skip to first unread message

Hang LYU

unread,
Sep 29, 2021, 2:16:41 PM9/29/21
to PLUMED users
Dear developers and users,
     I am trying to repeat a metadynamics simulation for crystallization of perovskite reported in an article (Sci. Adv. 2021; 7 : eabe3326). In their work, they used the Debye form of structure factor as the CV to describe the crystallinity of the system (The 1st attached figured). Then I checked the paper's SI which contains the Debye structure factor S(q) of Pb2+ ions in cubic phase of MAPbI3 (The 2nd attached figure), so I can get the q values (0.94 Å^(-1) and 1.40 Å^(-1)) of the first two peaks of the S(q) of Pb2+ (and MA+) . My understanding about the CV is that, taking S_Pb2 as an example, I need to plug the q value of the second peak into eq. 1 and then the S_Pb2 will be calculated by considering every i-j pair of Pb2+ within the cutoff radius r_c. And then the final CV is the summation of S_Pb1, S_Pb2, S_MA1 and S_MA2. I searched Plumed's maunal for the method to calculate the Debye structure factor, and I found the CV SAXS from module PLUMED-ISDB. According to the manual, the CV SAXS calculates the SAXS scattered intensity using the Debye equation, so I think I can use this to obtain the Debye structure factor and I wrote the following plumed commands (as attached in the bottom). Here is my question: is it the correct way to use the CV SAXS to calculate the Debye structure factor, or I need to use the CUSTOM command of Plumed to define how to calculate the Debye structure factor by myself?

Best regards,
Hang LYU

PS:

The plumed commands using the CV SAXS:
UNITS LENGTH=A
grp_Pb: GROUP ATOMS=1-27 # all the Pb2+
# to calculate the Debye structure factor of Pb2+ using the q value (0.94 Å^(-1)) of the first peak, the peak value of S(q) is 1.34 according to paper
S_Pb1: SAXS ATOMS=grp_Pb QVALUE1=0.94 EXPINT1=1.34

The 1st attached figure
WeChat Screenshot_20210930004536.png

The 2nd attached figure
WeChat Screenshot_20210930003137.png

Michele Invernizzi

unread,
Sep 30, 2021, 12:43:45 PM9/30/21
to plumed...@googlegroups.com
Dear Hang LYU,

The Debye CV used in that paper has not been added yet to the official PLUMED, but the code is available in this repo and on the plumed-nest you can find a simple example of how to use it https://www.plumed-nest.org/eggs/19/000/data/sodium/plumed-metad.dat.html 
You do not need to reinstall plumed, but simply put the DebyeStructureFactor.cpp file (here is the latest version) in your folder and use the LOAD keyword to add the CV on-the-fly to PLUMED.
The DebyeStructureFactor.cpp file also contains some documentation, but in case you need it I am available for clarifications.

Best,
Michele

--
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/780c1345-69b2-491c-9424-85d4d783cd14n%40googlegroups.com.

Michele Invernizzi

unread,
Sep 30, 2021, 12:45:31 PM9/30/21
to plumed...@googlegroups.com

Hang LYU

unread,
Sep 30, 2021, 3:34:29 PM9/30/21
to PLUMED users
Dear Michele,
     Thanks very much for your help which points out the right direction to have this CV implemented in Plumed. Will try to add DebyeStructureFactor.cpp to my plumed later .

Best wishes and thanks,
Hang LYU

qun ji

unread,
Jan 15, 2024, 8:47:55 AM1/15/24
to PLUMED users
Dear developers and users,
           I also tried taking the structure factor as a CV. How can I calculate the debye form of structure factor accurately?

Best regards,
Qun Ji
           图片1.png

Michele Invernizzi

unread,
Jan 16, 2024, 2:34:47 AM1/16/24
to plumed...@googlegroups.com
Dear Qun Ji,

Here is the updated link to the Debye structure factor CV described in the literature:

Best,
Michele 

qun ji

unread,
Jan 17, 2024, 2:54:48 AM1/17/24
to PLUMED users
Dear Michele,
     Thanks very much for your help!I will try the calculation of structure factor.

Best regards,
Qun Ji

qun ji

unread,
Feb 28, 2024, 2:44:57 AM2/28/24
to PLUMED users
Dear Michele,

The SI of this paper presents the Debye  form of structure factor S(q) containing Pb2+ ions in the cubic phase of MAPbI3. The example given by plumed is to calculate the XRD for the entire material and then select the ACTIVE_2THETA corresponding to the peak (usage example). The paper only solves the Debye structure factor as CV for specific elements. How do I find the Debye form of structure factor for a specific atom (Fig.S16) ,then set the CV in the article (CV = S_Pb1 + S_Pb2 + S_MA1 + S_MA2) in the process of calculating perovskite MAPbI3?

Best regards,
Qun Ji

1.bmp
2.bmp

Paramvir Ahlawat

unread,
Feb 28, 2024, 4:08:49 AM2/28/24
to PLUMED users
Dear Qun Ji,

Thank you for your interest in our work, and thanks to Michele for explaing details. All kinds of simulations, figures or anything in that study are very easy to reproduce.

Please excuse me for late response, although we performed quite a lot of experiments and simulations in our work, however I still had a little bit of doubt on few results, as we had a few assumptions and at same time there was a random Science paper with a similar message(10.1126/science.abf7652). But, over the years many reliable experimentalists (10.1021/jacs.1c11803, 10.1002/adfm.202102338, 10.1002/anie.202005012, 10.1002/ange.202202911) have synthesized our simulated structures and low-temperature formation of FAPbI3 is also repeated by plenty of reliable experimentalist (10.1021/acsenergylett.3c02455, 10.1038/s41586-023-06637-w), and current record efficiency perovskite solar cells by two-step from Jingbi You (10.1126/science.abp8873) and single-step from Professor Seok (10.1038/s41586-023-05825-y) have seen similar low-dimensional intermediates and based on similar low-temperature process.

Its just I am crazy busy these days, if you please allow me a few days to get back to you for all input/output files, I think they are already on Zenodo as well.

Best wishes,
Paramvir

qun ji

unread,
Feb 28, 2024, 5:42:11 AM2/28/24
to PLUMED users
Dear Paramvir Ahlawat

Thank you very much for taking the time to reply. The structural simulations in your work are extremely meaningful.

As a beginner to metadynamic, I look forward to all  files. Thank you again!

Best wishes,
Qun Ji

Yang

unread,
Feb 28, 2024, 6:20:49 AM2/28/24
to PLUMED users
Dear Paramvir Ahlawat, Qun Ji

I've been looking at it lately. I tried to copy the S(q)-q diagram provided in the article using Python, and got the correct shape. However, I noticed that the resulting S(q) value was incorrect. Furthermore, adding atomic scattering factors to this does not correct these values. It should be noted that this difference does not affect the position of the peak corresponding to the q value. So I can set the position of q, but I can't control the range of Cv. I want to know how to get the correct range of Sq values. Dear author, we are looking forward to your plumed input file, which will be very helpful to us.

In both pictures, pic2 is multiplied by the atomic scattering factor, while pic1 is not. And I am happy to offer my python programs, even though I am new to programming and hope to help more people.

Best wishes,
Yang
pic1.png
DebyeStructureFactor.py
pic2.png

Michele Invernizzi

unread,
Mar 4, 2024, 4:44:54 AM3/4/24
to plumed...@googlegroups.com
Dear Qun Ji,

while Paramvir prepares all the output to share them, I'll try to reply to your question:

> How do I find the Debye form of structure factor for a specific atom
use atom indices, you can group them under a label in this way
myPBatoms: GROUP ATOMS=2,4,13,15
myOatom: GROUP ATOMS=10,12
cv1: DEBYE_STRUCTURE_FACTOR LAMBDA=1.5406 ACTIVE_2THETA=13.2,25 CUTOFF=8 ATOMS1=myPBatoms ATOM_TYPE=Pb2+
cv2: DEBYE_STRUCTURE_FACTOR LAMBDA=1.5406 ACTIVE_2THETA=13.2,25 CUTOFF=8 ATOMS1=myPBatoms ATOMS2=myOatom ATOM_TYPE=Pb2+,O

> then set the CV in the article (CV = S_Pb1 + S_Pb2 + S_MA1 + S_MA2

qun ji

unread,
Mar 4, 2024, 9:22:33 PM3/4/24
to PLUMED users
Dear Michele,

Thank you very much!I'll try the calculation again.

Best regards,
Qun Ji

Paramvir Ahlawat

unread,
Mar 5, 2024, 10:26:12 AM3/5/24
to PLUMED users
Dear Qun Ji,

Please excuse me for late response. I have updated the Zenodo link with relevant files: https://zenodo.org/records/10782438

You can find all kinds of input files there for example:

 lammps data file: data.MAPI
 input file to run: in.lmp
 plumed input files: plumed.dat, plumed.txt, now I have taken large bias factor and some settings are there to see the quick transition, cutoff and all
 
You can also create you own lammps data files using solute_MAYPI.tcl script with any of your own perovskite supercells. One can also use ASE as well.

Codes and everything are available from Michele already and he explained pretty much all aspects in details, so go crazy now and run and report here what you see.

I have also put a simulated trajectory as well. If you need anything else, please let us know.

I note: delta-to-alpha FAPbI3 simulations in that study are not biased (no metaD) simulations.

With best wishes,
Paramvir

paramv...@gmail.com

unread,
Mar 5, 2024, 4:48:12 PM3/5/24
to PLUMED users
Dear Yang,

Sorry I missed your question,  which input files or codes you need? Do you want to calculate full SF of perovskite as I understand. I can also put those calculations on Zenodo as well.
you can use same codes as Michele has mentioned already and I think he has put the links.

Best wishes,
Paramvir

qun ji

unread,
Mar 5, 2024, 9:23:24 PM3/5/24
to PLUMED users
Dear Paramvir Ahlawat,

I truly appreciate your willingness to share your expertise. Your guidance and support have been invaluable! I will read and study them carefully.

Once again, thank you for taking the time to assist me.

Warm regards,
Qun Ji

qun ji

unread,
Mar 6, 2024, 3:29:44 AM3/6/24
to PLUMED users
Dear Paramvir Ahlawat,

I used Yang's code, but I couldn't reproduce the S(q)-q diagram and S(q) value (Fig.S16). Can you provide the code to calculate the complete structure of the perovskite (e.g. Fig.S16)?

Best wishes,
Qun Ji

Paramvir Ahlawat

unread,
Mar 6, 2024, 6:16:11 AM3/6/24
to PLUMED users
Hi Qun,

I would suggest you reproduce that figure s16 yourself

I have again updated the Zenodo folder: https://zenodo.org/records/10785248

There is zipped folder now calculate_SF.zip which has all necessary files to reproduce that figure.

First you do is generate a short trajectory of any perovskite phase or any other strucutre, in this case use lammps input files and run to produce say a few hundered frames of dcd or any other format trajectory. You can also use codes (ASE, Gromacs) as per your liking. I use lammps.

Once you have that then use plumed driver on trajectory to calcualte like this: plumed driver --mf_dcd out.1.dcd --plumed plumed.dat

Then use Build-Structure_factor.py (Michele's code directory) to generate full S(q)-q plot like this: ./Build-Structure_factor.py -f Colvar-P.data   -o SP.dat

and there is a notebook as well to produce that figure.

You can also automate and make changes in codes and files as per your liking.

Please report if you can not make it, also if you can make it.

Best wishes,
Paramvir

qun ji

unread,
Mar 6, 2024, 6:51:28 AM3/6/24
to PLUMED users
Dear Paramvir,

Thank you for your help. I will try to calculate and report back my results.

Best wishes,
Qun

qun ji

unread,
Mar 13, 2024, 7:28:23 AM3/13/24
to PLUMED users

Hi Paramvir,

Thank you again for your help. With your help, I calculated the SF of MAPbI3, the plumed file is DebyeStructureFactor.cpp.

1. Based on the provided input file plumed.dat, I calculated the SF of MAPI.pdb in the calculate_SF. file, as shown by the blue line in the figure. Also based on your steps, I get an error when I execute "./Build-Structure_factor.py" . What I'm not sure about is that the SF extracted by ./Build-Structure_factor.py is from Molecular Physics. 119(2021) (StructureFactor_sphericallyAveraged.cpp)?

2. I want to simulate a phase change process through AIMD+metadynamic. As we all know, AIMD is limited by the size of the cell. Therefore, I am very concerned about whether the unit cell size affects the process of calculating SF and metadynamic?
    ① Calculate the complete SF, my understanding is based on the grid mode. I calculated MAPbI3 for 324 atoms (lattice size 1.9x1.9x1.9nm) and found that CUTOFF greatly affects the value of SF. The value of SF is correct only when CUTOFF is large (red line in the figure). Therefore, the cutoff is 1.5 when I execute metanamic (q=9.8). But  DebyeStructureFactor.cpp   suggests that CUTOFF cannot be larger than half of the lattice. This conflict confuses me.
    ②The calculation process of AIMD+metadynamic is slow. What parameter adjustments can generally speed up deposition? Could you give me some advice?

Best wishes,
Qun

Fig1.bmp

Paramvir Ahlawat

unread,
Mar 13, 2024, 8:05:46 AM3/13/24
to plumed...@googlegroups.com
Hi Qun,

Great job, these cut-off and other issues can be easily solved with new versions of SF, these are already available in Michele's directory.

Can you write email to me and Michele, and we can help you more, and it depends which material you want to simulate. Becuase for these perovskites you wont need to run AIMD soon. DFT functional is crucial for these materials, and size matters if you want to do serious research: Ball, P. Size matters. Nat. Mater. 21, 1341 (2022). https://doi.org/10.1038/s41563-022-01427-7


Best wishes,
Paramvir



--
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/mraSueRkazI/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/5a1e8098-93ae-4f9e-a2c7-fe0c3184ef3fn%40googlegroups.com.

qun ji

unread,
Mar 13, 2024, 9:23:12 AM3/13/24
to PLUMED users
Hi Paramvir,

Thank you for your reply! I will try other new versions of SF, collect perovskite-related issues and email to you soon.

Sincerely thank you for your help!

Best wishes,
Qun

Paramvir Ahlawat

unread,
Mar 16, 2024, 11:18:47 AM3/16/24
to plumed...@googlegroups.com
cool cool go ahead, other CVs also work, metaD or other biased simulation can definitely reveal many insights, as this TEM paper yesterday also showed an absolute experimental proof what we have said in our simulations going from PbI2 to intercalated phase to perovskite: https://www.nature.com/articles/s41467-024-46588-y


de.jpg



Best wishes,
Paramvir



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/80d0f8bf-df77-4efe-827c-270258547861n%40googlegroups.com.
Message has been deleted

Yun An

unread,
Apr 8, 2024, 3:53:20 AM4/8/24
to PLUMED users
Dear Paramvir,

Thank you for the helpful information.

I would also like to use the Debye structure factor to simulate a possible phase transition. While I was checking the related topic in the group, I had a question about the active_Q values in the first place: how did you decide/calculate the  'ACTIVE_Q (=9.45,13.92)' values?  According to the code, "ACTIVE_Q","manually set which q frequencies will be considered". Does this mean that the value of Q is from literature?

"First you do is generate a short trajectory of any perovskite phase or any other strucutre, in this case use lammps input files and run to produce say a few hundered frames of dcd or any other format trajectory. You can also use codes (ASE, Gromacs) as per your liking. I use lammps.

Once you have that then use plumed driver on trajectory to calcualte like this: plumed driver --mf_dcd out.1.dcd --plumed plumed.dat

Then use Build-Structure_factor.py (Michele's code directory) to generate full S(q)-q plot like this: ./Build-Structure_factor.py -f Colvar-P.data   -o SP.dat

So after one got a few hundred frames of lammps trajectory (I got the form of lammpstrj), one should use the plumed driver, to perform the metadynamics. I checked the 'plumed.dat' file,  it has
"dsf_P: DEBYE_STRUCTURE_FACTOR CUTOFF=2.0 ATOMS1=Pb  ACTIVE_Q=9.45,13.92
dsf_Cs: DEBYE_STRUCTURE_FACTOR CUTOFF=2.0 ATOMS1=Cs ACTIVE_Q=9.45,13.92"

I haven't figured out where does the 'ACTIVE_Q' of 9.45 and 13.92 come from. For example, if I want to calculate the debye factor for a bcc Li, how to set the value of active_q? Using the one from papers?

Maybe I missed some points or did not fully think through them. Thank you so much for your help.

I am looking forward to hearing from you.

Best regards,

Yun

在2024年3月6日星期三 UTC+8 19:16:11<Paramvir Ahlawat> 写道:

Michele Invernizzi

unread,
Apr 8, 2024, 10:35:27 AM4/8/24
to plumed...@googlegroups.com
Hi Yun,

the Build-Structure_factor.py script simply averages the various S_q over time and expects a full grid of different S_q values. You can compute them by setting BOX_EDGE (used to guess the grid spacing) instead of ACTIVE_Q. See also the documentation in the DebyeStructureFactor.cpp file:

This CV can work in two modes:
- manual pick active \f$q\f$ or \f$2\theta\f$ (useful when biasing)
- grid of certain \f$q\f$ or \f$2\theta\f$ values (mainly for building the full structure factor)
The grid spacing is automatically chosen using the given `BOX_EDGE` which is taken as reference, doesn't have to be exact.
This spacing can be fine tuned through the `RESOLUTION` keyword.

\par Examples
some usage examples
\plumedfile
manual: DEBYE_STRUCTURE_FACTOR LAMBDA=1.5406 ACTIVE_2THETA=13.5,25 CUTOFF=8
grid_q: DEBYE_STRUCTURE_FACTOR NOBPC BOX_EDGE=16 MAX=9
\endplumedfile
 
Hope this answers.
Sorry that the documentation is not great... This is an unfinished project from my PhD, and unfortunately I currently do not have the time to clean it up and wrap it into a nice plumed module.

Best,
Michele

karly banks

unread,
Apr 8, 2024, 7:17:56 PM4/8/24
to PLUMED users
Looking for where to buy high quality pain and anxiety pills, depression medications and research chemicals for research purposes? Be 99.99% sure of product quality and authenticity. With a focus on quality and customer satisfaction, we ensure that all our products are sourced from reputable manufacturers and undergo rigorous testing for purity and potency.


WHERE CAN YOU BUY DMT POWDER
HOW TO BUY DMT POWDER ONLINE
 DMT POWDER FOR SALE ONLINE

https://t.me/ukverifiedv
https://t.me/ukverifiedv

K2 PAPER FOR SALE ONLINE
K2 SPRAY FOR SALE ONLINE
K2 SPICE PAPER FOR SALE ONLINE

K2 PAPER FOR SALE ONLINE BUY K2 PAPER ONLINE
BUY K2 PAPER ONLINE
BUY K2 PAPER ONLINE


 BUY ECSTASY PILLS, BUY MOLLY ONLINE
WHERE CAN I BUY ECSTASY PILLS? BUY MOLLY ONLINE
ECSTASY PILLS, BUY MOLLY ONLINE FOR SALE
300mg -XTC Ecstasy for sale online

https://t.me/ukverifiedv
https://t.me/ukverifiedv
https://t.me/ukverifiedv

 BUY MDMA CRYSTALS, MDMA ONLINE
WHERE TO BUY MDMA CRYSTALS, MDMA ONLINE
MDMA CRYSTALS, MDMA FOR SALE ONLINE

https://t.me/ukverifiedv
https://t.me/ukverifiedv
https://t.me/ukverifiedv

BUY QUALITY POWDER COCAINE (ORDER COKAS) ONLINE
Where to buy high quality cocaine powder?
 COCAINE POWDER FOR SALE
CRYSTAL METH FOR SALE

https://t.me/ukverifiedv
https://t.me/ukverifiedv
https://t.me/ukverifiedv

BUY KETAMINE ONLINE
WHERE CAN YOU BUY KETAMINE ONLINE?
HOW TO BUY KETAMINE ONLINE
BUY KETAMINE FOR EXPERIMENT ONLINE

https://t.me/ukverifiedv
https://t.me/ukverifiedv
https://t.me/ukverifiedv

Buy Adderall online without a prescription
Xanax for sale
BUY HERION ONLINE https://t.me/ukverifiedv
Buy Adderall pills online

https://t.me/ukverifiedv
https://t.me/ukverifiedv
https://t.me/ukverifiedv

100% discreet and confidential,
-Your personal information is 100% SECURE.
-Your orders are 100% secure and anonymous.
-Fast delivery worldwide (you can track the shipment with the provided tracking number).

Yun An

unread,
Apr 9, 2024, 11:49:30 PM4/9/24
to plumed...@googlegroups.com
Hi Michele,

Thank you so much for the message, that already helps a lot.

I used the Box_EDGE and cut off, trying to calculate the Debye structure factor of a bcc-Li. One of the questions now is how to decide  
the correct number of CV components?
 
I did the toy test with the following input, as the plumed output files suggested that there are 12 grid points, and according to its hint (the components in this action are cv.ds-2.513274, cv.ds-2.722714.....), I added 12 components of cv (12 powers of 1) and used the combine function. It runs with no error and I got the COLVAR information, but I know the settings should be changed. 

Therefore, could you please tell me how to set the components of CV if I use grid_q? I would like to simulate multicomponent electrolytes in the future, so the 'combine' function should be used for the CV.

Thank you again for your help. I am looking forward to hearing from you. 

Best,
Yun

image.png

image.png

image.png

image.png

Michele Invernizzi <inve.m...@gmail.com> 于2024年4月8日周一 22:35写道:

Michele Invernizzi

unread,
Apr 10, 2024, 11:28:06 AM4/10/24
to plumed...@googlegroups.com
Dear Yun,

once you build the S(q) function, you will see which q values correspond to a peak of the structure factor.
What to use as CV for biasing is yet another problem. The highest peak? a linear combination of a few peaks? a more complex ML-based combination?
The answer depends on your system and on what you want to achieve, and most likely will require some trial and error. You can have a look at previous literature to get ideas, there is a list of papers here https://github.com/invemichele/plumed2/tree/structure_factor/src/structurefactor Notice that almost each one of them is doing a slightly different thing to define the structure-factor-based CV for biasing.

Best of luck,
Michele

karly banks

unread,
Apr 11, 2024, 7:48:51 PM4/11/24
to PLUMED users
buy subutex https://t.me/ukverifiedv
buy Cialis onine https://t.me/ukverifiedv
buy kamagra jelly online https://t.me/ukverifiedv
viagra for sale https://t.me/ukverifiedv

BUY HERION ONLINE https://t.me/ukverifiedv
Buy Adderall pills online

https://t.me/ukverifiedv
https://t.me/ukverifiedv
https://t.me/ukverifiedv

100% discreet and confidential,
-Your personal information is 100% SECURE.
-Your orders are 100% secure and anonymous.
-Fast delivery worldwide (you can track the shipment with the provided tracking number).

Reply all
Reply to author
Forward
0 new messages