[GAP Forum] substitution
Thomas Breuer
thomas.breuer at math.rwth-aachen.de
Wed Jan 18 18:26:01 GMT 2006
Dear GAP Forum,
Vahid Dabbaghian-Abdoly wrote
> I have a dense matrix of large dimensions with entries in the cyclotomic
> field CF(24) and in this matrix I would like to replace the primitive
> element E(24) by a prime number p.
> Do you know any method for this substitution?
If only one value shall be replaced by another value and all other values
in the matrix shall remain unchanged,
a short solution is the following.
mat:= ...; # the matrix, i.e., list of lists
old:= ...; # the value that shall be replaced
new:= ...; # the value that shall replace it
replace:= function( value )
if value = old then return new; fi; return value; end;
List( mat, row -> List( row, replace ) );
Another possible interpretation of replacement would be that
all entries of the given matrix over `CF(24)' shall be replaced
by the images under a linear map (or a ring homomorphism that is defined
by the image of `E(24)').
The replacement by a prime mentioned in the question is not of that kind,
but if one is interested in this then one can use the GAP function
`CoeffsCyc' to compute the (rational) coefficients of an element `x'
in `CF(n)' w.r.t. a basis of `CF(n)' that consists of certain powers of
`E(n)'.
`CoeffsCyc( x, n )' is a list of length `n' in which the entry at
position `i' is the coefficient of `E(n)^i'.
(See "CoeffsCyc" in the GAP Reference Manual,
more about the basis used can be found in the manual section
"Integral Bases of Abelian Number Fields".)
All the best,
Thomas
More information about the Forum
mailing list