ucf !

726 views
Skip to first unread message

Dhurba Raj Jaishi

unread,
Jun 24, 2022, 4:52:44 PM6/24/22
to Vampire Users
Hello vampire users!
I am new in learning VAMPIRE. I am just trying to learn how to code unit cell files using python but couldn't succeed. I want to do simulation in a hexagonal system. Can anyone guide me or share python script to generate ucf for hexagonal or trigonal  systems? 


Thank you!

gabo...@gmail.com

unread,
Jun 25, 2022, 2:20:01 AM6/25/22
to Vampire Users
If it helps, the attached create-ucf.py is a rudimentary and not well tested Python script that outputs the beginning part of a unit cell file (ucf), where the latter interactions block still has to be completed manually in a text editor or you would have to write and add your own code to do that (For example, Jij could probably be programmed using the equation on the VAMPIRE crystals structure webpage [1]).  Feel free to modify create-ucf.py and make improvements to it.  The shell commands in bash are given below, which demonstrates how to run it.  The output produced by it can be seen in the attached UC.png.  You can compare it to the sample UC.ucf at [2].  You might also get helpful information from the YouTube ucf video [3], if you haven't already watched it.  Of note, parameters such as 'cx' are described in section "5 Unit Cell Files" which starts on page 22 in the VAMPIRE 5.0 manual [4].


username@computername:~/Desktop/test$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 22.04 LTS
Release:    22.04
Codename:    jammy
username@computername:~/Desktop/test$ dos2unix create-ucf.py
dos2unix: converting file create-ucf.py to Unix format...
username@computername:~/Desktop/test$ chmod +x create-ucf.py
username@computername:~/Desktop/test$ ls -l
total 4
-rwxr-xr-x 1 username username 3100 Jun 24 23:43 create-ucf.py
username@computername:~/Desktop/test$ python3 create-ucf.py
Enter ucf filename [example: template.ucf]
UC.ucf
Enter crystal system [cubic, tetragonal, orthorhombic, hexagonal, monoclinic, rhombohedral, or triclinic]
cubic
Enter lattice constant a [example: 3.54]
3.54
Enter vector 1 x [example: 0.0]
1.0
Enter vector 1 y [example: 0.0]
0.0
Enter vector 1 z [example: 0.0]
0.0
Enter vector 2 x [example: 0.0]
0.0
Enter vector 2 y [example: 0.0]
1.0
Enter vector 2 z [example: 0.0]
0.0
Enter vector 3 x [example: 0.0]
0.0
Enter vector 3 y [example: 0.0]
0.0
Enter vector 3 z [example: 0.0]
1.0
Enter number of atoms [example: 4]
4
Enter atom 1 id [example: 0]
0
Enter atom 1 cx [example: 0]
0
Enter atom 1 cy [example: 0]
0
Enter atom 1 cz [example: 0]
0
Enter atom 1 mat [example: 0]
0
Enter atom 1 lc [example: 0]
1
Enter atom 1 hc [example: 0]
0
Enter atom 2 id [example: 0]
1
Enter atom 2 cx [example: 0]
0.5
Enter atom 2 cy [example: 0]
0.5
Enter atom 2 cz [example: 0]
0
Enter atom 2 mat [example: 0]
1
Enter atom 2 lc [example: 0]
0
Enter atom 2 hc [example: 0]
0
Enter atom 3 id [example: 0]
2
Enter atom 3 cx [example: 0]
0.5
Enter atom 3 cy [example: 0]
0
Enter atom 3 cz [example: 0]
0.5
Enter atom 3 mat [example: 0]
1
Enter atom 3 lc [example: 0]
0
Enter atom 3 hc [example: 0]
1
Enter atom 4 id [example: 0]
3
Enter atom 4 cx [example: 0]
0
Enter atom 4 cy [example: 0]
0.5
Enter atom 4 cz [example: 0]
0.5
Enter atom 4 mat [example: 0]
1
Enter atom 4 lc [example: 0]
0
Enter atom 4 hc [example: 0]
1
Enter number of interactions [example: 48]
48
Enter exchange type [example: 0]
0
Open ucf to add interaction parameters (id i j dx dy dz Jij). These currently must be added manually.

UC.ucf has been generated.

Kind Regards,
Gavin
VAMPIRE user
UC.png
create-ucf.py

Dhurba Raj Jaishi

unread,
Jun 27, 2022, 2:44:44 PM6/27/22
to Vampire Users
Thank you so much Gavin for your response. Actually, I am struggling with the exchange part of the unit cell file (ucf). Would you mind to share some ideas how to get all the exchange interactions for different crystal systems.

Best regards,

gabo...@gmail.com

unread,
Jun 28, 2022, 2:16:10 AM6/28/22
to Vampire Users
You will probably want to do a literature survey to determine the favored method for the particular material you are studying.

For the exchange parameters (Jij) calculations using mean field method, refer to section "3.2.2. Exchange energy" in the article at [1] and the webpage at [2].

For Jij calculations using another method (e.g., Green's function method), refer to a code package such as TB2J [3,4],  OpenMX [5], JaSS [6], RSPt [7], exchanges [8], FLEUR [9], aiida-kkr [10], and SPR-KKR [11].

[11] Section "4.4 Exchange coupling parameters Jij" in SPRKKR 7.7 Manual: https://www.ebert.cup.uni-muenchen.de/index.php/en/software-en/13-sprkkr

Kind Regards,
Gavin

Dhurba Raj Jaishi

unread,
Jun 28, 2022, 4:18:58 PM6/28/22
to Vampire Users
I really appreciate your effort to list out all the useful information in a single frame. I am familiar with a few DFT codes and have some idea to calculate Jij. But, I am looking for the exchange pairs (i and j ) of the crystal system ( see the attached dummy hexagonal system). I am pretty sure that this is not a good way to list out all the exchange pairs.

Best,

hex_ucf.py

gabo...@gmail.com

unread,
Jun 29, 2022, 2:18:12 AM6/29/22
to Vampire Users
Regarding exchange pairs for a hexagonal system, I currently don't know.  Maybe someone else in the list will have some advice for you on that.

If you haven't already, you might have a look at the C++ code from the VAMPIRE developer that generates a ucf for a primitive unit cell [1].

There is also the matlab scripts made available by a user to help generate a ucf for bcc and fcc [2].

In addition, you may have saw in the TB2J documentation that it outputs a VAMPIRE ucf file in tensorial format, but it doesn't include yet the anisotropic exchange and DMI terms [3].  Those are terms in the exchange tensor.  Refer to equation (2.13) in [4].

If you look into those to see how they handled the exchange pairs, maybe there will be something there that can help with that.


Kind Regards,
Gavin
VAMPIRE user

Reply all
Reply to author
Forward
0 new messages