@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,45 +0,0 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from mat3ra.made.utils import AXIS_TO_INDEX_MAP
|
|
5
|
-
from scipy.integrate import quad
|
|
6
|
-
from scipy.optimize import root_scalar
|
|
7
|
-
|
|
8
|
-
from .function_holder import FunctionHolder
|
|
9
|
-
|
|
10
|
-
EQUATION_RANGE_COEFFICIENT = 5
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class PerturbationFunctionHolder(FunctionHolder):
|
|
14
|
-
def _integrand(self, t: float, coordinate: List[float], axis: str) -> float:
|
|
15
|
-
temp_coordinate = coordinate[:]
|
|
16
|
-
temp_coordinate[AXIS_TO_INDEX_MAP[axis]] = t
|
|
17
|
-
return np.sqrt(1 + self.calculate_derivative(temp_coordinate, axis) ** 2)
|
|
18
|
-
|
|
19
|
-
def get_arc_length_equation(self, w_prime: float, coordinate: List[float], axis: str) -> float:
|
|
20
|
-
"""
|
|
21
|
-
Calculate arc length considering a change along one specific axis.
|
|
22
|
-
"""
|
|
23
|
-
a, b = 0, w_prime
|
|
24
|
-
arc_length = quad(self._integrand, a, b, args=(coordinate, axis), limit=1000)[0]
|
|
25
|
-
return arc_length - coordinate[AXIS_TO_INDEX_MAP[axis]]
|
|
26
|
-
|
|
27
|
-
def normalize_coordinates(self, coordinate: List[float]) -> List[float]:
|
|
28
|
-
"""
|
|
29
|
-
Transform coordinates to preserve the distance between points on a sine wave when perturbation is applied.
|
|
30
|
-
Achieved by calculating the integral of the length between [0,0,0] and given coordinate.
|
|
31
|
-
|
|
32
|
-
Returns:
|
|
33
|
-
Callable[[List[float]], List[float]]: The coordinates transformation function.
|
|
34
|
-
"""
|
|
35
|
-
for i, var in enumerate(self.variables):
|
|
36
|
-
index = AXIS_TO_INDEX_MAP[var]
|
|
37
|
-
w = coordinate[index]
|
|
38
|
-
result = root_scalar(
|
|
39
|
-
self.get_arc_length_equation,
|
|
40
|
-
args=(coordinate, var),
|
|
41
|
-
bracket=[0, EQUATION_RANGE_COEFFICIENT * w],
|
|
42
|
-
method="brentq",
|
|
43
|
-
)
|
|
44
|
-
coordinate[index] = result.root
|
|
45
|
-
return coordinate
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
|
|
3
|
-
import sympy as sp
|
|
4
|
-
|
|
5
|
-
from .perturbation_function_holder import PerturbationFunctionHolder
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class SineWavePerturbationFunctionHolder(PerturbationFunctionHolder):
|
|
9
|
-
amplitude: float = 0.05
|
|
10
|
-
wavelength: float = 1
|
|
11
|
-
phase: float = 0
|
|
12
|
-
axis: str = "x"
|
|
13
|
-
|
|
14
|
-
def __init__(
|
|
15
|
-
self,
|
|
16
|
-
amplitude: float = 0.05,
|
|
17
|
-
wavelength: float = 1,
|
|
18
|
-
phase: float = 0,
|
|
19
|
-
axis: str = "x",
|
|
20
|
-
**data: Any,
|
|
21
|
-
):
|
|
22
|
-
w = sp.Symbol(axis)
|
|
23
|
-
function = amplitude * sp.sin(2 * sp.pi * w / wavelength + phase)
|
|
24
|
-
variables = [axis]
|
|
25
|
-
super().__init__(function=function, variables=variables, **data)
|
|
26
|
-
self.amplitude = amplitude
|
|
27
|
-
self.wavelength = wavelength
|
|
28
|
-
self.phase = phase
|
|
29
|
-
self.axis = axis
|
package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/helpers.py
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
from typing import Optional, Union
|
|
2
|
-
|
|
3
|
-
import sympy as sp
|
|
4
|
-
from mat3ra.made.material import Material
|
|
5
|
-
|
|
6
|
-
from ..... import MaterialWithBuildMetadata
|
|
7
|
-
from .builders.base import PerturbationBuilder
|
|
8
|
-
from .builders.isometric import IsometricPerturbationBuilder
|
|
9
|
-
from .configuration import PerturbationConfiguration
|
|
10
|
-
from .functions import PerturbationFunctionHolder
|
|
11
|
-
from .functions.maxwell_boltzmann import MaxwellBoltzmannDisplacementHolder
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def create_perturbation(
|
|
15
|
-
material: Union[Material, MaterialWithBuildMetadata],
|
|
16
|
-
perturbation_function: Union[sp.Expr, str],
|
|
17
|
-
use_cartesian_coordinates: bool = True,
|
|
18
|
-
is_isometric: bool = False,
|
|
19
|
-
):
|
|
20
|
-
"""
|
|
21
|
-
Create a perturbation for a material.
|
|
22
|
-
With a function of delta for coordinate [∆x, ∆y, ∆z] = f(x, y, z) applied to each atom in the material.
|
|
23
|
-
|
|
24
|
-
Args:
|
|
25
|
-
material (Material): The material to be perturbed.
|
|
26
|
-
perturbation_function (PerturbationFunctionHolder): The perturbation function to apply.
|
|
27
|
-
is_isometric (bool): If True, the lattice will be adjusted to preserve distances between atoms.
|
|
28
|
-
|
|
29
|
-
Returns:
|
|
30
|
-
Material: The perturbed material.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
configuration = PerturbationConfiguration(
|
|
34
|
-
material=material,
|
|
35
|
-
perturbation_function_holder=PerturbationFunctionHolder(function=perturbation_function),
|
|
36
|
-
use_cartesian_coordinates=use_cartesian_coordinates,
|
|
37
|
-
)
|
|
38
|
-
if is_isometric:
|
|
39
|
-
builder = IsometricPerturbationBuilder()
|
|
40
|
-
else:
|
|
41
|
-
builder = PerturbationBuilder()
|
|
42
|
-
return builder.get_material(configuration)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def create_maxwell_displacement(
|
|
46
|
-
material: Union[Material, MaterialWithBuildMetadata],
|
|
47
|
-
disorder_parameter: float,
|
|
48
|
-
random_seed: Optional[int] = None,
|
|
49
|
-
is_mass_used: bool = True,
|
|
50
|
-
) -> Material:
|
|
51
|
-
"""
|
|
52
|
-
Apply Maxwell-Boltzmann random displacements to a material.
|
|
53
|
-
|
|
54
|
-
Generates random 3D displacement vectors where each component follows a normal
|
|
55
|
-
distribution with variance proportional to disorder_parameter/m (if is_mass_used=True)
|
|
56
|
-
or disorder_parameter (if is_mass_used=False), where m is atomic mass.
|
|
57
|
-
|
|
58
|
-
Args:
|
|
59
|
-
material: The material to be perturbed.
|
|
60
|
-
disorder_parameter: Disorder parameter controlling displacement magnitude,
|
|
61
|
-
can be viewed as effective temperature in eV.
|
|
62
|
-
random_seed: Optional random seed for reproducibility for the same material and parameters.
|
|
63
|
-
is_mass_used: If True, displacement variance is disorder_parameter/m (mass-dependent).
|
|
64
|
-
If False, displacement variance is disorder_parameter (mass-independent).
|
|
65
|
-
|
|
66
|
-
Returns:
|
|
67
|
-
Material with applied Maxwell-Boltzmann displacements.
|
|
68
|
-
"""
|
|
69
|
-
displacement_holder = MaxwellBoltzmannDisplacementHolder(
|
|
70
|
-
disorder_parameter=disorder_parameter,
|
|
71
|
-
random_seed=random_seed,
|
|
72
|
-
is_mass_used=is_mass_used,
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
configuration = PerturbationConfiguration(
|
|
76
|
-
material=material,
|
|
77
|
-
perturbation_function_holder=displacement_holder,
|
|
78
|
-
use_cartesian_coordinates=True,
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
builder = PerturbationBuilder()
|
|
82
|
-
|
|
83
|
-
return builder.get_material(configuration)
|
package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/builder.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
from typing import Type
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.tools.build_components.entities.reusable.base_builder import BaseBuilderParameters, BaseSingleBuilder
|
|
4
|
-
|
|
5
|
-
from ......operations.core.unary import strain
|
|
6
|
-
from ..... import MaterialWithBuildMetadata
|
|
7
|
-
from .configuration import StrainConfiguration
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class StrainBuilder(BaseSingleBuilder):
|
|
11
|
-
_ConfigurationType: Type[StrainConfiguration] = StrainConfiguration
|
|
12
|
-
_BuildParametersType: Type[BaseBuilderParameters] = BaseBuilderParameters
|
|
13
|
-
_DefaultBuildParameters: BaseBuilderParameters = BaseBuilderParameters()
|
|
14
|
-
|
|
15
|
-
def _generate(self, configuration: StrainConfiguration) -> MaterialWithBuildMetadata:
|
|
16
|
-
strained_material = strain(configuration.material, configuration.strain_matrix)
|
|
17
|
-
return MaterialWithBuildMetadata.create(strained_material.to_dict())
|
|
18
|
-
|
|
19
|
-
def _update_material_name(
|
|
20
|
-
self, material: MaterialWithBuildMetadata, configuration: StrainConfiguration
|
|
21
|
-
) -> MaterialWithBuildMetadata:
|
|
22
|
-
if configuration.scale_factor is not None:
|
|
23
|
-
base_name = configuration.material.name
|
|
24
|
-
material.name = f"{base_name} (scale={configuration.scale_factor:.4f})"
|
|
25
|
-
return material
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from typing import Optional, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.esse.models.core.abstract.matrix_3x3 import Matrix3x3Schema
|
|
4
|
-
from mat3ra.made.material import Material
|
|
5
|
-
from mat3ra.made.tools.build_components.entities.reusable.base_builder import BaseConfigurationPydantic
|
|
6
|
-
|
|
7
|
-
from ..... import MaterialWithBuildMetadata
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class StrainConfiguration(BaseConfigurationPydantic):
|
|
11
|
-
"""
|
|
12
|
-
Configuration for a strain operation on a Material.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
material (Material): The Material object to be strained.
|
|
16
|
-
strain_matrix (Matrix3x3Schema): The 3x3 strain matrix defining the deformation.
|
|
17
|
-
scale_factor (Optional[float]): An optional scale factor for isotropic scaling instead of a full strain matrix.
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
type: str = "StrainConfiguration"
|
|
21
|
-
material: Union[Material, MaterialWithBuildMetadata]
|
|
22
|
-
strain_matrix: Matrix3x3Schema
|
|
23
|
-
scale_factor: Optional[float] = None
|
package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/helpers.py
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
from typing import Optional, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.esse.models.core.abstract.matrix_3x3 import Matrix3x3Schema
|
|
4
|
-
from mat3ra.made.material import Material
|
|
5
|
-
|
|
6
|
-
from ..... import MaterialWithBuildMetadata
|
|
7
|
-
from .builder import StrainBuilder
|
|
8
|
-
from .configuration import StrainConfiguration
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def get_isotropic_strain_matrix(scale_factor: float) -> Matrix3x3Schema:
|
|
12
|
-
"""
|
|
13
|
-
Returns a 3x3 isotropic strain matrix for uniform lattice scaling.
|
|
14
|
-
"""
|
|
15
|
-
return Matrix3x3Schema(
|
|
16
|
-
root=[
|
|
17
|
-
[scale_factor, 0.0, 0.0],
|
|
18
|
-
[0.0, scale_factor, 0.0],
|
|
19
|
-
[0.0, 0.0, scale_factor],
|
|
20
|
-
]
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def create_strain(
|
|
25
|
-
material: Union[Material, MaterialWithBuildMetadata],
|
|
26
|
-
strain_matrix: Optional[Matrix3x3Schema] = None,
|
|
27
|
-
scale_factor: Optional[float] = None,
|
|
28
|
-
) -> MaterialWithBuildMetadata:
|
|
29
|
-
"""
|
|
30
|
-
Creates a strained Material based on the provided strain matrix or scale factor.
|
|
31
|
-
|
|
32
|
-
Args:
|
|
33
|
-
material (Union[Material, MaterialWithBuildMetadata]): The material to be strained.
|
|
34
|
-
strain_matrix (Optional[Matrix3x3Schema]): The 3x3 strain matrix defining the deformation.
|
|
35
|
-
scale_factor (Optional[float]): An optional scale factor for isotropic scaling instead of a full strain matrix.
|
|
36
|
-
|
|
37
|
-
Returns:
|
|
38
|
-
MaterialWithBuildMetadata: The strained material with build metadata.
|
|
39
|
-
"""
|
|
40
|
-
if scale_factor is not None:
|
|
41
|
-
if scale_factor <= 0:
|
|
42
|
-
raise ValueError("scale_factor must be positive.")
|
|
43
|
-
strain_matrix = get_isotropic_strain_matrix(scale_factor)
|
|
44
|
-
if strain_matrix is None:
|
|
45
|
-
raise ValueError("Either strain_matrix or scale_factor must be provided.")
|
|
46
|
-
|
|
47
|
-
configuration = StrainConfiguration(material=material, strain_matrix=strain_matrix, scale_factor=scale_factor)
|
|
48
|
-
builder = StrainBuilder()
|
|
49
|
-
return builder.get_material(configuration)
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from typing import List, Union
|
|
2
|
-
|
|
3
|
-
from mat3ra.made.material import Material
|
|
4
|
-
|
|
5
|
-
from ..modify import filter_by_box
|
|
6
|
-
from . import MaterialWithBuildMetadata
|
|
7
|
-
from .entities.reusable.three_dimensional.supercell.helpers import create_supercell
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def double_and_filter_material(
|
|
11
|
-
material: Union[Material, MaterialWithBuildMetadata], start: List[float], end: List[float]
|
|
12
|
-
) -> Material:
|
|
13
|
-
"""
|
|
14
|
-
Double the material and filter it by a box defined by the start and end coordinates.
|
|
15
|
-
Args:
|
|
16
|
-
material (Material): The material to double and filter.
|
|
17
|
-
start (List[float]): The start coordinates of the box.
|
|
18
|
-
end (List[float]): The end coordinates of the box.
|
|
19
|
-
Returns:
|
|
20
|
-
Material: The filtered material.
|
|
21
|
-
"""
|
|
22
|
-
material_doubled = create_supercell(material, scaling_factor=[2, 1, 1])
|
|
23
|
-
return filter_by_box(material_doubled, start, end)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def expand_lattice_vectors(
|
|
27
|
-
material: Union[Material, MaterialWithBuildMetadata], gap: float, direction: int = 0
|
|
28
|
-
) -> Material:
|
|
29
|
-
"""
|
|
30
|
-
Expand the lattice vectors of the material in the specified direction by the given gap.
|
|
31
|
-
|
|
32
|
-
Args:
|
|
33
|
-
material (Material): The material whose lattice vectors are to be expanded.
|
|
34
|
-
gap (float): The gap by which to expand the lattice vector.
|
|
35
|
-
direction (int): The index of the lattice vector to expand (0, 1, or 2).
|
|
36
|
-
"""
|
|
37
|
-
new_lattice_vectors = material.lattice.vector_arrays
|
|
38
|
-
new_lattice_vectors[direction][direction] += gap
|
|
39
|
-
material.set_lattice_vectors(
|
|
40
|
-
lattice_vector1=new_lattice_vectors[0],
|
|
41
|
-
lattice_vector2=new_lattice_vectors[1],
|
|
42
|
-
lattice_vector3=new_lattice_vectors[2],
|
|
43
|
-
)
|
|
44
|
-
return material
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
from typing import Optional, Tuple
|
|
2
|
-
|
|
3
|
-
from ...material import Material
|
|
4
|
-
from ..analyze.other import get_surface_area
|
|
5
|
-
from ..analyze.interface_material import get_interface_bulk_crystal
|
|
6
|
-
from ..build.compound_pristine_structures.two_dimensional.interface import get_slab
|
|
7
|
-
from ..build_components.metadata import MaterialWithBuildMetadata
|
|
8
|
-
from ..convert import decorator_convert_material_args_kwargs_to_atoms
|
|
9
|
-
from ..third_party import ASEAtoms, ASECalculator, ASECalculatorEMT
|
|
10
|
-
from .calculators import InterfaceMaterialCalculatorParameters
|
|
11
|
-
from .interaction_functions import sum_of_inverse_distances_squared
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@decorator_convert_material_args_kwargs_to_atoms
|
|
15
|
-
def calculate_total_energy(atoms: ASEAtoms, calculator: ASECalculator):
|
|
16
|
-
"""
|
|
17
|
-
Set calculator for ASE Atoms and calculate the total energy.
|
|
18
|
-
|
|
19
|
-
Args:
|
|
20
|
-
atoms (ASEAtoms): The Atoms object to calculate the energy of.
|
|
21
|
-
calculator (ase.calculators.calculator.Calculator): The calculator to use for the energy calculation.
|
|
22
|
-
|
|
23
|
-
Returns:
|
|
24
|
-
float: The total energy of the atoms.
|
|
25
|
-
"""
|
|
26
|
-
atoms.calc = calculator
|
|
27
|
-
return atoms.get_total_energy()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@decorator_convert_material_args_kwargs_to_atoms
|
|
31
|
-
def calculate_total_energy_per_atom(atoms: ASEAtoms, calculator: ASECalculator):
|
|
32
|
-
"""
|
|
33
|
-
Set calculator for ASE Atoms and calculate the total energy per atom.
|
|
34
|
-
|
|
35
|
-
Args:
|
|
36
|
-
atoms (ASEAtoms): The Atoms object to calculate the energy of.
|
|
37
|
-
calculator (ase.calculators.calculator.Calculator): The calculator to use for the energy calculation.
|
|
38
|
-
|
|
39
|
-
Returns:
|
|
40
|
-
float: The energy per atom of the atoms.
|
|
41
|
-
"""
|
|
42
|
-
return calculate_total_energy(atoms, calculator) / atoms.get_global_number_of_atoms()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
@decorator_convert_material_args_kwargs_to_atoms
|
|
46
|
-
def calculate_surface_energy(slab: ASEAtoms, bulk: ASEAtoms, calculator: ASECalculator):
|
|
47
|
-
"""
|
|
48
|
-
Calculate the surface energy by subtracting the weighted bulk energy from the slab energy.
|
|
49
|
-
|
|
50
|
-
Args:
|
|
51
|
-
slab (ASEAtoms): The slab Atoms object to calculate the surface energy of.
|
|
52
|
-
bulk (ASEAtoms): The bulk Atoms object to calculate the surface energy of.
|
|
53
|
-
calculator (ase.calculators.calculator.Calculator): The calculator to use for the energy calculation.
|
|
54
|
-
|
|
55
|
-
Returns:
|
|
56
|
-
float: The surface energy of the slab.
|
|
57
|
-
"""
|
|
58
|
-
number_of_atoms = slab.get_global_number_of_atoms()
|
|
59
|
-
area = get_surface_area(slab)
|
|
60
|
-
return (
|
|
61
|
-
calculate_total_energy(slab, calculator) - calculate_total_energy_per_atom(bulk, calculator) * number_of_atoms
|
|
62
|
-
) / (2 * area)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
@decorator_convert_material_args_kwargs_to_atoms
|
|
66
|
-
def calculate_adhesion_energy(
|
|
67
|
-
interface: ASEAtoms, substrate_slab: ASEAtoms, film_slab: ASEAtoms, calculator: ASECalculator
|
|
68
|
-
):
|
|
69
|
-
"""
|
|
70
|
-
Calculate the adhesion energy.
|
|
71
|
-
The adhesion energy is the difference between the energy of the interface and
|
|
72
|
-
the sum of the energies of the substrate and film.
|
|
73
|
-
According to: 10.1088/0953-8984/27/30/305004
|
|
74
|
-
|
|
75
|
-
Args:
|
|
76
|
-
interface (ASEAtoms): The interface ASEAtoms object to calculate the adhesion energy of.
|
|
77
|
-
substrate_slab (ASEAtoms): The substrate slab ASEAtoms object to calculate the adhesion energy of.
|
|
78
|
-
film_slab (ASEAtoms): The film slab ASEAtoms object to calculate the adhesion energy of.
|
|
79
|
-
calculator (ase.calculators.calculator.Calculator): The calculator to use for the energy calculation.
|
|
80
|
-
|
|
81
|
-
Returns:
|
|
82
|
-
float: The adhesion energy of the interface.
|
|
83
|
-
"""
|
|
84
|
-
energy_substrate_slab = calculate_total_energy(substrate_slab, calculator)
|
|
85
|
-
energy_film_slab = calculate_total_energy(film_slab, calculator)
|
|
86
|
-
energy_interface = calculate_total_energy(interface, calculator)
|
|
87
|
-
area = get_surface_area(interface)
|
|
88
|
-
return (energy_substrate_slab + energy_film_slab - energy_interface) / area
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def _get_interface_with_build_metadata(interface: Material) -> MaterialWithBuildMetadata:
|
|
92
|
-
if isinstance(interface, MaterialWithBuildMetadata):
|
|
93
|
-
return interface
|
|
94
|
-
return MaterialWithBuildMetadata.create(interface.to_dict())
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
def _resolve_interface_bulk_materials(
|
|
98
|
-
interface: Material,
|
|
99
|
-
substrate_bulk: Optional[Material],
|
|
100
|
-
film_bulk: Optional[Material],
|
|
101
|
-
) -> Tuple[Optional[Material], Optional[Material]]:
|
|
102
|
-
"""Resolve missing bulks from interface build metadata (handles BoundaryConditions metadata)."""
|
|
103
|
-
try:
|
|
104
|
-
interface_with_metadata = _get_interface_with_build_metadata(interface)
|
|
105
|
-
if substrate_bulk is None:
|
|
106
|
-
substrate_bulk = Material.create(get_interface_bulk_crystal(interface_with_metadata, part="substrate"))
|
|
107
|
-
if film_bulk is None:
|
|
108
|
-
film_bulk = Material.create(get_interface_bulk_crystal(interface_with_metadata, part="film"))
|
|
109
|
-
except (ValueError, TypeError) as exc:
|
|
110
|
-
raise ValueError(
|
|
111
|
-
"The substrate and film bulk materials must be provided or defined in the interface metadata."
|
|
112
|
-
) from exc
|
|
113
|
-
return substrate_bulk, film_bulk
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def calculate_interfacial_energy(
|
|
117
|
-
interface: Material,
|
|
118
|
-
substrate_slab: Optional[Material] = None,
|
|
119
|
-
substrate_bulk: Optional[Material] = None,
|
|
120
|
-
film_slab: Optional[Material] = None,
|
|
121
|
-
film_bulk: Optional[Material] = None,
|
|
122
|
-
calculator: ASECalculator = ASECalculatorEMT(),
|
|
123
|
-
):
|
|
124
|
-
"""
|
|
125
|
-
Calculate the interfacial energy.
|
|
126
|
-
The interfacial energy is the sum of the surface energies of the substrate and film minus the adhesion energy.
|
|
127
|
-
According to Dupré's formula
|
|
128
|
-
|
|
129
|
-
Args:
|
|
130
|
-
interface (Material): The interface Material object to calculate the interfacial energy of.
|
|
131
|
-
substrate_slab (Material): The substrate slab Material object to calculate the interfacial energy of.
|
|
132
|
-
substrate_bulk (Material): The substrate bulk Material object to calculate the interfacial energy of.
|
|
133
|
-
film_slab (Material): The film slab Material object to calculate the interfacial energy of.
|
|
134
|
-
film_bulk (Material): The film bulk Material object to calculate the interfacial energy of.
|
|
135
|
-
calculator (ase.calculators.calculator.Calculator): The calculator to use for the energy calculation
|
|
136
|
-
|
|
137
|
-
Returns:
|
|
138
|
-
float: The interfacial energy of the interface.
|
|
139
|
-
"""
|
|
140
|
-
substrate_slab = get_slab(interface, part="substrate") if substrate_slab is None else substrate_slab
|
|
141
|
-
film_slab = get_slab(interface, part="film") if film_slab is None else film_slab
|
|
142
|
-
|
|
143
|
-
if substrate_bulk is None or film_bulk is None:
|
|
144
|
-
substrate_bulk, film_bulk = _resolve_interface_bulk_materials(interface, substrate_bulk, film_bulk)
|
|
145
|
-
|
|
146
|
-
surface_energy_substrate = calculate_surface_energy(substrate_slab, substrate_bulk, calculator)
|
|
147
|
-
surface_energy_film = calculate_surface_energy(film_slab, film_bulk, calculator)
|
|
148
|
-
adhesion_energy = calculate_adhesion_energy(interface, substrate_slab, film_slab, calculator)
|
|
149
|
-
return surface_energy_film + surface_energy_substrate - adhesion_energy
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional, Union
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from mat3ra.made.material import Material
|
|
5
|
-
|
|
6
|
-
from ...convert import from_ase
|
|
7
|
-
from ...convert.interface_parts_enum import INTERFACE_LABELS_MAP, InterfacePartsEnum
|
|
8
|
-
from ...third_party import ASEAtoms, ASECalculator, ASEFixAtoms, ASEFixedPlane, ase_all_changes
|
|
9
|
-
from ..calculators import InterfaceMaterialCalculator, MaterialCalculator
|
|
10
|
-
from .constraints import RigidFilmXYInterfaceConstraint
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def get_interface_part_indices(atoms: ASEAtoms, part: InterfacePartsEnum) -> List[int]:
|
|
14
|
-
"""
|
|
15
|
-
Get the indices of the atoms in the interface part.
|
|
16
|
-
|
|
17
|
-
Args:
|
|
18
|
-
atoms (ASEAtoms): The ASE Atoms object.
|
|
19
|
-
part (str): The interface part to get the indices of.
|
|
20
|
-
|
|
21
|
-
Returns:
|
|
22
|
-
List[int]: The indices of the atoms in the interface part.
|
|
23
|
-
"""
|
|
24
|
-
return [i for i, tag in enumerate(atoms.get_tags()) if tag == INTERFACE_LABELS_MAP[part.name.lower()]]
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class FilmSubstrateDistanceASECalculator(ASECalculator):
|
|
28
|
-
"""
|
|
29
|
-
ASE calculator that calculates the interaction energy between a film and substrate in an interface material.
|
|
30
|
-
|
|
31
|
-
Args:
|
|
32
|
-
shadowing_radius (float): The radius for atom to shadow underlying from being considered surface, in Angstroms.
|
|
33
|
-
force_constant (float): The force constant for the finite difference approximation of the forces.
|
|
34
|
-
is_substrate_fixed (bool): Whether to fix the substrate atoms.
|
|
35
|
-
is_z_axis_fixed (bool): Whether to fix atoms movement in the z direction.
|
|
36
|
-
symprec (float): The symmetry precision for the ASE calculator. This parameter determines the tolerance
|
|
37
|
-
for symmetry operations, affecting the identification of equivalent atoms and the overall
|
|
38
|
-
symmetry of the system. For more details, refer to the ASE documentation:
|
|
39
|
-
https://wiki.fysik.dtu.dk/ase/ase/constraints.html#ase.constraints.FixSymmetry
|
|
40
|
-
|
|
41
|
-
Example usage:
|
|
42
|
-
```python
|
|
43
|
-
from ase.optimize import BFGS
|
|
44
|
-
atoms = to_ase(material)
|
|
45
|
-
calc = SurfaceDistanceCalculator(shadowing_radius=2.5)
|
|
46
|
-
|
|
47
|
-
atoms.calc = calc
|
|
48
|
-
opt = BFGS(atoms)
|
|
49
|
-
opt.run(fmax=0.05)
|
|
50
|
-
```
|
|
51
|
-
Args:
|
|
52
|
-
shadowing_radius (float): Radius for atoms shadowing underlying from being treated as a surface, in Angstroms.
|
|
53
|
-
force_constant (float): The force constant for the finite difference approximation of the
|
|
54
|
-
Note:
|
|
55
|
-
Built following https://wiki.fysik.dtu.dk/ase/development/calculators.html
|
|
56
|
-
|
|
57
|
-
The calculate method is responsible for computing the energy and forces (if requested).
|
|
58
|
-
Forces are estimated using a finite difference method, which is a simple approximation
|
|
59
|
-
and might not be the most accurate or efficient for all cases.
|
|
60
|
-
"""
|
|
61
|
-
|
|
62
|
-
implemented_properties = ["energy", "forces"]
|
|
63
|
-
|
|
64
|
-
def __init__(
|
|
65
|
-
self,
|
|
66
|
-
shadowing_radius: float = 2.5,
|
|
67
|
-
is_substrate_fixed: bool = True,
|
|
68
|
-
is_z_axis_fixed: bool = True,
|
|
69
|
-
symprec: float = 0.01,
|
|
70
|
-
material_calculator: Union[MaterialCalculator, InterfaceMaterialCalculator] = InterfaceMaterialCalculator(),
|
|
71
|
-
**kwargs,
|
|
72
|
-
):
|
|
73
|
-
super().__init__(**kwargs)
|
|
74
|
-
self.shadowing_radius = shadowing_radius
|
|
75
|
-
self.fix_substrate = is_substrate_fixed
|
|
76
|
-
self.fix_z = is_z_axis_fixed
|
|
77
|
-
self.symprec = symprec
|
|
78
|
-
self.material_calculator = material_calculator
|
|
79
|
-
|
|
80
|
-
def _add_constraints(self, atoms: ASEAtoms) -> ASEAtoms:
|
|
81
|
-
constraints: List[Union[ASEFixAtoms, ASEFixedPlane, RigidFilmXYInterfaceConstraint]] = []
|
|
82
|
-
if self.fix_substrate:
|
|
83
|
-
substrate_indices = get_interface_part_indices(atoms, InterfacePartsEnum.SUBSTRATE)
|
|
84
|
-
constraints.append(ASEFixAtoms(indices=substrate_indices))
|
|
85
|
-
if self.fix_z:
|
|
86
|
-
all_indices = list(range(len(atoms)))
|
|
87
|
-
constraints.append(ASEFixedPlane(indices=all_indices, direction=[0, 0, 1]))
|
|
88
|
-
|
|
89
|
-
film_indices = get_interface_part_indices(atoms, InterfacePartsEnum.FILM)
|
|
90
|
-
if film_indices:
|
|
91
|
-
constraints.append(RigidFilmXYInterfaceConstraint(film_indices=film_indices))
|
|
92
|
-
|
|
93
|
-
atoms.set_constraint(constraints)
|
|
94
|
-
return atoms
|
|
95
|
-
|
|
96
|
-
def _calculate_forces(self, atoms: ASEAtoms, energy: float) -> np.ndarray:
|
|
97
|
-
forces = np.zeros((len(atoms), 3))
|
|
98
|
-
dx = 0.01
|
|
99
|
-
for i in range(len(atoms)):
|
|
100
|
-
for j in range(3):
|
|
101
|
-
atoms_plus = atoms.copy()
|
|
102
|
-
atoms_plus.positions[i, j] += dx
|
|
103
|
-
material_plus = Material.create(from_ase(atoms_plus))
|
|
104
|
-
energy_plus = self.material_calculator.get_energy(material_plus)
|
|
105
|
-
|
|
106
|
-
forces[i, j] = -(energy_plus - energy) / dx
|
|
107
|
-
|
|
108
|
-
return forces
|
|
109
|
-
|
|
110
|
-
def calculate(self, atoms: Optional[ASEAtoms] = None, properties=["energy"], system_changes=ase_all_changes):
|
|
111
|
-
if atoms is None:
|
|
112
|
-
atoms = self.atoms.copy()
|
|
113
|
-
|
|
114
|
-
atoms = self._add_constraints(atoms)
|
|
115
|
-
constraints = atoms.constraints
|
|
116
|
-
|
|
117
|
-
super().calculate(atoms, properties, system_changes)
|
|
118
|
-
material = Material.create(from_ase(atoms))
|
|
119
|
-
energy = self.material_calculator.get_energy(material)
|
|
120
|
-
|
|
121
|
-
self.results = {"energy": energy}
|
|
122
|
-
|
|
123
|
-
if "forces" in properties:
|
|
124
|
-
forces = self._calculate_forces(atoms, energy)
|
|
125
|
-
for constraint in constraints:
|
|
126
|
-
constraint.adjust_forces(atoms, forces)
|
|
127
|
-
self.results["forces"] = forces
|
|
128
|
-
|
|
129
|
-
def get_potential_energy(self, atoms=None, force_consistent=False):
|
|
130
|
-
return self.get_property("energy", atoms)
|
|
131
|
-
|
|
132
|
-
def get_forces(self, atoms=None):
|
|
133
|
-
return self.get_property("forces", atoms)
|