A Basic Symmetry Module
Project description
bsym
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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93a6e77964e50e16b0fc907e20fb1c5456644de1a6400d272f14289badd4fedb
|
|
| MD5 |
7d1fd292f53e84b9ea3f1433264430f7
|
|
| BLAKE2b-256 |
c52501e83825c50e9eb0b119e63bc5199e424eb3bcfe5f0b5bf3f1890822735d
|
Provenance
The following attestation bundles were made for bsym-2.1.1.tar.gz:
Publisher:
publish.yml on bjmorgan/bsym
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsym-2.1.1.tar.gz -
Subject digest:
93a6e77964e50e16b0fc907e20fb1c5456644de1a6400d272f14289badd4fedb - Sigstore transparency entry: 730743157
- Sigstore integration time:
-
Permalink:
bjmorgan/bsym@738f21adc4bf0a93791839803dde7dff4d986b26 -
Branch / Tag:
refs/tags/2.1.1 - Owner: https://github.com/bjmorgan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@738f21adc4bf0a93791839803dde7dff4d986b26 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9e7c97a39ec8e85d6c9b77a31dcf299659be24227f432ea874094c230d9ea95
|
|
| MD5 |
ad59e0123f21b802f40d5f839d66fa82
|
|
| BLAKE2b-256 |
3cd43185d90947147d2597bc693553d78fc36843fcb20f0e455380b7447c07ec
|
Provenance
The following attestation bundles were made for bsym-2.1.1-py3-none-any.whl:
Publisher:
publish.yml on bjmorgan/bsym
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsym-2.1.1-py3-none-any.whl -
Subject digest:
d9e7c97a39ec8e85d6c9b77a31dcf299659be24227f432ea874094c230d9ea95 - Sigstore transparency entry: 730743160
- Sigstore integration time:
-
Permalink:
bjmorgan/bsym@738f21adc4bf0a93791839803dde7dff4d986b26 -
Branch / Tag:
refs/tags/2.1.1 - Owner: https://github.com/bjmorgan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@738f21adc4bf0a93791839803dde7dff4d986b26 -
Trigger Event:
release
-
Statement type: