@mat3ra/made 2026.8.7-0 → 2026.8.18-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/Material.d.ts +219 -0
- package/dist/js/Material.js +457 -0
- package/dist/js/basis/basis.d.ts +14 -9
- package/dist/js/basis/basis.js +15 -13
- package/dist/js/basis/constrained_basis.d.ts +9 -7
- package/dist/js/basis/constrained_basis.js +4 -4
- package/dist/js/generated/MaterialSchemaMixin.d.ts +5 -0
- package/dist/js/generated/MaterialSchemaMixin.js +69 -0
- package/dist/js/lattice/lattice.d.ts +4 -3
- package/dist/js/lattice/lattice.js +1 -2
- package/dist/js/made.d.ts +12 -12
- package/dist/js/made.js +38 -5
- package/dist/js/parsers/espresso.d.ts +2 -3
- package/dist/js/parsers/espresso.js +0 -1
- package/dist/js/parsers/native_format_parsers.d.ts +9 -8
- package/dist/js/parsers/native_format_parsers.js +6 -6
- package/dist/js/parsers/parsers.d.ts +6 -6
- package/dist/js/parsers/poscar.d.ts +5 -4
- package/dist/js/parsers/poscar.js +3 -2
- package/dist/js/parsers/xyz.d.ts +3 -5
- package/dist/js/parsers/xyz.js +3 -4
- package/dist/js/parsers/xyz_combinatorial_basis.js +3 -1
- package/dist/js/tools/basis.d.ts +1 -1
- package/dist/js/tools/index.d.ts +7 -7
- package/dist/js/tools/material.d.ts +1 -1
- package/dist/js/tools/material.js +8 -7
- package/dist/js/tools/supercell.d.ts +4 -5
- package/dist/js/tools/supercell.js +2 -4
- package/dist/js/tools/surface.d.ts +4 -4
- package/dist/js/tools/surface.js +2 -7
- package/package.json +12 -8
- package/.babelrc +0 -10
- package/.eslintrc.json +0 -11
- package/.gitattributes +0 -1
- package/.husky/post-checkout +0 -3
- package/.husky/post-commit +0 -3
- package/.husky/post-merge +0 -3
- package/.husky/pre-commit +0 -6
- package/.husky/pre-push +0 -3
- package/.mocharc.json +0 -5
- package/.pre-commit-config.yaml +0 -26
- package/.prettierignore +0 -2
- package/.prettierrc +0 -6
- package/AGENTS.md +0 -133
- package/MANIFEST.in +0 -1
- package/data/constants.json +0 -13
- package/data/reciprocal_paths.json +0 -111
- package/dist/js/material.d.ts +0 -169
- package/dist/js/material.js +0 -362
- package/images/made/tools/tools_diagram_general.png +0 -3
- package/images/made/tools/tools_diagram_interface.png +0 -3
- package/pyproject.toml +0 -123
- package/src/__init__.py +0 -0
- package/src/js/basis/basis.ts +0 -621
- package/src/js/basis/constrained_basis.ts +0 -114
- package/src/js/basis/coordinates.ts +0 -93
- package/src/js/basis/elements.ts +0 -24
- package/src/js/basis/helpers.ts +0 -20
- package/src/js/basis/labels.ts +0 -6
- package/src/js/cell/cell.ts +0 -150
- package/src/js/cell/conventional_cell.ts +0 -86
- package/src/js/cell/primitive_cell.ts +0 -166
- package/src/js/constants/molecule.ts +0 -18
- package/src/js/constants.ts +0 -4
- package/src/js/constraints/constraints.ts +0 -45
- package/src/js/lattice/lattice.ts +0 -306
- package/src/js/lattice/lattice_types.ts +0 -134
- package/src/js/lattice/reciprocal/lattice_reciprocal.ts +0 -193
- package/src/js/lattice/reciprocal/paths.ts +0 -39
- package/src/js/lattice/reciprocal/symmetry_points.ts +0 -886
- package/src/js/lattice/unit_cell.ts +0 -66
- package/src/js/made.ts +0 -62
- package/src/js/material.ts +0 -458
- package/src/js/parsers/cif.ts +0 -25
- package/src/js/parsers/errors.ts +0 -6
- package/src/js/parsers/espresso.ts +0 -30
- package/src/js/parsers/native_format_parsers.ts +0 -51
- package/src/js/parsers/parsers.ts +0 -13
- package/src/js/parsers/poscar.ts +0 -212
- package/src/js/parsers/xyz.ts +0 -187
- package/src/js/parsers/xyz_combinatorial_basis.ts +0 -265
- package/src/js/tools/basis.ts +0 -132
- package/src/js/tools/cell.ts +0 -41
- package/src/js/tools/index.ts +0 -11
- package/src/js/tools/material.ts +0 -62
- package/src/js/tools/supercell.ts +0 -88
- package/src/js/tools/surface.ts +0 -223
- package/src/py/__init__.py +0 -0
- package/src/py/mat3ra/__init__.py +0 -1
- package/src/py/mat3ra/made/__init__.py +0 -7
- package/src/py/mat3ra/made/basis/__init__.py +0 -255
- package/src/py/mat3ra/made/basis/coordinates.py +0 -43
- package/src/py/mat3ra/made/cell/__init__.py +0 -55
- package/src/py/mat3ra/made/cell/primitive_cell.py +0 -156
- package/src/py/mat3ra/made/data_helper.py +0 -5
- package/src/py/mat3ra/made/lattice.py +0 -195
- package/src/py/mat3ra/made/material.py +0 -134
- package/src/py/mat3ra/made/metadata.py +0 -45
- package/src/py/mat3ra/made/reciprocal/__init__.py +0 -5
- package/src/py/mat3ra/made/reciprocal/lattice_reciprocal.py +0 -147
- package/src/py/mat3ra/made/reciprocal/paths.py +0 -30
- package/src/py/mat3ra/made/reciprocal/symmetry_points.py +0 -385
- package/src/py/mat3ra/made/tools/README.md +0 -173
- package/src/py/mat3ra/made/tools/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/__init__.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/basis/__init__.py +0 -3
- package/src/py/mat3ra/made/tools/analyze/basis/analyzer.py +0 -50
- package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer.py +0 -32
- package/src/py/mat3ra/made/tools/analyze/build_metadata_analyzer_factory.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/coordination.py +0 -56
- package/src/py/mat3ra/made/tools/analyze/crystal_site/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_crystal_site_material_analyzer.py +0 -35
- package/src/py/mat3ra/made/tools/analyze/crystal_site/adatom_material_analyzer.py +0 -49
- package/src/py/mat3ra/made/tools/analyze/crystal_site/crystal_site_analyzer.py +0 -65
- package/src/py/mat3ra/made/tools/analyze/crystal_site/voronoi_crystal_site_analyzer.py +0 -47
- package/src/py/mat3ra/made/tools/analyze/enums.py +0 -33
- package/src/py/mat3ra/made/tools/analyze/fingerprint/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/layered_fingerprint_along_axis.py +0 -83
- package/src/py/mat3ra/made/tools/analyze/fingerprint/layers/unique_element_string_per_layer.py +0 -9
- package/src/py/mat3ra/made/tools/analyze/interface/__init__.py +0 -20
- package/src/py/mat3ra/made/tools/analyze/interface/commensurate.py +0 -156
- package/src/py/mat3ra/made/tools/analyze/interface/enums.py +0 -60
- package/src/py/mat3ra/made/tools/analyze/interface/grain_boundary.py +0 -80
- package/src/py/mat3ra/made/tools/analyze/interface/simple.py +0 -251
- package/src/py/mat3ra/made/tools/analyze/interface/twisted_nanoribbons.py +0 -91
- package/src/py/mat3ra/made/tools/analyze/interface/utils/__init__.py +0 -77
- package/src/py/mat3ra/made/tools/analyze/interface/utils/holders.py +0 -14
- package/src/py/mat3ra/made/tools/analyze/interface/utils/vector.py +0 -56
- package/src/py/mat3ra/made/tools/analyze/interface/zsl.py +0 -259
- package/src/py/mat3ra/made/tools/analyze/interface_material.py +0 -45
- package/src/py/mat3ra/made/tools/analyze/lattice/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/analyze/lattice/analyzer.py +0 -126
- package/src/py/mat3ra/made/tools/analyze/lattice/helpers.py +0 -31
- package/src/py/mat3ra/made/tools/analyze/lattice_lines.py +0 -30
- package/src/py/mat3ra/made/tools/analyze/lattice_planes.py +0 -192
- package/src/py/mat3ra/made/tools/analyze/lattice_swap_analyzer.py +0 -105
- package/src/py/mat3ra/made/tools/analyze/material.py +0 -276
- package/src/py/mat3ra/made/tools/analyze/other.py +0 -434
- package/src/py/mat3ra/made/tools/analyze/rdf.py +0 -74
- package/src/py/mat3ra/made/tools/analyze/slab.py +0 -76
- package/src/py/mat3ra/made/tools/analyze/solid_solution_analyzer.py +0 -171
- package/src/py/mat3ra/made/tools/analyze/terrace.py +0 -105
- package/src/py/mat3ra/made/tools/analyze/utils.py +0 -162
- package/src/py/mat3ra/made/tools/bond_directions/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions.py +0 -150
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_for_element_list.py +0 -7
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_enum.py +0 -8
- package/src/py/mat3ra/made/tools/bond_directions/bond_directions_templates_for_element.py +0 -16
- package/src/py/mat3ra/made/tools/build/__init__.py +0 -25
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/helpers.py +0 -59
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/types.py +0 -26
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/heterostructure/utils.py +0 -139
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/__init__.py +0 -47
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/__init__.py +0 -11
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/builder.py +0 -164
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/configuration.py +0 -48
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/base/helpers.py +0 -134
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/commensurate/helpers.py +0 -157
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/enums.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/configuration.py +0 -13
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/twisted/helpers.py +0 -70
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/utils.py +0 -87
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build/compound_pristine_structures/two_dimensional/interface/zsl/helpers.py +0 -129
- package/src/py/mat3ra/made/tools/build/defective_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/build_parameters.py +0 -12
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/builder.py +0 -17
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/configuration.py +0 -40
- package/src/py/mat3ra/made/tools/build/defective_structures/one_dimensional/grain_boundary_linear/helpers.py +0 -82
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/__init__.py +0 -1
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/builder.py +0 -37
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/configuration.py +0 -30
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/enums.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/three_dimensional/solid_solution/helpers.py +0 -76
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/builder.py +0 -11
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/configuration.py +0 -18
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/helpers.py +0 -137
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/adatom/types.py +0 -22
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/builder.py +0 -28
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/configuration.py +0 -55
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/grain_boundary_planar/helpers.py +0 -75
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/builder.py +0 -15
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/configuration.py +0 -16
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/island/helpers.py +0 -116
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/build_parameters.py +0 -10
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/builder.py +0 -30
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/configuration.py +0 -11
- package/src/py/mat3ra/made/tools/build/defective_structures/two_dimensional/terrace/helpers.py +0 -78
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/builder.py +0 -31
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/configuration.py +0 -45
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/pair_defect/helpers.py +0 -80
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/__init__.py +0 -40
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/atom_placement_method_enum.py +0 -14
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/base/configuration.py +0 -27
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/complex_defect_type_enum.py +0 -5
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/factories.py +0 -69
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/helpers.py +0 -92
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/builder.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/configuration.py +0 -29
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/helpers.py +0 -48
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/interstitial/interstitial_placement_method_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/point_defect_type_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/builder.py +0 -6
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/configuration.py +0 -41
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/helpers.py +0 -43
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/substitutional/substitution_placement_method_enum.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/types.py +0 -24
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/builder.py +0 -19
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/configuration.py +0 -27
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/helpers.py +0 -42
- package/src/py/mat3ra/made/tools/build/defective_structures/zero_dimensional/point_defect/vacancy/vacancy_placement_method_enum.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/builder.py +0 -80
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/configurations.py +0 -22
- package/src/py/mat3ra/made/tools/build/pristine_structures/three_dimensional/ideal_crystal/helpers.py +0 -40
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/__init__.py +0 -29
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/builders.py +0 -56
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/configuration.py +0 -33
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanoribbon/helpers.py +0 -76
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/__init__.py +0 -11
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/build_parameters.py +0 -9
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/builders.py +0 -83
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/configuration.py +0 -35
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/nanotape/helpers.py +0 -62
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/build_parameters.py +0 -8
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/configuration.py +0 -99
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/helpers.py +0 -95
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/termination_utils.py +0 -14
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab/utils.py +0 -61
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/builder.py +0 -22
- package/src/py/mat3ra/made/tools/build/pristine_structures/two_dimensional/slab_strained_supercell/configuration.py +0 -17
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/__init__.py +0 -19
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/analyzer.py +0 -86
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/builder.py +0 -54
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/ase_based/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/enums.py +0 -42
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/helpers.py +0 -127
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/builder.py +0 -33
- package/src/py/mat3ra/made/tools/build/pristine_structures/zero_dimensional/nanoparticle/merge_based/configuration.py +0 -16
- package/src/py/mat3ra/made/tools/build/processed_structures/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/__init__.py +0 -9
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/coordination_based_passivation_material_analyzer.py +0 -112
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/passivation_material_analyzer.py +0 -16
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/analyzers/surface_passivation_material_analyzer.py +0 -32
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/builder.py +0 -23
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/configuration.py +0 -31
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/enums.py +0 -7
- package/src/py/mat3ra/made/tools/build/processed_structures/two_dimensional/passivation/helpers.py +0 -151
- package/src/py/mat3ra/made/tools/build_components/__init__.py +0 -10
- package/src/py/mat3ra/made/tools/build_components/entities/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/one_dimensional/miller_indices_2d.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/miller_indices.py +0 -18
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/two_dimensional/termination.py +0 -33
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/crystal_site/crystal_site_list.py +0 -9
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/builder.py +0 -32
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/point_defect_site/configuration.py +0 -14
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/builder.py +0 -29
- package/src/py/mat3ra/made/tools/build_components/entities/auxiliary/zero_dimensional/void_region/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/builder.py +0 -48
- package/src/py/mat3ra/made/tools/build_components/entities/core/two_dimensional/vacuum/configuration.py +0 -17
- package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/builder.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/entities/core/zero_dimensional/atom/configuration.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/__init__.py +0 -16
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_configuration_pydantic.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/base_single_builder.py +0 -87
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/base_builder/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/builder.py +0 -46
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/configuration.py +0 -19
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/edge_types.py +0 -51
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines/helpers.py +0 -58
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/builder.py +0 -42
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/one_dimensional/crystal_lattice_lines_unique_repeated/configuration.py +0 -21
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/configuration.py +0 -11
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/three_dimensional/supercell/helpers.py +0 -38
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/__init__.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/builder.py +0 -62
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/configuration.py +0 -14
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/atomic_layers_unique_repeated/helpers.py +0 -42
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/__init__.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/builder.py +0 -39
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/crystal_lattice_planes/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/__init__.py +0 -10
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/builder.py +0 -36
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/configuration.py +0 -31
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/two_dimensional/slab_stack/helpers.py +0 -80
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/entities/reusable/zero_dimensional/coordinates_shape_enum.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/metadata/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/metadata/build_metadata.py +0 -7
- package/src/py/mat3ra/made/tools/build_components/metadata/material_build_metadata.py +0 -35
- package/src/py/mat3ra/made/tools/build_components/metadata/material_with_build_metadata.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/mixins/__init__.py +0 -2
- package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_ase_atoms_mixin.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/mixins/convert_generated_items_pymatgen_structure_mixin.py +0 -8
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/__init__.py +0 -0
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/enums.py +0 -11
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/__init__.py +0 -6
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/build_parameters.py +0 -18
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/builder.py +0 -93
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/merge/configuration.py +0 -20
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/builder.py +0 -83
- package/src/py/mat3ra/made/tools/build_components/operations/core/combinations/stack/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/__init__.py +0 -15
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/build_parameters.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/base.py +0 -33
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/builders/isometric.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/configuration.py +0 -24
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/__init__.py +0 -13
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/atomic_mass_dependent_function_holder.py +0 -32
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/function_holder.py +0 -80
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/maxwell_boltzmann.py +0 -39
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/perturbation_function_holder.py +0 -45
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/functions/sine_wave_perturbation_function_holder.py +0 -29
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/perturb/helpers.py +0 -83
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/__init__.py +0 -5
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/builder.py +0 -25
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/configuration.py +0 -23
- package/src/py/mat3ra/made/tools/build_components/operations/core/modifications/strain/helpers.py +0 -49
- package/src/py/mat3ra/made/tools/build_components/utils.py +0 -44
- package/src/py/mat3ra/made/tools/calculate/__init__.py +0 -149
- package/src/py/mat3ra/made/tools/calculate/ase/__init__.py +0 -133
- package/src/py/mat3ra/made/tools/calculate/ase/constraints.py +0 -91
- package/src/py/mat3ra/made/tools/calculate/calculators/__init__.py +0 -4
- package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator.py +0 -70
- package/src/py/mat3ra/made/tools/calculate/calculators/interface_material_calculator_parameters.py +0 -14
- package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator.py +0 -32
- package/src/py/mat3ra/made/tools/calculate/calculators/material_calculator_parameters.py +0 -17
- package/src/py/mat3ra/made/tools/calculate/interaction_functions.py +0 -23
- package/src/py/mat3ra/made/tools/convert/__init__.py +0 -286
- package/src/py/mat3ra/made/tools/convert/interface_parts_enum.py +0 -9
- package/src/py/mat3ra/made/tools/convert/utils.py +0 -96
- package/src/py/mat3ra/made/tools/entities/__init__.py +0 -5
- package/src/py/mat3ra/made/tools/entities/coordinate/__init__.py +0 -14
- package/src/py/mat3ra/made/tools/entities/coordinate/box_coordinate_condition.py +0 -15
- package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_condition.py +0 -16
- package/src/py/mat3ra/made/tools/entities/coordinate/coordinate_functions.py +0 -158
- package/src/py/mat3ra/made/tools/entities/coordinate/cylinder_coordinate_condition.py +0 -17
- package/src/py/mat3ra/made/tools/entities/coordinate/plane_coordinate_condition.py +0 -14
- package/src/py/mat3ra/made/tools/entities/coordinate/sphere_coordinate_condition.py +0 -15
- package/src/py/mat3ra/made/tools/entities/coordinate/triangular_prism_coordinate_condition.py +0 -26
- package/src/py/mat3ra/made/tools/entities/termination_holder.py +0 -12
- package/src/py/mat3ra/made/tools/helpers.py +0 -168
- package/src/py/mat3ra/made/tools/modify.py +0 -627
- package/src/py/mat3ra/made/tools/operations/core/binary.py +0 -106
- package/src/py/mat3ra/made/tools/operations/core/unary.py +0 -170
- package/src/py/mat3ra/made/tools/operations/core/utils.py +0 -138
- package/src/py/mat3ra/made/tools/operations/reusable/unary.py +0 -53
- package/src/py/mat3ra/made/tools/optimize.py +0 -55
- package/src/py/mat3ra/made/tools/third_party.py +0 -69
- package/src/py/mat3ra/made/tools/utils.py +0 -182
- package/src/py/mat3ra/made/utils.py +0 -144
- package/tests/.gitattributes +0 -1
- package/tests/fixtures/AsGe-basis.json +0 -3
- package/tests/fixtures/C2H4-translated.json +0 -3
- package/tests/fixtures/C2H4.json +0 -3
- package/tests/fixtures/FeLiSi-basis.json +0 -3
- package/tests/fixtures/FeO.json +0 -3
- package/tests/fixtures/Ge2-basis.json +0 -3
- package/tests/fixtures/Graphene.json +0 -3
- package/tests/fixtures/Graphene.poscar +0 -3
- package/tests/fixtures/H2+H-final.json +0 -3
- package/tests/fixtures/H2+H-image.json +0 -3
- package/tests/fixtures/H2+H-initial.json +0 -3
- package/tests/fixtures/H2O.poscar +0 -3
- package/tests/fixtures/LiFeSi-basis-labels.json +0 -3
- package/tests/fixtures/LiFeSi-basis.json +0 -3
- package/tests/fixtures/Na.json +0 -3
- package/tests/fixtures/Na4Cl4-cartesian.json +0 -3
- package/tests/fixtures/Na4Cl4.json +0 -3
- package/tests/fixtures/Na4Cl4.poscar +0 -3
- package/tests/fixtures/Ni-hex.json +0 -3
- package/tests/fixtures/Ni-hex.poscar +0 -3
- package/tests/fixtures/OSi-basis.json +0 -3
- package/tests/fixtures/Si-hex.poscar +0 -3
- package/tests/fixtures/Si-pwscf.in +0 -3
- package/tests/fixtures/Si-slab.json +0 -3
- package/tests/fixtures/Si-supercell.json +0 -3
- package/tests/fixtures/Si2-basis-repeated.json +0 -3
- package/tests/fixtures/Si2-basis.json +0 -3
- package/tests/fixtures/Zr1H23Zr1H1.json +0 -3
- package/tests/fixtures/Zr1H23Zr1H1.poscar +0 -3
- package/tests/fixtures/atomic-constraints.json +0 -3
- package/tests/fixtures/hashes.json +0 -3
- package/tests/fixtures/si-slab-100.json +0 -3
- package/tests/fixtures/si-slab-111-0-vacuum.json +0 -3
- package/tests/fixtures/si-slab-111-0.5-vacuum-gamma-120.json +0 -3
- package/tests/fixtures/si-slab-111-0.5-vacuum-ratio.json +0 -3
- package/tests/fixtures/si-standata.json +0 -3
- package/tests/js/basis/basis.ts +0 -247
- package/tests/js/cell/cell.ts +0 -182
- package/tests/js/cell/primitive_cell.ts +0 -21
- package/tests/js/constraints/constraints.ts +0 -11
- package/tests/js/fixtures.ts +0 -120
- package/tests/js/lattice/lattice.ts +0 -43
- package/tests/js/lattice/lattice_reciprocal.ts +0 -104
- package/tests/js/material.test.ts +0 -42
- package/tests/js/parsers/espresso.ts +0 -15
- package/tests/js/parsers/native_formats.ts +0 -35
- package/tests/js/parsers/poscar.ts +0 -89
- package/tests/js/parsers/xyz.ts +0 -33
- package/tests/js/parsers/xyz_combinatorial_basis.ts +0 -156
- package/tests/js/setup.ts +0 -6
- package/tests/js/tools/basis.ts +0 -22
- package/tests/js/tools/supercell.ts +0 -58
- package/tests/js/tools/surface.ts +0 -115
- package/tests/py/conftest.py +0 -34
- package/tests/py/mat3ra/debug_utils.py +0 -75
- package/tests/py/unit/__init__.py +0 -0
- package/tests/py/unit/fixtures/__init__.py +0 -0
- package/tests/py/unit/fixtures/adatom.py +0 -60
- package/tests/py/unit/fixtures/bulk.py +0 -162
- package/tests/py/unit/fixtures/cuts.py +0 -118
- package/tests/py/unit/fixtures/grain_boundary.py +0 -875
- package/tests/py/unit/fixtures/interface/commensurate.py +0 -498
- package/tests/py/unit/fixtures/interface/gaas_dia.py +0 -837
- package/tests/py/unit/fixtures/interface/gr_ni_111_top_hcp.py +0 -123
- package/tests/py/unit/fixtures/interface/simple.py +0 -84
- package/tests/py/unit/fixtures/interface/twisted_nanoribbons.py +0 -131
- package/tests/py/unit/fixtures/interface/zsl.py +0 -756
- package/tests/py/unit/fixtures/island.py +0 -336
- package/tests/py/unit/fixtures/merge.py +0 -147
- package/tests/py/unit/fixtures/monolayer.py +0 -46
- package/tests/py/unit/fixtures/nanoparticle.py +0 -116
- package/tests/py/unit/fixtures/nanoribbon/__init__.py +0 -0
- package/tests/py/unit/fixtures/nanoribbon/armchair.py +0 -102
- package/tests/py/unit/fixtures/nanoribbon/nanoribbon.py +0 -145
- package/tests/py/unit/fixtures/nanoribbon/zigzag.py +0 -54
- package/tests/py/unit/fixtures/pair_defects.py +0 -41
- package/tests/py/unit/fixtures/passivated/nanoribbon.py +0 -69
- package/tests/py/unit/fixtures/passivated/slab.py +0 -58
- package/tests/py/unit/fixtures/point_defects.py +0 -158
- package/tests/py/unit/fixtures/slab.py +0 -606
- package/tests/py/unit/fixtures/strain.py +0 -42
- package/tests/py/unit/fixtures/supercell.py +0 -64
- package/tests/py/unit/fixtures/terrace.py +0 -70
- package/tests/py/unit/fixtures/thrid_party/ase_atoms.py +0 -13
- package/tests/py/unit/test_analyze_lattice_planes.py +0 -131
- package/tests/py/unit/test_cell.py +0 -104
- package/tests/py/unit/test_data_files.py +0 -68
- package/tests/py/unit/test_lattice.py +0 -103
- package/tests/py/unit/test_lattice_type_extended.py +0 -53
- package/tests/py/unit/test_material.py +0 -158
- package/tests/py/unit/test_operations.py +0 -126
- package/tests/py/unit/test_primitive_cell.py +0 -118
- package/tests/py/unit/test_reciprocal_lattice.py +0 -86
- package/tests/py/unit/test_reciprocal_paths.py +0 -64
- package/tests/py/unit/test_symmetry_points.py +0 -151
- package/tests/py/unit/test_tools_analyze.py +0 -219
- package/tests/py/unit/test_tools_analyze_basis.py +0 -105
- package/tests/py/unit/test_tools_analyze_interface.py +0 -223
- package/tests/py/unit/test_tools_analyze_interface_material.py +0 -63
- package/tests/py/unit/test_tools_analyze_interface_zsl.py +0 -187
- package/tests/py/unit/test_tools_analyze_lattice.py +0 -74
- package/tests/py/unit/test_tools_analyze_swap.py +0 -80
- package/tests/py/unit/test_tools_build.py +0 -158
- package/tests/py/unit/test_tools_build_defect/__init__.py +0 -0
- package/tests/py/unit/test_tools_build_defect/test_adatom.py +0 -84
- package/tests/py/unit/test_tools_build_defect/test_island.py +0 -45
- package/tests/py/unit/test_tools_build_defect/test_pair_defect.py +0 -84
- package/tests/py/unit/test_tools_build_defect/test_point_defect.py +0 -196
- package/tests/py/unit/test_tools_build_defect/test_slab_stack.py +0 -30
- package/tests/py/unit/test_tools_build_defect/test_solid_solution.py +0 -90
- package/tests/py/unit/test_tools_build_defect/test_terrace.py +0 -44
- package/tests/py/unit/test_tools_build_grain_boundary.py +0 -133
- package/tests/py/unit/test_tools_build_heterostructure.py +0 -46
- package/tests/py/unit/test_tools_build_interface.py +0 -292
- package/tests/py/unit/test_tools_build_interface_zsl.py +0 -263
- package/tests/py/unit/test_tools_build_maxwell_disorder.py +0 -123
- package/tests/py/unit/test_tools_build_metadata.py +0 -79
- package/tests/py/unit/test_tools_build_monolayer.py +0 -33
- package/tests/py/unit/test_tools_build_nanoparticle.py +0 -42
- package/tests/py/unit/test_tools_build_nanoribbon.py +0 -45
- package/tests/py/unit/test_tools_build_passivation.py +0 -85
- package/tests/py/unit/test_tools_build_perturbation.py +0 -103
- package/tests/py/unit/test_tools_build_slab.py +0 -382
- package/tests/py/unit/test_tools_build_strain.py +0 -36
- package/tests/py/unit/test_tools_build_supercell.py +0 -47
- package/tests/py/unit/test_tools_calculate.py +0 -67
- package/tests/py/unit/test_tools_convert.py +0 -174
- package/tests/py/unit/test_tools_modify.py +0 -248
- package/tests/py/unit/utils.py +0 -142
- package/tsconfig-transpile.json +0 -3
- package/tsconfig.json +0 -3
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import math
|
|
2
|
-
from typing import List, Optional
|
|
3
|
-
|
|
4
|
-
import numpy as np
|
|
5
|
-
from mat3ra.code.constants import HASH_TOLERANCE
|
|
6
|
-
from mat3ra.code.entity import InMemoryEntityPydantic
|
|
7
|
-
from mat3ra.esse.models.properties_directory.structural.lattice import (
|
|
8
|
-
LatticeSchema,
|
|
9
|
-
LatticeTypeEnum,
|
|
10
|
-
LatticeUnitsSchema,
|
|
11
|
-
)
|
|
12
|
-
from mat3ra.utils.mixins import RoundNumericValuesMixin
|
|
13
|
-
from pydantic import BaseModel
|
|
14
|
-
|
|
15
|
-
from .cell import Cell
|
|
16
|
-
|
|
17
|
-
COORDINATE_TOLERANCE = 6
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class LatticeVectors(Cell):
|
|
21
|
-
pass
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class LatticeSchemaVectorless(BaseModel):
|
|
25
|
-
"""LatticeSchema without the vectors field to avoid conflicts."""
|
|
26
|
-
|
|
27
|
-
a: float
|
|
28
|
-
b: float
|
|
29
|
-
c: float
|
|
30
|
-
alpha: float
|
|
31
|
-
beta: float
|
|
32
|
-
gamma: float
|
|
33
|
-
units: LatticeUnitsSchema = LatticeSchema.model_fields["units"].default_factory()
|
|
34
|
-
type: LatticeTypeEnum = LatticeSchema.model_fields["type"].default
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class Lattice(RoundNumericValuesMixin, LatticeSchemaVectorless, InMemoryEntityPydantic):
|
|
38
|
-
__types__ = LatticeTypeEnum
|
|
39
|
-
__type_default__ = LatticeSchema.model_fields["type"].default
|
|
40
|
-
__units_default__ = LatticeSchema.model_fields["units"].default_factory()
|
|
41
|
-
|
|
42
|
-
a: float = 1.0
|
|
43
|
-
b: float = a
|
|
44
|
-
c: float = a
|
|
45
|
-
alpha: float = 90.0
|
|
46
|
-
beta: float = alpha
|
|
47
|
-
gamma: float = alpha
|
|
48
|
-
|
|
49
|
-
@property
|
|
50
|
-
def vectors(self) -> LatticeVectors:
|
|
51
|
-
vectors = self.calculate_vectors()
|
|
52
|
-
return LatticeVectors.from_vectors_array(vectors)
|
|
53
|
-
|
|
54
|
-
def calculate_vectors(self):
|
|
55
|
-
a = self.a
|
|
56
|
-
b = self.b
|
|
57
|
-
c = self.c
|
|
58
|
-
# Convert degrees to radians for trigonometric functions
|
|
59
|
-
alpha_rad = math.radians(self.alpha)
|
|
60
|
-
beta_rad = math.radians(self.beta)
|
|
61
|
-
gamma_rad = math.radians(self.gamma)
|
|
62
|
-
|
|
63
|
-
# Calculate cosines and sines of the angles
|
|
64
|
-
cos_alpha = math.cos(alpha_rad)
|
|
65
|
-
cos_beta = math.cos(beta_rad)
|
|
66
|
-
cos_gamma = math.cos(gamma_rad)
|
|
67
|
-
sin_alpha = math.sin(alpha_rad)
|
|
68
|
-
sin_beta = math.sin(beta_rad)
|
|
69
|
-
|
|
70
|
-
# Compute gamma star (used in matrix calculation)
|
|
71
|
-
gamma_star = math.acos((cos_alpha * cos_beta - cos_gamma) / (sin_alpha * sin_beta))
|
|
72
|
-
cos_gamma_star = math.cos(gamma_star)
|
|
73
|
-
sin_gamma_star = math.sin(gamma_star)
|
|
74
|
-
|
|
75
|
-
# Calculate the vectors
|
|
76
|
-
vector_a = [a * sin_beta, 0.0, a * cos_beta]
|
|
77
|
-
vector_b = [-b * sin_alpha * cos_gamma_star, b * sin_alpha * sin_gamma_star, b * cos_alpha]
|
|
78
|
-
vector_c = [0.0, 0.0, c]
|
|
79
|
-
|
|
80
|
-
return [vector_a, vector_b, vector_c]
|
|
81
|
-
|
|
82
|
-
@classmethod
|
|
83
|
-
def from_vectors_array(
|
|
84
|
-
cls,
|
|
85
|
-
vectors: List[List[float]],
|
|
86
|
-
units: Optional[LatticeUnitsSchema] = __units_default__,
|
|
87
|
-
type: Optional[LatticeTypeEnum] = __type_default__,
|
|
88
|
-
) -> "Lattice":
|
|
89
|
-
a = np.linalg.norm(vectors[0])
|
|
90
|
-
b = np.linalg.norm(vectors[1])
|
|
91
|
-
c = np.linalg.norm(vectors[2])
|
|
92
|
-
bc = b * c
|
|
93
|
-
ac = a * c
|
|
94
|
-
ab = a * b
|
|
95
|
-
|
|
96
|
-
if bc == 0 or ac == 0 or ab == 0:
|
|
97
|
-
print("Vectors:", vectors)
|
|
98
|
-
raise ValueError("Vectors must not be zero vectors.")
|
|
99
|
-
|
|
100
|
-
alpha = np.degrees(np.arccos(np.dot(vectors[1], vectors[2]) / bc))
|
|
101
|
-
beta = np.degrees(np.arccos(np.dot(vectors[0], vectors[2]) / ac))
|
|
102
|
-
gamma = np.degrees(np.arccos(np.dot(vectors[0], vectors[1]) / ab))
|
|
103
|
-
|
|
104
|
-
return cls(
|
|
105
|
-
a=float(a),
|
|
106
|
-
b=float(b),
|
|
107
|
-
c=float(c),
|
|
108
|
-
alpha=alpha,
|
|
109
|
-
beta=beta,
|
|
110
|
-
gamma=gamma,
|
|
111
|
-
units=units,
|
|
112
|
-
type=type,
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
@property
|
|
116
|
-
def vector_arrays(self) -> List[List[float]]:
|
|
117
|
-
return self.vectors.vector_arrays
|
|
118
|
-
|
|
119
|
-
@property
|
|
120
|
-
def vector_arrays_rounded(self) -> List[List[float]]:
|
|
121
|
-
return self.vectors.vector_arrays_rounded
|
|
122
|
-
|
|
123
|
-
@property
|
|
124
|
-
def cell_volume(self) -> float:
|
|
125
|
-
return self.vectors.volume
|
|
126
|
-
|
|
127
|
-
@property
|
|
128
|
-
def cell_volume_rounded(self) -> float:
|
|
129
|
-
return self.vectors.volume_rounded
|
|
130
|
-
|
|
131
|
-
@property
|
|
132
|
-
def reciprocal_vectors(self):
|
|
133
|
-
return np.linalg.inv(np.array(self.vector_arrays, dtype=float)).T.tolist()
|
|
134
|
-
|
|
135
|
-
@property
|
|
136
|
-
def reciprocal_vector_norms(self) -> List[float]:
|
|
137
|
-
return [float(np.linalg.norm(vector)) for vector in self.reciprocal_vectors]
|
|
138
|
-
|
|
139
|
-
@property
|
|
140
|
-
def reciprocal_vector_ratios(self) -> List[float]:
|
|
141
|
-
norms = self.reciprocal_vector_norms
|
|
142
|
-
max_norm = max(norms)
|
|
143
|
-
return [round(float(value / max_norm), 3) for value in norms]
|
|
144
|
-
|
|
145
|
-
@property
|
|
146
|
-
def type_extended(self) -> str:
|
|
147
|
-
"""Get the extended lattice type classification.
|
|
148
|
-
|
|
149
|
-
For lattice types with subtypes (BCT, ORCF, RHL, MCLC, TRI),
|
|
150
|
-
returns the specific subtype based on lattice parameters.
|
|
151
|
-
For other types, returns the base type string.
|
|
152
|
-
"""
|
|
153
|
-
a, b, c = self.a, self.b, self.c
|
|
154
|
-
alpha, beta, gamma = self.alpha, self.beta, self.gamma
|
|
155
|
-
cos_alpha = math.cos(math.radians(alpha))
|
|
156
|
-
lattice_type = self.type.value if hasattr(self.type, "value") else str(self.type)
|
|
157
|
-
|
|
158
|
-
if lattice_type == "BCT":
|
|
159
|
-
return "BCT-1" if c < a else "BCT-2"
|
|
160
|
-
elif lattice_type == "ORCF":
|
|
161
|
-
if 1 / (a * a) >= 1 / (b * b) + 1 / (c * c):
|
|
162
|
-
return "ORCF-1"
|
|
163
|
-
return "ORCF-2"
|
|
164
|
-
elif lattice_type == "RHL":
|
|
165
|
-
return "RHL-1" if cos_alpha > 0 else "RHL-2"
|
|
166
|
-
elif lattice_type == "MCLC":
|
|
167
|
-
if gamma >= 90:
|
|
168
|
-
return "MCLC-1"
|
|
169
|
-
if (b / c) * cos_alpha + (b * b / (a * a)) * (1 - cos_alpha * cos_alpha) <= 1:
|
|
170
|
-
return "MCLC-3"
|
|
171
|
-
return "MCLC-5"
|
|
172
|
-
elif lattice_type == "TRI":
|
|
173
|
-
if alpha > 90 and beta > 90 and gamma >= 90:
|
|
174
|
-
return "TRI_1a"
|
|
175
|
-
return "TRI_1b"
|
|
176
|
-
else:
|
|
177
|
-
return lattice_type
|
|
178
|
-
|
|
179
|
-
def get_hash_string(self, is_scaled: bool = False) -> str:
|
|
180
|
-
"""Mirrors JS Lattice.getHashString(isScaled). Rounds to HASH_TOLERANCE decimal places."""
|
|
181
|
-
scale = self.a if is_scaled else 1
|
|
182
|
-
values = [self.a / scale, self.b / scale, self.c / scale, self.alpha, self.beta, self.gamma]
|
|
183
|
-
return ";".join(f"{round(v, HASH_TOLERANCE):g}" for v in values) + ";"
|
|
184
|
-
|
|
185
|
-
def get_scaled_by_matrix(self, matrix: List[List[float]]):
|
|
186
|
-
"""
|
|
187
|
-
Scale the lattice by a matrix.
|
|
188
|
-
Args:
|
|
189
|
-
matrix (List[List[float]]): A 3x3 matrix.
|
|
190
|
-
"""
|
|
191
|
-
np_vectors = np.array(self.vector_arrays)
|
|
192
|
-
np_matrix = np.array(matrix)
|
|
193
|
-
scaled_vectors = np.dot(np_matrix, np_vectors).tolist()
|
|
194
|
-
new_lattice = self.from_vectors_array(vectors=scaled_vectors, units=self.units, type=self.type)
|
|
195
|
-
return new_lattice
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import hashlib
|
|
2
|
-
from typing import Any, List, Optional, Union
|
|
3
|
-
|
|
4
|
-
from mat3ra.code.constants import AtomicCoordinateUnits, Units
|
|
5
|
-
from mat3ra.code.entity import HasDescriptionHasMetadataNamedDefaultableInMemoryEntityPydantic
|
|
6
|
-
from mat3ra.esse.models.material import MaterialSchema
|
|
7
|
-
from pydantic import ConfigDict, SkipValidation, computed_field, field_serializer
|
|
8
|
-
|
|
9
|
-
from .basis import Basis
|
|
10
|
-
from .lattice import Lattice
|
|
11
|
-
|
|
12
|
-
defaultMaterialConfig = {
|
|
13
|
-
"name": "Silicon FCC",
|
|
14
|
-
"basis": {
|
|
15
|
-
"elements": [
|
|
16
|
-
{
|
|
17
|
-
"id": 0,
|
|
18
|
-
"value": "Si",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"id": 1,
|
|
22
|
-
"value": "Si",
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
"coordinates": [
|
|
26
|
-
{
|
|
27
|
-
"id": 0,
|
|
28
|
-
"value": [0.0, 0.0, 0.0],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"id": 1,
|
|
32
|
-
"value": [0.25, 0.25, 0.25],
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
"units": AtomicCoordinateUnits.crystal,
|
|
36
|
-
"labels": [],
|
|
37
|
-
"constraints": [],
|
|
38
|
-
},
|
|
39
|
-
"lattice": {
|
|
40
|
-
"a": 3.867,
|
|
41
|
-
"b": 3.867,
|
|
42
|
-
"c": 3.867,
|
|
43
|
-
"alpha": 60.0,
|
|
44
|
-
"beta": 60.0,
|
|
45
|
-
"gamma": 60.0,
|
|
46
|
-
"units": {
|
|
47
|
-
"length": Units.angstrom,
|
|
48
|
-
"angle": Units.degree,
|
|
49
|
-
},
|
|
50
|
-
"type": "FCC",
|
|
51
|
-
},
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
# TODO: replace `-Pydantic` with actual class in the next PR
|
|
56
|
-
class Material(MaterialSchema, HasDescriptionHasMetadataNamedDefaultableInMemoryEntityPydantic):
|
|
57
|
-
model_config = ConfigDict(arbitrary_types_allowed=True, populate_by_name=True)
|
|
58
|
-
|
|
59
|
-
__default_config__ = defaultMaterialConfig
|
|
60
|
-
__schema__ = MaterialSchema
|
|
61
|
-
|
|
62
|
-
basis: Basis
|
|
63
|
-
lattice: Lattice
|
|
64
|
-
# TODO: Fix discriminator in ESSE and remove this:
|
|
65
|
-
derivedProperties: Optional[SkipValidation[object]] = None
|
|
66
|
-
|
|
67
|
-
def model_post_init(self, __context: Any) -> None:
|
|
68
|
-
if not self.name and self.formula:
|
|
69
|
-
self.name: str = self.formula
|
|
70
|
-
self.basis.cell = self.lattice.vectors
|
|
71
|
-
|
|
72
|
-
@classmethod
|
|
73
|
-
def create_from_config_or_class_instance(cls, config_or_instance: Union[dict, "Material"]) -> "Material":
|
|
74
|
-
if isinstance(config_or_instance, cls):
|
|
75
|
-
return config_or_instance
|
|
76
|
-
return cls.create(config_or_instance)
|
|
77
|
-
|
|
78
|
-
@property
|
|
79
|
-
def coordinates_array(self) -> List[List[float]]:
|
|
80
|
-
return self.basis.coordinates.values
|
|
81
|
-
|
|
82
|
-
def to_cartesian(self) -> None:
|
|
83
|
-
self.basis.to_cartesian()
|
|
84
|
-
|
|
85
|
-
def to_crystal(self) -> None:
|
|
86
|
-
self.basis.to_crystal()
|
|
87
|
-
|
|
88
|
-
def set_coordinates(self, coordinates: List[List[float]]) -> None:
|
|
89
|
-
self.basis.coordinates.values = coordinates
|
|
90
|
-
|
|
91
|
-
def set_lattice_vectors(
|
|
92
|
-
self, lattice_vector1: List[float], lattice_vector2: List[float], lattice_vector3: List[float]
|
|
93
|
-
) -> None:
|
|
94
|
-
original_is_in_crystal_units = self.basis.is_in_crystal_units
|
|
95
|
-
self.to_cartesian()
|
|
96
|
-
self.lattice = Lattice.from_vectors_array([lattice_vector1, lattice_vector2, lattice_vector3])
|
|
97
|
-
self.basis.cell = self.lattice.vectors
|
|
98
|
-
if original_is_in_crystal_units:
|
|
99
|
-
self.to_crystal()
|
|
100
|
-
|
|
101
|
-
def set_lattice_vectors_from_array(self, lattice_vectors: List[List[float]]) -> None:
|
|
102
|
-
if len(lattice_vectors) != 3:
|
|
103
|
-
raise ValueError("Lattice vectors array must contain exactly three vectors.")
|
|
104
|
-
self.set_lattice_vectors(*lattice_vectors)
|
|
105
|
-
|
|
106
|
-
def set_lattice(self, lattice: Lattice) -> None:
|
|
107
|
-
self.set_lattice_vectors(*lattice.vector_arrays)
|
|
108
|
-
|
|
109
|
-
def add_atom(self, element: str, coordinate: List[float], use_cartesian_coordinates: bool = False) -> None:
|
|
110
|
-
self.basis.add_atom(element, coordinate, use_cartesian_coordinates)
|
|
111
|
-
|
|
112
|
-
def set_labels_from_list(self, labels: Optional[List[Union[int, str]]]) -> None:
|
|
113
|
-
self.basis.set_labels_from_list(labels)
|
|
114
|
-
|
|
115
|
-
def set_labels_from_value(self, value: Union[int, str]) -> None:
|
|
116
|
-
self.basis.set_labels_from_list([value] * self.basis.number_of_atoms)
|
|
117
|
-
|
|
118
|
-
def calculate_hash(self, salt: str = "", is_scaled: bool = False) -> str:
|
|
119
|
-
"""Mirrors JS materialMixin.calculateHash(). MD5 of basis + lattice hash strings."""
|
|
120
|
-
message = f"{self.basis.hash_string}#{self.lattice.get_hash_string(is_scaled)}#{salt}"
|
|
121
|
-
return hashlib.md5(message.encode()).hexdigest()
|
|
122
|
-
|
|
123
|
-
@computed_field
|
|
124
|
-
@property
|
|
125
|
-
def hash(self) -> str:
|
|
126
|
-
return self.calculate_hash()
|
|
127
|
-
|
|
128
|
-
@field_serializer("scaledHash")
|
|
129
|
-
def serialize_scaled_hash(self, _scaled_hash: Optional[str]) -> str:
|
|
130
|
-
return self.scaled_hash
|
|
131
|
-
|
|
132
|
-
@property
|
|
133
|
-
def scaled_hash(self) -> str:
|
|
134
|
-
return self.calculate_hash(is_scaled=True)
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from typing import Any
|
|
3
|
-
|
|
4
|
-
from mat3ra.code.entity import InMemoryEntityPydantic
|
|
5
|
-
from pydantic import model_validator
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def to_dict(obj: Any) -> dict:
|
|
9
|
-
if isinstance(obj, dict):
|
|
10
|
-
return obj
|
|
11
|
-
if hasattr(obj, "to_dict") and callable(obj.to_dict):
|
|
12
|
-
return obj.to_dict()
|
|
13
|
-
# TODO: remove conditional checks below when all configurations moved to Pydantic
|
|
14
|
-
if hasattr(obj, "to_json") and callable(obj.to_json):
|
|
15
|
-
data = obj.to_json()
|
|
16
|
-
if isinstance(data, str):
|
|
17
|
-
return json.loads(data)
|
|
18
|
-
return data
|
|
19
|
-
return {}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class BaseMetadata(InMemoryEntityPydantic):
|
|
23
|
-
model_config = {"arbitrary_types_allowed": True, "extra": "allow"}
|
|
24
|
-
|
|
25
|
-
@model_validator(mode="before")
|
|
26
|
-
def convert_fields_to_dict(cls, values):
|
|
27
|
-
for key, value in values.items():
|
|
28
|
-
field = cls.model_fields.get(key)
|
|
29
|
-
if field and field.annotation is dict and value is None:
|
|
30
|
-
values[key] = {}
|
|
31
|
-
elif field and field.annotation is dict and value is not None and not isinstance(value, dict):
|
|
32
|
-
values[key] = to_dict(value)
|
|
33
|
-
elif isinstance(value, InMemoryEntityPydantic):
|
|
34
|
-
values[key] = to_dict(value)
|
|
35
|
-
elif hasattr(value, "to_dict") and callable(value.to_dict):
|
|
36
|
-
values[key] = to_dict(value)
|
|
37
|
-
# TODO: remove when Pydantic configurations are fully implemented
|
|
38
|
-
elif hasattr(value, "to_json") and callable(value.to_json):
|
|
39
|
-
values[key] = to_dict(value)
|
|
40
|
-
return values
|
|
41
|
-
|
|
42
|
-
def update(self, **kwargs: Any):
|
|
43
|
-
for key, value in kwargs.items():
|
|
44
|
-
if hasattr(self, key) and isinstance(getattr(self, key), dict):
|
|
45
|
-
getattr(self, key).update(to_dict(value))
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Reciprocal lattice class with k-point path and symmetry point utilities.
|
|
3
|
-
|
|
4
|
-
Extends the base Lattice class with reciprocal-space functionality
|
|
5
|
-
for Brillouin zone analysis.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from typing import List, Optional
|
|
9
|
-
|
|
10
|
-
import numpy as np
|
|
11
|
-
|
|
12
|
-
from ..lattice import Lattice
|
|
13
|
-
from .paths import RECIPROCAL_PATHS
|
|
14
|
-
from .symmetry_points import get_symmetry_points
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class ReciprocalLattice(Lattice):
|
|
18
|
-
"""Lattice with reciprocal-space utilities.
|
|
19
|
-
|
|
20
|
-
Provides methods for working with reciprocal lattice vectors,
|
|
21
|
-
high-symmetry points, k-point paths, and k-grid dimensions.
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
def cartesian_coordinates(self, point: List[float]) -> List[float]:
|
|
25
|
-
"""Convert a point in crystal (fractional) coordinates to Cartesian coordinates.
|
|
26
|
-
|
|
27
|
-
The Cartesian coordinates are in units of 2π/a.
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
point: A 3D point in fractional reciprocal-space coordinates.
|
|
31
|
-
|
|
32
|
-
Returns:
|
|
33
|
-
The point in Cartesian coordinates.
|
|
34
|
-
"""
|
|
35
|
-
return np.dot(point, self.reciprocal_vectors).tolist()
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def symmetry_points(self) -> List[dict]:
|
|
39
|
-
"""Get the list of high-symmetry points for the current lattice.
|
|
40
|
-
|
|
41
|
-
Returns:
|
|
42
|
-
List of dicts with 'point' (str) and 'coordinates' ([float, float, float]).
|
|
43
|
-
"""
|
|
44
|
-
return get_symmetry_points(self)
|
|
45
|
-
|
|
46
|
-
@property
|
|
47
|
-
def default_kpoint_path(self) -> List[dict]:
|
|
48
|
-
"""Get the default path in reciprocal space for the current lattice.
|
|
49
|
-
|
|
50
|
-
Looks up the path by extended type first (e.g., 'BCT-1'), falling back
|
|
51
|
-
to the base type (e.g., 'BCT').
|
|
52
|
-
|
|
53
|
-
Returns:
|
|
54
|
-
List of dicts with 'point' (str) and 'steps' (int).
|
|
55
|
-
"""
|
|
56
|
-
path = RECIPROCAL_PATHS.get(self.type_extended)
|
|
57
|
-
if path is None:
|
|
58
|
-
lattice_type = self.type.value if hasattr(self.type, "value") else str(self.type)
|
|
59
|
-
path = RECIPROCAL_PATHS.get(lattice_type, [])
|
|
60
|
-
return path
|
|
61
|
-
|
|
62
|
-
def extract_kpoint_path(self, data_points: Optional[List[List[float]]] = None) -> List[dict]:
|
|
63
|
-
"""Find and label high-symmetry points in a list of raw k-point coordinates.
|
|
64
|
-
|
|
65
|
-
Scans through the provided data points and identifies any that match
|
|
66
|
-
known symmetry points (within tolerance).
|
|
67
|
-
|
|
68
|
-
Args:
|
|
69
|
-
data_points: List of 3D k-point coordinates.
|
|
70
|
-
|
|
71
|
-
Returns:
|
|
72
|
-
List of dicts with 'point' (str), 'steps' (int), and
|
|
73
|
-
'coordinates' ([float, float, float]) for each matched symmetry point.
|
|
74
|
-
"""
|
|
75
|
-
if data_points is None:
|
|
76
|
-
data_points = []
|
|
77
|
-
|
|
78
|
-
kpoint_path: List[dict] = []
|
|
79
|
-
symm_points = self.symmetry_points
|
|
80
|
-
|
|
81
|
-
for index, point in enumerate(data_points):
|
|
82
|
-
for sp in symm_points:
|
|
83
|
-
if np.allclose(sp["coordinates"], point, atol=1e-4):
|
|
84
|
-
kpoint_path.append(
|
|
85
|
-
{
|
|
86
|
-
"point": sp["point"],
|
|
87
|
-
"steps": index,
|
|
88
|
-
"coordinates": sp["coordinates"],
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
break
|
|
92
|
-
|
|
93
|
-
return kpoint_path
|
|
94
|
-
|
|
95
|
-
def calculate_dimension(self, n_points: int, index: int) -> int:
|
|
96
|
-
"""Calculate k-grid dimension for one reciprocal direction.
|
|
97
|
-
|
|
98
|
-
Args:
|
|
99
|
-
n_points: Total number of k-points.
|
|
100
|
-
index: Index of the reciprocal vector direction (0, 1, or 2).
|
|
101
|
-
|
|
102
|
-
Returns:
|
|
103
|
-
Grid dimension in the specified direction.
|
|
104
|
-
"""
|
|
105
|
-
norms = self.reciprocal_vector_norms
|
|
106
|
-
others = [i for i in range(3) if i != index]
|
|
107
|
-
j, k = others[0], others[1]
|
|
108
|
-
n = np.cbrt((n_points * norms[index] ** 2) / (norms[j] * norms[k]))
|
|
109
|
-
return max(1, int(np.ceil(n)))
|
|
110
|
-
|
|
111
|
-
def get_dimensions_from_points_count(self, n_kpoints: int) -> List[int]:
|
|
112
|
-
"""Calculate 3D grid dimensions from total number of k-points.
|
|
113
|
-
|
|
114
|
-
Args:
|
|
115
|
-
n_kpoints: Total number of k-points.
|
|
116
|
-
|
|
117
|
-
Returns:
|
|
118
|
-
List of three grid dimensions [n1, n2, n3].
|
|
119
|
-
"""
|
|
120
|
-
return [self.calculate_dimension(n_kpoints, i) for i in range(3)]
|
|
121
|
-
|
|
122
|
-
def get_dimensions_from_spacing(self, spacing: float) -> List[int]:
|
|
123
|
-
"""Calculate grid dimensions from k-point spacing.
|
|
124
|
-
|
|
125
|
-
The spacing is in Cartesian (2π/a) units.
|
|
126
|
-
|
|
127
|
-
Args:
|
|
128
|
-
spacing: Maximum spacing between k-points.
|
|
129
|
-
|
|
130
|
-
Returns:
|
|
131
|
-
List of three grid dimensions [n1, n2, n3].
|
|
132
|
-
"""
|
|
133
|
-
norms = self.reciprocal_vector_norms
|
|
134
|
-
return [max(1, int(np.ceil(round(norm / spacing, 4)))) for norm in norms]
|
|
135
|
-
|
|
136
|
-
def get_spacing_from_dimensions(self, dimensions: List[int]) -> float:
|
|
137
|
-
"""Calculate average k-point spacing from grid dimensions.
|
|
138
|
-
|
|
139
|
-
Args:
|
|
140
|
-
dimensions: List of three grid dimensions [n1, n2, n3].
|
|
141
|
-
|
|
142
|
-
Returns:
|
|
143
|
-
Average spacing in Cartesian (2π/a) units.
|
|
144
|
-
"""
|
|
145
|
-
norms = self.reciprocal_vector_norms
|
|
146
|
-
spacings = [norms[i] / max(1, dimensions[i]) for i in range(3)]
|
|
147
|
-
return float(np.mean(spacings))
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Default k-point paths according to AFLOW methodology.
|
|
3
|
-
|
|
4
|
-
Reference: https://arxiv.org/abs/1004.2974
|
|
5
|
-
Paths are split in parts for clarity.
|
|
6
|
-
|
|
7
|
-
Raw segment data is stored in reciprocal_paths.json (shared with JS/TS).
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
import json
|
|
11
|
-
from typing import Dict, List
|
|
12
|
-
|
|
13
|
-
from mat3ra.made.data_helper import DATA_DIR
|
|
14
|
-
|
|
15
|
-
_JSON_FILE = DATA_DIR / "reciprocal_paths.json"
|
|
16
|
-
with open(_JSON_FILE) as f:
|
|
17
|
-
_POINTS: Dict[str, List[List[str]]] = json.load(f)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def _build_reciprocal_paths() -> Dict[str, List[dict]]:
|
|
21
|
-
"""Flatten path segments and assign default step count to each point."""
|
|
22
|
-
result: Dict[str, List[dict]] = {}
|
|
23
|
-
for key, path_segments in _POINTS.items():
|
|
24
|
-
flattened = [point for segment in path_segments for point in segment]
|
|
25
|
-
# TODO: calculate number of steps based on distance in k-space
|
|
26
|
-
result[key] = [{"point": point, "steps": 10} for point in flattened]
|
|
27
|
-
return result
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
RECIPROCAL_PATHS: Dict[str, List[dict]] = _build_reciprocal_paths()
|