Skip to content

[Feature] Added Pure Random Algo to OrderDisorderedStructureTransformation#4236

Merged
shyuep merged 3 commits intomaterialsproject:masterfrom
jmmshn:jmmshn/order
Dec 31, 2024
Merged

[Feature] Added Pure Random Algo to OrderDisorderedStructureTransformation#4236
shyuep merged 3 commits intomaterialsproject:masterfrom
jmmshn:jmmshn/order

Conversation

@jmmshn
Copy link
Copy Markdown
Contributor

@jmmshn jmmshn commented Dec 26, 2024

Added Pure Random Algo to OrderDisorderedStructureTransformation

The current implementation assume some oxidation and tries to evaluate and Ewald energy to get the ordered representation with the lowest energy.

matrix = EwaldSummation(struct).total_energy_matrix
ewald_m = EwaldMinimizer(matrix, manipulations, n_to_return, self.algo)

For large cells this has some disadvantages:

matrix = EwaldSummation(struct).total_energy_matrix  # <<- This can run out of memory for cells with ~2000 atoms
ewald_m = EwaldMinimizer(matrix, manipulations, n_to_return, self.algo) # <<- This takes hours for cells with ~200 atoms

We need some way to indiscriminately generate random structures without Ewald evaluation. Since for larger cells the value proposition of explicitly enumerating all the ordered representations and ranking them is dubious.

This PR adds a purely random sampling method that will sample all allowed structures with equal probability.

Major changes:

  • Added ALGO_RANDOM=-1 for purely random sampling
  • Allows user to define the occupation tolerance occ_tol for if a ordered structure is valid representation of a disordered structure

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

@shyuep shyuep merged commit 9d3d82c into materialsproject:master Dec 31, 2024
@shyuep
Copy link
Copy Markdown
Member

shyuep commented Dec 31, 2024

Thanks for the contribution.

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