@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,255 +0,0 @@
|
|
|
1
|
-
from typing import Any, Dict, List, Optional, Union
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from mat3ra.code.array_with_ids import ArrayWithIds
|
|
5
|
-
from mat3ra.code.constants import HASH_TOLERANCE
|
|
6
|
-
from mat3ra.code.entity import InMemoryEntityPydantic
|
|
7
|
-
from mat3ra.esse.models.core.abstract.matrix_3x3 import Matrix3x3Schema
|
|
8
|
-
from mat3ra.esse.models.material import BasisSchema, BasisUnitsEnum
|
|
9
|
-
from mat3ra.made.basis.coordinates import Coordinates
|
|
10
|
-
from mat3ra.made.cell import Cell
|
|
11
|
-
from pydantic import Field
|
|
12
|
-
from scipy.spatial import cKDTree
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def get_overlapping_coordinates(
|
|
16
|
-
coordinate: List[float],
|
|
17
|
-
coordinates: List[List[float]],
|
|
18
|
-
threshold: float = 0.01,
|
|
19
|
-
) -> List[List[float]]:
|
|
20
|
-
"""
|
|
21
|
-
Find coordinates that are within a certain threshold of a given coordinate.
|
|
22
|
-
|
|
23
|
-
Args:
|
|
24
|
-
coordinate (List[float]): The coordinate.
|
|
25
|
-
coordinates (List[List[float]]): The list of coordinates.
|
|
26
|
-
threshold (float): The threshold for the distance, in the units of the coordinates.
|
|
27
|
-
|
|
28
|
-
Returns:
|
|
29
|
-
List[List[float]]: The list of overlapping coordinates.
|
|
30
|
-
"""
|
|
31
|
-
return [c for c in coordinates if np.linalg.norm(np.array(c) - np.array(coordinate)) < threshold]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class Basis(BasisSchema, InMemoryEntityPydantic):
|
|
35
|
-
elements: ArrayWithIds
|
|
36
|
-
coordinates: Coordinates
|
|
37
|
-
cell: Cell = Field(Cell(), exclude=True)
|
|
38
|
-
labels: ArrayWithIds = Field(ArrayWithIds.from_values([]))
|
|
39
|
-
constraints: ArrayWithIds = Field(ArrayWithIds.from_values([]))
|
|
40
|
-
DEFAULT_COORDINATE_PROXIMITY_TOLERANCE: float = Field(
|
|
41
|
-
0.1, exclude=True
|
|
42
|
-
) # Angstroms, used for checking overlapping coordinates
|
|
43
|
-
|
|
44
|
-
def __convert_kwargs__(self, **kwargs: Any) -> Dict[str, Any]:
|
|
45
|
-
if isinstance(kwargs.get("elements"), list):
|
|
46
|
-
kwargs["elements"] = ArrayWithIds.from_list_of_dicts(kwargs["elements"])
|
|
47
|
-
if isinstance(kwargs.get("coordinates"), list):
|
|
48
|
-
kwargs["coordinates"] = Coordinates.from_list_of_dicts(kwargs["coordinates"])
|
|
49
|
-
if isinstance(kwargs.get("labels"), list):
|
|
50
|
-
kwargs["labels"] = ArrayWithIds.from_list_of_dicts(kwargs["labels"])
|
|
51
|
-
if isinstance(kwargs.get("constraints"), list):
|
|
52
|
-
kwargs["constraints"] = ArrayWithIds.from_list_of_dicts(kwargs["constraints"])
|
|
53
|
-
if isinstance(kwargs.get("cell"), list):
|
|
54
|
-
kwargs["cell"] = Cell.from_vectors_array(kwargs["cell"])
|
|
55
|
-
return kwargs
|
|
56
|
-
|
|
57
|
-
def __init__(self, *args: Any, **kwargs: Any):
|
|
58
|
-
kwargs = self.__convert_kwargs__(**kwargs)
|
|
59
|
-
super().__init__(*args, **kwargs)
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def coordinates_as_kdtree(self):
|
|
63
|
-
return cKDTree(np.array(self.coordinates.values))
|
|
64
|
-
|
|
65
|
-
def get_coordinates_colliding_pairs(self, tolerance=DEFAULT_COORDINATE_PROXIMITY_TOLERANCE):
|
|
66
|
-
return self.coordinates_as_kdtree.query_pairs(r=tolerance)
|
|
67
|
-
|
|
68
|
-
@property
|
|
69
|
-
def number_of_atoms(self) -> int:
|
|
70
|
-
return len(self.elements.values)
|
|
71
|
-
|
|
72
|
-
@classmethod
|
|
73
|
-
def from_dict(
|
|
74
|
-
cls,
|
|
75
|
-
elements: List[Dict],
|
|
76
|
-
coordinates: List[Dict],
|
|
77
|
-
units: str,
|
|
78
|
-
cell: List[List[float]],
|
|
79
|
-
labels: Optional[List[Dict]] = ArrayWithIds.from_list_of_dicts([]),
|
|
80
|
-
constraints: Optional[List[Dict]] = ArrayWithIds.from_list_of_dicts([]),
|
|
81
|
-
) -> "Basis":
|
|
82
|
-
return Basis(
|
|
83
|
-
elements=ArrayWithIds.from_list_of_dicts(elements),
|
|
84
|
-
coordinates=Coordinates.from_list_of_dicts(coordinates),
|
|
85
|
-
units=units,
|
|
86
|
-
cell=Cell.from_vectors_array(cell),
|
|
87
|
-
labels=ArrayWithIds.from_list_of_dicts(labels),
|
|
88
|
-
constraints=ArrayWithIds.from_list_of_dicts(constraints),
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
@property
|
|
92
|
-
def hash_string(self) -> str:
|
|
93
|
-
"""
|
|
94
|
-
Mirrors JS Basis.hashString (getAsSortedString in crystal units).
|
|
95
|
-
Converts to crystal, applies mod 1 to bring coords into [0,1), builds sorted atom strings.
|
|
96
|
-
"""
|
|
97
|
-
original_is_in_cartesian = self.is_in_cartesian_units
|
|
98
|
-
self.to_crystal()
|
|
99
|
-
labels_map = {lbl["id"]: str(lbl["value"]) for lbl in self.labels.to_dict()}
|
|
100
|
-
parts = []
|
|
101
|
-
for elem, coord in zip(self.elements.to_dict(), self.coordinates.to_dict()):
|
|
102
|
-
label = labels_map.get(elem["id"], "")
|
|
103
|
-
rounded = [f"{round(v % 1, HASH_TOLERANCE):g}" for v in coord["value"]]
|
|
104
|
-
parts.append(f"{elem['value']}{label} {','.join(rounded)}")
|
|
105
|
-
if original_is_in_cartesian:
|
|
106
|
-
self.to_cartesian()
|
|
107
|
-
return ";".join(sorted(parts)) + ";"
|
|
108
|
-
|
|
109
|
-
@property
|
|
110
|
-
def is_in_crystal_units(self):
|
|
111
|
-
return self.units == BasisUnitsEnum.crystal
|
|
112
|
-
|
|
113
|
-
@property
|
|
114
|
-
def is_in_cartesian_units(self):
|
|
115
|
-
return self.units == BasisUnitsEnum.cartesian
|
|
116
|
-
|
|
117
|
-
def to_cartesian(self):
|
|
118
|
-
if self.is_in_cartesian_units:
|
|
119
|
-
return
|
|
120
|
-
self.coordinates.map_array_in_place(self.cell.convert_point_to_cartesian)
|
|
121
|
-
self.units = BasisUnitsEnum.cartesian
|
|
122
|
-
|
|
123
|
-
def to_crystal(self):
|
|
124
|
-
if self.is_in_crystal_units:
|
|
125
|
-
return
|
|
126
|
-
self.coordinates.map_array_in_place(self.cell.convert_point_to_crystal)
|
|
127
|
-
self.units = BasisUnitsEnum.crystal
|
|
128
|
-
|
|
129
|
-
def add_atom(
|
|
130
|
-
self,
|
|
131
|
-
element="Si",
|
|
132
|
-
coordinate: Optional[List[float]] = None,
|
|
133
|
-
use_cartesian_coordinates: bool = False,
|
|
134
|
-
force: bool = False,
|
|
135
|
-
label: Optional[Union[int, str]] = None,
|
|
136
|
-
):
|
|
137
|
-
"""
|
|
138
|
-
Add an atom to the basis at a specified coordinate. Check that no other atom is overlapping with it.
|
|
139
|
-
|
|
140
|
-
Args:
|
|
141
|
-
element (str): Element symbol of the atom to be added.
|
|
142
|
-
coordinate (List[float]): Coordinate of the atom to be added.
|
|
143
|
-
use_cartesian_coordinates (bool): Whether the coordinate is in Cartesian units (or crystal by default).
|
|
144
|
-
force (bool): Whether to force adding the atom even if it overlaps with another atom.
|
|
145
|
-
label (int|str|None): Per-atom label when the basis already uses labels; omit if the basis has none.
|
|
146
|
-
"""
|
|
147
|
-
if coordinate is None:
|
|
148
|
-
coordinate = [0, 0, 0]
|
|
149
|
-
if use_cartesian_coordinates and self.is_in_crystal_units:
|
|
150
|
-
coordinate = self.cell.convert_point_to_crystal(coordinate)
|
|
151
|
-
if not use_cartesian_coordinates and self.is_in_cartesian_units:
|
|
152
|
-
coordinate = self.cell.convert_point_to_cartesian(coordinate)
|
|
153
|
-
cartesian_coordinates_for_overlap_check = [
|
|
154
|
-
self.cell.convert_point_to_cartesian(coord) for coord in self.coordinates.values
|
|
155
|
-
]
|
|
156
|
-
cartesian_coordinate_for_overlap_check = self.cell.convert_point_to_cartesian(coordinate)
|
|
157
|
-
if get_overlapping_coordinates(
|
|
158
|
-
cartesian_coordinate_for_overlap_check, cartesian_coordinates_for_overlap_check, threshold=0.01
|
|
159
|
-
):
|
|
160
|
-
if force:
|
|
161
|
-
print(f"Warning: Overlapping coordinates found for {coordinate}. Adding atom anyway.")
|
|
162
|
-
else:
|
|
163
|
-
print(f"Warning: Overlapping coordinates found for {coordinate}. Not adding atom.")
|
|
164
|
-
return
|
|
165
|
-
self.elements.add_item(element)
|
|
166
|
-
self.coordinates.add_item(coordinate)
|
|
167
|
-
if label is not None:
|
|
168
|
-
self.labels.add_item(label)
|
|
169
|
-
|
|
170
|
-
def add_atoms_from_another_basis(self, other_basis: "Basis"):
|
|
171
|
-
"""
|
|
172
|
-
Add atoms from another basis to this basis.
|
|
173
|
-
|
|
174
|
-
Args:
|
|
175
|
-
other_basis (Basis): The other basis to add atoms from.
|
|
176
|
-
"""
|
|
177
|
-
|
|
178
|
-
for el in other_basis.elements.values:
|
|
179
|
-
self.elements.add_item(el)
|
|
180
|
-
for coord in other_basis.coordinates.values:
|
|
181
|
-
self.coordinates.add_item(coord)
|
|
182
|
-
for label in other_basis.labels.values:
|
|
183
|
-
self.labels.add_item(label)
|
|
184
|
-
|
|
185
|
-
def remove_atom_by_id(self, id: int):
|
|
186
|
-
self.elements.remove_item(id)
|
|
187
|
-
self.coordinates.remove_item(id)
|
|
188
|
-
self.labels.remove_item(id)
|
|
189
|
-
|
|
190
|
-
def remove_atoms_by_elements(self, values: Union[List[str], str]) -> "Basis":
|
|
191
|
-
if isinstance(values, str):
|
|
192
|
-
values = [values]
|
|
193
|
-
ids_to_remove = [
|
|
194
|
-
id_ for value in values for id_, v in zip(self.elements.ids, self.elements.values) if v == value
|
|
195
|
-
]
|
|
196
|
-
self.filter_atoms_by_ids(ids_to_remove, invert=True)
|
|
197
|
-
return self
|
|
198
|
-
|
|
199
|
-
def filter_atoms_by_ids(self, ids: Union[List[int], int], invert: bool = False, reset_ids=False) -> "Basis":
|
|
200
|
-
self.elements.filter_by_ids(ids, invert, reset_ids=reset_ids)
|
|
201
|
-
self.coordinates.filter_by_ids(ids, invert, reset_ids=reset_ids)
|
|
202
|
-
self.labels.filter_by_ids(ids, invert, reset_ids=reset_ids)
|
|
203
|
-
return self
|
|
204
|
-
|
|
205
|
-
def filter_atoms_by_labels(self, labels: Union[List[str], str]) -> "Basis":
|
|
206
|
-
labels_int = [int(label) if isinstance(label, str) else label for label in labels]
|
|
207
|
-
self.labels.filter_by_values(labels_int)
|
|
208
|
-
ids = self.labels.ids
|
|
209
|
-
self.elements.filter_by_ids(ids)
|
|
210
|
-
self.coordinates.filter_by_ids(ids)
|
|
211
|
-
return self
|
|
212
|
-
|
|
213
|
-
def set_labels_from_list(self, labels: Optional[List[Union[int, str]]]) -> None:
|
|
214
|
-
"""
|
|
215
|
-
Set the labels of the basis from a list of labels (i. e. [1,1,1] for a 3-atom basis).
|
|
216
|
-
If None or [] are passed, the labels are removed (set to an empty array).
|
|
217
|
-
"""
|
|
218
|
-
num_atoms = len(self.elements.values)
|
|
219
|
-
|
|
220
|
-
if labels is None or len(labels) == 0:
|
|
221
|
-
self.labels = ArrayWithIds.from_values([])
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
if len(labels) != num_atoms:
|
|
225
|
-
raise ValueError(f"Number of labels ({len(labels)}) must match number of atoms ({num_atoms})")
|
|
226
|
-
|
|
227
|
-
self.labels = ArrayWithIds.from_values(values=list(labels))
|
|
228
|
-
|
|
229
|
-
def transform_by_matrix(self, matrix: Matrix3x3Schema) -> None:
|
|
230
|
-
original_is_in_crystal_units = self.is_in_crystal_units
|
|
231
|
-
self.to_crystal()
|
|
232
|
-
matrix_np = np.array(matrix)
|
|
233
|
-
new_coordinates = np.dot(self.coordinates.values, matrix_np)
|
|
234
|
-
self.coordinates.values = new_coordinates.tolist()
|
|
235
|
-
if not original_is_in_crystal_units:
|
|
236
|
-
self.to_cartesian()
|
|
237
|
-
|
|
238
|
-
# TODO: add/update test for this method
|
|
239
|
-
def resolve_colliding_coordinates(self, tolerance=DEFAULT_COORDINATE_PROXIMITY_TOLERANCE):
|
|
240
|
-
"""
|
|
241
|
-
Find all atoms that are within distance tolerance and only keep the last one, remove other sites.
|
|
242
|
-
|
|
243
|
-
Args:
|
|
244
|
-
tolerance (float): The distance tolerance in angstroms.
|
|
245
|
-
"""
|
|
246
|
-
original_is_in_crystal = self.is_in_crystal_units
|
|
247
|
-
self.to_cartesian()
|
|
248
|
-
ids_to_remove = set()
|
|
249
|
-
atom_ids = self.coordinates.ids
|
|
250
|
-
for index_1, index_2 in self.get_coordinates_colliding_pairs(tolerance):
|
|
251
|
-
ids_to_remove.add(atom_ids[index_1]) # Keep the last one in the pair
|
|
252
|
-
|
|
253
|
-
self.filter_atoms_by_ids(list(ids_to_remove), invert=True, reset_ids=True)
|
|
254
|
-
if original_is_in_crystal:
|
|
255
|
-
self.to_crystal()
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
from typing import Literal
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from mat3ra.code.array_with_ids import RoundedArrayWithIds
|
|
5
|
-
from mat3ra.code.value_with_id import RoundedValueWithId
|
|
6
|
-
from mat3ra.code.vector import RoundedVector3D as RoundedPoint3D
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class Coordinate(RoundedValueWithId):
|
|
10
|
-
value: RoundedPoint3D
|
|
11
|
-
|
|
12
|
-
def get_value_along_axis(self, axis: Literal["x", "y", "z"] = "z"):
|
|
13
|
-
return self.value.root[{"x": 0, "y": 1, "z": 2}[axis]]
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class Coordinates(RoundedArrayWithIds):
|
|
17
|
-
def get_values_along_axis(
|
|
18
|
-
self,
|
|
19
|
-
axis: Literal["x", "y", "z"] = "z",
|
|
20
|
-
):
|
|
21
|
-
values_along_axis = [Coordinate(value=coord).get_value_along_axis(axis) for coord in self.values]
|
|
22
|
-
return values_along_axis
|
|
23
|
-
|
|
24
|
-
def get_max_value_along_axis(
|
|
25
|
-
self,
|
|
26
|
-
axis: Literal["x", "y", "z"] = "z",
|
|
27
|
-
):
|
|
28
|
-
return np.max(self.get_values_along_axis(axis))
|
|
29
|
-
|
|
30
|
-
def get_min_value_along_axis(
|
|
31
|
-
self,
|
|
32
|
-
axis: Literal["x", "y", "z"] = "z",
|
|
33
|
-
):
|
|
34
|
-
return np.min(self.get_values_along_axis(axis))
|
|
35
|
-
|
|
36
|
-
def get_extremum_value_along_axis(
|
|
37
|
-
self,
|
|
38
|
-
extremum: Literal["max", "min"] = "max",
|
|
39
|
-
axis: Literal["x", "y", "z"] = "z",
|
|
40
|
-
):
|
|
41
|
-
if extremum == "max":
|
|
42
|
-
return self.get_max_value_along_axis(axis)
|
|
43
|
-
return self.get_min_value_along_axis(axis)
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from mat3ra.code.vector import RoundedVector3D
|
|
5
|
-
from mat3ra.esse.models.properties_directory.structural.lattice import LatticeVectorsSchema as CellSchema
|
|
6
|
-
from mat3ra.utils.mixins import RoundNumericValuesMixin
|
|
7
|
-
from pydantic import Field
|
|
8
|
-
|
|
9
|
-
DEFAULT_CELL = np.eye(3).tolist()
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class Cell(RoundNumericValuesMixin, CellSchema):
|
|
13
|
-
__rounded_vector3d__ = RoundedVector3D
|
|
14
|
-
__default_vectors__ = DEFAULT_CELL
|
|
15
|
-
|
|
16
|
-
a: RoundedVector3D = Field(default_factory=lambda: Cell.__rounded_vector3d__(DEFAULT_CELL[0]))
|
|
17
|
-
b: RoundedVector3D = Field(default_factory=lambda: Cell.__rounded_vector3d__(DEFAULT_CELL[1]))
|
|
18
|
-
c: RoundedVector3D = Field(default_factory=lambda: Cell.__rounded_vector3d__(DEFAULT_CELL[2]))
|
|
19
|
-
|
|
20
|
-
@classmethod
|
|
21
|
-
def from_vectors_array(cls, vectors: List[List[float]] = DEFAULT_CELL) -> "Cell":
|
|
22
|
-
return cls(
|
|
23
|
-
a=RoundedVector3D(vectors[0]),
|
|
24
|
-
b=RoundedVector3D(vectors[1]),
|
|
25
|
-
c=RoundedVector3D(vectors[2]),
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
def get_vector_arrays(self, skip_rounding=False) -> List[List[float]]:
|
|
29
|
-
if skip_rounding:
|
|
30
|
-
return [self.a.value, self.b.value, self.c.value]
|
|
31
|
-
return [self.a.value_rounded, self.b.value_rounded, self.c.value_rounded]
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def vector_arrays(self) -> List[List[float]]:
|
|
35
|
-
return self.get_vector_arrays(skip_rounding=True)
|
|
36
|
-
|
|
37
|
-
@property
|
|
38
|
-
def vector_arrays_rounded(self) -> List[List[float]]:
|
|
39
|
-
return self.get_vector_arrays(skip_rounding=False)
|
|
40
|
-
|
|
41
|
-
def convert_point_to_cartesian(self, point: List[float]) -> List[float]:
|
|
42
|
-
np_vector = np.array(self.vector_arrays)
|
|
43
|
-
return np.dot(point, np_vector).tolist()
|
|
44
|
-
|
|
45
|
-
def convert_point_to_crystal(self, point: List[float]) -> List[float]:
|
|
46
|
-
np_vector = np.array(self.vector_arrays)
|
|
47
|
-
return np.dot(point, np.linalg.inv(np_vector)).tolist()
|
|
48
|
-
|
|
49
|
-
@property
|
|
50
|
-
def volume(self) -> float:
|
|
51
|
-
return np.linalg.det(np.array(self.vector_arrays))
|
|
52
|
-
|
|
53
|
-
@property
|
|
54
|
-
def volume_rounded(self) -> float:
|
|
55
|
-
return self.round_array_or_number(self.volume)
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Routines for calculating primitive cell vectors from conventional cell Bravais parameters.
|
|
3
|
-
Python equivalent of src/js/cell/primitive_cell.ts.
|
|
4
|
-
|
|
5
|
-
Following Setyawan, W., & Curtarolo, S. (2010). doi:10.1016/j.commatsci.2010.05.010
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import math
|
|
9
|
-
from typing import List
|
|
10
|
-
|
|
11
|
-
from mat3ra.esse.models.properties_directory.structural.lattice import LatticeSchema
|
|
12
|
-
from mat3ra.made.cell import Cell
|
|
13
|
-
|
|
14
|
-
Matrix3x3 = List[List[float]]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _rhl(p: LatticeSchema) -> Matrix3x3:
|
|
18
|
-
a = p.a
|
|
19
|
-
alpha_rad = math.radians(p.alpha)
|
|
20
|
-
|
|
21
|
-
cos_alpha = math.cos(alpha_rad)
|
|
22
|
-
cos_half_alpha = math.cos(alpha_rad / 2.0)
|
|
23
|
-
sin_half_alpha = math.sin(alpha_rad / 2.0)
|
|
24
|
-
|
|
25
|
-
z_comp = a * math.sqrt(1.0 - (cos_alpha / cos_half_alpha) ** 2)
|
|
26
|
-
|
|
27
|
-
return [
|
|
28
|
-
[a * cos_half_alpha, -a * sin_half_alpha, 0.0],
|
|
29
|
-
[a * cos_half_alpha, a * sin_half_alpha, 0.0],
|
|
30
|
-
[(a * cos_alpha) / cos_half_alpha, 0.0, z_comp],
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def _tri(p: LatticeSchema) -> Matrix3x3:
|
|
35
|
-
"""
|
|
36
|
-
Algorithm from pymatgen (from_params).
|
|
37
|
-
Mirrors the TRI case in primitive_cell.ts exactly.
|
|
38
|
-
"""
|
|
39
|
-
alpha = math.radians(p.alpha)
|
|
40
|
-
beta = math.radians(p.beta)
|
|
41
|
-
gamma = math.radians(p.gamma)
|
|
42
|
-
|
|
43
|
-
cos_alpha = math.cos(alpha)
|
|
44
|
-
cos_beta = math.cos(beta)
|
|
45
|
-
cos_gamma = math.cos(gamma)
|
|
46
|
-
sin_alpha = math.sin(alpha)
|
|
47
|
-
sin_beta = math.sin(beta)
|
|
48
|
-
|
|
49
|
-
acos_arg = (cos_alpha * cos_beta - cos_gamma) / (sin_alpha * sin_beta)
|
|
50
|
-
# Clamp to [-1, 1] to guard against floating-point drift
|
|
51
|
-
acos_arg = max(-1.0, min(1.0, acos_arg))
|
|
52
|
-
|
|
53
|
-
gamma_star = math.acos(acos_arg)
|
|
54
|
-
cos_gamma_star = math.cos(gamma_star)
|
|
55
|
-
sin_gamma_star = math.sin(gamma_star)
|
|
56
|
-
|
|
57
|
-
a, b, c = p.a, p.b, p.c
|
|
58
|
-
return [
|
|
59
|
-
[a * sin_beta, 0.0, a * cos_beta],
|
|
60
|
-
[-b * sin_alpha * cos_gamma_star, b * sin_alpha * sin_gamma_star, b * cos_alpha],
|
|
61
|
-
[0.0, 0.0, c],
|
|
62
|
-
]
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
PRIMITIVE_CELLS = {
|
|
66
|
-
"CUB": lambda p: [
|
|
67
|
-
[p.a, 0, 0],
|
|
68
|
-
[0, p.a, 0],
|
|
69
|
-
[0, 0, p.a],
|
|
70
|
-
],
|
|
71
|
-
"FCC": lambda p: [
|
|
72
|
-
[0.0, p.a / 2, p.a / 2],
|
|
73
|
-
[p.a / 2, 0.0, p.a / 2],
|
|
74
|
-
[p.a / 2, p.a / 2, 0.0],
|
|
75
|
-
],
|
|
76
|
-
"BCC": lambda p: [
|
|
77
|
-
[-p.a / 2, p.a / 2, p.a / 2],
|
|
78
|
-
[p.a / 2, -p.a / 2, p.a / 2],
|
|
79
|
-
[p.a / 2, p.a / 2, -p.a / 2],
|
|
80
|
-
],
|
|
81
|
-
"TET": lambda p: [
|
|
82
|
-
[p.a, 0, 0],
|
|
83
|
-
[0, p.a, 0],
|
|
84
|
-
[0, 0, p.c],
|
|
85
|
-
],
|
|
86
|
-
"BCT": lambda p: [
|
|
87
|
-
[-p.a / 2, p.a / 2, p.c / 2],
|
|
88
|
-
[p.a / 2, -p.a / 2, p.c / 2],
|
|
89
|
-
[p.a / 2, p.a / 2, -p.c / 2],
|
|
90
|
-
],
|
|
91
|
-
"ORC": lambda p: [
|
|
92
|
-
[p.a, 0, 0],
|
|
93
|
-
[0, p.b, 0],
|
|
94
|
-
[0, 0, p.c],
|
|
95
|
-
],
|
|
96
|
-
"ORCF": lambda p: [
|
|
97
|
-
[0, p.b / 2, p.c / 2],
|
|
98
|
-
[p.a / 2, 0, p.c / 2],
|
|
99
|
-
[p.a / 2, p.b / 2, 0],
|
|
100
|
-
],
|
|
101
|
-
"ORCI": lambda p: [
|
|
102
|
-
[-p.a / 2, p.b / 2, p.c / 2],
|
|
103
|
-
[p.a / 2, -p.b / 2, p.c / 2],
|
|
104
|
-
[p.a / 2, p.b / 2, -p.c / 2],
|
|
105
|
-
],
|
|
106
|
-
"ORCC": lambda p: [
|
|
107
|
-
[p.a / 2, p.b / 2, 0],
|
|
108
|
-
[-p.a / 2, p.b / 2, 0],
|
|
109
|
-
[0, 0, p.c],
|
|
110
|
-
],
|
|
111
|
-
"HEX": lambda p: [
|
|
112
|
-
[p.a / 2, -(p.a * math.sqrt(3)) / 2, 0],
|
|
113
|
-
[p.a / 2, (p.a * math.sqrt(3)) / 2, 0],
|
|
114
|
-
[0, 0, p.c],
|
|
115
|
-
],
|
|
116
|
-
"RHL": _rhl,
|
|
117
|
-
"MCL": lambda p: [
|
|
118
|
-
[p.a, 0, 0],
|
|
119
|
-
[0, p.b, 0],
|
|
120
|
-
[0, p.c * math.cos(math.radians(p.alpha)), p.c * math.sin(math.radians(p.alpha))],
|
|
121
|
-
],
|
|
122
|
-
"MCLC": lambda p: [
|
|
123
|
-
[p.a / 2, p.b / 2, 0],
|
|
124
|
-
[-p.a / 2, p.b / 2, 0],
|
|
125
|
-
[0, p.c * math.cos(math.radians(p.alpha)), p.c * math.sin(math.radians(p.alpha))],
|
|
126
|
-
],
|
|
127
|
-
"TRI": _tri,
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
def get_primitive_lattice_vectors_from_config(lattice_config: LatticeSchema) -> Matrix3x3:
|
|
132
|
-
"""
|
|
133
|
-
Returns lattice vectors for a primitive cell for a given lattice config.
|
|
134
|
-
Python equivalent of getPrimitiveLatticeVectorsFromConfig() in primitive_cell.ts.
|
|
135
|
-
|
|
136
|
-
Args:
|
|
137
|
-
lattice_config: LatticeSchema instance with fields:
|
|
138
|
-
type, a, b, c, alpha, beta, gamma.
|
|
139
|
-
|
|
140
|
-
Returns:
|
|
141
|
-
3x3 list of lists (rows = vectors a, b, c) in the same units as the
|
|
142
|
-
input lattice parameters (typically Angstroms).
|
|
143
|
-
"""
|
|
144
|
-
lattice_type = lattice_config.type.value if lattice_config.type else "TRI"
|
|
145
|
-
generator = PRIMITIVE_CELLS.get(lattice_type)
|
|
146
|
-
if generator is None:
|
|
147
|
-
raise ValueError(
|
|
148
|
-
f"Unsupported lattice type '{lattice_type}'. " f"Must be one of: {list(PRIMITIVE_CELLS.keys())}"
|
|
149
|
-
)
|
|
150
|
-
return generator(lattice_config)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
def get_primitive_cell_from_config(lattice_config: LatticeSchema) -> Cell:
|
|
154
|
-
"""Returns a full Cell object instantiated with the primitive lattice vectors."""
|
|
155
|
-
vectors = get_primitive_lattice_vectors_from_config(lattice_config)
|
|
156
|
-
return Cell.from_vectors_array(vectors)
|