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 7413 #154

Merged
merged 92 commits into from
Sep 11, 2024
Merged

feature/SOF 7413 #154

merged 92 commits into from
Sep 11, 2024

Conversation

VsevolodX
Copy link
Member

  • feat: first implementation of a nanrobibon
  • update: corrections
  • chore: run lint fix
  • update: wrap in a builder
  • update: make work + docstring
  • update: make work correctly
  • update: fix for even number fo vacuum{
  • update: armchair case
  • feat: add undercoordiantein analysis
  • feat: add passivation modfy:
  • update: add atom to material

@@ -265,13 +266,15 @@ def get_atom_indices_with_condition_on_coordinates(
def get_nearest_neighbors_atom_indices(
material: Material,
coordinate: Optional[List[float]] = None,
cutoff: float = 15.0,
Copy link
Member

Choose a reason for hiding this comment

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

Why 15?

try:
neighbors_indices = get_nearest_neighbors_atom_indices(material, coordinate, cutoff=3)
except:
print("error")
Copy link
Member

Choose a reason for hiding this comment

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

dafuq

@timurbazhirov timurbazhirov changed the base branch from main to feature/SOF-7412 August 20, 2024 01:16
undercoordinated_atom_indices = get_undercoordinated_atom_indices(passivated_slab)
for i in undercoordinated_atom_indices:
atom_coordinate = passivated_slab.basis.coordinates.values[i]
# TODO: change normal to be from the cloeses center of mass
Copy link
Member

Choose a reason for hiding this comment

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

typo

@@ -437,3 +439,15 @@ def rotate_material(material: Material, axis: List[int], angle: float) -> Materi
atoms.wrap()

return Material(from_ase(atoms))


def passivate_surface(slab: Material, passivant: str, bond_length: float = 3.0):
Copy link
Member

Choose a reason for hiding this comment

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

Needs to be close to slab

@VsevolodX VsevolodX marked this pull request as draft August 20, 2024 01:46
Base automatically changed from feature/SOF-7412 to main August 20, 2024 18:03
@@ -76,7 +76,17 @@ def to_crystal(self):
self.coordinates.map_array_in_place(self.cell.convert_point_to_crystal)
self.units = AtomicCoordinateUnits.crystal

def add_atom(self, element="Si", coordinate=[0.5, 0.5, 0.5]):
def add_atom(self, element="Si", coordinate=None, force=False):
Copy link
Member

Choose a reason for hiding this comment

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

The function signature here should be aware of whether the units of the coordinate are cartesian or crystal. We can add use_cartesian or something like that.

Before lines 90 and 91 we need to check and confirm that the current units are compatible - i.e. if units are cartesian, we should add cartesian_coordinate, otherwise - crystal

if site_index is None:
structure.append("X", coordinate, validate_proximity=False)
site_index = len(structure.sites) - 1

Copy link
Member

Choose a reason for hiding this comment

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

remove extra newline

return (z >= z_extremum - depth) if surface == SurfaceTypes.TOP else (z <= z_extremum + depth)


def shadowing_check(z: float, neighbors_indices: List[int], surface: SurfaceTypes, coordinates: np.ndarray) -> bool:
Copy link
Member

Choose a reason for hiding this comment

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

is_shadowed_by_neighbors

def condition(coordinate: List[float]):
return True

thickness_nudge_value = (added_layers_max_z - original_max_z) / thickness
Copy link
Member

Choose a reason for hiding this comment

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

what is this thickness_nudge_value?? Is there a better name? If not - explain in a comment

Copy link
Member

Choose a reason for hiding this comment

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

thickness_nudge_value_z + comment

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll switch to cartesians and do this the proper way. Wasn't clear at the time

@@ -0,0 +1,7 @@
# TODO: Get this from periodic table

BOND_LENGTHS_MAP = {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to be used anywhere

# Filter atoms in the added layers
island_material = filter_by_box(
material=atoms_within_island,
min_coordinate=[0, 0, original_max_z],
min_coordinate=[0, 0, original_max_z - thickness_nudge_value],
Copy link
Member Author

Choose a reason for hiding this comment

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

Add a comment to explain what is happening

coordination_numbers = set(
get_coordination_numbers(material=material, cutoff=self.build_parameters.shadowing_radius)
)
print("coordination numbers:", coordination_numbers)
Copy link
Member

Choose a reason for hiding this comment

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

  1. Let's name this function get_unique_coordination_numbers
  2. Update the description to state accordingly
  3. Remove the print statement

@VsevolodX VsevolodX merged commit b27922b into main Sep 11, 2024
9 checks passed
@VsevolodX VsevolodX deleted the feature/SOF-7413 branch September 11, 2024 00:49
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