File: MgB2.py

package info (click to toggle)
phonopy 2.48.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,556 kB
  • sloc: python: 44,403; xml: 12,080; ansic: 3,227; cpp: 525; sh: 213; makefile: 20
file content (18 lines) | stat: -rw-r--r-- 593 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Example of calculation of irreps of MgB2."""

import numpy as np

import phonopy

phonon = phonopy.load(unitcell_filename="POSCAR-unitcell", supercell_matrix=[3, 3, 2])
print("Space group: %s" % phonon.symmetry.get_international_table())

# Character table
phonon.set_irreps([1.0 / 3, 1.0 / 3, 0], degeneracy_tolerance=1e-4)
ct = phonon.irreps
assert ct is not None
band_indices = ct.band_indices
characters = np.rint(ct.characters).real  # type: ignore
for bi, cts in zip(band_indices, characters, strict=True):
    print("%s %s" % (np.array(bi) + 1, cts))
# phonon.show_character_table()