libcasm-mapping 2.2.0__tar.gz → 2.3.0__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.
Files changed (134) hide show
  1. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/CHANGELOG.md +20 -2
  2. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/CMakeLists.txt +1 -1
  3. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/CMakeLists.txt.in +1 -1
  4. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/PKG-INFO +1 -1
  5. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/doc/doxygen_config +1 -1
  6. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/MappingSearch.hh +8 -7
  7. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/SearchData.hh +23 -2
  8. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/murty.hh +5 -0
  9. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/pyproject.toml +1 -1
  10. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/conf.py +2 -2
  11. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm/mapping/mapsearch/__init__.py +1 -0
  12. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm_mapping.egg-info/PKG-INFO +1 -1
  13. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/src/mapping_mapsearch.cpp +160 -31
  14. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/test_MappingSearch.py +135 -10
  15. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/setup.py +1 -1
  16. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/MappingSearch.cc +23 -4
  17. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/SearchData.cc +70 -7
  18. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/CMakeLists.txt +1 -1
  19. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/CMakeLists.txt.in +1 -1
  20. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/MappingSearch_test.cpp +4 -4
  21. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/version_test.cpp +2 -2
  22. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/LICENSE +0 -0
  23. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/MANIFEST.in +0 -0
  24. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/README.md +0 -0
  25. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/build_requirements.txt +0 -0
  26. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/cmake/CASMcode_mappingConfig.cmake.in +0 -0
  27. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/dev_requirements.txt +0 -0
  28. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/doc/customdoxygen.css +0 -0
  29. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/doc_requirements.txt +0 -0
  30. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/AtomMapping.hh +0 -0
  31. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/LatticeMapping.hh +0 -0
  32. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/StructureMapping.hh +0 -0
  33. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/atom_cost.hh +0 -0
  34. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/hungarian.hh +0 -0
  35. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/impl/LatticeMap.hh +0 -0
  36. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/impl/SimpleStrucMapCalculator.hh +0 -0
  37. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/impl/StrucMapCalculatorInterface.hh +0 -0
  38. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/impl/StrucMapping.hh +0 -0
  39. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/impl/io/json/StrucMapping_json_io.hh +0 -0
  40. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/io/json_io.hh +0 -0
  41. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/lattice_cost.hh +0 -0
  42. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/map_atoms.hh +0 -0
  43. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/map_lattices.hh +0 -0
  44. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/map_structures.hh +0 -0
  45. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/misc.hh +0 -0
  46. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/include/casm/mapping/version.hh +0 -0
  47. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/make_CMakeLists.py +0 -0
  48. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/pre-commit +0 -0
  49. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/.gitignore +0 -0
  50. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/apple-touch-icon.png +0 -0
  51. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/css/custom.css +0 -0
  52. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/favicon-16x16.png +0 -0
  53. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/favicon-32x32.png +0 -0
  54. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/logo.pdf +0 -0
  55. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/logo.svg +0 -0
  56. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/logo_dark.svg +0 -0
  57. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/logo_dark_outline.svg +0 -0
  58. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/logo_outline.svg +0 -0
  59. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/small_logo.pdf +0 -0
  60. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/small_logo.svg +0 -0
  61. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_static/small_logo_dark.svg +0 -0
  62. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_templates/base.rst +0 -0
  63. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_templates/custom-attr-template.rst +0 -0
  64. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_templates/custom-class-template.rst +0 -0
  65. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_templates/custom-function-template.rst +0 -0
  66. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/_templates/custom-module-template.rst +0 -0
  67. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/bibliography.rst +0 -0
  68. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/index.rst +0 -0
  69. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/installation.rst +0 -0
  70. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/reference/libcasm/index.rst +0 -0
  71. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/refs.bib +0 -0
  72. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/doc/usage.rst +0 -0
  73. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/examples/example_1.py +0 -0
  74. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/examples/example_2.py +0 -0
  75. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/examples/example_3.py +0 -0
  76. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/examples/example_4.py +0 -0
  77. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm/mapping/__init__.py +0 -0
  78. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm/mapping/info/__init__.py +0 -0
  79. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm/mapping/methods/__init__.py +0 -0
  80. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm/mapping/methods/_methods.py +0 -0
  81. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm_mapping.egg-info/SOURCES.txt +0 -0
  82. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm_mapping.egg-info/dependency_links.txt +0 -0
  83. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm_mapping.egg-info/requires.txt +0 -0
  84. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/libcasm_mapping.egg-info/top_level.txt +0 -0
  85. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/pyproject.toml +0 -0
  86. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/setup.py +0 -0
  87. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/src/mapping_info.cpp +0 -0
  88. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/src/mapping_methods.cpp +0 -0
  89. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/conftest.py +0 -0
  90. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/data/AB_test/POSCAR +0 -0
  91. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/data/AB_test/prim.json +0 -0
  92. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/data/AB_test/properties.calc.json +0 -0
  93. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/test_info_io.py +0 -0
  94. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/test_info_strain_cost.py +0 -0
  95. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/test_interpolate_lattices.py +0 -0
  96. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/test_interpolate_structures.py +0 -0
  97. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/test_map_lattices.py +0 -0
  98. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/python/tests/test_map_structures.py +0 -0
  99. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/setup.cfg +0 -0
  100. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/AtomMapping.cc +0 -0
  101. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/LatticeMapping.cc +0 -0
  102. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/StructureMapping.cc +0 -0
  103. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/atom_cost.cc +0 -0
  104. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/hungarian.cc +0 -0
  105. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/impl/LatticeMap.cc +0 -0
  106. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/impl/SimpleStrucMapCalculator.cc +0 -0
  107. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/impl/StrucMapping.cc +0 -0
  108. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/impl/io/json/StrucMapping_json_io.cc +0 -0
  109. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/io/json_io.cc +0 -0
  110. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/lattice_cost.cc +0 -0
  111. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/map_atoms.cc +0 -0
  112. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/map_lattices.cc +0 -0
  113. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/map_structures.cc +0 -0
  114. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/murty.cc +0 -0
  115. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/src/casm/mapping/version.cc +0 -0
  116. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/stylize.sh +0 -0
  117. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/test_requirements.txt +0 -0
  118. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/SearchTestData.hh +0 -0
  119. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/autotools.cc +0 -0
  120. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/autotools.hh +0 -0
  121. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/gtest_main_run_all.cpp +0 -0
  122. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/AtomMappingSearchData_test.cpp +0 -0
  123. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/LatticeMap_test.cpp +0 -0
  124. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/LatticeMappingSearchData_test.cpp +0 -0
  125. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/PrimSearchData_test.cpp +0 -0
  126. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/StrucMapper_test.cpp +0 -0
  127. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/StrucMapping_test.cpp +0 -0
  128. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/StructureSearchData_test.cpp +0 -0
  129. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/hungarian_test.cpp +0 -0
  130. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/make_trial_translations_test.cpp +0 -0
  131. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/mapping/murty_test.cpp +0 -0
  132. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/testdir.cc +0 -0
  133. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/testdir.hh +0 -0
  134. {libcasm_mapping-2.2.0 → libcasm_mapping-2.3.0}/tests/unit/teststructures.hh +0 -0
@@ -5,14 +5,32 @@ All notable changes to `libcasm-mapping` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [2.2.0] - 2025-08-14
8
+ ## [2.3.0] - 2025-08-07
9
+
10
+ ### Added
11
+
12
+ - Added `CASM::mapping::DispOnlyAtomToSiteCostFunction`, which has the same definition of `CASM::mapping::AtomToSiteCostFunction` previous to this release.
13
+ - Added `libcasm.mapping.mapsearch.make_atom_to_site_cost_future`. This method makes the cost infinity for displacements that are on the boundary of the Voronio cell. This addresses an issue where the choice of displacement vector for atoms on the parent superlattice voronoi cell boundary was ambiguous and in practice sensitive to small numerical differences, leading to inconsistent mapping results. With the change, atom mappings with displacements on the Voronoi cell boundary will not be selected, and larger supercells will be necessary to find atom mappings with those assignments.
14
+ - Added an `atom_to_site_cost_future_f` argument for the `MapSearch` and `AtomMappingSearchData` constructors to allow use of `make_atom_to_site_cost_future` instead of `make_atom_to_site_cost`.
15
+
16
+ ### Changed
17
+
18
+ - Changed `CASM::mapping::AtomToSiteCostFunction` to take the Lattice used to find displacements under periodic boundary conditions.
19
+
20
+ ### Deprecated
21
+
22
+ - The `make_atom_to_site_cost_future` and `make_atom_to_site_cost` methods are marked deprecated because `make_atom_to_site_cost_future` is planned to replace `make_atom_to_site_cost` in libcasm-mapping 3.0.0.
23
+ - The `atom_to_site_cost_f` and `atom_to_site_cost_future_f` arguments for the `MapSearch` and `AtomMappingSearchData` constructors are marked deprecated because `atom_to_site_cost_future_f` is planned to replace `atom_to_site_cost_f` in libcasm-mapping 3.0.0.
24
+
25
+
26
+ ## [2.2.0] - 2025-07-14
9
27
 
10
28
  ### Changed
11
29
 
12
30
  - Set pybind11~=3.0
13
31
 
14
32
 
15
- ## [2.1.0] - 2025-08-07
33
+ ## [2.1.0] - 2025-07-07
16
34
 
17
35
  ### Changed
18
36
 
@@ -1,7 +1,7 @@
1
1
  cmake_minimum_required(VERSION 3.20)
2
2
  set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
3
3
 
4
- project(CASMcode_mapping VERSION 2.2.0 LANGUAGES CXX)
4
+ project(CASMcode_mapping VERSION 2.3.0 LANGUAGES CXX)
5
5
 
6
6
  # set CMAKE_INSTALL_X variables
7
7
  include(GNUInstallDirs)
@@ -1,7 +1,7 @@
1
1
  cmake_minimum_required(VERSION 3.20)
2
2
  set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
3
3
 
4
- project(CASMcode_mapping VERSION 2.2.0 LANGUAGES CXX)
4
+ project(CASMcode_mapping VERSION 2.3.0 LANGUAGES CXX)
5
5
 
6
6
  # set CMAKE_INSTALL_X variables
7
7
  include(GNUInstallDirs)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libcasm-mapping
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: CASM structure mapping
5
5
  Author-email: CASM developers <casm-developers@lists.engr.ucsb.edu>
6
6
  License-Expression: LGPL-2.1-or-later
@@ -38,7 +38,7 @@ PROJECT_NAME = "CASM_mapping"
38
38
  # could be handy for archiving the generated documentation or if some version
39
39
  # control system is used.
40
40
 
41
- PROJECT_NUMBER = 2.2.0
41
+ PROJECT_NUMBER = 2.3.0
42
42
 
43
43
  # Using the PROJECT_BRIEF tag one can provide an optional one line description
44
44
  # for a project that appears at the top of each page and should give viewer a
@@ -154,13 +154,14 @@ MappingNode make_mapping_node(
154
154
  /// \brief Performs structure mapping searches
155
155
  struct MappingSearch {
156
156
  /// \brief Constructor
157
- MappingSearch(
158
- double _min_cost = 0.0, double _max_cost = 1e20, int _k_best = 1,
159
- AtomCostFunction _atom_cost_f = IsotropicAtomCost(),
160
- TotalCostFunction _total_cost_f = WeightedTotalCost(0.5),
161
- AtomToSiteCostFunction _atom_to_site_cost_f = make_atom_to_site_cost,
162
- bool _enable_remove_mean_displacement = true, double _infinity = 1e20,
163
- double _cost_tol = 1e-5);
157
+ MappingSearch(double _min_cost = 0.0, double _max_cost = 1e20,
158
+ int _k_best = 1,
159
+ AtomCostFunction _atom_cost_f = IsotropicAtomCost(),
160
+ TotalCostFunction _total_cost_f = WeightedTotalCost(0.5),
161
+ AtomToSiteCostFunction _atom_to_site_cost_f =
162
+ make_atom_to_site_cost_future,
163
+ bool _enable_remove_mean_displacement = true,
164
+ double _infinity = 1e20, double _cost_tol = 1e-5);
164
165
 
165
166
  /// \brief A queue of structure mappings, sorted by total
166
167
  /// cost only
@@ -205,9 +205,22 @@ std::vector<Eigen::Vector3d> make_trial_translations(
205
205
 
206
206
  /// \brief A function, such as `make_atom_to_site_cost`,
207
207
  /// which calculates the atom-to-site mapping cost given the
208
- /// site-to-atom displacement, atom_type, allowed_atom_types,
208
+ /// lattice in which the displacements are calculated under
209
+ /// periodic boundary conditions, the site-to-atom
210
+ /// displacement, atom_type, allowed_atom_types,
209
211
  /// and value to use for unallowed mappings (infinity).
210
212
  using AtomToSiteCostFunction = std::function<double(
213
+ xtal::Lattice const &lattice, Eigen::Vector3d const &displacement,
214
+ std::string const &atom_type,
215
+ std::vector<std::string> const &allowed_atom_types, double infinity)>;
216
+
217
+ /// \brief A function, such as `make_atom_to_site_cost`,
218
+ /// which calculates the atom-to-site mapping cost given the
219
+ /// lattice in which the displacements are calculated under
220
+ /// periodic boundary conditions, the site-to-atom
221
+ /// displacement, atom_type, allowed_atom_types,
222
+ /// and value to use for unallowed mappings (infinity).
223
+ using DispOnlyAtomToSiteCostFunction = std::function<double(
211
224
  Eigen::Vector3d const &displacement, std::string const &atom_type,
212
225
  std::vector<std::string> const &allowed_atom_types, double infinity)>;
213
226
 
@@ -217,6 +230,13 @@ double make_atom_to_site_cost(
217
230
  Eigen::Vector3d const &displacement, std::string const &atom_type,
218
231
  std::vector<std::string> const &allowed_atom_types, double infinity);
219
232
 
233
+ /// \brief Make the mapping cost for a particular atom
234
+ /// to a particular structure site
235
+ double make_atom_to_site_cost_future(
236
+ xtal::Lattice const &lattice, Eigen::Vector3d const &displacement,
237
+ std::string const &atom_type,
238
+ std::vector<std::string> const &allowed_atom_types, double infinity);
239
+
220
240
  /// \brief Holds data shared amongst all potential atom-to-site
221
241
  /// assignment problems making use of the same trial
222
242
  /// translation
@@ -225,7 +245,8 @@ struct AtomMappingSearchData {
225
245
  AtomMappingSearchData(
226
246
  std::shared_ptr<LatticeMappingSearchData const> _lattice_mapping_data,
227
247
  Eigen::Vector3d const &_trial_translation_cart,
228
- AtomToSiteCostFunction _atom_to_site_cost_f = make_atom_to_site_cost,
248
+ AtomToSiteCostFunction _atom_to_site_cost_f =
249
+ make_atom_to_site_cost_future,
229
250
  double _infinity = 1e20);
230
251
 
231
252
  /// \brief Holds lattice mapping-specific data used
@@ -80,6 +80,11 @@ struct Node {
80
80
 
81
81
  /// \brief Compare by cost only
82
82
  bool operator<(Node const &rhs) const { return this->cost < rhs.cost; }
83
+
84
+ /// \brief Return true if assignment was made
85
+ bool all_col_assigned() const { // check if sub_assignment succeeded:
86
+ return sub_assignment.size() == unassigned_cols.size();
87
+ }
83
88
  };
84
89
 
85
90
  /// \brief Returns a Node representing the (constrained) assignment problem
@@ -13,7 +13,7 @@ build-backend = "setuptools.build_meta"
13
13
 
14
14
  [project]
15
15
  name = "libcasm-mapping"
16
- version = "2.2.0"
16
+ version = "2.3.0"
17
17
  authors = [
18
18
  { name="CASM developers", email="casm-developers@lists.engr.ucsb.edu" },
19
19
  ]
@@ -2,8 +2,8 @@ import os
2
2
 
3
3
  # -- package specific configuration --
4
4
  project = "libcasm-mapping"
5
- version = "2.2" # The short X.Y version.
6
- release = "2.2.0" # The full version, including alpha/beta/rc tags.
5
+ version = "2.3" # The short X.Y version.
6
+ release = "2.3.0" # The full version, including alpha/beta/rc tags.
7
7
  project_desc = "CASM structure mapping"
8
8
  logo_text = "libcasm-mapping"
9
9
  github_url = "https://github.com/prisms-center/CASMcode_mapping/"
@@ -12,6 +12,7 @@ from ._mapping_mapsearch import (
12
12
  SymmetryBreakingAtomCost,
13
13
  WeightedTotalCost,
14
14
  make_atom_to_site_cost,
15
+ make_atom_to_site_cost_future,
15
16
  make_superstructure_data,
16
17
  make_trial_translations,
17
18
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libcasm-mapping
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: CASM structure mapping
5
5
  Author-email: CASM developers <casm-developers@lists.engr.ucsb.edu>
6
6
  License-Expression: LGPL-2.1-or-later
@@ -30,33 +30,64 @@ MappingSearch make_MappingSearch(
30
30
  double _min_cost, double _max_cost, int _k_best,
31
31
  std::optional<AtomCostFunction> _atom_cost_f,
32
32
  std::optional<TotalCostFunction> _total_cost_f,
33
- std::optional<AtomToSiteCostFunction> _atom_to_site_cost_f,
34
- bool _enable_remove_mean_displacement, double _infinity, double _cost_tol) {
33
+ std::optional<DispOnlyAtomToSiteCostFunction> _atom_to_site_cost_f,
34
+ bool _enable_remove_mean_displacement, double _infinity, double _cost_tol,
35
+ std::optional<AtomToSiteCostFunction> _atom_to_site_cost_future_f) {
35
36
  if (!_atom_cost_f) {
36
37
  _atom_cost_f = IsotropicAtomCost();
37
38
  }
38
39
  if (!_total_cost_f) {
39
40
  _total_cost_f = WeightedTotalCost(0.5);
40
41
  }
41
- if (!_atom_to_site_cost_f) {
42
- _atom_to_site_cost_f = AtomToSiteCostFunction(make_atom_to_site_cost);
42
+ AtomToSiteCostFunction f;
43
+ if (_atom_to_site_cost_future_f) {
44
+ f = _atom_to_site_cost_future_f.value();
45
+ } else {
46
+ if (!_atom_to_site_cost_f) {
47
+ _atom_to_site_cost_f =
48
+ DispOnlyAtomToSiteCostFunction(make_atom_to_site_cost);
49
+ }
50
+ // convert to AtomToSiteCostFunction
51
+ f = [_atom_to_site_cost_f](
52
+ xtal::Lattice const &lattice, Eigen::Vector3d const &displacement,
53
+ std::string const &atom_type,
54
+ std::vector<std::string> const &allowed_atom_types,
55
+ double infinity) {
56
+ return _atom_to_site_cost_f.value()(displacement, atom_type,
57
+ allowed_atom_types, infinity);
58
+ };
43
59
  }
44
60
  return MappingSearch(_min_cost, _max_cost, _k_best, _atom_cost_f.value(),
45
- _total_cost_f.value(), _atom_to_site_cost_f.value(),
61
+ _total_cost_f.value(), f,
46
62
  _enable_remove_mean_displacement, _infinity, _cost_tol);
47
63
  }
48
64
 
49
65
  std::shared_ptr<AtomMappingSearchData> make_AtomMappingSearchData(
50
66
  std::shared_ptr<LatticeMappingSearchData const> lattice_mapping_data,
51
67
  Eigen::Vector3d const &trial_translation_cart,
52
- std::optional<AtomToSiteCostFunction> atom_to_site_cost_f,
53
- double infinity) {
54
- if (!atom_to_site_cost_f) {
55
- atom_to_site_cost_f = AtomToSiteCostFunction(make_atom_to_site_cost);
68
+ std::optional<DispOnlyAtomToSiteCostFunction> _atom_to_site_cost_f,
69
+ double infinity,
70
+ std::optional<AtomToSiteCostFunction> _atom_to_site_cost_future_f) {
71
+ AtomToSiteCostFunction f;
72
+ if (_atom_to_site_cost_future_f) {
73
+ f = _atom_to_site_cost_future_f.value();
74
+ } else {
75
+ if (!_atom_to_site_cost_f) {
76
+ _atom_to_site_cost_f =
77
+ DispOnlyAtomToSiteCostFunction(make_atom_to_site_cost);
78
+ }
79
+ // convert to AtomToSiteCostFunction
80
+ f = [_atom_to_site_cost_f](
81
+ xtal::Lattice const &lattice, Eigen::Vector3d const &displacement,
82
+ std::string const &atom_type,
83
+ std::vector<std::string> const &allowed_atom_types,
84
+ double infinity) {
85
+ return _atom_to_site_cost_f.value()(displacement, atom_type,
86
+ allowed_atom_types, infinity);
87
+ };
56
88
  }
57
89
  return std::make_shared<AtomMappingSearchData>(
58
- lattice_mapping_data, trial_translation_cart, atom_to_site_cost_f.value(),
59
- infinity);
90
+ lattice_mapping_data, trial_translation_cart, f, infinity);
60
91
  }
61
92
 
62
93
  } // namespace CASMpy
@@ -101,14 +132,14 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
101
132
  prim : libcasm.xtal.Prim
102
133
  A primitive reference "parent" structure that a structure
103
134
  may be mapped to
104
- override_prim_factor_group : Optional[List[libcasm.xtal.SymOp]]
135
+ override_prim_factor_group : Optional[List[libcasm.xtal.SymOp]] = None
105
136
  Optional, allows explicitly setting the symmetry operations
106
137
  used to skip symmetrically equivalent structure mappings. The
107
138
  default (None), uses the prim factor group as generated by
108
139
  `libcasm.xtal.make_prim_factor_group`. The first symmetry
109
140
  operation should always be the identity operation. Will raise
110
141
  if an empty vector is provided.
111
- enable_symmetry_breaking_atom_cost : bool, default=True
142
+ enable_symmetry_breaking_atom_cost : bool = True
112
143
  If symmetry_breaking_atom_cost is intended to be used, setting
113
144
  this to true will generate the symmetry-invariant displacement
114
145
  modes required for the calculation using this object's
@@ -433,22 +464,76 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
433
464
  R"pbdoc(
434
465
  Returns the cost for mapping a particular atom to a particular site
435
466
 
467
+
468
+ .. deprecated:: 2.3.0
469
+ The :func:`make_atom_to_site_cost_future` method, which takes
470
+ `lattice` as a parameter, is planned to replace this
471
+ method in libcasm-mapping>=3.0.0.
472
+
473
+ The mapping cost:
474
+
475
+ - of a vacancy to any site that allows vacancies is set to
476
+ 0.0.
477
+ - of an atom to a site that does not allow the atom type is
478
+ infinity
479
+ - otherwise, the mapping cost is equal to displacement length
480
+ squared
481
+
482
+ Notes
483
+ -----
484
+ Atoms are treated as vacancies if they are named \"Va\", \"VA\",
485
+ or \"va\".
486
+
487
+ Parameters
488
+ ----------
489
+ displacement : array_like, shape=(3,)
490
+ The minimum length displacement, accounting for periodic
491
+ boundaries, from the site to the atom.
492
+ atom_type : str,
493
+ The atom (or vacancy) type.
494
+ allowed_atom_types : List[str]
495
+ The atom (or vacancy) types allowed on the site.
496
+ infinity: float
497
+ The value to use for the cost of unallowed mappings
498
+
499
+ Returns
500
+ -------
501
+ cost : float
502
+ The atom (or vacancy) mapping cost.
503
+ )pbdoc");
504
+
505
+ m.def("make_atom_to_site_cost_future", &make_atom_to_site_cost_future,
506
+ py::arg("lattice"), py::arg("displacement"), py::arg("atom_type"),
507
+ py::arg("allowed_atom_types"), py::arg("infinity"),
508
+ R"pbdoc(
509
+ Returns the cost for mapping a particular atom to a particular site
510
+
511
+ .. deprecated:: 2.3.0
512
+ This method is planned to replace :func:`make_atom_to_site_cost` in
513
+ libcasm-mapping>=3.0.0, and this method will be removed.
514
+
436
515
  The mapping cost:
437
516
 
438
517
  - of a vacancy to any site that allows vacancies is set to
439
518
  0.0.
440
519
  - of an atom to a site that does not allow the atom type is
441
520
  infinity
521
+ - of a displacement on the lattice voronoi cell boundary is
522
+ infinity (the displacement is ambiguous as to which periodic
523
+ image it should map to)
442
524
  - otherwise, the mapping cost is equal to displacement length
443
525
  squared
444
526
 
445
527
  Notes
446
528
  -----
447
- Vacancies should be given the name \"Va\", \"VA\", or \"va\", and
448
- checked for with the function :func:`libcasm.xtal.is_vacancy`.
529
+ Atoms are treated as vacancies if they are named \"Va\", \"VA\",
530
+ or \"va\".
449
531
 
450
532
  Parameters
451
533
  ----------
534
+ lattice : libcasm.xtal.Lattice
535
+ The lattice in which the displacements are calculated under
536
+ periodic boundary conditions.
452
537
  displacement : array_like, shape=(3,)
453
538
  The minimum length displacement, accounting for periodic
454
539
  boundaries, from the site to the atom.
@@ -456,7 +541,7 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
456
541
  The atom (or vacancy) type.
457
542
  allowed_atom_types : List[str]
458
543
  The atom (or vacancy) types allowed on the site.
459
- infinity: float, default=1e20
544
+ infinity: float
460
545
  The value to use for the cost of unallowed mappings
461
546
 
462
547
  Returns
@@ -505,7 +590,9 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
505
590
  .def(py::init<>(&make_AtomMappingSearchData),
506
591
  py::arg("lattice_mapping_data"), py::arg("trial_translation_cart"),
507
592
  py::arg("atom_to_site_cost_f") = std::nullopt,
508
- py::arg("infinity") = 1e20, R"pbdoc(
593
+ py::arg("infinity") = 1e20,
594
+ py::arg("atom_to_site_cost_future_f") = std::nullopt,
595
+ R"pbdoc(
509
596
  .. rubric:: Constructor
510
597
 
511
598
  Parameters
@@ -519,13 +606,35 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
519
606
  ideal superstructure setting (i.e.
520
607
  atom_coordinate_cart_in_supercell) to bring the atoms and sites
521
608
  into alignment.
522
- atom_to_site_cost_f : Optional[Callable[[numpy.ndarray[numpy.float64[3, 1]], str, List[str], float], float]] = None
609
+ atom_to_site_cost_f : Optional[Callable] = None
523
610
  A function used to calculate the cost of mapping an atom to a
524
611
  particular site. Expected to match the same signature as
525
612
  :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost`, which
526
613
  is the default method.
527
- infinity : float, default=1e20
614
+
615
+ .. deprecated:: 2.3.0
616
+ The signature of
617
+ :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost`
618
+ will change in libcasm-mapping>=3.0.0 to accept the lattice
619
+ used for finding the displacements under periodic boundary
620
+ conditions. The function
621
+ :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost_future`
622
+ will be used as the default.
623
+
624
+ infinity : float = 1e20
528
625
  The value to use for the cost of unallowed mappings.
626
+
627
+ atom_to_site_cost_future_f : Optional[Callable] = None
628
+ A function used to calculate the cost of mapping an atom to a
629
+ particular site. Expected to match the same signature as
630
+ :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost_future`.
631
+ If provided, this function will be used with priority over
632
+ `atom_to_site_cost_f`.
633
+
634
+ .. deprecated:: 2.3.0
635
+ This argument will be removed in libcasm-mapping>=3.0.0.
636
+
637
+
529
638
  )pbdoc")
530
639
  .def(
531
640
  "lattice_mapping_data",
@@ -903,26 +1012,27 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
903
1012
  py::arg("atom_to_site_cost_f") = std::nullopt,
904
1013
  py::arg("enable_remove_mean_displacement") = true,
905
1014
  py::arg("infinity") = 1e20, py::arg("cost_tol") = 1e-5,
1015
+ py::arg("atom_to_site_cost_future_f") = std::nullopt,
906
1016
  R"pbdoc(
907
1017
  .. rubric:: Constructor
908
1018
 
909
1019
  Parameters
910
1020
  ----------
911
- min_cost : float, default=0.0
1021
+ min_cost : float = 0.0
912
1022
  Keep mappings with total cost >= min_cost. Nodes that have
913
1023
  a lower cost will be added to the search queue to enable searching
914
1024
  for less-optimal solutions but not included in the final results.
915
- max_cost : float, default=1e20
1025
+ max_cost : float = 1e20
916
1026
  Keep mappings with total cost <= max_cost. Nodes that have
917
1027
  a higher cost will not be included in the final results, nor will
918
1028
  they be added to the search queue. During the course of a search,
919
1029
  once `k_best` results have been found, the `max_cost` will be
920
1030
  shrunk to match the `k_best`-ranked solution.
921
- k_best : int, default=1
1031
+ k_best : int = 1
922
1032
  Keep the k_best mappings with lowest total cost that also
923
1033
  satisfy the min/max cost criteria. Approximate ties with the
924
1034
  current `k_best`-ranked result are also kept.
925
- atom_cost_f : Optional[Callable[[LatticeMappingSearchData, AtomMappingSearchData, libcasm.mapping.info.AtomMapping], float]] = None
1035
+ atom_cost_f : Optional[Callable] = None
926
1036
 
927
1037
  The function used to calculate the atom mapping cost. Expected
928
1038
  to match the same signature as
@@ -934,27 +1044,46 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
934
1044
 
935
1045
  If None, the default value is ``IsotropicAtomCost()``.
936
1046
 
937
- total_cost_f : Callable[[float, LatticeMappingSearchData, float, AtomMappingSearchData, AtomMapping], float]] = None
1047
+ total_cost_f : Optional[Callable] = None
938
1048
  The function used to calculate the total mapping cost. Expected
939
1049
  to match the same signature as
940
1050
  :class:`~libcasm.mapping.mapsearch.WeightedTotalCost.cost`.
941
1051
  If None, the default value is ``WeightedTotalCost(0.5)``.
942
1052
 
943
- atom_to_site_cost_f : Optional[Callable[[numpy.ndarray[numpy.float64[3, 1]], str, List[str], float], float]] = None
1053
+ atom_to_site_cost_f : Optional[Callable] = None
944
1054
  A function used to calculate the cost of mapping an atom to a
945
1055
  particular site. Expected to match the same signature as
946
1056
  :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost`, which
947
1057
  is the default method.
948
1058
 
949
- enable_remove_mean_displacement : bool, default=True
1059
+ .. deprecated:: 2.3.0
1060
+ The signature of
1061
+ :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost`
1062
+ will change in libcasm-mapping>=3.0.0 to accept the lattice
1063
+ used for finding the displacements under periodic boundary
1064
+ conditions. The function
1065
+ :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost_future`
1066
+ will be used as the default.
1067
+
1068
+ enable_remove_mean_displacement : bool = True
950
1069
  If true, the translation and displacements of an atom
951
1070
  mapping are adjusted consistently so that the mean displacment
952
1071
  is zero.
953
- infinity : float, default=1e20
1072
+ infinity : float = 1e20
954
1073
  The value to use in the assignment problem cost matrix for
955
1074
  unallowed atom-to-site mappings.
956
- cost_tol : float, default=1e-5
1075
+ cost_tol : float = 1e-5
957
1076
  Tolerance for checking if mapping costs are approximately equal.
1077
+ atom_to_site_cost_future_f : Optional[Callable] = None
1078
+ A function used to calculate the cost of mapping an atom to a
1079
+ particular site. Expected to match the same signature as
1080
+ :func:`~libcasm.mapping.mapsearch.make_atom_to_site_cost_future`.
1081
+ If provided, this function will be used with priority over
1082
+ `atom_to_site_cost_f`.
1083
+
1084
+ .. deprecated:: 2.3.0
1085
+ This argument will be removed in libcasm-mapping>=3.0.0.
1086
+
958
1087
  )pbdoc")
959
1088
  .def_readonly("min_cost", &MappingSearch::min_cost,
960
1089
  "float: Keep mappings with total cost >= min_cost.")
@@ -1103,15 +1232,15 @@ PYBIND11_MODULE(_mapping_mapsearch, m) {
1103
1232
 
1104
1233
  Parameters
1105
1234
  ----------
1106
- min_queue_cost : Optional[float], default=None
1235
+ min_queue_cost : Optional[float] = None
1107
1236
  Minimum cost mappings to keep in the search queue and use as the
1108
1237
  starting point for finding next-best cost atom mapping
1109
1238
  assignments.
1110
- max_queue_cost : Optional[float], default=None
1239
+ max_queue_cost : Optional[float] = None
1111
1240
  Maximum cost mappings to keep in the search queue and use as the
1112
1241
  starting point for finding next-best cost atom mapping
1113
1242
  assignments.
1114
- max_queue_size : Optional[int], default=None
1243
+ max_queue_size : Optional[int] = None
1115
1244
  Maximum search queue size to allow.
1116
1245
 
1117
1246
  )pbdoc")