# On Rotations

### How to Specify Rotations in Questaal

Rotations appear in a number of contexts: including rotations of the lattice, and of spins.

Specify a rotation by a sequence of one or more substrings separated by commas,

  rot1[,rot2][...]


Each substring rot1, rot2, … is a rotation around a particular axis and has the syntax

  (<i>x</i>,<i>y</i>,<i>z</i>)<i>angle</i>


angle is the size of the rotation, in radians; x, y, and z are three real numbers specifying the rotation axis. There should be no spaces in the string.

Wikipedia notes that “Any orientation can be achieved by composing three elemental rotations, starting from a known standard orientation. … The three elemental rotations may be extrinsic (rotations about the axes xyz of the original coordinate system, which is assumed to remain motionless), or intrinsic (rotations about the axes of the rotating coordinate system XYZ, solidary with the moving body, which changes its orientation after each elemental rotation).”

Questaal uses the intrinsic (sometimes called passive) convention: vectors remain fixed and the reference frame rotates. Thus each of the successive elementary rotations Ri, specifies a rotation about the new coordinate system. The sense of rotation is counterclockwise for a positive angle.

Intrinsic and extrinsic conventions correspond to opposite conventions of the order in which elemental rotations are performed. Let R be a rotation matrix composed of three successive elementary rotations:

According to the intrinsic definition, R ia a composite of rotations about axes x-y′-z″, in that order. while according to the extrinsic definition, R ia a composite of rotations about axes z, y, x, in that order.

Example 1:  consider a composite of two elementary rotations, and denote the reference frames for first and second rotations with single and double primes. let X be a rotation about z by π/2. X maps x′ = y,  y′ = −x,  z′ = z. In matrix form X is:

    0    1    0
-1    0    0
0    0    1


Let Y be a rotation around the new y by π/2. x″ = −z′ = −z,  y″ = y′ = −x,  z″ = x′ = y.  In the X reference frame this is

    0    0   -1
0    1    0
1    0    0


while in the new reference frame it is

    0    0   -1
-1    0    0
0    1    0


You can verify these rotations numerically with mcx utility. The intrinsic convention corresponds to the matrix product YX: Either of these instructions

mcx -rot=y:pi/2 -rot=z:pi/2 -x
mcx '-rot=z:pi/2,y:pi/2'


should yield the last matrix.

Any rotation matrix R can be decomposed as a product of at most three elemental rotation matrices, though Questaal lets you can specify as many as you like.

Example 2:  for the three Euler angles α=π/4, β=π/2, and γ=π/3, the ROT token in an input file would read

  ROT=(0,0,1)pi/4,(0,1,0)pi/2,(0,0,1)pi/3


You can use as the following strings as shorthand:
x: = shorthand for (1,0,0)
y: = shorthand for (0,1,0)
z: = shorthand for (0,0,1)

The mcx utility will perform the same function, writing the result to stdout. In the preceding example, try mcx -rot=z:pi/4,y:pi/2,z:pi/3.

mcx also allows you to determine the Euler angles from a given rotation matrix (-roteu switch). Thus
mcx '-rot=z:pi/4,y:pi/2,z:pi/3' -roteu -s1/pi  should yield   0.250000 0.500000 0.333333.

Below are two instances of rotations, especially useful for cubic systems:

  z:pi/4,y:acos(1/sqrt(3))  &larr; Rotates <i>z</i> &rarr; (1,1,1)
z:-pi/4,y:pi/2            &larr; Rotates <i>z</i>&rarr;(1,-1,0), <i>y</i>&rarr;(1,1,0), <i>x</i>&rarr;<i>z</i>.


#### Explicit rotation matrix for Euler angles

The rotation about Euler angles (α, β, γ) can be written

z:<i>&alpha;</i>,y:<i>&beta;</i>,z:<i>&gamma;</i>


This corresponds to the three elementary rotations

Here $c_1$ and $s_1$ are $\cos(\alpha)$ and $\sin(\alpha)$; similarly for ($c_2$, $s_2$) and ($c_3$, $s_3$).

The rotation matrix constructed from Euler angles $\alpha,\,\beta,\,\gamma$ is then

It is the transpose of the rotation matrix given in Wikipedia, which refers to external (aka active) rotations.

### Applying space group operations to electrons, atoms, and lattices

When evaluating the effect of rotations on a system it is necessary to say what is being rotated. Electron position $\mathbf{r}$, nuclear coordinate $\mathbf{R}$, and (in a Bravais lattice) the lattice translation vectors $\mathbf{T}$ and wave numbers $\mathbf{q}$ of Bloch states, which make up crystal eigenfunctions. Rotations can act independently on $\mathbf{r}$, $\mathbf{R}$, or $\mathbf{q}$. When the entire system is rotated, $\mathbf{r}$, $\mathbf{R}$, $\mathbf{T}$ and $\mathbf{q}$ rotate in the same way. $\mathbf{q}$ must rotate to keep the inner product ${\mathbf{q}{\cdot}\mathbf{r}}$ invariant.

All Bravais lattices, have a family of lattice translation vectors $\mathbf{T}$ which leave the lattice invariant. (Bloch’s theorem follows as a consequence of this translation symmetry.) In addition a Bravais lattice may be invariant under rotations. Bravais lattices are classified by the family of rotations {$g$} that leave the lattice invariant.

A crystal consists of atoms arranged on a Bravais lattice. If only one atom is associated with each lattice point, that crystal is a Bravais lattice. When each point has a structure, (iseveral nuclei are associated with one lattice point, called a basis, not to be confused with the basis set used to represent electron wave functions) the symmetry may be reduced since the crystal must also satisfy the condition that the basis be invariant under the operation. A crystal belongs to a space group, possibly with lower symmetry than the underlying Bravais lattice. In the crystal it is possible that one element in the basis transform into a different element, provided a translation a is added to the rotation $g$. Note that a is not unique, since any $\mathbf{T}$ can be added to it. Thus, for the pure Bravais lattice a is always zero.

The space group consists of all operations (rotation + translation) {g,a} that leave the crystal invariant. All atoms within the basis that transform into each other are equivalent by symmetry, forming a class.

#### Specifying space groups in Questaal

Elements of a crystallographic space group are symmetry operations that take a lattice into itself. A particular member of the space group consists of a rotation which we denote as g, a translation part a so that a point r gets mapped into

r′ = g r + a     (1)

If {g,a} is an element of the space group of a lattice, r′ and r are equivalent points. The family of {g} are called the point group. One elementary property of groups is that if g is a member of the group, so is its inverse.

The Questaal codes have a syntax to specify space groups. Only a limited number of rotations is possible in crystallographic lattices, so the format defining the rotation part is a little different. The translation part gets appended to rotation part in one of the following forms:  :(x1,x2,x3)  or alternatively  ::(p1,p2,p3)  with the double ‘::’. The first defines the translation in Cartesian coordinates; the second in crystal coordinates.

Example:: Co is hcp with c/a=1.632993. Writing the basis as

SITE    ATOM=A XPOS=1/3 -1/3 1/2
ATOM=A XPOS= 0 0 0


generators of the space group read in either of the two equivalent forms

i*r3z:(-1*sqrt(3)/6,-1/2,-0.8164966) r2z:(-1*sqrt(3)/6,-1/2,0.8164966) r2x
i*r3z::(1/3,-1/3,-1/2) r2z::(1/3,-1/3,1/2) r2x


#### Rotations of spherical harmonics

Under rotation, a spherical harmonic Ylm(r) = YL(r) of a particular $l$ transforms into a linear combination of spherical harmonics of the same $l$ (L is a compound index for l and m). Thus for point group operation g,

$\mathcal{R}$ is block diagonal in $l$, and it can be generated from g. (The mcx utility can generate $\mathcal{R}$ from g with the -ylm switch, as discussed here.)

There are two possible senses of rotations, the “intrinsic” and “extrinsic” conventions. Questaal uses the “intrinsic” sense defined in Wikipedia

For definiteness, consider a a 90 degree operation generated by rotation about z (right-hand rule) It rotates: the reference frame COUNTERCLOCKWISE, or the vectors in a fixed frame CLOCKWISE. $g$ takes this form:

This rotates the $\mathbf{x}$ and $\mathbf{y}$ axes as follows

$g$ generates the following $p{-}p$ block of $\mathcal{R}$ (real harmonics, $l{=}1$)

Note that $Y_{1-1},Y_{10},Y_{11}$ correspond to $y,z,x$ respectively. $\mathcal{R}_{pp}$ transforms $Y_{11}{\rightarrow}-Y_{1-1}$ ($Y_{x}{\rightarrow}-Y_{y}$) and $Y_{1-1}{\rightarrow}Y_{11}$ ($Y_{y}{\rightarrow}Y_{x}$).

### Group operations acting an atomic position

The crystal consists of a lattice and a basis (atoms making up the unit cell), centered at points $\mathbf{R}_i$. If the lattice is transformed by some group operation $\{g,\mathbf{a}\}$ $\mathbf{R}_i$ is transformed into some $\mathbf{R}_j$, which may be a different member of the basis. Many of the Questaal codes will print out this table if you run it with a verbosity 50 or higher (look for SHOIST at the beginning of the output).

$\{g,\mathbf{a}\}$ acts on $\mathbf{R}_i$ to translate it into some lattice point $\mathbf{R}_j$, Eq. (1). a is not unique since any $\mathbf{R}_j$ belongs to infinite set of points, connected by the lattice translation vectors $\mathbf{T}$. However, when specifying the basis we make a particular choice, which may not be consistent with a. If we require the group operation map $\mathbf{R}_i$ onto a particular $\mathbf{R}_j$ (i.e. a particular unit cell) we must also specify a lattice translation vector τi.

When applying symmetry operations on eigenfunctions it is sometimes necessary to know what $\mathbf{\tau}_i$ is, because different choices of τ introduce phase shifts. Also we cannot necessarily choose a to make $\mathbf{\tau}_i$ vanish, because $\mathbf{\tau}_i$ can be different for each i. This brings up another subtle point: every group operation has an inverse, namely the group operation $\{g',\mathbf{a}'\}$ which undoes the action of $\{g,\mathbf{a}\}$. Applying them successively on $\mathbf{r}$ we get

This shows that $g'=g^{-1}$ and $\mathbf{a}' = -g^{-1} \mathbf{a}$. However, $\mathbf{a}'$ may differ (and sometimes does) from this last relation by some lattice vector $\mathbf{\tau}$, since point $\mathbf{r}'+\mathbf{\tau}$ is related to $\mathbf{r}$ by symmetry. Care must be taken that that derived expressions make no assumptions about the relation between $\mathbf{a}$ and $\mathbf{a}'$.

### Symmetry operations applied to crystal functions

#### Rotating a Bloch eigenfunction to a symmetry-equivalent q point

This section follows the development in Appendix A of Savio Laricchia’s working notes on matrix elements of the electron-phonon interaction. His notes use symbols $\{S,\mathbf{v}_S\}$ for $\{g,\mathbf{a}\}$, and $\mathbf{v}_\tau$ for $\tau$ in Eq. (3). (The notation here is consistent with symbols used in the Questaal code.)

The eigenfunction at a (rotated) wave vector g−1q  is related by symmetry to the unrotated eigenfunction, if g is in the point group of the lattice. In this section the following relation is established.

The factor e is often ignored since it can be chosen arbitrarily. However there is a justification for choosing $\phi{=}0$ as we will shoon show.

Before proceeding with the proof, note that Eq. (4) is valid for any $\mathbf{q}$, in particular for $\mathbf{q}'=g^{-1}\mathbf{q}$. Evaluate Eq. (4) at $\mathbf{q}'$ and relabel $\mathbf{q}'$ as $\mathbf{q}$

Eq. (4b) will be used to rotate eigenfunctions in Questaal’s basis set. In this expression we take ${\phi}{=}0$.

$\psi^{\mathbf{q}}$ is an eigenfunction of the crystal hamiltonian:

Laricchia’s proof starts from Bloch’s theorem, which factors a Bloch state into a part u(r) that is periodic in the lattice, and a phase

Consider a symmetry operation {g,a} that leaves the hamitonian invariant when it acts on r:

Applying this operation to the Schrodinger equation we get

Simplify the phase : ${i\mathbf{q{\cdot}}\{g,\mathbf{a}\}\mathbf{r}} = {i\mathbf{q{\cdot}}(g\mathbf{r})} + {i\mathbf{q{\cdot}a}}$ and use the fact that $g^T=g^{-1}$ to write $\mathbf{q{\cdot}}(g\mathbf{r})$ as $(g^{-1}\mathbf{q}){\cdot}\mathbf{r}$. Since H commutes with $e^{i\mathbf{q{\cdot}a}}$ this factor cancels out on the two sides and the preceding equation becomes

This is an eigenvalue equation with an eigenfunction of the Bloch form with wave number $g^{-1}\mathbf{q}$, since $u^{\mathbf{q}}(\{g,\mathbf{a}\}\mathbf{r})$ is a periodic function of r. This establishes first, that if a Bloch state $\psi^{\mathbf{q}}$ is an eigenfunction of H at q, there is an equivalent state at $g^{-1}\mathbf{q}$, second that there must also be an equivalent state at $g\mathbf{q}$ since group element $g^{-1}$ implies that $g$ is also in the point group, and finally that $u^{\mathbf{q}}(\{g,\mathbf{a}\}\mathbf{r})$ and $u^{g^{-1}\mathbf{q}}(\mathbf{r})$ must be equal apart from an arbitrary phase factor:

To require that Bloch states at q and g−1q have synchronous phases, consider the symmetry-equivalent Bloch state at gq, while applying {g,a} to the coordinate system:

Simplify the phase as before to get

This has the form of a Bloch state at q. For it to be equivalent to Eq. (5), the condition

must be satisfied. Let $\mathbf{q}'=g\mathbf{q}$. The relation reads

Redefine $\mathbf{q}'{\rightarrow}\mathbf{q}$ and substitute into (4), using the Bloch form (5) for $\psi$:

This establishes Eq. (4) and that $\phi=0$. Equation (4) also implies

and also, by evaluating (6a) at $\mathbf{q}'=g\mathbf{q}$ and relabelling $\mathbf{q}'$ as $\mathbf{q}$

#### Rotating functions of the Slater-Koster form

Questaal’s eigenfunctions are represented by a basis set of (augmented, and Bloch-summmed) atom-centered envelope functions of the form

Typically the HL(r) are smooth Hankel functions, special instances of functions of the Slater-Koster form (radial function × spherical harmonic $Y_L$). However the expressions developed here do not depend on the shape of $h_l(r)$, only that they are of the Slater Koster form. They equally apply to the augmentation parts of the basis functions, or the localized product basis functions used in the GW code.

Rotating $\mathbf{r}$ by $g$ does not change $h_l(r)$, while $Y_L(\mathbf{r})$ transforms according to Eq. (2).

Rotating $\mathbf{r}$ by $g$ is equivalent to rotating the coordinate system in the opposite sense (see discussion following Eq. (2)). If the coordinate system and position are both rotated in the same sense, the two cancel out, as should in any case be intuitively evident. Let a prime denote an object in a rotated coordinate system. Then we have

Using the identity $\mathcal{R}^{-1}\mathcal{R}=\mathbf{1}$, we obtain a relation between ${H}_L'$ and ${H}$ where the coordinate system is rotated while keeping the coordinate fixed

#### Envelope functions and phase shifts in a Bloch summed basis of Muffin-Tin Orbitals

In general, the $H_L(\mathbf{r})$ are not centered at the origin but at some point $\mathbf{R}$. In what follows we will use the convienient shorthand $H_{\mathbf{R}L}(\bar{\mathbf{r}}) = H_{\mathbf{}L}(\mathbf{r-R})$; subscript $\mathbf{R}$ denotes the origin of $H$ and $\bar{\mathbf{r}}$ the position relative to the origin. A basis function is always expressed in terms of the atom center $\mathbf{R}$ and the relative coordinate

The eigenfunction is represented as an expansion of a linear combination (eigenvector) of Bloch-summed versions of functions similar to Eq. (7). A Bloch-summed envelope function H is defined as (J. Math. Phys. 39, 3393 (1998), Eq. 3.16)

It is not difficult to show that if the origin is shifted by $\tau$, i.e. $\mathbf{R}' = \mathbf{R-\tau}$,

This is relevant in light of the discussion around Eq. (3).

Note  there is an alternative definition to the Bloch summed Hankel, Eq. (10):   $\sum_\mathbf{T} e^{i\mathbf{q}\cdot(\mathbf{R+T})} H_L(\mathbf{r}-\mathbf{R}-\mathbf{T}) = e^{i\mathbf{q}\cdot\mathbf{R}} H_{\mathbf{R}L}^\mathbf{q}(\bar{\mathbf{r}})$. Questaal uses Eq. (10) so that $H_{\mathbf{R}L}^\mathbf{q}(\bar{\mathbf{r}})$ suffers no phase shift if its center is shifted but $\bar{\mathbf{r}}$ is kept fixed.

#### Rotating Bloch-summed functions of the Slater Koster form to a symmetry-equivalent q point

In a prior section it was shown that for given symmetry operation $\{g,\mathbf{a}\}$, a Bloch state at rotated wave vector $g^{-1}\mathbf{q}$ and position $\mathbf{r}$ is equivalent a Bloch state at $\mathbf{q}$ and $\{g,\mathbf{a}\}\mathbf{r}$ when the coordinate system is rotated by $g$.

The same must be true of any Bloch function including a basis function of the form Eq. (10). Applying Eq. (4) to a Bloch function $H^{\mathbf{q}}(\mathbf{r})$ we obtain

The prime indicates that coordinate system has been rotated. To write the R.H.S in the original coordinate system apply Eq. (8a).

Even though ${H_L'}^\mathbf{q}$ is not of the Slater Koster form, Eq. (8a) nevertheless applies to the Bloch functions also. This is because ${H_L'}^\mathbf{q}$ is comprised of a linear combination of functions of the Slater Koster form. Rotating the coordinate system keeping $\mathbf{r}$ fixed applies to each term separately. The $H_M^\mathbf{q}$ are expressed in terms of a coordinate relative to its origin at some $\mathbf{R}_i$; see Eq. (10). Inspect how the relative coordinate evolves when $\{g,\mathbf{a}\}$ is applied to $\mathbf{r}$:

The relative coordinate is rotated, while the origin shifts to $\mathbf{R}_j' = g\mathbf{R}_i + \mathbf{a}$. $\mathbf{R}_j'$ need not be a member of the set $\mathbf{R}_i+\tau$, where $\tau$ is some translation vector, but symmetry requires there be some symmetry-equivalent Bravais lattice point $\mathbf{R}_j'$,which is connected to a basis vector $\mathbf{R}_j$ by a lattice translation vector $\tau$; see discussion around Eq. (3).

In the $H_{\mathbf{R}L}^{\mathbf{q}}(\bar{\mathbf{r}})$ representation, Eq. (12) becomes

The basis set is represented in terms $H_{\mathbf{R}_jM}^\mathbf{q}$, not $H_{\mathbf{R}_j'M}^\mathbf{q}$. Combining Eq. (11) that relates the two with Eq. (3) we obtain a practically useful result

$\mathbf{\tau}_i(g)$ depends on both $i$ and the choice of $\mathbf{a}$ in the definition of $\{g,\mathbf{a}\}$.

Eq. (14) can be written in other forms using the relations

An obvious one is to apply it using the inverse operation $\{g,\mathbf{a}\}^{-1}$

Care must be taken in the determination of $\tau$. As noted in the discussion around Eq. (3), $\{g,\mathbf{a}\}^{-1}$ and $\{g,\mathbf{a}\}$ are defined separately. It may be that $\{g,\mathbf{a}\}^{-1}\{g,\mathbf{a}\}\mathbf{r}$ yields a vector differing from $\mathbf{r}$ by some lattice vector.

Eq. (16) is valid for any $\mathbf{q}$, in particular for $\mathbf{q}'=g^{-1}\mathbf{q}$ or $\mathbf{q}'=g\mathbf{q}$. Evaluate Eq. (14) at $\mathbf{q}'=g^{-1}\mathbf{q}$ and Eq. (16) at $\mathbf{q}'=g\mathbf{q}$ and relabel $\mathbf{q}'$ as $\mathbf{q}$ in both cases

Finally Eq. (14) can be inverted using Eq. (15). Perform the inversion using $\mathbf{q}'=g^{-1}\mathbf{q}$ and relabel $\mathbf{q}'$ as $\mathbf{q}$

#### Rotating a crystal function in a Slater-Koster basis to a symmetry-equivalent q point

This section shows how to realize rotation Eq. (4b) when the basis set is represented as a linear combination of Bloch-summed functions of the Slater-Koster form. Questaal uses a basis set of functions of the form Eq. (10). An eigenfunction is expanded as

The $z^{\mathbf{q}}_{\mathbf{R}_{i}L}$ are the expansion coefficients (eigenvectors). Use Eq. (16b) to trace how they transform with rotation of $\mathbf{q}$ to $g\mathbf{q}$. Substitute Eq. (16b) into Eq. (17)

This is a Bloch state at wave number $g\mathbf{q}$, evaluated at $\{g,\mathbf{a}\}\mathbf{r}$, and it must be an eigenfunction of the hamiltonian as shown earlier. Its expansion may be written in the same way as Eq. (17)

Eq. (4b) equates Eq. (17a) and (17b). The separate site contributions must be individually equal since the $H$ are linearly independent. Using this and noting the 1-1 correspondence between $\mathbf{R}_i$ and $\mathbf{R}_j$,

To vanish everywhere the quantity in brackets must vanish. Perform the sum over $L$ using Eq. (15)

As noted earlier, $\mathcal{R}_{ML}$ is block diagonal in $l$.

The expressions in this section apply to any function that has a one-center expansion around a site of the Slater-Koster form. If a function $\psi^{\mathbf{q}}$ has a one-center expansion around site $\mathbf{R}_i$ as $\psi^{\mathbf{q}} (\mathbf{r}) = \sum_{kL}C^\mathbf{q}_{\mathbf{R}_ikL} P_{kL}(\mathbf{r})$ the coefficients rotate in the same way as Eq. (18)

This applies to the augmentation parts of the eigenfunctions (see Eq. (151) of the Questaal Methods paper, Comp. Phys. Comm. 249, 107065 (2020)), and also to the product functions $B^{\mathbf{q}}_{\mathbf{R}_{j}kL}$ used to construct augmentation parts of two-particle objects (see discussion around Eq. (28) of Questaal’s GW methods paper Phys. Rev. B76, 165106 (2007)).

#### Time reversal symmetry

Inversion can be added to the actual space group because the hamiltonian has time-reversal symmetry. If inversion is not in the space group already, it doubles the number of symmetry operations.

Time-reversal symmetry has the effect of turning $\psi^\mathbf{q}$ into ${\psi^\mathbf{-q}}^*$. To perform rotations of the hamiltonian or eigenfuctions in $\mathbf{q}$ with such these extra operations, it is necessary to factor it into an inversion and the space group operation. The latter proceeds as normal; but to incorporate the former, the inversion takes $\mathbf{q}$ to $\mathbf{-q}$. A rotation is performed in practice with the following prescription.

1. g is scaled by $-1$

2. the phase $\mathbf{q}\cdot{\tau}$ is scaled by $-1$

3. the hermitian conjugate of the rotated eigenvector is taken.

#### Rotating a hamiltonian in a Slater-Koster basis to a symmetry-equivalent q point

Two-point objects such as the Hamiltonian or overlap S are bilinear in basis functions, and are represented in terms of a coefficient matrix, and objects expanded by Slater Koster functions Eq. (7) have a matrix $S_{LL'}$ which represents an expansion bilinear in spherical harmonics. S is rotated by $\mathcal{R} S \mathcal{R}^{-1}$. If you have a numerical representation of $S_{LL'}$, the matrix calculator mcx will perform this rotation numerically (-ylm~rots).

In the crystalline case, one-point objects such as eigenfunctions $z$ are represented by a single $\mathbf{q}$. $z^\mathbf{q}$ can be rotated to $z^{g\mathbf{q}}$ with $\mathcal{R}$ and a phase shift, as shown in Eq. (18).

When two-point objects are represented by a single $\mathbf{q}$, such as a hamiltonian or overlap matrix, the rules for rotation to to $g\mathbf{q}$ are essentialy like Eq. (18), but applied once on the left and the inverse operation on the right. This is immediately apparent becaues the Hamiltonian is diagonalized by finding the set of eigenvectors $z_{n}$ for which

In the crystal case, for basis functions of the Slater Koster form, a relation between $\mathrm{H}^{\mathbf{q}}$ and $\mathrm{H}^{g\mathbf{q}}$ is readily obtained by requiring that

$z^{g\mathbf{q}}_n$ and $z^{\mathbf{q}}_n$ are related by Eq. (18); the same rotation applies for any $n$. Thus $\mathrm{H}$ is rotated by acting with this operation once on the left, and its inverse on the right.