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 7412 #153

Merged
merged 31 commits into from
Aug 20, 2024
Merged

feature/SOF 7412 #153

merged 31 commits into from
Aug 20, 2024

Conversation

VsevolodX
Copy link
Member

  • feat: first implementation of a nanrobibon
  • update: corrections
  • chore: run lint fix

@VsevolodX VsevolodX marked this pull request as ready for review August 20, 2024 00:56
from .configuration import NanoribbonConfiguration


def build_nanoribbon(configuration: NanoribbonConfiguration) -> Material:
Copy link
Member

Choose a reason for hiding this comment

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

create_nanoribbon

length: int # in number of unit cells
vacuum_width: int = 3 # in number of unit cells
vacuum_length: int = 0 # in number of unit cells
edge_type: Literal["armchair", "zigzag"]
Copy link
Member

Choose a reason for hiding this comment

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

Has to be enums

nanoribbon = self._update_basis_and_lattice(
nanoribbon, length_lattice_vector, width_lattice_vector, height_lattice_vector
)
cenetered_nanoribbon = center_material(nanoribbon)
Copy link
Member

Choose a reason for hiding this comment

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

typo - centered

@@ -87,6 +87,31 @@ def translate_by_vector(
return Material(from_ase(atoms))


def center_material(material: Material, axes: Optional[List[str]] = None) -> Material:
Copy link
Member

Choose a reason for hiding this comment

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

translate_to_center

return nanoribbon

@staticmethod
def _update_basis_and_lattice(
Copy link
Member

Choose a reason for hiding this comment

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

Move to a generic place - Material, modify

Copy link
Member Author

Choose a reason for hiding this comment

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

Moving to Material

edge_type: Literal["armchair", "zigzag"]

class Config:
arbitrary_types_allowed = True
Copy link
Member

Choose a reason for hiding this comment

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

Move to BaseModel

Copy link
Member Author

Choose a reason for hiding this comment

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

BaseModel is Pydantic's class, we can't adjust it. We don't have BaseConfiguration either, because there's no common properties. We can create a BaseConfig that'll house this Pydantic setup.

vacuum_length = config.vacuum_length
edge_type = config.edge_type

if edge_type == "armchair":
Copy link
Member

Choose a reason for hiding this comment

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

What happens to Si slab in this case, when we don't use HEX?

@VsevolodX VsevolodX merged commit 3680b6e into main Aug 20, 2024
9 checks passed
@VsevolodX VsevolodX deleted the feature/SOF-7412 branch August 20, 2024 18:03
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