[Wien] 'x symmetry' issue

Fecher, Gerhard fecher at uni-mainz.de
Mon Jul 6 10:52:47 CEST 2026


Dear all,
To me it seems that this is the never ending story of the precision of rational numbers, as was already mentioned by Laurence.

There is just a discrepance between what Wien2k accepts as 2/3 and what the user thinks about what 2/3 is.

One can easily test the structur generator of W2Web to check what it accepts as 2/3, independent of a hexagonal structur.
Take a very simple tetragonal structure with space group P 4/mmm (#123) and one atom on the 2g site.
The 2g site has two equivalent positions (0,0,z) and (0,0,1-z) that are related by a mirror operation.
Now choose z=2/3 with different number of digits
0.66666666 will deliver 0.33333334 for the second, equivalent position
(any number with less digits will also deliver a 4 at the end, only 9 digits, that is:
0,666666666 will be interpreted as  0.666666667 and thus delivers 0.333333333
This is not just an effect of mirror operations, similar problems will appear also for other symmetry operations and for other space groups.

The same test can be performed with a hexagonal structure with spgr # 164 and the 2d position at (1/3, 2/3, 1/2), the result for the equivalent position will depend on how much digits you give.
I think, just the frequent appearance of thirds etc in the hexagonal structure is the reason why it is most often detected there and not in other cases.
(Note: In the simple tetragonal example it will not effect the symmetry analysis as z of the 2g site (here 1/3 or 2/3) is a free parameter and can take any reasonable value)

My conclusion would be that one needs 9 digits that a rational number is interpreted correctly (indeed not for 1/2, 1/4, or similar)
I wonder whether this is also true for irrational numbers.

I did not check how this propagates through other subroutines.
It might also appear that conversion between single and double precision numbers, may cause such problems with the precision.
In some other cases a conversion of real numbers to integers may not be rounded correctly (check for appearance of int and nint, e.g.:
compare 1.-int(1000.0*x)/1000.0 and 1.-nint(1000.0*x)/1000.0 where x=2.0/3.0).

If looking at various crystallographic programms you find that in some cases 0.6666 is already used for 2/3.
This causes troubles when reading positions from cif files produced by such programms (even if they give 0.6667).
From the experimental point of view I think it is not very probable that one can give positions with a better precision than 4 digits,
and one could savely convert an input of 0.333330 to 1/3 and 0.666660 or 0.666670 to 2/3 and similar for other cases of positions with rational or even irrational numbers, e..g. square roots, pi, etc.
Indeed, one could also give different precision for the search of symmetry elements and correct the numbers accordingly,
that is if one finds for example 2d and spgr 164 at a given precision epsilon then one sets the parameters automatically to 1/3 and 2/3.
Preferentially one would use different epsilon for lattice parameters translations and symmetry operations.

My personal solution is to check if such numbers appear and correct them in the files using search & replace with my favoured editor.
(Sometimes one needs to cross check also during initialisation before running lstart)

Ciao
Gerhard

DEEP THOUGHT in D. Adams; Hitchhikers Guide to the Galaxy:
"I think the problem, to be quite honest with you,
is that you have never actually known what the question is."

====================================
Dr. Gerhard H. Fecher
Institut of Physics
Johannes Gutenberg - University
55099 Mainz
________________________________________
Von: Wien <wien-bounces at zeus.theochem.tuwien.ac.at> im Auftrag von Stefaan Cottenier via Wien <wien at zeus.theochem.tuwien.ac.at>
Gesendet: Samstag, 30. Mai 2026 21:27
An: wien at zeus.theochem.tuwien.ac.at
Cc: Stefaan Cottenier
Betreff: Re: [Wien] 'x symmetry' issue

Hello Lyudmila,

>In addition to the discussion:
>I see also that some atoms have combination 66666 and 33334
>ATOM  14: X=0.19047619 Y=0.66666666 Z=0.10000000
 >      14: X=0.33333334 Y=0.52380953 Z=0.10000000
>Can this make a symmetry problem? maybe later

To stay on the safe side, when I cleaned the file I immediately made the ...667 consistent with ...333. Hence, I did not see whether or not the ...334 itself caused problems.

(btw, happy to see many familiar names from long ago on the mailing list - in a time when LLMs have taken over the job of answering most questions 🙂)

Stefaan



More information about the Wien mailing list