Structures of Alloys Generation And Recognition
Project description
pniggli
========================================
This is a (P)ure python implementation of algorithm to determin Niggli cell.
The library supports both 2D and 3D niggli transformations.
Rows of list or rows of `numpy.ndarray` correspond basis vectors, a, b, c or a, b
They are input to niggli_reduce as a row with three colum matrices,
same as most DFT softwares' lattice inputs.
In the implementation details, since the lattice is represented by a row vector,
the transformation operation on the lattice is left-multiplied, such as:
```python
import numpy as np
# TMatrix is the transform matrix
new_Lattice = np.matmul(TMatrix, old_Lattice)
```
For details of the algorithm, see [[Niggli for 2d and 3d]](http://)
Install
----------
```shell
$ pip install pniggli
```
Usage
----------
```python
from pniggli import niggli_reduce, niggli_check
lattice_3D = [4.912, 0.000, 0.000,
-2.456, 4.254, 0.000,
0.000, 0.000, 0.000]
niggli_lattice = niggli_reduce(lattice_3D)
print(niggli_lattice)
# Out:
# array([[ 4.912, 0. , 0. ],
# [-2.456, 4.254, 0. ],
# [ 0. , 0. , 16. ]])
print(niggli_check(niggli_lattice)) # True
lattice_2D = [2.4560000896, 0.0000000000,
11.0520002567, 2.1269502021]
niggli_lattice = niggli_reduce(lattice_2D)
print(niggli_lattice)
# Out[6]:
# array([[-1.2279999 , -2.1269502 ],
# [-1.22800019, 2.1269502 ]])
```
The 2D example is a triangle motif.
Feature
----------
##### v0.1.2
+ 2D and 3D niggli reduce support
+ niggli_check for 3D lattice
##### v0.1.0
+ 3D niggli reduce support
+ niggli_check for 3D lattice
========================================
This is a (P)ure python implementation of algorithm to determin Niggli cell.
The library supports both 2D and 3D niggli transformations.
Rows of list or rows of `numpy.ndarray` correspond basis vectors, a, b, c or a, b
They are input to niggli_reduce as a row with three colum matrices,
same as most DFT softwares' lattice inputs.
In the implementation details, since the lattice is represented by a row vector,
the transformation operation on the lattice is left-multiplied, such as:
```python
import numpy as np
# TMatrix is the transform matrix
new_Lattice = np.matmul(TMatrix, old_Lattice)
```
For details of the algorithm, see [[Niggli for 2d and 3d]](http://)
Install
----------
```shell
$ pip install pniggli
```
Usage
----------
```python
from pniggli import niggli_reduce, niggli_check
lattice_3D = [4.912, 0.000, 0.000,
-2.456, 4.254, 0.000,
0.000, 0.000, 0.000]
niggli_lattice = niggli_reduce(lattice_3D)
print(niggli_lattice)
# Out:
# array([[ 4.912, 0. , 0. ],
# [-2.456, 4.254, 0. ],
# [ 0. , 0. , 16. ]])
print(niggli_check(niggli_lattice)) # True
lattice_2D = [2.4560000896, 0.0000000000,
11.0520002567, 2.1269502021]
niggli_lattice = niggli_reduce(lattice_2D)
print(niggli_lattice)
# Out[6]:
# array([[-1.2279999 , -2.1269502 ],
# [-1.22800019, 2.1269502 ]])
```
The 2D example is a triangle motif.
Feature
----------
##### v0.1.2
+ 2D and 3D niggli reduce support
+ niggli_check for 3D lattice
##### v0.1.0
+ 3D niggli reduce support
+ niggli_check for 3D lattice
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
pniggli-0.1.2.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for pniggli-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0de3c8724a8dd2ccd640a5be0976a87f2399ef67b7cb0b46c8ea27c2a49937f0 |
|
MD5 | 7aac3059ba7042533f8e91c48a2f3a4a |
|
BLAKE2b-256 | 6e4ae4c588d9122e95b909b26a6e3105e8a5f1fbb4a846729026bfa50d08dc22 |