@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/basis/basis.ts
DELETED
|
@@ -1,621 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { getElectronegativity, getElementAtomicRadius } from "@exabyte-io/periodic-table.js";
|
|
3
|
-
import { InMemoryEntity } from "@mat3ra/code/dist/js/entity";
|
|
4
|
-
import { BasisSchema, Coordinate3DSchema, Vector3DSchema } from "@mat3ra/esse/dist/js/types";
|
|
5
|
-
import { Utils } from "@mat3ra/utils";
|
|
6
|
-
import { chain, toPairs, uniq, values } from "lodash";
|
|
7
|
-
|
|
8
|
-
import { Cell } from "../cell/cell";
|
|
9
|
-
import { ATOMIC_COORD_UNITS, HASH_TOLERANCE } from "../constants";
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
defaultNonPeriodicMinimumLatticeSize,
|
|
13
|
-
diatomicLatticePaddingFactor,
|
|
14
|
-
molecularLatticePaddingFactor,
|
|
15
|
-
} from "../lattice/lattice";
|
|
16
|
-
import { AtomicCoordinateValue, Coordinates } from "./coordinates";
|
|
17
|
-
import { AtomicElementValue, Elements } from "./elements";
|
|
18
|
-
import { AtomicLabelValue, Labels } from "./labels";
|
|
19
|
-
|
|
20
|
-
export interface ElementWithCoordinate {
|
|
21
|
-
id?: number; // numeric id of the element (optional).
|
|
22
|
-
element: AtomicElementValue; // Chemical element
|
|
23
|
-
coordinate: AtomicCoordinateValue; // Coordinates of the element
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface ElementCount {
|
|
27
|
-
count: number;
|
|
28
|
-
value: AtomicElementValue;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface Overlap {
|
|
32
|
-
id1: number;
|
|
33
|
-
id2: number;
|
|
34
|
-
element1: AtomicElementValue;
|
|
35
|
-
element2: AtomicElementValue;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface BasisConfig extends BasisSchema {
|
|
39
|
-
cell?: Cell;
|
|
40
|
-
isEmpty?: boolean;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface ElementsAndCoordinatesConfig {
|
|
44
|
-
elements: AtomicElementValue[];
|
|
45
|
-
coordinates: AtomicCoordinateValue[];
|
|
46
|
-
labels?: AtomicLabelValue[];
|
|
47
|
-
units?: BasisSchema["units"];
|
|
48
|
-
cell?: Cell;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const DEFAULT_BASIS_CONFIG = {
|
|
52
|
-
elements: [
|
|
53
|
-
{
|
|
54
|
-
id: 0,
|
|
55
|
-
value: "Si",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: 1,
|
|
59
|
-
value: "Si",
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
coordinates: [
|
|
63
|
-
{
|
|
64
|
-
id: 0,
|
|
65
|
-
value: [0, 0, 0],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: 1,
|
|
69
|
-
value: [0.25, 0.25, 0.25],
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
units: "crystal",
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export class Basis extends InMemoryEntity implements BasisSchema {
|
|
76
|
-
static defaultConfig: BasisSchema = DEFAULT_BASIS_CONFIG as BasisSchema;
|
|
77
|
-
|
|
78
|
-
units: BasisSchema["units"];
|
|
79
|
-
|
|
80
|
-
cell: Cell;
|
|
81
|
-
|
|
82
|
-
_elements: Elements;
|
|
83
|
-
|
|
84
|
-
_coordinates: Coordinates;
|
|
85
|
-
|
|
86
|
-
_labels: Labels;
|
|
87
|
-
|
|
88
|
-
static _convertValuesToConfig({
|
|
89
|
-
elements = [],
|
|
90
|
-
coordinates = [],
|
|
91
|
-
units = ATOMIC_COORD_UNITS.crystal as BasisSchema["units"],
|
|
92
|
-
cell = new Cell(),
|
|
93
|
-
labels = [],
|
|
94
|
-
}: ElementsAndCoordinatesConfig): BasisConfig {
|
|
95
|
-
const elementsArrayWithIdsJSON = Elements.fromValues(elements).toJSON();
|
|
96
|
-
const coordinatesArrayWithIdsJSON = Coordinates.fromValues(coordinates).toJSON();
|
|
97
|
-
const labelsArrayWithIdsJSON = Labels.fromValues(labels).toJSON();
|
|
98
|
-
return {
|
|
99
|
-
elements: elementsArrayWithIdsJSON as BasisSchema["elements"],
|
|
100
|
-
coordinates: coordinatesArrayWithIdsJSON as BasisSchema["coordinates"],
|
|
101
|
-
units,
|
|
102
|
-
cell,
|
|
103
|
-
labels: labelsArrayWithIdsJSON as BasisSchema["labels"],
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
static fromElementsAndCoordinates({
|
|
108
|
-
elements = [],
|
|
109
|
-
coordinates = [],
|
|
110
|
-
units = ATOMIC_COORD_UNITS.crystal as BasisSchema["units"],
|
|
111
|
-
cell = new Cell(),
|
|
112
|
-
labels = [],
|
|
113
|
-
}: ElementsAndCoordinatesConfig): Basis {
|
|
114
|
-
return new Basis(
|
|
115
|
-
Basis._convertValuesToConfig({
|
|
116
|
-
elements,
|
|
117
|
-
coordinates,
|
|
118
|
-
units,
|
|
119
|
-
cell,
|
|
120
|
-
labels,
|
|
121
|
-
}),
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
constructor(config: BasisConfig = Basis.defaultConfig) {
|
|
126
|
-
super(config);
|
|
127
|
-
const { elements, coordinates, units, labels } = config;
|
|
128
|
-
this.cell = new Cell(config.cell);
|
|
129
|
-
this.units = units || (ATOMIC_COORD_UNITS.crystal as BasisSchema["units"]);
|
|
130
|
-
this._elements = Elements.fromObjects(elements);
|
|
131
|
-
this._coordinates = Coordinates.fromObjects(coordinates);
|
|
132
|
-
this._labels = Labels.fromObjects(labels || []);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
get elements(): BasisSchema["elements"] {
|
|
136
|
-
return this._elements.toJSON() as BasisSchema["elements"];
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
set elements(elements: BasisSchema["elements"]) {
|
|
140
|
-
this._elements = Elements.fromObjects(elements);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
get coordinates(): BasisSchema["coordinates"] {
|
|
144
|
-
return this._coordinates.toJSON() as BasisSchema["coordinates"];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
set coordinates(coordinates: BasisSchema["coordinates"]) {
|
|
148
|
-
this._coordinates = Coordinates.fromObjects(coordinates);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
get labels(): BasisSchema["labels"] {
|
|
152
|
-
return this._labels.toJSON() as BasisSchema["labels"];
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
set labels(labels: BasisSchema["labels"]) {
|
|
156
|
-
this._labels = Labels.fromObjects(labels || []);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// TODO: figure out how to override toJSON in the parent class with generic classes
|
|
160
|
-
// @ts-ignore
|
|
161
|
-
toJSON(exclude: string[] = ["cell"]): BasisSchema {
|
|
162
|
-
return {
|
|
163
|
-
...super.toJSON(exclude),
|
|
164
|
-
elements: this.elements,
|
|
165
|
-
coordinates: this.coordinates,
|
|
166
|
-
units: this.units,
|
|
167
|
-
...(this.labels?.length ? { labels: this.labels } : {}),
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// @ts-ignore
|
|
172
|
-
override clone(): Basis {
|
|
173
|
-
const instance = super.clone();
|
|
174
|
-
instance.cell = this.cell.clone();
|
|
175
|
-
return instance;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
removeAllAtoms() {
|
|
179
|
-
this.elements = [];
|
|
180
|
-
this.coordinates = [];
|
|
181
|
-
this.labels = [];
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
get cellRounded() {
|
|
185
|
-
return this.cell.vectorArraysRounded;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
get elementsArray(): object[] {
|
|
189
|
-
return this._elements.toJSON();
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
getElementsAsObject(): BasisSchema["elements"] {
|
|
193
|
-
return this.elements;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
get coordinatesAsArray() {
|
|
197
|
-
return this._coordinates.values;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
get isInCartesianUnits(): boolean {
|
|
201
|
-
return this.units === ATOMIC_COORD_UNITS.cartesian;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
get isInCrystalUnits(): boolean {
|
|
205
|
-
return this.units === ATOMIC_COORD_UNITS.crystal;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
toCartesian(): void {
|
|
209
|
-
if (this.isInCartesianUnits) return;
|
|
210
|
-
this._coordinates.mapArrayInPlace((point) => this.cell.convertPointToCartesian(point));
|
|
211
|
-
this.units = ATOMIC_COORD_UNITS.cartesian as BasisSchema["units"];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
toCrystal(): void {
|
|
215
|
-
if (this.isInCrystalUnits) return;
|
|
216
|
-
this._coordinates.mapArrayInPlace((point) => this.cell.convertPointToCrystal(point));
|
|
217
|
-
this.units = ATOMIC_COORD_UNITS.crystal as BasisSchema["units"];
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
getElementByIndex(idx: number): AtomicElementValue {
|
|
221
|
-
return this._elements.getElementValueByIndex(idx) as AtomicElementValue;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
getElementById(id: number): AtomicElementValue {
|
|
225
|
-
const result = this._elements.getElementValueById(id) as AtomicElementValue;
|
|
226
|
-
if (result) {
|
|
227
|
-
return result;
|
|
228
|
-
}
|
|
229
|
-
throw new Error(`Element with index ${id} not found`);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
getCoordinateValueByIndex(idx: number): AtomicCoordinateValue {
|
|
233
|
-
const value = this._coordinates.getElementValueByIndex(idx);
|
|
234
|
-
if (value) {
|
|
235
|
-
return value as AtomicCoordinateValue;
|
|
236
|
-
}
|
|
237
|
-
throw new Error(`Coordinate with index ${idx} not found`);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
getCoordinateValueById(id: number): AtomicCoordinateValue {
|
|
241
|
-
const coordinate = this._coordinates.getElementValueById(id);
|
|
242
|
-
if (coordinate) {
|
|
243
|
-
return coordinate as AtomicCoordinateValue;
|
|
244
|
-
}
|
|
245
|
-
throw new Error(`Coordinate with index ${id} not found`);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
toStandardRepresentation() {
|
|
249
|
-
this.toCrystal();
|
|
250
|
-
this._coordinates.mapArrayInPlace(
|
|
251
|
-
(point) => point.map((x) => Utils.math.mod(x)) as Coordinate3DSchema,
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/** A representation where all coordinates are within 0 and 1 in crystal units */
|
|
256
|
-
get standardRepresentation(): BasisSchema {
|
|
257
|
-
const originalIsInCartesianUnits = this.isInCartesianUnits;
|
|
258
|
-
|
|
259
|
-
this.toStandardRepresentation();
|
|
260
|
-
const result = this.toJSON();
|
|
261
|
-
|
|
262
|
-
if (originalIsInCartesianUnits) this.toCartesian();
|
|
263
|
-
|
|
264
|
-
return result as BasisSchema;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Add atom with a chemical element at coordinate.
|
|
269
|
-
*/
|
|
270
|
-
addAtom({ element = "Si", coordinate = [0.5, 0.5, 0.5] }: ElementWithCoordinate) {
|
|
271
|
-
this._elements.addItem(element);
|
|
272
|
-
this._coordinates.addItem(coordinate);
|
|
273
|
-
this.coordinates = this._coordinates.toJSON() as BasisSchema["coordinates"];
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Remove atom with a chemical element at coordinate either by passing the (element AND coordinate) OR id.
|
|
278
|
-
*/
|
|
279
|
-
removeAtom({ element, coordinate, id }: ElementWithCoordinate) {
|
|
280
|
-
if (element && coordinate) {
|
|
281
|
-
const coordinateId = this._coordinates.getElementIdByValue(coordinate) || -1;
|
|
282
|
-
this._elements.removeItem(coordinateId, id);
|
|
283
|
-
this._coordinates.removeItem(coordinateId, id);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Unique names (symbols) of the chemical elements basis. E.g. `['Si', 'Li']`
|
|
289
|
-
*/
|
|
290
|
-
get uniqueElements(): AtomicElementValue[] {
|
|
291
|
-
return uniq(this._elements.values);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Returns unique chemical elements with their count sorted by electronegativity.
|
|
296
|
-
* `{ "Fe": 4.0, "O": 8.0, "Li": 2.0}`.
|
|
297
|
-
*/
|
|
298
|
-
get uniqueElementCountsSortedByElectronegativity() {
|
|
299
|
-
return chain(this.elements)
|
|
300
|
-
.sortBy("value")
|
|
301
|
-
.sortBy((x) => getElectronegativity(x.value))
|
|
302
|
-
.countBy((element) => element.value)
|
|
303
|
-
.value();
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Returns chemical elements with their count wrt their original order in the basis.
|
|
308
|
-
* Note: entries for the same element separated by another element are considered separately.
|
|
309
|
-
* [{"count":1, "value":"Zr"}, {"count":23, "value":"H"}, {"count":11, "value":"Zr"}, {"count":1, "value":"H"}]
|
|
310
|
-
*/
|
|
311
|
-
get elementCounts(): ElementCount[] {
|
|
312
|
-
const elementCounts: ElementCount[] = [];
|
|
313
|
-
this.elements.forEach((element, index) => {
|
|
314
|
-
const previousElement = this.elements[index - 1];
|
|
315
|
-
if (previousElement && previousElement.value === element.value) {
|
|
316
|
-
const previousElementCount = elementCounts[elementCounts.length - 1];
|
|
317
|
-
previousElementCount.count += 1;
|
|
318
|
-
} else {
|
|
319
|
-
elementCounts.push({
|
|
320
|
-
count: 1,
|
|
321
|
-
value: element.value,
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
return elementCounts;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Reduced formula in IUPAC format. E.g., Na2SO4
|
|
330
|
-
*/
|
|
331
|
-
get formula(): string {
|
|
332
|
-
const counts = this.uniqueElementCountsSortedByElectronegativity;
|
|
333
|
-
const countsValues = values(counts);
|
|
334
|
-
const gcd = countsValues.length > 1 ? Utils.math.gcd(...countsValues) : countsValues[0];
|
|
335
|
-
|
|
336
|
-
return toPairs(counts)
|
|
337
|
-
.map(([element, count]) => element + (count / gcd === 1 ? "" : count / gcd))
|
|
338
|
-
.reduce((acc, part) => acc + part, "");
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Returns the unit cell formula as object `{ "Fe": 4.0, "O": 8.0, "Li": 2.0}`
|
|
343
|
-
*/
|
|
344
|
-
get unitCellFormula(): string {
|
|
345
|
-
const counts = this.uniqueElementCountsSortedByElectronegativity;
|
|
346
|
-
return toPairs(counts)
|
|
347
|
-
.map(([element, count]) => element + (count === 1 ? "" : count))
|
|
348
|
-
.reduce((acc, part) => acc + part, "");
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Returns a nested array with elements and their corresponding coordinates
|
|
353
|
-
* @example Output: [ ["Si", [0,0,0]], ["Si", [0.5,0.5,0.5]] ]
|
|
354
|
-
*/
|
|
355
|
-
get elementsAndCoordinatesArray(): [AtomicElementValue, AtomicCoordinateValue][] {
|
|
356
|
-
return this._elements.values.map((element, idx) => {
|
|
357
|
-
const coordinate = this.getCoordinateValueByIndex(idx);
|
|
358
|
-
return [element, coordinate];
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Returns a nested array with elements and their corresponding coordinates with labels
|
|
364
|
-
* @example Output: [ ["Si", [0,0,0], ['1']], ["Si", [0.5,0.5,0.5]] , ['2']]
|
|
365
|
-
*/
|
|
366
|
-
get elementsAndCoordinatesAndLabelsArray(): [
|
|
367
|
-
AtomicElementValue,
|
|
368
|
-
AtomicCoordinateValue,
|
|
369
|
-
AtomicLabelValue,
|
|
370
|
-
][] {
|
|
371
|
-
return this._elements.values.map((element, idx) => {
|
|
372
|
-
const coordinate = this.getCoordinateValueByIndex(idx);
|
|
373
|
-
const atomicLabel = this.atomicLabelsArray[idx];
|
|
374
|
-
return [element, coordinate, atomicLabel];
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* @summary Concatenates elements and sorts them in alphanumeric order.
|
|
380
|
-
* E.g.,
|
|
381
|
-
* ```
|
|
382
|
-
* elements: [{id: 0, value: 'Si'}, {id: 1, value: 'Si'}]
|
|
383
|
-
* coordinates: [{id: 0, value: [1,0,0]}, {id: 1, value: [0, 1, 0]}]
|
|
384
|
-
*
|
|
385
|
-
* result: "Si 0,1,0;Si 1,0,0"
|
|
386
|
-
* ```
|
|
387
|
-
* This guarantees the independence from the order in the elements array.
|
|
388
|
-
*/
|
|
389
|
-
getAsSortedString(): string {
|
|
390
|
-
const clsInstance = this.clone();
|
|
391
|
-
clsInstance.toStandardRepresentation();
|
|
392
|
-
const standardRep = clsInstance.elementsAndCoordinatesAndLabelsArray.map((entry) => {
|
|
393
|
-
const element = entry[0];
|
|
394
|
-
const coordinate = entry[1];
|
|
395
|
-
const atomicLabel = entry[2];
|
|
396
|
-
const toleratedCoordinate = coordinate.map((x) => Utils.math.roundCustom(x, HASH_TOLERANCE));
|
|
397
|
-
return `${element}${atomicLabel} ${toleratedCoordinate.join()}`;
|
|
398
|
-
});
|
|
399
|
-
return `${standardRep.sort().join(";")};`;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* Returns a string for hash calculation (in crystal units)
|
|
404
|
-
*/
|
|
405
|
-
get hashString(): string {
|
|
406
|
-
const originallyInCartesianUnits = this.isInCartesianUnits;
|
|
407
|
-
|
|
408
|
-
this.toCrystal();
|
|
409
|
-
const hashString = this.getAsSortedString();
|
|
410
|
-
|
|
411
|
-
// preserve the original state
|
|
412
|
-
if (originallyInCartesianUnits) this.toCartesian();
|
|
413
|
-
|
|
414
|
-
return hashString;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/* Returns array of atomic labels E.g., ["1", "2", "", ""] */
|
|
418
|
-
get atomicLabelsArray(): string[] {
|
|
419
|
-
const labelsArray = Array.from({ length: this.elements.length }, (_) => "");
|
|
420
|
-
// https://dev.to/maafaishal/benchmarking-for-while-forof-and-arrayforeach-using-performancenow-1jjg
|
|
421
|
-
if (this.labels?.length) {
|
|
422
|
-
for (let i = 0; i < this.labels.length; i++) {
|
|
423
|
-
// @ts-ignore
|
|
424
|
-
labelsArray[this.labels[i].id] = this.labels[i].value.toString();
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
return labelsArray;
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/* Returns array of elements with labels E.g., ["Fe1", "Fe2", "O", "O"] */
|
|
431
|
-
get elementsWithLabelsArray(): string[] {
|
|
432
|
-
return this.elements.map((element, i) => {
|
|
433
|
-
const label = this.labels?.[i]?.value || "";
|
|
434
|
-
return `${element.value}${label}`;
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Returns an array of strings with chemical elements and their atomic positions.
|
|
440
|
-
* E.g., ``` ['Si 0 0 0', 'Li 0.5 0.5 0.5']```
|
|
441
|
-
*/
|
|
442
|
-
get atomicPositions(): string[] {
|
|
443
|
-
return this.elementsAndCoordinatesAndLabelsArray.map((entry, idx) => {
|
|
444
|
-
const element = entry[0];
|
|
445
|
-
const coordinate = entry[1];
|
|
446
|
-
const atomicLabel = this.atomicLabelsArray[idx];
|
|
447
|
-
return `${element}${atomicLabel} ${coordinate}`;
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* @summary Returns number of atoms in material
|
|
453
|
-
*/
|
|
454
|
-
get nAtoms(): number {
|
|
455
|
-
return this._elements.values.length;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
// helpers
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* @summary Returns true if bases are equal, otherwise - false.
|
|
462
|
-
* @param anotherBasisClsInstance {Basis} Another Basis.
|
|
463
|
-
*/
|
|
464
|
-
isEqualTo(anotherBasisClsInstance: Basis): boolean {
|
|
465
|
-
return this.hashString === anotherBasisClsInstance.hashString;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* @summary Returns true if basis cells are equal, otherwise - false.
|
|
470
|
-
* @param anotherBasisClsInstance {Basis} Another Basis.
|
|
471
|
-
*/
|
|
472
|
-
hasEquivalentCellTo(anotherBasisClsInstance: Basis): boolean {
|
|
473
|
-
return !this.cell.vectorArrays
|
|
474
|
-
.map((vector, idx) => {
|
|
475
|
-
return Utils.math.vEqualWithTolerance(
|
|
476
|
-
vector,
|
|
477
|
-
anotherBasisClsInstance.cell.vectorArrays[idx],
|
|
478
|
-
);
|
|
479
|
-
})
|
|
480
|
-
.some((x) => !x);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* @summary Returns the minimum cubic lattice size for a non-periodic structure.
|
|
485
|
-
* Single-atom structures use the element atomic radius floored at defaultMinimumLatticeSize.
|
|
486
|
-
* Multi-atom structures scale the maximum pairwise distance by 3 when W=min/max pairwise distance
|
|
487
|
-
* is ~1 (diatomic), otherwise by 2.
|
|
488
|
-
*/
|
|
489
|
-
getMinimumLatticeSize(
|
|
490
|
-
defaultMinimumLatticeSize = defaultNonPeriodicMinimumLatticeSize,
|
|
491
|
-
): number {
|
|
492
|
-
if (this._elements.values.length === 1) {
|
|
493
|
-
const elementSymbol = this._elements.getElementValueByIndex(0);
|
|
494
|
-
const atomicRadius = getElementAtomicRadius(elementSymbol);
|
|
495
|
-
return Math.max(defaultMinimumLatticeSize, atomicRadius);
|
|
496
|
-
}
|
|
497
|
-
const maxDistance = this.maxPairwiseDistance;
|
|
498
|
-
const minDistance = this.minPairwiseDistance;
|
|
499
|
-
const widthRatio = maxDistance > 0 ? minDistance / maxDistance : 1;
|
|
500
|
-
const latticeScalingFactor = Utils.math.almostEqual(widthRatio, 1)
|
|
501
|
-
? diatomicLatticePaddingFactor
|
|
502
|
-
: molecularLatticePaddingFactor;
|
|
503
|
-
const moleculeLatticeSize = maxDistance * latticeScalingFactor;
|
|
504
|
-
return Math.max(defaultMinimumLatticeSize, moleculeLatticeSize);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* @summary function returns an array of overlapping atoms within specified tolerance.
|
|
509
|
-
*/
|
|
510
|
-
getOverlappingAtoms(): Overlap[] {
|
|
511
|
-
// to simplify calculations, convert to cartesian coordinates
|
|
512
|
-
this.toCartesian();
|
|
513
|
-
const { coordinates, elements } = this;
|
|
514
|
-
const overlaps: Overlap[] = [];
|
|
515
|
-
// temporary value for overlap approximation, where atoms most certainly can't be located
|
|
516
|
-
const overlapCoefficient = 0.75;
|
|
517
|
-
|
|
518
|
-
coordinates.forEach((entry1, i) => {
|
|
519
|
-
for (let j = i + 1; j < coordinates.length; j++) {
|
|
520
|
-
const entry2 = coordinates[j];
|
|
521
|
-
const el1 = elements[i].value;
|
|
522
|
-
const el2 = elements[j].value;
|
|
523
|
-
|
|
524
|
-
const tolerance =
|
|
525
|
-
overlapCoefficient *
|
|
526
|
-
(getElementAtomicRadius(el1) + getElementAtomicRadius(el2)); // in angstroms
|
|
527
|
-
|
|
528
|
-
// @ts-ignore
|
|
529
|
-
const distance = Utils.math.vDist(entry1.value, entry2.value) as number;
|
|
530
|
-
if (distance < tolerance) {
|
|
531
|
-
overlaps.push({
|
|
532
|
-
id1: i,
|
|
533
|
-
id2: j,
|
|
534
|
-
element1: el1,
|
|
535
|
-
element2: el2,
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
|
|
541
|
-
this.toCrystal();
|
|
542
|
-
return overlaps;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* @summary function returns the max distance between pairs of basis coordinates by
|
|
547
|
-
* calculating the distance between pairs of basis coordinates.
|
|
548
|
-
* basis coordinates = [[x1, y1, z1], [x2, y2, z2], ... [xn, yn, zn]]
|
|
549
|
-
* n = last set of coordinates
|
|
550
|
-
* n-1 = second to last set of coordinates
|
|
551
|
-
*
|
|
552
|
-
* Iterate through pairs without redundancy.
|
|
553
|
-
* pair 0,1 pair 0,2 pair 0,3 ... pair 0,n
|
|
554
|
-
* - pair 1,2 pair 1,3 ... pair 1,n
|
|
555
|
-
* - - - pair 2,3 ... pair 2,n
|
|
556
|
-
* - - - ... ...
|
|
557
|
-
* - - - ... ... pair n-1, n
|
|
558
|
-
*
|
|
559
|
-
*/
|
|
560
|
-
get maxPairwiseDistance(): number {
|
|
561
|
-
return this.getPairwiseDistanceExtremum("max");
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
get minPairwiseDistance(): number {
|
|
565
|
-
return this.getPairwiseDistanceExtremum("min");
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
getPairwiseDistanceExtremum(extremum: "max" | "min"): number {
|
|
569
|
-
const originalUnits = this.units;
|
|
570
|
-
this.toCartesian();
|
|
571
|
-
let resultDistance = extremum === "max" ? 0 : Infinity;
|
|
572
|
-
if (this._elements.values.length >= 2) {
|
|
573
|
-
for (let i = 0; i < this._elements.values.length; i++) {
|
|
574
|
-
for (let j = i + 1; j < this._elements.values.length; j++) {
|
|
575
|
-
const distance = Utils.math.vDist(
|
|
576
|
-
this._coordinates.getElementValueByIndex(i) as Coordinate3DSchema,
|
|
577
|
-
this._coordinates.getElementValueByIndex(j) as Coordinate3DSchema,
|
|
578
|
-
);
|
|
579
|
-
if (!distance) continue;
|
|
580
|
-
if (extremum === "max" && distance > resultDistance) {
|
|
581
|
-
resultDistance = distance;
|
|
582
|
-
}
|
|
583
|
-
if (extremum === "min" && distance < resultDistance) {
|
|
584
|
-
resultDistance = distance;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
if (originalUnits !== ATOMIC_COORD_UNITS.cartesian) this.toCrystal();
|
|
590
|
-
return extremum === "min" && resultDistance === Infinity ? 0 : resultDistance;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* @summary Function takes basis coordinates and transposes them so that the values for each dimension of the
|
|
595
|
-
* the basis are in their own nested array.
|
|
596
|
-
* Then the center point for each dimension of the coordinates is calculated.
|
|
597
|
-
*
|
|
598
|
-
* initial basisCoordinates
|
|
599
|
-
* [[x1, y1, z1],
|
|
600
|
-
* [x2, y2, z2],
|
|
601
|
-
* [.., .., ..],
|
|
602
|
-
* [xn, yn, zn]]
|
|
603
|
-
*
|
|
604
|
-
* transposed basisCoordinates
|
|
605
|
-
* [[x1, x2, ...xn],
|
|
606
|
-
* [y1, y2, ...yn],
|
|
607
|
-
* [z1, z2, ...zn]]
|
|
608
|
-
*
|
|
609
|
-
* Returns an array = [xCenter, yCenter, zCenter]
|
|
610
|
-
*/
|
|
611
|
-
get centerOfCoordinatesPoint(): AtomicCoordinateValue {
|
|
612
|
-
return this._coordinates.getCenterPoint();
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
/**
|
|
616
|
-
* @summary Function translates coordinates by the vector passed as an argument.
|
|
617
|
-
*/
|
|
618
|
-
translateByVector(translationVector: Vector3DSchema) {
|
|
619
|
-
this._coordinates.translateByVector(translationVector);
|
|
620
|
-
}
|
|
621
|
-
}
|