@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
package/src/js/tools/basis.ts
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { Coordinate3DSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import { Utils } from "@mat3ra/utils";
|
|
3
|
-
import { chunk, flatten } from "lodash";
|
|
4
|
-
|
|
5
|
-
import { Basis } from "../basis/basis";
|
|
6
|
-
import { AtomicCoordinateValue, Coordinate } from "../basis/coordinates";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const ADD = Utils.math.add;
|
|
10
|
-
const MULT = Utils.math.multiply;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Returns a repeated basis of a crystal.
|
|
14
|
-
* @param basis {Basis} Original basis.
|
|
15
|
-
* @param repetitions{Number[]} Repetition vector `[x, y, z]`, in each spatial dimension.
|
|
16
|
-
* @return {Basis} New Basis.
|
|
17
|
-
*/
|
|
18
|
-
function repeat(basis: Basis, repetitions: number[]): Basis {
|
|
19
|
-
let i, j, k;
|
|
20
|
-
let shiftI = 0;
|
|
21
|
-
let shiftJ = 0;
|
|
22
|
-
let shiftK = 0;
|
|
23
|
-
|
|
24
|
-
// clone original basis and assert it is in cartesian coordinates
|
|
25
|
-
const newBasis = basis.clone();
|
|
26
|
-
const basisCloneInCrystalCoordinates = basis.clone();
|
|
27
|
-
|
|
28
|
-
newBasis.toCrystal();
|
|
29
|
-
basisCloneInCrystalCoordinates.toCrystal();
|
|
30
|
-
|
|
31
|
-
for (i = 1; i <= repetitions[0]; i += 1) {
|
|
32
|
-
for (j = 1; j <= repetitions[1]; j += 1) {
|
|
33
|
-
for (k = 1; k <= repetitions[2]; k += 1) {
|
|
34
|
-
// for each atom in original basis add one with a repetition
|
|
35
|
-
// eslint-disable-next-line no-loop-func
|
|
36
|
-
basisCloneInCrystalCoordinates.elements.forEach((element, index) => {
|
|
37
|
-
const coord = basisCloneInCrystalCoordinates.getCoordinateValueByIndex(index);
|
|
38
|
-
// only add atoms if shifts are non-zero
|
|
39
|
-
if (shiftI || shiftJ || shiftK) {
|
|
40
|
-
const coordinateInstance = Coordinate.fromValueAndId(coord);
|
|
41
|
-
const translatedCoordinateInstance = coordinateInstance.translateByVector([
|
|
42
|
-
shiftI,
|
|
43
|
-
shiftJ,
|
|
44
|
-
shiftK,
|
|
45
|
-
]);
|
|
46
|
-
newBasis.addAtom({
|
|
47
|
-
element: element.value,
|
|
48
|
-
coordinate: translatedCoordinateInstance.value,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
shiftK += 1;
|
|
53
|
-
}
|
|
54
|
-
shiftK = 0;
|
|
55
|
-
shiftJ += 1;
|
|
56
|
-
}
|
|
57
|
-
shiftJ = 0;
|
|
58
|
-
shiftI += 1;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (basis.isInCartesianUnits) newBasis.toCartesian();
|
|
62
|
-
|
|
63
|
-
return newBasis;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Calculates linear function `y = kx + b` for vectors. Isolated for modularity.
|
|
68
|
-
* @param initialCoordinate {Array} - b.
|
|
69
|
-
* @param delta {Array} - x.
|
|
70
|
-
* @param normalizedStepIndex {Number} - k.
|
|
71
|
-
* @return {Basis[]} List of all bases.
|
|
72
|
-
*/
|
|
73
|
-
function _linearInterpolation(
|
|
74
|
-
initialCoordinate: AtomicCoordinateValue,
|
|
75
|
-
delta: Coordinate3DSchema,
|
|
76
|
-
normalizedStepIndex: number,
|
|
77
|
-
): number[] {
|
|
78
|
-
return ADD(initialCoordinate, MULT(delta, normalizedStepIndex)) as number[];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Returns a set of Bases for a crystal interpolated from initial to final crystal.
|
|
83
|
-
* Can be used to generate atomic configurations along a chemical reaction path, for example.
|
|
84
|
-
* @param initialBasis {Basis} Original initialBasis.
|
|
85
|
-
* @param finalBasis {Basis} Final initialBasis.
|
|
86
|
-
* @param numberOfSteps{Number} Number of intermediate steps.
|
|
87
|
-
* @return {Basis[]} List of all bases.
|
|
88
|
-
*/
|
|
89
|
-
function interpolate(initialBasis: Basis, finalBasis: Basis, numberOfSteps = 1) {
|
|
90
|
-
// check that initial and final basis have the same cell
|
|
91
|
-
if (!initialBasis.hasEquivalentCellTo(finalBasis))
|
|
92
|
-
throw new Error("basis.interpolate: Basis cells are not equal");
|
|
93
|
-
|
|
94
|
-
// clone original initialBasis and assert it is in cartesian coordinates
|
|
95
|
-
const initialBasisCopy = initialBasis.clone();
|
|
96
|
-
const finalBasisCopy = finalBasis.clone();
|
|
97
|
-
|
|
98
|
-
initialBasisCopy.toCrystal();
|
|
99
|
-
finalBasisCopy.toCrystal();
|
|
100
|
-
|
|
101
|
-
const initialCoordinates = flatten(initialBasisCopy.coordinatesAsArray);
|
|
102
|
-
const finalCoordinates = flatten(finalBasisCopy.coordinatesAsArray);
|
|
103
|
-
const delta = ADD(finalCoordinates, MULT(initialCoordinates, -1));
|
|
104
|
-
const resultingListOfBases = [];
|
|
105
|
-
|
|
106
|
-
for (let i = 1; i <= numberOfSteps; i++) {
|
|
107
|
-
const normalizedStepIndex = i / (numberOfSteps + 1);
|
|
108
|
-
const intermediateCoordinates: number[] = _linearInterpolation(
|
|
109
|
-
initialCoordinates as AtomicCoordinateValue,
|
|
110
|
-
delta as AtomicCoordinateValue,
|
|
111
|
-
normalizedStepIndex,
|
|
112
|
-
);
|
|
113
|
-
const vectorSize = 3;
|
|
114
|
-
const intermediateCoordinatesAsNestedArray = chunk(intermediateCoordinates, vectorSize);
|
|
115
|
-
const intermediateBasis = initialBasis.clone();
|
|
116
|
-
intermediateBasis.coordinates = intermediateCoordinatesAsNestedArray.map(
|
|
117
|
-
(coordinate, index) => ({
|
|
118
|
-
id: index,
|
|
119
|
-
value: coordinate as AtomicCoordinateValue,
|
|
120
|
-
}),
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
resultingListOfBases.push(intermediateBasis);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return resultingListOfBases;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export default {
|
|
130
|
-
repeat,
|
|
131
|
-
interpolate,
|
|
132
|
-
};
|
package/src/js/tools/cell.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Coordinate3DSchema, Matrix3X3Schema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import { Utils } from "@mat3ra/utils";
|
|
3
|
-
|
|
4
|
-
import { Cell } from "../cell/cell";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns the list of points on the original lattice contained in the supercell in fractional coordinates.
|
|
9
|
-
* Source: https://pymatgen.org/_modules/pymatgen/util/coord.html
|
|
10
|
-
*/
|
|
11
|
-
function latticePointsInSupercell(supercellMatrix: Matrix3X3Schema) {
|
|
12
|
-
const supercell = Cell.fromVectorsArray(supercellMatrix);
|
|
13
|
-
const diagonals = [
|
|
14
|
-
[0, 0, 0],
|
|
15
|
-
[0, 0, 1],
|
|
16
|
-
[0, 1, 0],
|
|
17
|
-
[0, 1, 1],
|
|
18
|
-
[1, 0, 0],
|
|
19
|
-
[1, 0, 1],
|
|
20
|
-
[1, 1, 0],
|
|
21
|
-
[1, 1, 1],
|
|
22
|
-
];
|
|
23
|
-
const d_points = diagonals.map((point) =>
|
|
24
|
-
supercell.convertPointToCartesian(point as Coordinate3DSchema),
|
|
25
|
-
);
|
|
26
|
-
const mins = [0, 1, 2].map((i) => Utils.math.min(...d_points.map((p) => p[i])));
|
|
27
|
-
const maxes = [0, 1, 2].map((i) => Utils.math.max(...d_points.map((p) => p[i])) + 1);
|
|
28
|
-
const points = [];
|
|
29
|
-
for (let i = mins[0]; i <= maxes[0]; i++) {
|
|
30
|
-
for (let j = mins[1]; j <= maxes[1]; j++) {
|
|
31
|
-
for (let k = mins[2]; k <= maxes[2]; k++) {
|
|
32
|
-
points.push(supercell.convertPointToCrystal([i, j, k]));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return points;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
latticePointsInSupercell,
|
|
41
|
-
};
|
package/src/js/tools/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import BasisTools from "./basis";
|
|
2
|
-
import MaterialTools from "./material";
|
|
3
|
-
import SupercellTools from "./supercell";
|
|
4
|
-
import SurfaceTools from "./surface";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
surface: SurfaceTools,
|
|
8
|
-
supercell: SupercellTools,
|
|
9
|
-
material: MaterialTools,
|
|
10
|
-
basis: BasisTools,
|
|
11
|
-
};
|
package/src/js/tools/material.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { LatticeSchema, Vector3DSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import { Utils } from "@mat3ra/utils";
|
|
3
|
-
|
|
4
|
-
import { ATOMIC_COORD_UNITS } from "../constants";
|
|
5
|
-
import { Lattice } from "../lattice/lattice";
|
|
6
|
-
import { Material } from "../material";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Scales one lattice vector for the given material
|
|
11
|
-
* @param material {Material} The material acted upon.
|
|
12
|
-
* @param key {String} Lattice vector key.
|
|
13
|
-
* @param factor {Number} Float scaling factor.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
function scaleOneLatticeVector(material: Material, key: "a" | "b" | "c" = "a", factor = 1.0) {
|
|
17
|
-
const lattice = { ...material.lattice };
|
|
18
|
-
if (lattice.vectors === undefined) {
|
|
19
|
-
throw new Error("Lattice vectors are undefined");
|
|
20
|
-
}
|
|
21
|
-
lattice.vectors[key] = lattice.vectors![key].map((v) => v * factor) as Vector3DSchema;
|
|
22
|
-
|
|
23
|
-
material.lattice = Lattice.fromVectors(lattice.vectors).toJSON();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Updates the size of a materials lattice using the minimumLatticeSize function.
|
|
28
|
-
* The new size of the material is calculated based on the materials basis.
|
|
29
|
-
* @param material {Material}
|
|
30
|
-
*/
|
|
31
|
-
function scaleLatticeToMakeNonPeriodic(material: Material) {
|
|
32
|
-
material.lattice = Lattice.fromConfigPartial({
|
|
33
|
-
a: material.Basis.getMinimumLatticeSize(),
|
|
34
|
-
type: "CUB",
|
|
35
|
-
} as LatticeSchema).toJSON();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Updates the basis of a material by translating the coordinates
|
|
40
|
-
* so that the center of the material and lattice are aligned.
|
|
41
|
-
* @param material {Material}
|
|
42
|
-
* */
|
|
43
|
-
function translateAtomsToCenter(material: Material) {
|
|
44
|
-
const originalUnits = material.Basis.units;
|
|
45
|
-
material.toCartesian();
|
|
46
|
-
const updatedBasis = material.Basis;
|
|
47
|
-
const centerOfCoordinates = updatedBasis.centerOfCoordinatesPoint;
|
|
48
|
-
const centerOfLattice = Utils.math.multiply(
|
|
49
|
-
0.5,
|
|
50
|
-
material.Lattice.vectorArrays.reduce((a, b) => Utils.math.add(a, b) as Vector3DSchema),
|
|
51
|
-
);
|
|
52
|
-
const translationVector = Utils.math.subtract(centerOfLattice, centerOfCoordinates);
|
|
53
|
-
updatedBasis.translateByVector(translationVector as Vector3DSchema);
|
|
54
|
-
material.setBasis(updatedBasis.toJSON());
|
|
55
|
-
if (originalUnits !== ATOMIC_COORD_UNITS.cartesian) material.toCrystal();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default {
|
|
59
|
-
scaleOneLatticeVector,
|
|
60
|
-
scaleLatticeToMakeNonPeriodic,
|
|
61
|
-
translateAtomsToCenter,
|
|
62
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Coordinate3DSchema, Matrix3X3Schema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import { Utils } from "@mat3ra/utils";
|
|
3
|
-
|
|
4
|
-
import { Basis } from "../basis/basis";
|
|
5
|
-
import { ConstrainedBasis } from "../basis/constrained_basis";
|
|
6
|
-
import { Cell } from "../cell/cell";
|
|
7
|
-
import { Lattice } from "../lattice/lattice";
|
|
8
|
-
import type { Material } from "../material";
|
|
9
|
-
import cellTools from "./cell";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const ADD = Utils.math.add;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @summary Generates new basis for a supercell. For each site from basis generates shifts that are within supercell.
|
|
16
|
-
*/
|
|
17
|
-
function generateNewBasisWithinSupercell(
|
|
18
|
-
basis: Basis | ConstrainedBasis,
|
|
19
|
-
cell: Cell,
|
|
20
|
-
supercell: Cell,
|
|
21
|
-
supercellMatrix: Matrix3X3Schema,
|
|
22
|
-
): Basis {
|
|
23
|
-
const oldBasis = basis.clone();
|
|
24
|
-
const newBasis = basis.clone();
|
|
25
|
-
newBasis.removeAllAtoms();
|
|
26
|
-
|
|
27
|
-
oldBasis.toCrystal();
|
|
28
|
-
newBasis.toCrystal();
|
|
29
|
-
|
|
30
|
-
oldBasis.elements.forEach((element) => {
|
|
31
|
-
const coordinate = oldBasis.getCoordinateValueById(element.id);
|
|
32
|
-
const cartesianCoordinate = cell.convertPointToCartesian(coordinate);
|
|
33
|
-
const shifts = cellTools.latticePointsInSupercell(supercellMatrix);
|
|
34
|
-
shifts.forEach((combination) => {
|
|
35
|
-
// "combination" is effectively a point in fractional coordinates here, hence the below
|
|
36
|
-
const newPoint = ADD(
|
|
37
|
-
cartesianCoordinate,
|
|
38
|
-
supercell.convertPointToCartesian(combination),
|
|
39
|
-
);
|
|
40
|
-
if (supercell.isPointInsideCell(newPoint as Coordinate3DSchema)) {
|
|
41
|
-
newBasis.addAtom({
|
|
42
|
-
element: element.value,
|
|
43
|
-
coordinate: supercell.convertPointToCrystal(
|
|
44
|
-
newPoint as Coordinate3DSchema,
|
|
45
|
-
) as Coordinate3DSchema,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
return newBasis as Basis;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @summary Generates supercell config for the specified material.
|
|
56
|
-
* @param material
|
|
57
|
-
* @param supercellMatrix {Number[][]}
|
|
58
|
-
*/
|
|
59
|
-
function generateConfig(material: Material, supercellMatrix: Matrix3X3Schema) {
|
|
60
|
-
const det = Utils.math.det(supercellMatrix);
|
|
61
|
-
if (det === 0) {
|
|
62
|
-
throw new Error("Scaling matrix is degenerate.");
|
|
63
|
-
}
|
|
64
|
-
const cell = material.Lattice.vectors;
|
|
65
|
-
const supercell = cell.cloneAndScaleByMatrix(supercellMatrix);
|
|
66
|
-
const newBasis = generateNewBasisWithinSupercell(
|
|
67
|
-
material.Basis,
|
|
68
|
-
cell,
|
|
69
|
-
supercell,
|
|
70
|
-
supercellMatrix,
|
|
71
|
-
);
|
|
72
|
-
const newLattice = Lattice.fromVectors({
|
|
73
|
-
a: supercell.a,
|
|
74
|
-
b: supercell.b,
|
|
75
|
-
c: supercell.c,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
name: `${material.name} - supercell ${JSON.stringify(supercellMatrix)}`,
|
|
80
|
-
basis: newBasis.toJSON(),
|
|
81
|
-
lattice: newLattice.toJSON(),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default {
|
|
86
|
-
generateConfig,
|
|
87
|
-
generateNewBasisWithinSupercell,
|
|
88
|
-
};
|
package/src/js/tools/surface.ts
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Coordinate3DSchema,
|
|
3
|
-
MaterialSchema,
|
|
4
|
-
Matrix3X3Schema,
|
|
5
|
-
Vector3DSchema,
|
|
6
|
-
} from "@mat3ra/esse/dist/js/types";
|
|
7
|
-
import { Utils } from "@mat3ra/utils";
|
|
8
|
-
|
|
9
|
-
import { Cell } from "../cell/cell";
|
|
10
|
-
import { Lattice } from "../lattice/lattice";
|
|
11
|
-
import { Material } from "../material";
|
|
12
|
-
import SupercellTools from "./supercell";
|
|
13
|
-
|
|
14
|
-
const MULT = Utils.math.multiply;
|
|
15
|
-
const ADD = Utils.math.add;
|
|
16
|
-
const DOT = Utils.math.product;
|
|
17
|
-
const getMatrixInLeftHandedRepresentation = (matrix: Matrix3X3Schema) => {
|
|
18
|
-
return Utils.math.det(matrix) < 0 ? MULT(matrix, -1) : matrix;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Helper function for extended GCD.
|
|
23
|
-
* Inspired by https://gitlab.com/ase/ase/-/blob/20401e2596821a85f17ced1cb18f32c508e35fb0/ase/build/general_surface.py
|
|
24
|
-
* @param {Number} a
|
|
25
|
-
* @param {Number} b
|
|
26
|
-
* @return {Array}
|
|
27
|
-
*/
|
|
28
|
-
function extGCD(a: number, b: number): [number, number] {
|
|
29
|
-
if (b === 0) return [1, 0];
|
|
30
|
-
if (Utils.math.mod(a, b) === 0) return [0, 1];
|
|
31
|
-
|
|
32
|
-
const [x, y] = extGCD(b, Utils.math.mod(a, b));
|
|
33
|
-
return [y, x - y * Utils.math.floor(a / b)];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Generates a slab scaling matrix for the specified cell based on miller indices.
|
|
38
|
-
* Inspired by from https://gitlab.com/ase/ase/blob/master/ase/build/general_surface.py.
|
|
39
|
-
* @param cell {Cell}
|
|
40
|
-
* @param millerIndices {Number[]}
|
|
41
|
-
* @param tol {Number} Zero-value tolerance
|
|
42
|
-
* @return {Number[][]}
|
|
43
|
-
*/
|
|
44
|
-
function getMillerScalingMatrix(
|
|
45
|
-
cell: Cell,
|
|
46
|
-
millerIndices: Coordinate3DSchema,
|
|
47
|
-
tol = 1e-8,
|
|
48
|
-
): Matrix3X3Schema {
|
|
49
|
-
if (!millerIndices.reduce((a, b) => Utils.math.abs(a) + Utils.math.abs(b)))
|
|
50
|
-
throw new Error("Miller indices are zeros.");
|
|
51
|
-
|
|
52
|
-
let scalingMatrix;
|
|
53
|
-
|
|
54
|
-
const [h, k, l] = millerIndices;
|
|
55
|
-
const [h0, k0, l0] = millerIndices.map((i) => i === 0);
|
|
56
|
-
|
|
57
|
-
if ((h0 && k0) || (h0 && l0) || (k0 && l0)) {
|
|
58
|
-
// if any two indices are zero
|
|
59
|
-
|
|
60
|
-
if (!h0) {
|
|
61
|
-
scalingMatrix = [
|
|
62
|
-
[0, 1, 0],
|
|
63
|
-
[0, 0, 1],
|
|
64
|
-
[1, 0, 0],
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
if (!k0) {
|
|
68
|
-
scalingMatrix = [
|
|
69
|
-
[0, 0, 1],
|
|
70
|
-
[1, 0, 0],
|
|
71
|
-
[0, 1, 0],
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
if (!l0) {
|
|
75
|
-
scalingMatrix = [
|
|
76
|
-
[1, 0, 0],
|
|
77
|
-
[0, 1, 0],
|
|
78
|
-
[0, 0, 1],
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
} else {
|
|
82
|
-
const [a1, a2, a3] = cell.vectorArrays;
|
|
83
|
-
// z1 = (k * a1 - h * a2)
|
|
84
|
-
// z2 = (l * a1 - h * a3)
|
|
85
|
-
// z3 = l * a2 - k * a3)
|
|
86
|
-
const z1 = ADD(MULT(k, a1), -MULT(h, a2));
|
|
87
|
-
const z2 = ADD(MULT(l, a1), -MULT(h, a3));
|
|
88
|
-
const z3 = ADD(MULT(l, a2), -MULT(k, a3));
|
|
89
|
-
|
|
90
|
-
let [p, q] = extGCD(k, l);
|
|
91
|
-
|
|
92
|
-
// @ts-ignore
|
|
93
|
-
const k1 = DOT(ADD(MULT(p, z1), MULT(q, z2)), z3);
|
|
94
|
-
// @ts-ignore
|
|
95
|
-
const k2 = DOT(ADD(MULT(l, z1), -MULT(k, z2)), z3);
|
|
96
|
-
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
if (Utils.math.abs(k2) > tol) {
|
|
99
|
-
// For mathjs version 3.20: round(-0.5) = -0
|
|
100
|
-
// For mathjs version 5.10: round(-0.5) = -1
|
|
101
|
-
// Here we specify rounding method to Bankers
|
|
102
|
-
// For Python 3.11: round(-0.5) = 0
|
|
103
|
-
// @ts-ignore - mathjs v12 dot return type
|
|
104
|
-
const value = k1 / k2;
|
|
105
|
-
const roundedValue = Utils.math.roundCustom(
|
|
106
|
-
value,
|
|
107
|
-
0,
|
|
108
|
-
Utils.math.RoundingMethod.Bankers,
|
|
109
|
-
);
|
|
110
|
-
const i = -roundedValue;
|
|
111
|
-
[p, q] = [p + i * l, q - i * k];
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const [a, b] = extGCD(p * k + q * l, h);
|
|
115
|
-
const c1 = [p * k + q * l, -p * h, -q * h];
|
|
116
|
-
const c2 = [0, l, -k].map((c) => Utils.math.trunc(c / Utils.math.gcd(l, k))); // floor division
|
|
117
|
-
const c3 = [b, a * p, a * q];
|
|
118
|
-
|
|
119
|
-
scalingMatrix = [c1, c2, c3];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// @ts-ignore
|
|
123
|
-
return getMatrixInLeftHandedRepresentation(scalingMatrix);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Scale the surface cell in out-of-plane direction according to thickness
|
|
128
|
-
* and construct the lateral supercell from vx/vy parameters.
|
|
129
|
-
* @param bulkCell {Cell}
|
|
130
|
-
* @param surfaceCell {Cell}
|
|
131
|
-
* @param outOfPlaneAxisIndex {Number} Index of the cell vector most collinear with the out-of-surface-plane vector
|
|
132
|
-
* @param thickness {Number} Surface (Slab) thickness in layers (Positive Integer).
|
|
133
|
-
* @param vx {Number} Size of lateral supercell along the direction of the first (x) cell vector (Positive Integer).
|
|
134
|
-
* @param vy {Number} Size of lateral supercell along the direction of the second (y) cell vector (Positive Integer).
|
|
135
|
-
* @return {Number[][]}
|
|
136
|
-
*/
|
|
137
|
-
function getDimensionsScalingMatrix(
|
|
138
|
-
outOfPlaneAxisIndex: number,
|
|
139
|
-
thickness: number,
|
|
140
|
-
vx: number,
|
|
141
|
-
vy: number,
|
|
142
|
-
): Matrix3X3Schema {
|
|
143
|
-
const transformationMatrix = [
|
|
144
|
-
[1, 0, 0],
|
|
145
|
-
[0, 1, 0],
|
|
146
|
-
[0, 0, 1],
|
|
147
|
-
] as Matrix3X3Schema;
|
|
148
|
-
const vxIndex = outOfPlaneAxisIndex === 2 ? 0 : outOfPlaneAxisIndex + 1;
|
|
149
|
-
const vyIndex = vxIndex === 2 ? 0 : vxIndex + 1;
|
|
150
|
-
|
|
151
|
-
transformationMatrix[outOfPlaneAxisIndex] = MULT(
|
|
152
|
-
thickness,
|
|
153
|
-
transformationMatrix[outOfPlaneAxisIndex],
|
|
154
|
-
) as Vector3DSchema;
|
|
155
|
-
transformationMatrix[vxIndex] = MULT(vx, transformationMatrix[vxIndex]) as Vector3DSchema;
|
|
156
|
-
transformationMatrix[vyIndex] = MULT(vy, transformationMatrix[vyIndex]) as Vector3DSchema;
|
|
157
|
-
|
|
158
|
-
return transformationMatrix as Matrix3X3Schema;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export type SlabConfigSchema = MaterialSchema & {
|
|
162
|
-
outOfPlaneAxisIndex: number;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
/*
|
|
166
|
-
* Generate a config object for a surface based on a set of parameters.
|
|
167
|
-
* @param material {Material} The parent material (bulk) this surface is constructed from
|
|
168
|
-
* @param millerIndices {Number[]} Miller Indices that define the surface cleavage.
|
|
169
|
-
* @param numberOfLayers {Number} Surface (Slab) thickness in layers (Positive Integer).
|
|
170
|
-
* @param vx {Number} Size of lateral supercell along the direction of the first (x) cell vector (Positive Integer).
|
|
171
|
-
* @param vy {Number} Size of lateral supercell along the direction of the second (y) cell vector (Positive Integer).
|
|
172
|
-
* @return {Object}
|
|
173
|
-
*/
|
|
174
|
-
function generateConfig(
|
|
175
|
-
material: Material,
|
|
176
|
-
millerIndices: Coordinate3DSchema,
|
|
177
|
-
numberOfLayers = 1,
|
|
178
|
-
vx = 1,
|
|
179
|
-
vy = 1,
|
|
180
|
-
): SlabConfigSchema {
|
|
181
|
-
if (numberOfLayers < 1)
|
|
182
|
-
throw new Error("Made.tools.surface.generateConfig: number of layers < 1.");
|
|
183
|
-
|
|
184
|
-
const cell = material.Lattice.vectors;
|
|
185
|
-
const millerScalingMatrix = getMillerScalingMatrix(cell, millerIndices);
|
|
186
|
-
const millerSupercell = cell.cloneAndScaleByMatrix(millerScalingMatrix);
|
|
187
|
-
const millerPlanePseudoNormal = cell.convertPointToCartesian(millerIndices);
|
|
188
|
-
const outOfPlaneAxisIndex =
|
|
189
|
-
millerSupercell.getMostCollinearVectorIndex(millerPlanePseudoNormal);
|
|
190
|
-
const dimensionsScalingMatrix = getDimensionsScalingMatrix(
|
|
191
|
-
outOfPlaneAxisIndex,
|
|
192
|
-
numberOfLayers,
|
|
193
|
-
vx,
|
|
194
|
-
vy,
|
|
195
|
-
);
|
|
196
|
-
const supercellMatrix = MULT(dimensionsScalingMatrix, millerScalingMatrix);
|
|
197
|
-
const supercell = millerSupercell.cloneAndScaleByMatrix(dimensionsScalingMatrix);
|
|
198
|
-
const tempBasis = material.Basis.clone();
|
|
199
|
-
const newBasis = SupercellTools.generateNewBasisWithinSupercell(
|
|
200
|
-
tempBasis,
|
|
201
|
-
cell,
|
|
202
|
-
supercell,
|
|
203
|
-
supercellMatrix as Matrix3X3Schema,
|
|
204
|
-
);
|
|
205
|
-
const newLattice = Lattice.fromVectors({
|
|
206
|
-
a: supercell.vectorArrays[0],
|
|
207
|
-
b: supercell.vectorArrays[1],
|
|
208
|
-
c: supercell.vectorArrays[2],
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
return {
|
|
212
|
-
name: `${material.name} - slab ${JSON.stringify(millerIndices)}`,
|
|
213
|
-
basis: newBasis.toJSON(),
|
|
214
|
-
lattice: newLattice.toJSON(),
|
|
215
|
-
// extra parameter for use in creating vacuum etc.
|
|
216
|
-
outOfPlaneAxisIndex,
|
|
217
|
-
metadata: {},
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export default {
|
|
222
|
-
generateConfig,
|
|
223
|
-
};
|
package/src/py/__init__.py
DELETED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import warnings
|
|
2
|
-
|
|
3
|
-
from pydantic.warnings import PydanticDeprecatedSince20
|
|
4
|
-
|
|
5
|
-
warnings.filterwarnings("ignore", category=DeprecationWarning, module="typing_extensions")
|
|
6
|
-
warnings.filterwarnings("ignore", category=UserWarning, module="pydantic")
|
|
7
|
-
warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20)
|