rsspolymlp 0.4.3__tar.gz → 0.4.4__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.
- {rsspolymlp-0.4.3/src/rsspolymlp.egg-info → rsspolymlp-0.4.4}/PKG-INFO +1 -6
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/README.md +0 -5
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/pyproject.toml +1 -1
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/rss_summarize.py +28 -8
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/identify_uniqstr.py +12 -2
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/cli_rsspolymlp.py +8 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/cli_rsspolymlp_utils.py +1 -1
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/rsspolymlp.py +3 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/rsspolymlp_utils.py +2 -3
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/common/atomic_energy.py +2 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/common/property.py +1 -1
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/dataset/split_dataset.py +4 -3
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/make_plot.py +14 -3
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/spglib_utils.py +5 -1
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4/src/rsspolymlp.egg-info}/PKG-INFO +1 -6
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/LICENSE +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/setup.cfg +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/eos.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/ghost_minima.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/phase_analysis.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/assignment_algo.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/chiral_spg.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/gen_struct_rep.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/redrep_lattice.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/redrep_position.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/struct_match.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/test/gen_lattice.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/test/time_measure.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/cli_rsspolymlp_devkit.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/cli_rsspolymlp_plot.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/rsspolymlp_devkit.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/api/rsspolymlp_plot.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/common/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/common/composition.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/common/convert_dict.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/common/interface_vasp.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/dataset/compress_vasprun.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/dataset/gen_mlp_dataset.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/estimate_cost.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/model_selection/binary/gen_single_model.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/model_selection/elemental/gen_hybrid_model.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/model_selection/elemental/gen_single_model.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/model_selection/n_feature.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/model_selection/pypolymlp_gridsearch.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/model_selection/reduce_grid.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/pareto_opt_mlp.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/polymlp_dev.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/rss/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/rss/eliminate_duplicates.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/rss/load_logfile.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/rss/optimization_mlp.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/rss/random_struct.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/lammps_utils.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/custom_plt.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/examples/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/examples/example.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/examples/template.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/opt_sscha/opt_geometry_sscha.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/opt_sscha/opt_position_sscha.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/opt_sscha/run_opt_sscha.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/opt_sscha/sscha_property.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/pymatgen_utils.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/vasp_util/__init__.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/vasp_util/api.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/vasp_util/gen_incar.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/vasp_util/gen_script.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/vasp_util/write_poscar.py +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp.egg-info/SOURCES.txt +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp.egg-info/dependency_links.txt +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp.egg-info/entry_points.txt +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp.egg-info/requires.txt +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp.egg-info/top_level.txt +0 -0
- {rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/tests/test_cli_help.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rsspolymlp
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: A framework for random structure search using polynomial MLPs
|
|
5
5
|
Author-email: Hayato Wakai <wakai@cms.mtl.kyoto-u.ac.jp>
|
|
6
6
|
Maintainer-email: Hayato Wakai <wakai@cms.mtl.kyoto-u.ac.jp>
|
|
@@ -79,11 +79,6 @@ pip install rsspolymlp
|
|
|
79
79
|
- Global RSS with polynomial MLPs
|
|
80
80
|
- Unique structure identification and RSS result summarization
|
|
81
81
|
- Phase stability analysis
|
|
82
|
-
- [Development kit for polynomial MLPs](docs/rsspolymlp_dev.md)
|
|
83
|
-
- MLP dataset generation
|
|
84
|
-
- DFT dataset division
|
|
85
|
-
- Polynomial MLP development
|
|
86
|
-
- Pareto-optimal MLP selection
|
|
87
82
|
- Python API
|
|
88
83
|
- [RSS workflow](docs/api_rsspolymlp.md)
|
|
89
84
|
- [VASP calculation utilities](src/rsspolymlp/utils/vasp_util/readme.md)
|
|
@@ -48,11 +48,6 @@ pip install rsspolymlp
|
|
|
48
48
|
- Global RSS with polynomial MLPs
|
|
49
49
|
- Unique structure identification and RSS result summarization
|
|
50
50
|
- Phase stability analysis
|
|
51
|
-
- [Development kit for polynomial MLPs](docs/rsspolymlp_dev.md)
|
|
52
|
-
- MLP dataset generation
|
|
53
|
-
- DFT dataset division
|
|
54
|
-
- Polynomial MLP development
|
|
55
|
-
- Pareto-optimal MLP selection
|
|
56
51
|
- Python API
|
|
57
52
|
- [RSS workflow](docs/api_rsspolymlp.md)
|
|
58
53
|
- [VASP calculation utilities](src/rsspolymlp/utils/vasp_util/readme.md)
|
|
@@ -6,17 +6,18 @@ import xml.etree.ElementTree as ET
|
|
|
6
6
|
from collections import defaultdict
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from time import time
|
|
9
|
-
from typing import Optional
|
|
9
|
+
from typing import Literal, Optional
|
|
10
10
|
|
|
11
11
|
import numpy as np
|
|
12
|
-
from pypolymlp.utils.vasp_utils import write_poscar_file
|
|
13
12
|
|
|
13
|
+
from pypolymlp.utils.vasp_utils import write_poscar_file
|
|
14
14
|
from rsspolymlp.analysis.ghost_minima import detect_ghost_minima
|
|
15
15
|
from rsspolymlp.analysis.struct_matcher.gen_struct_rep import (
|
|
16
16
|
StructRepGenerator,
|
|
17
17
|
StructReps,
|
|
18
18
|
)
|
|
19
19
|
from rsspolymlp.analysis.struct_matcher.identify_uniqstr import (
|
|
20
|
+
UniqueStructIdentifier,
|
|
20
21
|
identify_unique_structure,
|
|
21
22
|
)
|
|
22
23
|
from rsspolymlp.common.composition import compute_composition
|
|
@@ -37,6 +38,7 @@ class RSSResultSummarizer:
|
|
|
37
38
|
element_order: list = None,
|
|
38
39
|
num_process: int = -1,
|
|
39
40
|
backend: str = "loky",
|
|
41
|
+
assign_method: Literal["redrep", "greedy", "HK", "pymatgen"] = "redrep",
|
|
40
42
|
primitive_symprecs: list[float] = [1e-5, 1e-4, 1e-3, 1e-2],
|
|
41
43
|
output_poscar: bool = False,
|
|
42
44
|
thresholds: list[float] = None,
|
|
@@ -50,6 +52,7 @@ class RSSResultSummarizer:
|
|
|
50
52
|
self.element_order = element_order
|
|
51
53
|
self.num_process = num_process
|
|
52
54
|
self.backend = backend
|
|
55
|
+
self.assign_method = assign_method
|
|
53
56
|
self.primitive_symprecs = primitive_symprecs
|
|
54
57
|
self.output_poscar = output_poscar
|
|
55
58
|
self.thresholds = thresholds
|
|
@@ -89,6 +92,11 @@ class RSSResultSummarizer:
|
|
|
89
92
|
axis_tol = 0.1
|
|
90
93
|
pos_tol = 0.1
|
|
91
94
|
|
|
95
|
+
self.analyzer = UniqueStructIdentifier(
|
|
96
|
+
axis_tol=axis_tol,
|
|
97
|
+
pos_tol=pos_tol,
|
|
98
|
+
assign_method=self.assign_method,
|
|
99
|
+
)
|
|
92
100
|
for comp_tag, res_paths in json_paths_c.items():
|
|
93
101
|
print(f"Composition {comp_tag}: summarizing...")
|
|
94
102
|
time_start = time()
|
|
@@ -116,6 +124,7 @@ class RSSResultSummarizer:
|
|
|
116
124
|
rss_results_c[comp_tag][res_path],
|
|
117
125
|
axis_tol=axis_tol,
|
|
118
126
|
pos_tol=pos_tol,
|
|
127
|
+
assign_method=self.assign_method,
|
|
119
128
|
pre_analyzer=self.analyzer,
|
|
120
129
|
)
|
|
121
130
|
|
|
@@ -124,11 +133,11 @@ class RSSResultSummarizer:
|
|
|
124
133
|
unique_structs = self.analyzer.unique_str
|
|
125
134
|
unique_str_prop = self.analyzer.unique_str_prop
|
|
126
135
|
enthalpies = np.array([s["energy"] for s in unique_str_prop])
|
|
127
|
-
distances = np.array([s["least_distance"] for s in unique_str_prop])
|
|
128
136
|
sort_idx = np.argsort(enthalpies)
|
|
129
137
|
|
|
130
138
|
if not self.parse_vasp:
|
|
131
139
|
os.makedirs("ghost_minima", exist_ok=True)
|
|
140
|
+
distances = np.array([s["least_distance"] for s in unique_str_prop])
|
|
132
141
|
is_ghost_minima, ghost_minima_info = detect_ghost_minima(
|
|
133
142
|
enthalpies[sort_idx], distances[sort_idx]
|
|
134
143
|
)
|
|
@@ -209,6 +218,7 @@ class RSSResultSummarizer:
|
|
|
209
218
|
keep_unique=True,
|
|
210
219
|
axis_tol=axis_tol,
|
|
211
220
|
pos_tol=pos_tol,
|
|
221
|
+
assign_method=self.assign_method,
|
|
212
222
|
pre_analyzer=self.analyzer,
|
|
213
223
|
)
|
|
214
224
|
time_finish = time() - time_start
|
|
@@ -220,7 +230,7 @@ class RSSResultSummarizer:
|
|
|
220
230
|
sort_idx = np.argsort(enthalpies)
|
|
221
231
|
sort_idx = sorted(
|
|
222
232
|
sort_idx,
|
|
223
|
-
key=lambda i: len(
|
|
233
|
+
key=lambda i: len(unique_structs[i]),
|
|
224
234
|
reverse=True,
|
|
225
235
|
)
|
|
226
236
|
unique_str_sorted = [unique_structs[i] for i in sort_idx]
|
|
@@ -260,12 +270,12 @@ class RSSResultSummarizer:
|
|
|
260
270
|
|
|
261
271
|
print(" - Converting reduced crystal structure representation...")
|
|
262
272
|
generator = StructRepGenerator(
|
|
263
|
-
num_process=self.num_process,
|
|
264
|
-
backend=self.backend,
|
|
265
273
|
primitive_symprecs=self.primitive_symprecs,
|
|
266
274
|
)
|
|
267
275
|
struct_reps_list = generator.generate_struct_reps_parallel(
|
|
268
276
|
rss_results,
|
|
277
|
+
num_process=self.num_process,
|
|
278
|
+
backend=self.backend,
|
|
269
279
|
)
|
|
270
280
|
if self.update_parent:
|
|
271
281
|
print(" - Eliminating duplicate structures...")
|
|
@@ -586,6 +596,14 @@ def log_all_unique_structures(
|
|
|
586
596
|
with open(file_name, "a") as f:
|
|
587
597
|
print("unique_structures:", file=f)
|
|
588
598
|
for idx1, _str in enumerate(unique_structs):
|
|
599
|
+
if unique_str_prop is not None:
|
|
600
|
+
sorted_data = sorted(
|
|
601
|
+
zip(unique_structs[idx1], unique_str_prop[idx1]),
|
|
602
|
+
key=lambda x: x[1]["energy"],
|
|
603
|
+
)
|
|
604
|
+
unique_structs[idx1], unique_str_prop[idx1] = map(
|
|
605
|
+
list, zip(*sorted_data)
|
|
606
|
+
)
|
|
589
607
|
print(f" - struct_No: {idx1 + 1}", file=f)
|
|
590
608
|
print(" structures:", file=f)
|
|
591
609
|
for idx2, _str in enumerate(unique_structs[idx1]):
|
|
@@ -597,7 +615,9 @@ def log_all_unique_structures(
|
|
|
597
615
|
objprop = PropUtil(polymlp_st.axis.T, polymlp_st.positions.T)
|
|
598
616
|
print(f" - sub_struct_No: '{idx1 + 1}_{idx2 + 1}'", file=f)
|
|
599
617
|
print(f" struct_path: {_str.struct_path}", file=f)
|
|
600
|
-
print(
|
|
618
|
+
print(
|
|
619
|
+
f" pressure: {unique_str_prop[idx1][idx2]['pressure']}", file=f
|
|
620
|
+
)
|
|
601
621
|
print(f" enthalpy: {e}", file=f)
|
|
602
622
|
print(f" axis: {objprop.abc}", file=f)
|
|
603
623
|
print(
|
|
@@ -627,7 +647,7 @@ def log_all_unique_structures(
|
|
|
627
647
|
if unique_other_prop is not None:
|
|
628
648
|
print(" properties:", unique_other_prop[idx1], file=f)
|
|
629
649
|
|
|
630
|
-
comp_res = compute_composition(unique_structs[0][0].
|
|
650
|
+
comp_res = compute_composition(unique_structs[0][0].original_polymlp_st.elements)
|
|
631
651
|
|
|
632
652
|
rss_result_all = {
|
|
633
653
|
"elements": comp_res.unique_elements.tolist(),
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/identify_uniqstr.py
RENAMED
|
@@ -18,7 +18,7 @@ class UniqueStructIdentifier:
|
|
|
18
18
|
self,
|
|
19
19
|
axis_tol: float = 0.01,
|
|
20
20
|
pos_tol: float = 0.01,
|
|
21
|
-
assign_method: Literal["redrep", "greedy", "HK"] = "redrep",
|
|
21
|
+
assign_method: Literal["redrep", "greedy", "HK", "pymatgen"] = "redrep",
|
|
22
22
|
keep_unique: bool = False,
|
|
23
23
|
verbose: bool = False,
|
|
24
24
|
):
|
|
@@ -43,6 +43,10 @@ class UniqueStructIdentifier:
|
|
|
43
43
|
self.assign_method = assign_method
|
|
44
44
|
self.keep_unique = keep_unique
|
|
45
45
|
self.verbose = verbose
|
|
46
|
+
if self.assign_method == "pymatgen":
|
|
47
|
+
from rsspolymlp.utils.pymatgen_utils import PymatUtil
|
|
48
|
+
|
|
49
|
+
self.pymat = PymatUtil()
|
|
46
50
|
|
|
47
51
|
self.unique_str: list[StructReps] = [] # Store unique structures
|
|
48
52
|
self.unique_str_prop: list[dict] = [] # Store unique structure properties
|
|
@@ -94,6 +98,12 @@ class UniqueStructIdentifier:
|
|
|
94
98
|
axis_tol=self.axis_tol,
|
|
95
99
|
pos_tol=self.pos_tol,
|
|
96
100
|
)
|
|
101
|
+
elif self.assign_method == "pymatgen":
|
|
102
|
+
st1 = self.pymat.polymlp_to_pymat_st(uniq_str.original_polymlp_st)
|
|
103
|
+
st2 = self.pymat.polymlp_to_pymat_st(
|
|
104
|
+
struct_reps.original_polymlp_st
|
|
105
|
+
)
|
|
106
|
+
judge_duplicate = self.pymat.match_str(st1, st2)
|
|
97
107
|
else:
|
|
98
108
|
judge_duplicate = struct_match_allrep(
|
|
99
109
|
uniq_str,
|
|
@@ -171,7 +181,7 @@ def identify_unique_structure(
|
|
|
171
181
|
struct_list: list[dict],
|
|
172
182
|
axis_tol: float = 0.01,
|
|
173
183
|
pos_tol: float = 0.01,
|
|
174
|
-
assign_method: Literal["redrep", "greedy", "HK"] = "redrep",
|
|
184
|
+
assign_method: Literal["redrep", "greedy", "HK", "pymatgen"] = "redrep",
|
|
175
185
|
keep_unique: bool = False,
|
|
176
186
|
num_process: int = -1,
|
|
177
187
|
backend: str = "loky",
|
|
@@ -211,6 +211,13 @@ def run():
|
|
|
211
211
|
default=None,
|
|
212
212
|
help="List of element symbols",
|
|
213
213
|
)
|
|
214
|
+
parser.add_argument(
|
|
215
|
+
"--assign_method",
|
|
216
|
+
choices=["redrep", "greedy", "HK", "pymatgen"],
|
|
217
|
+
default="redrep",
|
|
218
|
+
help="Method for matching atomic positions: "
|
|
219
|
+
"reduced representation, greedy, or Hopcroft-Karp",
|
|
220
|
+
)
|
|
214
221
|
parser.add_argument(
|
|
215
222
|
"--primitive_symprecs",
|
|
216
223
|
nargs="*",
|
|
@@ -314,6 +321,7 @@ def run():
|
|
|
314
321
|
element_order=args.element_order,
|
|
315
322
|
num_process=args.num_process,
|
|
316
323
|
backend=args.backend,
|
|
324
|
+
assign_method=args.assign_method,
|
|
317
325
|
primitive_symprecs=args.primitive_symprecs,
|
|
318
326
|
output_poscar=args.output_poscar,
|
|
319
327
|
thresholds=args.thresholds,
|
|
@@ -43,7 +43,7 @@ def run():
|
|
|
43
43
|
)
|
|
44
44
|
parser.add_argument(
|
|
45
45
|
"--assign_method",
|
|
46
|
-
choices=["redrep", "greedy", "HK"],
|
|
46
|
+
choices=["redrep", "greedy", "HK", "pymatgen"],
|
|
47
47
|
default="redrep",
|
|
48
48
|
help="Method for matching atomic positions: "
|
|
49
49
|
"reduced representation, greedy, or Hopcroft-Karp",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import glob
|
|
2
2
|
import os
|
|
3
3
|
import time
|
|
4
|
+
from typing import Literal
|
|
4
5
|
|
|
5
6
|
from rsspolymlp.analysis.ghost_minima import (
|
|
6
7
|
detect_actual_ghost_minima,
|
|
@@ -182,6 +183,7 @@ def rss_summarize(
|
|
|
182
183
|
element_order: list = None,
|
|
183
184
|
num_process=-1,
|
|
184
185
|
backend="loky",
|
|
186
|
+
assign_method: Literal["redrep", "greedy", "HK", "pymatgen"] = "redrep",
|
|
185
187
|
primitive_symprecs: list[float] = [1e-5, 1e-4, 1e-3, 1e-2],
|
|
186
188
|
output_poscar: bool = False,
|
|
187
189
|
thresholds: list[float] = None,
|
|
@@ -195,6 +197,7 @@ def rss_summarize(
|
|
|
195
197
|
element_order=element_order,
|
|
196
198
|
num_process=num_process,
|
|
197
199
|
backend=backend,
|
|
200
|
+
assign_method=assign_method,
|
|
198
201
|
primitive_symprecs=primitive_symprecs,
|
|
199
202
|
output_poscar=output_poscar,
|
|
200
203
|
thresholds=thresholds,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Literal, Optional
|
|
2
2
|
|
|
3
3
|
from pypolymlp.utils.spglib_utils import SymCell
|
|
4
|
-
|
|
5
4
|
from rsspolymlp.analysis.rss_summarize import (
|
|
6
5
|
log_all_unique_structures,
|
|
7
6
|
log_unique_structures,
|
|
@@ -23,7 +22,7 @@ def struct_matcher(
|
|
|
23
22
|
struct_reps_list: Optional[list[dict]] = None,
|
|
24
23
|
axis_tol: float = 0.05,
|
|
25
24
|
pos_tol: float = 0.03,
|
|
26
|
-
assign_method: Literal["redrep", "greedy", "HK"] = "redrep",
|
|
25
|
+
assign_method: Literal["redrep", "greedy", "HK", "pymatgen"] = "redrep",
|
|
27
26
|
num_process: int = -1,
|
|
28
27
|
backend: str = "loky",
|
|
29
28
|
primitive_symprecs: list[float] = [1e-5, 1e-4, 1e-3, 1e-2],
|
|
@@ -148,7 +147,7 @@ def struct_compare(
|
|
|
148
147
|
poscar_paths,
|
|
149
148
|
axis_tol: float = 0.01,
|
|
150
149
|
pos_tol: float = 0.01,
|
|
151
|
-
assign_method: Literal["redrep", "greedy", "HK"] = "redrep",
|
|
150
|
+
assign_method: Literal["redrep", "greedy", "HK", "pymatgen"] = "redrep",
|
|
152
151
|
refine_symprec: float = 1e-3,
|
|
153
152
|
reduced_symprecs: list[float] = None,
|
|
154
153
|
normalize_axis: bool = False,
|
|
@@ -26,8 +26,10 @@ def atomic_energy(element):
|
|
|
26
26
|
"P": -1.88664411,
|
|
27
27
|
"Pb": -0.58498619,
|
|
28
28
|
"Rb": -0.14189970,
|
|
29
|
+
"S": -0.94100986,
|
|
29
30
|
"Sb": -1.43005001,
|
|
30
31
|
"Sc": -1.98188993,
|
|
32
|
+
"Se": -0.76510990,
|
|
31
33
|
"Si": -0.87162900,
|
|
32
34
|
"Sn": -0.48437348, # dftu s-orbital 1.0 eV, dft: -0.64316709
|
|
33
35
|
"Sr": -0.02805273,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import numpy as np
|
|
2
2
|
|
|
3
3
|
from pypolymlp.core.data_format import PolymlpStructure
|
|
4
|
-
from pypolymlp.utils.spglib_utils import SymCell
|
|
5
4
|
from rsspolymlp.common.composition import compute_composition
|
|
5
|
+
from rsspolymlp.utils.spglib_utils import SymCell
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class PropUtil:
|
|
@@ -32,7 +32,8 @@ def parse_vasp_results(elements, vasprun_paths):
|
|
|
32
32
|
for vasprun_path in vasprun_paths:
|
|
33
33
|
try:
|
|
34
34
|
structure, (energy, force, stress) = parse_properties_from_vasprun(
|
|
35
|
-
vasprun_path,
|
|
35
|
+
vasprun_path,
|
|
36
|
+
units="GPa",
|
|
36
37
|
)
|
|
37
38
|
except Exception:
|
|
38
39
|
print(vasprun_path, "failed")
|
|
@@ -119,8 +120,8 @@ def split_dataset(
|
|
|
119
120
|
e_tag = ""
|
|
120
121
|
|
|
121
122
|
# Filter by stress tensor components
|
|
122
|
-
if max_stress > threshold_s_large
|
|
123
|
-
threshold_s_small is not None and min_stress < threshold_s_small
|
|
123
|
+
if max_stress > threshold_s_large or (
|
|
124
|
+
threshold_s_small is not None and min_stress < threshold_s_small
|
|
124
125
|
):
|
|
125
126
|
vasprun_dict[f"s_large{e_tag}"].append(vasprun_path)
|
|
126
127
|
return
|
|
@@ -230,14 +230,17 @@ class MakePlot:
|
|
|
230
230
|
rasterized=rasterized,
|
|
231
231
|
)
|
|
232
232
|
|
|
233
|
-
def ax_hist(self, dist, bins=50, range=None):
|
|
233
|
+
def ax_hist(self, dist, bins=50, range=None, density=False, fraction=False):
|
|
234
234
|
if range is None:
|
|
235
235
|
range = [min(dist), max(dist)]
|
|
236
|
+
weights = np.ones(len(dist)) / len(dist) if fraction else None
|
|
236
237
|
self.ax.hist(
|
|
237
238
|
dist,
|
|
238
239
|
bins=bins,
|
|
239
240
|
range=range,
|
|
240
241
|
color=self.color,
|
|
242
|
+
density=density,
|
|
243
|
+
weights=weights,
|
|
241
244
|
)
|
|
242
245
|
|
|
243
246
|
def finalize_ax(
|
|
@@ -288,7 +291,9 @@ class MakePlot:
|
|
|
288
291
|
"""
|
|
289
292
|
self._set_axis_scale(xlog, ylog, xlog_grid, ylog_grid)
|
|
290
293
|
self._set_axis_limits(x_limits, x_limits_hide, y_limits, y_limits_hide)
|
|
291
|
-
self._set_axis_grid(
|
|
294
|
+
self._set_axis_grid(
|
|
295
|
+
x_limits, y_limits, x_grid, y_grid, x_limits_hide, y_limits_hide
|
|
296
|
+
)
|
|
292
297
|
self._set_axis_labels(xlabel, ylabel, title)
|
|
293
298
|
self._set_twiny(twiny, x_limits, x_grid)
|
|
294
299
|
if legend_ncol:
|
|
@@ -323,7 +328,9 @@ class MakePlot:
|
|
|
323
328
|
if y_limits_hide:
|
|
324
329
|
self.ax.tick_params(labelleft=False)
|
|
325
330
|
|
|
326
|
-
def _set_axis_grid(
|
|
331
|
+
def _set_axis_grid(
|
|
332
|
+
self, x_limits, y_limits, x_grid, y_grid, x_limits_hide, y_limits_hide
|
|
333
|
+
):
|
|
327
334
|
"""Set grid spacing for axes."""
|
|
328
335
|
if x_grid:
|
|
329
336
|
if x_grid[1]:
|
|
@@ -341,6 +348,10 @@ class MakePlot:
|
|
|
341
348
|
np.append(np.arange(*y_limits, y_grid[0]), y_limits[1]), 6
|
|
342
349
|
)
|
|
343
350
|
self.ax.set_yticks(y_values)
|
|
351
|
+
if x_limits_hide:
|
|
352
|
+
self.ax.set_xticks([])
|
|
353
|
+
if y_limits_hide:
|
|
354
|
+
self.ax.set_yticks([])
|
|
344
355
|
|
|
345
356
|
def _set_axis_labels(self, xlabel, ylabel, title):
|
|
346
357
|
"""Set labels and title for axes."""
|
|
@@ -117,7 +117,11 @@ class SymCell:
|
|
|
117
117
|
|
|
118
118
|
def get_spacegroup(self):
|
|
119
119
|
"""Return space group."""
|
|
120
|
-
|
|
120
|
+
try:
|
|
121
|
+
spg = spglib.get_spacegroup(self.cell, symprec=self.symprec)
|
|
122
|
+
except spglib._spglib.SpglibCppError:
|
|
123
|
+
spg = None
|
|
124
|
+
return spg
|
|
121
125
|
|
|
122
126
|
def get_spacegroup_multiple_prec(self, symprecs=[1e-2, 1e-3, 1e-4, 1e-5]):
|
|
123
127
|
"""Return list of space groups using multiple precisions."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rsspolymlp
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: A framework for random structure search using polynomial MLPs
|
|
5
5
|
Author-email: Hayato Wakai <wakai@cms.mtl.kyoto-u.ac.jp>
|
|
6
6
|
Maintainer-email: Hayato Wakai <wakai@cms.mtl.kyoto-u.ac.jp>
|
|
@@ -79,11 +79,6 @@ pip install rsspolymlp
|
|
|
79
79
|
- Global RSS with polynomial MLPs
|
|
80
80
|
- Unique structure identification and RSS result summarization
|
|
81
81
|
- Phase stability analysis
|
|
82
|
-
- [Development kit for polynomial MLPs](docs/rsspolymlp_dev.md)
|
|
83
|
-
- MLP dataset generation
|
|
84
|
-
- DFT dataset division
|
|
85
|
-
- Polynomial MLP development
|
|
86
|
-
- Pareto-optimal MLP selection
|
|
87
82
|
- Python API
|
|
88
83
|
- [RSS workflow](docs/api_rsspolymlp.md)
|
|
89
84
|
- [VASP calculation utilities](src/rsspolymlp/utils/vasp_util/readme.md)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/assignment_algo.py
RENAMED
|
File without changes
|
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/gen_struct_rep.py
RENAMED
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/redrep_lattice.py
RENAMED
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/redrep_position.py
RENAMED
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/struct_match.py
RENAMED
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/test/gen_lattice.py
RENAMED
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/analysis/struct_matcher/test/time_measure.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/mlp_dev/model_selection/pypolymlp_gridsearch.py
RENAMED
|
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
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/examples/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{rsspolymlp-0.4.3 → rsspolymlp-0.4.4}/src/rsspolymlp/utils/matplot_util/examples/template.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|