Skip to content

Fix Wrong Oriented Cell When Calling SlabGenerator.get_slab#24

Open
ThomasWarford wants to merge 1 commit intomaterialsproject:mainfrom
ThomasWarford:fix-constrained-ouc-primitive-match
Open

Fix Wrong Oriented Cell When Calling SlabGenerator.get_slab#24
ThomasWarford wants to merge 1 commit intomaterialsproject:mainfrom
ThomasWarford:fix-constrained-ouc-primitive-match

Conversation

@ThomasWarford
Copy link
Copy Markdown
Contributor

Summary

Copy of materialsproject/pymatgen#4598

  • Only take primitive slab cell if corresponding oriented unit cell is found.
  • Add reduce=True keyword argument to Structure.get_primitive_cell. If false, Structure.get_reduced_structure() is not applied during recursive search for primitive cell.
  • When searching for primitive cell of a slab and its corresponding orientated unit cell (OUC), use reduce=False.
    • For MgO(111) example in #4597 this allows the oriented unit cell to find primitive cell candidates which meet the constraints, otherwise it can't.
    • Someone who's more knowledgable about Niggli reduction might be able to rationalise this.

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)

Closes #4597

@ThomasWarford ThomasWarford requested a review from shyuep as a code owner April 14, 2026 09:25
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.

1 participant