gap-packages / CaratInterface

Interface to CARAT, a crystallographic groups package
https://www.math.uni-bielefeld.de/~gaehler/gap/packages.php#CaratInterface
0 stars 1 forks source link

Error in `NormalizerInGLnZ` (algorithm does not converge?) #32

Open fingolfin opened 1 year ago

fingolfin commented 1 year ago

Consider this input:

mats := [
  [ [ 1921, -61504, 61504 ], [ -62, 1983, -1984 ], [ -122, 3904, -3905] ],
  [ [ 6143, 65536, 63488 ], [ -198, -2113, -2046 ], [ -390, -4160, -4031 ] ],
  [ [ -6947, 32736, -126047 ], [ 224, -1055, 4064 ], [ 441, -2079, 8002 ] ],
  [ [ 3039, 94240, 0 ], [ -98, -3039, 0 ], [ -193, -5983, -1 ] ],
];;
G:=Group(mats);
NormalizerInGLnZ(G);

It leads to this error (note that Size(G) = 24):

gap> mats := [
>   [ [ 1921, -61504, 61504 ], [ -62, 1983, -1984 ], [ -122, 3904, -3905] ],
>   [ [ 6143, 65536, 63488 ], [ -198, -2113, -2046 ], [ -390, -4160, -4031 ] ],
>   [ [ -6947, 32736, -126047 ], [ 224, -1055, 4064 ], [ 441, -2079, 8002 ] ],
>   [ [ 3039, 94240, 0 ], [ -98, -3039, 0 ], [ -193, -5983, -1 ] ],
> ];;
gap> G:=Group(mats);
<matrix group with 4 generators>
gap> NormalizerInGLnZ(G);
Error, Range: <last> must be a small integer (not the value 'fail') in
  for i in [ 1 .. n ] do
    str := CaratReadLine( input );
    Add( res, CaratReadMatrix( input, str ) );
od; at GAPROOT/pkg/CaratInterface/gap/carat.gi:224 called from
CaratReadMatrices( input, n ) at GAPROOT/pkg/CaratInterface/gap/carat.gi:287 called from
CaratReadBravaisRecord( input, str ) at GAPROOT/pkg/CaratInterface/gap/carat.gi:349 called from
CaratReadBravaisFile( resfile ) at GAPROOT/pkg/CaratInterface/gap/methods.gi:169 called from
CaratNormalizerInGLnZFunc( G, "" ) at GAPROOT/pkg/CaratInterface/gap/methods.gi:188 called from
<function "NormalizerInGLnZ with Carat function Normalizer">( <arguments> )
 called from read-eval loop at *stdin*:21
type 'quit;' to quit to outer loop
brk>

The cause for the error is that the external carat executable produces this unexpected output:

Verfahren hat nach 10000 Schritten nicht konvergiert !

I've not dug deeper.

Maybe @gaehler has some insights

fingolfin commented 1 year ago

I forgot to mention that this was reported by @hongyi-zhao

gaehler commented 1 year ago

I have committed a fix which better catches CARAT failures. It does not solve the problem, but just displays the CARAT error message (in German). There is not much more I can do about it. My recommendation would be to first find a better basis for the matrix group.

hongyi-zhao commented 1 year ago

My recommendation would be to first find a better basis for the matrix group.

Rename the space group in question as S2, and I tried with the following methods, but they all failed to do the trick:

  1. Transforming the group to the standard basis:

    gap> S2:=S1^C2;
    <matrix group with 7 generators>
    gap> GeneratorsOfGroup(S2);
    [ [ [ -1, -1922, 1922, 1055/16 ], [ 0, 61, -62, -33/16 ], [ 0, 60, -61, -17/8 ], [ 0, 0, 0, 1 ] ], 
    [ [ 127, 2048, 1984, 63/16 ], [ -4, -65, -62, -1/16 ], [ -4, -64, -63, -1/8 ], [ 0, 0, 0, 1 ] ], [ [ -1473/16, 1023, -126047/32, 0 ], [ 47/16, -32, 4001/32, 0 ], 
      [ 23/8, -33, 1985/16, 0 ], [ 0, 0, 0, 1 ] ], [ [ 94, 2945, 0, 2205/32 ], [ -3, -94, 0, -67/32 ], [ -3, -93, -1, -35/16 ], [ 0, 0, 0, 1 ] ], 
    [ [ 1, 0, 0, 252 ], [ 0, 1, 0, -8 ], [ 0, 0, 1, -8 ], [ 0, 0, 0, 1 ] ], [ [ 1, 0, 0, 128 ], [ 0, 1, 0, -4 ], [ 0, 0, 1, -4 ], [ 0, 0, 0, 1 ] ], 
    [ [ 1, 0, 0, -961/8 ], [ 0, 1, 0, 31/8 ], [ 0, 0, 1, 15/4 ], [ 0, 0, 0, 1 ] ] ]
    gap> StandardAffineCrystGroup(S2);
    <matrix group with 7 generators>
    gap> GeneratorsOfGroup(last);
    [ [ [ 1921, -61504, 61504, 1055/2 ], [ -62, 1983, -1984, -17 ], [ -122, 3904, -3905, -67/2 ], [ 0, 0, 0, 1 ] ], 
    [ [ 6143, 65536, 63488, 63/2 ], [ -198, -2113, -2046, -1 ], [ -390, -4160, -4031, -2 ], [ 0, 0, 0, 1 ] ], 
    [ [ -6947, 32736, -126047, 0 ], [ 224, -1055, 4064, 0 ], [ 441, -2079, 8002, 0 ], [ 0, 0, 0, 1 ] ], 
    [ [ 3039, 94240, 0, 2205/4 ], [ -98, -3039, 0, -71/4 ], [ -193, -5983, -1, -35 ], [ 0, 0, 0, 1 ] ], 
    [ [ 1, 0, 0, 2016 ], [ 0, 1, 0, -65 ], [ 0, 0, 1, -128 ], [ 0, 0, 0, 1 ] ], [ [ 1, 0, 0, 1024 ], [ 0, 1, 0, -33 ], [ 0, 0, 1, -65 ], [ 0, 0, 0, 1 ] ], 
    [ [ 1, 0, 0, -961 ], [ 0, 1, 0, 31 ], [ 0, 0, 1, 61 ], [ 0, 0, 0, 1 ] ] ]
  2. Alternatively, I also tried with the following method suggested by Bernd Souvignier:

One can compute an invariant bilinear form for the point group Then applying LLL reduction to this form, one again obtains a nice basis with a simple invariant form, showing in this case again that the lattice is the standard lattice (the invariant form with respect to the reduced basis is simply the identity matrix) written with respect to a somewhat complicated basis.

gap> P2:=PointGroup(S2);
<matrix group of size 24 with 4 generators>
gap> InvariantBilinearForm(P2);
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `InvariantBilinearForm' on 1 arguments at /home/werner/Public/repo/github.com/gap-system/gap.git/lib/methsel2.g:250 called from
<function "HANDLE_METHOD_NOT_FOUND">( <arguments> )
 called from read-eval loop at *stdin*:64
type 'quit;' to quit to outer loop
brk>