@mat3ra/made 2026.8.13-0 → 2026.8.26-0

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 (493) hide show
  1. package/package.json +9 -5
  2. package/.babelrc +0 -10
  3. package/.eslintrc.json +0 -11
  4. package/.gitattributes +0 -1
  5. package/.husky/post-checkout +0 -3
  6. package/.husky/post-commit +0 -3
  7. package/.husky/post-merge +0 -3
  8. package/.husky/pre-commit +0 -6
  9. package/.husky/pre-push +0 -3
  10. package/.mocharc.json +0 -5
  11. package/.pre-commit-config.yaml +0 -26
  12. package/.prettierignore +0 -2
  13. package/.prettierrc +0 -6
  14. package/AGENTS.md +0 -133
  15. package/MANIFEST.in +0 -1
  16. package/data/constants.json +0 -13
  17. package/data/reciprocal_paths.json +0 -111
  18. package/images/made/tools/tools_diagram_general.png +0 -3
  19. package/images/made/tools/tools_diagram_interface.png +0 -3
  20. package/pyproject.toml +0 -123
  21. package/scripts/generate-mixins.ts +0 -28
  22. package/src/__init__.py +0 -0
  23. package/src/js/Material.ts +0 -618
  24. package/src/js/basis/basis.ts +0 -634
  25. package/src/js/basis/constrained_basis.ts +0 -115
  26. package/src/js/basis/coordinates.ts +0 -92
  27. package/src/js/basis/elements.ts +0 -24
  28. package/src/js/basis/helpers.ts +0 -20
  29. package/src/js/basis/labels.ts +0 -6
  30. package/src/js/cell/cell.ts +0 -149
  31. package/src/js/cell/conventional_cell.ts +0 -86
  32. package/src/js/cell/primitive_cell.ts +0 -166
  33. package/src/js/constants/molecule.ts +0 -18
  34. package/src/js/constants.ts +0 -4
  35. package/src/js/constraints/constraints.ts +0 -45
  36. package/src/js/generated/MaterialSchemaMixin.ts +0 -79
  37. package/src/js/lattice/lattice.ts +0 -308
  38. package/src/js/lattice/lattice_types.ts +0 -134
  39. package/src/js/lattice/reciprocal/lattice_reciprocal.ts +0 -206
  40. package/src/js/lattice/reciprocal/paths.ts +0 -39
  41. package/src/js/lattice/reciprocal/symmetry_points.ts +0 -886
  42. package/src/js/lattice/unit_cell.ts +0 -66
  43. package/src/js/made.ts +0 -62
  44. package/src/js/parsers/cif.ts +0 -25
  45. package/src/js/parsers/errors.ts +0 -6
  46. package/src/js/parsers/espresso.ts +0 -29
  47. package/src/js/parsers/native_format_parsers.ts +0 -52
  48. package/src/js/parsers/parsers.ts +0 -13
  49. package/src/js/parsers/poscar.ts +0 -218
  50. package/src/js/parsers/xyz.ts +0 -190
  51. package/src/js/parsers/xyz_combinatorial_basis.ts +0 -268
  52. package/src/js/tools/basis.ts +0 -131
  53. package/src/js/tools/cell.ts +0 -40
  54. package/src/js/tools/index.ts +0 -11
  55. package/src/js/tools/material.ts +0 -64
  56. package/src/js/tools/supercell.ts +0 -89
  57. package/src/js/tools/surface.ts +0 -213
  58. package/src/py/__init__.py +0 -0
  59. package/src/py/mat3ra/__init__.py +0 -1
  60. package/src/py/mat3ra/made/__init__.py +0 -7
  61. package/src/py/mat3ra/made/basis/__init__.py +0 -255
  62. package/src/py/mat3ra/made/basis/coordinates.py +0 -43
  63. package/src/py/mat3ra/made/cell/__init__.py +0 -55
  64. package/src/py/mat3ra/made/cell/primitive_cell.py +0 -156
  65. package/src/py/mat3ra/made/data_helper.py +0 -5
  66. package/src/py/mat3ra/made/lattice.py +0 -195
  67. package/src/py/mat3ra/made/material.py +0 -135
  68. package/src/py/mat3ra/made/metadata.py +0 -45
  69. package/src/py/mat3ra/made/reciprocal/__init__.py +0 -5
  70. package/src/py/mat3ra/made/reciprocal/lattice_reciprocal.py +0 -147
  71. package/src/py/mat3ra/made/reciprocal/paths.py +0 -30
  72. package/src/py/mat3ra/made/reciprocal/symmetry_points.py +0 -385
  73. package/src/py/mat3ra/made/tools/README.md +0 -173
  74. package/src/py/mat3ra/made/tools/__init__.py +0 -0
  75. package/src/py/mat3ra/made/tools/analyze/__init__.py +0 -31
  76. package/src/py/mat3ra/made/tools/analyze/basis/__init__.py +0 -3
  77. package/src/py/mat3ra/made/tools/analyze/basis/analyzer.py +0 -50
  78. package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer.py +0 -32
  79. package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer_factory.py +0 -31
  80. package/src/py/mat3ra/made/tools/analyze/coordination.py +0 -56
  81. package/src/py/mat3ra/made/tools/analyze/crystal_site/__init__.py +0 -0
  82. package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_crystal_site_material_analyzer.py +0 -35
  83. package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_material_analyzer.py +0 -49
  84. package/src/py/mat3ra/made/tools/analyze/crystal_site/crystal_site_analyzer.py +0 -65
  85. package/src/py/mat3ra/made/tools/analyze/crystal_site/voronoi_crystal_site_analyzer.py +0 -47
  86. package/src/py/mat3ra/made/tools/analyze/enums.py +0 -33
  87. package/src/py/mat3ra/made/tools/analyze/fingerprint/__init__.py +0 -4
  88. package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/__init__.py +0 -0
  89. package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/layered_fingerprint_along_axis.py +0 -83
  90. package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/unique_element_string_per_layer.py +0 -9
  91. package/src/py/mat3ra/made/tools/analyze/interface/__init__.py +0 -20
  92. package/src/py/mat3ra/made/tools/analyze/interface/commensurate.py +0 -156
  93. package/src/py/mat3ra/made/tools/analyze/interface/enums.py +0 -60
  94. package/src/py/mat3ra/made/tools/analyze/interface/grain_boundary.py +0 -80
  95. package/src/py/mat3ra/made/tools/analyze/interface/simple.py +0 -251
  96. package/src/py/mat3ra/made/tools/analyze/interface/twisted_nanoribbons.py +0 -91
  97. package/src/py/mat3ra/made/tools/analyze/interface/utils/__init__.py +0 -77
  98. package/src/py/mat3ra/made/tools/analyze/interface/utils/holders.py +0 -14
  99. package/src/py/mat3ra/made/tools/analyze/interface/utils/vector.py +0 -56
  100. package/src/py/mat3ra/made/tools/analyze/interface/zsl.py +0 -259
  101. package/src/py/mat3ra/made/tools/analyze/interface_material.py +0 -45
  102. package/src/py/mat3ra/made/tools/analyze/lattice/__init__.py +0 -2
  103. package/src/py/mat3ra/made/tools/analyze/lattice/analyzer.py +0 -126
  104. package/src/py/mat3ra/made/tools/analyze/lattice/helpers.py +0 -31
  105. package/src/py/mat3ra/made/tools/analyze/lattice_lines.py +0 -30
  106. package/src/py/mat3ra/made/tools/analyze/lattice_planes.py +0 -192
  107. package/src/py/mat3ra/made/tools/analyze/lattice_swap_analyzer.py +0 -105
  108. package/src/py/mat3ra/made/tools/analyze/material.py +0 -276
  109. package/src/py/mat3ra/made/tools/analyze/other.py +0 -434
  110. package/src/py/mat3ra/made/tools/analyze/rdf.py +0 -74
  111. package/src/py/mat3ra/made/tools/analyze/slab.py +0 -76
  112. package/src/py/mat3ra/made/tools/analyze/solid_solution_analyzer.py +0 -171
  113. package/src/py/mat3ra/made/tools/analyze/terrace.py +0 -105
  114. package/src/py/mat3ra/made/tools/analyze/utils.py +0 -162
  115. package/src/py/mat3ra/made/tools/bond_directions/__init__.py +0 -0
  116. package/src/py/mat3ra/made/tools/bond_directions/bond_directions.py +0 -150
  117. package/src/py/mat3ra/made/tools/bond_directions/bond_directions_for_element_list.py +0 -7
  118. package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_enum.py +0 -8
  119. package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_for_element.py +0 -16
  120. package/src/py/mat3ra/made/tools/build/__init__.py +0 -25
  121. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/__init__.py +0 -7
  122. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/helpers.py +0 -59
  123. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/types.py +0 -26
  124. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/utils.py +0 -139
  125. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/__init__.py +0 -47
  126. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/__init__.py +0 -11
  127. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/build_parameters.py +0 -5
  128. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/builder.py +0 -164
  129. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/configuration.py +0 -48
  130. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/helpers.py +0 -134
  131. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/__init__.py +0 -6
  132. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/helpers.py +0 -157
  133. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/enums.py +0 -7
  134. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/__init__.py +0 -7
  135. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/configuration.py +0 -13
  136. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/helpers.py +0 -70
  137. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/utils.py +0 -87
  138. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/__init__.py +0 -6
  139. package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/helpers.py +0 -129
  140. package/src/py/mat3ra/made/tools/build/defective_structures/__init__.py +0 -0
  141. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/__init__.py +0 -0
  142. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/__init__.py +0 -0
  143. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/build_parameters.py +0 -12
  144. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/builder.py +0 -17
  145. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/configuration.py +0 -40
  146. package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/helpers.py +0 -82
  147. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/__init__.py +0 -1
  148. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/__init__.py +0 -9
  149. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/builder.py +0 -37
  150. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/configuration.py +0 -30
  151. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/enums.py +0 -8
  152. package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/helpers.py +0 -76
  153. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/__init__.py +0 -0
  154. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/__init__.py +0 -0
  155. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/builder.py +0 -11
  156. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/configuration.py +0 -18
  157. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/helpers.py +0 -137
  158. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/types.py +0 -22
  159. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/__init__.py +0 -0
  160. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/builder.py +0 -28
  161. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/configuration.py +0 -55
  162. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/helpers.py +0 -75
  163. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/builder.py +0 -15
  164. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/configuration.py +0 -16
  165. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/helpers.py +0 -116
  166. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/build_parameters.py +0 -10
  167. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/builder.py +0 -30
  168. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/configuration.py +0 -11
  169. package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/helpers.py +0 -78
  170. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/__init__.py +0 -0
  171. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/__init__.py +0 -0
  172. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/builder.py +0 -31
  173. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/configuration.py +0 -45
  174. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/helpers.py +0 -80
  175. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/__init__.py +0 -40
  176. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/atom_placement_method_enum.py +0 -14
  177. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/__init__.py +0 -7
  178. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/builder.py +0 -42
  179. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/configuration.py +0 -27
  180. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/complex_defect_type_enum.py +0 -5
  181. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/factories.py +0 -69
  182. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/helpers.py +0 -92
  183. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/__init__.py +0 -7
  184. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/builder.py +0 -8
  185. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/configuration.py +0 -29
  186. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/helpers.py +0 -48
  187. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/interstitial_placement_method_enum.py +0 -8
  188. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/point_defect_type_enum.py +0 -8
  189. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/__init__.py +0 -7
  190. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/builder.py +0 -6
  191. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/configuration.py +0 -41
  192. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/helpers.py +0 -43
  193. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/substitution_placement_method_enum.py +0 -7
  194. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/types.py +0 -24
  195. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/__init__.py +0 -7
  196. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/builder.py +0 -19
  197. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/configuration.py +0 -27
  198. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/helpers.py +0 -42
  199. package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/vacancy_placement_method_enum.py +0 -7
  200. package/src/py/mat3ra/made/tools/build/pristine_structures/__init__.py +0 -0
  201. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/__init__.py +0 -0
  202. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/builder.py +0 -80
  203. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/configurations.py +0 -22
  204. package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/helpers.py +0 -40
  205. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/__init__.py +0 -0
  206. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/__init__.py +0 -29
  207. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/build_parameters.py +0 -5
  208. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/builders.py +0 -56
  209. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/configuration.py +0 -33
  210. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/helpers.py +0 -76
  211. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/__init__.py +0 -11
  212. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/build_parameters.py +0 -9
  213. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/builders.py +0 -83
  214. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/configuration.py +0 -35
  215. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/helpers.py +0 -62
  216. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/__init__.py +0 -9
  217. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/build_parameters.py +0 -8
  218. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/builder.py +0 -42
  219. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/configuration.py +0 -99
  220. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/helpers.py +0 -95
  221. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/termination_utils.py +0 -14
  222. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/utils.py +0 -61
  223. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/builder.py +0 -22
  224. package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/configuration.py +0 -17
  225. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/__init__.py +0 -0
  226. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/__init__.py +0 -19
  227. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/analyzer.py +0 -86
  228. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/__init__.py +0 -7
  229. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/builder.py +0 -54
  230. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/configuration.py +0 -19
  231. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/enums.py +0 -42
  232. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/helpers.py +0 -127
  233. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/__init__.py +0 -7
  234. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/builder.py +0 -33
  235. package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/configuration.py +0 -16
  236. package/src/py/mat3ra/made/tools/build/processed_structures/__init__.py +0 -0
  237. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/__init__.py +0 -0
  238. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/__init__.py +0 -0
  239. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/__init__.py +0 -9
  240. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/coordination_based_passivation_material_analyzer.py +0 -112
  241. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/passivation_material_analyzer.py +0 -16
  242. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/surface_passivation_material_analyzer.py +0 -32
  243. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/builder.py +0 -23
  244. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/configuration.py +0 -31
  245. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/enums.py +0 -7
  246. package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/helpers.py +0 -151
  247. package/src/py/mat3ra/made/tools/build_components/__init__.py +0 -10
  248. package/src/py/mat3ra/made/tools/build_components/entities/__init__.py +0 -0
  249. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/__init__.py +0 -0
  250. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/one_dimensional/miller_indices_2d.py +0 -0
  251. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/miller_indices.py +0 -18
  252. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/termination.py +0 -33
  253. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/__init__.py +0 -0
  254. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/__init__.py +0 -2
  255. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site.py +0 -24
  256. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site_list.py +0 -9
  257. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/builder.py +0 -32
  258. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/configuration.py +0 -14
  259. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/__init__.py +0 -0
  260. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/builder.py +0 -29
  261. package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/configuration.py +0 -19
  262. package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/builder.py +0 -48
  263. package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/configuration.py +0 -17
  264. package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/builder.py +0 -25
  265. package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/configuration.py +0 -8
  266. package/src/py/mat3ra/made/tools/build_components/entities/reusable/__init__.py +0 -0
  267. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/__init__.py +0 -16
  268. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_configuration_pydantic.py +0 -5
  269. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_single_builder.py +0 -87
  270. package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/build_parameters.py +0 -5
  271. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/__init__.py +0 -0
  272. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/__init__.py +0 -4
  273. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/builder.py +0 -46
  274. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/configuration.py +0 -19
  275. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/edge_types.py +0 -51
  276. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/helpers.py +0 -58
  277. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/__init__.py +0 -4
  278. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/builder.py +0 -42
  279. package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/configuration.py +0 -21
  280. package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/__init__.py +0 -0
  281. package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/configuration.py +0 -11
  282. package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/helpers.py +0 -38
  283. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/__init__.py +0 -24
  284. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/__init__.py +0 -7
  285. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/builder.py +0 -62
  286. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/configuration.py +0 -14
  287. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/helpers.py +0 -42
  288. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/__init__.py +0 -7
  289. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/builder.py +0 -39
  290. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/configuration.py +0 -24
  291. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/__init__.py +0 -10
  292. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/builder.py +0 -36
  293. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/configuration.py +0 -31
  294. package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/helpers.py +0 -80
  295. package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/__init__.py +0 -0
  296. package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/coordinates_shape_enum.py +0 -8
  297. package/src/py/mat3ra/made/tools/build_components/metadata/__init__.py +0 -2
  298. package/src/py/mat3ra/made/tools/build_components/metadata/build_metadata.py +0 -7
  299. package/src/py/mat3ra/made/tools/build_components/metadata/material_build_metadata.py +0 -35
  300. package/src/py/mat3ra/made/tools/build_components/metadata/material_with_build_metadata.py +0 -8
  301. package/src/py/mat3ra/made/tools/build_components/mixins/__init__.py +0 -2
  302. package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_ase_atoms_mixin.py +0 -8
  303. package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_pymatgen_structure_mixin.py +0 -8
  304. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/__init__.py +0 -0
  305. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/enums.py +0 -11
  306. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/__init__.py +0 -6
  307. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/build_parameters.py +0 -18
  308. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/builder.py +0 -93
  309. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/configuration.py +0 -20
  310. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/builder.py +0 -83
  311. package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/configuration.py +0 -24
  312. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/__init__.py +0 -15
  313. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/build_parameters.py +0 -5
  314. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/base.py +0 -33
  315. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/isometric.py +0 -25
  316. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/configuration.py +0 -24
  317. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/__init__.py +0 -13
  318. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/atomic_mass_dependent_function_holder.py +0 -32
  319. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/function_holder.py +0 -80
  320. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/maxwell_boltzmann.py +0 -39
  321. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/perturbation_function_holder.py +0 -45
  322. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/sine_wave_perturbation_function_holder.py +0 -29
  323. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/helpers.py +0 -83
  324. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/__init__.py +0 -5
  325. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/builder.py +0 -25
  326. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/configuration.py +0 -23
  327. package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/helpers.py +0 -49
  328. package/src/py/mat3ra/made/tools/build_components/utils.py +0 -44
  329. package/src/py/mat3ra/made/tools/calculate/__init__.py +0 -149
  330. package/src/py/mat3ra/made/tools/calculate/ase/__init__.py +0 -133
  331. package/src/py/mat3ra/made/tools/calculate/ase/constraints.py +0 -91
  332. package/src/py/mat3ra/made/tools/calculate/calculators/__init__.py +0 -4
  333. package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator.py +0 -70
  334. package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator_parameters.py +0 -14
  335. package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator.py +0 -32
  336. package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator_parameters.py +0 -17
  337. package/src/py/mat3ra/made/tools/calculate/interaction_functions.py +0 -23
  338. package/src/py/mat3ra/made/tools/convert/__init__.py +0 -286
  339. package/src/py/mat3ra/made/tools/convert/interface_parts_enum.py +0 -9
  340. package/src/py/mat3ra/made/tools/convert/utils.py +0 -96
  341. package/src/py/mat3ra/made/tools/entities/__init__.py +0 -5
  342. package/src/py/mat3ra/made/tools/entities/coordinate/__init__.py +0 -14
  343. package/src/py/mat3ra/made/tools/entities/coordinate/box_coordinate_condition.py +0 -15
  344. package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_condition.py +0 -16
  345. package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_functions.py +0 -158
  346. package/src/py/mat3ra/made/tools/entities/coordinate/cylinder_coordinate_condition.py +0 -17
  347. package/src/py/mat3ra/made/tools/entities/coordinate/plane_coordinate_condition.py +0 -14
  348. package/src/py/mat3ra/made/tools/entities/coordinate/sphere_coordinate_condition.py +0 -15
  349. package/src/py/mat3ra/made/tools/entities/coordinate/triangular_prism_coordinate_condition.py +0 -26
  350. package/src/py/mat3ra/made/tools/entities/termination_holder.py +0 -12
  351. package/src/py/mat3ra/made/tools/helpers.py +0 -168
  352. package/src/py/mat3ra/made/tools/modify.py +0 -627
  353. package/src/py/mat3ra/made/tools/operations/core/binary.py +0 -106
  354. package/src/py/mat3ra/made/tools/operations/core/unary.py +0 -170
  355. package/src/py/mat3ra/made/tools/operations/core/utils.py +0 -138
  356. package/src/py/mat3ra/made/tools/operations/reusable/unary.py +0 -53
  357. package/src/py/mat3ra/made/tools/optimize.py +0 -55
  358. package/src/py/mat3ra/made/tools/third_party.py +0 -69
  359. package/src/py/mat3ra/made/tools/utils.py +0 -182
  360. package/src/py/mat3ra/made/utils.py +0 -144
  361. package/tests/.gitattributes +0 -1
  362. package/tests/fixtures/AsGe-basis.json +0 -3
  363. package/tests/fixtures/C2H4-translated.json +0 -3
  364. package/tests/fixtures/C2H4.json +0 -3
  365. package/tests/fixtures/FeLiSi-basis.json +0 -3
  366. package/tests/fixtures/FeO.json +0 -3
  367. package/tests/fixtures/Ge2-basis.json +0 -3
  368. package/tests/fixtures/Graphene.json +0 -3
  369. package/tests/fixtures/Graphene.poscar +0 -3
  370. package/tests/fixtures/H2+H-final.json +0 -3
  371. package/tests/fixtures/H2+H-image.json +0 -3
  372. package/tests/fixtures/H2+H-initial.json +0 -3
  373. package/tests/fixtures/H2O.poscar +0 -3
  374. package/tests/fixtures/LiFeSi-basis-labels.json +0 -3
  375. package/tests/fixtures/LiFeSi-basis.json +0 -3
  376. package/tests/fixtures/Na.json +0 -3
  377. package/tests/fixtures/Na4Cl4-cartesian.json +0 -3
  378. package/tests/fixtures/Na4Cl4.json +0 -3
  379. package/tests/fixtures/Na4Cl4.poscar +0 -3
  380. package/tests/fixtures/Ni-hex.json +0 -3
  381. package/tests/fixtures/Ni-hex.poscar +0 -3
  382. package/tests/fixtures/OSi-basis.json +0 -3
  383. package/tests/fixtures/Si-hex.poscar +0 -3
  384. package/tests/fixtures/Si-pwscf.in +0 -3
  385. package/tests/fixtures/Si-slab.json +0 -3
  386. package/tests/fixtures/Si-supercell.json +0 -3
  387. package/tests/fixtures/Si2-basis-repeated.json +0 -3
  388. package/tests/fixtures/Si2-basis.json +0 -3
  389. package/tests/fixtures/Zr1H23Zr1H1.json +0 -3
  390. package/tests/fixtures/Zr1H23Zr1H1.poscar +0 -3
  391. package/tests/fixtures/atomic-constraints.json +0 -3
  392. package/tests/fixtures/hashes.json +0 -3
  393. package/tests/fixtures/si-slab-100.json +0 -3
  394. package/tests/fixtures/si-slab-111-0-vacuum.json +0 -3
  395. package/tests/fixtures/si-slab-111-0.5-vacuum-gamma-120.json +0 -3
  396. package/tests/fixtures/si-slab-111-0.5-vacuum-ratio.json +0 -3
  397. package/tests/fixtures/si-standata.json +0 -3
  398. package/tests/js/basis/basis.ts +0 -247
  399. package/tests/js/cell/cell.ts +0 -182
  400. package/tests/js/cell/primitive_cell.ts +0 -21
  401. package/tests/js/constraints/constraints.ts +0 -11
  402. package/tests/js/fixtures.ts +0 -123
  403. package/tests/js/lattice/lattice.ts +0 -43
  404. package/tests/js/lattice/lattice_reciprocal.ts +0 -104
  405. package/tests/js/material/material.ts +0 -161
  406. package/tests/js/parsers/espresso.ts +0 -12
  407. package/tests/js/parsers/native_formats.ts +0 -35
  408. package/tests/js/parsers/poscar.ts +0 -89
  409. package/tests/js/parsers/xyz.ts +0 -33
  410. package/tests/js/parsers/xyz_combinatorial_basis.ts +0 -156
  411. package/tests/js/register-esse-schemas.cjs +0 -10
  412. package/tests/js/setup.ts +0 -6
  413. package/tests/js/tools/basis.ts +0 -22
  414. package/tests/js/tools/supercell.ts +0 -58
  415. package/tests/js/tools/surface.ts +0 -111
  416. package/tests/py/conftest.py +0 -34
  417. package/tests/py/mat3ra/debug_utils.py +0 -75
  418. package/tests/py/unit/__init__.py +0 -0
  419. package/tests/py/unit/fixtures/__init__.py +0 -0
  420. package/tests/py/unit/fixtures/adatom.py +0 -60
  421. package/tests/py/unit/fixtures/bulk.py +0 -162
  422. package/tests/py/unit/fixtures/cuts.py +0 -118
  423. package/tests/py/unit/fixtures/grain_boundary.py +0 -875
  424. package/tests/py/unit/fixtures/interface/commensurate.py +0 -498
  425. package/tests/py/unit/fixtures/interface/gaas_dia.py +0 -837
  426. package/tests/py/unit/fixtures/interface/gr_ni_111_top_hcp.py +0 -123
  427. package/tests/py/unit/fixtures/interface/simple.py +0 -84
  428. package/tests/py/unit/fixtures/interface/twisted_nanoribbons.py +0 -131
  429. package/tests/py/unit/fixtures/interface/zsl.py +0 -756
  430. package/tests/py/unit/fixtures/island.py +0 -336
  431. package/tests/py/unit/fixtures/merge.py +0 -147
  432. package/tests/py/unit/fixtures/monolayer.py +0 -46
  433. package/tests/py/unit/fixtures/nanoparticle.py +0 -116
  434. package/tests/py/unit/fixtures/nanoribbon/__init__.py +0 -0
  435. package/tests/py/unit/fixtures/nanoribbon/armchair.py +0 -102
  436. package/tests/py/unit/fixtures/nanoribbon/nanoribbon.py +0 -145
  437. package/tests/py/unit/fixtures/nanoribbon/zigzag.py +0 -54
  438. package/tests/py/unit/fixtures/pair_defects.py +0 -41
  439. package/tests/py/unit/fixtures/passivated/nanoribbon.py +0 -69
  440. package/tests/py/unit/fixtures/passivated/slab.py +0 -58
  441. package/tests/py/unit/fixtures/point_defects.py +0 -158
  442. package/tests/py/unit/fixtures/slab.py +0 -606
  443. package/tests/py/unit/fixtures/strain.py +0 -42
  444. package/tests/py/unit/fixtures/supercell.py +0 -64
  445. package/tests/py/unit/fixtures/terrace.py +0 -70
  446. package/tests/py/unit/fixtures/thrid_party/ase_atoms.py +0 -13
  447. package/tests/py/unit/test_analyze_lattice_planes.py +0 -131
  448. package/tests/py/unit/test_cell.py +0 -104
  449. package/tests/py/unit/test_data_files.py +0 -68
  450. package/tests/py/unit/test_lattice.py +0 -103
  451. package/tests/py/unit/test_lattice_type_extended.py +0 -53
  452. package/tests/py/unit/test_material.py +0 -158
  453. package/tests/py/unit/test_operations.py +0 -126
  454. package/tests/py/unit/test_primitive_cell.py +0 -118
  455. package/tests/py/unit/test_reciprocal_lattice.py +0 -86
  456. package/tests/py/unit/test_reciprocal_paths.py +0 -64
  457. package/tests/py/unit/test_symmetry_points.py +0 -151
  458. package/tests/py/unit/test_tools_analyze.py +0 -219
  459. package/tests/py/unit/test_tools_analyze_basis.py +0 -105
  460. package/tests/py/unit/test_tools_analyze_interface.py +0 -223
  461. package/tests/py/unit/test_tools_analyze_interface_material.py +0 -63
  462. package/tests/py/unit/test_tools_analyze_interface_zsl.py +0 -187
  463. package/tests/py/unit/test_tools_analyze_lattice.py +0 -74
  464. package/tests/py/unit/test_tools_analyze_swap.py +0 -80
  465. package/tests/py/unit/test_tools_build.py +0 -158
  466. package/tests/py/unit/test_tools_build_defect/__init__.py +0 -0
  467. package/tests/py/unit/test_tools_build_defect/test_adatom.py +0 -84
  468. package/tests/py/unit/test_tools_build_defect/test_island.py +0 -45
  469. package/tests/py/unit/test_tools_build_defect/test_pair_defect.py +0 -84
  470. package/tests/py/unit/test_tools_build_defect/test_point_defect.py +0 -196
  471. package/tests/py/unit/test_tools_build_defect/test_slab_stack.py +0 -30
  472. package/tests/py/unit/test_tools_build_defect/test_solid_solution.py +0 -90
  473. package/tests/py/unit/test_tools_build_defect/test_terrace.py +0 -44
  474. package/tests/py/unit/test_tools_build_grain_boundary.py +0 -133
  475. package/tests/py/unit/test_tools_build_heterostructure.py +0 -46
  476. package/tests/py/unit/test_tools_build_interface.py +0 -292
  477. package/tests/py/unit/test_tools_build_interface_zsl.py +0 -263
  478. package/tests/py/unit/test_tools_build_maxwell_disorder.py +0 -123
  479. package/tests/py/unit/test_tools_build_metadata.py +0 -79
  480. package/tests/py/unit/test_tools_build_monolayer.py +0 -33
  481. package/tests/py/unit/test_tools_build_nanoparticle.py +0 -42
  482. package/tests/py/unit/test_tools_build_nanoribbon.py +0 -45
  483. package/tests/py/unit/test_tools_build_passivation.py +0 -85
  484. package/tests/py/unit/test_tools_build_perturbation.py +0 -103
  485. package/tests/py/unit/test_tools_build_slab.py +0 -382
  486. package/tests/py/unit/test_tools_build_strain.py +0 -36
  487. package/tests/py/unit/test_tools_build_supercell.py +0 -47
  488. package/tests/py/unit/test_tools_calculate.py +0 -67
  489. package/tests/py/unit/test_tools_convert.py +0 -174
  490. package/tests/py/unit/test_tools_modify.py +0 -248
  491. package/tests/py/unit/utils.py +0 -142
  492. package/tsconfig-transpile.json +0 -3
  493. package/tsconfig.json +0 -3
@@ -1,32 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Generic, Type, TypeVar
4
-
5
- from ..build_components.metadata import BuildMetadata, MaterialWithBuildMetadata
6
- from . import BaseMaterialAnalyzer
7
-
8
- TypeConfiguration = TypeVar("TypeConfiguration")
9
- TypeBuildParameters = TypeVar("TypeBuildParameters")
10
-
11
-
12
- class BuildMetadataAnalyzer(BaseMaterialAnalyzer, Generic[TypeConfiguration, TypeBuildParameters]):
13
- material: MaterialWithBuildMetadata
14
- configuration_cls: Type[TypeConfiguration]
15
- build_parameters_cls: Type[TypeBuildParameters]
16
-
17
- @property
18
- def build_metadata(self) -> BuildMetadata:
19
- if not self.material.metadata.build:
20
- raise ValueError("No metadata.build on the material.")
21
- metadata = self.material.metadata.get_build_metadata_of_type(self.configuration_cls.__name__)
22
- if not metadata:
23
- raise ValueError(f"Build metadata for {self.configuration_cls.__name__} not found.")
24
- return metadata
25
-
26
- @property
27
- def build_configuration(self) -> TypeConfiguration:
28
- return self.configuration_cls(**self.build_metadata.configuration)
29
-
30
- @property
31
- def build_parameters(self) -> TypeBuildParameters:
32
- return self.build_parameters_cls(**self.build_metadata.build_parameters)
@@ -1,31 +0,0 @@
1
- from typing import Dict, Type
2
-
3
- from ..build_components.metadata import MaterialWithBuildMetadata
4
- from .build_metadata_analyzer import BuildMetadataAnalyzer
5
- from .interface_material import (
6
- InterfaceMaterialAnalyzer,
7
- )
8
- from .slab import SlabMaterialAnalyzer
9
-
10
- BUILD_METADATA_ANALYZER_REGISTRY: Dict[str, Type[BuildMetadataAnalyzer]] = {
11
- "SlabConfiguration": SlabMaterialAnalyzer,
12
- "InterfaceConfiguration": InterfaceMaterialAnalyzer,
13
- }
14
-
15
-
16
- def create_build_metadata_analyzer(
17
- material: MaterialWithBuildMetadata,
18
- **analyzer_kwargs,
19
- ) -> BuildMetadataAnalyzer:
20
- build_metadata = material.metadata.get_latest_build_metadata()
21
- configuration_type = build_metadata.configuration.get("type")
22
- if not configuration_type:
23
- raise ValueError("Latest build step has no configuration type.")
24
- analyzer_cls = BUILD_METADATA_ANALYZER_REGISTRY.get(configuration_type)
25
- if analyzer_cls is None:
26
- registered_types = ", ".join(sorted(BUILD_METADATA_ANALYZER_REGISTRY))
27
- raise ValueError(
28
- f"No build metadata analyzer registered for '{configuration_type}'. "
29
- f"Registered types: {registered_types}."
30
- )
31
- return analyzer_cls(material=material, **analyzer_kwargs)
@@ -1,56 +0,0 @@
1
- from typing import List, Optional
2
-
3
- from mat3ra.made.material import Material
4
-
5
- from ..convert import to_pymatgen
6
- from ..third_party import PymatgenVoronoiNN
7
-
8
-
9
- def get_voronoi_nearest_neighbors_atom_indices(
10
- material: Material,
11
- coordinate: Optional[List[float]] = None,
12
- tolerance: float = 0.1,
13
- cutoff: float = 13.0,
14
- ) -> Optional[List[int]]:
15
- """
16
- Returns the indices of direct neighboring atoms to a specified position in the material using Voronoi tessellation.
17
-
18
- Args:
19
- material (Material): The material object to find neighbors in.
20
- coordinate (List[float]): The position to find neighbors for.
21
- tolerance (float): tolerance parameter for near-neighbor finding. Faces that are smaller than tol fraction
22
- of the largest face are not included in the tessellation. (default: 0.1).
23
- as per: https://pymatgen.org/pymatgen.analysis.html#pymatgen.analysis.local_env.VoronoiNN
24
- cutoff (float): The cutoff radius for identifying neighbors, in angstroms.
25
-
26
- Returns:
27
- List[int]: A list of indices of neighboring atoms, or an empty list if no neighbors are found.
28
- """
29
- if coordinate is None:
30
- coordinate = [0, 0, 0]
31
- structure = to_pymatgen(material)
32
- voronoi_nn = PymatgenVoronoiNN(
33
- tol=tolerance,
34
- cutoff=cutoff,
35
- weight="solid_angle",
36
- extra_nn_info=False,
37
- compute_adj_neighbors=True,
38
- )
39
- coordinates = material.basis.coordinates
40
- site_index = coordinates.get_element_id_by_value(coordinate)
41
- remove_dummy_atom = False
42
- if site_index is None:
43
- structure.append("X", coordinate, validate_proximity=False)
44
- site_index = len(structure.sites) - 1
45
- remove_dummy_atom = True
46
- try:
47
- neighbors = voronoi_nn.get_nn_info(structure, site_index)
48
- except ValueError:
49
- return None
50
- neighboring_atoms_pymatgen_ids = [n["site_index"] for n in neighbors]
51
- if remove_dummy_atom:
52
- structure.remove_sites([-1])
53
-
54
- all_coordinates = material.basis.coordinates
55
- all_coordinates.filter_by_indices(neighboring_atoms_pymatgen_ids)
56
- return all_coordinates.ids
@@ -1,35 +0,0 @@
1
- from typing import List
2
-
3
- from mat3ra.made.material import Material
4
- from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab.builder import SlabBuilder
5
-
6
- from ...build_components.entities.reusable.two_dimensional.slab_stack.helpers import (
7
- recreate_slab_with_fractional_layers,
8
- )
9
- from ...build_components.metadata import MaterialWithBuildMetadata
10
- from .adatom_material_analyzer import AdatomMaterialAnalyzer
11
- from .crystal_site_analyzer import CrystalSiteAnalyzer
12
-
13
-
14
- class AdatomCrystalSiteMaterialAnalyzer(AdatomMaterialAnalyzer):
15
- DEFAULT_NUMBER_OF_LAYERS: float = 1
16
-
17
- @property
18
- def added_component_prototype(self) -> Material:
19
- # Recreate the slab with a single layer to ensure the adatom is placed correctly
20
- return recreate_slab_with_fractional_layers(self.material, self.DEFAULT_NUMBER_OF_LAYERS)
21
-
22
- @property
23
- def coordinate_in_added_component(self) -> List[float]:
24
- approximate_coordinate_3d = super().coordinate_in_added_component
25
- crystal_site_analyzer = CrystalSiteAnalyzer(
26
- material=self.added_component_prototype,
27
- coordinate=approximate_coordinate_3d,
28
- )
29
- return crystal_site_analyzer.closest_site_coordinate
30
-
31
- @property
32
- def slab_material_or_configuration_for_stacking(self) -> MaterialWithBuildMetadata:
33
- config = self.slab_configuration_with_no_vacuum
34
- params = self.build_parameters
35
- return SlabBuilder(build_parameters=params).get_material(config)
@@ -1,49 +0,0 @@
1
- from typing import List
2
-
3
- from mat3ra.esse.models.materials_category_components.entities.core.zero_dimensional.atom import AtomSchema
4
-
5
- from ...build_components.entities.core.two_dimensional.vacuum.builder import VacuumBuilder
6
- from ...build_components.entities.core.two_dimensional.vacuum.configuration import VacuumConfiguration
7
- from ...build_components.entities.core.zero_dimensional.atom.builder import AtomAtCoordinateBuilder
8
- from ...build_components.entities.core.zero_dimensional.atom.configuration import AtomAtCoordinateConfiguration
9
- from ...build_components.metadata import MaterialWithBuildMetadata
10
- from ..slab import SlabMaterialAnalyzer
11
-
12
-
13
- class AdatomMaterialAnalyzer(SlabMaterialAnalyzer):
14
- distance_z: float
15
- coordinate_2d: List[float] # Add coordinate property
16
- element: str
17
-
18
- @property
19
- def added_component_height(self) -> float:
20
- return self.layer_thickness
21
-
22
- @property
23
- def added_component_prototype(self) -> MaterialWithBuildMetadata:
24
- vacuum_configuration = VacuumConfiguration(crystal=self.material, size=self.added_component_height)
25
- vacuum_material = VacuumBuilder().get_material(vacuum_configuration)
26
- return vacuum_material
27
-
28
- @property
29
- def coordinate_in_added_component(self) -> List[float]:
30
- coordinate_3d = self.coordinate_2d + [0]
31
- coordinate_3d_cartesian = self.material.basis.cell.convert_point_to_cartesian(coordinate_3d)
32
- coordinate_3d_cartesian[2] = self.distance_z
33
- coordinate_3d_crystal = self.added_component_prototype.basis.cell.convert_point_to_crystal(
34
- coordinate_3d_cartesian
35
- )
36
- return coordinate_3d_crystal
37
-
38
- @property
39
- def added_component(self) -> MaterialWithBuildMetadata:
40
- atom_configuration = AtomAtCoordinateConfiguration(
41
- crystal=self.added_component_prototype,
42
- element=AtomSchema(chemical_element=self.element),
43
- coordinate=self.coordinate_in_added_component,
44
- )
45
- return AtomAtCoordinateBuilder().get_material(atom_configuration)
46
-
47
- @property
48
- def slab_material_or_configuration_for_stacking(self) -> MaterialWithBuildMetadata:
49
- return self._slab_with_no_gap
@@ -1,65 +0,0 @@
1
- from typing import List
2
-
3
- from ....utils import get_center_of_coordinates
4
- from ...build_components.entities.reusable.three_dimensional.supercell.helpers import create_supercell
5
- from ...modify import filter_by_condition_on_coordinates
6
- from ...utils import transform_coordinate_to_supercell
7
- from .. import BaseMaterialAnalyzer
8
- from ..coordination import get_voronoi_nearest_neighbors_atom_indices
9
- from ..other import get_closest_site_id_from_coordinate
10
-
11
-
12
- class CrystalSiteAnalyzer(BaseMaterialAnalyzer):
13
- coordinate: List[float] = [0.0, 0.0, 0.0]
14
-
15
- @property
16
- def exact_coordinate(self) -> List[float]:
17
- return self.coordinate
18
-
19
- @property
20
- def closest_site_coordinate(self) -> List[float]:
21
- site_id = get_closest_site_id_from_coordinate(self.material, self.coordinate)
22
- return self.material.coordinates_array[site_id]
23
-
24
- def get_equidistant_coordinate(self, coordinate=None) -> List[float]:
25
- """
26
- Compute a coordinate that is equidistant from the nearest atoms to the target coordinate. Useful for adatom.
27
-
28
- This method works by:
29
- 1. Creating a 3x3x1 supercell of the original material to include atoms in PBC.
30
- 2. Transforming the target coordinate into the supercell's coordinate system.
31
- 3. Using Voronoi tessellation to find the indices of the nearest atoms in the supercell.
32
- 4. Taking the geometric center (average) of these neighboring atoms' coordinates as the equidistant point.
33
- 5. Setting the z-coordinate to the original value (useful for 2D/slab systems).
34
- 6. Transforming the equidistant coordinate back to the original cell's coordinate system.
35
-
36
- The [3, 3, 1] supercell ensures robust neighbor search in x and y, but not in z (for 2D/slab systems).
37
- """
38
- if coordinate is None:
39
- coordinate = self.coordinate
40
- scaling_factor = [3, 3, 1]
41
- translation_vector = [1 / 3, 1 / 3, 0]
42
- supercell_material = create_supercell(self.material, scaling_factor=scaling_factor)
43
-
44
- coordinate_in_supercell = transform_coordinate_to_supercell(
45
- coordinate=coordinate, scaling_factor=scaling_factor, translation_vector=translation_vector
46
- )
47
-
48
- neighboring_atoms_ids_in_supercell = get_voronoi_nearest_neighbors_atom_indices(
49
- material=supercell_material, coordinate=coordinate_in_supercell
50
- )
51
-
52
- if neighboring_atoms_ids_in_supercell is None:
53
- raise ValueError("No neighboring atoms found for equidistant calculation.")
54
-
55
- # Filter out atoms that are too close to the z boundaries of the supercell
56
- supercell_material = filter_by_condition_on_coordinates(supercell_material, lambda c: 1e-2 < c[2] < 1 - 1e-2)
57
- isolated_neighboring_atoms_basis = supercell_material.basis.model_copy()
58
- isolated_neighboring_atoms_basis.coordinates.filter_by_ids(neighboring_atoms_ids_in_supercell)
59
- equidistant_coordinate_in_supercell = get_center_of_coordinates(
60
- isolated_neighboring_atoms_basis.coordinates.values
61
- )
62
-
63
- return transform_coordinate_to_supercell(
64
- equidistant_coordinate_in_supercell, scaling_factor, translation_vector, reverse=True
65
- )
@@ -1,47 +0,0 @@
1
- from typing import List
2
-
3
- from ...convert import to_pymatgen
4
- from ...third_party import PymatgenVoronoiInterstitialGenerator
5
- from ...utils import get_distance_between_coordinates
6
- from .crystal_site_analyzer import CrystalSiteAnalyzer
7
-
8
-
9
- class VoronoiCrystalSiteAnalyzer(CrystalSiteAnalyzer):
10
- """
11
- Attributes:
12
- clustering_tol: Tolerance for clustering the Voronoi nodes.
13
- min_dist: Minimum distance between an interstitial and the nearest atom.
14
- ltol: Tolerance for lattice matching.
15
- stol: Tolerance for structure matching.
16
- angle_tol: Angle tolerance for structure matching.
17
- """
18
-
19
- clustering_tol: float = 0.5
20
- min_dist: float = 0.9
21
- ltol: float = 0.2
22
- stol: float = 0.3
23
- angle_tol: float = 5
24
-
25
- @property
26
- def voronoi_site_coordinate(self) -> List[float]:
27
- pymatgen_structure = to_pymatgen(self.material)
28
-
29
- voronoi_gen = PymatgenVoronoiInterstitialGenerator(
30
- clustering_tol=self.clustering_tol,
31
- min_dist=self.min_dist,
32
- ltol=self.ltol,
33
- stol=self.stol,
34
- angle_tol=self.angle_tol,
35
- )
36
-
37
- interstitials = list(voronoi_gen.generate(structure=pymatgen_structure, insert_species=["Si"]))
38
-
39
- if not interstitials:
40
- raise ValueError("No Voronoi interstitial sites found.")
41
-
42
- closest_interstitial = min(
43
- interstitials,
44
- key=lambda interstitial: get_distance_between_coordinates(interstitial.site.frac_coords, self.coordinate),
45
- )
46
-
47
- return closest_interstitial.site.frac_coords.tolist()
@@ -1,33 +0,0 @@
1
- POSSIBLE_TRANSFORMATION_MATRICES = [
2
- [[1, 0, 0], [0, 1, 0], [0, 0, 1]], # Identity - no transformation
3
- # Direct swaps: new[i] = old[j]
4
- [[0, 1, 0], [1, 0, 0], [0, 0, 1]],
5
- [[0, 0, 1], [0, 1, 0], [1, 0, 0]],
6
- [[1, 0, 0], [0, 0, 1], [0, 1, 0]],
7
- # Swaps with sign flips
8
- [[0, 0, 1], [1, 0, 0], [0, -1, 0]],
9
- [[0, 0, -1], [1, 0, 0], [0, 1, 0]],
10
- [[0, 1, 0], [0, 0, 1], [-1, 0, 0]],
11
- [[0, -1, 0], [0, 0, 1], [1, 0, 0]],
12
- # Inverted swaps
13
- [[0, -1, 0], [-1, 0, 0], [0, 0, 1]],
14
- [[0, 0, -1], [0, 1, 0], [-1, 0, 0]],
15
- [[1, 0, 0], [0, 0, -1], [0, -1, 0]],
16
- # Rotations around x-axis: -90 and +90 degrees
17
- [[1, 0, 0], [0, 0, 1], [0, -1, 0]], # -90° around x
18
- [[1, 0, 0], [0, 0, -1], [0, 1, 0]], # +90° around x
19
- # Rotations around y-axis: -90 and +90 degrees
20
- [[0, 0, -1], [0, 1, 0], [1, 0, 0]], # -90° around y
21
- [[0, 0, 1], [0, 1, 0], [-1, 0, 0]], # +90° around y
22
- # Rotations around z-axis: -90 and +90 degrees
23
- [[0, 1, 0], [-1, 0, 0], [0, 0, 1]], # -90° around z
24
- [[0, -1, 0], [1, 0, 0], [0, 0, 1]], # +90° around z
25
- # 180° rotations around axes
26
- [[1, 0, 0], [0, -1, 0], [0, 0, -1]], # 180° around x
27
- [[-1, 0, 0], [0, 1, 0], [0, 0, -1]], # 180° around y
28
- [[-1, 0, 0], [0, -1, 0], [0, 0, 1]], # 180° around z
29
- # Mirrors (reflections)
30
- [[1, 0, 0], [0, 1, 0], [0, 0, -1]], # Mirror along z
31
- [[1, 0, 0], [0, -1, 0], [0, 0, 1]], # Mirror along y
32
- [[-1, 0, 0], [0, 1, 0], [0, 0, 1]], # Mirror along x
33
- ]
@@ -1,4 +0,0 @@
1
- from mat3ra.made.tools.analyze.fingerprint.layers.layered_fingerprint_along_axis import LayeredFingerprintAlongAxis
2
- from mat3ra.made.tools.analyze.fingerprint.layers.unique_element_string_per_layer import UniqueElementStringsPerLayer
3
-
4
- __all__ = ["UniqueElementStringsPerLayer", "LayeredFingerprintAlongAxis"]
@@ -1,83 +0,0 @@
1
- from itertools import cycle, islice
2
- from typing import List
3
-
4
- from mat3ra.esse.models.core.reusable.axis_enum import AxisEnum
5
- from mat3ra.made.tools.analyze.fingerprint.layers.unique_element_string_per_layer import UniqueElementStringsPerLayer
6
- from mat3ra.utils.array import jaccard_similarity_for_strings
7
- from pydantic import BaseModel, Field
8
-
9
-
10
- class LayeredFingerprintAlongAxis(BaseModel):
11
- layers: List[UniqueElementStringsPerLayer] = Field(default_factory=list, description="List of layer fingerprints")
12
- axis: AxisEnum = Field(default=AxisEnum.z, description="Axis along which the fingerprint is computed")
13
- layer_thickness: float = Field(default=1.0, gt=0, description="Thickness of each layer in Angstroms")
14
-
15
- @property
16
- def non_empty_layers(self) -> List[UniqueElementStringsPerLayer]:
17
- return [layer for layer in self.layers if layer.elements]
18
-
19
- @property
20
- def element_sequence(self) -> List[List[str]]:
21
- return [layer.elements for layer in self.layers]
22
-
23
- def get_similarity_score(self, other: "LayeredFingerprintAlongAxis") -> float:
24
- """
25
- Calculate Jaccard similarity score between this and another fingerprint.
26
-
27
- The Jaccard similarity coefficient measures the similarity between two sets by comparing
28
- the size of their intersection to the size of their union: J(A, B) = |A ∩ B| / |A ∪ B|.
29
- In this implementation, we compare the sets of chemical elements in corresponding layers
30
- between two fingerprints. For example, if layer 1 contains {Si, O} and the corresponding
31
- layer contains {Si, Ge}, the Jaccard score is 1/3 (one common element divided by three
32
- unique elements total). The final score is the average across all layers, providing a
33
- measure of compositional similarity along the axis (0.0 = completely different,
34
- 1.0 = identical composition in all layers).
35
-
36
- Args:
37
- other: Another LayeredFingerprintAlongAxis to compare with
38
-
39
- Returns:
40
- float: Average Jaccard similarity score (0.0 to 1.0). Returns 0.0 if the number of layers doesn't match.
41
- """
42
- if not self.layers or not other.layers:
43
- return 0.0
44
- if len(self.layers) != len(other.layers):
45
- return 0.0
46
-
47
- seq1, seq2 = self.element_sequence, other.element_sequence
48
- return sum(jaccard_similarity_for_strings(a, b) for a, b in zip(seq1, seq2)) / len(seq1)
49
-
50
- def get_similarity_score_ignore_periodicity(self, other: "LayeredFingerprintAlongAxis") -> float:
51
- """
52
- Calculate Jaccard similarity score ignoring periodicity differences.
53
-
54
- Handles cases where one fingerprint is a periodic repetition of another.
55
- For example, if self has 6 layers and other has 2 layers, this method checks if
56
- self.layers is a 3× repetition of other.layers (i.e., layers 0–1 match other,
57
- layers 2–3 match other, etc.).
58
-
59
- Args:
60
- other: Another LayeredFingerprintAlongAxis to compare with
61
-
62
- Returns:
63
- float: Average Jaccard similarity score (0.0 to 1.0). Returns 0.0 if the number
64
- of layers is not a multiple relationship or if fingerprints don't match.
65
- """
66
- if not self.layers or not other.layers:
67
- return 0.0
68
-
69
- len_a, len_b = len(self.layers), len(other.layers)
70
- if len_a == len_b:
71
- return self.get_similarity_score(other)
72
-
73
- # Identify shorter/longer and ensure multiplicity
74
- if len_a < len_b:
75
- short_seq, long_seq = self.element_sequence, other.element_sequence
76
- else:
77
- short_seq, long_seq = other.element_sequence, self.element_sequence
78
-
79
- if len(long_seq) % len(short_seq) != 0:
80
- return 0.0
81
-
82
- cycled_short = islice(cycle(short_seq), len(long_seq))
83
- return sum(jaccard_similarity_for_strings(a, b) for a, b in zip(cycled_short, long_seq)) / len(short_seq)
@@ -1,9 +0,0 @@
1
- from typing import List
2
-
3
- from pydantic import BaseModel, Field
4
-
5
-
6
- class UniqueElementStringsPerLayer(BaseModel):
7
- min_coord: float = Field(..., description="Minimum coordinate value for the layer")
8
- max_coord: float = Field(..., description="Maximum coordinate value for the layer")
9
- elements: List[str] = Field(default_factory=list, description="Sorted unique chemical elements in the layer")
@@ -1,20 +0,0 @@
1
- from .commensurate import CommensurateLatticeInterfaceAnalyzer, CommensurateLatticeMatchHolder
2
- from .grain_boundary import GrainBoundaryPlanarAnalyzer, GrainBoundaryPlanarMatchHolder
3
- from .simple import InterfaceAnalyzer
4
- from .twisted_nanoribbons import TwistedNanoribbonsInterfaceAnalyzer
5
- from .utils import calculate_interfacial_distance_from_rdf
6
- from .utils.holders import MatchedSubstrateFilmConfigurationHolder
7
- from .zsl import ZSLInterfaceAnalyzer, ZSLMatchHolder
8
-
9
- __all__ = [
10
- "InterfaceAnalyzer",
11
- "ZSLInterfaceAnalyzer",
12
- "ZSLMatchHolder",
13
- "CommensurateLatticeInterfaceAnalyzer",
14
- "CommensurateLatticeMatchHolder",
15
- "GrainBoundaryPlanarAnalyzer",
16
- "GrainBoundaryPlanarMatchHolder",
17
- "TwistedNanoribbonsInterfaceAnalyzer",
18
- "MatchedSubstrateFilmConfigurationHolder",
19
- "calculate_interfacial_distance_from_rdf",
20
- ]
@@ -1,156 +0,0 @@
1
- from functools import cached_property
2
- from typing import List, Optional
3
-
4
- import numpy as np
5
- from mat3ra.code.entity import InMemoryEntityPydantic
6
- from mat3ra.esse.models.materials_category_components.entities.auxiliary.two_dimensional.supercell_matrix_2d import (
7
- SupercellMatrix2DSchema,
8
- )
9
- from mat3ra.made.lattice import Lattice
10
- from mat3ra.made.material import Material
11
- from pydantic import model_validator
12
-
13
- from ....utils import create_2d_supercell_matrices, get_angle_from_rotation_matrix_2d
14
- from .enums import angle_to_supercell_matrix_values_for_hex
15
- from .simple import InterfaceAnalyzer
16
- from .utils.holders import MatchedSubstrateFilmConfigurationHolder
17
-
18
-
19
- class CommensurateLatticeMatchHolder(InMemoryEntityPydantic):
20
- match_id: int
21
- angle: float
22
- actual_angle: float
23
- xy_supercell_matrix_film: List[List[int]]
24
- xy_supercell_matrix_substrate: List[List[int]]
25
-
26
-
27
- class CommensurateLatticeInterfaceAnalyzer(InterfaceAnalyzer):
28
- """
29
- Interface analyzer using commensurate lattice matching for commensurate lattice interfaces.
30
-
31
- For commensurate lattice bilayer materials where film and substrate are the same material,
32
- this analyzer finds commensurate supercells at a target twist angle.
33
-
34
- Attributes:
35
- target_angle (float): The target twist angle, in degrees.
36
- angle_tolerance (float): Tolerance for matching angles, in degrees.
37
- max_supercell_matrix_int (Optional[int]): Maximum integer for supercell matrix elements.
38
- limit_max_int (int): Limit for maximum integer to search for supercell matrices.
39
- return_first_match (bool): If True, returns only the first match found (to speed up the process).
40
-
41
- This class generates strained configurations for both substrate and film based on the commensurate matches found.
42
-
43
- """
44
-
45
- target_angle: float = 0.0
46
- angle_tolerance: float = 0.1
47
- max_supercell_matrix_int: Optional[int] = None
48
- limit_max_int: int = 50
49
- return_first_match: bool = True
50
-
51
- @model_validator(mode="before")
52
- def _handle_missing_substrate_or_film(cls, values):
53
- substrate = values.get("substrate_slab_configuration")
54
- film = values.get("film_slab_configuration")
55
- if substrate and not film:
56
- values["film_slab_configuration"] = substrate
57
- elif film and not substrate:
58
- values["substrate_slab_configuration"] = film
59
- return values
60
-
61
- @property
62
- def material(self) -> Material:
63
- return self.substrate_material
64
-
65
- def _get_initial_guess_for_max_int(self, material: Material, target_angle: float) -> int:
66
- if material.lattice.type == Lattice.__types__.HEX:
67
- xy_supercell_matrix_for_closest_angle = min(
68
- angle_to_supercell_matrix_values_for_hex, key=lambda x: abs(x["angle"] - target_angle)
69
- )
70
- return max(abs(x) for row in xy_supercell_matrix_for_closest_angle["xy_supercell"] for x in row)
71
- return 1
72
-
73
- def _generate_commensurate_lattices(
74
- self,
75
- material: Material,
76
- target_angle: float,
77
- max_supercell_matrix_element_int: int,
78
- ) -> List[CommensurateLatticeMatchHolder]:
79
- a = material.lattice.vector_arrays[0][:2]
80
- b = material.lattice.vector_arrays[1][:2]
81
-
82
- matrices = create_2d_supercell_matrices(max_supercell_matrix_element_int)
83
- matrix_ab = np.array([a, b])
84
- matrix_ab_inverse = np.linalg.inv(matrix_ab)
85
-
86
- solutions: List[CommensurateLatticeMatchHolder] = []
87
- match_id = 0
88
-
89
- for index1, matrix1 in enumerate(matrices):
90
- for index2, matrix2 in enumerate(matrices[0 : index1 + 1]):
91
- matrix2_inverse = np.linalg.inv(matrix2)
92
- intermediate_product = matrix2_inverse @ matrix1
93
- product = matrix_ab_inverse @ intermediate_product @ matrix_ab
94
- angle = get_angle_from_rotation_matrix_2d(product)
95
-
96
- if angle is not None and np.abs(angle - target_angle) < self.angle_tolerance:
97
- solutions.append(
98
- CommensurateLatticeMatchHolder(
99
- match_id=match_id,
100
- angle=angle,
101
- actual_angle=angle,
102
- xy_supercell_matrix_substrate=matrix1.tolist(),
103
- xy_supercell_matrix_film=matrix2.tolist(),
104
- )
105
- )
106
- match_id += 1
107
-
108
- if self.return_first_match:
109
- return solutions
110
-
111
- return solutions
112
-
113
- @cached_property
114
- def commensurate_lattice_match_holders(self) -> List[CommensurateLatticeMatchHolder]:
115
- max_int = self.max_supercell_matrix_int or self._get_initial_guess_for_max_int(self.material, self.target_angle)
116
-
117
- commensurate_lattice_matches: List[CommensurateLatticeMatchHolder] = []
118
-
119
- while not commensurate_lattice_matches and max_int < self.limit_max_int:
120
- commensurate_lattice_matches = self._generate_commensurate_lattices(
121
- self.material, self.target_angle, max_int
122
- )
123
- max_int += 1
124
-
125
- return commensurate_lattice_matches
126
-
127
- def get_strained_configuration_by_match_id(self, match_id: int) -> MatchedSubstrateFilmConfigurationHolder:
128
- match_holders = self.commensurate_lattice_match_holders
129
- if match_id < 0 or match_id >= len(match_holders):
130
- raise ValueError(f"Match ID {match_id} out of range. Available IDs: 0-{len(match_holders)-1}")
131
-
132
- match_holder = match_holders[match_id]
133
- return self._create_strained_configs_from_match(match_holder)
134
-
135
- def _create_strained_configs_from_match(
136
- self, match_holder: CommensurateLatticeMatchHolder
137
- ) -> MatchedSubstrateFilmConfigurationHolder:
138
- substrate_matrix_schema = SupercellMatrix2DSchema(root=match_holder.xy_supercell_matrix_substrate)
139
- film_matrix_schema = SupercellMatrix2DSchema(root=match_holder.xy_supercell_matrix_film)
140
-
141
- return self.create_matched_configuration_holder(
142
- self.substrate_slab_configuration,
143
- self.film_slab_configuration,
144
- match_id=match_holder.match_id,
145
- substrate_xy_supercell_matrix=substrate_matrix_schema,
146
- film_xy_supercell_matrix=film_matrix_schema,
147
- )
148
-
149
- def get_strained_configurations(self) -> List[MatchedSubstrateFilmConfigurationHolder]:
150
- strained_configs = []
151
-
152
- for match_holder in self.commensurate_lattice_match_holders:
153
- config_holder = self._create_strained_configs_from_match(match_holder)
154
- strained_configs.append(config_holder)
155
-
156
- return strained_configs