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

Error reading .cif with partial occupation #158

Open
Lazersmoke opened this issue Sep 4, 2023 · 1 comment
Open

Error reading .cif with partial occupation #158

Lazersmoke opened this issue Sep 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Lazersmoke
Copy link
Contributor

In my material LaSrCrO4, there is a lattice site where there is 50% of the time a La and 50% of the time a Sr. The .cif I have (attached) lists these both at the same site, but 0.5 occupancy. Sunny complains:

Reference positions [0.0, 0.0, 0.359] and [0.0, 0.0, 0.359] are symmetry equivalent.

Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] crystal_from_symops(latvecs::StaticArraysCore.SMatrix{3, 3, Float64, 9}, positions::Vector{StaticArraysCore.SVector{3, Float64}}, types::Vector{String}, symops::Vector{Sunny.SymOp}, spacegroup::String; symprec::Float64)
   @ Sunny C:\Users\Sam\.julia\dev\Sunny\src\Symmetry\Crystal.jl:358
 [3] crystal_from_symops
   @ C:\Users\Sam\.julia\dev\Sunny\src\Symmetry\Crystal.jl:341 [inlined]
 [4] Crystal(filename::String; symprec::Float64)
   @ Sunny C:\Users\Sam\.julia\dev\Sunny\src\Symmetry\Parsing.jl:168
 [5] top-level scope
   @ In[54]:1

which is completely true, it should just make a Crystal with type "La/Sr" in this situation instead of complaining.

(Maybe related to #31 )

example_cif.zip

@Lazersmoke Lazersmoke added the enhancement New feature or request label Sep 4, 2023
@kbarros
Copy link
Member

kbarros commented Sep 4, 2023

I like the error in the general case, because it forces people to think about what they want. Maybe we should allow "opt in" merging of sites:

Crystal("example.cif"; merge_sites=true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants