semvec/pypi-packages huggingface dataset:
dsenum 0.4.4
Derivative structure enumerator for multilattice
License: MIT
Requires Python: >=3.8


# dsenum

[![testing](https://github.com/lan496/dsenum/actions/workflows/testing.yml/badge.svg?branch=master)](https://github.com/lan496/dsenum/actions/workflows/testing.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/lan496/dsenum/master.svg)](https://results.pre-commit.ci/latest/github/lan496/dsenum/master)
[![codecov](https://codecov.io/gh/lan496/dsenum/branch/master/graph/badge.svg)](https://codecov.io/gh/lan496/dsenum)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dsenum)
[![PyPI version](https://badge.fury.io/py/dsenum.svg)](https://badge.fury.io/py/dsenum)
![PyPI - Downloads](https://img.shields.io/pypi/dm/dsenum)

Derivative structure enumerator for multilattice

- Github: https://github.com/lan496/dsenum
- PyPI: https://pypi.org/project/dsenum/

## Installation

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

```shell
pip install dsenum
```

Or in local:
```shell
git clone git@github.com:lan496/dsenum.git
cd dsenum
pip install -e .
```

## Usage

```python
import numpy as np
from pymatgen.core import Lattice, Structure
from pymatgen.core.periodic_table import DummySpecie

from dsenum import StructureEnumerator

latt = Lattice(np.array([[0, 1, 1], [1, 0, 1], [1, 1, 0]]))
coords = [[0, 0, 0]]
structure = Structure(latt, [DummySpecie('X')] * len(coords), coords)

num_type = 2
index = 4

dstructs = StructureEnumerator(structure, index, num_type).generate()
print(len(dstructs))  # -> 12
```

See [docs/examples/constraints.ipynb](docs/examples/constraints.ipynb) for more complicated use cases.

## How to cite dsenum

If you use `dsenum.ZddStructureEnumerator` in your research, please cite the following articles.

```
@article{doi:10.1063/5.0021663,
    author = {Shinohara,Kohei  and Seko,Atsuto  and Horiyama,Takashi  and Ishihata,Masakazu  and Honda,Junya  and Tanaka,Isao },
    title = {Enumeration of nonequivalent substitutional structures using advanced data structure of binary decision diagram},
    journal = {J. Chem. Phys.},
    volume = {153},
    number = {10},
    pages = {104109},
    year = {2020},
    doi = {10.1063/5.0021663},
    URL = {https://doi.org/10.1063/5.0021663},
}
```

```
@inproceedings{Horiyama2018,
  memo ={Isomorphism Elimination by Zero-Suppressed Binary Decision Diagrams},
  author={Takashi Horiyama and Masahiro Miyasaka and Riku Sasaki},
  booktitle={the Canadian Conference on Computational Geometry},
  pages={360--366},
  address={Winnipeg, Manitoba, Canada}
  year={2018},
  url={http://www.cs.umanitoba.ca/~cccg2018/papers/session7B-p2.pdf}
}
```

## Acknowledgments

I acknowledge Dr. Takashi Horiyama for sharing his implementation of the frontier method for isomorphism-elimination decision diagram.
I also appreciate his kindness to allow publishing the code.
pyzdd 0.3.0
Python wrapper to TdZdd
License: MIT
Requires Python: >=3.8


# pyzdd
[![testing](https://github.com/lan496/pyzdd/actions/workflows/testing.yml/badge.svg)](https://github.com/lan496/pyzdd/actions/workflows/testing.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/lan496/pyzdd/main.svg?badge_token=MU26PgVHQe-LRTPsqN6olg)](https://results.pre-commit.ci/latest/github/lan496/pyzdd/main?badge_token=MU26PgVHQe-LRTPsqN6olg)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyzdd)
[![PyPI version](https://badge.fury.io/py/pyzdd.svg)](https://badge.fury.io/py/pyzdd)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pyzdd)

Python wrapper to TdZdd

- Github: https://github.com/lan496/pyzdd
- PyPI: https://pypi.org/project/pyzdd/

## Installation

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

```shell
pip install pyzdd
```

or in local:

```shell
git clone git@github.com:lan496/pyzdd.git
cd pyzdd
pip install -e .
```

## How to cite pyzdd

If you use this package in your research, please cite TdZDD as follows.

```
@techreport{Iwashita13,
  author = {Hiroaki Iwashita and Shinichi Minato},
  memo = {Efficient Top-Down {ZDD} Construction Techniques Using Recursive Specifications},
  year = {2013},
  number = {TCS-TRA-1369,
  INSTITUTION = {Graduate School of Information Science and Technology, Hokkaido University}
}
```

The citation for the isomorphism-elimination DD is as follows.

```
@inproceedings{Horiyama2018,
  memo ={Isomorphism Elimination by Zero-Suppressed Binary Decision Diagrams},
  author={Takashi Horiyama and Masahiro Miyasaka and Riku Sasaki},
  booktitle={the Canadian Conference on Computational Geometry},
  pages={360--366},
  address={Winnipeg, Manitoba, Canada}
  year={2018},
  url={http://www.cs.umanitoba.ca/~cccg2018/papers/session7B-p2.pdf}
}
```

## Development

### Installation

```shell
./clean.sh && pip install -e ".[dev]"
pre-commit install
```

### Testing

```shell
cd xtal_tdzdd/test
cmake -S . -B build
cmake --build build -j 32
cd build && ctest -vv
```

### Building Python wheels in local

```shell
# Linux build
cibuildwheel --platform linux

# MacOS build
cibuildwheel --platform macos
```

### Write Custom Specification
1. Write a TdZdd-specification in `src/spec/*.hpp`
2. Let the new specification class be `A`, wrap the following classes and methods in `src/wrapper.cpp`
    - `tdzdd::DdSpecBase<A, 2>`
    - `tdzdd::DdSpec<A, T, 2>`
    - `A`
    - `tdzdd::DdStructure<2>::zddSubset<A>`
3. import `_pyzdd.A` in `pyzdd/__init__.py`

## References
- https://github.com/kunisura/TdZdd
- https://github.com/junkawahara/frontier_basic_tdzdd