@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,434 +0,0 @@
|
|
|
1
|
-
from typing import Callable, List, Literal, Optional
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from mat3ra.made.material import Material
|
|
5
|
-
from scipy.spatial import cKDTree
|
|
6
|
-
|
|
7
|
-
from ..build.processed_structures.two_dimensional.passivation.enums import SurfaceTypesEnum
|
|
8
|
-
from ..convert import decorator_convert_material_args_kwargs_to_atoms, to_pymatgen
|
|
9
|
-
from ..third_party import ASEAtoms, PymatgenIStructure
|
|
10
|
-
from ..utils import decorator_convert_position_to_coordinate
|
|
11
|
-
from .utils import decorator_handle_periodic_boundary_conditions
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@decorator_convert_material_args_kwargs_to_atoms
|
|
15
|
-
def get_average_interlayer_distance(
|
|
16
|
-
interface_atoms: ASEAtoms, tag_substrate: str, tag_film: str, threshold: float = 0.5
|
|
17
|
-
) -> float:
|
|
18
|
-
"""
|
|
19
|
-
Calculate the average distance between the top layer of substrate atoms and the bottom layer of film atoms.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
interface_atoms (ase.ASEAtoms): The ASE ASEAtoms object containing both sets of atoms.
|
|
23
|
-
tag_substrate (int): The tag representing the substrate atoms.
|
|
24
|
-
tag_film (int): The tag representing the film atoms.
|
|
25
|
-
threshold (float): The threshold for identifying the top and bottom layers of atoms.
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
float: The average distance between the top layer of substrate and the bottom layer of film.
|
|
29
|
-
"""
|
|
30
|
-
# Extract z-coordinates of substrate and film atoms
|
|
31
|
-
z_substrate = interface_atoms.positions[interface_atoms.get_tags() == tag_substrate][:, 2]
|
|
32
|
-
z_film = interface_atoms.positions[interface_atoms.get_tags() == tag_film][:, 2]
|
|
33
|
-
|
|
34
|
-
# Identify the top layer of substrate atoms and bottom layer of film atoms by z-coordinate
|
|
35
|
-
top_substrate_layer_z = np.max(z_substrate)
|
|
36
|
-
bottom_film_layer_z = np.min(z_film)
|
|
37
|
-
|
|
38
|
-
# Get the average z-coordinate of the top substrate atoms (within a threshold from the top)
|
|
39
|
-
top_substrate_atoms = z_substrate[z_substrate >= top_substrate_layer_z - threshold]
|
|
40
|
-
avg_z_top_substrate = np.mean(top_substrate_atoms)
|
|
41
|
-
|
|
42
|
-
# Get the average z-coordinate of the bottom film atoms (within a threshold from the bottom)
|
|
43
|
-
bottom_film_atoms = z_film[z_film <= bottom_film_layer_z + threshold]
|
|
44
|
-
avg_z_bottom_film = np.mean(bottom_film_atoms)
|
|
45
|
-
|
|
46
|
-
# Calculate the average distance between the top layer of substrate and the bottom layer of film
|
|
47
|
-
average_interlayer_distance = avg_z_bottom_film - avg_z_top_substrate
|
|
48
|
-
return abs(average_interlayer_distance)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
@decorator_convert_material_args_kwargs_to_atoms
|
|
52
|
-
def get_surface_area(atoms: ASEAtoms):
|
|
53
|
-
"""
|
|
54
|
-
Calculate the area of the surface perpendicular to the z-axis of the atoms structure.
|
|
55
|
-
|
|
56
|
-
Args:
|
|
57
|
-
atoms (ase.ASEAtoms): The ASEAtoms object to calculate the surface area of.
|
|
58
|
-
|
|
59
|
-
Returns:
|
|
60
|
-
float: The surface area of the atoms.
|
|
61
|
-
"""
|
|
62
|
-
matrix = atoms.cell
|
|
63
|
-
cross_product = np.cross(matrix[0], matrix[1])
|
|
64
|
-
return np.linalg.norm(cross_product)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
@decorator_convert_material_args_kwargs_to_atoms
|
|
68
|
-
def get_chemical_formula_empirical(atoms: ASEAtoms) -> str:
|
|
69
|
-
"""
|
|
70
|
-
Calculate the formula of the atoms structure.
|
|
71
|
-
|
|
72
|
-
Args:
|
|
73
|
-
atoms (ase.ASEAtoms): The ASEAtoms object to calculate the formula of.
|
|
74
|
-
|
|
75
|
-
Returns:
|
|
76
|
-
str: The formula of the atoms.
|
|
77
|
-
"""
|
|
78
|
-
return atoms.get_chemical_formula(empirical=True)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def get_closest_site_id_from_coordinate(
|
|
82
|
-
material: Material, coordinate: List[float], use_cartesian_coordinates: bool = False
|
|
83
|
-
) -> int:
|
|
84
|
-
"""
|
|
85
|
-
Get the site ID of the closest site to a given coordinate in the crystal.
|
|
86
|
-
|
|
87
|
-
Args:
|
|
88
|
-
material (Material): The material object to find the closest site in.
|
|
89
|
-
coordinate (List[float]): The coordinate to find the closest site to.
|
|
90
|
-
use_cartesian_coordinates (bool): Whether to use Cartesian coordinates for the calculation.
|
|
91
|
-
|
|
92
|
-
Returns:
|
|
93
|
-
int: The site ID of the closest site.
|
|
94
|
-
"""
|
|
95
|
-
new_material = material.clone()
|
|
96
|
-
if use_cartesian_coordinates:
|
|
97
|
-
new_material.to_cartesian()
|
|
98
|
-
coordinates = np.array(new_material.coordinates_array)
|
|
99
|
-
coordinate = np.array(coordinate) # type: ignore
|
|
100
|
-
distances = np.linalg.norm(coordinates - coordinate, axis=1)
|
|
101
|
-
return int(np.argmin(distances))
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
def get_closest_site_id_from_coordinate_and_element(
|
|
105
|
-
material: Material,
|
|
106
|
-
coordinate: List[float],
|
|
107
|
-
chemical_element: Optional[str] = None,
|
|
108
|
-
use_cartesian_coordinates: bool = False,
|
|
109
|
-
) -> int:
|
|
110
|
-
"""
|
|
111
|
-
Get the site ID of the closest site with a given element to a given coordinate in the crystal.
|
|
112
|
-
|
|
113
|
-
Args:
|
|
114
|
-
material (Material): The material object to find the closest site in.
|
|
115
|
-
coordinate (List[float]): The coordinate to find the closest site to.
|
|
116
|
-
chemical_element (str): The element of the site to find.
|
|
117
|
-
use_cartesian_coordinates (bool): Whether to use Cartesian coordinates for the calculation.
|
|
118
|
-
|
|
119
|
-
Returns:
|
|
120
|
-
int: The site ID of the closest site with the given element.
|
|
121
|
-
"""
|
|
122
|
-
new_material = material.clone()
|
|
123
|
-
if use_cartesian_coordinates:
|
|
124
|
-
new_material.to_cartesian()
|
|
125
|
-
coordinates = np.array(new_material.basis.coordinates.values)
|
|
126
|
-
coordinate = np.array(coordinate) # type: ignore
|
|
127
|
-
distances = np.linalg.norm(coordinates - coordinate, axis=1)
|
|
128
|
-
|
|
129
|
-
if chemical_element is not None:
|
|
130
|
-
elements = np.array(new_material.basis.elements.values)
|
|
131
|
-
element_indices = np.where(elements == chemical_element)[0]
|
|
132
|
-
distances = distances[element_indices]
|
|
133
|
-
return int(element_indices[np.argmin(distances)])
|
|
134
|
-
else:
|
|
135
|
-
return int(np.argmin(distances))
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def get_atom_indices_within_layer_by_atom_index(material: Material, atom_index: int, layer_thickness: float):
|
|
139
|
-
"""
|
|
140
|
-
Select all atoms within a specified layer thickness of a central atom along a direction.
|
|
141
|
-
This direction will be orthogonal to the AB plane.
|
|
142
|
-
Layer thickness is converted from angstroms to fractional units based on the lattice vector length.
|
|
143
|
-
|
|
144
|
-
Args:
|
|
145
|
-
material (Material): Material object
|
|
146
|
-
atom_index (int): Index of the central atom
|
|
147
|
-
layer_thickness (float): Thickness of the layer in angstroms
|
|
148
|
-
|
|
149
|
-
Returns:
|
|
150
|
-
List[int]: List of indices of atoms within the specified layer
|
|
151
|
-
"""
|
|
152
|
-
# TODO: use Coordinates class functions
|
|
153
|
-
coordinates = material.basis.coordinates.to_array_of_values_with_ids()
|
|
154
|
-
vectors = material.lattice.vectors
|
|
155
|
-
direction_vector = np.array(vectors[2])
|
|
156
|
-
|
|
157
|
-
# Normalize the direction vector
|
|
158
|
-
direction_length = np.linalg.norm(direction_vector)
|
|
159
|
-
direction_norm = direction_vector / direction_length
|
|
160
|
-
central_atom_coordinate = coordinates[atom_index]
|
|
161
|
-
central_atom_projection = np.dot(central_atom_coordinate.value, direction_norm)
|
|
162
|
-
|
|
163
|
-
layer_thickness_frac = layer_thickness / direction_length
|
|
164
|
-
|
|
165
|
-
lower_bound = central_atom_projection - layer_thickness_frac / 2
|
|
166
|
-
upper_bound = central_atom_projection + layer_thickness_frac / 2
|
|
167
|
-
|
|
168
|
-
selected_indices = []
|
|
169
|
-
for coord in coordinates:
|
|
170
|
-
# Project each coordinate onto the direction vector
|
|
171
|
-
projection = np.dot(coord.value, direction_norm)
|
|
172
|
-
if lower_bound <= projection <= upper_bound:
|
|
173
|
-
selected_indices.append(coord.id)
|
|
174
|
-
return selected_indices
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
def get_atom_indices_within_layer_by_atom_coordinate(
|
|
178
|
-
material: Material, coordinate: List[float], layer_thickness: float
|
|
179
|
-
):
|
|
180
|
-
"""
|
|
181
|
-
Select all atoms within a specified layer thickness of a central atom along a direction.
|
|
182
|
-
This direction will be orthogonal to the AB plane.
|
|
183
|
-
Layer thickness is converted from angstroms to fractional units based on the lattice vector length.
|
|
184
|
-
|
|
185
|
-
Args:
|
|
186
|
-
material (Material): Material object
|
|
187
|
-
coordinate (List[float]): Coordinate of the central atom in crystal coordinates
|
|
188
|
-
layer_thickness (float): Thickness of the layer in angstroms
|
|
189
|
-
|
|
190
|
-
Returns:
|
|
191
|
-
List[int]: List of indices of atoms within the specified layer
|
|
192
|
-
"""
|
|
193
|
-
site_id = get_closest_site_id_from_coordinate(material, coordinate)
|
|
194
|
-
return get_atom_indices_within_layer_by_atom_index(material, site_id, layer_thickness)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
def get_atom_indices_within_layer(
|
|
198
|
-
material: Material,
|
|
199
|
-
atom_index: Optional[int] = 0,
|
|
200
|
-
coordinate: Optional[List[float]] = None,
|
|
201
|
-
layer_thickness: float = 1,
|
|
202
|
-
):
|
|
203
|
-
"""
|
|
204
|
-
Select all atoms within a specified layer thickness of the central atom along the c-vector direction.
|
|
205
|
-
|
|
206
|
-
Args:
|
|
207
|
-
material (Material): Material object
|
|
208
|
-
atom_index (int): Index of the central atom
|
|
209
|
-
coordinate (List[float]): Coordinate of the central atom in crystal coordinates
|
|
210
|
-
layer_thickness (float): Thickness of the layer in angstroms
|
|
211
|
-
|
|
212
|
-
Returns:
|
|
213
|
-
List[int]: List of indices of atoms within the specified layer
|
|
214
|
-
"""
|
|
215
|
-
if coordinate is not None:
|
|
216
|
-
return get_atom_indices_within_layer_by_atom_coordinate(material, coordinate, layer_thickness)
|
|
217
|
-
if atom_index is not None:
|
|
218
|
-
return get_atom_indices_within_layer_by_atom_index(material, atom_index, layer_thickness)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
def get_atom_indices_within_radius_pbc(
|
|
222
|
-
material: Material, atom_index: Optional[int] = 0, coordinate: Optional[List[float]] = None, radius: float = 1
|
|
223
|
-
):
|
|
224
|
-
"""
|
|
225
|
-
Select all atoms within a specified radius of a central atom considering periodic boundary conditions.
|
|
226
|
-
|
|
227
|
-
Args:
|
|
228
|
-
material (Material): Material object
|
|
229
|
-
atom_index (int): Index of the central atom
|
|
230
|
-
coordinate (List[float]): Coordinate of the central atom in crystal coordinates
|
|
231
|
-
radius (float): Radius of the sphere in angstroms
|
|
232
|
-
|
|
233
|
-
Returns:
|
|
234
|
-
List[int]: List of indices of atoms within the specified
|
|
235
|
-
"""
|
|
236
|
-
|
|
237
|
-
if coordinate is not None:
|
|
238
|
-
atom_index = get_closest_site_id_from_coordinate(material, coordinate)
|
|
239
|
-
|
|
240
|
-
structure = to_pymatgen(material)
|
|
241
|
-
immutable_structure = PymatgenIStructure.from_sites(structure.sites)
|
|
242
|
-
|
|
243
|
-
central_atom = immutable_structure[atom_index]
|
|
244
|
-
sites_within_radius = structure.get_sites_in_sphere(central_atom.coords, radius)
|
|
245
|
-
|
|
246
|
-
selected_indices = [site.index for site in sites_within_radius]
|
|
247
|
-
return selected_indices
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
def get_atom_indices_with_condition_on_coordinates(
|
|
251
|
-
material: Material,
|
|
252
|
-
condition: Callable[[List[float]], bool],
|
|
253
|
-
use_cartesian_coordinates: bool = False,
|
|
254
|
-
) -> List[int]:
|
|
255
|
-
"""
|
|
256
|
-
Select atoms whose coordinates satisfy the given condition.
|
|
257
|
-
|
|
258
|
-
Args:
|
|
259
|
-
material (Material): Material object
|
|
260
|
-
condition (Callable[List[float], bool]): Function that checks if coordinates satisfy the condition.
|
|
261
|
-
use_cartesian_coordinates (bool): Whether to use Cartesian coordinates for the condition evaluation.
|
|
262
|
-
|
|
263
|
-
Returns:
|
|
264
|
-
List[int]: List of indices of atoms whose coordinates satisfy the condition.
|
|
265
|
-
"""
|
|
266
|
-
new_material = material.clone()
|
|
267
|
-
new_basis = new_material.basis
|
|
268
|
-
if use_cartesian_coordinates:
|
|
269
|
-
new_basis.to_cartesian()
|
|
270
|
-
else:
|
|
271
|
-
new_basis.to_crystal()
|
|
272
|
-
new_material.basis = new_basis
|
|
273
|
-
# TODO: use Coordinates class functions
|
|
274
|
-
coordinates = new_material.basis.coordinates.to_array_of_values_with_ids()
|
|
275
|
-
|
|
276
|
-
selected_indices = []
|
|
277
|
-
for coord in coordinates:
|
|
278
|
-
if condition(coord.value):
|
|
279
|
-
selected_indices.append(coord.id)
|
|
280
|
-
|
|
281
|
-
return selected_indices
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
def is_height_within_limits(z: float, z_extremum: float, depth: float, surface: SurfaceTypesEnum) -> bool:
|
|
285
|
-
"""
|
|
286
|
-
Check if the height of an atom is within the specified limits.
|
|
287
|
-
|
|
288
|
-
Args:
|
|
289
|
-
z (float): The z-coordinate of the atom.
|
|
290
|
-
z_extremum (float): The extremum z-coordinate of the surface.
|
|
291
|
-
depth (float): The depth from the surface to look for exposed atoms.
|
|
292
|
-
surface (SurfaceTypesEnum): The surface type (top or bottom).
|
|
293
|
-
|
|
294
|
-
Returns:
|
|
295
|
-
bool: True if the height is within the limits, False otherwise.
|
|
296
|
-
"""
|
|
297
|
-
return (z >= z_extremum - depth) if surface == SurfaceTypesEnum.TOP else (z <= z_extremum + depth)
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
def is_shadowed_by_neighbors_from_surface(
|
|
301
|
-
z: float, neighbors_indices: List[int], surface: SurfaceTypesEnum, coordinates: np.ndarray
|
|
302
|
-
) -> bool:
|
|
303
|
-
"""
|
|
304
|
-
Check if any one of the neighboring atoms shadow the atom from the surface by being closer to the specified surface.
|
|
305
|
-
|
|
306
|
-
Args:
|
|
307
|
-
z (float): The z-coordinate of the atom.
|
|
308
|
-
neighbors_indices (List[int]): List of indices of neighboring atoms.
|
|
309
|
-
surface (SurfaceTypesEnum): The surface type (top or bottom).
|
|
310
|
-
coordinates (np.ndarray): The coordinates of the atoms.
|
|
311
|
-
|
|
312
|
-
Returns:
|
|
313
|
-
bool: True if the atom is not shadowed, False otherwise.
|
|
314
|
-
"""
|
|
315
|
-
return not any(
|
|
316
|
-
(coordinates[n][2] > z if surface == SurfaceTypesEnum.TOP else coordinates[n][2] < z) for n in neighbors_indices
|
|
317
|
-
)
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
@decorator_handle_periodic_boundary_conditions(cutoff=0.25)
|
|
321
|
-
def get_surface_atom_indices(
|
|
322
|
-
material: Material,
|
|
323
|
-
surface: SurfaceTypesEnum = SurfaceTypesEnum.TOP,
|
|
324
|
-
shadowing_radius: float = 2.5,
|
|
325
|
-
depth: float = 5,
|
|
326
|
-
) -> List[int]:
|
|
327
|
-
"""
|
|
328
|
-
Identify exposed atoms on the top or bottom surface of the material.
|
|
329
|
-
|
|
330
|
-
Args:
|
|
331
|
-
material (Material): Material object to get surface atoms from.
|
|
332
|
-
surface (SurfaceTypesEnum): Specify "top" or "bottom" to detect the respective surface atoms.
|
|
333
|
-
shadowing_radius (float): Radius for atoms shadowing underlying from detecting as exposed.
|
|
334
|
-
depth (float): Depth from the surface to look for exposed atoms.
|
|
335
|
-
|
|
336
|
-
Returns:
|
|
337
|
-
List[int]: List of indices of exposed surface atoms.
|
|
338
|
-
"""
|
|
339
|
-
new_material = material.clone()
|
|
340
|
-
new_material.to_cartesian()
|
|
341
|
-
coordinates = np.array(new_material.basis.coordinates.values)
|
|
342
|
-
ids = new_material.basis.coordinates.ids
|
|
343
|
-
|
|
344
|
-
# Get z-extremum of atoms inside the unit cell and sort atoms by z-coordinate
|
|
345
|
-
z_coords = coordinates[:, 2]
|
|
346
|
-
unit_cell_mask = (z_coords > 0) & (z_coords <= material.lattice.c)
|
|
347
|
-
coords_inside_unit_cell = coordinates[unit_cell_mask]
|
|
348
|
-
z_extremum = (
|
|
349
|
-
np.max(coords_inside_unit_cell[:, 2])
|
|
350
|
-
if surface == SurfaceTypesEnum.TOP
|
|
351
|
-
else np.min(coords_inside_unit_cell[:, 2])
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
# First filter by height to be within the specified depth from the surface
|
|
355
|
-
height_mask = np.array([is_height_within_limits(z, z_extremum, depth, surface) for z in z_coords])
|
|
356
|
-
potential_surface_indices = np.where(height_mask)[0]
|
|
357
|
-
|
|
358
|
-
if len(potential_surface_indices) == 0:
|
|
359
|
-
return []
|
|
360
|
-
|
|
361
|
-
# For remaining atoms, check shadowing using KDTree
|
|
362
|
-
try:
|
|
363
|
-
kd_tree = cKDTree(coordinates)
|
|
364
|
-
exposed_atoms_indices = []
|
|
365
|
-
|
|
366
|
-
for idx in potential_surface_indices:
|
|
367
|
-
x, y, z = coordinates[idx]
|
|
368
|
-
try:
|
|
369
|
-
neighbors_indices = kd_tree.query_ball_point([x, y, z], r=shadowing_radius)
|
|
370
|
-
if is_shadowed_by_neighbors_from_surface(z, neighbors_indices, surface, coordinates):
|
|
371
|
-
exposed_atoms_indices.append(ids[idx])
|
|
372
|
-
except Exception:
|
|
373
|
-
# Fallback if KDTree query fails - manual distance calculation
|
|
374
|
-
neighbors_indices = []
|
|
375
|
-
for i, coord in enumerate(coordinates):
|
|
376
|
-
if i != idx:
|
|
377
|
-
dist = np.linalg.norm(coord - coordinates[idx])
|
|
378
|
-
if dist <= shadowing_radius:
|
|
379
|
-
neighbors_indices.append(i)
|
|
380
|
-
if is_shadowed_by_neighbors_from_surface(z, neighbors_indices, surface, coordinates):
|
|
381
|
-
exposed_atoms_indices.append(ids[idx])
|
|
382
|
-
|
|
383
|
-
except Exception:
|
|
384
|
-
# Fallback if KDTree fails completely - use simple z-coordinate based detection
|
|
385
|
-
z_threshold = z_extremum - (0.5 * depth) if surface == SurfaceTypesEnum.TOP else z_extremum + (0.5 * depth)
|
|
386
|
-
exposed_atoms_indices = [
|
|
387
|
-
ids[i]
|
|
388
|
-
for i in potential_surface_indices
|
|
389
|
-
if (surface == SurfaceTypesEnum.TOP and z_coords[i] >= z_threshold)
|
|
390
|
-
or (surface == SurfaceTypesEnum.BOTTOM and z_coords[i] <= z_threshold)
|
|
391
|
-
]
|
|
392
|
-
|
|
393
|
-
return exposed_atoms_indices
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
@decorator_convert_position_to_coordinate
|
|
397
|
-
def get_local_extremum_atom_index(
|
|
398
|
-
material: Material,
|
|
399
|
-
coordinate: List[float],
|
|
400
|
-
extremum: Literal["max", "min"] = "max",
|
|
401
|
-
vicinity: float = 1.0,
|
|
402
|
-
use_cartesian_coordinates: bool = False,
|
|
403
|
-
) -> int:
|
|
404
|
-
"""
|
|
405
|
-
Return the id of the atom with the minimum or maximum z-coordinate
|
|
406
|
-
within a certain vicinity of a given (x, y) coordinate.
|
|
407
|
-
|
|
408
|
-
Args:
|
|
409
|
-
material (Material): Material object.
|
|
410
|
-
coordinate (List[float]): (x, y, z) coordinate to find the local extremum atom index for.
|
|
411
|
-
extremum (str): "min" or "max".
|
|
412
|
-
vicinity (float): Radius of the vicinity, in Angstroms.
|
|
413
|
-
use_cartesian_coordinates (bool): Whether to use Cartesian coordinates.
|
|
414
|
-
|
|
415
|
-
Returns:
|
|
416
|
-
int: id of the atom with the minimum or maximum z-coordinate.
|
|
417
|
-
"""
|
|
418
|
-
new_material = material.clone()
|
|
419
|
-
new_material.to_cartesian()
|
|
420
|
-
if not use_cartesian_coordinates:
|
|
421
|
-
coordinate = new_material.basis.cell.convert_point_to_cartesian(coordinate)
|
|
422
|
-
|
|
423
|
-
coordinates = np.array(new_material.basis.coordinates.values)
|
|
424
|
-
ids = np.array(new_material.basis.coordinates.ids)
|
|
425
|
-
tree = cKDTree(coordinates[:, :2])
|
|
426
|
-
indices = tree.query_ball_point(coordinate[:2], vicinity)
|
|
427
|
-
z_values = [(id, coord[2]) for id, coord in zip(ids[indices], coordinates[indices])]
|
|
428
|
-
|
|
429
|
-
if extremum == "max":
|
|
430
|
-
extremum_z_atom = max(z_values, key=lambda item: item[1])
|
|
431
|
-
else:
|
|
432
|
-
extremum_z_atom = min(z_values, key=lambda item: item[1])
|
|
433
|
-
|
|
434
|
-
return extremum_z_atom[0]
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
from mat3ra.made.material import Material
|
|
3
|
-
from pydantic import BaseModel
|
|
4
|
-
|
|
5
|
-
from . import BaseMaterialAnalyzer
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class RadialDistributionFunction(BaseModel):
|
|
9
|
-
rdf: np.ndarray
|
|
10
|
-
bin_centers: np.ndarray
|
|
11
|
-
|
|
12
|
-
class Config:
|
|
13
|
-
arbitrary_types_allowed = True
|
|
14
|
-
|
|
15
|
-
@classmethod
|
|
16
|
-
def from_material(cls, material: Material, cutoff: float = 10.0, bin_size: float = 0.1):
|
|
17
|
-
analyzer = BaseMaterialAnalyzer(material=material)
|
|
18
|
-
distances = analyzer.pairwise_distances
|
|
19
|
-
density = analyzer.atomic_density
|
|
20
|
-
distances = distances[distances <= cutoff]
|
|
21
|
-
|
|
22
|
-
# Bin distances into a histogram
|
|
23
|
-
bins = np.arange(0, cutoff + bin_size, bin_size) # Bin edges
|
|
24
|
-
hist, bin_edges = np.histogram(distances, bins=bins, density=False)
|
|
25
|
-
|
|
26
|
-
# Convert to radial distribution function
|
|
27
|
-
bin_centers = 0.5 * (bin_edges[:-1] + bin_edges[1:])
|
|
28
|
-
shell_volumes = (
|
|
29
|
-
(4 / 3) * np.pi * (np.power(bin_edges[1:], 3) - np.power(bin_edges[:-1], 3))
|
|
30
|
-
) # Volume of spherical shells
|
|
31
|
-
|
|
32
|
-
rdf = hist / (shell_volumes * density)
|
|
33
|
-
|
|
34
|
-
return cls(rdf=rdf, bin_centers=bin_centers)
|
|
35
|
-
|
|
36
|
-
@property
|
|
37
|
-
def first_peak_index(self):
|
|
38
|
-
return np.argmax(self.rdf[1:]) + 1
|
|
39
|
-
|
|
40
|
-
@property
|
|
41
|
-
def first_peak_value(self):
|
|
42
|
-
return self.rdf[self.first_peak_index]
|
|
43
|
-
|
|
44
|
-
@property
|
|
45
|
-
def first_peak_width(self):
|
|
46
|
-
half_max = 0.5 * self.first_peak_value
|
|
47
|
-
|
|
48
|
-
# Find left boundary
|
|
49
|
-
left_index = self.first_peak_index
|
|
50
|
-
while left_index > 0 and self.rdf[left_index] > half_max:
|
|
51
|
-
left_index -= 1
|
|
52
|
-
|
|
53
|
-
# Find right boundary
|
|
54
|
-
right_index = self.first_peak_index
|
|
55
|
-
while right_index < len(self.rdf) - 1 and self.rdf[right_index] > half_max:
|
|
56
|
-
right_index += 1
|
|
57
|
-
|
|
58
|
-
# Compute the width
|
|
59
|
-
left_boundary = self.bin_centers[left_index]
|
|
60
|
-
right_boundary = self.bin_centers[right_index]
|
|
61
|
-
first_peak_width = right_boundary - left_boundary
|
|
62
|
-
|
|
63
|
-
return float(first_peak_width)
|
|
64
|
-
|
|
65
|
-
@property
|
|
66
|
-
def first_peak_distance(self):
|
|
67
|
-
return self.bin_centers[self.first_peak_index]
|
|
68
|
-
|
|
69
|
-
def is_within_first_peak(self, distance: float, tolerance: float = 0.1) -> bool:
|
|
70
|
-
return (
|
|
71
|
-
self.first_peak_distance - 0.5 * self.first_peak_width - tolerance
|
|
72
|
-
< distance
|
|
73
|
-
< self.first_peak_distance + 0.5 * self.first_peak_width + tolerance
|
|
74
|
-
)
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Type
|
|
4
|
-
|
|
5
|
-
from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab.build_parameters import SlabBuilderParameters
|
|
6
|
-
from mat3ra.made.tools.build.pristine_structures.two_dimensional.slab.configuration import SlabConfiguration
|
|
7
|
-
from mat3ra.made.utils import adjust_material_cell_to_set_gap_along_direction, get_atomic_coordinates_extremum
|
|
8
|
-
|
|
9
|
-
from ..build_components.entities.core.two_dimensional.vacuum.configuration import VacuumConfiguration
|
|
10
|
-
from ..build_components.metadata import MaterialWithBuildMetadata
|
|
11
|
-
from .build_metadata_analyzer import BuildMetadataAnalyzer
|
|
12
|
-
from .crystal_site.crystal_site_analyzer import CrystalSiteAnalyzer
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class SlabMaterialAnalyzer(
|
|
16
|
-
BuildMetadataAnalyzer[SlabConfiguration, SlabBuilderParameters],
|
|
17
|
-
CrystalSiteAnalyzer,
|
|
18
|
-
):
|
|
19
|
-
configuration_cls: Type[SlabConfiguration] = SlabConfiguration
|
|
20
|
-
build_parameters_cls: Type[SlabBuilderParameters] = SlabBuilderParameters
|
|
21
|
-
|
|
22
|
-
@property
|
|
23
|
-
def number_of_layers(self) -> int:
|
|
24
|
-
return self.build_configuration.number_of_layers
|
|
25
|
-
|
|
26
|
-
@property
|
|
27
|
-
def layer_thickness(self) -> float:
|
|
28
|
-
return (self.material.lattice.c - self.build_configuration.vacuum) / self.number_of_layers
|
|
29
|
-
|
|
30
|
-
@property
|
|
31
|
-
def vacuum_ratio(self) -> float:
|
|
32
|
-
return self.build_configuration.vacuum / self.material.lattice.c
|
|
33
|
-
|
|
34
|
-
@property
|
|
35
|
-
def vacuum_thickness_in_layers(self) -> float:
|
|
36
|
-
return self.vacuum_ratio / (1 - self.vacuum_ratio) * self.number_of_layers
|
|
37
|
-
|
|
38
|
-
@property
|
|
39
|
-
def slab_configuration_with_no_vacuum(self) -> SlabConfiguration:
|
|
40
|
-
slab_configuration_with_no_vacuum = self.build_configuration.clone()
|
|
41
|
-
slab_configuration_with_no_vacuum.set_vacuum(0.0)
|
|
42
|
-
return slab_configuration_with_no_vacuum
|
|
43
|
-
|
|
44
|
-
def get_slab_vacuum_configuration(self) -> VacuumConfiguration:
|
|
45
|
-
return self.build_configuration.vacuum_configuration
|
|
46
|
-
|
|
47
|
-
@property
|
|
48
|
-
def max_z_crystal(self) -> float:
|
|
49
|
-
return get_atomic_coordinates_extremum(self.material, "max", "z")
|
|
50
|
-
|
|
51
|
-
@property
|
|
52
|
-
def min_z_crystal(self) -> float:
|
|
53
|
-
return get_atomic_coordinates_extremum(self.material, "min", "z")
|
|
54
|
-
|
|
55
|
-
def get_gap_from_top(self, use_cartesian=False) -> float:
|
|
56
|
-
gap_top_in_crystal = 1.0 - self.max_z_crystal
|
|
57
|
-
if use_cartesian:
|
|
58
|
-
gap_top_in_cartesian = self.material.basis.cell.convert_point_to_cartesian([0, 0, gap_top_in_crystal])[2]
|
|
59
|
-
return gap_top_in_cartesian
|
|
60
|
-
return gap_top_in_crystal
|
|
61
|
-
|
|
62
|
-
def get_gap_from_bottom(self, use_cartesian=False) -> float:
|
|
63
|
-
gap_bottom_in_crystal = self.min_z_crystal
|
|
64
|
-
if use_cartesian:
|
|
65
|
-
gap_bottom_in_cartesian = self.material.basis.cell.convert_point_to_cartesian(
|
|
66
|
-
[0, 0, gap_bottom_in_crystal]
|
|
67
|
-
)[2]
|
|
68
|
-
return gap_bottom_in_cartesian
|
|
69
|
-
return gap_bottom_in_crystal
|
|
70
|
-
|
|
71
|
-
@property
|
|
72
|
-
def _slab_with_no_gap(self) -> MaterialWithBuildMetadata:
|
|
73
|
-
"""
|
|
74
|
-
Returns a fictitious structure with no gap along the z-direction. Used for stacking components.
|
|
75
|
-
"""
|
|
76
|
-
return adjust_material_cell_to_set_gap_along_direction(self.material, 0)
|