Skip to contents

Function to calculate all positions related by symmetry (including cell centring) to the position of an atom in the asymmetric unit

Usage

expand_au(xyzf, aname, B, Occ, SG, inau = FALSE)

Arguments

xyzf

An n X 3 array or data frame whose rows are the fractional coordinates of the n atoms in the asymmetric unit.

aname

A character string. The name of the atomic species.

B

A vector of length n providing the thermal factor for the n atoms in the asymmetric unit.

Occ

A vector of length n providing the occupancy numbers for the n atoms in the asymmetric unit.

SG

A character string indicating the extended Hermann-Mauguin symbol for the space group.

inau

Logical variable. If TRUE, all atoms outside the unit cell are changed into atoms inside the unit cell by translational repetition (default is not to change expanded atoms).

Value

set An integer equal to the specific setting corresponding to the given xHM symbol.

An m X 6 data frame with column names x, y, z, atom, B, Occ, where m is the total number of atoms after the symmetry-expansion and the centring. The first three columns contain the three fractional coordinates, while the last three contain the atom name, the B factor and the occupancy.

Details

One atom has fractional coordinates \((x,y,z)\). The function first finds the symmetry-equivalent \((x',y',z')\) based on the operation, $$ \left(\begin{array}{c} x' \\ y' \\ z' \end{array}\right) = R \left(\begin{array}{c} x' \\ y' \\ z' \end{array}\right) + T $$ where \(R\) is a 3 X 3 matrix representing the point group operation and \(T\) a 3 X 1 vector representing the group translation. The function then finds the copies \((x'',y'',z'')\) of the symmetry-related atoms \((x',y',z')\) using the centring operator 3 X 1 vector \(C\): $$ \left(\begin{array}{c} x'' \\ y'' \\ z'' \end{array}\right) = \left(\begin{array}{c} x' \\ y' \\ z' \end{array}\right) + C $$

Examples


# Create a "pretend" structure with five atoms in C 1 2 1
# Asymmetric unit is 0<=x<=1/2; 0<=y<1/2; 0<=z<1
xyzf <- matrix(nrow=5,ncol=3)
xyzf[1,] <- c(0.2,0.1,0.6)
xyzf[2,] <- c(0.15,0.15,0.55)
xyzf[3,] <- c(0.05,0.2,0.4)
xyzf[4,] <- c(0.25,0.15,0.56)
xyzf[5,] <- c(0.3,0.1,0.7)

# Atom names
aname <- c("C","O","C","N","N")

# Random B factors
B <- rnorm(5,mean=1,sd=0.2)

# Occupancies
Occ <- rep(1,times=5)

# Space group
SG <- "C 1 2 1"

# Expansion
xyz <- expand_au(xyzf,aname,B,Occ,SG)
print(xyz) # The expanded structure should have 20 atoms
#>        x    y     z atom         B Occ
#> 1   0.20 0.10  0.60    C 0.9401314   1
#> 2   0.15 0.15  0.55    O 0.4281181   1
#> 3   0.05 0.20  0.40    C 1.3038773   1
#> 4   0.25 0.15  0.56    N 0.9832285   1
#> 5   0.30 0.10  0.70    N 1.2593148   1
#> 6  -0.20 0.10 -0.60    C 0.9401314   1
#> 7  -0.15 0.15 -0.55    O 0.4281181   1
#> 8  -0.05 0.20 -0.40    C 1.3038773   1
#> 9  -0.25 0.15 -0.56    N 0.9832285   1
#> 10 -0.30 0.10 -0.70    N 1.2593148   1
#> 11  0.70 0.60  0.60    C 0.9401314   1
#> 12  0.65 0.65  0.55    O 0.4281181   1
#> 13  0.55 0.70  0.40    C 1.3038773   1
#> 14  0.75 0.65  0.56    N 0.9832285   1
#> 15  0.80 0.60  0.70    N 1.2593148   1
#> 16  0.30 0.60 -0.60    C 0.9401314   1
#> 17  0.35 0.65 -0.55    O 0.4281181   1
#> 18  0.45 0.70 -0.40    C 1.3038773   1
#> 19  0.25 0.65 -0.56    N 0.9832285   1
#> 20  0.20 0.60 -0.70    N 1.2593148   1