@mat3ra/made 2026.8.7-0 → 2026.8.18-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.
- package/dist/js/Material.d.ts +219 -0
- package/dist/js/Material.js +457 -0
- package/dist/js/basis/basis.d.ts +14 -9
- package/dist/js/basis/basis.js +15 -13
- package/dist/js/basis/constrained_basis.d.ts +9 -7
- package/dist/js/basis/constrained_basis.js +4 -4
- package/dist/js/generated/MaterialSchemaMixin.d.ts +5 -0
- package/dist/js/generated/MaterialSchemaMixin.js +69 -0
- package/dist/js/lattice/lattice.d.ts +4 -3
- package/dist/js/lattice/lattice.js +1 -2
- package/dist/js/made.d.ts +12 -12
- package/dist/js/made.js +38 -5
- package/dist/js/parsers/espresso.d.ts +2 -3
- package/dist/js/parsers/espresso.js +0 -1
- package/dist/js/parsers/native_format_parsers.d.ts +9 -8
- package/dist/js/parsers/native_format_parsers.js +6 -6
- package/dist/js/parsers/parsers.d.ts +6 -6
- package/dist/js/parsers/poscar.d.ts +5 -4
- package/dist/js/parsers/poscar.js +3 -2
- package/dist/js/parsers/xyz.d.ts +3 -5
- package/dist/js/parsers/xyz.js +3 -4
- package/dist/js/parsers/xyz_combinatorial_basis.js +3 -1
- package/dist/js/tools/basis.d.ts +1 -1
- package/dist/js/tools/index.d.ts +7 -7
- package/dist/js/tools/material.d.ts +1 -1
- package/dist/js/tools/material.js +8 -7
- package/dist/js/tools/supercell.d.ts +4 -5
- package/dist/js/tools/supercell.js +2 -4
- package/dist/js/tools/surface.d.ts +4 -4
- package/dist/js/tools/surface.js +2 -7
- package/package.json +12 -8
- package/.babelrc +0 -10
- package/.eslintrc.json +0 -11
- package/.gitattributes +0 -1
- package/.husky/post-checkout +0 -3
- package/.husky/post-commit +0 -3
- package/.husky/post-merge +0 -3
- package/.husky/pre-commit +0 -6
- package/.husky/pre-push +0 -3
- package/.mocharc.json +0 -5
- package/.pre-commit-config.yaml +0 -26
- package/.prettierignore +0 -2
- package/.prettierrc +0 -6
- package/AGENTS.md +0 -133
- package/MANIFEST.in +0 -1
- package/data/constants.json +0 -13
- package/data/reciprocal_paths.json +0 -111
- package/dist/js/material.d.ts +0 -169
- package/dist/js/material.js +0 -362
- package/images/made/tools/tools_diagram_general.png +0 -3
- package/images/made/tools/tools_diagram_interface.png +0 -3
- package/pyproject.toml +0 -123
- package/src/__init__.py +0 -0
- package/src/js/basis/basis.ts +0 -621
- package/src/js/basis/constrained_basis.ts +0 -114
- package/src/js/basis/coordinates.ts +0 -93
- package/src/js/basis/elements.ts +0 -24
- package/src/js/basis/helpers.ts +0 -20
- package/src/js/basis/labels.ts +0 -6
- package/src/js/cell/cell.ts +0 -150
- package/src/js/cell/conventional_cell.ts +0 -86
- package/src/js/cell/primitive_cell.ts +0 -166
- package/src/js/constants/molecule.ts +0 -18
- package/src/js/constants.ts +0 -4
- package/src/js/constraints/constraints.ts +0 -45
- package/src/js/lattice/lattice.ts +0 -306
- package/src/js/lattice/lattice_types.ts +0 -134
- package/src/js/lattice/reciprocal/lattice_reciprocal.ts +0 -193
- package/src/js/lattice/reciprocal/paths.ts +0 -39
- package/src/js/lattice/reciprocal/symmetry_points.ts +0 -886
- package/src/js/lattice/unit_cell.ts +0 -66
- package/src/js/made.ts +0 -62
- package/src/js/material.ts +0 -458
- package/src/js/parsers/cif.ts +0 -25
- package/src/js/parsers/errors.ts +0 -6
- package/src/js/parsers/espresso.ts +0 -30
- package/src/js/parsers/native_format_parsers.ts +0 -51
- package/src/js/parsers/parsers.ts +0 -13
- package/src/js/parsers/poscar.ts +0 -212
- package/src/js/parsers/xyz.ts +0 -187
- package/src/js/parsers/xyz_combinatorial_basis.ts +0 -265
- package/src/js/tools/basis.ts +0 -132
- package/src/js/tools/cell.ts +0 -41
- package/src/js/tools/index.ts +0 -11
- package/src/js/tools/material.ts +0 -62
- package/src/js/tools/supercell.ts +0 -88
- package/src/js/tools/surface.ts +0 -223
- package/src/py/__init__.py +0 -0
- package/src/py/mat3ra/__init__.py +0 -1
- package/src/py/mat3ra/made/__init__.py +0 -7
- package/src/py/mat3ra/made/basis/__init__.py +0 -255
- package/src/py/mat3ra/made/basis/coordinates.py +0 -43
- package/src/py/mat3ra/made/cell/__init__.py +0 -55
- package/src/py/mat3ra/made/cell/primitive_cell.py +0 -156
- package/src/py/mat3ra/made/data_helper.py +0 -5
- package/src/py/mat3ra/made/lattice.py +0 -195
- package/src/py/mat3ra/made/material.py +0 -134
- package/src/py/mat3ra/made/metadata.py +0 -45
- package/src/py/mat3ra/made/reciprocal/__init__.py +0 -5
- package/src/py/mat3ra/made/reciprocal/lattice_reciprocal.py +0 -147
- package/src/py/mat3ra/made/reciprocal/paths.py +0 -30
- package/src/py/mat3ra/made/reciprocal/symmetry_points.py +0 -385
- package/src/py/mat3ra/made/tools/README.md +0 -173
- package/src/py/mat3ra/made/tools/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/__init__.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/basis/__init__.py +0 -3
- package/src/py/mat3ra/made/tools/analyze/basis/analyzer.py +0 -50
- package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer.py +0 -32
- package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer_factory.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/coordination.py +0 -56
- package/src/py/mat3ra/made/tools/analyze/crystal_site/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_crystal_site_material_analyzer.py +0 -35
- package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_material_analyzer.py +0 -49
- package/src/py/mat3ra/made/tools/analyze/crystal_site/crystal_site_analyzer.py +0 -65
- package/src/py/mat3ra/made/tools/analyze/crystal_site/voronoi_crystal_site_analyzer.py +0 -47
- package/src/py/mat3ra/made/tools/analyze/enums.py +0 -33
- package/src/py/mat3ra/made/tools/analyze/fingerprint/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/layered_fingerprint_along_axis.py +0 -83
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/unique_element_string_per_layer.py +0 -9
- package/src/py/mat3ra/made/tools/analyze/interface/__init__.py +0 -20
- package/src/py/mat3ra/made/tools/analyze/interface/commensurate.py +0 -156
- package/src/py/mat3ra/made/tools/analyze/interface/enums.py +0 -60
- package/src/py/mat3ra/made/tools/analyze/interface/grain_boundary.py +0 -80
- package/src/py/mat3ra/made/tools/analyze/interface/simple.py +0 -251
- package/src/py/mat3ra/made/tools/analyze/interface/twisted_nanoribbons.py +0 -91
- package/src/py/mat3ra/made/tools/analyze/interface/utils/__init__.py +0 -77
- package/src/py/mat3ra/made/tools/analyze/interface/utils/holders.py +0 -14
- package/src/py/mat3ra/made/tools/analyze/interface/utils/vector.py +0 -56
- package/src/py/mat3ra/made/tools/analyze/interface/zsl.py +0 -259
- package/src/py/mat3ra/made/tools/analyze/interface_material.py +0 -45
- package/src/py/mat3ra/made/tools/analyze/lattice/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/analyze/lattice/analyzer.py +0 -126
- package/src/py/mat3ra/made/tools/analyze/lattice/helpers.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/lattice_lines.py +0 -30
- package/src/py/mat3ra/made/tools/analyze/lattice_planes.py +0 -192
- package/src/py/mat3ra/made/tools/analyze/lattice_swap_analyzer.py +0 -105
- package/src/py/mat3ra/made/tools/analyze/material.py +0 -276
- package/src/py/mat3ra/made/tools/analyze/other.py +0 -434
- package/src/py/mat3ra/made/tools/analyze/rdf.py +0 -74
- package/src/py/mat3ra/made/tools/analyze/slab.py +0 -76
- package/src/py/mat3ra/made/tools/analyze/solid_solution_analyzer.py +0 -171
- package/src/py/mat3ra/made/tools/analyze/terrace.py +0 -105
- package/src/py/mat3ra/made/tools/analyze/utils.py +0 -162
- package/src/py/mat3ra/made/tools/bond_directions/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions.py +0 -150
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_for_element_list.py +0 -7
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_enum.py +0 -8
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_for_element.py +0 -16
- package/src/py/mat3ra/made/tools/build/__init__.py +0 -25
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/helpers.py +0 -59
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/types.py +0 -26
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/utils.py +0 -139
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/__init__.py +0 -47
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/__init__.py +0 -11
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/builder.py +0 -164
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/configuration.py +0 -48
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/helpers.py +0 -134
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/helpers.py +0 -157
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/enums.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/configuration.py +0 -13
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/helpers.py +0 -70
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/utils.py +0 -87
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/helpers.py +0 -129
- package/src/py/mat3ra/made/tools/build/defective_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/build_parameters.py +0 -12
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/builder.py +0 -17
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/configuration.py +0 -40
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/helpers.py +0 -82
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/__init__.py +0 -1
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/builder.py +0 -37
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/configuration.py +0 -30
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/enums.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/helpers.py +0 -76
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/builder.py +0 -11
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/configuration.py +0 -18
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/helpers.py +0 -137
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/types.py +0 -22
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/builder.py +0 -28
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/configuration.py +0 -55
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/helpers.py +0 -75
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/builder.py +0 -15
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/configuration.py +0 -16
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/helpers.py +0 -116
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/build_parameters.py +0 -10
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/builder.py +0 -30
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/configuration.py +0 -11
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/helpers.py +0 -78
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/builder.py +0 -31
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/configuration.py +0 -45
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/helpers.py +0 -80
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/__init__.py +0 -40
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/atom_placement_method_enum.py +0 -14
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/configuration.py +0 -27
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/complex_defect_type_enum.py +0 -5
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/factories.py +0 -69
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/helpers.py +0 -92
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/builder.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/configuration.py +0 -29
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/helpers.py +0 -48
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/interstitial_placement_method_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/point_defect_type_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/builder.py +0 -6
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/configuration.py +0 -41
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/helpers.py +0 -43
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/substitution_placement_method_enum.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/types.py +0 -24
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/builder.py +0 -19
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/configuration.py +0 -27
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/helpers.py +0 -42
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/vacancy_placement_method_enum.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/builder.py +0 -80
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/configurations.py +0 -22
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/helpers.py +0 -40
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/__init__.py +0 -29
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/builders.py +0 -56
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/configuration.py +0 -33
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/helpers.py +0 -76
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/__init__.py +0 -11
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/build_parameters.py +0 -9
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/builders.py +0 -83
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/configuration.py +0 -35
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/helpers.py +0 -62
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/build_parameters.py +0 -8
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/configuration.py +0 -99
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/helpers.py +0 -95
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/termination_utils.py +0 -14
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/utils.py +0 -61
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/builder.py +0 -22
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/configuration.py +0 -17
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/__init__.py +0 -19
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/analyzer.py +0 -86
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/builder.py +0 -54
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/enums.py +0 -42
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/helpers.py +0 -127
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/builder.py +0 -33
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/configuration.py +0 -16
- package/src/py/mat3ra/made/tools/build/processed_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/coordination_based_passivation_material_analyzer.py +0 -112
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/passivation_material_analyzer.py +0 -16
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/surface_passivation_material_analyzer.py +0 -32
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/builder.py +0 -23
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/configuration.py +0 -31
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/enums.py +0 -7
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/helpers.py +0 -151
- package/src/py/mat3ra/made/tools/build_components/__init__.py +0 -10
- package/src/py/mat3ra/made/tools/build_components/entities/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/one_dimensional/miller_indices_2d.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/miller_indices.py +0 -18
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/termination.py +0 -33
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site_list.py +0 -9
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/builder.py +0 -32
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/configuration.py +0 -14
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/builder.py +0 -29
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/builder.py +0 -48
- package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/configuration.py +0 -17
- package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/builder.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/configuration.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/__init__.py +0 -16
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_configuration_pydantic.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_single_builder.py +0 -87
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/builder.py +0 -46
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/edge_types.py +0 -51
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/helpers.py +0 -58
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/configuration.py +0 -21
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/configuration.py +0 -11
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/helpers.py +0 -38
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/__init__.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/builder.py +0 -62
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/configuration.py +0 -14
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/helpers.py +0 -42
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/builder.py +0 -39
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/__init__.py +0 -10
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/builder.py +0 -36
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/configuration.py +0 -31
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/helpers.py +0 -80
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/coordinates_shape_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/metadata/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/metadata/build_metadata.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/metadata/material_build_metadata.py +0 -35
- package/src/py/mat3ra/made/tools/build_components/metadata/material_with_build_metadata.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/mixins/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_ase_atoms_mixin.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_pymatgen_structure_mixin.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/enums.py +0 -11
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/build_parameters.py +0 -18
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/builder.py +0 -93
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/configuration.py +0 -20
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/builder.py +0 -83
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/__init__.py +0 -15
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/base.py +0 -33
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/isometric.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/__init__.py +0 -13
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/atomic_mass_dependent_function_holder.py +0 -32
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/function_holder.py +0 -80
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/maxwell_boltzmann.py +0 -39
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/perturbation_function_holder.py +0 -45
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/sine_wave_perturbation_function_holder.py +0 -29
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/helpers.py +0 -83
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/__init__.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/builder.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/configuration.py +0 -23
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/helpers.py +0 -49
- package/src/py/mat3ra/made/tools/build_components/utils.py +0 -44
- package/src/py/mat3ra/made/tools/calculate/__init__.py +0 -149
- package/src/py/mat3ra/made/tools/calculate/ase/__init__.py +0 -133
- package/src/py/mat3ra/made/tools/calculate/ase/constraints.py +0 -91
- package/src/py/mat3ra/made/tools/calculate/calculators/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator.py +0 -70
- package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator_parameters.py +0 -14
- package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator.py +0 -32
- package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator_parameters.py +0 -17
- package/src/py/mat3ra/made/tools/calculate/interaction_functions.py +0 -23
- package/src/py/mat3ra/made/tools/convert/__init__.py +0 -286
- package/src/py/mat3ra/made/tools/convert/interface_parts_enum.py +0 -9
- package/src/py/mat3ra/made/tools/convert/utils.py +0 -96
- package/src/py/mat3ra/made/tools/entities/__init__.py +0 -5
- package/src/py/mat3ra/made/tools/entities/coordinate/__init__.py +0 -14
- package/src/py/mat3ra/made/tools/entities/coordinate/box_coordinate_condition.py +0 -15
- package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_condition.py +0 -16
- package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_functions.py +0 -158
- package/src/py/mat3ra/made/tools/entities/coordinate/cylinder_coordinate_condition.py +0 -17
- package/src/py/mat3ra/made/tools/entities/coordinate/plane_coordinate_condition.py +0 -14
- package/src/py/mat3ra/made/tools/entities/coordinate/sphere_coordinate_condition.py +0 -15
- package/src/py/mat3ra/made/tools/entities/coordinate/triangular_prism_coordinate_condition.py +0 -26
- package/src/py/mat3ra/made/tools/entities/termination_holder.py +0 -12
- package/src/py/mat3ra/made/tools/helpers.py +0 -168
- package/src/py/mat3ra/made/tools/modify.py +0 -627
- package/src/py/mat3ra/made/tools/operations/core/binary.py +0 -106
- package/src/py/mat3ra/made/tools/operations/core/unary.py +0 -170
- package/src/py/mat3ra/made/tools/operations/core/utils.py +0 -138
- package/src/py/mat3ra/made/tools/operations/reusable/unary.py +0 -53
- package/src/py/mat3ra/made/tools/optimize.py +0 -55
- package/src/py/mat3ra/made/tools/third_party.py +0 -69
- package/src/py/mat3ra/made/tools/utils.py +0 -182
- package/src/py/mat3ra/made/utils.py +0 -144
- package/tests/.gitattributes +0 -1
- package/tests/fixtures/AsGe-basis.json +0 -3
- package/tests/fixtures/C2H4-translated.json +0 -3
- package/tests/fixtures/C2H4.json +0 -3
- package/tests/fixtures/FeLiSi-basis.json +0 -3
- package/tests/fixtures/FeO.json +0 -3
- package/tests/fixtures/Ge2-basis.json +0 -3
- package/tests/fixtures/Graphene.json +0 -3
- package/tests/fixtures/Graphene.poscar +0 -3
- package/tests/fixtures/H2+H-final.json +0 -3
- package/tests/fixtures/H2+H-image.json +0 -3
- package/tests/fixtures/H2+H-initial.json +0 -3
- package/tests/fixtures/H2O.poscar +0 -3
- package/tests/fixtures/LiFeSi-basis-labels.json +0 -3
- package/tests/fixtures/LiFeSi-basis.json +0 -3
- package/tests/fixtures/Na.json +0 -3
- package/tests/fixtures/Na4Cl4-cartesian.json +0 -3
- package/tests/fixtures/Na4Cl4.json +0 -3
- package/tests/fixtures/Na4Cl4.poscar +0 -3
- package/tests/fixtures/Ni-hex.json +0 -3
- package/tests/fixtures/Ni-hex.poscar +0 -3
- package/tests/fixtures/OSi-basis.json +0 -3
- package/tests/fixtures/Si-hex.poscar +0 -3
- package/tests/fixtures/Si-pwscf.in +0 -3
- package/tests/fixtures/Si-slab.json +0 -3
- package/tests/fixtures/Si-supercell.json +0 -3
- package/tests/fixtures/Si2-basis-repeated.json +0 -3
- package/tests/fixtures/Si2-basis.json +0 -3
- package/tests/fixtures/Zr1H23Zr1H1.json +0 -3
- package/tests/fixtures/Zr1H23Zr1H1.poscar +0 -3
- package/tests/fixtures/atomic-constraints.json +0 -3
- package/tests/fixtures/hashes.json +0 -3
- package/tests/fixtures/si-slab-100.json +0 -3
- package/tests/fixtures/si-slab-111-0-vacuum.json +0 -3
- package/tests/fixtures/si-slab-111-0.5-vacuum-gamma-120.json +0 -3
- package/tests/fixtures/si-slab-111-0.5-vacuum-ratio.json +0 -3
- package/tests/fixtures/si-standata.json +0 -3
- package/tests/js/basis/basis.ts +0 -247
- package/tests/js/cell/cell.ts +0 -182
- package/tests/js/cell/primitive_cell.ts +0 -21
- package/tests/js/constraints/constraints.ts +0 -11
- package/tests/js/fixtures.ts +0 -120
- package/tests/js/lattice/lattice.ts +0 -43
- package/tests/js/lattice/lattice_reciprocal.ts +0 -104
- package/tests/js/material.test.ts +0 -42
- package/tests/js/parsers/espresso.ts +0 -15
- package/tests/js/parsers/native_formats.ts +0 -35
- package/tests/js/parsers/poscar.ts +0 -89
- package/tests/js/parsers/xyz.ts +0 -33
- package/tests/js/parsers/xyz_combinatorial_basis.ts +0 -156
- package/tests/js/setup.ts +0 -6
- package/tests/js/tools/basis.ts +0 -22
- package/tests/js/tools/supercell.ts +0 -58
- package/tests/js/tools/surface.ts +0 -115
- package/tests/py/conftest.py +0 -34
- package/tests/py/mat3ra/debug_utils.py +0 -75
- package/tests/py/unit/__init__.py +0 -0
- package/tests/py/unit/fixtures/__init__.py +0 -0
- package/tests/py/unit/fixtures/adatom.py +0 -60
- package/tests/py/unit/fixtures/bulk.py +0 -162
- package/tests/py/unit/fixtures/cuts.py +0 -118
- package/tests/py/unit/fixtures/grain_boundary.py +0 -875
- package/tests/py/unit/fixtures/interface/commensurate.py +0 -498
- package/tests/py/unit/fixtures/interface/gaas_dia.py +0 -837
- package/tests/py/unit/fixtures/interface/gr_ni_111_top_hcp.py +0 -123
- package/tests/py/unit/fixtures/interface/simple.py +0 -84
- package/tests/py/unit/fixtures/interface/twisted_nanoribbons.py +0 -131
- package/tests/py/unit/fixtures/interface/zsl.py +0 -756
- package/tests/py/unit/fixtures/island.py +0 -336
- package/tests/py/unit/fixtures/merge.py +0 -147
- package/tests/py/unit/fixtures/monolayer.py +0 -46
- package/tests/py/unit/fixtures/nanoparticle.py +0 -116
- package/tests/py/unit/fixtures/nanoribbon/__init__.py +0 -0
- package/tests/py/unit/fixtures/nanoribbon/armchair.py +0 -102
- package/tests/py/unit/fixtures/nanoribbon/nanoribbon.py +0 -145
- package/tests/py/unit/fixtures/nanoribbon/zigzag.py +0 -54
- package/tests/py/unit/fixtures/pair_defects.py +0 -41
- package/tests/py/unit/fixtures/passivated/nanoribbon.py +0 -69
- package/tests/py/unit/fixtures/passivated/slab.py +0 -58
- package/tests/py/unit/fixtures/point_defects.py +0 -158
- package/tests/py/unit/fixtures/slab.py +0 -606
- package/tests/py/unit/fixtures/strain.py +0 -42
- package/tests/py/unit/fixtures/supercell.py +0 -64
- package/tests/py/unit/fixtures/terrace.py +0 -70
- package/tests/py/unit/fixtures/thrid_party/ase_atoms.py +0 -13
- package/tests/py/unit/test_analyze_lattice_planes.py +0 -131
- package/tests/py/unit/test_cell.py +0 -104
- package/tests/py/unit/test_data_files.py +0 -68
- package/tests/py/unit/test_lattice.py +0 -103
- package/tests/py/unit/test_lattice_type_extended.py +0 -53
- package/tests/py/unit/test_material.py +0 -158
- package/tests/py/unit/test_operations.py +0 -126
- package/tests/py/unit/test_primitive_cell.py +0 -118
- package/tests/py/unit/test_reciprocal_lattice.py +0 -86
- package/tests/py/unit/test_reciprocal_paths.py +0 -64
- package/tests/py/unit/test_symmetry_points.py +0 -151
- package/tests/py/unit/test_tools_analyze.py +0 -219
- package/tests/py/unit/test_tools_analyze_basis.py +0 -105
- package/tests/py/unit/test_tools_analyze_interface.py +0 -223
- package/tests/py/unit/test_tools_analyze_interface_material.py +0 -63
- package/tests/py/unit/test_tools_analyze_interface_zsl.py +0 -187
- package/tests/py/unit/test_tools_analyze_lattice.py +0 -74
- package/tests/py/unit/test_tools_analyze_swap.py +0 -80
- package/tests/py/unit/test_tools_build.py +0 -158
- package/tests/py/unit/test_tools_build_defect/__init__.py +0 -0
- package/tests/py/unit/test_tools_build_defect/test_adatom.py +0 -84
- package/tests/py/unit/test_tools_build_defect/test_island.py +0 -45
- package/tests/py/unit/test_tools_build_defect/test_pair_defect.py +0 -84
- package/tests/py/unit/test_tools_build_defect/test_point_defect.py +0 -196
- package/tests/py/unit/test_tools_build_defect/test_slab_stack.py +0 -30
- package/tests/py/unit/test_tools_build_defect/test_solid_solution.py +0 -90
- package/tests/py/unit/test_tools_build_defect/test_terrace.py +0 -44
- package/tests/py/unit/test_tools_build_grain_boundary.py +0 -133
- package/tests/py/unit/test_tools_build_heterostructure.py +0 -46
- package/tests/py/unit/test_tools_build_interface.py +0 -292
- package/tests/py/unit/test_tools_build_interface_zsl.py +0 -263
- package/tests/py/unit/test_tools_build_maxwell_disorder.py +0 -123
- package/tests/py/unit/test_tools_build_metadata.py +0 -79
- package/tests/py/unit/test_tools_build_monolayer.py +0 -33
- package/tests/py/unit/test_tools_build_nanoparticle.py +0 -42
- package/tests/py/unit/test_tools_build_nanoribbon.py +0 -45
- package/tests/py/unit/test_tools_build_passivation.py +0 -85
- package/tests/py/unit/test_tools_build_perturbation.py +0 -103
- package/tests/py/unit/test_tools_build_slab.py +0 -382
- package/tests/py/unit/test_tools_build_strain.py +0 -36
- package/tests/py/unit/test_tools_build_supercell.py +0 -47
- package/tests/py/unit/test_tools_calculate.py +0 -67
- package/tests/py/unit/test_tools_convert.py +0 -174
- package/tests/py/unit/test_tools_modify.py +0 -248
- package/tests/py/unit/utils.py +0 -142
- package/tsconfig-transpile.json +0 -3
- package/tsconfig.json +0 -3
|
@@ -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
|
|
File without changes
|
package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_crystal_site_material_analyzer.py
DELETED
|
@@ -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"]
|
|
File without changes
|
package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/layered_fingerprint_along_axis.py
DELETED
|
@@ -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)
|
package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/unique_element_string_per_layer.py
DELETED
|
@@ -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
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
from typing import List, TypedDict
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class SupercellTypes(str, Enum):
|
|
6
|
-
hexagonal = "hexagonal"
|
|
7
|
-
orthogonal = "orthogonal"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class SupercellMatrix(TypedDict):
|
|
11
|
-
angle: float
|
|
12
|
-
xy_supercell: List[List[int]]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# Tabulation from https://github.com/qtm-iisc/Twister/blob/474156a2a59f2b9d59350b32de56864a9496f848/examples/Homobilayer_hex/hex.table
|
|
16
|
-
# Maps twist angle to supercell matrix values for homo-material hexagonal supercells bilayer
|
|
17
|
-
angle_to_supercell_matrix_values_for_hex: List[SupercellMatrix] = [
|
|
18
|
-
{"angle": 60.0, "xy_supercell": [[0, 1], [-1, 1]]},
|
|
19
|
-
{"angle": 21.7867892983, "xy_supercell": [[1, 2], [-2, 3]]},
|
|
20
|
-
{"angle": 13.1735511073, "xy_supercell": [[2, 3], [-3, 5]]},
|
|
21
|
-
{"angle": 9.4300079079, "xy_supercell": [[3, 4], [-4, 7]]},
|
|
22
|
-
{"angle": 7.34099301663, "xy_supercell": [[4, 5], [-5, 9]]},
|
|
23
|
-
{"angle": 6.00898319777, "xy_supercell": [[5, 6], [-6, 11]]},
|
|
24
|
-
{"angle": 5.08584780812, "xy_supercell": [[6, 7], [-7, 13]]},
|
|
25
|
-
{"angle": 4.40845500794, "xy_supercell": [[7, 8], [-8, 15]]},
|
|
26
|
-
{"angle": 3.89023816901, "xy_supercell": [[8, 9], [-9, 17]]},
|
|
27
|
-
{"angle": 3.48100608947, "xy_supercell": [[9, 10], [-10, 19]]},
|
|
28
|
-
{"angle": 3.14965742639, "xy_supercell": [[10, 11], [-11, 21]]},
|
|
29
|
-
{"angle": 2.87589463363, "xy_supercell": [[11, 12], [-12, 23]]},
|
|
30
|
-
{"angle": 2.64590838119, "xy_supercell": [[12, 13], [-13, 25]]},
|
|
31
|
-
{"angle": 2.44997727662, "xy_supercell": [[13, 14], [-14, 27]]},
|
|
32
|
-
{"angle": 2.28105960973, "xy_supercell": [[14, 15], [-15, 29]]},
|
|
33
|
-
{"angle": 2.1339296666, "xy_supercell": [[15, 16], [-16, 31]]},
|
|
34
|
-
{"angle": 2.00462783069, "xy_supercell": [[16, 17], [-17, 33]]},
|
|
35
|
-
{"angle": 1.89009907347, "xy_supercell": [[17, 18], [-18, 35]]},
|
|
36
|
-
{"angle": 1.78794861038, "xy_supercell": [[18, 19], [-19, 37]]},
|
|
37
|
-
{"angle": 1.69627269352, "xy_supercell": [[19, 20], [-20, 39]]},
|
|
38
|
-
{"angle": 1.61353890116, "xy_supercell": [[20, 21], [-21, 41]]},
|
|
39
|
-
{"angle": 1.53849981837, "xy_supercell": [[21, 22], [-22, 43]]},
|
|
40
|
-
{"angle": 1.47012972578, "xy_supercell": [[22, 23], [-23, 45]]},
|
|
41
|
-
{"angle": 1.40757744635, "xy_supercell": [[23, 24], [-24, 47]]},
|
|
42
|
-
{"angle": 1.35013073557, "xy_supercell": [[24, 25], [-25, 49]]},
|
|
43
|
-
{"angle": 1.29718904759, "xy_supercell": [[25, 26], [-26, 51]]},
|
|
44
|
-
{"angle": 1.24824246553, "xy_supercell": [[26, 27], [-27, 53]]},
|
|
45
|
-
{"angle": 1.20285522748, "xy_supercell": [[27, 28], [-28, 55]]},
|
|
46
|
-
{"angle": 1.16065271985, "xy_supercell": [[28, 29], [-29, 57]]},
|
|
47
|
-
{"angle": 1.12131111538, "xy_supercell": [[29, 30], [-30, 59]]},
|
|
48
|
-
{"angle": 1.08454904916, "xy_supercell": [[30, 31], [-31, 61]]},
|
|
49
|
-
{"angle": 1.05012087979, "xy_supercell": [[31, 32], [-32, 63]]},
|
|
50
|
-
{"angle": 1.01781119445, "xy_supercell": [[32, 33], [-33, 65]]},
|
|
51
|
-
{"angle": 0.987430297814, "xy_supercell": [[33, 34], [-34, 67]]},
|
|
52
|
-
{"angle": 0.958810485525, "xy_supercell": [[34, 35], [-35, 69]]},
|
|
53
|
-
{"angle": 0.931802947264, "xy_supercell": [[35, 36], [-36, 71]]},
|
|
54
|
-
{"angle": 0.906275178895, "xy_supercell": [[36, 37], [-37, 73]]},
|
|
55
|
-
{"angle": 0.882108808579, "xy_supercell": [[37, 38], [-38, 75]]},
|
|
56
|
-
{"angle": 0.859197761631, "xy_supercell": [[38, 39], [-39, 77]]},
|
|
57
|
-
{"angle": 0.8374467041, "xy_supercell": [[39, 40], [-40, 79]]},
|
|
58
|
-
{"angle": 0.816769716893, "xy_supercell": [[40, 41], [-41, 81]]},
|
|
59
|
-
{"angle": 0.0, "xy_supercell": [[1, 0], [0, 1]]},
|
|
60
|
-
]
|