anaddb_irreps: use phonopy to find the irreducible representations of the phonon modes from anaddb output. It is a simple wrapper of the Phonopy irreps module.
Project description
anaddb_irreps
A simple wrapper of the phonopy irreps module for finding irreducible representations of phonon modes in ABINIT's anaddb output.
Installation
Install from PyPI:
pip install anaddb_irreps
Or from source:
pip install .
Usage (Python API)
From anaddb PHBST (AbiPy)
Run anaddb to get the PHBST file with phonon frequencies and eigenvectors. See example in examples/MoS2_1T/anaddb_input/.
Basic Usage
from anaddb_irreps import print_irreps
# Simple usage
print_irreps("run_PHBST.nc", ind_q=0)
With Options
from anaddb_irreps import print_irreps
print_irreps(
"run_PHBST.nc",
ind_q=0,
symprec=1e-8, # Symmetry precision (default: 1e-5)
degeneracy_tolerance=1e-4, # Frequency tolerance (default: 1e-4)
log_level=1, # Verbosity: 0=quiet, 1+=verbose (default: 0)
show_verbose=True # Show detailed phonopy output (default: False)
)
From phonopy params/YAML
If you already have a phonopy params/YAML file (e.g. phonopy_params.yaml or
phonopy.yaml), you can use the phonopy-based helper:
from anaddb_irreps import print_irreps_phonopy
irr = print_irreps_phonopy(
"phonopy_params.yaml",
qpoint=[0.0, 0.0, 0.0],
symprec=1e-5,
degeneracy_tolerance=1e-4,
log_level=0,
show_verbose=False,
)
Parameters
For print_irreps (anaddb route):
- phbst_fname (str, required): Path to PHBST NetCDF file
- ind_q (int, required): Index of q-point in PHBST file (0-based)
- symprec (float): Symmetry precision for structure analysis (default: 1e-5)
- degeneracy_tolerance (float): Frequency tolerance for degeneracy detection (default: 1e-4)
- is_little_cogroup (bool): Use little co-group setting (default: False)
- log_level (int): Verbosity level; 0=quiet, higher=more verbose (default: 0)
- show_verbose (bool): Show detailed phonopy irreps output (default: False)
For print_irreps_phonopy (phonopy route):
- phonopy_params (str, required): Path to phonopy params/YAML file
- qpoint (sequence of 3 floats, required): q-point in fractional coordinates
- symprec (float or None): Symmetry precision for structure analysis. If
None(or omitted), anaddb_irreps will try to use the symmetry tolerance recorded in the phonopy file (e.g.phonopy.symmetry_tolerancein the YAML), falling back to1e-5when not available. - degeneracy_tolerance (float): Frequency tolerance for degeneracy detection (default: 1e-4)
- is_little_cogroup (bool): Use little co-group setting (default: False)
- log_level (int): Verbosity level; 0=quiet, higher=more verbose (default: 0)
- show_verbose (bool): Show detailed phonopy irreps output (default: False)
Usage (CLI)
Use the anaddb-irreps and phonopy-irreps command-line tools for quick command-line access.
Basic Example (anaddb PHBST)
anaddb-irreps --phbst run_PHBST.nc --q-index 0
With Options (anaddb PHBST)
anaddb-irreps \
--phbst run_PHBST.nc \
--q-index 0 \
--symprec 1e-8 \
--degeneracy-tolerance 1e-4 \
--log-level 1
Basic Example (phonopy params)
phonopy-irreps \
--params phonopy_params.yaml \
--qpoint 0.0 0.0 0.0
CLI Options
For anaddb-irreps:
-p,--phbst(required): Path to PHBST NetCDF file-q,--q-index(required): Index of q-point in PHBST file (0-based)-s,--symprec: Symmetry precision (default: 1e-5)-d,--degeneracy-tolerance: Frequency tolerance for degeneracy (default: 1e-4)-l,--is-little-cogroup: Use little co-group setting-v,--log-level: Verbosity level; 0=quiet, higher=more verbose (default: 0)
For phonopy-irreps:
-p,--params(required): Path to phonopy params/YAML file--qpoint(required): Three floats for q-point in fractional coordinates-s,--symprec: Override symmetry precision. If omitted, anaddb_irreps will try to use the symmetry tolerance stored in the phonopy file, falling back to1e-5.-d,--degeneracy-tolerance: Frequency tolerance for degeneracy (default: 1e-4)-l,--is-little-cogroup: Use little co-group setting-v,--log-level: Verbosity level; 0=quiet, higher=more verbose (default: 0)
The CLI produces the same output format as the Python API, showing q-point, point group, and a table of phonon modes with their irreducible representations and IR/Raman activity.
Output Format
The output includes:
- Q-point coordinates in fractional coordinates
- Point group of the structure at that q-point
- Mode table with columns:
qx, qy, qz: q-point coordinates (repeated for each mode)band: Mode index (0-based)freq(THz): Frequency in THzfreq(cm-1): Frequency in cm⁻¹label: Irreducible representation label (e.g., Eu, Eg, A1g)IR: IR activity (Y= active,.= inactive)Raman: Raman activity (Y= active,.= inactive)
Example Output
q-point: [0.0000, 0.0000, 0.0000]
Point group: -3m
# qx qy qz band freq(THz) freq(cm-1) label IR Raman
0.0000 0.0000 0.0000 0 0.0000 0.00 - . .
0.0000 0.0000 0.0000 1 0.0000 0.00 - . .
0.0000 0.0000 0.0000 2 0.0000 0.00 - . .
0.0000 0.0000 0.0000 3 6.4001 213.49 Eu Y .
0.0000 0.0000 0.0000 4 6.4001 213.49 Eu Y .
0.0000 0.0000 0.0000 5 6.8617 228.88 Eg . Y
0.0000 0.0000 0.0000 6 6.8617 228.88 Eg . Y
0.0000 0.0000 0.0000 7 11.1626 372.34 A1g . Y
0.0000 0.0000 0.0000 8 11.3152 377.43 A2u Y .
Examples
See examples/MoS2_1T/ for a complete working example with MoS2 1T structure.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anaddb_irreps-0.1.3.tar.gz.
File metadata
- Download URL: anaddb_irreps-0.1.3.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60389ebed9862c659bae532064b3aff82124df0969c18f43850bf153d2e2e7d1
|
|
| MD5 |
1c4ed9a41d3e92261bb47ca46ca72b8f
|
|
| BLAKE2b-256 |
597eef88d315d3a2ee0db782edb494188aa399dc40b01e74634cbebbb0121da6
|
File details
Details for the file anaddb_irreps-0.1.3-py3-none-any.whl.
File metadata
- Download URL: anaddb_irreps-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b234f93751d891c7497062c736fe85f96e151084bd6417836617fdd84e6a41d3
|
|
| MD5 |
e136cd81322522a9e47234ce36d176da
|
|
| BLAKE2b-256 |
15de2de40ea2be761af6fce2ebd0ae169b20065182bfd7a357efc42e8459120b
|