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

Endmembers wrapped in sublattices for fixed configuration datasets should behave as endmembers #260

Open
bocklund opened this issue Aug 21, 2024 · 0 comments

Comments

@bocklund
Copy link
Member

Currently to ESPEI's fixed configuration datasets, sublattices occupied only by an endmember are represented as not wrapped in a tuple. For example, consider a phase with sublattice model (A,B):(C,D), the following is the behavior:

  • ("A", "C") refers to the endmember A:B
  • (("A", "B"), "C") refers to A and B mixing on the first sublattice, with the only C occupying the second sublattice
  • (("A", "B"), ("C", "D")) refers to mixing in both sublattices
  • (notably) (("A", "B"), ("C",)) is not properly recognized as C being the only species to occupy the second sublattice, even though a user would expect it to be treated equivalently to the (("A", "B"), "C") case.

As a temporary solution, we could make espei.sublattice_tools.canonicalize unwrap the singly-occupied sublattices, e.g. (("A", "B"), ("C",)) -> (("A", "B"), "C"). That change should be localized and not have any ranging implications in the codebase.

Arguably, the correct approach would be that every sublattice configuration is typed as a Tuple[Tuple[str | Species]], rather than what we have now which is a Tuple[(str | Species) | Tuple[str | species]]. The latter could initially trigger a Warning as deprecated behavior, and later raise an Exception. We could implement that in espei.sublattice_tools.canonicalize to do the conversion and warn/raise about the correctness issue (and include something in the dataset checker to handle that). Making that change will require some changes throughout the code to make sure internally ESPEI represents endmembers as singly-occupied tuples in a sublattice configuration.

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

No branches or pull requests

1 participant