@mat3ra/made 2024.11.19-0 → 2024.11.26-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/py/mat3ra/made/tools/build/interface/configuration.py +23 -0
- package/src/py/mat3ra/made/tools/build/passivation/__init__.py +1 -1
- package/src/py/mat3ra/made/tools/build/perturbation/configuration.py +9 -0
- package/src/py/mat3ra/made/tools/build/slab/__init__.py +18 -0
package/package.json
CHANGED
|
@@ -11,6 +11,18 @@ from ..slab.configuration import SlabConfiguration
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class InterfaceConfiguration(BaseModel, InMemoryEntity):
|
|
14
|
+
"""
|
|
15
|
+
Configuration for an interface between two slabs.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
film_configuration (SlabConfiguration): The configuration of the film slab.
|
|
19
|
+
substrate_configuration (SlabConfiguration): The configuration of the substrate slab.
|
|
20
|
+
film_termination (Termination): The termination of the film.
|
|
21
|
+
substrate_termination (Termination): The termination of the substrate.
|
|
22
|
+
distance_z (float): The distance between the film and the substrate in Angstroms.
|
|
23
|
+
vacuum (float): The vacuum thickness, in Angstroms.
|
|
24
|
+
"""
|
|
25
|
+
|
|
14
26
|
film_configuration: SlabConfiguration
|
|
15
27
|
substrate_configuration: SlabConfiguration
|
|
16
28
|
film_termination: Termination
|
|
@@ -36,6 +48,17 @@ class InterfaceConfiguration(BaseModel, InMemoryEntity):
|
|
|
36
48
|
|
|
37
49
|
|
|
38
50
|
class TwistedInterfaceConfiguration(BaseConfiguration):
|
|
51
|
+
"""
|
|
52
|
+
Configuration for creating a twisted interface between two slabs with specified twist angle.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
film (Material): The film material.
|
|
56
|
+
substrate (Material): The substrate material.
|
|
57
|
+
twist_angle (float): Twist angle in degrees.
|
|
58
|
+
distance_z (float): Vertical distance between layers in Angstroms.
|
|
59
|
+
vacuum (float): Vacuum thickness, in Angstroms.
|
|
60
|
+
"""
|
|
61
|
+
|
|
39
62
|
film: Material
|
|
40
63
|
substrate: Optional[Material] = None
|
|
41
64
|
twist_angle: float = 0.0
|
|
@@ -22,4 +22,4 @@ def get_unique_coordination_numbers(configuration: PassivationConfiguration) ->
|
|
|
22
22
|
"""
|
|
23
23
|
Get the unique coordination numbers for the provided configuration as a set type.
|
|
24
24
|
"""
|
|
25
|
-
return CoordinationBasedPassivationBuilder().get_unique_coordination_numbers(material=configuration.
|
|
25
|
+
return CoordinationBasedPassivationBuilder().get_unique_coordination_numbers(material=configuration.slab)
|
|
@@ -8,6 +8,15 @@ from ...utils.perturbation import SineWavePerturbationFunctionHolder, Perturbati
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class PerturbationConfiguration(BaseModel, InMemoryEntity):
|
|
11
|
+
"""
|
|
12
|
+
Configuration for a geometrical perturbation.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
material (Material): The Material object.
|
|
16
|
+
perturbation_function_holder (PerturbationFunctionHolder): The perturbation function holder.
|
|
17
|
+
use_cartesian_coordinates (bool): Whether to use cartesian coordinates
|
|
18
|
+
"""
|
|
19
|
+
|
|
11
20
|
material: Material
|
|
12
21
|
perturbation_function_holder: Union[
|
|
13
22
|
SineWavePerturbationFunctionHolder, PerturbationFunctionHolder
|
|
@@ -14,3 +14,21 @@ def create_slab(configuration: SlabConfiguration, termination: Optional[Terminat
|
|
|
14
14
|
builder = SlabBuilder()
|
|
15
15
|
termination = termination or builder.get_terminations(configuration)[0]
|
|
16
16
|
return builder.get_material(configuration, selector_parameters=SlabSelectorParameters(termination=termination))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def create_slab_if_not(material: Material, default_slab_configuration: SlabConfiguration) -> Material:
|
|
20
|
+
"""
|
|
21
|
+
Create a slab from the material if it is not a slab already. Otherwise, return the material.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
material (Material): The material to be checked.
|
|
25
|
+
default_slab_configuration (SlabConfiguration): The default configuration to be used for creating a new slab.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
Material: The slab.
|
|
29
|
+
"""
|
|
30
|
+
slab = material
|
|
31
|
+
if not slab.metadata or slab.metadata["build"]["configuration"]["type"] != SlabConfiguration.__name__:
|
|
32
|
+
print("The material is not a slab. Creating a new slab...")
|
|
33
|
+
slab = create_slab(default_slab_configuration)
|
|
34
|
+
return slab
|