[Wien] 'x symmetry' issue
Peter Blaha
peter.blaha at tuwien.ac.at
Mon Jul 6 12:23:15 CEST 2026
Dear Gerhard,
I agree, this is a never ending story ...
A few hints anyway:
in w2web: never put 0.333333... but always put 1/3, ... into the
mask. It should then convert properly.
Note, that wien2k uses a fixed format in case.struct and if a position
is given as 0.66666 it will appear as 0.6666000 (8 digits). Even if you
give 8 digits, the number is actually 0.666666660000000, and
wheninverted, it gives 0.33333334. It thus needs 9 digits as input to
make a proper rounding and put a "3" into the 8th digit in case.struct.
cif files: x cif2struct detects "1/3, ..." and asks the user if
0.3333 should be really 1/3. If you answer yes, it should do it properly.
The "real" problem is sgroup. This is a program written in C (thus I
cannot touch it) and while sgroup is in principle VERY good, it has
problems with rounding. So in this program numbers like 0.66666666 can
occur, or, when it converts 120 degrees in some supercell into an
orthorhombic structure, angles of 90.00001 , .... can appear.
If anybody is fluent in C and willing to tackle those rounding problems
(maybe in a manner similar as cif2struct), it would be very useful.
PS: Please note, I had to change the mailinglist to https, and now the
reply-to tag has still wien at unused as address. You have to put
wien at zeus.theochem.tuwien.ac.at "by hand".
Am 06.07.2026 um 10:52 schrieb Fecher, Gerhard:
> 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
>
> _______________________________________________
> Wien mailing list
> Wien at unused
> https://unused/mailman/listinfo/wien
> SEARCH the MAILING-LIST at: http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
--
-----------------------------------------------------------------------
Peter Blaha, Inst. f. Materials Chemistry, TU Vienna, A-1060 Vienna
Email: peter.blaha at tuwien.ac.at
WWW: http://www.imc.tuwien.ac.at WIEN2k: http://www.wien2k.at
-------------------------------------------------------------------------
More information about the Wien
mailing list