Problem with lattice and create_atoms

Hello Everyone I am not expert of lammps but I am trying to follow documentation.

Here I am trying to make cubic silicon carbide super cell oriented at desired axis, using lattice and create_atoms command but I don’t know every time I see silicon and carbon replacing each other so they don’t follow the respective lattice orders.

I will highly appreciate any suggestions and recommendations

atom_style atomic
units metal
boundary p p p
lattice diamond 4.36 orient x 1 -1 0 orient y 1 1 0 orient z 0 0 1
region whole block 0 10 0 10 0 10 units lattice # lattice multiplied with lattice constant and we get 43.6 an>
create_box 2 whole #creath box with two types of atoms
mass 1 28.0855 # Si
mass 2 12.011 # C
create_atoms 1 region whole basis 1 1 #place basis atom 1 as type 1
create_atoms 2 region whole basis 2 2 #place basis aotm 2 as type 2
pair_style vashishta
pair_coeff * * /home/ashrafirslanullah/lammps/potentials/SiC.vashishta Si C
write_dump all custom dump.oriented id type x y z
run 0

I wonder if the problem is linked with the following note in the documentation “Note For non-orthogonal unit cells and/or when a rotation is applied via the orient keyword, then the lattice spacings computed by LAMMPS are typically less intuitive. In particular, in these cases, there is no guarantee that a particular lattice spacing is an integer multiple of the periodicity of the lattice in that direction. Thus, if you create an orthogonal periodic simulation box whose size in a dimension is a multiple of the lattice spacing, and then fill it with atoms via the create_atoms command, you will NOT necessarily create a periodic system. I.e. atoms may overlap incorrectly at the faces of the simulation box.“ in that case how I should solve this problem

This is not correct. You are creating atoms on all lattice sites twice.

Correct is:

create_atoms 1 box  basis 1 1 basis 2 2

Or when using type labels:

labelmap atom 1 Si 2 C
mass Si 28.0855
mass C 12.011
create_atoms 1 box basis 1 Si basis 2 C

No.

Well, that is not correct either since the documentation of the lattice command mentions that the “diamond” lattice has 8 (eight!) basis atoms. So all basis atom sites will be populated by the atom type after the command except for those listed with the basis keyword.

So the following lines should all result in the same and expected geometry:

create_atoms 1 box basis 1 1 basis 2 2 basis 3 1 basis 4 2 basis 5 1 basis 6 2 basis 7 1 basis 8 2
create_atoms 2 box basis 1 1 basis 2 2 basis 3 1 basis 4 2 basis 5 1 basis 6 2 basis 7 1 basis 8 2
create_atoms 1 box basis 2 2 basis 4 2 basis 6 2 basis 8 2
create_atoms 2 box basis 1 1 basis 3 1 basis 5 1 basis 7 1
1 Like

Hi Thank you very much for explanation, infact I was struggling with previous recommendation

after failed attempts I was working myself. I read the suggested information in the documentation but it too small for me to reach to a solution. Thank you very much for the solution command I can understand better its like writing the whole structure as basis.

Hi there is still problem with above commands since I couldn’t generate the exact diamond lattice with them and couldn’t understand why one has to use just even or odd basis to place atoms. For example you can use simply “create_atoms 2 box basis 1 1 basis 2 1 basis 3 1 basis 4 1“ and it will create pairs sequentially thus generating exact diamond.

1 Like

Diamond itself has just one atom type (i.e. carbon atoms), so you don’t need to use the basis keyword at all since all basis locations have the same element. In all commands discussed in this thread, all atoms were always located on the diamond lattice locations, so the lattice itself was always correct.

However, the commands create_atoms 2 box basis 1 1 basis 3 1 basis 5 1 basis 7 1 and create_atoms 2 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 are two different compounds where different lattice sites are occupied by different elements (or rather atom types). Which one is the correct one for a specific application is for the user to know, not me. It can be easily confirmed by visualizing the resulting geometry.

The important points I was trying to make are that:
a) the “diamond” lattice has 8 basis sites, not two,
b) you populate all basis sites with just one create_atoms command and not one per basis site or atom type,
c) the basis sites are populated with the atom type following the command except those using the “basis” keyword to assign different atom types, and
d) there are multiple ways to generate the same geometry.