Crystal Structure

Most computations require a crystal structure, and PM has a standard yaml file for doing so.

For many different tasks performed in the PM suite, a crystal structure, or some component of a crystal structure, must be provided to the code. Most likely, this will be done using a yaml input file, and the two required key words are vec and atoms, which will contain the lattice vectors and the basis atoms, respectively. Considering the flourite structure, the most straightforward yaml file would be:

# xtal.yml
vec: 
  [[0.000000,2.764309,2.764309],
   [2.764309,0.000000,2.764309],
   [2.764309,2.764309,0.000000]]
atoms:
  - Ca: 
     [[0,0,0]]
  - F:
     [[0.25,0.25,0.25],
      [0.75,0.75,0.75]]

The code will infer that there is one basis atom labeled Ca and two basis atoms labeled F.

When entering matrices, we will always run the input through our general array parser (see parse_array if interested in the details). Therefore, there are many different options for entering a matrix as a string. For example, consider the following two examples:

xtal.yml

scale: 2.764309
vec: |
   0 1 1
   1 0 1
   1 1 0   
atoms:
  - Ca: |  
     0 0 0
  - F: |
     1/4 1/4 1/4
     3/4 3/4 3/4     
xtal.yml

scale: 2.764309
vec: 0 1 1 ; 1 0 1 ; 1 1 0
atoms:
  - Ca: 0 0 0 
  - F: 1/4 1/4 1/4 ; 3/4 3/4 3/4

where scale is a constant that multiplies all lattice vectors (a list of three constants could have been provided), and the vertical lines tells yaml to expect a text block. Our parser has a hierarchy of delimiters, ranging from space, comma, semicolon, newline. In the above example, we have two types of delimiters (i.e. spaces and newlines), which tells the code to form a matrix.

Prototype Crystal Structures

There are a number of very common crystal structures that are adopted in numerous compounds, such as rock salt, flourite, etc. There is a simple command line script to output these crystal structures.

$ pm-prototype-xtal --perovskite
# Crystal
vec:
  [[ 3.91300000,  0.00000000,  0.00000000],
   [ 0.00000000,  3.91300000,  0.00000000],
   [ 0.00000000,  0.00000000,  3.91300000]]
atoms:
  - Sr: 
      [[ 0.50000000,  0.50000000,  0.50000000]]
  - Ti: 
      [[ 0.00000000,  0.00000000,  0.00000000]]
  - O: 
      [[ 0.50000000,  0.00000000,  0.00000000],
       [ 0.00000000,  0.50000000,  0.00000000],
       [ 0.00000000,  0.00000000,  0.50000000]]

Last modified September 13, 2024: started an entry for input tags. (d5545de)