Skip to main content

A Basic Symmetry Module

Project description

bsym

PyPI version DOI status Coverage Status Documentation Status

bsym is a basic Python symmetry module. It consists of core classes that describe configuration vector spaces, their symmetry operations, and specific configurations of objects within these spaces. The module also contains an interface for working with pymatgen Structure objects, to allow simple generation of disordered symmetry-inequivalent structures from a symmetric parent crystal structure.

Usage examples are provided in the documentation. API documentation is here. Source code is available at https://github.com/bjmorgan/bsym.

Requirements

bsym requires Python 3.10 or later.

Installation

Standard Installation

Install from PyPI:

pip install bsym

Installation from Source

Download the latest release from GitHub, and install:

cd bsym
pip install .

Or clone the latest development version:

git clone git@github.com:bjmorgan/bsym.git
cd bsym
pip install .

Development Installation

To install with development dependencies (for running tests, type checking, building docs, etc.):

git clone git@github.com:bjmorgan/bsym.git
cd bsym
pip install -e ".[dev]"

This installs bsym in editable mode with additional tools for development.

Tests

Tests use pytest. After installing with development dependencies, run:

pytest

For verbose output:

pytest -v

To run specific test files:

pytest tests/unit_tests/test_symmetry_group.py

Example Usage

Enumerating Symmetry-Inequivalent Structures

bsym can enumerate symmetry-inequivalent structures for disordered materials. Here's an example using a pymatgen Structure as input:

from bsym.interface.pymatgen import unique_structure_substitutions
unique_structures = unique_structure_substitutions(
    parent_structure, 
    'X',  # Sites to substitute
    {'O': 8, 'F': 16}  # 8 oxygen, 16 fluorine
)
print(f"Found {len(unique_structures)} unique structures")

Documentation

An overview of the capabilities of bsym along with example code is provided in the documentation.

Citing bsym

This code can be cited as:

Morgan, Benjamin J. (2017). bsym - a Basic Symmetry Module. The Journal of Open Source Software. http://doi.org/10.21105/joss.00370

BibTeX

@article{Morgan_JOSS2017b,
  doi = {10.21105/joss.00370},
  url = {https://doi.org/10.21105/joss.00370},
  year  = {2017},
  month = {aug},
  publisher = {The Open Journal},
  volume = {2},
  number = {16},
  author = {Benjamin J. Morgan},
  title = {bsym: A basic symmetry module},
  journal = {The Journal of Open Source Software}
}

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

bsym-2.1.1.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bsym-2.1.1-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file bsym-2.1.1.tar.gz.

File metadata

  • Download URL: bsym-2.1.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bsym-2.1.1.tar.gz
Algorithm Hash digest
SHA256 93a6e77964e50e16b0fc907e20fb1c5456644de1a6400d272f14289badd4fedb
MD5 7d1fd292f53e84b9ea3f1433264430f7
BLAKE2b-256 c52501e83825c50e9eb0b119e63bc5199e424eb3bcfe5f0b5bf3f1890822735d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bsym-2.1.1.tar.gz:

Publisher: publish.yml on bjmorgan/bsym

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bsym-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: bsym-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bsym-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9e7c97a39ec8e85d6c9b77a31dcf299659be24227f432ea874094c230d9ea95
MD5 ad59e0123f21b802f40d5f839d66fa82
BLAKE2b-256 3cd43185d90947147d2597bc693553d78fc36843fcb20f0e455380b7447c07ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for bsym-2.1.1-py3-none-any.whl:

Publisher: publish.yml on bjmorgan/bsym

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page