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:
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
$ pip install pniggli
Usage
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.
Version
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
Release files for pniggli 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pniggli-0.1.3.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pniggli-0.1.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / pniggli-0.1.3.tar.gz
| Download URL | pniggli-0.1.3.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2916cfbe96b6b2c3f580aa81f4d57fa8b4a8cc8085f29d72f1351a6af3482346
|
|
BLAKE2b-256 checksum How to use checksums |
afddac558aa8cf5c48861d0b765eb2c6b44e93ecf6359ec95c7fdc102c54a3cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|
Release files / pniggli-0.1.3-py2.py3-none-any.whl
| Download URL | pniggli-0.1.3-py2.py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6ccbd1c3fad9d638a6ab3f7be1560eb70016f881a02ac184725f654803588f31
|
|
BLAKE2b-256 checksum How to use checksums |
5088d471fcf9ab23e80087c25c02ed23c0f915f6ccd073996e4e6ce098ee77d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
|