multixem 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {multixem-0.3.2 → multixem-0.3.3}/MANIFEST.in +2 -1
- {multixem-0.3.2 → multixem-0.3.3}/PKG-INFO +1 -1
- {multixem-0.3.2 → multixem-0.3.3}/multixem/__init__.py +1 -1
- multixem-0.3.3/multixem/scripts/Rrot_sum_eigen.py +62 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem.egg-info/SOURCES.txt +1 -0
- {multixem-0.3.2 → multixem-0.3.3}/pyproject.toml +1 -1
- {multixem-0.3.2 → multixem-0.3.3}/LICENSE +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/README.md +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/analyse_refinement.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/bootstrap_dataset.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/bootstrap_maps.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/bootstrap_statistics.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/bootstrap_structures.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/data/Rrot_sum_eigen.json +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/run.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/multixem/tools.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/setup.cfg +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/tests/test_argparse.py +0 -0
- {multixem-0.3.2 → multixem-0.3.3}/tests/test_integration.py +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
include multixem/data/*.json
|
|
2
|
+
include multixem/scripts/*.py
|
|
3
|
+
|
|
2
4
|
prune dist
|
|
3
5
|
prune build
|
|
4
6
|
prune __venv__
|
|
@@ -11,7 +13,6 @@ prune docs_backup
|
|
|
11
13
|
prune scripts_backup
|
|
12
14
|
prune multixem_tmp
|
|
13
15
|
prune multixem_*
|
|
14
|
-
prune multixem/scripts
|
|
15
16
|
prune multixem/prototypes
|
|
16
17
|
|
|
17
18
|
global-exclude *.py[cod]
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import gemmi
|
|
2
|
+
import numpy
|
|
3
|
+
from pprint import pprint
|
|
4
|
+
import json
|
|
5
|
+
from collections import OrderedDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def get_Rrot_sum_eigen():
|
|
9
|
+
"""
|
|
10
|
+
Compute the sum of rotation symmetry operation matrices and its
|
|
11
|
+
eigen decomposition for the highest-numbered space group in each point group.
|
|
12
|
+
Save results to Rrot_sum_eigen.json.
|
|
13
|
+
"""
|
|
14
|
+
# Find the highest space group per point group
|
|
15
|
+
point_group_to_sg = {}
|
|
16
|
+
# Iterate over all 230 space groups
|
|
17
|
+
for sg in gemmi.spacegroup_table():
|
|
18
|
+
pg = sg.point_group_hm()
|
|
19
|
+
# Keep the space group with the highest number per point group
|
|
20
|
+
if pg not in point_group_to_sg or sg.number > point_group_to_sg[pg].number:
|
|
21
|
+
point_group_to_sg[pg] = sg
|
|
22
|
+
|
|
23
|
+
print("Point groups:", list(point_group_to_sg.keys()))
|
|
24
|
+
|
|
25
|
+
point_group_results = OrderedDict({})
|
|
26
|
+
# Iterate over the selected space groups, one each for a point group
|
|
27
|
+
for pg, sg in point_group_to_sg.items():
|
|
28
|
+
ops = sg.operations()
|
|
29
|
+
# Keep rotation matrices as integers to avoid numerical artifacts
|
|
30
|
+
rots = [numpy.array(op.rot, dtype=int) for op in ops.sym_ops]
|
|
31
|
+
Rsum = numpy.array(numpy.sum(rots, axis=0) / 24, dtype=int)
|
|
32
|
+
# Eigen decomposition
|
|
33
|
+
eigvals, eigvecs = numpy.linalg.eig(Rsum)
|
|
34
|
+
eigvals_all = numpy.round(eigvals).astype(int)
|
|
35
|
+
eigvecs_all = numpy.round(eigvecs).astype(int)
|
|
36
|
+
# Get eigenvalues and related eigenvectors that are truly non-zero
|
|
37
|
+
nonzero_idx = numpy.where(numpy.abs(eigvals) > 1e-12)[0]
|
|
38
|
+
subspace_dim = len(nonzero_idx)
|
|
39
|
+
eigvals_nonzero = numpy.round(eigvals[nonzero_idx]).astype(int)
|
|
40
|
+
eigvecs_nonzero = numpy.round(eigvecs[:, nonzero_idx]).astype(int).T
|
|
41
|
+
point_group_results[pg] = OrderedDict(
|
|
42
|
+
{
|
|
43
|
+
"space_group_highest": sg.hm,
|
|
44
|
+
"space_group_highest_number": sg.number,
|
|
45
|
+
"Rrot_sum": Rsum.tolist(),
|
|
46
|
+
"eigenindices_nonzero": nonzero_idx.tolist(),
|
|
47
|
+
"eigenvalues": eigvals_all.tolist(),
|
|
48
|
+
"eigenvectors": eigvecs_all.tolist(),
|
|
49
|
+
"subspace_dimension": subspace_dim,
|
|
50
|
+
"eigenvalues_nonzero": eigvals_nonzero.tolist(),
|
|
51
|
+
"eigenvectors_nonzero": eigvecs_nonzero.tolist(),
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
pprint(point_group_results)
|
|
56
|
+
with open("Rrot_sum_eigen.json", "w") as f:
|
|
57
|
+
json.dump(point_group_results, f, indent=2)
|
|
58
|
+
print("Rrot_sum_eigen.json written with results for each point group.")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if __name__ == "__main__":
|
|
62
|
+
get_Rrot_sum_eigen()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|