> < ^ Date: Fri, 06 Mar 1998 09:45:44 +0000 (GMT)
> < ^ From: Alexander Hulpke <hulpke@math.colostate.edu >
< ^ Subject: Re: Cyclotomics=Cyclotomics?

Dear GAP-Forum,

Mathias Kratzer asked:

> is anyone able to explain the following results / error message?
> gap> G := GeneralLinearGroup(3,2);; G.name := "GL(3,2)";;
> gap> chi1 := Irr(G)[2];;  chi1.range;
> Cyclotomics
> gap> chi3 := Copy( chi1 );;  chi3.range;
> Cyclotomics
> gap> chi1.range = chi3.range;
> Error, Record: element 'generators' must have an assigned value at
> What went wrong in Copy( chi1 )?

Copy runs recursively through an object and copies all entries, in this case
creating a copy of `Cyclotomics'.

gap> IsIdentical(Cyclotomics,Copy(Cyclotomics));

This copy looks the same, but the equality
test (that treats the infinite domains in a special way as you cannot list
all elements and not always even a finite generating set) gets completely

The remedy is not to use `Copy' but only `ShallowCopy' (which only copies
the first level and does not descend recursively through the full data
structure). This not only avoids this problem of doppelgaengers but may also
save you substantial memory if larger data structures are stored within an

In GAP4 this problem ceases to exist. Objects like the Cyclotomics are
immutable and even copying them will not duplicate the object:

( Gap4 example. `Copy' is called `StructuralCopy' here to avoid exactly this
type of confusion.
gap> IsIdenticalObj(Cyclotomics,StructuralCopy(Cyclotomics));

You can find a slightly more elaborate answer on this type of problem in
the Forum archive under:

Best regards,

Alexander Hulpke

> < [top]