[lammps-users] Illegal Lattice Command

Hello Once again,

  Thanks for pointing out the error. That was indeed the actual problem. It works now with a1, a2 and a3 vector. Although I am getting ridiculous energy values and then lost atoms at some point (after 9 MD steps).

The problem now is that the vector definition(shown below) taken from VASP output is not building the correct lattice structure in LAMMPS.

lattice custom 1.0 &
                 a1 6.02317659 -2.04697751 -0.01608890 &
                 a2 6.02317659 2.04697751 -0.01608890 &
                 a3 3.93985599 0.00000000 5.65177768 &
                  basis 0.0000000000000000 0.0000000000000000 0.0000000000000000 &
                  basis 0.5000000000000000 0.5000000000000000 0.5000000000000000 &
                  basis 0.1554369940875797 0.1554369940875797 0.5392629068444545 &
                  basis 0.8445630059124201 0.8445630059124201 0.4607370931555455 &
                  basis 0.3771787923540568 0.3771787923540568 0.0080116785954751 &
                  basis 0.6228212076459432 0.6228212076459432 0.9919883214045249 &
                  basis 0.2586613846202718 0.2586613846202718 0.7582000746896076 &
                  basis 0.7413386153797283 0.7413386153797283 0.2417999253103924 &
                  basis 0.1094403869771623 0.1094403869771623 0.2268251694450604 &
                  basis 0.8905596130228376 0.8905596130228376 0.7731748305549396

Have a look at the lattice command on the document page. It talks about the relative basis coordinates and lattice vectors.

The documentation is of no help in this case. My simulation box parameters for the unit cell are;

monoclinic unit cell a = 12.04640, b = 4.09396, c = 6.88949, beta = 55.273

How do I transform this to the vectors a1, a2, a3. I just help a guy with transforming from a,b,c alpha, beta, gamma to lx,ly,lz, xy,xz,yz
but ironically, I don't know how LAMMPS handle unit cell parameters and relative basis vector. Could anyone help in this particular case with the following basis vectors;

HOW DO I TRANSFORM THIS TO (a1, a2, a3) vectors in LAMMPS?

       a = 12.04640, b = 4.09396, c = 6.88949, beta = 55.273

                     basis 0.0000000000000000 0.0000000000000000 0.0000000000000000&
                     basis 0.5000000000000000 0.5000000000000000 0.5000000000000000&
                     basis 0.1554369940875797 0.1554369940875797 0.5392629068444545&
                     basis 0.8445630059124201 0.8445630059124201 0.4607370931555455&
                     basis 0.3771787923540568 0.3771787923540568 0.0080116785954751&
                     basis 0.6228212076459432 0.6228212076459432 0.9919883214045249&
                     basis 0.2586613846202718 0.2586613846202718 0.7582000746896076&
                     basis 0.7413386153797283 0.7413386153797283 0.2417999253103924&
                     basis 0.1094403869771623 0.1094403869771623 0.2268251694450604&
                     basis 0.8905596130228376 0.8905596130228376 0.7731748305549396

The documentation is of no help in this case. My simulation box parameters for the unit cell are;
monoclinic unit cell a = 12.04640, b = 4.09396, c = 6.88949, beta = 55.273
How do I transform this to the vectors a1, a2, a3. I just help a guy with transforming from a,b,c alpha, beta, gamma to lx,ly,lz, xy,xz,yz
but ironically, I don't know how LAMMPS handle unit cell parameters and relative basis vector. Could anyone help in this particular >case with the following basis vectors;
HOW DO I TRANSFORM THIS TO (a1, a2, a3) vectors in LAMMPS?

Have you read section 4.12 of the LAMMPS manual? What part is not clear?

Steve

I did read section 4.12 and it's of no help in this case. It only mention the conversion from (a,b,c,alpha,beta,gamma) to (lx,ly,lz,xy,xz,yz). I am interested in the vectors a1, a2 and a3 in lattice custom

The a1, a2 and a3 vectors from VASP are;

                   a1 6.02317659 -2.04697751 -0.01608890&
                   a2 6.02317659 2.04697751 -0.01608890&
                   a3 3.93985599 0.00000000 5.65177768&

The problem is they don't seems to construct the right crystal in LAMMPS because the potential energies are too high from a simple NVE run.

My question now is this; given a monoclinic unit cell with parameters a = 12.04640, b = 4.09396, c = 6.88949, beta = 55.273

How do I convert a, b, c and beta to a1 , a2 and a3 vectors?

1. Re-read 4.12, and read the prism and lattice command pages. This is not meant to be a scavenger hunt, but you need to understand the usage of lattice, prism, and box so you can put the three together correctly.

2. Visualize your structure if you think it's not the right crystal. In your original input script, it looks as though you are not tilting your prism region at all. Forming a box around this with a periodic structure could cause overlaps.

3. Make sure the prism command is using lattice-multiple distance and not box length distance (or vice versa, if this is what you want).

I did read section 4.12 and it's of no help in this case. It only mention the conversion from (a,b,c,alpha,beta,gamma) to >(lx,ly,lz,xy,xz,yz). I am interested in the vectors a1, a2 and a3 in lattice custom

From section 4.12:
The orthogonal box has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by A = (xhi-xlo,0,0); B >= (0,yhi-ylo,0); C = (0,0,zhi-zlo).

So if you know how to find (lx,ly,lz,xy,xz,yz) from a,b,c,beta (those
conversion eqs are also listed),
then you have the edge vectors which are (multiples of) a1,a2,a3 for
the lattice comand.
Note that lx = xhi-xlo. What am I missing?

I would also suggest that when you build such a geometry in LAMMPS you
carefully look at the output (viz, dump file, how many atoms LAMMPS says it
created), to see if you got everything right. Your NVE energy could be wrong
b/c you are missing an atom or two at a boundary that isn't what you expect.
The create_atom command doc pages discusses this.

Steve

Okay,
  Here is what I found quite contradictory. The LAMMPS manual mentioned that;

"Note that in LAMMPS the triclinic simulation box edge vectors A,B,C cannot be arbitrary vectors. As indicated, A must be aligned with the x axis, B must be in the xy plane, and C is arbitrary. However, this is not a restriction since it is possible to rotate any set of 3 crystal basis vectors so that they meet this restriction. "

That is;

"The parallelepiped has its "origin" at (xlo,ylo,zlo) and is defined by 3 edge vectors starting from the origin given by A = (xhi-xlo,0,0); B = (xy,yhi-ylo,0); C = (xz,yz,zhi-zlo). Xy,xz,yz can be 0.0 or positive or negative values"

Now assuming I am correct the vectors a1, a2 and a3 correspond to A, B, C respectively. Therefore, LAMPPS input must always be of the form

              a1 xhi-xlo 0 0
              a2 xy yhi-ylo 0
              a3 xz yz zhi-zlo
               
Now, why will an input file I like this (immediately below) run correctly with the right results;

lattice custom 1.00 &
                a1 2.91111614 2.91111614 0.00000000 &
                a2 0.00000000 2.91111614 2.91111614 &
                a3 2.91111614 0.00000000 2.91111614 &
                basis 0.0000000000000000 0.0000000000000000 0.0000000000000000 &
                basis 0.5000000000000000 0.5000000000000000 0.5000000000000000 &
                basis 0.2500000000000000 0.2500000000000000 0.2500000000000000 &
                basis 0.7500000000000000 0.7500000000000000 0.7500000000000000

While this one (below) will not;

lattice custom 1.0&
                   a1 6.02317659 -2.04697751 -0.01608890&
                   a2 6.02317659 2.04697751 -0.01608890&
                   a3 3.93985599 0.00000000 5.65177768&
                    basis 0.0000000000000000 0.0000000000000000 0.0000000000000000&
                    basis 0.5000000000000000 0.5000000000000000 0.5000000000000000&
                    basis 0.1554369940875797 0.1554369940875797 0.5392629068444545&
                    basis 0.8445630059124201 0.8445630059124201 0.4607370931555455&
                    basis 0.3771787923540568 0.3771787923540568 0.0080116785954751&
                    basis 0.6228212076459432 0.6228212076459432 0.9919883214045249&
                    basis 0.2586613846202718 0.2586613846202718 0.7582000746896076&
                    basis 0.7413386153797283 0.7413386153797283 0.2417999253103924&
                    basis 0.1094403869771623 0.1094403869771623 0.2268251694450604&
                     basis 0.8905596130228376 0.8905596130228376 0.7731748305549396

Apparently the one that ran fine violated LAMMPS input file structure with

              a2 xy yhi-ylo 0

given by a2 0.00000000 2.91111614 2.91111614 (non zero)

Am I missing something?

A few suggestions I have from experience:

  1. Looking at your initial input you do not include any xy xz or yz tilt within the region command. I found when you do the conversions from a b c alpha, beta, and gamma you need to have the tilt in both the lattice vectors and in the region command. (follow the documentation)

  2. I found I needed to directly define the spacing to my x, y, and z values within the lattice command.

  3. If you are using Ovito to visualize the structure, there are a few inconsistencies reading in triclinic dump data directly as is. I can explain how to correct Ovito for this if you are using the software.

Shawn P Coleman

University of Arkansas
Mechanical Engineering

Now assuming I am correct the vectors a1, a2 and a3 correspond to A, B, C respectively.
Therefore, LAMPPS input must always be of the form
             a1 xhi-xlo 0 0
             a2 xy yhi-ylo 0
             a3 xz yz zhi-zlo
Apparently the one that ran fine violated LAMMPS input file structure with
             a2 xy yhi-ylo 0
given by a2 0.00000000 2.91111614 2.91111614 (non zero)

No. You are confusing the specification of the simulation box with the lattice.
The triclinic simulation box must be of that form, with one of the box
edge vectors
aligned along the x-axis, etc.

The lattice command doesn't care.
You can specify any a1, a2, a3 you wish for the lattice command, and the
create_atoms command will attempt to tile the simulation box with the
unit cell you have defined.

But if you don't choose a lattice and unit cell with an associated
periodicity (see the
lattice spacings) that maps nicely to the box (e.g. an integer # of
times in each
direction), then you will likely not create the set of atoms you want.
But that's
under your control, not LAMMPS.

Steve