Coder Social home page Coder Social logo

yardasol / spgrep Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spglib/spgrep

0.0 0.0 0.0 14.4 MB

On-the-fly generator of space-group irreducible representations

Home Page: https://spglib.github.io/spgrep/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

spgrep's Introduction

Spgrep

testing pre-commit.ci status codecov License PyPI - Python Version PyPI version PyPI Downloads Lines of code DOI

Spgrep is a Python package of on-the-fly generator of space-group irreducible representations.

Features

  • Enumerate the following irreducible representations (irreps) of space groups from spglibโ€™s cell and kpoints:
    • Linear irreps
    • Physically irreps (irreps over real numbers)
    • Projective irreps for spnior
    • Projective irreducible co-representations for spinor
  • Enumerate irreps of crystallographic point groups as well
  • Find symmetry-adapted basis forming given irreps
  • Minimal dependencies (numpy and spglib)

Usage

from spgrep import get_spacegroup_irreps
from spgrep.representation import get_character

# Rutile structure (https://materialsproject.org/materials/mp-2657/)
# P4_2/mnm (No. 136)
a = 4.603
c = 2.969
x_4f = 0.3046
lattice = [
    [a, 0, 0],
    [0, a, 0],
    [0, 0, c],
]
positions = [
    [0, 0, 0],  # Ti(2a)
    [0.5, 0.5, 0.5],  # Ti(2a)
    [x_4f, x_4f, 0],  # O(4f)
    [-x_4f, -x_4f, 0],  # O(4f)
    [-x_4f + 0.5, x_4f + 0.5, 0.5],  # O(4f)
    [x_4f + 0.5, -x_4f + 0.5, 0.5],  # O(4f)
]
numbers = [0, 0, 1, 1, 1, 1]

kpoint = [0.5, 0, 0]  # X point
irreps, rotations, translations, mapping_little_group = get_spacegroup_irreps(
    lattice, positions, numbers, kpoint
)

# Symmetry operations by spglib
assert len(rotations) == 16
assert len(translations) == 16

# At X point, the little co-group is isomorphic to mmm (order=8)
assert len(mapping_little_group) == 8
print(mapping_little_group)  # [ 0,  1,  4,  5,  8,  9, 12, 13]

# Two two-dimensional irreps
for irrep in irreps:
    print(get_character(irrep))
# [2.+0.j 0.+0.j 0.+0.j 2.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j]
# [2.+0.j 0.+0.j 0.+0.j -2.+0.j 0.+0.j 0.+0.j 0.+0.j 0.+0.j]

See example pages for more detailed use cases and API summary for summary of functionalities.

Installation

Spgrep works with Python3.8+ and can be installed via PyPI:

pip install spgrep

or in local:

conda create -n spgrep python=3.10 pip
conda activate spgrep
git clone [email protected]:spglib/spgrep.git
cd spgrep
pip install -e .

Change log

See the change log for recent changes.

How to contribute

We welcome any contributions to improve functionalities. Please open issues or create pull requests. See the development page for preparing an environment.

License

Spgrep is released under a BSD 3-clause license.

spgrep's People

Contributors

lan496 avatar pre-commit-ci[bot] avatar dependabot[bot] avatar danielskatz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.