Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/SOF 7282 1 #163

Merged
merged 25 commits into from
Sep 25, 2024
Merged

feature/SOF 7282 1 #163

merged 25 commits into from
Sep 25, 2024

Conversation

VsevolodX
Copy link
Member

@VsevolodX VsevolodX commented Sep 19, 2024

  • feat: add commensurate supercells generation builder

@VsevolodX VsevolodX marked this pull request as ready for review September 21, 2024 03:22
return commensurate_lattice_pairs

@staticmethod
def __create_matrices(max_search: int):
Copy link
Member

@timurbazhirov timurbazhirov Sep 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create_2d_supercell_matrices + docstring

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be util

return matrices

@staticmethod
def __solve_angle_from_rotation_matrix(matrix, zero_tolerance=1e-6, round_digits=3):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be util

intermediate_product = matrix2_inverse @ matrix1
product = matrix_a1a2_inverse @ intermediate_product @ matrix_a1a2
try:
angle = self.__solve_angle_from_rotation_matrix(product)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can return None and get back from loop here

@@ -1,6 +1,8 @@
from typing import Any, List, Optional

import numpy as np
from mat3ra.made.tools.build.supercell import create_supercell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be imported from ...



class CommensurateLatticeInterfaceBuilderParameters(BaseModel):
max_search: int = 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_repetition_int

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Docstring

new_film, [0, 0, item.configuration.distance_z], use_cartesian_coordinates=True
)
try:
interface = merge_materials([new_substrate, new_film])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this - lattices have to be commensurate already?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The try case? lms

return matrices


def get_angle_from_rotation_matrix(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_angle_from_rotation_matrix_2d


Attributes:
configuration (TwistedInterfaceConfiguration): The configuration of the twisted interface.
matrix1 (np.ndarray): The supercell matrix for the first lattice.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2d supercell matrix

# substrate = configuration.substrate
max_search = self.build_parameters.max_repetition_int
a = film.lattice.vector_arrays[0][:2]
b = film.lattice.vector_arrays[1][:2]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a getter for this film.lattice.a, film.lattice.b, film.lattice.c

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We're adding this across all the made during cleanup task.

@timurbazhirov timurbazhirov merged commit 8eca34e into main Sep 25, 2024
9 checks passed
@timurbazhirov timurbazhirov deleted the feature/SOF-7282-1 branch September 25, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants