Skip to main content

spgrep-modulation

testing pre-commit.ci status codecov License PyPI - Python Version PyPI version PyPI Downloads

Collective atomic modulation analysis with irreducible space-group representation

Features

  • Calculate representation matrices and irreps formed by phonon eigenmodes
  • Calculate isotropy subgroups of irreps of space groups on the fly
  • Generate modulated structures in selected order-parameter directions of isotropy subgroups

Usage

from pathlib import Path
import phonopy
from phonopy.structure.symmetry import Symmetry
from spgrep_modulation.modulation import Modulation

# Load Phonopy object
path = Path(__file__).resolve().parent.parent / "tests" / "phonopy_mp-2998.yaml.xz"
ph = phonopy.load(path)

# Prepare Modulation class
qpoint = [0.5, 0, 0]  # X point
md = Modulation.with_supercell_and_symmetry_search(
    dynamical_matrix=ph.dynamical_matrix,
    supercell_matrix=[2, 2, 2],
    qpoint=qpoint,
    factor=ph.unit_conversion_factor,
)

# Degenerated imaginary mode
frequency_index = 0
print(f"Frequency (THz): {md.eigvals_to_frequencies(md.eigenspaces[frequency_index][0]):.2f}")
# -> Frequency (THz): -4.88
print(f"Irrep shape: {md.eigenspaces[frequency_index][2].shape}")
# -> Irrep shape: (16, 2, 2)

# Modulated cells corresponding to one-dimensional order-parameter directions of isotropy subgroup
cells = md.get_high_symmetry_modulated_supercells(frequency_index)
for cell in cells:
    symmetry = Symmetry(cell)
    print(f"{symmetry.dataset['international']} (No. {symmetry.dataset['number']})")
# -> Pmma (No. 51) and Cmcm (No. 63)

Installation

pip install spgrep-modulation
conda create -n modulation python=3.10 pip
conda activate modulation
git clone git@github.com:lan496/spgrep-modulation.git
cd spgrep-modulation
pip install -e .
# pip install -e ".[dev,docs,vis]"
# pre-commit install

License

spgrep-modulation is released under a BSD 3-clause license.

Development

Document

sphinx-autobuild docs docs_build
# open localhost:8000 in your browser

Acknowledgements

Some test files tests/phonopy_mp-*.yaml.xz are adapted from phonondb under CC BY 4.0.

Metadata

Release files for spgrep-modulation 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spgrep-modulation 0.3.0
File Size Uploaded Provenance
spgrep_modulation-0.3.0.tar.gz 390.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for spgrep-modulation 0.3.0
File Interpreter ABI Platform
spgrep_modulation-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 411.3 kB

Release files / spgrep_modulation-0.3.0.tar.gz

Download URL spgrep_modulation-0.3.0.tar.gz
Size 390.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7405eef3202823395a9cc7c16efa11c9748fd2dd9033b4ff271ddb30c452163a
BLAKE2b-256 checksum
How to use checksums
80403275a0f16e1938ba7404c6c49aa2c07d2b21209fa9c3a29f6aed9ad90aea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / spgrep_modulation-0.3.0-py3-none-any.whl

Download URL spgrep_modulation-0.3.0-py3-none-any.whl
Size 20.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
664370ef431615b61e48c83c0efa749b4c9ea1d8754cdfb55288e37979bb6d53
BLAKE2b-256 checksum
How to use checksums
aedca08eed3a298dd2e145ee370d8e818acaabca0ac4b717e52b18df09c339d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for spgrep-modulation 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page