Relaxation of WSe2

259 views
Skip to first unread message

Gayani Pallewela

unread,
May 31, 2023, 5:06:07 AM5/31/23
to Twister Help
Dear All,

I am trying to relax  WSe2.

The relaxed structure looks incorrect.
Can some one suggest how to fix this problem.
I have tried with this input file as well. But the problem still exist

Thanks 

#Initialize--

#general settings

units           metal

dimension       3

box tilt        large

atom_style      atomic


# structure

boundary        p p p

read_data       WSe2Ezzinew.lmp


# potentials

pair_style hybrid/overlay sw sw kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 lj/cut 10.0


# Intralayer Interaction

pair_coeff * * sw 1 tmd.sw W Se Se NULL NULL NULL

pair_coeff * * sw 2 tmd.sw NULL NULL NULL W Se Se


# Interlayer Interaction

pair_coeff 1 5 kolmogorov/crespi/z 1 WSe.KC W NULL NULL  NULL Se NULL

pair_coeff 3 4 kolmogorov/crespi/z 2 WSe.KC NULL NULL Se  W NULL NULL

pair_coeff 3 5 kolmogorov/crespi/z 3 WSe.KC NULL NULL Se  NULL Se NULL

pair_coeff 1 4 kolmogorov/crespi/z 4 WSe.KC W NULL NULL  W NULL NULL

pair_coeff * * lj/cut 0.0 3.0

neighbor        2.0 bin

neigh_modify every 1 delay 0 check yes

#neigh_modify one 111


#optimize at 0 K

#dump 1 all custom 100  WSe2out.xyz

#dump            1 all custom 100 dump.initial id type x y z

thermo          1000

thermo_style    custom step pe press

#undump          1


min_style       cg

minimize        0.0 1.0e-4 1000000 1000000

write_dump all custom  outnew.xyz id type x y z

WSe2in.lmp
log.lammps
lammps.in
tmd.sw
lammps.dat_min
WSe.KC
WSe2relaxout.xyz
Screenshot 2023-05-30 at 3.13.25 PM.png
WSe2relaxout.dat
Mass_FF

Indrajit Maity

unread,
May 31, 2023, 5:41:43 AM5/31/23
to Gayani Pallewela, Twister Help
Dear Gayani,

Your input script is wrong. Based on your data file- the following W and Se atom types should interact:
1 and 4
1 and 6
2 and 4
2 and 6.

Simply, replace the KC forcefield include by something like:
# Interlayer Interaction
pair_coeff 1 4 kolmogorov/crespi/z 1 WSe.KC W NULL NULL  W NULL NULL
pair_coeff 1 6 kolmogorov/crespi/z 2 WSe.KC W NULL NULL  NULL NULL Se
pair_coeff 2 4 kolmogorov/crespi/z 3 WSe.KC NULL Se NULL  W NULL NULL
pair_coeff 2 6 kolmogorov/crespi/z 4 WSe.KC NULL Se NULL  NULL NULL Se

**
The reason is quite straightforward. Hope this helps.

Best regards,
Indrajit

--
You received this message because you are subscribed to the Google Groups "Twister Help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to twister-help...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/twister-help/de7bef98-cccb-403f-8e7a-76fa05e97e0an%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gayani Pallewela

unread,
May 31, 2023, 7:36:14 AM5/31/23
to Twister Help
Thank you very much !!!

Ashita Jose

unread,
Jun 1, 2023, 3:31:12 AM6/1/23
to Gayani Pallewela, Twister Help
Dear Sir,
I am experiencing a similar problem when I reproduced an example (21.78-degree twisted homo bilayer MoS2 (near_60-relax-without_python)) from FFRelaxation, when I run the 'homo.sh' the output file (lammps.dat_min and relaxed_data) obtained after relaxation is different from the one which is provided in the reference folder for the same system. The Lammps input file generated is the same as the one in the reference.
I tried running lammps from the homo.sh generated input separately but the result was the same. I didn't modify anything in the script but obtained different results, and the structure is not relaxed. I even tried the Lammps version you used in your calculation but was not able to obtain the one which is given in the reference.
I am attaching the input and output files, kindly help me figure out the issue. In the attached files, Input and output files that are part of the reference folder of the code are given the suffix "reference", and the ones that I have personally tested on my own are given the suffix "test".


reference_lammps.dat_min
test_relaxed_data.png
test_lammps.dat
reference_relaxed_data
reference_lammps.dat
reference_log.lammps
test_lammps_data_min.png
test_log.lammps
test_relaxed_data
test_lammps.dat_min

Indrajit Maity

unread,
Jun 1, 2023, 5:46:26 AM6/1/23
to Twister Help



Dear Ashita,

If you are using an old version of lammps:
----------------
The force-field used in this directory for twisted bilayer
of mos2 will be a combination of Stillinger-Weber
(parametrized as in: http://jiangjinwu.org/sw, within
sw_mx2.zip file) and registry dependent Kolmogorov-Crespi
Potential (Naik et al., as in J. Phys. Chem. C 2019, 123,
15, 9770-9778). The corresponding forcefield files are
available in the current directory, i) mos2.sw ii) MoS.KC.
They are used to describe intra and interlayer interaction
of mos2 layers, respectively.

It is extremely important, that the user modifies
pair_sw.cpp as suggested in:
https://link.springer.com/article/10.1007/s10338-018-0049-z#appendices
After this, please rebuild the lammps executable.
For convenience, the modified pair_sw.cpp is provided here.

[If you have not yet built lammps already, please see
/path-to-examples-of-mos2/LAMMPS_INSTALL]

After this replace the original pair_sw.cpp by the one
provided here (or, you can modify the pair_sw.cpp yourself)
and type:

make serial

Without this step, if you simply run the script, homo.sh
the intralayer interaction will be completely wrong.
-------------

If you are using the new version of LAMMPS:
1. replace the string "sw" with "sw/mod" in every place.
2. Run LAMMPS as usual without any need for changes.

Hope this helps. I will update the README and Mass_FF in GitHub. Meanwhile, you check this yourself.


Hope this helps,
Indrajit

Ashita Jose

unread,
Jun 1, 2023, 10:49:02 AM6/1/23
to Indrajit Maity, Twister Help
Dear Sir,
As you have suggested, I modified Mass_FF file in the aux_files and run the latest version of LAMMPS (28 Mar 2023 - Development). But it ended up in error : ERROR on proc 0: cannot open sw potential file tmd.sw/mod: No such file or directory (../potential_file_reader.cpp:59). 
I attached the files for your reference.

Regards,
Ashita Jose

Mass_FF
log.lammps

Indrajit Maity

unread,
Jun 1, 2023, 11:15:16 AM6/1/23
to Ashita Jose, Twister Help
Hi Ashita,

As the error says there's no tmd.sw file. You have to replace the string "sw" by "sw/mod" for the pair styles. 

The filename is still tmd.sw!. 

Best regards,
Indrajit 

Gayani Pallewela

unread,
Jun 27, 2023, 6:38:32 AM6/27/23
to Twister Help
Hi Indrajith,

If I'm adding another layer (WSe2 trilayer system), can we define the system like this.

# Intralayer Interaction
pair_coeff * * sw 1 tmd.sw W Se Se NULL NULL NULL NULL NULL NULL
pair_coeff * * sw 2 tmd.sw NULL NULL NULL W Se Se NULL NULL NULL
pair_coeff * * sw 3 tmd.sw NULL NULL NULL NULL NULL NULL W Se Se
# Interlayer Interaction
pair_coeff 1 4 kolmogorov/crespi/z 1 WSe.KC W NULL NULL  W NULL NULL NULL NULL NULL
pair_coeff 1 6 kolmogorov/crespi/z 2 WSe.KC W NULL NULL  NULL NULL Se NULL NULL NULL
pair_coeff 2 4 kolmogorov/crespi/z 3 WSe.KC NULL Se NULL  W NULL NULL NULL NULL NULL
pair_coeff 2 6 kolmogorov/crespi/z 4 WSe.KC NULL Se NULL  NULL NULL Se NULL NULL NULL
pair_coeff 1 7 kolmogorov/crespi/z 5 WSe.KC W NULL NULL NULL NULL NULL W NULL NULL
pair_coeff 1 8 kolmogorov/crespi/z 6 WSe.KC W NULL NULL NULL NULL NULL NULL Se NULL
pair_coeff 3 7 kolmogorov/crespi/z 7 WSe.KC NULL NULL Se NULL NULL NULL W NULL NULL
pair_coeff 3 8 kolmogorov/crespi/z 8 WSe.KC NULL NULL Se NULL NULL NULL  NULL Se NULL
thanks and regards,
Gayani

WSe2_trilayer.lmp

Indrajit Maity

unread,
Jun 27, 2023, 10:12:02 AM6/27/23
to Twister Help
Dear Gayani,

Doesn't look right to me.

What you want is something like this:
Three WSe2 layers. Each layer has its own thing (SW potential). Layers 1 and 2 talk to each other. Layers 2 and 3 talk to each other. Layer 1 and 3 probably don't talk to each other as such or not a major driving factor.
 9: Se
7: W
8: Se


6: Se
4: W
5: Se


3: Se
1: W
2: Se

Then you want to utilize
  • W-W interactions for pair 1 and 4;;;; pair 4 and 7
  • Se-Se interactions for pair 3 and 5, pair 6 and 8
  • W-Se interactions for pair 3 and 4, pair 1 and 5, pair 4 and 8, pair 6 and 7

Best wishes,
Indrajit

Gayani Pallewela

unread,
Aug 2, 2023, 4:10:45 AM8/2/23
to Twister Help
Dear Indrajith,

My system look like this. (Please see the attached screen shot)
You explained me earlier how atoms should interact with each other. I have double check my lines in the input script.

But still it is not correct. I have a hard time in getting it correct.

pair_coeff 1 6 kolmogorov/crespi/z 2 WSe.KC W NULL NULL  NULL NULL Se NULL NULL NULL

In this line 5th column=2 what that really means. I have read the documentation but still not clear. How that 5th column should change


Thanks and regards,

Gayani

Screenshot 2023-08-02 at 4.03.58 PM.png

Indrajit Maity

unread,
Aug 2, 2023, 7:01:02 AM8/2/23
to Gayani Pallewela, Twister Help
Dear Gayani,

 I am not sure why you would do the following (after the W-W interaction string):
------
pair_coeff 1 4 kolmogorov/crespi/z 1 .....
pair_coeff 1 7 kolmogorov/crespi/z 5 ...
------

"In this line 5th column=2 what that really means. I have read the documentation but still not clear. How that 5th column should change"
The line should be 2 here for the pair_coeff 1 7 Kolmogorov/crespi/z 2 ...
The meaning of that is- If you call the Kolmogorov/crespi/z n number of times. You should specify them in increasing order. For instance, when you first call them - 1, when you call them 2nd time 2, etc.

I think the documentation is quite clear here: https://docs.lammps.org/pair_hybrid.html

To quote:
"As an example of using the same pair style multiple times, consider a simulation with 2 atom types. Type 1 is Si, type 2 is C. The following commands would model the Si atoms with Tersoff, the C atoms with Tersoff, and the cross-interactions with Lennard-Jones:
pair_style hybrid lj/cut 2.5 tersoff tersoff
pair_coeff * * tersoff 1 Si.tersoff Si NULL
pair_coeff * * tersoff 2 C.tersoff NULL C
pair_coeff 1 2 lj/cut 1.0 1.5
"
You see that you are calling tersoff twice and hence you need to write 1, 2 for the fifth column.

Best wishes,
Indrajit


Gayani Pallewela

unread,
Aug 3, 2023, 12:51:32 AM8/3/23
to Indrajit Maity, Twister Help
Dear Indrajit,

Thanks for your detailed explanation. As you have advised me I reconstructed the LAMMPs input file

#Initialize--

#general settings

units           metal

dimension       3

box tilt        large

atom_style      atomic


# structure

boundary        p p p

read_data       WSe2_trilayeredited.lmp


# potentials

pair_style hybrid/overlay sw sw kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 lj/cut 10.0


# Intralayer Interaction

pair_coeff * * sw 1 tmd.sw W Se Se NULL NULL NULL NULL NULL NULL

pair_coeff * * sw 2 tmd.sw NULL NULL NULL W Se Se NULL NULL NULL

pair_coeff * * sw 3 tmd.sw NULL NULL NULL NULL NULL NULL W Se Se


# Interlayer Interaction

# W-W interactions

pair_coeff 1 4 kolmogorov/crespi/z 1 WSe.KC W NULL NULL  W NULL NULL NULL NULL NULL

pair_coeff 1 7 kolmogorov/crespi/z 2 WSe.KC W NULL NULL NULL NULL NULL W NULL NULL

#Se-Se interaction

pair_coeff 2 6 kolmogorov/crespi/z 3 WSe.KC NULL Se NULL  NULL NULL Se NULL NULL NULL

pair_coeff 3 8 kolmogorov/crespi/z 4 WSe.KC NULL NULL Se NULL NULL NULL  NULL Se NULL

#W-Se interaction

pair_coeff 1 6 kolmogorov/crespi/z 5 WSe.KC W NULL NULL  NULL NULL Se NULL NULL NULL

pair_coeff 2 4 kolmogorov/crespi/z 6 WSe.KC NULL Se NULL  W NULL NULL NULL NULL NULL

pair_coeff 3 7 kolmogorov/crespi/z 7 WSe.KC NULL NULL Se NULL NULL NULL W NULL NULL

pair_coeff 1 8 kolmogorov/crespi/z 8 WSe.KC W NULL NULL NULL NULL NULL NULL Se NULL


pair_coeff * * lj/cut 0.0 3.0

neighbor        2.0 bin

neigh_modify every 1 delay 0 check yes


#optimize at 0 K

#dump 1 all custom 100  WSe2out.xyz

#dump            1 all custom 100 dump.initial id type x y z

thermo          1000

thermo_style    custom step pe press

#undump          1


min_style       cg

minimize        0.0 1.0e-4 1000000 1000000

write_dump all custom  WSe2_trirelaxed.xyz id type x y z




The error is 


" Pair coeff for hybrid has invalid style (src/pair_hybrid_overlay.cpp:65)

Last command: pair_coeff * * sw 3 tmd.sw NULL NULL NULL NULL NULL NULL W Se Se"


This pair style was okay for the first two layers but not when defining the third layer.



For the bilayer I used this and it worked fine


pair_coeff * * sw 1 tmd.sw W Se Se NULL NULL NULL

pair_coeff * * sw 2 tmd.sw NULL NULL NULL W Se Se

Indrajit Maity

unread,
Aug 3, 2023, 1:34:05 AM8/3/23
to Gayani Pallewela, Twister Help
Hi Gayani,

Note that:
"

# potentials

pair_style hybrid/overlay sw sw kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 lj/cut 10.0

"
This means you are allowed to call sw 2 times and kolmogorov/crespi/z 4 times and lj/cut 1 times.

However, you wish to call sw 3 times later in your script through pair_coeff and kolmogorov/crespi/z 8 times, and lj/cut 1 time. Make sure you are consistent with the pair_style. Does that make sense?

I will also suggest carefully looking at the LAMMPS documentation. All these are fairly well explained.

Best,
Indrajit

Gayani Pallewela

unread,
Aug 3, 2023, 4:22:38 AM8/3/23
to Indrajit Maity, Twister Help
Thanks Indrajit. I will closely go through the document again

Regards,
Gayani

Gayani Pallewela

unread,
Apr 19, 2024, 7:14:36 PM4/19/24
to Twister Help
hi Indrajit,

I have discussed this with you earlier. How to construct the WSe2 bilayer system.
In the relaxed structure bottom and top most layers are detached. 
Is this relaxation wrong?
Have you ever experienced something like this?
Please get back to me
Thanks
Gayani


Screenshot 2024-04-19 at 13.56.13.png

input script look like this

#Initialize--

#general settings

units           metal

dimension       3

box tilt        large

atom_style      atomic


# structure

boundary        p p p

read_data       WSe1_6.lmp


# potentials

pair_style hybrid/overlay sw sw kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 kolmogorov/crespi/z 14.0 lj/cut 10.0


# Intralayer Interaction

pair_coeff * * sw 1 tmd.sw W Se Se NULL NULL NULL

pair_coeff * * sw 2 tmd.sw NULL NULL NULL W Se Se


# Interlayer Interaction

pair_coeff 1 4 kolmogorov/crespi/z 1 WSe.KC W NULL NULL  W NULL NULL

pair_coeff 1 6 kolmogorov/crespi/z 2 WSe.KC W NULL NULL  NULL NULL Se

pair_coeff 2 4 kolmogorov/crespi/z 3 WSe.KC NULL Se NULL  W NULL NULL

pair_coeff 2 6 kolmogorov/crespi/z 4 WSe.KC NULL Se NULL  NULL NULL Se

#pair_coeff 1 5 kolmogorov/crespi/z 1 WSe.KC W NULL NULL  NULL Se NULL

#pair_coeff 3 4 kolmogorov/crespi/z 2 WSe.KC NULL NULL Se  W NULL NULL

#pair_coeff 3 5 kolmogorov/crespi/z 3 WSe.KC NULL NULL Se  NULL Se NULL

#pair_coeff 1 4 kolmogorov/crespi/z 4 WSe.KC W NULL NULL  W NULL NULL

pair_coeff * * lj/cut 0.0 3.0

neighbor        2.0 bin

neigh_modify every 1 delay 0 check yes

#neigh_modify one 111


#optimize at 0 K

#dump 1 all custom 100  WSe2out.xyz

#dump            1 all custom 100 dump.initial id type x y z

thermo          1000

thermo_style    custom step pe press

#undump          1


min_style       cg

minimize        0.0 1.0e-4 1000000 1000000

write_dump all custom  WSe2_1_6relaced.xyz id type x y z

~                                                               




On Wednesday, May 31, 2023 at 5:41:43 PM UTC+8 indrajit...@gmail.com wrote:
WSe1_6.lmp
WSe.KC
tmd.sw
log.lammps
Mass_FF
WSe2_1_6relaced.xyz
lammps.in

Indrajit Maity

unread,
Apr 20, 2024, 12:37:17 AM4/20/24
to Gayani Pallewela, Twister Help
Hi,

Could you please share a folder with all the data files in it? We can't help much without those.

Best,
Indrajit

Gayani Pallewela

unread,
Apr 21, 2024, 5:24:20 AM4/21/24
to Twister Help
Hi Indrajith,

Can you please find the attached data files.
Can you access these.

Thanks
Gayani

WSe1_6.dat
log.lammps
WSe1_6in.dat
WSe.KC
Mass_FF
lammps.in
WSe1_6.lmp
tmd.sw
WSe2_1_6relaced.xyz
WSe2_1_6relaxed.dat
WSe2_1_6relaced.dat
lammps.dat_min
Reply all
Reply to author
Forward
0 new messages