# NANO106 - Symmetry Computations on $mmm (D_{2h})$ Point Group
*by Shyue Ping Ong*

This notebook demonstrates the computation of orbits in the mmm point group. It is part of course material for UCSD's NANO106 - Crystallography of Materials. Unlike the $m\overline{3}m (O_h)$ version, this duplicates relevant code from the symmetry package to explicitly demonstrate the priniciples of generating point group symmetry operations. 

# Preliminaries

Let's start by importing the numpy, sympy and other packages we need.


```python
import numpy as np
import itertools
from sympy import symbols
```

We will now define a useful function for checking existence of np.arrays in a list of arrays. It is not the most efficient implementation, but would suffice for our purposes.


```python
def in_array_list(array_list, a):
    for i in array_list:
        if np.all(np.equal(a, i)):
            return True
    return False
```

# Generating the Symmetry Operations

Next, we specify the generators for mmm point group, which are the three mirror planes. Note that the existence of the three two-fold rotation axes is implied by the existence of the three mirror planes.


```python
generators = []
for i in xrange(3):
    g = np.eye(3).astype(np.int)
    g[i, i] = -1
    generators.append(g)
```

We will now generate all the group symmetry operation matrices from the generators.


```python
symm_ops = []
symm_ops.extend(generators)
new_ops = generators

while len(new_ops) > 0:
    gen_ops = []
    for g1, g2 in itertools.product(new_ops, symm_ops):
        #Note that we cast the op to int to improve presentation of the results.
        #This is fine in crystallographic reference frame.
        op = np.dot(g1, g2)
        if not in_array_list(symm_ops, op):
            gen_ops.append(op)
            symm_ops.append(op)
        op = np.dot(g2, g1)
        if not in_array_list(symm_ops, op):
            gen_ops.append(op)
            symm_ops.append(op)
    new_ops = gen_ops
print "The order of the group is %d. The group matrices are:" % len(symm_ops)
for op in symm_ops:
    print op
```

    The order of the group is 8. The group matrices are:
    [[-1  0  0]
     [ 0  1  0]
     [ 0  0  1]]
    [[ 1  0  0]
     [ 0 -1  0]
     [ 0  0  1]]
    [[ 1  0  0]
     [ 0  1  0]
     [ 0  0 -1]]
    [[1 0 0]
     [0 1 0]
     [0 0 1]]
    [[-1  0  0]
     [ 0 -1  0]
     [ 0  0  1]]
    [[-1  0  0]
     [ 0  1  0]
     [ 0  0 -1]]
    [[ 1  0  0]
     [ 0 -1  0]
     [ 0  0 -1]]
    [[-1  0  0]
     [ 0 -1  0]
     [ 0  0 -1]]


# Computing Orbits

Using sympy, we specify the symbolic symbols x, y, z to represent position coordinates. We also define a function to generate the orbit given a set of symmetry operations and a point p.


```python
x, y, z = symbols("x y z")

def get_orbit(symm_ops, p):
    """Given a set of symmops and a point p, this function returns the orbit"""
    orbit = []
    for o in symm_ops:
        pp = np.dot(o, p)
        if not in_array_list(orbit, pp):
            orbit.append(pp)
    return orbit
```

## Orbit for General Position


```python
p = np.array([x, y, z])
print "For the general position %s, the orbit is " % str(p)
for o in get_orbit(symm_ops, p):
    print o,
```

    For the general position [x y z], the orbit is 
    [-x y z] [x -y z] [x y -z] [x y z] [-x -y z] [-x y -z] [x -y -z] [-x -y -z]


## Orbit for Special Position on two-fold rotation axes


```python
p = np.array([0, 0, z])
orb = get_orbit(symm_ops, p)
print "For the special position %s on the two-fold axis, the orbit comprise %d points:" % (str(p), len(orb))
for o in orb:
    print o,
```

    For the special position [0 0 z] on the two-fold axis, the orbit comprise 2 points:
    [0 0 z] [0 0 -z]


The orbit is similar for the other two-fold axes on the a and b axes are similar.

## Orbit for Special Position on mirror planes

Positions on the mirror on the a-b plane have coordinates (x, y, 0).


```python
p = np.array([x, y, 0])
orb = get_orbit(symm_ops, p)
print "For the special position %s on the two-fold axis, the orbit comprise %d points:" % (str(p), len(orb))
for o in orb:
    print o,
```

    For the special position [x y 0] on the two-fold axis, the orbit comprise 4 points:
    [-x y 0] [x -y 0] [x y 0] [-x -y 0]


The orbit is similar for the other two mirror planes on the a-c and b-c planes are similar.

47a1ff4d42f6db85fedc3c1670c3fb4d2c2c678c
ipynb
Jupyter Notebook
lectures/lecture_4_point_group_symmetry/Symmetry Computations on mmm (D_2h) Point Group.ipynb
ksyang2013/nano106
222f2c6142f43fc4395d9f9ee833ec88c5106e8d
BSD-3-Clause
2015-04-19T23:24:25.000Z
2022-02-10T15:21:12.000Z
lectures/lecture_4_point_group_symmetry/Symmetry Computations on mmm (D_2h) Point Group.ipynb
materialsvirtuallab/nano106
222f2c6142f43fc4395d9f9ee833ec88c5106e8d
BSD-3-Clause
lectures/lecture_4_point_group_symmetry/Symmetry Computations on mmm (D_2h) Point Group.ipynb
materialsvirtuallab/nano106
222f2c6142f43fc4395d9f9ee833ec88c5106e8d
BSD-3-Clause
2016-06-30T21:37:14.000Z
2021-02-15T16:36:41.000Z
Qwen/Qwen-72B
1. YES
2. YES