@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,91 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from pydantic import BaseModel
|
|
5
|
-
|
|
6
|
-
from ...third_party import ASEAtoms
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class InterfaceConstraint(BaseModel):
|
|
10
|
-
"""
|
|
11
|
-
Based on https://wiki.fysik.dtu.dk/ase/ase/constraints.html#making-your-own-constraint-class
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
class Config:
|
|
15
|
-
arbitrary_types_allowed = True
|
|
16
|
-
|
|
17
|
-
def adjust_positions(self, atoms: ASEAtoms, new_positions: np.ndarray) -> None:
|
|
18
|
-
"""
|
|
19
|
-
Adjust the positions of the atoms in the system.
|
|
20
|
-
|
|
21
|
-
Args:
|
|
22
|
-
atoms (ASEAtoms): The ASE Atoms object.
|
|
23
|
-
new_positions (numpy.ndarray): The new positions to adjust in place.
|
|
24
|
-
"""
|
|
25
|
-
raise NotImplementedError
|
|
26
|
-
|
|
27
|
-
def adjust_forces(self, forces: np.ndarray) -> None:
|
|
28
|
-
"""
|
|
29
|
-
Adjust the forces on the atoms in the system.
|
|
30
|
-
|
|
31
|
-
Args:
|
|
32
|
-
forces (numpy.ndarray): The forces array to adjust in place.
|
|
33
|
-
"""
|
|
34
|
-
raise NotImplementedError
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class RigidFilmXYInterfaceConstraint(InterfaceConstraint):
|
|
38
|
-
"""
|
|
39
|
-
Custom constraint to allow only rigid translation in x and y for film atoms.
|
|
40
|
-
"""
|
|
41
|
-
|
|
42
|
-
film_indices: List[int] = []
|
|
43
|
-
initial_positions: Optional[np.ndarray] = None
|
|
44
|
-
reference_center: Optional[np.ndarray] = None
|
|
45
|
-
|
|
46
|
-
def adjust_positions(self, atoms: ASEAtoms, new_positions: np.ndarray) -> None:
|
|
47
|
-
"""
|
|
48
|
-
Adjust the positions of film atoms to maintain rigidity in x and y.
|
|
49
|
-
|
|
50
|
-
Args:
|
|
51
|
-
atoms (ase.Atoms): The ASE Atoms object.
|
|
52
|
-
new_positions (numpy.ndarray): The new positions to adjust in place.
|
|
53
|
-
"""
|
|
54
|
-
if self.initial_positions is None:
|
|
55
|
-
self.initial_positions = atoms.positions[self.film_indices].copy()
|
|
56
|
-
self.reference_center = self.initial_positions.mean(axis=0)
|
|
57
|
-
|
|
58
|
-
current_center = new_positions[self.film_indices].mean(axis=0)
|
|
59
|
-
desired_translation = current_center - self.reference_center
|
|
60
|
-
desired_translation[2] = 0.0
|
|
61
|
-
|
|
62
|
-
# Update positions to maintain rigid body translation in x and y
|
|
63
|
-
for i, idx in enumerate(self.film_indices):
|
|
64
|
-
new_positions[idx, 0] = self.initial_positions[i, 0] + desired_translation[0]
|
|
65
|
-
new_positions[idx, 1] = self.initial_positions[i, 1] + desired_translation[1]
|
|
66
|
-
|
|
67
|
-
def adjust_forces(self, forces: np.ndarray) -> None:
|
|
68
|
-
"""
|
|
69
|
-
Adjust the forces on film atoms to ensure rigidity.
|
|
70
|
-
|
|
71
|
-
Args:
|
|
72
|
-
forces (numpy.ndarray): The forces array to adjust in place.
|
|
73
|
-
"""
|
|
74
|
-
if self.initial_positions is None:
|
|
75
|
-
return # No adjustment needed if initial positions are not set
|
|
76
|
-
|
|
77
|
-
# Project forces onto x and y for collective translation
|
|
78
|
-
net_force_x = np.sum(forces[self.film_indices, 0])
|
|
79
|
-
net_force_y = np.sum(forces[self.film_indices, 1])
|
|
80
|
-
|
|
81
|
-
# Distribute the net force equally to all film atoms to maintain rigidity
|
|
82
|
-
num_film_atoms = len(self.film_indices)
|
|
83
|
-
if num_film_atoms == 0:
|
|
84
|
-
return # Avoid division by zero
|
|
85
|
-
|
|
86
|
-
distributed_force_x = net_force_x / num_film_atoms
|
|
87
|
-
distributed_force_y = net_force_y / num_film_atoms
|
|
88
|
-
|
|
89
|
-
for idx in self.film_indices:
|
|
90
|
-
forces[idx, 0] = distributed_force_x
|
|
91
|
-
forces[idx, 1] = distributed_force_y
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
from .interface_material_calculator import InterfaceMaterialCalculator
|
|
2
|
-
from .interface_material_calculator_parameters import InterfaceMaterialCalculatorParameters
|
|
3
|
-
from .material_calculator import MaterialCalculator
|
|
4
|
-
from .material_calculator_parameters import MaterialCalculatorParameters
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
from typing import Callable
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from mat3ra.made.material import Material
|
|
5
|
-
from mat3ra.made.tools.build.processed_structures.two_dimensional.passivation.enums import SurfaceTypesEnum
|
|
6
|
-
|
|
7
|
-
from ...analyze.other import get_surface_atom_indices
|
|
8
|
-
from ...convert.interface_parts_enum import InterfacePartsEnum
|
|
9
|
-
from ...modify import interface_get_part
|
|
10
|
-
from ..interaction_functions import sum_of_inverse_distances_squared
|
|
11
|
-
from .interface_material_calculator_parameters import InterfaceMaterialCalculatorParameters
|
|
12
|
-
from .material_calculator import MaterialCalculator
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class InterfaceMaterialCalculator(MaterialCalculator):
|
|
16
|
-
"""
|
|
17
|
-
A specialized calculator for computing the interaction energy between a film and a substrate
|
|
18
|
-
in an interface material.
|
|
19
|
-
|
|
20
|
-
This class extends MaterialCalculator and uses additional parameters specific to interface materials,
|
|
21
|
-
such as the shadowing radius to detect surface atoms.
|
|
22
|
-
|
|
23
|
-
Args:
|
|
24
|
-
calculator_parameters (InterfaceMaterialCalculatorParameters): Parameters that include the
|
|
25
|
-
shadowing radius and interaction function.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
calculator_parameters: InterfaceMaterialCalculatorParameters = InterfaceMaterialCalculatorParameters()
|
|
29
|
-
|
|
30
|
-
def get_energy(
|
|
31
|
-
self,
|
|
32
|
-
material: Material,
|
|
33
|
-
shadowing_radius: float = 2.5,
|
|
34
|
-
interaction_function: Callable = sum_of_inverse_distances_squared,
|
|
35
|
-
) -> float:
|
|
36
|
-
"""
|
|
37
|
-
Calculate the interaction energy between the film and substrate in an interface material.
|
|
38
|
-
|
|
39
|
-
This method uses the shadowing radius to detect surface atoms and applies the given
|
|
40
|
-
interaction function to calculate the interaction between the film and substrate.
|
|
41
|
-
|
|
42
|
-
Args:
|
|
43
|
-
material (Material): The interface Material object consisting of both the film and substrate.
|
|
44
|
-
shadowing_radius (float): The radius used to detect surface atoms for the interaction
|
|
45
|
-
calculation. Defaults to 2.5 Å.
|
|
46
|
-
interaction_function (Callable): A function to compute the interaction between the film and
|
|
47
|
-
substrate. Defaults to sum_of_inverse_distances_squared.
|
|
48
|
-
|
|
49
|
-
Returns:
|
|
50
|
-
float: The calculated interaction energy between the film and substrate.
|
|
51
|
-
"""
|
|
52
|
-
film_material = interface_get_part(material, part=InterfacePartsEnum.FILM)
|
|
53
|
-
substrate_material = interface_get_part(material, part=InterfacePartsEnum.SUBSTRATE)
|
|
54
|
-
|
|
55
|
-
film_surface_atom_indices = get_surface_atom_indices(
|
|
56
|
-
film_material, SurfaceTypesEnum.BOTTOM, shadowing_radius=shadowing_radius
|
|
57
|
-
)
|
|
58
|
-
substrate_surface_atom_indices = get_surface_atom_indices(
|
|
59
|
-
substrate_material, SurfaceTypesEnum.TOP, shadowing_radius=shadowing_radius
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
film_surface_atom_coordinates = film_material.basis.coordinates
|
|
63
|
-
film_surface_atom_coordinates.filter_by_ids(film_surface_atom_indices)
|
|
64
|
-
substrate_surface_atom_coordinates = substrate_material.basis.coordinates
|
|
65
|
-
substrate_surface_atom_coordinates.filter_by_ids(substrate_surface_atom_indices)
|
|
66
|
-
|
|
67
|
-
film_coordinates_values = np.array(film_surface_atom_coordinates.values)
|
|
68
|
-
substrate_coordinates_values = np.array(substrate_surface_atom_coordinates.values)
|
|
69
|
-
|
|
70
|
-
return interaction_function(film_coordinates_values, substrate_coordinates_values)
|
package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator_parameters.py
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from .material_calculator_parameters import MaterialCalculatorParameters
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class InterfaceMaterialCalculatorParameters(MaterialCalculatorParameters):
|
|
5
|
-
"""
|
|
6
|
-
Parameters specific to the calculation of interaction energies between
|
|
7
|
-
an interface material's film and substrate.
|
|
8
|
-
|
|
9
|
-
Args:
|
|
10
|
-
shadowing_radius (float): Radius used to determine the surface atoms of the film or substrate
|
|
11
|
-
for interaction calculations. Default is 2.5 Å.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
shadowing_radius: float = 2.5
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from mat3ra.made.material import Material
|
|
2
|
-
from pydantic import BaseModel
|
|
3
|
-
|
|
4
|
-
from .material_calculator_parameters import MaterialCalculatorParameters
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class MaterialCalculator(BaseModel):
|
|
8
|
-
"""
|
|
9
|
-
A base class for performing calculations on materials.
|
|
10
|
-
|
|
11
|
-
This class uses the parameters defined in MaterialCalculatorParameters to calculate
|
|
12
|
-
interaction metrics between atoms or sets of coordinates within the material.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
calculator_parameters (MaterialCalculatorParameters): Parameters controlling the calculator,
|
|
16
|
-
including the interaction function.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
calculator_parameters: MaterialCalculatorParameters = MaterialCalculatorParameters()
|
|
20
|
-
|
|
21
|
-
def get_energy(self, material: Material):
|
|
22
|
-
"""
|
|
23
|
-
Calculate the energy (or other metric) for a material.
|
|
24
|
-
|
|
25
|
-
Args:
|
|
26
|
-
material (Material): The material to calculate the interaction energy for.
|
|
27
|
-
|
|
28
|
-
Returns:
|
|
29
|
-
float: The interaction energy between the coordinates of the material,
|
|
30
|
-
calculated using the specified interaction function.
|
|
31
|
-
"""
|
|
32
|
-
return self.calculator_parameters.interaction_function(material.coordinates, material.coordinates)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
from typing import Callable
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel
|
|
4
|
-
|
|
5
|
-
from ..interaction_functions import sum_of_inverse_distances_squared
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class MaterialCalculatorParameters(BaseModel):
|
|
9
|
-
"""
|
|
10
|
-
Defines the parameters for a material calculator.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
interaction_function (Callable): A function used to calculate the interaction metric between
|
|
14
|
-
sets of coordinates. The default function is sum_of_inverse_distances_squared.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
interaction_function: Callable = sum_of_inverse_distances_squared
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import numpy as np
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def sum_of_inverse_distances_squared(
|
|
5
|
-
coordinates_1: np.ndarray, coordinates_2: np.ndarray, epsilon: float = 1e-12
|
|
6
|
-
) -> float:
|
|
7
|
-
"""
|
|
8
|
-
Calculate the sum of inverse squares of distances between two sets of coordinates.
|
|
9
|
-
|
|
10
|
-
Args:
|
|
11
|
-
coordinates_1 (np.ndarray): The first set of coordinates, shape (N1, 3).
|
|
12
|
-
coordinates_2 (np.ndarray): The second set of coordinates, shape (N2, 3).
|
|
13
|
-
epsilon (float): Small value to prevent division by zero.
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
float: The calculated sum.
|
|
17
|
-
"""
|
|
18
|
-
differences = coordinates_1[:, np.newaxis, :] - coordinates_2[np.newaxis, :, :] # Shape: (N1, N2, 3)
|
|
19
|
-
distances_squared = np.sum(differences**2, axis=2) # Shape: (N1, N2)
|
|
20
|
-
distances_squared = np.where(distances_squared == 0, epsilon, distances_squared)
|
|
21
|
-
inv_distances_squared = -1 / distances_squared
|
|
22
|
-
total = np.sum(inv_distances_squared)
|
|
23
|
-
return float(total)
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import inspect
|
|
2
|
-
from functools import wraps
|
|
3
|
-
from typing import Any, Callable, Dict, Union
|
|
4
|
-
|
|
5
|
-
from mat3ra.made.material import Material
|
|
6
|
-
from mat3ra.made.utils import map_array_to_array_with_id_value, map_array_with_id_value_to_array
|
|
7
|
-
from mat3ra.utils import remove_comments_from_source_code
|
|
8
|
-
from mat3ra.utils.mixins import RoundNumericValuesMixin
|
|
9
|
-
|
|
10
|
-
from ..third_party import (
|
|
11
|
-
ASEAtoms,
|
|
12
|
-
PymatgenAseAtomsAdaptor,
|
|
13
|
-
PymatgenInterface,
|
|
14
|
-
PymatgenLattice,
|
|
15
|
-
PymatgenPoscar,
|
|
16
|
-
PymatgenStructure,
|
|
17
|
-
)
|
|
18
|
-
from .utils import (
|
|
19
|
-
calculate_padded_cell_simple_cubic,
|
|
20
|
-
extract_labels_from_pymatgen_structure,
|
|
21
|
-
extract_metadata_from_pymatgen_structure,
|
|
22
|
-
extract_tags_from_ase_atoms,
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def to_pymatgen(material_or_material_data: Union[Material, Dict[str, Any]]) -> PymatgenStructure:
|
|
27
|
-
"""
|
|
28
|
-
Converts material object in ESSE format to a pymatgen Structure object.
|
|
29
|
-
|
|
30
|
-
Args:
|
|
31
|
-
material_or_material_data (dict|class): A dictionary containing the material information in ESSE format.
|
|
32
|
-
|
|
33
|
-
Returns:
|
|
34
|
-
Structure: A pymatgen Structure object.
|
|
35
|
-
"""
|
|
36
|
-
material_data = material_or_material_data
|
|
37
|
-
|
|
38
|
-
if isinstance(material_or_material_data, Material):
|
|
39
|
-
material_data = material_or_material_data.to_dict()
|
|
40
|
-
|
|
41
|
-
lattice_params = material_data["lattice"]
|
|
42
|
-
lattice = PymatgenLattice.from_parameters(
|
|
43
|
-
a=lattice_params["a"],
|
|
44
|
-
b=lattice_params["b"],
|
|
45
|
-
c=lattice_params["c"],
|
|
46
|
-
alpha=lattice_params["alpha"],
|
|
47
|
-
beta=lattice_params["beta"],
|
|
48
|
-
gamma=lattice_params["gamma"],
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
basis = material_data["basis"]
|
|
52
|
-
elements = [element["value"] for element in basis["elements"]]
|
|
53
|
-
coordinates = [coord["value"] for coord in basis["coordinates"]]
|
|
54
|
-
labels_data = basis.get("labels", []) or []
|
|
55
|
-
labels = [label["value"] for label in labels_data]
|
|
56
|
-
# Assuming that the basis units are fractional since it's a crystal basis
|
|
57
|
-
coords_are_cartesian = "units" in basis and basis["units"] == "angstrom"
|
|
58
|
-
|
|
59
|
-
if "labels" in inspect.signature(PymatgenStructure.__init__).parameters:
|
|
60
|
-
structure = PymatgenStructure(
|
|
61
|
-
lattice, elements, coordinates, coords_are_cartesian=coords_are_cartesian, labels=labels
|
|
62
|
-
)
|
|
63
|
-
else:
|
|
64
|
-
# Passing labels does not work for pymatgen `2023.6.23` supporting py3.8
|
|
65
|
-
print(f"labels: {labels}. Not passing labels to pymatgen.")
|
|
66
|
-
structure = PymatgenStructure(lattice, elements, coordinates, coords_are_cartesian=coords_are_cartesian)
|
|
67
|
-
|
|
68
|
-
return structure
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def from_pymatgen(structure: Union[PymatgenStructure, PymatgenInterface]) -> Dict[str, Any]:
|
|
72
|
-
"""
|
|
73
|
-
Converts a pymatgen Structure object to a material object in ESSE format.
|
|
74
|
-
|
|
75
|
-
Args:
|
|
76
|
-
structure (Structure): A pymatgen Structure object.
|
|
77
|
-
|
|
78
|
-
Returns:
|
|
79
|
-
dict: A dictionary containing the material information in ESSE format.
|
|
80
|
-
"""
|
|
81
|
-
__round__ = RoundNumericValuesMixin.round_array_or_number
|
|
82
|
-
basis = {
|
|
83
|
-
"elements": [{"id": i, "value": str(site.specie)} for i, site in enumerate(structure.sites)],
|
|
84
|
-
"coordinates": [
|
|
85
|
-
{"id": i, "value": __round__(list(site.frac_coords))} for i, site in enumerate(structure.sites)
|
|
86
|
-
],
|
|
87
|
-
"units": "crystal",
|
|
88
|
-
# `cell` is assigned by the `lattice` object during Material initialization
|
|
89
|
-
# "cell": __round__(structure.lattice.matrix.tolist()),
|
|
90
|
-
"constraints": [],
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
lattice = {
|
|
94
|
-
"a": __round__(structure.lattice.a),
|
|
95
|
-
"b": __round__(structure.lattice.b),
|
|
96
|
-
"c": __round__(structure.lattice.c),
|
|
97
|
-
"alpha": __round__(structure.lattice.alpha),
|
|
98
|
-
"beta": __round__(structure.lattice.beta),
|
|
99
|
-
"gamma": __round__(structure.lattice.gamma),
|
|
100
|
-
"units": {"length": "angstrom", "angle": "degree"},
|
|
101
|
-
"type": "TRI",
|
|
102
|
-
"vectors": {
|
|
103
|
-
"a": __round__(structure.lattice.matrix[0].tolist()),
|
|
104
|
-
"b": __round__(structure.lattice.matrix[1].tolist()),
|
|
105
|
-
"c": __round__(structure.lattice.matrix[2].tolist()),
|
|
106
|
-
"alat": 1,
|
|
107
|
-
"units": "angstrom",
|
|
108
|
-
},
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
metadata = {
|
|
112
|
-
**extract_metadata_from_pymatgen_structure(structure),
|
|
113
|
-
"boundaryConditions": {"type": "pbc", "offset": 0},
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
basis["labels"] = map_array_to_array_with_id_value(
|
|
117
|
-
extract_labels_from_pymatgen_structure(structure), remove_none=True
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
material_data = {
|
|
121
|
-
"name": structure.formula,
|
|
122
|
-
"basis": basis,
|
|
123
|
-
"lattice": lattice,
|
|
124
|
-
"isNonPeriodic": not structure.is_ordered,
|
|
125
|
-
"_id": "",
|
|
126
|
-
"metadata": metadata,
|
|
127
|
-
"isUpdated": True,
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return material_data
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
def to_poscar(material_or_material_data: Union[Material, Dict[str, Any]]) -> str:
|
|
134
|
-
"""
|
|
135
|
-
Converts material object in ESSE format to a POSCAR string.
|
|
136
|
-
|
|
137
|
-
Args:
|
|
138
|
-
material_or_material_data (dict|class): A dictionary containing the material information in ESSE format.
|
|
139
|
-
|
|
140
|
-
Returns:
|
|
141
|
-
str: A POSCAR string.
|
|
142
|
-
"""
|
|
143
|
-
structure = to_pymatgen(material_or_material_data)
|
|
144
|
-
poscar = PymatgenPoscar(structure)
|
|
145
|
-
# For pymatgen `2023.6.23` supporting py3.8 the method name is "get_string"
|
|
146
|
-
# TODO: cleanup the if statement when dropping support for py3.8
|
|
147
|
-
if hasattr(poscar, "get_string"):
|
|
148
|
-
return poscar.get_string()
|
|
149
|
-
return poscar.get_str()
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
def clean_qe_input(poscar):
|
|
153
|
-
return remove_comments_from_source_code(remove_comments_from_source_code(poscar, "fortran"), "python")
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
def from_poscar(poscar: str) -> Dict[str, Any]:
|
|
157
|
-
"""
|
|
158
|
-
Converts a POSCAR string to a material object in ESSE format.
|
|
159
|
-
|
|
160
|
-
Args:
|
|
161
|
-
poscar (str): A POSCAR string.
|
|
162
|
-
|
|
163
|
-
Returns:
|
|
164
|
-
dict: A dictionary containing the material information in ESSE format.
|
|
165
|
-
"""
|
|
166
|
-
poscar_clean = clean_qe_input(poscar)
|
|
167
|
-
structure = PymatgenStructure.from_str(poscar_clean, "poscar")
|
|
168
|
-
return from_pymatgen(structure)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
def from_poscar_molecule(poscar: str) -> Dict[str, Any]:
|
|
172
|
-
"""
|
|
173
|
-
Converts a molecule POSCAR string to a non-periodic ESSE material.
|
|
174
|
-
"""
|
|
175
|
-
poscar_clean = clean_qe_input(poscar)
|
|
176
|
-
structure = PymatgenStructure.from_str(poscar_clean, "poscar")
|
|
177
|
-
ase_atoms = PymatgenAseAtomsAdaptor.get_atoms(structure)
|
|
178
|
-
ase_atoms.set_pbc(False)
|
|
179
|
-
return from_ase(ase_atoms)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
def to_ase(material_or_material_data: Union[Material, Dict[str, Any]]) -> ASEAtoms:
|
|
183
|
-
"""
|
|
184
|
-
Converts material object in ESSE format to an ASE Atoms object.
|
|
185
|
-
|
|
186
|
-
Args:
|
|
187
|
-
material_or_material_data (dict|class): A dictionary containing the material information in ESSE format.
|
|
188
|
-
|
|
189
|
-
Returns:
|
|
190
|
-
Any: An ASE Atoms object.
|
|
191
|
-
"""
|
|
192
|
-
if isinstance(material_or_material_data, Material):
|
|
193
|
-
material_config = material_or_material_data.to_dict()
|
|
194
|
-
else:
|
|
195
|
-
material_config = material_or_material_data
|
|
196
|
-
structure = to_pymatgen(material_config)
|
|
197
|
-
atoms = PymatgenAseAtomsAdaptor.get_atoms(structure)
|
|
198
|
-
|
|
199
|
-
atomic_labels = material_config["basis"].get("labels", [])
|
|
200
|
-
if atomic_labels:
|
|
201
|
-
atoms.set_tags(map_array_with_id_value_to_array(atomic_labels))
|
|
202
|
-
if "metadata" in material_config:
|
|
203
|
-
atoms.info.update({"metadata": material_config["metadata"]})
|
|
204
|
-
|
|
205
|
-
atoms.info.update({"name": material_config["name"]})
|
|
206
|
-
return atoms
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
def from_ase(ase_atoms: ASEAtoms) -> Dict[str, Any]:
|
|
210
|
-
"""
|
|
211
|
-
Converts an ASE Atoms object to a material object in ESSE format.
|
|
212
|
-
|
|
213
|
-
Args:
|
|
214
|
-
ase_atoms (Atoms): An ASE Atoms object.
|
|
215
|
-
|
|
216
|
-
Returns:
|
|
217
|
-
dict: A dictionary containing the material information in ESSE format.
|
|
218
|
-
"""
|
|
219
|
-
is_molecule = not any(ase_atoms.pbc)
|
|
220
|
-
|
|
221
|
-
if is_molecule:
|
|
222
|
-
lattice_vectors = calculate_padded_cell_simple_cubic(ase_atoms.get_positions())
|
|
223
|
-
ase_atoms.set_cell(lattice_vectors)
|
|
224
|
-
ase_atoms.center()
|
|
225
|
-
|
|
226
|
-
# TODO: check that atomic labels/tags are properly handled
|
|
227
|
-
structure = PymatgenAseAtomsAdaptor.get_structure(ase_atoms)
|
|
228
|
-
|
|
229
|
-
material = from_pymatgen(structure)
|
|
230
|
-
material["isNonPeriodic"] = is_molecule
|
|
231
|
-
if is_molecule:
|
|
232
|
-
material["lattice"]["type"] = "CUB"
|
|
233
|
-
|
|
234
|
-
ase_tags = extract_tags_from_ase_atoms(ase_atoms)
|
|
235
|
-
material["basis"]["labels"] = ase_tags
|
|
236
|
-
ase_metadata = ase_atoms.info.get("metadata", {})
|
|
237
|
-
if ase_metadata:
|
|
238
|
-
material["metadata"].update(ase_metadata)
|
|
239
|
-
material["name"] = ase_atoms.info.get("name", ase_atoms.get_chemical_formula())
|
|
240
|
-
return material
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
def decorator_convert_material_args_kwargs_to_atoms(func: Callable) -> Callable:
|
|
244
|
-
"""
|
|
245
|
-
Decorator that converts ESSE Material objects to ASE Atoms objects.
|
|
246
|
-
"""
|
|
247
|
-
|
|
248
|
-
@wraps(func)
|
|
249
|
-
def wrapper(*args, **kwargs):
|
|
250
|
-
# Convert args if they are of type ESSE Material
|
|
251
|
-
new_args = [to_ase(arg) if isinstance(arg, Material) else arg for arg in args]
|
|
252
|
-
|
|
253
|
-
# Convert kwargs if they are of type ESSE Material
|
|
254
|
-
new_kwargs = {k: to_ase(v) if isinstance(v, Material) else v for k, v in kwargs.items()}
|
|
255
|
-
|
|
256
|
-
# Call the original function with the converted arguments
|
|
257
|
-
return func(*new_args, **new_kwargs)
|
|
258
|
-
|
|
259
|
-
return wrapper
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
def decorator_convert_material_args_kwargs_to_structure(func: Callable) -> Callable:
|
|
263
|
-
"""
|
|
264
|
-
Decorator that converts ESSE Material objects to pymatgen Structure objects.
|
|
265
|
-
"""
|
|
266
|
-
|
|
267
|
-
@wraps(func)
|
|
268
|
-
def wrapper(*args, **kwargs):
|
|
269
|
-
# Convert args if they are of type ESSE Material
|
|
270
|
-
new_args = [to_pymatgen(arg) if isinstance(arg, Material) else arg for arg in args]
|
|
271
|
-
|
|
272
|
-
# Convert kwargs if they are of type ESSE Material
|
|
273
|
-
new_kwargs = {k: to_pymatgen(v) if isinstance(v, Material) else v for k, v in kwargs.items()}
|
|
274
|
-
|
|
275
|
-
# Call the original function with the converted arguments
|
|
276
|
-
return func(*new_args, **new_kwargs)
|
|
277
|
-
|
|
278
|
-
return wrapper
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
def convert_atoms_or_structure_to_material(item):
|
|
282
|
-
if isinstance(item, PymatgenStructure):
|
|
283
|
-
return from_pymatgen(item)
|
|
284
|
-
elif isinstance(item, ASEAtoms):
|
|
285
|
-
return from_ase(item)
|
|
286
|
-
return item
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from typing import Any, Dict, List, Union
|
|
3
|
-
|
|
4
|
-
import numpy as np
|
|
5
|
-
from mat3ra.made.data_helper import DATA_DIR
|
|
6
|
-
from mat3ra.made.utils import get_center_of_coordinates, map_array_to_array_with_id_value
|
|
7
|
-
from mat3ra.utils.object import NumpyNDArrayRoundEncoder
|
|
8
|
-
from scipy.spatial.distance import pdist
|
|
9
|
-
|
|
10
|
-
from ..third_party import ASEAtoms, PymatgenInterface, PymatgenStructure
|
|
11
|
-
from .interface_parts_enum import INTERFACE_LABELS_MAP
|
|
12
|
-
|
|
13
|
-
_CONSTANTS_FILE = DATA_DIR / "constants.json"
|
|
14
|
-
with open(_CONSTANTS_FILE) as _f:
|
|
15
|
-
_CONSTANTS = json.load(_f)
|
|
16
|
-
|
|
17
|
-
DEFAULT_NON_PERIODIC_MIN_LATTICE_SIZE = _CONSTANTS["molecule"]["nonPeriodicMinimumLatticeSize"]
|
|
18
|
-
DIATOMIC_LATTICE_PADDING_FACTOR = _CONSTANTS["molecule"]["diatomicLatticePaddingFactor"]
|
|
19
|
-
MOLECULAR_LATTICE_PADDING_FACTOR = _CONSTANTS["molecule"]["molecularLatticePaddingFactor"]
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def _get_non_periodic_lattice_padding_factor(max_distance: float, min_distance: float) -> float:
|
|
23
|
-
if max_distance <= 0:
|
|
24
|
-
return MOLECULAR_LATTICE_PADDING_FACTOR
|
|
25
|
-
width_ratio = min_distance / max_distance
|
|
26
|
-
if np.isclose(width_ratio, 1.0):
|
|
27
|
-
return DIATOMIC_LATTICE_PADDING_FACTOR
|
|
28
|
-
return MOLECULAR_LATTICE_PADDING_FACTOR
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def _get_non_periodic_lattice_size(
|
|
32
|
-
shifted_positions: np.ndarray,
|
|
33
|
-
default_min_size: float = DEFAULT_NON_PERIODIC_MIN_LATTICE_SIZE,
|
|
34
|
-
) -> float:
|
|
35
|
-
if len(shifted_positions) < 2:
|
|
36
|
-
return max(default_min_size, 10.0)
|
|
37
|
-
distances = pdist(shifted_positions)
|
|
38
|
-
max_distance = float(np.max(distances))
|
|
39
|
-
min_distance = float(np.min(distances))
|
|
40
|
-
padding_factor = _get_non_periodic_lattice_padding_factor(max_distance, min_distance)
|
|
41
|
-
return max(default_min_size, max_distance * padding_factor)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def extract_labels_from_pymatgen_structure(structure: PymatgenStructure) -> List[int]:
|
|
45
|
-
labels = []
|
|
46
|
-
if isinstance(structure, PymatgenInterface):
|
|
47
|
-
labels = list(map(lambda s: INTERFACE_LABELS_MAP[s.properties["interface_label"]], structure.sites))
|
|
48
|
-
return labels
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def extract_metadata_from_pymatgen_structure(structure: PymatgenStructure) -> Dict[str, Any]:
|
|
52
|
-
metadata = {}
|
|
53
|
-
# TODO: consider using Interface JSONSchema from ESSE when such created and adapt interface_properties accordingly.
|
|
54
|
-
# Add interface properties to metadata according to pymatgen Interface as a JSON object
|
|
55
|
-
if hasattr(structure, "interface_properties"):
|
|
56
|
-
interface_props = structure.interface_properties
|
|
57
|
-
# TODO: figure out how to round the values and stringify terminations tuple
|
|
58
|
-
# in the interface properties with Encoder
|
|
59
|
-
for key, value in interface_props.items():
|
|
60
|
-
if isinstance(value, tuple):
|
|
61
|
-
interface_props[key] = str(value)
|
|
62
|
-
metadata["interface_properties"] = json.loads(json.dumps(interface_props, cls=NumpyNDArrayRoundEncoder))
|
|
63
|
-
|
|
64
|
-
return metadata
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def extract_tags_from_ase_atoms(atoms: ASEAtoms) -> List[Union[str, int]]:
|
|
68
|
-
result = []
|
|
69
|
-
if "tags" in atoms.arrays:
|
|
70
|
-
int_tags = [int(tag) for tag in atoms.arrays["tags"] if tag is not None]
|
|
71
|
-
result = map_array_to_array_with_id_value(int_tags, remove_none=True)
|
|
72
|
-
return result
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def calculate_padded_cell_simple_cubic(
|
|
76
|
-
coordinates: List[List[float]],
|
|
77
|
-
default_min_size: float = DEFAULT_NON_PERIODIC_MIN_LATTICE_SIZE,
|
|
78
|
-
) -> List[List[float]]:
|
|
79
|
-
"""
|
|
80
|
-
Calculate values for a padded cell for a molecule based on its coordinates.
|
|
81
|
-
Args:
|
|
82
|
-
coordinates (Array[Array[float]]): A list of atomic coordinates.
|
|
83
|
-
default_min_size (float): Minimum cubic lattice parameter in angstroms.
|
|
84
|
-
Returns:
|
|
85
|
-
Array[float]: A list containing the final cell latice vectors with padding applied.
|
|
86
|
-
"""
|
|
87
|
-
positions = np.array(coordinates)
|
|
88
|
-
center = get_center_of_coordinates(positions)
|
|
89
|
-
shifted_positions = positions - center
|
|
90
|
-
padding_value = _get_non_periodic_lattice_size(shifted_positions, default_min_size)
|
|
91
|
-
|
|
92
|
-
return [
|
|
93
|
-
[padding_value, 0.0, 0.0],
|
|
94
|
-
[0.0, padding_value, 0.0],
|
|
95
|
-
[0.0, 0.0, padding_value],
|
|
96
|
-
]
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
from ..build_components.entities.auxiliary.two_dimensional.miller_indices import MillerIndices
|
|
2
|
-
from ..build_components.entities.auxiliary.two_dimensional.termination import Termination
|
|
3
|
-
from .termination_holder import TerminationHolder
|
|
4
|
-
|
|
5
|
-
__all__ = ["Termination", "TerminationHolder", "MillerIndices"]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from .box_coordinate_condition import BoxCoordinateCondition
|
|
2
|
-
from .coordinate_condition import CoordinateCondition
|
|
3
|
-
from .coordinate_functions import (
|
|
4
|
-
is_coordinate_behind_plane,
|
|
5
|
-
is_coordinate_in_box,
|
|
6
|
-
is_coordinate_in_cylinder,
|
|
7
|
-
is_coordinate_in_sphere,
|
|
8
|
-
is_coordinate_in_triangular_prism,
|
|
9
|
-
is_coordinate_within_layer,
|
|
10
|
-
)
|
|
11
|
-
from .cylinder_coordinate_condition import CylinderCoordinateCondition
|
|
12
|
-
from .plane_coordinate_condition import PlaneCoordinateCondition
|
|
13
|
-
from .sphere_coordinate_condition import SphereCoordinateCondition
|
|
14
|
-
from .triangular_prism_coordinate_condition import TriangularPrismCoordinateCondition
|