@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
|
-
import { ArrayWithIds, ValueWithId } from "@mat3ra/code";
|
|
2
|
-
import { AtomicConstraintSchema } from "@mat3ra/esse/dist/js/types";
|
|
3
|
-
|
|
4
|
-
export type AtomicConstraintValue = AtomicConstraintSchema["value"];
|
|
5
|
-
|
|
6
|
-
export class Constraint extends ValueWithId<AtomicConstraintValue> {
|
|
7
|
-
value: AtomicConstraintValue;
|
|
8
|
-
|
|
9
|
-
constructor({ value, id }: AtomicConstraintSchema) {
|
|
10
|
-
super({ id, value });
|
|
11
|
-
this.value = value;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getValueAsString(): string {
|
|
15
|
-
return this.value.map((x) => (x ? 1 : 0)).join(" ");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
prettyPrint(): string {
|
|
19
|
-
return this.value.map((x) => (x ? 1 : 0)).join(" ");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// By default, the constraint is unconstrained if all values are 1/true.
|
|
23
|
-
isUnconstrained(): boolean {
|
|
24
|
-
return this.value.every((val) => val);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export class AtomicConstraints extends ArrayWithIds<AtomicConstraintValue> {
|
|
29
|
-
/**
|
|
30
|
-
* Get constraints for an atom with index as string.
|
|
31
|
-
* @param idx - atom index.
|
|
32
|
-
* @param mapFn (OPTIONAL) - a function to be applied to each constraint. By default 0 or 1 is returned.
|
|
33
|
-
*/
|
|
34
|
-
getAsStringByIndex(idx: number, mapFn = (val: boolean): string => (val ? "1" : "0")): string {
|
|
35
|
-
const constraints = this.getElementValueByIndex(idx);
|
|
36
|
-
return constraints ? constraints.map(mapFn).join(" ") : "";
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
get areUnconstrained(): boolean {
|
|
40
|
-
return this.values.every((constraint) => {
|
|
41
|
-
const _constraint = Constraint.fromValueAndId(constraint);
|
|
42
|
-
return _constraint.isUnconstrained();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
2
|
-
import {
|
|
3
|
-
Coordinate3DSchema,
|
|
4
|
-
LatticeSchema,
|
|
5
|
-
LatticeTypeEnum,
|
|
6
|
-
LatticeTypeExtendedEnum,
|
|
7
|
-
LatticeVectorsSchema,
|
|
8
|
-
Matrix3X3Schema,
|
|
9
|
-
} from "@mat3ra/esse/dist/js/types";
|
|
10
|
-
import { Utils } from "@mat3ra/utils";
|
|
11
|
-
import * as lodash from "lodash";
|
|
12
|
-
|
|
13
|
-
import { Cell } from "../cell/cell";
|
|
14
|
-
import { getPrimitiveLatticeVectorsFromConfig } from "../cell/primitive_cell";
|
|
15
|
-
import { LATTICE_TYPE_CONFIGS } from "./lattice_types";
|
|
16
|
-
import { UnitCell, UnitCellProps } from "./unit_cell";
|
|
17
|
-
|
|
18
|
-
const { HASH_TOLERANCE } = Utils.constants;
|
|
19
|
-
/**
|
|
20
|
-
* Scaling factor used to calculate the new lattice size for non-periodic systems.
|
|
21
|
-
* The scaling factor ensures that a non-periodic structure will have have a lattice greater than the structures size.
|
|
22
|
-
*/
|
|
23
|
-
export {
|
|
24
|
-
defaultNonPeriodicMinimumLatticeSize,
|
|
25
|
-
diatomicLatticePaddingFactor,
|
|
26
|
-
molecularLatticePaddingFactor,
|
|
27
|
-
} from "../constants/molecule";
|
|
28
|
-
|
|
29
|
-
export class LatticeVectors extends Cell implements LatticeVectorsSchema {}
|
|
30
|
-
|
|
31
|
-
export type { LatticeVectorsSchema };
|
|
32
|
-
|
|
33
|
-
export class Lattice extends InMemoryEntity implements LatticeSchema {
|
|
34
|
-
static defaultConfig: LatticeSchema = {
|
|
35
|
-
a: 1,
|
|
36
|
-
b: 1,
|
|
37
|
-
c: 1,
|
|
38
|
-
alpha: 90,
|
|
39
|
-
beta: 90,
|
|
40
|
-
gamma: 90,
|
|
41
|
-
units: { length: "angstrom", angle: "degree" },
|
|
42
|
-
type: "CUB",
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
a: LatticeSchema["a"];
|
|
46
|
-
|
|
47
|
-
b: LatticeSchema["b"];
|
|
48
|
-
|
|
49
|
-
c: LatticeSchema["c"];
|
|
50
|
-
|
|
51
|
-
alpha: LatticeSchema["alpha"];
|
|
52
|
-
|
|
53
|
-
beta: LatticeSchema["beta"];
|
|
54
|
-
|
|
55
|
-
gamma: LatticeSchema["gamma"];
|
|
56
|
-
|
|
57
|
-
type: LatticeTypeEnum = "TRI";
|
|
58
|
-
|
|
59
|
-
units: LatticeSchema["units"];
|
|
60
|
-
|
|
61
|
-
constructor(config: LatticeSchema = Lattice.defaultConfig) {
|
|
62
|
-
super(config);
|
|
63
|
-
const { a, b, c, alpha, beta, gamma, units, type } = config;
|
|
64
|
-
this.a = a;
|
|
65
|
-
this.b = b;
|
|
66
|
-
this.c = c;
|
|
67
|
-
this.alpha = alpha;
|
|
68
|
-
this.beta = beta;
|
|
69
|
-
this.gamma = gamma;
|
|
70
|
-
this.units = units;
|
|
71
|
-
this.type = type || "TRI";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
static fromConfig(config: object): Lattice {
|
|
75
|
-
const latticeConfig = config as LatticeSchema;
|
|
76
|
-
return new Lattice(latticeConfig);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static fromConfigPartial(config: LatticeSchema): Lattice {
|
|
80
|
-
const primitiveLatticeConfig = Lattice.getDefaultPrimitiveLatticeConfigByType(config);
|
|
81
|
-
return new Lattice(primitiveLatticeConfig);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
calculateVectors(): Matrix3X3Schema {
|
|
85
|
-
const { a } = this;
|
|
86
|
-
const { b } = this;
|
|
87
|
-
const { c } = this;
|
|
88
|
-
|
|
89
|
-
const alphaRad = Utils.math.unit(this.alpha, "deg").toNumber("rad");
|
|
90
|
-
const betaRad = Utils.math.unit(this.beta, "deg").toNumber("rad");
|
|
91
|
-
const gammaRad = Utils.math.unit(this.gamma, "deg").toNumber("rad");
|
|
92
|
-
|
|
93
|
-
const cosAlpha = Utils.math.cos(alphaRad);
|
|
94
|
-
const cosBeta = Utils.math.cos(betaRad);
|
|
95
|
-
const cosGamma = Utils.math.cos(gammaRad);
|
|
96
|
-
const sinAlpha = Utils.math.sin(alphaRad);
|
|
97
|
-
const sinBeta = Utils.math.sin(betaRad);
|
|
98
|
-
|
|
99
|
-
const gammaStar = Utils.math.acos((cosAlpha * cosBeta - cosGamma) / (sinAlpha * sinBeta));
|
|
100
|
-
// @ts-ignore - mathjs v12 acos return type includes Complex, but inputs are always real
|
|
101
|
-
const cosGammaStar = Utils.math.cos(gammaStar);
|
|
102
|
-
// @ts-ignore
|
|
103
|
-
const sinGammaStar = Utils.math.sin(gammaStar);
|
|
104
|
-
|
|
105
|
-
const vectorA: Coordinate3DSchema = [a * sinBeta, 0.0, a * cosBeta];
|
|
106
|
-
const vectorB: Coordinate3DSchema = [
|
|
107
|
-
-b * sinAlpha * cosGammaStar,
|
|
108
|
-
b * sinAlpha * sinGammaStar,
|
|
109
|
-
b * cosAlpha,
|
|
110
|
-
];
|
|
111
|
-
const vectorC: Coordinate3DSchema = [0.0, 0.0, c];
|
|
112
|
-
|
|
113
|
-
return [vectorA, vectorB, vectorC];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
static fromVectors(config: LatticeVectorsSchema): Lattice {
|
|
117
|
-
return this.fromVectorsArray([config.a, config.b, config.c]);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
static fromVectorsArray(
|
|
121
|
-
vectors: Matrix3X3Schema,
|
|
122
|
-
units: LatticeSchema["units"] = Lattice.defaultConfig.units,
|
|
123
|
-
type: LatticeTypeEnum = "TRI",
|
|
124
|
-
): Lattice {
|
|
125
|
-
const [aVec, bVec, cVec] = vectors;
|
|
126
|
-
const a = Utils.math.vlen(aVec);
|
|
127
|
-
const b = Utils.math.vlen(bVec);
|
|
128
|
-
const c = Utils.math.vlen(cVec);
|
|
129
|
-
const alpha = Utils.math.angle(bVec, cVec, "deg");
|
|
130
|
-
const beta = Utils.math.angle(aVec, cVec, "deg");
|
|
131
|
-
const gamma = Utils.math.angle(aVec, bVec, "deg");
|
|
132
|
-
|
|
133
|
-
return new Lattice({
|
|
134
|
-
a,
|
|
135
|
-
b,
|
|
136
|
-
c,
|
|
137
|
-
alpha,
|
|
138
|
-
beta,
|
|
139
|
-
gamma,
|
|
140
|
-
units,
|
|
141
|
-
type,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// TODO: remove
|
|
146
|
-
get unitCell() {
|
|
147
|
-
const units = this.units?.length || "angstrom";
|
|
148
|
-
const vectors = [...lodash.flatten(this.vectorArrays), units] as UnitCellProps;
|
|
149
|
-
return new UnitCell(vectors);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
get vectors(): LatticeVectors {
|
|
153
|
-
return LatticeVectors.fromVectorsArray(this.calculateVectors());
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
get vectorArrays(): Matrix3X3Schema {
|
|
157
|
-
return this.vectors.vectorArrays;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
get vectorArraysRounded(): Matrix3X3Schema {
|
|
161
|
-
return this.vectors.vectorArraysRounded;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
get cellVolume(): number {
|
|
165
|
-
return this.vectors.volume;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
get cellVolumeRounded(): number {
|
|
169
|
-
return this.vectors.volumeRounded;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Get a short label for the type of the lattice, eg. "MCLC".
|
|
174
|
-
*/
|
|
175
|
-
get typeLabel(): string {
|
|
176
|
-
return lodash.get(
|
|
177
|
-
LATTICE_TYPE_CONFIGS.find((c) => c.code === this.type),
|
|
178
|
-
"label",
|
|
179
|
-
"Unknown",
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Get a short label for the extended type of the lattice, eg. "MCLC-5".
|
|
185
|
-
*/
|
|
186
|
-
get typeExtended(): LatticeTypeExtendedEnum {
|
|
187
|
-
const { a, b, c, alpha, beta, gamma, type } = this;
|
|
188
|
-
const cosAlpha = Utils.math.cos((alpha / 180) * Utils.math.PI);
|
|
189
|
-
|
|
190
|
-
switch (type) {
|
|
191
|
-
case "BCT":
|
|
192
|
-
return c < a ? "BCT-1" : "BCT-2";
|
|
193
|
-
case "ORCF":
|
|
194
|
-
if (1 / (a * a) >= 1 / (b * b) + 1 / (c * c)) {
|
|
195
|
-
return "ORCF-1";
|
|
196
|
-
}
|
|
197
|
-
return "ORCF-2";
|
|
198
|
-
case "RHL":
|
|
199
|
-
return cosAlpha > 0 ? "RHL-1" : "RHL-2";
|
|
200
|
-
case "MCLC":
|
|
201
|
-
if (gamma >= 90) {
|
|
202
|
-
// MCLC-1,2
|
|
203
|
-
return "MCLC-1";
|
|
204
|
-
}
|
|
205
|
-
if ((b / c) * cosAlpha + ((b * b) / (a * a)) * (1 - cosAlpha * cosAlpha) <= 1) {
|
|
206
|
-
// MCLC-3,4
|
|
207
|
-
return "MCLC-3";
|
|
208
|
-
}
|
|
209
|
-
return "MCLC-5";
|
|
210
|
-
case "TRI":
|
|
211
|
-
if (alpha > 90 && beta > 90 && gamma >= 90) {
|
|
212
|
-
// TRI-1a,2a
|
|
213
|
-
return "TRI_1a";
|
|
214
|
-
}
|
|
215
|
-
return "TRI_1b";
|
|
216
|
-
default:
|
|
217
|
-
return type;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Calculate the volume of the lattice cell.
|
|
223
|
-
*/
|
|
224
|
-
get volume(): number {
|
|
225
|
-
return Utils.math.abs(Utils.math.det(this.vectorArrays));
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/*
|
|
229
|
-
* Returns a "default" primitive lattice by type, with lattice parameters scaled by the length of "a",
|
|
230
|
-
* @param latticeConfig {Object} LatticeBravais config (see constructor)
|
|
231
|
-
*/
|
|
232
|
-
static getDefaultPrimitiveLatticeConfigByType(latticeConfig: LatticeSchema) {
|
|
233
|
-
const f_ = Utils.math.roundArrayOrNumber;
|
|
234
|
-
// construct new primitive cell using lattice parameters and skip rounding the vectors
|
|
235
|
-
const vectors = getPrimitiveLatticeVectorsFromConfig(latticeConfig);
|
|
236
|
-
// create new lattice from primitive cell
|
|
237
|
-
const newLattice = Lattice.fromVectorsArray(vectors, undefined, latticeConfig.type);
|
|
238
|
-
// preserve the new type and scale back the lattice parameters
|
|
239
|
-
const k = latticeConfig.a / newLattice.a;
|
|
240
|
-
|
|
241
|
-
return Object.assign(newLattice.toJSON(), {
|
|
242
|
-
a: f_(newLattice.a * k),
|
|
243
|
-
b: f_(newLattice.b * k),
|
|
244
|
-
c: f_(newLattice.c * k),
|
|
245
|
-
alpha: f_(newLattice.alpha),
|
|
246
|
-
beta: f_(newLattice.beta),
|
|
247
|
-
gamma: f_(newLattice.gamma),
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Returns a string further used for the calculation of an unique hash.
|
|
253
|
-
* @param isScaled - Whether to scale the vectors by the length of the first vector initially.
|
|
254
|
-
*/
|
|
255
|
-
getHashString(isScaled = false): string {
|
|
256
|
-
// lattice vectors must be measured in angstroms
|
|
257
|
-
const scaleK = isScaled ? this.a : 1;
|
|
258
|
-
const scaledLattice = {
|
|
259
|
-
...this,
|
|
260
|
-
a: this.a / scaleK,
|
|
261
|
-
b: this.b / scaleK,
|
|
262
|
-
c: this.c / scaleK,
|
|
263
|
-
};
|
|
264
|
-
// form lattice string
|
|
265
|
-
return `${[
|
|
266
|
-
scaledLattice.a,
|
|
267
|
-
scaledLattice.b,
|
|
268
|
-
scaledLattice.c,
|
|
269
|
-
scaledLattice.alpha,
|
|
270
|
-
scaledLattice.beta,
|
|
271
|
-
scaledLattice.gamma,
|
|
272
|
-
]
|
|
273
|
-
.map((x) => Utils.math.roundCustom(x, HASH_TOLERANCE))
|
|
274
|
-
.join(";")};`;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Get the list of editable keys (eg. 'a', 'alpha') for the current lattice.
|
|
279
|
-
* @return {Object}
|
|
280
|
-
* @example {a: true, b: false, c: false, alpha: true, beta: false, gamma: false}
|
|
281
|
-
*/
|
|
282
|
-
get editables() {
|
|
283
|
-
const object = {};
|
|
284
|
-
const editablesList = LATTICE_TYPE_CONFIGS.find(
|
|
285
|
-
(entry: any) => entry.code === this.type,
|
|
286
|
-
)?.editables;
|
|
287
|
-
// ["a", "gamma"] => {a: true, gamma: true}
|
|
288
|
-
if (editablesList) {
|
|
289
|
-
editablesList.forEach((element: any) => {
|
|
290
|
-
Object.assign(object, {
|
|
291
|
-
[element]: true,
|
|
292
|
-
});
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
return object;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// @ts-ignore
|
|
300
|
-
toJSON(exclude?: string[]): LatticeSchema {
|
|
301
|
-
return {
|
|
302
|
-
...super.toJSON(exclude),
|
|
303
|
-
vectors: this.vectors.toJSON(),
|
|
304
|
-
} as LatticeSchema;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { LatticeTypeEnum } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
|
|
3
|
-
export enum LatticeTypeExtended {
|
|
4
|
-
BCC = "BCC",
|
|
5
|
-
BCT_1 = "BCT-1",
|
|
6
|
-
BCT_2 = "BCT-2",
|
|
7
|
-
CUB = "CUB",
|
|
8
|
-
FCC = "FCC",
|
|
9
|
-
HEX = "HEX",
|
|
10
|
-
MCL = "MCL",
|
|
11
|
-
MCLC_1 = "MCLC-1",
|
|
12
|
-
MCLC_2 = "MCLC-2",
|
|
13
|
-
MCLC_3 = "MCLC-3",
|
|
14
|
-
MCLC_4 = "MCLC-4",
|
|
15
|
-
MCLC_5 = "MCLC-5",
|
|
16
|
-
ORC = "ORC",
|
|
17
|
-
ORCC = "ORCC",
|
|
18
|
-
ORCF_1 = "ORCF-1",
|
|
19
|
-
ORCF_2 = "ORCF-2",
|
|
20
|
-
ORCF_3 = "ORCF-3",
|
|
21
|
-
ORCI = "ORCI",
|
|
22
|
-
RHL_1 = "RHL-1",
|
|
23
|
-
RHL_2 = "RHL-2",
|
|
24
|
-
TET = "TET",
|
|
25
|
-
TRI_1a = "TRI_1a",
|
|
26
|
-
TRI_2a = "TRI_2a",
|
|
27
|
-
TRI_1b = "TRI_1b",
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface LatticeTypeConfig {
|
|
31
|
-
label: string;
|
|
32
|
-
code: LatticeTypeEnum;
|
|
33
|
-
editables: string[];
|
|
34
|
-
editablesConventional: string[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const DEFAULT_LATTICE_UNITS = {
|
|
38
|
-
// by default lattice vectors shall be measured in angstrom, angles - in degrees
|
|
39
|
-
length: {
|
|
40
|
-
angstrom: "angstrom",
|
|
41
|
-
},
|
|
42
|
-
angle: {
|
|
43
|
-
degree: "degree",
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const LATTICE_TYPE_CONFIGS: LatticeTypeConfig[] = [
|
|
48
|
-
{
|
|
49
|
-
label: "Simple Cubic",
|
|
50
|
-
code: "CUB",
|
|
51
|
-
// editables for primitive cell => WARNING: not tested
|
|
52
|
-
editables: ["a"],
|
|
53
|
-
// editables for conventional cell, taken from the publication above
|
|
54
|
-
editablesConventional: ["a"],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
label: "Face-centered Cubic",
|
|
58
|
-
code: "FCC",
|
|
59
|
-
editables: ["a"],
|
|
60
|
-
editablesConventional: ["a"],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
label: "Body-centered Cubic",
|
|
64
|
-
code: "BCC",
|
|
65
|
-
editables: ["a"],
|
|
66
|
-
editablesConventional: ["a"],
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
label: "Tetragonal",
|
|
70
|
-
code: "TET",
|
|
71
|
-
editables: ["a", "c"],
|
|
72
|
-
editablesConventional: ["a", "c"],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
label: "Body-centered Tetragonal",
|
|
76
|
-
code: "BCT",
|
|
77
|
-
editables: ["a"],
|
|
78
|
-
editablesConventional: ["a", "c"],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
label: "Orthorombic",
|
|
82
|
-
code: "ORC",
|
|
83
|
-
editables: ["a", "b", "c"],
|
|
84
|
-
editablesConventional: ["a", "b", "c"],
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
label: "Orthorombic Face-centered",
|
|
88
|
-
code: "ORCF",
|
|
89
|
-
editables: ["a", "b", "c"],
|
|
90
|
-
editablesConventional: ["a", "b", "c"],
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
label: "Orthorombic Body-centered",
|
|
94
|
-
code: "ORCI",
|
|
95
|
-
editables: ["a", "alpha", "gamma"],
|
|
96
|
-
editablesConventional: ["a", "b", "c"],
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
label: "Orthorombic Base-centered",
|
|
100
|
-
code: "ORCC",
|
|
101
|
-
editables: ["a", "c", "alpha"],
|
|
102
|
-
editablesConventional: ["a", "b", "c"],
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
label: "Hexagonal",
|
|
106
|
-
code: "HEX",
|
|
107
|
-
editables: ["a", "c"],
|
|
108
|
-
editablesConventional: ["a", "c"],
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
label: "Rhombohedral",
|
|
112
|
-
code: "RHL",
|
|
113
|
-
editables: ["a", "alpha"],
|
|
114
|
-
editablesConventional: ["a", "alpha"],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
label: "Monoclinic",
|
|
118
|
-
code: "MCL",
|
|
119
|
-
editables: ["a", "b", "c", "alpha"],
|
|
120
|
-
editablesConventional: ["a", "b", "c", "alpha"],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
label: "Monoclinic Base-centered",
|
|
124
|
-
code: "MCLC",
|
|
125
|
-
editables: ["a", "c", "alpha", "gamma"],
|
|
126
|
-
editablesConventional: ["a", "b", "c", "alpha"],
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
label: "Triclinic",
|
|
130
|
-
code: "TRI",
|
|
131
|
-
editables: ["a", "b", "c", "alpha", "beta", "gamma"],
|
|
132
|
-
editablesConventional: ["a", "b", "c", "alpha", "beta", "gamma"],
|
|
133
|
-
},
|
|
134
|
-
];
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { ATOMIC_COORD_UNITS, units as UNITS } from "@mat3ra/code/dist/js/constants";
|
|
2
|
-
import { Vector3DSchema } from "@mat3ra/esse/dist/js/types";
|
|
3
|
-
import { Utils } from "@mat3ra/utils";
|
|
4
|
-
import lodash from "lodash";
|
|
5
|
-
|
|
6
|
-
import { Lattice } from "../lattice";
|
|
7
|
-
import { paths } from "./paths";
|
|
8
|
-
import { symmetryPoints } from "./symmetry_points";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type KPointCoordinates = number[];
|
|
12
|
-
export type KPointPath = Array<{
|
|
13
|
-
point: string;
|
|
14
|
-
steps: number;
|
|
15
|
-
coordinates: KPointCoordinates;
|
|
16
|
-
}>;
|
|
17
|
-
|
|
18
|
-
interface SymmetryPoint {
|
|
19
|
-
point: string;
|
|
20
|
-
coordinates: KPointCoordinates;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface ConversionTable {
|
|
24
|
-
[key: string]: {
|
|
25
|
-
[key: string]: number;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface PathsType {
|
|
30
|
-
[key: string]: Array<{
|
|
31
|
-
point: string;
|
|
32
|
-
steps: number;
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export class ReciprocalLattice extends Lattice {
|
|
37
|
-
/**
|
|
38
|
-
* Get reciprocal vectors for the current Lattice in cartesian (2pi / a) units
|
|
39
|
-
* @return {Vector3DSchema[]}
|
|
40
|
-
*/
|
|
41
|
-
get reciprocalVectors(): Vector3DSchema[] {
|
|
42
|
-
const vectors_: Vector3DSchema[] = this.vectors.vectorArrays as Vector3DSchema[];
|
|
43
|
-
const a: number = Utils.math.vlen(vectors_[0]);
|
|
44
|
-
const divider: number =
|
|
45
|
-
(Utils.math.multiply(
|
|
46
|
-
vectors_[0],
|
|
47
|
-
Utils.math.cross(vectors_[1], vectors_[2]),
|
|
48
|
-
) as unknown as number) / a;
|
|
49
|
-
return [
|
|
50
|
-
Utils.math.multiply(Utils.math.cross(vectors_[1], vectors_[2]), 1 / divider) as Vector3DSchema,
|
|
51
|
-
Utils.math.multiply(Utils.math.cross(vectors_[2], vectors_[0]), 1 / divider) as Vector3DSchema,
|
|
52
|
-
Utils.math.multiply(Utils.math.cross(vectors_[0], vectors_[1]), 1 / divider) as Vector3DSchema,
|
|
53
|
-
];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Norms of reciprocal vectors.
|
|
58
|
-
*/
|
|
59
|
-
get reciprocalVectorNorms(): Vector3DSchema {
|
|
60
|
-
return this.reciprocalVectors.map((vec) => Utils.math.norm(vec) as number) as Vector3DSchema;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Ratio of reciprocal vector norms scaled by the inverse of the largest component.
|
|
65
|
-
*/
|
|
66
|
-
get reciprocalVectorRatios(): Vector3DSchema {
|
|
67
|
-
const norms: number[] = this.reciprocalVectorNorms;
|
|
68
|
-
const maxNorm: number = Utils.math.max(...norms) as number;
|
|
69
|
-
return norms.map((n: number) => n / maxNorm) as Vector3DSchema;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Get point (in crystal coordinates) in cartesian coordinates.
|
|
74
|
-
* @param {KPointCoordinates} point - point in 3D space
|
|
75
|
-
* @return {KPointCoordinates}
|
|
76
|
-
*/
|
|
77
|
-
getCartesianCoordinates(point: KPointCoordinates): KPointCoordinates {
|
|
78
|
-
return Utils.math.multiply(point, this.reciprocalVectors) as KPointCoordinates;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get the list of high-symmetry points for the current lattice.
|
|
83
|
-
* @return {SymmetryPoint[]}
|
|
84
|
-
*/
|
|
85
|
-
get symmetryPoints(): SymmetryPoint[] {
|
|
86
|
-
return symmetryPoints(this);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Get the default path in reciprocal space for the current lattice.
|
|
91
|
-
* @return {Array<{point: string; steps: number}>}
|
|
92
|
-
*/
|
|
93
|
-
get defaultKpointPath(): Array<{ point: string; steps: number }> {
|
|
94
|
-
const pathsObj = paths as PathsType;
|
|
95
|
-
return pathsObj[this.typeExtended as string] || pathsObj[this.type as string] || [];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Find/mark the high symmetry points on a list with raw data and return the edited list.
|
|
100
|
-
* @param {KPointCoordinates[]} dataPoints - list of point coordinates
|
|
101
|
-
* @return {KPointPath}
|
|
102
|
-
*/
|
|
103
|
-
extractKpointPath(dataPoints: KPointCoordinates[] = []): KPointPath {
|
|
104
|
-
const kpointPath: KPointPath = [];
|
|
105
|
-
const symmPoints: SymmetryPoint[] = this.symmetryPoints;
|
|
106
|
-
|
|
107
|
-
dataPoints.forEach((point: KPointCoordinates, index: number) => {
|
|
108
|
-
const symmPoint: SymmetryPoint | undefined = symmPoints.find((x) => {
|
|
109
|
-
return Utils.math.vEqualWithTolerance(x.coordinates, point, 1e-4);
|
|
110
|
-
});
|
|
111
|
-
if (symmPoint) {
|
|
112
|
-
kpointPath.push({
|
|
113
|
-
point: symmPoint.point,
|
|
114
|
-
steps: index,
|
|
115
|
-
coordinates: symmPoint.coordinates,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
return kpointPath;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Calculate grid dimension based on reciprocal lattice vectors.
|
|
124
|
-
* @param {number} nPoints - Total number of points
|
|
125
|
-
* @param {number} index - Index of reciprocal vector
|
|
126
|
-
* @return {number} - Grid dimension in direction of reciprocal vector
|
|
127
|
-
* @todo This could be moved to a separate KGrid class.
|
|
128
|
-
*/
|
|
129
|
-
calculateDimension(nPoints: number, index: number): number {
|
|
130
|
-
const norms: number[] = this.reciprocalVectorNorms;
|
|
131
|
-
const [j, k] = [0, 1, 2].filter((i) => i !== index); // get indices of other two dimensions
|
|
132
|
-
const N: number = Utils.math.cbrt(
|
|
133
|
-
(nPoints * norms[index] ** 2) / (norms[j] * norms[k]),
|
|
134
|
-
) as number;
|
|
135
|
-
return Utils.math.max(1, Utils.math.ceil(N)) as number;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Calculate grid dimensions from total number of k-points.
|
|
140
|
-
* @param {number} nKpoints - Total number of k-points.
|
|
141
|
-
* @return Grid dimensions
|
|
142
|
-
*/
|
|
143
|
-
getDimensionsFromPointsCount(nKpoints: number) {
|
|
144
|
-
const indices = [0, 1, 2] as const;
|
|
145
|
-
return indices.map((i) => this.calculateDimension(nKpoints, i)) as Vector3DSchema;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
get conversionTable(): ConversionTable {
|
|
149
|
-
const { a } = this;
|
|
150
|
-
return {
|
|
151
|
-
[ATOMIC_COORD_UNITS.cartesian]: {
|
|
152
|
-
[UNITS.angstrom]: (2 * Utils.math.PI) / a,
|
|
153
|
-
},
|
|
154
|
-
[UNITS.angstrom]: {
|
|
155
|
-
[ATOMIC_COORD_UNITS.cartesian]: a / (2 * Utils.math.PI),
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Calculate grid dimensions from k-point spacing, i.e.
|
|
162
|
-
* the maximum distance between adjacent points along a reciprocal axis.
|
|
163
|
-
* Note: just as the lattice vectors spacing is in cartesian (2pi / a) units by default
|
|
164
|
-
* @param {number} spacing - maximum Spacing between k-points
|
|
165
|
-
* @param {string} units - units of spacing parameter (default: 2pi / a)
|
|
166
|
-
*/
|
|
167
|
-
getDimensionsFromSpacing(spacing: number, units: string = ATOMIC_COORD_UNITS.cartesian) {
|
|
168
|
-
const factor: number = this.conversionTable[units][ATOMIC_COORD_UNITS.cartesian] || 1;
|
|
169
|
-
return this.reciprocalVectorNorms.map((norm: number) => {
|
|
170
|
-
return Utils.math.max(1, Utils.math.ceil(lodash.round(norm / (spacing * factor), 4))) as number;
|
|
171
|
-
}) as Vector3DSchema;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Calculate grid spacing as average of spacing along individual reciprocal axes.
|
|
176
|
-
* @param {number[]} dimensions - Array of dimensions
|
|
177
|
-
* @param {string} units - units of spacing parameter (default: 2pi / a)
|
|
178
|
-
* @return {number} - average grid spacing
|
|
179
|
-
*/
|
|
180
|
-
getSpacingFromDimensions(
|
|
181
|
-
dimensions: number[],
|
|
182
|
-
units: string = ATOMIC_COORD_UNITS.cartesian,
|
|
183
|
-
): number {
|
|
184
|
-
const factor: number = this.conversionTable[ATOMIC_COORD_UNITS.cartesian][units] || 1;
|
|
185
|
-
const norms: number[] = this.reciprocalVectorNorms;
|
|
186
|
-
return (
|
|
187
|
-
factor *
|
|
188
|
-
(Utils.math.mean(
|
|
189
|
-
dimensions.map((dim: number, i: number) => norms[i] / Utils.math.max(1, dim)),
|
|
190
|
-
) as number)
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
}
|