kim-tools 0.2.1__tar.gz → 0.2.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.
- {kim_tools-0.2.1/kim_tools.egg-info → kim_tools-0.2.3}/PKG-INFO +1 -1
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/__init__.py +1 -1
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/aflow_util/core.py +89 -23
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/core.py +17 -3
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/test_driver/core.py +93 -9
- {kim_tools-0.2.1 → kim_tools-0.2.3/kim_tools.egg-info}/PKG-INFO +1 -1
- {kim_tools-0.2.1 → kim_tools-0.2.3}/tests/test_symmetry_util.py +3 -1
- {kim_tools-0.2.1 → kim_tools-0.2.3}/LICENSE.CDDL +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/MANIFEST.in +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/README.md +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/aflow_util/__init__.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/aflow_util/data/README_PROTO.TXT +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/ase/__init__.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/ase/core.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/kimunits.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/__init__.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/possible_primitive_shifts.json +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/primitive_GENPOS_ops.json +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/space_groups_for_each_bravais_lattice.json +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/wyck_pos_xform_under_normalizer.json +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/wyckoff_multiplicities.json +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/wyckoff_sets.json +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/test_driver/__init__.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/vc/__init__.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/vc/core.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools.egg-info/SOURCES.txt +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools.egg-info/dependency_links.txt +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools.egg-info/requires.txt +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools.egg-info/top_level.txt +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/pyproject.toml +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/setup.cfg +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/setup.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/tests/test_aflow_util.py +0 -0
- {kim_tools-0.2.1 → kim_tools-0.2.3}/tests/test_test_driver.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: kim-tools
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.3
|
4
4
|
Summary: Base classes and helper routines for writing KIM Tests
|
5
5
|
Author-email: ilia Nikiforov <nikif002@umn.edu>, Ellad Tadmor <tadmor@umn.edu>, Claire Waters <bwaters@umn.edu>, "Daniel S. Karls" <karl0100umn@gmail.com>, Matt Bierbaum <matt.bierbaum@gmail.com>, Eric Fuemmeler <efuemmel@umn.edu>
|
6
6
|
Maintainer-email: ilia Nikiforov <nikif002@umn.edu>
|
@@ -18,6 +18,7 @@ import ase
|
|
18
18
|
import numpy as np
|
19
19
|
from ase import Atoms
|
20
20
|
from ase.cell import Cell
|
21
|
+
from ase.neighborlist import natural_cutoffs, neighbor_list
|
21
22
|
from numpy.typing import ArrayLike
|
22
23
|
from sympy import Symbol, linear_eq_to_matrix, matrix2numpy, parse_expr
|
23
24
|
|
@@ -1116,9 +1117,7 @@ class AFLOW:
|
|
1116
1117
|
misfit_min_overall = struct["misfit"]
|
1117
1118
|
library_proto_overall = struct["name"]
|
1118
1119
|
found_overall = True
|
1119
|
-
if struct["misfit"] < misfit_min_inlist and
|
1120
|
-
proto in struct["name"] for proto in shortnames
|
1121
|
-
):
|
1120
|
+
if struct["misfit"] < misfit_min_inlist and struct["name"] in shortnames:
|
1122
1121
|
misfit_min_inlist = struct["misfit"]
|
1123
1122
|
library_proto_inlist = struct["name"]
|
1124
1123
|
found_inlist = True
|
@@ -1426,7 +1425,13 @@ class AFLOW:
|
|
1426
1425
|
return equation_sets
|
1427
1426
|
|
1428
1427
|
def solve_for_params_of_known_prototype(
|
1429
|
-
self,
|
1428
|
+
self,
|
1429
|
+
atoms: Atoms,
|
1430
|
+
prototype_label: str,
|
1431
|
+
max_resid: Optional[float] = None,
|
1432
|
+
cell_rtol: float = 0.01,
|
1433
|
+
rot_rtol: float = 0.01,
|
1434
|
+
rot_atol: float = 0.01,
|
1430
1435
|
) -> List[float]:
|
1431
1436
|
"""
|
1432
1437
|
Given an Atoms object that is a primitive cell of its Bravais lattice as
|
@@ -1451,6 +1456,19 @@ class AFLOW:
|
|
1451
1456
|
max_resid:
|
1452
1457
|
Maximum residual allowed when attempting to match the fractional
|
1453
1458
|
positions of the atoms to the crystallographic equations
|
1459
|
+
If not provided, this is automatically set to 0.01*(minimum NN distance)
|
1460
|
+
cell_rtol:
|
1461
|
+
Relative tolerance on cell lengths and angles
|
1462
|
+
Justification for default value: AFLOW uses 0.01*(minimum NN distance)
|
1463
|
+
as default tolerance.
|
1464
|
+
rot_rtol:
|
1465
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1466
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1467
|
+
default distance tolerance of 0.01*(NN distance)
|
1468
|
+
rot_atol:
|
1469
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1470
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1471
|
+
default distance tolerance of 0.01*(NN distance)
|
1454
1472
|
|
1455
1473
|
Returns:
|
1456
1474
|
List of free parameters that will regenerate `atoms` (up to permutations,
|
@@ -1463,6 +1481,25 @@ class AFLOW:
|
|
1463
1481
|
if AFLOW fails to match the re-generated crystal to the input crystal
|
1464
1482
|
|
1465
1483
|
"""
|
1484
|
+
# If max_resid not provided, determine it from neighborlist
|
1485
|
+
if max_resid is None:
|
1486
|
+
nl_len = 0
|
1487
|
+
cov_mult = 1
|
1488
|
+
while nl_len == 0:
|
1489
|
+
logger.info(
|
1490
|
+
"Attempting to find NN distance by searching "
|
1491
|
+
f"within covalent radii times {cov_mult}"
|
1492
|
+
)
|
1493
|
+
nl = neighbor_list("d", atoms, natural_cutoffs(atoms, mult=cov_mult))
|
1494
|
+
nl_len = nl.size
|
1495
|
+
cov_mult += 1
|
1496
|
+
# set the maximum error to 1% of NN distance to follow AFLOW convention
|
1497
|
+
max_resid = nl.min() * 0.01
|
1498
|
+
logger.info(
|
1499
|
+
"Automatically set max residual for solving position "
|
1500
|
+
f"equations to {max_resid}"
|
1501
|
+
)
|
1502
|
+
|
1466
1503
|
# solve for cell parameters
|
1467
1504
|
cell_params = solve_for_aflow_cell_params_from_primitive_ase_cell_params(
|
1468
1505
|
atoms.cell.cellpar(), prototype_label
|
@@ -1649,7 +1686,13 @@ class AFLOW:
|
|
1649
1686
|
# The internal shift may have taken us to an internal parameter
|
1650
1687
|
# solution that represents a rotation, so we need to check
|
1651
1688
|
if self.confirm_unrotated_prototype_designation(
|
1652
|
-
atoms,
|
1689
|
+
reference_atoms=atoms,
|
1690
|
+
species=species,
|
1691
|
+
prototype_label=prototype_label,
|
1692
|
+
parameter_values=candidate_prototype_param_values,
|
1693
|
+
cell_rtol=cell_rtol,
|
1694
|
+
rot_rtol=rot_rtol,
|
1695
|
+
rot_atol=rot_atol,
|
1653
1696
|
):
|
1654
1697
|
logger.info(
|
1655
1698
|
f"Found set of parameters for prototype {prototype_label} "
|
@@ -1679,8 +1722,9 @@ class AFLOW:
|
|
1679
1722
|
test_atoms: Atoms,
|
1680
1723
|
ref_atoms: Atoms,
|
1681
1724
|
sgnum: Union[int, str],
|
1682
|
-
|
1683
|
-
|
1725
|
+
cell_rtol: float = 0.01,
|
1726
|
+
rot_rtol: float = 0.01,
|
1727
|
+
rot_atol: float = 0.01,
|
1684
1728
|
) -> bool:
|
1685
1729
|
"""
|
1686
1730
|
Check whether `test_atoms` and `reference_atoms` are unrotated as follows:
|
@@ -1702,13 +1746,21 @@ class AFLOW:
|
|
1702
1746
|
Primitive cell of a crystal
|
1703
1747
|
sgnum:
|
1704
1748
|
Space group number
|
1705
|
-
|
1706
|
-
Parameter to pass to :func:`numpy.allclose` for comparing cell params
|
1707
|
-
|
1708
|
-
|
1749
|
+
cell_rtol:
|
1750
|
+
Parameter to pass to :func:`numpy.allclose` for comparing cell params.
|
1751
|
+
Justification for default value: AFLOW uses 0.01*(minimum NN distance)
|
1752
|
+
as default tolerance.
|
1753
|
+
rot_rtol:
|
1754
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1755
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1756
|
+
default distance tolerance of 0.01*(NN distance)
|
1757
|
+
rot_atol:
|
1758
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1759
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1760
|
+
default distance tolerance of 0.01*(NN distance)
|
1709
1761
|
"""
|
1710
1762
|
if not np.allclose(
|
1711
|
-
ref_atoms.cell.cellpar(), test_atoms.cell.cellpar(),
|
1763
|
+
ref_atoms.cell.cellpar(), test_atoms.cell.cellpar(), rtol=cell_rtol
|
1712
1764
|
):
|
1713
1765
|
logger.info(
|
1714
1766
|
"Cell lengths and angles do not match.\n"
|
@@ -1741,7 +1793,11 @@ class AFLOW:
|
|
1741
1793
|
return False
|
1742
1794
|
|
1743
1795
|
return cartesian_rotation_is_in_point_group(
|
1744
|
-
cart_rot,
|
1796
|
+
cart_rot=cart_rot,
|
1797
|
+
sgnum=sgnum,
|
1798
|
+
cell=test_atoms_copy.cell,
|
1799
|
+
rtol=rot_rtol,
|
1800
|
+
atol=rot_atol,
|
1745
1801
|
)
|
1746
1802
|
|
1747
1803
|
def confirm_unrotated_prototype_designation(
|
@@ -1750,8 +1806,9 @@ class AFLOW:
|
|
1750
1806
|
species: List[str],
|
1751
1807
|
prototype_label: str,
|
1752
1808
|
parameter_values: List[float],
|
1753
|
-
|
1754
|
-
|
1809
|
+
cell_rtol: float = 0.01,
|
1810
|
+
rot_rtol: float = 0.01,
|
1811
|
+
rot_atol: float = 0.01,
|
1755
1812
|
) -> bool:
|
1756
1813
|
"""
|
1757
1814
|
Check whether the provided prototype designation recreates ``reference_atoms``
|
@@ -1773,10 +1830,18 @@ class AFLOW:
|
|
1773
1830
|
without specified atomic species
|
1774
1831
|
parameter_values:
|
1775
1832
|
The free parameters of the AFLOW prototype designation
|
1776
|
-
|
1777
|
-
Parameter to pass to :func:`numpy.allclose` for comparing cell params
|
1778
|
-
atol:
|
1833
|
+
cell_rtol:
|
1779
1834
|
Parameter to pass to :func:`numpy.allclose` for comparing cell params
|
1835
|
+
Justification for default value: AFLOW uses 0.01*(minimum NN distance)
|
1836
|
+
as default tolerance.
|
1837
|
+
rot_rtol:
|
1838
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1839
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1840
|
+
default distance tolerance of 0.01*(NN distance)
|
1841
|
+
rot_atol:
|
1842
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1843
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1844
|
+
default distance tolerance of 0.01*(NN distance)
|
1780
1845
|
|
1781
1846
|
Returns:
|
1782
1847
|
Whether or not the crystals match
|
@@ -1788,9 +1853,10 @@ class AFLOW:
|
|
1788
1853
|
)
|
1789
1854
|
|
1790
1855
|
return self.confirm_atoms_unrotated_when_cells_aligned(
|
1791
|
-
test_atoms,
|
1792
|
-
reference_atoms,
|
1793
|
-
get_space_group_number_from_prototype(prototype_label),
|
1794
|
-
|
1795
|
-
|
1856
|
+
test_atoms=test_atoms,
|
1857
|
+
ref_atoms=reference_atoms,
|
1858
|
+
sgnum=get_space_group_number_from_prototype(prototype_label),
|
1859
|
+
cell_rtol=cell_rtol,
|
1860
|
+
rot_rtol=rot_rtol,
|
1861
|
+
rot_atol=rot_atol,
|
1796
1862
|
)
|
@@ -168,7 +168,11 @@ def fractional_to_cartesian_itc_rotation_from_ase_cell(
|
|
168
168
|
|
169
169
|
|
170
170
|
def cartesian_rotation_is_in_point_group(
|
171
|
-
cart_rot: ArrayLike,
|
171
|
+
cart_rot: ArrayLike,
|
172
|
+
sgnum: Union[int, str],
|
173
|
+
cell: ArrayLike,
|
174
|
+
rtol: float = 1e-2,
|
175
|
+
atol: float = 1e-2,
|
172
176
|
) -> bool:
|
173
177
|
"""
|
174
178
|
Check that a Cartesian rotation is in the point group of a crystal given by its
|
@@ -184,6 +188,14 @@ def cartesian_rotation_is_in_point_group(
|
|
184
188
|
http://doi.org/10.1016/j.commatsci.2017.01.017, with each row being a
|
185
189
|
cartesian vector representing a lattice vector. This is
|
186
190
|
consistent with most simulation packages, but transposed from the ITC
|
191
|
+
rtol:
|
192
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
193
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
194
|
+
default distance tolerance of 0.01*(NN distance)
|
195
|
+
atol:
|
196
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
197
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
198
|
+
default distance tolerance of 0.01*(NN distance)
|
187
199
|
"""
|
188
200
|
# we don't care about properly transposing (i.e. worrying whether it's operating on
|
189
201
|
# row or column vectors) the input cart_rot because that one is orthogonal, and
|
@@ -192,9 +204,11 @@ def cartesian_rotation_is_in_point_group(
|
|
192
204
|
|
193
205
|
space_group_ops = get_primitive_genpos_ops(sgnum)
|
194
206
|
|
207
|
+
logger.info(f"Attempting to match fractional rotation:\n{frac_rot}")
|
208
|
+
|
195
209
|
for op in space_group_ops:
|
196
|
-
if np.allclose(frac_rot, op["W"], atol=
|
197
|
-
logger.info("Found matching rotation")
|
210
|
+
if np.allclose(frac_rot, op["W"], rtol=rtol, atol=atol):
|
211
|
+
logger.info(f"Found matching rotation with point group op:\n{op['W']}")
|
198
212
|
return True
|
199
213
|
|
200
214
|
logger.info("No matching rotation found")
|
@@ -1219,7 +1219,12 @@ class SingleCrystalTestDriver(KIMTestDriver):
|
|
1219
1219
|
logger.info(msg)
|
1220
1220
|
|
1221
1221
|
def _update_nominal_parameter_values(
|
1222
|
-
self,
|
1222
|
+
self,
|
1223
|
+
atoms: Atoms,
|
1224
|
+
max_resid: Optional[float] = None,
|
1225
|
+
cell_rtol: float = 0.01,
|
1226
|
+
rot_rtol: float = 0.01,
|
1227
|
+
rot_atol: float = 0.01,
|
1223
1228
|
) -> None:
|
1224
1229
|
"""
|
1225
1230
|
Update the nominal parameter values of the nominal crystal structure from the
|
@@ -1250,7 +1255,20 @@ class SingleCrystalTestDriver(KIMTestDriver):
|
|
1250
1255
|
atoms: Structure to analyze to get the new parameter values
|
1251
1256
|
max_resid:
|
1252
1257
|
Maximum residual allowed when attempting to match the fractional
|
1253
|
-
positions of the atoms to the crystallographic equations
|
1258
|
+
positions of the atoms to the crystallographic equations.
|
1259
|
+
If not provided, this is automatically set to 0.01*(minimum NN distance)
|
1260
|
+
cell_rtol:
|
1261
|
+
Relative tolerance on cell lengths and angles.
|
1262
|
+
Justification for default value: AFLOW uses 0.01*(minimum NN distance)
|
1263
|
+
as default tolerance.
|
1264
|
+
rot_rtol:
|
1265
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1266
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1267
|
+
default distance tolerance of 0.01*(NN distance)
|
1268
|
+
rot_atol:
|
1269
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1270
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1271
|
+
default distance tolerance of 0.01*(NN distance)
|
1254
1272
|
|
1255
1273
|
Raises:
|
1256
1274
|
AFLOW.FailedToMatchException:
|
@@ -1269,6 +1287,9 @@ class SingleCrystalTestDriver(KIMTestDriver):
|
|
1269
1287
|
"source-value"
|
1270
1288
|
],
|
1271
1289
|
max_resid=max_resid,
|
1290
|
+
cell_rtol=cell_rtol,
|
1291
|
+
rot_rtol=rot_rtol,
|
1292
|
+
rot_atol=rot_atol,
|
1272
1293
|
)
|
1273
1294
|
except (AFLOW.FailedToMatchException, AFLOW.ChangedSymmetryException) as e:
|
1274
1295
|
raise type(e)(
|
@@ -1513,7 +1534,10 @@ class SingleCrystalTestDriver(KIMTestDriver):
|
|
1513
1534
|
def deduplicate_property_instances(
|
1514
1535
|
self,
|
1515
1536
|
properties_to_deduplicate: Optional[List[str]] = None,
|
1516
|
-
allow_rotation: bool =
|
1537
|
+
allow_rotation: bool = False,
|
1538
|
+
aflow_np: int = 4,
|
1539
|
+
rot_rtol: float = 0.01,
|
1540
|
+
rot_atol: float = 0.01,
|
1517
1541
|
) -> None:
|
1518
1542
|
"""
|
1519
1543
|
In the internally stored property instances,
|
@@ -1534,9 +1558,26 @@ class SingleCrystalTestDriver(KIMTestDriver):
|
|
1534
1558
|
allow_rotation:
|
1535
1559
|
Whether or not structures that are rotated by a rotation that is not in
|
1536
1560
|
the crystal's point group are considered identical
|
1561
|
+
aflow_np:
|
1562
|
+
Number of processors to use to run the AFLOW executable
|
1563
|
+
rot_rtol:
|
1564
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1565
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1566
|
+
default distance tolerance of 0.01*(NN distance). Used only if
|
1567
|
+
`allow_rotation` is False
|
1568
|
+
rot_atol:
|
1569
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1570
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1571
|
+
default distance tolerance of 0.01*(NN distance). Used only if
|
1572
|
+
`allow_rotation` is False
|
1537
1573
|
"""
|
1538
1574
|
deduplicated_property_instances = get_deduplicated_property_instances(
|
1539
|
-
self.property_instances,
|
1575
|
+
property_instances=self.property_instances,
|
1576
|
+
properties_to_deduplicate=properties_to_deduplicate,
|
1577
|
+
allow_rotation=allow_rotation,
|
1578
|
+
aflow_np=aflow_np,
|
1579
|
+
rot_rtol=rot_rtol,
|
1580
|
+
rot_atol=rot_atol,
|
1540
1581
|
)
|
1541
1582
|
logger.info(
|
1542
1583
|
f"Deduplicated {len(self.property_instances)} Property Instances "
|
@@ -1740,8 +1781,10 @@ def query_crystal_structures(
|
|
1740
1781
|
|
1741
1782
|
def detect_unique_crystal_structures(
|
1742
1783
|
crystal_structures: Union[List[Dict], Dict],
|
1743
|
-
allow_rotation: bool =
|
1784
|
+
allow_rotation: bool = False,
|
1744
1785
|
aflow_np: int = 4,
|
1786
|
+
rot_rtol: float = 0.01,
|
1787
|
+
rot_atol: float = 0.01,
|
1745
1788
|
) -> Dict:
|
1746
1789
|
"""
|
1747
1790
|
Detect which of the provided crystal structures is unique
|
@@ -1758,6 +1801,18 @@ def detect_unique_crystal_structures(
|
|
1758
1801
|
allow_rotation:
|
1759
1802
|
Whether or not structures that are rotated by a rotation that is not in the
|
1760
1803
|
crystal's point group are considered identical
|
1804
|
+
aflow_np:
|
1805
|
+
Number of processors to use to run the AFLOW executable
|
1806
|
+
rot_rtol:
|
1807
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1808
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1809
|
+
default distance tolerance of 0.01*(NN distance). Used only if
|
1810
|
+
`allow_rotation` is False
|
1811
|
+
rot_atol:
|
1812
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1813
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1814
|
+
default distance tolerance of 0.01*(NN distance). Used only if
|
1815
|
+
`allow_rotation` is False
|
1761
1816
|
Returns:
|
1762
1817
|
Dictionary with keys corresponding to indices of unique structures and values
|
1763
1818
|
being lists of indices of their duplicates
|
@@ -1810,7 +1865,13 @@ def detect_unique_crystal_structures(
|
|
1810
1865
|
"structures_duplicate"
|
1811
1866
|
]:
|
1812
1867
|
cart_rot = potential_rotated_duplicate["rotation"]
|
1813
|
-
if not cartesian_rotation_is_in_point_group(
|
1868
|
+
if not cartesian_rotation_is_in_point_group(
|
1869
|
+
cart_rot=cart_rot,
|
1870
|
+
sgnum=sgnum,
|
1871
|
+
cell=cell,
|
1872
|
+
rtol=rot_rtol,
|
1873
|
+
atol=rot_atol,
|
1874
|
+
):
|
1814
1875
|
i_rot_dup = int(
|
1815
1876
|
potential_rotated_duplicate["name"].split("/")[-1]
|
1816
1877
|
)
|
@@ -1822,7 +1883,11 @@ def detect_unique_crystal_structures(
|
|
1822
1883
|
|
1823
1884
|
unique_materials.update(
|
1824
1885
|
detect_unique_crystal_structures(
|
1825
|
-
rotated_structures,
|
1886
|
+
crystal_structures=rotated_structures,
|
1887
|
+
allow_rotation=False,
|
1888
|
+
aflow_np=aflow_np,
|
1889
|
+
rot_rtol=rot_rtol,
|
1890
|
+
rot_atol=rot_atol,
|
1826
1891
|
)
|
1827
1892
|
)
|
1828
1893
|
|
@@ -1832,7 +1897,10 @@ def detect_unique_crystal_structures(
|
|
1832
1897
|
def get_deduplicated_property_instances(
|
1833
1898
|
property_instances: List[Dict],
|
1834
1899
|
properties_to_deduplicate: Optional[List[str]] = None,
|
1835
|
-
allow_rotation: bool =
|
1900
|
+
allow_rotation: bool = False,
|
1901
|
+
aflow_np: int = 4,
|
1902
|
+
rot_rtol: float = 0.01,
|
1903
|
+
rot_atol: float = 0.01,
|
1836
1904
|
) -> List[Dict]:
|
1837
1905
|
"""
|
1838
1906
|
Given a list of dictionaries constituting KIM Property instances,
|
@@ -1855,6 +1923,18 @@ def get_deduplicated_property_instances(
|
|
1855
1923
|
allow_rotation:
|
1856
1924
|
Whether or not structures that are rotated by a rotation that is not in the
|
1857
1925
|
crystal's point group are considered identical
|
1926
|
+
aflow_np:
|
1927
|
+
Number of processors to use to run the AFLOW executable
|
1928
|
+
rot_rtol:
|
1929
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1930
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1931
|
+
default distance tolerance of 0.01*(NN distance). Used only if
|
1932
|
+
`allow_rotation` is False
|
1933
|
+
rot_atol:
|
1934
|
+
Parameter to pass to :func:`numpy.allclose` for compariong fractional
|
1935
|
+
rotations. Default value chosen to be commensurate with AFLOW
|
1936
|
+
default distance tolerance of 0.01*(NN distance). Used only if
|
1937
|
+
`allow_rotation` is False
|
1858
1938
|
|
1859
1939
|
Returns:
|
1860
1940
|
The deduplicated property instances
|
@@ -1884,7 +1964,11 @@ def get_deduplicated_property_instances(
|
|
1884
1964
|
|
1885
1965
|
# Get unique-duplicate dictionary
|
1886
1966
|
unique_crystal_structures = detect_unique_crystal_structures(
|
1887
|
-
property_instances_curr_name,
|
1967
|
+
crystal_structures=property_instances_curr_name,
|
1968
|
+
allow_rotation=allow_rotation,
|
1969
|
+
aflow_np=aflow_np,
|
1970
|
+
rot_rtol=rot_rtol,
|
1971
|
+
rot_atol=rot_atol,
|
1888
1972
|
)
|
1889
1973
|
|
1890
1974
|
# Put together the list of unique instances for the current
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: kim-tools
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.3
|
4
4
|
Summary: Base classes and helper routines for writing KIM Tests
|
5
5
|
Author-email: ilia Nikiforov <nikif002@umn.edu>, Ellad Tadmor <tadmor@umn.edu>, Claire Waters <bwaters@umn.edu>, "Daniel S. Karls" <karl0100umn@gmail.com>, Matt Bierbaum <matt.bierbaum@gmail.com>, Eric Fuemmeler <efuemmel@umn.edu>
|
6
6
|
Maintainer-email: ilia Nikiforov <nikif002@umn.edu>
|
@@ -19,7 +19,9 @@ def test_change_of_basis_atoms(
|
|
19
19
|
):
|
20
20
|
calc = KIM("LJ_ElliottAkerson_2015_Universal__MO_959249795837_003")
|
21
21
|
atoms_conventional.calc = calc
|
22
|
-
crystal_structure = get_crystal_structure_from_atoms(
|
22
|
+
crystal_structure = get_crystal_structure_from_atoms(
|
23
|
+
atoms_conventional, get_short_name=False
|
24
|
+
)
|
23
25
|
prototype_label = crystal_structure["prototype-label"]["source-value"]
|
24
26
|
sgnum = get_space_group_number_from_prototype(prototype_label)
|
25
27
|
formal_bravais_lattice = get_formal_bravais_lattice_from_space_group(sgnum)
|
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
|
{kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/possible_primitive_shifts.json
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{kim_tools-0.2.1 → kim_tools-0.2.3}/kim_tools/symmetry_util/data/wyckoff_multiplicities.json
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
|