Conversation
src/py/mat3ra/made/periodic_table.py
Outdated
| if output_path is not None: | ||
| with open(output_path, "w") as f: | ||
| json.dump(data, f, indent=2) | ||
| return data |
| from mat3ra.made.utils import AXIS_TO_INDEX_MAP | ||
|
|
||
|
|
||
| class ElementalFunctionHolder(InMemoryEntityPydantic): |
Member
There was a problem hiding this comment.
AtomicMassDependentFunctionHolder(FunctionHolder)
| return displacement.tolist() | ||
|
|
||
|
|
||
| def create_maxwell_displacement_function( |
| is_elemental = isinstance(perturbation_function, ElementalFunctionHolder) | ||
|
|
||
| for atom_index, coordinate in enumerate(original_coordinates): | ||
| if is_elemental: |
|
|
||
| for coordinate in original_coordinates: | ||
| # If func_holder returns a scalar, assume z-axis; otherwise vector | ||
| displacement = perturbation_function.apply_function(coordinate) |
Member
There was a problem hiding this comment.
Send the element symbol together with this
Member
There was a problem hiding this comment.
Send the whole material with it
Member
There was a problem hiding this comment.
additional_parameters = perturbation_function.calculate_additional_parameters(material)
in the loop:
displacement = perturbation_function.apply_function(coordinate=coordinate, additional_parameters=additional_parameters)
|
|
||
| super().__init__(function=function, variables=variables, **data) | ||
|
|
||
| def apply_function( |
|
|
||
| if self.is_mass_used: | ||
| element = material.basis.elements.values[atom_index] | ||
| mass = get_atomic_mass_from_element(element) |
Member
There was a problem hiding this comment.
We can get all masses as array in the parent class
| from .fixtures.bulk import BULK_Si_PRIMITIVE | ||
| from .fixtures.slab import SI_CONVENTIONAL_SLAB_001 | ||
|
|
||
| DISORDER_PARAMETER = 3000.0 # Temperature-like |
Member
There was a problem hiding this comment.
Let's remove the conversion constant and just put a comment that DISORDER_PARAMETER is close to temperature in eV
Member
There was a problem hiding this comment.
including the effective "spring" constant next to the current state
| disorder_parameter: float, | ||
| random_seed: Optional[int] = None, | ||
| is_mass_used: bool = True, | ||
| conversion_constant: float = 2e-3, |
Member
There was a problem hiding this comment.
This should not be necessary anymore
timurbazhirov
approved these changes
Dec 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.