You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I don't know whether it's a bug or a feature, but standardize_cell erases off the atomic number information of the cell passed to it: thus suppose we have
Run standardize_cell(cell).atoms, and you will find it's an array consisting of numbers 1, 2, 3, etc. which distinguish different atoms but tell us nothing about what these atoms actually are.
Expected behavior
standardize_cell(cell).atoms == cell.atoms
Additional context
The cause of the behavior is that at the end of standardize_cell(cell::AbstractCell, symprec=1e-5; to_primitive=false, no_idealize=false), the atoms field of the return value is set to atoms[1:num_atom_std]. The definition of atoms is
And if we go to the function _expand_cell, we find the following lines:
atoms =collect(Cint, findfirst(isequal(u), unique(atoms)) for u in atoms)
# ...return lattice, positions, atoms, magmoms
So indeed _atoms (hence standardize_cell(cell).atoms) in standardize_cell contains the aforementioned indices 1, 2, 3, etc. which distinguish different atoms but tell us nothing about what these atoms actually are.
I don't know if there is any reason to not set standardize_cell(cell).atoms to cell.atoms aftrer everything is finished.
The text was updated successfully, but these errors were encountered:
Hi @jywu20, this is a known behavior (See this comment). The Python code did remove extra information contained in atoms, but I think it is better we recover this information. Please see if #152 solves your problem. I have added some tests so I suppose it should work.
Describe the bug
I don't know whether it's a bug or a feature, but
standardize_cell
erases off the atomic number information of the cell passed to it: thus suppose we haveand we get
To Reproduce
Steps to reproduce the behavior:
Cell
standardize_cell(cell).atoms
, and you will find it's an array consisting of numbers 1, 2, 3, etc. which distinguish different atoms but tell us nothing about what these atoms actually are.Expected behavior
Additional context
The cause of the behavior is that at the end of
standardize_cell(cell::AbstractCell, symprec=1e-5; to_primitive=false, no_idealize=false)
, theatoms
field of the return value is set toatoms[1:num_atom_std]
. The definition ofatoms
isAnd if we go to the function
_expand_cell
, we find the following lines:So indeed
_atoms
(hencestandardize_cell(cell).atoms
) instandardize_cell
contains the aforementioned indices 1, 2, 3, etc. which distinguish different atoms but tell us nothing about what these atoms actually are.I don't know if there is any reason to not set
standardize_cell(cell).atoms
tocell.atoms
aftrer everything is finished.The text was updated successfully, but these errors were encountered: