@mat3ra/made 2026.8.13-0 → 2026.8.26-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/package.json +9 -5
- 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/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/scripts/generate-mixins.ts +0 -28
- package/src/__init__.py +0 -0
- package/src/js/Material.ts +0 -618
- package/src/js/basis/basis.ts +0 -634
- package/src/js/basis/constrained_basis.ts +0 -115
- package/src/js/basis/coordinates.ts +0 -92
- 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 -149
- 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/generated/MaterialSchemaMixin.ts +0 -79
- package/src/js/lattice/lattice.ts +0 -308
- package/src/js/lattice/lattice_types.ts +0 -134
- package/src/js/lattice/reciprocal/lattice_reciprocal.ts +0 -206
- 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/parsers/cif.ts +0 -25
- package/src/js/parsers/errors.ts +0 -6
- package/src/js/parsers/espresso.ts +0 -29
- package/src/js/parsers/native_format_parsers.ts +0 -52
- package/src/js/parsers/parsers.ts +0 -13
- package/src/js/parsers/poscar.ts +0 -218
- package/src/js/parsers/xyz.ts +0 -190
- package/src/js/parsers/xyz_combinatorial_basis.ts +0 -268
- package/src/js/tools/basis.ts +0 -131
- package/src/js/tools/cell.ts +0 -40
- package/src/js/tools/index.ts +0 -11
- package/src/js/tools/material.ts +0 -64
- package/src/js/tools/supercell.ts +0 -89
- package/src/js/tools/surface.ts +0 -213
- 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 -135
- 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 -123
- package/tests/js/lattice/lattice.ts +0 -43
- package/tests/js/lattice/lattice_reciprocal.ts +0 -104
- package/tests/js/material/material.ts +0 -161
- package/tests/js/parsers/espresso.ts +0 -12
- 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/register-esse-schemas.cjs +0 -10
- 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 -111
- 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,115 +0,0 @@
|
|
|
1
|
-
import { AtomicConstraintsSchema, BasisConstrainedSchema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
|
|
3
|
-
import { Cell } from "../cell/cell";
|
|
4
|
-
import { AtomicConstraints, AtomicConstraintValue, Constraint } from "../constraints/constraints";
|
|
5
|
-
import { Basis, ElementsAndCoordinatesConfig } from "./basis";
|
|
6
|
-
import { AtomicCoordinateValue, Coordinate } from "./coordinates";
|
|
7
|
-
import { AtomicElementValue } from "./elements";
|
|
8
|
-
import { ElementWithLabel } from "./helpers";
|
|
9
|
-
import { AtomicLabelValue } from "./labels";
|
|
10
|
-
|
|
11
|
-
export interface ConstrainedBasisConfig extends BasisConstrainedSchema {
|
|
12
|
-
cell?: Cell;
|
|
13
|
-
isEmpty?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface ElementsCoordinatesAndConstraintsConfig extends ElementsAndCoordinatesConfig {
|
|
17
|
-
constraints: AtomicConstraintValue[];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @summary Extension of the Basis class able to deal with atomic constraints.
|
|
22
|
-
* @extends Basis
|
|
23
|
-
*/
|
|
24
|
-
export class ConstrainedBasis extends Basis<ConstrainedBasisConfig> {
|
|
25
|
-
private _constraints: AtomicConstraints;
|
|
26
|
-
|
|
27
|
-
constructor(config: ConstrainedBasisConfig) {
|
|
28
|
-
super(config);
|
|
29
|
-
this._constraints = AtomicConstraints.fromObjects(config.constraints ?? []); // `constraints` is an Array with ids
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static fromElementsCoordinatesAndConstraints(
|
|
33
|
-
config: ElementsCoordinatesAndConstraintsConfig,
|
|
34
|
-
): ConstrainedBasis {
|
|
35
|
-
const basisConfig = this._convertValuesToConfig(config);
|
|
36
|
-
const constraints = AtomicConstraints.fromValues(config.constraints);
|
|
37
|
-
return new this({
|
|
38
|
-
...basisConfig,
|
|
39
|
-
constraints: constraints.toJSON() as AtomicConstraintsSchema,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
get constraints() {
|
|
44
|
-
return this._constraints.toJSON() as AtomicConstraintsSchema;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
set constraints(constraints: AtomicConstraintsSchema) {
|
|
48
|
-
this._constraints = AtomicConstraints.fromObjects(constraints);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
get AtomicConstraints() {
|
|
52
|
-
return AtomicConstraints.fromObjects(this.constraints);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
override toJSON(exclude: (keyof ConstrainedBasisConfig)[] = ["cell"]): ConstrainedBasisConfig {
|
|
56
|
-
return {
|
|
57
|
-
...super.toJSON(exclude as (keyof ConstrainedBasisConfig)[]),
|
|
58
|
-
constraints: this.constraints,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
getConstraintByIndex(idx: number): AtomicConstraintValue {
|
|
63
|
-
return this._constraints.getElementValueByIndex(idx) || [true, true, true];
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
getConstraintById(id: number): AtomicConstraintValue {
|
|
67
|
-
return this._constraints.getElementValueById(id) || [true, true, true];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Helper function returning a nested array with [element, coordinates, constraints] as elements
|
|
72
|
-
*/
|
|
73
|
-
get elementsCoordinatesConstraintsArray(): [
|
|
74
|
-
AtomicElementValue,
|
|
75
|
-
AtomicLabelValue,
|
|
76
|
-
AtomicCoordinateValue,
|
|
77
|
-
AtomicConstraintValue,
|
|
78
|
-
][] {
|
|
79
|
-
return this._elements.values.map((element: AtomicElementValue, idx: number) => {
|
|
80
|
-
const coordinate = this.getCoordinateValueByIndex(idx);
|
|
81
|
-
const constraint = this.getConstraintByIndex(idx);
|
|
82
|
-
const label = this.atomicLabelsArray[idx];
|
|
83
|
-
return [element, label, coordinate, constraint];
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Returns an array with atomic positions (with constraints) per atom stored as strings.
|
|
89
|
-
* E.g., ``` ['Si 0 0 0 0 1 0', 'Li 0.5 0.5 0.5 1 0 1']```
|
|
90
|
-
*/
|
|
91
|
-
getAtomicPositionsWithConstraintsAsStrings(
|
|
92
|
-
coordinatePrintFormat?: string,
|
|
93
|
-
precision?: number,
|
|
94
|
-
): string[] {
|
|
95
|
-
const omitConstraints = this._constraints.areUnconstrained;
|
|
96
|
-
return this.elementsCoordinatesConstraintsArray.map(
|
|
97
|
-
([element, label, coordinate, constraint]) => {
|
|
98
|
-
const _elementWithLabel = new ElementWithLabel({ element, label });
|
|
99
|
-
const _coordinate = Coordinate.fromValueAndId(coordinate);
|
|
100
|
-
const _constraint = Constraint.fromValueAndId(constraint);
|
|
101
|
-
|
|
102
|
-
return [
|
|
103
|
-
_elementWithLabel.prettyPrint(),
|
|
104
|
-
_coordinate.prettyPrint(coordinatePrintFormat, precision),
|
|
105
|
-
omitConstraints ? "" : _constraint.prettyPrint(),
|
|
106
|
-
].join(" ");
|
|
107
|
-
},
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
removeAllAtoms() {
|
|
112
|
-
super.removeAllAtoms();
|
|
113
|
-
this.constraints = [];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { RoundedArrayWithIds, RoundedValueWithId, RoundedVector3D, Vector3D } from "@mat3ra/code";
|
|
2
|
-
import {
|
|
3
|
-
AtomicCoordinateSchema,
|
|
4
|
-
Coordinate3DSchema,
|
|
5
|
-
Matrix3X3Schema,
|
|
6
|
-
Vector3DSchema,
|
|
7
|
-
} from "@mat3ra/esse/dist/js/types";
|
|
8
|
-
import { Utils } from "@mat3ra/utils";
|
|
9
|
-
import { sprintf } from "underscore.string";
|
|
10
|
-
|
|
11
|
-
export type AtomicCoordinateValue = AtomicCoordinateSchema["value"];
|
|
12
|
-
|
|
13
|
-
type AxisType = "x" | "y" | "z";
|
|
14
|
-
|
|
15
|
-
export class Coordinate extends RoundedValueWithId<AtomicCoordinateValue> {
|
|
16
|
-
value: AtomicCoordinateValue;
|
|
17
|
-
|
|
18
|
-
constructor({ value, id }: AtomicCoordinateSchema) {
|
|
19
|
-
super(id, value);
|
|
20
|
-
this.value = value;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
getValueAlongAxis(axis: AxisType = "z"): number {
|
|
24
|
-
const index = { x: 0, y: 1, z: 2 }[axis];
|
|
25
|
-
return this.value[index] as number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
translateByVector(vectorAsArray: Vector3DSchema): Coordinate {
|
|
29
|
-
const vector3D = new Vector3D(this.value);
|
|
30
|
-
this.value = vector3D.translateByVector(vectorAsArray).value;
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get valueRounded(): number[] {
|
|
35
|
-
return new RoundedVector3D(this.value).valueRounded;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
getValueRoundedWithPrecision(precision: number): number[] {
|
|
39
|
-
const RoundedInstance = RoundedVector3D;
|
|
40
|
-
RoundedInstance.roundPrecision = precision;
|
|
41
|
-
return new RoundedInstance(this.value).valueRounded;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
prettyPrint(format = "%14.9f", precision: number = this.precision): string {
|
|
45
|
-
return this.getValueRoundedWithPrecision(precision)
|
|
46
|
-
.map((x) => sprintf(format, x))
|
|
47
|
-
.join(" ");
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class Coordinates extends RoundedArrayWithIds<Coordinate3DSchema> {
|
|
52
|
-
getValuesAlongAxis(axis: AxisType = "z"): number[] {
|
|
53
|
-
return this.values.map((coord) => {
|
|
54
|
-
const coordinate = Coordinate.fromValueAndId(coord);
|
|
55
|
-
return coordinate.getValueAlongAxis(axis);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
getMaxValueAlongAxis(axis: AxisType = "z"): number {
|
|
60
|
-
return Math.max(...this.getValuesAlongAxis(axis));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
getMinValueAlongAxis(axis: AxisType = "z"): number {
|
|
64
|
-
return Math.min(...this.getValuesAlongAxis(axis));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
getExtremumValueAlongAxis(extremum: "max" | "min" = "max", axis: AxisType = "z"): number {
|
|
68
|
-
return extremum === "max"
|
|
69
|
-
? this.getMaxValueAlongAxis(axis)
|
|
70
|
-
: this.getMinValueAlongAxis(axis);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
translateByVector(vector: Vector3DSchema): void {
|
|
74
|
-
this.mapArrayInPlace((x) => {
|
|
75
|
-
const coordinate = Coordinate.fromValueAndId(x);
|
|
76
|
-
return coordinate.translateByVector(vector).value;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
getCenterPoint(): Vector3DSchema {
|
|
81
|
-
const transposed = Utils.math.transpose(this.values) as Matrix3X3Schema;
|
|
82
|
-
const center: Vector3DSchema = [0, 0, 0];
|
|
83
|
-
|
|
84
|
-
for (let i = 0; i < 3; i++) {
|
|
85
|
-
const axisCoords = transposed[i] as Coordinate3DSchema;
|
|
86
|
-
const sum = axisCoords.reduce((a, b) => a + b, 0);
|
|
87
|
-
center[i] = sum / this.values.length;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return center;
|
|
91
|
-
}
|
|
92
|
-
}
|
package/src/js/basis/elements.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ArrayWithIds, ValueWithId } from "@mat3ra/code";
|
|
2
|
-
import { AtomicElementSchema } from "@mat3ra/esse/dist/js/types";
|
|
3
|
-
import { uniq } from "lodash";
|
|
4
|
-
|
|
5
|
-
export type AtomicElementValue = AtomicElementSchema["value"];
|
|
6
|
-
|
|
7
|
-
export class Element extends ValueWithId<AtomicElementValue> {
|
|
8
|
-
value: AtomicElementValue;
|
|
9
|
-
|
|
10
|
-
constructor({ value, id }: AtomicElementSchema) {
|
|
11
|
-
super({ id, value });
|
|
12
|
-
this.value = value;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
prettyPrint(): string {
|
|
16
|
-
return this.value;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class Elements extends ArrayWithIds<AtomicElementValue> {
|
|
21
|
-
getUnique(): string[] {
|
|
22
|
-
return uniq(this.values.map((element) => element)) as string[];
|
|
23
|
-
}
|
|
24
|
-
}
|
package/src/js/basis/helpers.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import s from "underscore.string";
|
|
2
|
-
|
|
3
|
-
import { AtomicElementValue } from "./elements";
|
|
4
|
-
import { AtomicLabelValue } from "./labels";
|
|
5
|
-
|
|
6
|
-
export class ElementWithLabel {
|
|
7
|
-
element: AtomicElementValue;
|
|
8
|
-
|
|
9
|
-
label: AtomicLabelValue;
|
|
10
|
-
|
|
11
|
-
constructor({ element, label }: { element: AtomicElementValue; label: AtomicLabelValue }) {
|
|
12
|
-
this.element = element;
|
|
13
|
-
this.label = label;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
prettyPrint(): string {
|
|
17
|
-
const elementWithLabel = `${this.element}${this.label}`;
|
|
18
|
-
return s.sprintf("%-3s", elementWithLabel);
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/js/basis/labels.ts
DELETED
package/src/js/cell/cell.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { RoundedVector3D } from "@mat3ra/code";
|
|
2
|
-
import {
|
|
3
|
-
Coordinate3DSchema,
|
|
4
|
-
LatticeVectorsSchema as CellSchema,
|
|
5
|
-
Matrix3X3Schema,
|
|
6
|
-
Vector3DSchema,
|
|
7
|
-
} from "@mat3ra/esse/dist/js/types";
|
|
8
|
-
import { Utils } from "@mat3ra/utils";
|
|
9
|
-
|
|
10
|
-
import constants from "../constants";
|
|
11
|
-
|
|
12
|
-
const MATRIX = Utils.math.matrix;
|
|
13
|
-
const MULT = Utils.math.multiply;
|
|
14
|
-
const INV = Utils.math.inv;
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
const MATRIX_MULT = (...args) => MULT(...args.map((x) => MATRIX(x))).toArray();
|
|
17
|
-
|
|
18
|
-
export class Cell implements CellSchema {
|
|
19
|
-
static RoundedVector3DClassReference = RoundedVector3D;
|
|
20
|
-
|
|
21
|
-
static roundPrecision = 9;
|
|
22
|
-
|
|
23
|
-
static tolerance = constants.tolerance.length; // in crystal coordinates
|
|
24
|
-
|
|
25
|
-
static defaultConfig: CellSchema = {
|
|
26
|
-
a: [1.0, 0, 0],
|
|
27
|
-
b: [0, 1.0, 0],
|
|
28
|
-
c: [0, 0, 1.0],
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
a: CellSchema["a"];
|
|
32
|
-
|
|
33
|
-
b: CellSchema["b"];
|
|
34
|
-
|
|
35
|
-
c: CellSchema["c"];
|
|
36
|
-
|
|
37
|
-
alat = 1;
|
|
38
|
-
|
|
39
|
-
units: CellSchema["units"] = "angstrom";
|
|
40
|
-
|
|
41
|
-
constructor(config = Cell.defaultConfig) {
|
|
42
|
-
const { a, b, c } = config;
|
|
43
|
-
this.a = a;
|
|
44
|
-
this.b = b;
|
|
45
|
-
this.c = c;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static fromVectorsArray(vectors: Matrix3X3Schema): Cell {
|
|
49
|
-
return new Cell({
|
|
50
|
-
a: vectors[0],
|
|
51
|
-
b: vectors[1],
|
|
52
|
-
c: vectors[2],
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get _a() {
|
|
57
|
-
return new Cell.RoundedVector3DClassReference(this.a);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
get _b() {
|
|
61
|
-
return new Cell.RoundedVector3DClassReference(this.b);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
get _c() {
|
|
65
|
-
return new Cell.RoundedVector3DClassReference(this.c);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
get vectorArrays(): Matrix3X3Schema {
|
|
69
|
-
return [this._a.value, this._b.value, this._c.value];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
get vectorArraysRounded(): Matrix3X3Schema {
|
|
73
|
-
return [this._a.valueRounded, this._b.valueRounded, this._c.valueRounded];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
get volume(): number {
|
|
77
|
-
return Utils.math.det(this.vectorArrays);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
get volumeRounded(): number {
|
|
81
|
-
return Utils.math.roundArrayOrNumber(this.volume, Cell.roundPrecision) as number;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
clone(): Cell {
|
|
85
|
-
return new Cell({ a: this.a, b: this.b, c: this.c });
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
cloneAndScaleByMatrix(matrix: Matrix3X3Schema) {
|
|
89
|
-
const newCell = this.clone();
|
|
90
|
-
newCell.scaleByMatrix(matrix);
|
|
91
|
-
return newCell;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
convertPointToCartesian(point: Coordinate3DSchema): Coordinate3DSchema {
|
|
95
|
-
return MULT(point, this.vectorArrays) as unknown as Coordinate3DSchema;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
convertPointToCrystal(point: Coordinate3DSchema): Coordinate3DSchema {
|
|
99
|
-
return MULT(point, INV(this.vectorArrays)) as unknown as Coordinate3DSchema;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
isPointInsideCellCartesian(point: Coordinate3DSchema): boolean {
|
|
103
|
-
const { tolerance } = this.constructor as typeof Cell;
|
|
104
|
-
return (
|
|
105
|
-
this.convertPointToCrystal(point)
|
|
106
|
-
.map((c: number) => Utils.math.isBetweenZeroInclusiveAndOne(c, tolerance))
|
|
107
|
-
// @ts-ignore
|
|
108
|
-
.reduce((a: boolean, b: boolean): boolean => a && b)
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// eslint-disable-next-line class-methods-use-this
|
|
113
|
-
isPointInsideCellCrystal(point: Coordinate3DSchema): boolean {
|
|
114
|
-
const { tolerance } = this.constructor as typeof Cell;
|
|
115
|
-
return (
|
|
116
|
-
point
|
|
117
|
-
.map((c: number) => Utils.math.isBetweenZeroInclusiveAndOne(c, tolerance))
|
|
118
|
-
// @ts-ignore
|
|
119
|
-
.reduce((a: boolean, b: boolean): boolean => a && b)
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
isPointInsideCell(point: Coordinate3DSchema, useCrystal = false): boolean {
|
|
124
|
-
if (useCrystal) {
|
|
125
|
-
return this.isPointInsideCellCrystal(point);
|
|
126
|
-
}
|
|
127
|
-
return this.isPointInsideCellCartesian(point);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
getMostCollinearVectorIndex(testVector: Vector3DSchema): number {
|
|
131
|
-
const angles = this.vectorArrays.map((v) => Utils.math.angleUpTo90(v, testVector, "deg"));
|
|
132
|
-
return angles.findIndex((el: number) => el === Utils.math.min(angles));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
scaleByMatrix(matrix: number[][]) {
|
|
136
|
-
// @ts-ignore - mathjs v12 multiply return type is broader than runtime
|
|
137
|
-
[this.a, this.b, this.c] = MATRIX_MULT(matrix, this.vectorArrays);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
toJSON(): CellSchema {
|
|
141
|
-
return {
|
|
142
|
-
a: this._a.toJSON(),
|
|
143
|
-
b: this._b.toJSON(),
|
|
144
|
-
c: this._c.toJSON(),
|
|
145
|
-
alat: this.alat,
|
|
146
|
-
units: this.units,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { LatticeSchema, LatticeTypeEnum, Matrix3X3Schema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Routines for calculating conventional cell vectors from primitive cell Bravais parameters.
|
|
5
|
-
* Following Setyawan, W., & Curtarolo, S. (2010). doi:10.1016/j.commatsci.2010.05.010
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const unitMatrix: Matrix3X3Schema = [
|
|
9
|
-
[1, 0, 0],
|
|
10
|
-
[0, 1, 0],
|
|
11
|
-
[0, 0, 1],
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
// (Conventional cellVectors) = (Primitive cellVectors) * (PRIMITIVE_TO_CONVENTIONAL_CELL_MULTIPLIER matrix)
|
|
15
|
-
export const PRIMITIVE_TO_CONVENTIONAL_CELL_MULTIPLIERS: Record<string, Matrix3X3Schema> = {
|
|
16
|
-
// PRIMITIVE => CONVENTIONAL
|
|
17
|
-
CUB: unitMatrix,
|
|
18
|
-
FCC: [
|
|
19
|
-
[-1, 1, 1],
|
|
20
|
-
[1, -1, 1],
|
|
21
|
-
[1, 1, -1],
|
|
22
|
-
],
|
|
23
|
-
BCC: [
|
|
24
|
-
[0, 1, 1],
|
|
25
|
-
[1, 0, 1],
|
|
26
|
-
[1, 1, 0],
|
|
27
|
-
],
|
|
28
|
-
TET: unitMatrix,
|
|
29
|
-
BCT: [
|
|
30
|
-
[0, 1, 1],
|
|
31
|
-
[1, 0, 1],
|
|
32
|
-
[1, 1, 0],
|
|
33
|
-
],
|
|
34
|
-
ORC: unitMatrix,
|
|
35
|
-
ORCF: [
|
|
36
|
-
[-1, 1, 1],
|
|
37
|
-
[1, -1, 1],
|
|
38
|
-
[1, 1, -1],
|
|
39
|
-
],
|
|
40
|
-
ORCI: [
|
|
41
|
-
[0, 1, 1],
|
|
42
|
-
[1, 0, 1],
|
|
43
|
-
[1, 1, 0],
|
|
44
|
-
],
|
|
45
|
-
ORCC: [
|
|
46
|
-
[1, -1, 0],
|
|
47
|
-
[1, 1, 0],
|
|
48
|
-
[0, 0, 1],
|
|
49
|
-
],
|
|
50
|
-
HEX: unitMatrix,
|
|
51
|
-
RHL: unitMatrix,
|
|
52
|
-
MCL: unitMatrix,
|
|
53
|
-
MCLC: [
|
|
54
|
-
[1, -1, 0],
|
|
55
|
-
[1, 1, 0],
|
|
56
|
-
[0, 0, 1],
|
|
57
|
-
],
|
|
58
|
-
TRI: unitMatrix,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const PRIMITIVE_TO_CONVENTIONAL_CELL_LATTICE_TYPES: {
|
|
62
|
-
[key in LatticeTypeEnum]: LatticeTypeEnum;
|
|
63
|
-
} = {
|
|
64
|
-
// PRIMITIVE => CONVENTIONAL
|
|
65
|
-
CUB: "CUB",
|
|
66
|
-
FCC: "CUB",
|
|
67
|
-
BCC: "CUB",
|
|
68
|
-
TET: "TET",
|
|
69
|
-
BCT: "TET",
|
|
70
|
-
ORC: "ORC",
|
|
71
|
-
ORCF: "ORC",
|
|
72
|
-
ORCI: "ORC",
|
|
73
|
-
ORCC: "ORC",
|
|
74
|
-
HEX: "HEX",
|
|
75
|
-
RHL: "RHL",
|
|
76
|
-
MCL: "MCL",
|
|
77
|
-
MCLC: "MCL",
|
|
78
|
-
TRI: "TRI",
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export function isConventionalCellSameAsPrimitiveForLatticeType(
|
|
82
|
-
latticeType: LatticeSchema["type"],
|
|
83
|
-
): boolean {
|
|
84
|
-
const multiplier = PRIMITIVE_TO_CONVENTIONAL_CELL_MULTIPLIERS[latticeType || "TRI"];
|
|
85
|
-
return multiplier === unitMatrix;
|
|
86
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { LatticeSchema, Matrix3X3Schema } from "@mat3ra/esse/dist/js/types";
|
|
2
|
-
import { Utils } from "@mat3ra/utils";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Routines for calculating primitive cell vectors from conventional cell Bravais parameters.
|
|
6
|
-
* Following Setyawan, W., & Curtarolo, S. (2010). doi:10.1016/j.commatsci.2010.05.010
|
|
7
|
-
*/
|
|
8
|
-
const PRIMITIVE_CELLS = {
|
|
9
|
-
CUB: ({ a }: LatticeSchema): Matrix3X3Schema => {
|
|
10
|
-
return [
|
|
11
|
-
[a, 0, 0],
|
|
12
|
-
[0, a, 0],
|
|
13
|
-
[0, 0, a],
|
|
14
|
-
];
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
FCC: ({ a }: LatticeSchema): Matrix3X3Schema => {
|
|
18
|
-
return [
|
|
19
|
-
[0.0, a / 2, a / 2],
|
|
20
|
-
[a / 2, 0.0, a / 2],
|
|
21
|
-
[a / 2, a / 2, 0.0],
|
|
22
|
-
];
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
BCC: ({ a }: LatticeSchema): Matrix3X3Schema => {
|
|
26
|
-
return [
|
|
27
|
-
[-a / 2, a / 2, a / 2],
|
|
28
|
-
[a / 2, -a / 2, a / 2],
|
|
29
|
-
[a / 2, a / 2, -a / 2],
|
|
30
|
-
];
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
TET: ({ a, c }: LatticeSchema): Matrix3X3Schema => {
|
|
34
|
-
return [
|
|
35
|
-
[a, 0, 0],
|
|
36
|
-
[0, a, 0],
|
|
37
|
-
[0, 0, c],
|
|
38
|
-
];
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
BCT: ({ a, c }: LatticeSchema): Matrix3X3Schema => {
|
|
42
|
-
return [
|
|
43
|
-
[-a / 2, a / 2, c / 2],
|
|
44
|
-
[a / 2, -a / 2, c / 2],
|
|
45
|
-
[a / 2, a / 2, -c / 2],
|
|
46
|
-
];
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
ORC: ({ a, b, c }: LatticeSchema): Matrix3X3Schema => {
|
|
50
|
-
return [
|
|
51
|
-
[a, 0, 0],
|
|
52
|
-
[0, b, 0],
|
|
53
|
-
[0, 0, c],
|
|
54
|
-
];
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
ORCF: ({ a, b, c }: LatticeSchema): Matrix3X3Schema => {
|
|
58
|
-
return [
|
|
59
|
-
[0, b / 2, c / 2],
|
|
60
|
-
[a / 2, 0, c / 2],
|
|
61
|
-
[a / 2, b / 2, 0],
|
|
62
|
-
];
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
ORCI: ({ a, b, c }: LatticeSchema): Matrix3X3Schema => {
|
|
66
|
-
return [
|
|
67
|
-
[-a / 2, b / 2, c / 2],
|
|
68
|
-
[a / 2, -b / 2, c / 2],
|
|
69
|
-
[a / 2, b / 2, -c / 2],
|
|
70
|
-
];
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
ORCC: ({ a, b, c }: LatticeSchema): Matrix3X3Schema => {
|
|
74
|
-
return [
|
|
75
|
-
[a / 2, b / 2, 0],
|
|
76
|
-
[-a / 2, b / 2, 0],
|
|
77
|
-
[0, 0, c],
|
|
78
|
-
];
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
HEX: ({ a, c }: LatticeSchema): Matrix3X3Schema => {
|
|
82
|
-
return [
|
|
83
|
-
[a / 2, (-a * Number(Utils.math.sqrt(3))) / 2, 0],
|
|
84
|
-
[a / 2, (a * Number(Utils.math.sqrt(3))) / 2, 0],
|
|
85
|
-
[0, 0, c],
|
|
86
|
-
];
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
RHL: ({ a, alpha }: LatticeSchema): Matrix3X3Schema => {
|
|
90
|
-
const cosAlpha = Number(Utils.math.cos((alpha / 180) * Number(Utils.math.PI)));
|
|
91
|
-
const cosHalfAlpha = Number(Utils.math.sqrt((1 / 2) * (1 + cosAlpha)));
|
|
92
|
-
const sinHalfAlpha = Number(Utils.math.sqrt((1 / 2) * (1 - cosAlpha)));
|
|
93
|
-
return [
|
|
94
|
-
[a * cosHalfAlpha, -a * sinHalfAlpha, 0.0],
|
|
95
|
-
[a * cosHalfAlpha, a * sinHalfAlpha, 0.0],
|
|
96
|
-
[
|
|
97
|
-
(a * cosAlpha) / cosHalfAlpha,
|
|
98
|
-
0.0,
|
|
99
|
-
a *
|
|
100
|
-
Number(
|
|
101
|
-
Utils.math.sqrt(1 - (cosAlpha * cosAlpha) / (cosHalfAlpha * cosHalfAlpha)),
|
|
102
|
-
),
|
|
103
|
-
],
|
|
104
|
-
];
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
MCL: ({ a, b, c, alpha }: LatticeSchema): Matrix3X3Schema => {
|
|
108
|
-
const cosAlpha = Number(Utils.math.cos((alpha / 180) * Number(Utils.math.PI)));
|
|
109
|
-
return [
|
|
110
|
-
[a, 0, 0],
|
|
111
|
-
[0, b, 0],
|
|
112
|
-
[0, c * cosAlpha, c * Number(Utils.math.sqrt(1 - cosAlpha * cosAlpha))],
|
|
113
|
-
];
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
MCLC: ({ a, b, c, alpha }: LatticeSchema): Matrix3X3Schema => {
|
|
117
|
-
const cosAlpha = Number(Utils.math.cos((alpha / 180) * Number(Utils.math.PI)));
|
|
118
|
-
return [
|
|
119
|
-
[a / 2, b / 2, 0],
|
|
120
|
-
[-a / 2, b / 2, 0],
|
|
121
|
-
[0, c * cosAlpha, c * Number(Utils.math.sqrt(1 - cosAlpha * cosAlpha))],
|
|
122
|
-
];
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
// Algorithm from http://pymatgen.org/_modules/pymatgen/core/lattice.html (from_params)
|
|
126
|
-
TRI: ({ a, b, c, alpha, beta, gamma }: LatticeSchema): Matrix3X3Schema => {
|
|
127
|
-
// convert angles to Radians
|
|
128
|
-
// eslint-disable-next-line no-param-reassign
|
|
129
|
-
[alpha, beta, gamma] = [alpha, beta, gamma].map((x) =>
|
|
130
|
-
Number(Utils.math.unit(x, "degree").to("rad").value),
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const [cosAlpha, cosBeta, cosGamma] = [alpha, beta, gamma].map((x) =>
|
|
134
|
-
Number(Utils.math.cos(x)),
|
|
135
|
-
);
|
|
136
|
-
const [sinAlpha, sinBeta] = [alpha, beta].map((x) => Number(Utils.math.sin(x)));
|
|
137
|
-
let acosArg = (cosAlpha * cosBeta - cosGamma) / (sinAlpha * sinBeta);
|
|
138
|
-
if (acosArg < -1) {
|
|
139
|
-
acosArg = -1;
|
|
140
|
-
} else if (acosArg > 1) {
|
|
141
|
-
acosArg = 1;
|
|
142
|
-
}
|
|
143
|
-
const gammaStar = Number(Utils.math.acos(acosArg));
|
|
144
|
-
const cosGammaStar = Number(Utils.math.cos(gammaStar));
|
|
145
|
-
const sinGammaStar = Number(Utils.math.sin(gammaStar));
|
|
146
|
-
|
|
147
|
-
return [
|
|
148
|
-
[a * sinBeta, 0.0, a * cosBeta],
|
|
149
|
-
[-b * sinAlpha * cosGammaStar, b * sinAlpha * sinGammaStar, b * cosAlpha],
|
|
150
|
-
[0.0, 0.0, c],
|
|
151
|
-
];
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Returns lattice vectors for a primitive cell for a lattice.
|
|
157
|
-
* @param latticeConfig - Lattice config.
|
|
158
|
-
* @return Cell.vectorsAsArray
|
|
159
|
-
*/
|
|
160
|
-
export function getPrimitiveLatticeVectorsFromConfig(
|
|
161
|
-
latticeConfig: LatticeSchema,
|
|
162
|
-
): Matrix3X3Schema {
|
|
163
|
-
const primitiveCellGenerator = PRIMITIVE_CELLS[latticeConfig.type || "TRI"];
|
|
164
|
-
const [vectorA, vectorB, vectorC] = primitiveCellGenerator(latticeConfig);
|
|
165
|
-
return [vectorA, vectorB, vectorC];
|
|
166
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants for molecule handling and precision.
|
|
3
|
-
* Source of truth: /constants.json at repository root
|
|
4
|
-
*
|
|
5
|
-
* These values are duplicated here for TypeScript compilation.
|
|
6
|
-
* When updating these, also update constants.json.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export const defaultNonPeriodicMinimumLatticeSize = 3.0;
|
|
10
|
-
export const diatomicLatticePaddingFactor = 3.0;
|
|
11
|
-
export const molecularLatticePaddingFactor = 2.0;
|
|
12
|
-
|
|
13
|
-
export const PRECISION_MAP = {
|
|
14
|
-
coordinatesCrystal: 9,
|
|
15
|
-
coordinatesCartesian: 6,
|
|
16
|
-
latticeLengths: 6,
|
|
17
|
-
latticeAngles: 4,
|
|
18
|
-
};
|
package/src/js/constants.ts
DELETED