Re: [Spglib-users] primitive atom consistency
Brought to you by:
atztogo
From: Atsushi T. <atz...@gm...> - 2018-11-01 01:10:51
|
Hi, Can we move to github issue for discussion? Probably easier to discuss there. https://github.com/atztogo/spglib/issues/67 Togo On Wed, Oct 31, 2018 at 10:31 PM Noam Bernstein <noa...@nr...> wrote: > > On Oct 30, 2018, at 8:54 PM, Atsushi Togo <atz...@gm...> wrote: > > Currently yes, the code is written so. Do you recommend me to > guarantee this for the future? > > > Yes, I think that would be essentially required for get_symmetry_dataset()[“mapping_to_primitive”] to be meaningful. Let me explain my use case. Basically, I have some code that symmetrizes approximate configurations by doing get_symmetry_dataset, figuring out the transformation and rotation from the primitive cell vectors to the actual cell vectors, and then “rebuilds” a symmetrized version of the full atomic configuration by figuring out which ideal primitive cell supercell atom position corresponds to each real atom position, and moving the real atom to that position. This always works, and produces fully symmetrized cell vectors as well as positions. > > To do this, I need to figure out for each actual atom position what (rotated) primitive cell supercell atom it’s closest to. The easiest way I thought of was to find for each atom the primitive cell mapping (which is returned by get_symmetry_dataset), and calculate the difference between the real atom position and the corresponding primitive atom position (in the rotated primitive cell), transform the difference to scaled positions and round that difference (which should be nearly integers, since each atom should be close to an atom in the rotated primitive supercell up to some primitive cell vectors). This only works if the indices returned by mapping_to_primitive are consistent with the order of atoms returned by find_primitive. In fact, it’s basically meaningless to return mapping_to_primitive is this were not guaranteed, because you wouldn’t know which primitive atoms are mapped to. > > The reasons I asked this question is because I’m 95% sure that I ran into a situation where the two were not consistent with each other, and it led to a bug in my symmetrization code. Unfortunately I forgot to save the configuration, and now I can’t reproduce it, so if there really is a bug in the consistency between get_symmetry_dataset()[“mapping_to_primitive”] and find_primitive, I can’t actually demonstrate it. Instead, I switched my code to ignore the mapping, and send each atom to the position of the nearest atom (regardless of the mapping) in the rotated primitive supercell, which I think should always work. > > I couldn’t quite figure out how to do it with the quantities returned by get_symmetry_dataset() now, which are > > mapping_to_primitive > std_mapping_to_primitive > std_lattice, std_positions, std_types > > > As a more general but related question, is there a reason why get_symmetry_dataset() returns those quantities? I would have expected to get back a self-consistent set of related quantities, e.g. mapping_to_primitive and primitive_{lattice,positions,types}, or mapping_to_std and std_{lattice,positions,types}? > > thanks, > Noam > > _______________________________________________ > Spglib-users mailing list > Spg...@li... > https://lists.sourceforge.net/lists/listinfo/spglib-users -- Atsushi Togo Elements Strategy Initiative for Structural Materials, Kyoto university E-mail: atz...@gm... |