[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-math] Re: [Axiom-mail] Dynamically constructed return types
From: |
Marcus Better |
Subject: |
[Axiom-math] Re: [Axiom-mail] Dynamically constructed return types |
Date: |
Wed, 12 Jan 2005 16:13:40 +0100 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041124) |
Martin,
K:=SAE(FRAC INT, UP(x,FRAC INT), x^2+1::UP(x,FRAC INT))
should be the domain of complex integers,
Well, it should be Q(i), the field of rational numbers extended with i.
If I extend this domain again,
L:=SAE(K, UP(y, K), eq::UP(y, K))
what do I get?
A finite extension of Q(i). Now it happens that this extension will have
a primitive element, i.e., it is generated over Q by _one_ element a, so
it is equal to Q(a). But this is only because the ground field Q is of
characteristic zero, so the extension is automatically separable. In
general the extension is not necessarily generated by one element.
(In fact in my case the extension will certainly not be separable, as
you will see below.)
> Isn't this again a SAE of FRAC INT, only with a different
defining polynomial?
Yes, in the example above (but not in general).
If this is correct, Axiom doesn't know this, does it?
No, I don't think it does, and I don't think it should either.
I am trying to do the following, which is a common procedure when
dealing with Artin-Schreier extensions:
1. Input is a Laurent series f with coefficients in a field K of
characteristic p>0. If f satisfies one of the following conditions:
A. f has no terms with negative order, or
B. the leading term of f is of order -m where m>0, and m is not
divisible by p,
then stop and return f.
2. Otherwise we can find a p-th root of the leading coefficient of f in
a suitable extension field L of K, and hence a monomial w such that f +
w^p - w has a pole of smaller order than f.
3. Replace f by f+w^p-w and K by L, and go back to 1.
So I am trying to do a sequence of field extensions of K.
The result will be a Laurent series over one of these repeated
extensions, which I would like to return. But for now, I will be happy
if I can just get the code to run correctly and return some dummy value.
The problem seems to be in step 3, where I try to reassign the domain
variable K. I am not sure how to do this. It seems to confuse Axiom.
Here is a version which does compile, but with warnings. (Note that it
constructs a special series f, and the inner while loop is the algorithm
I described above):
---------------------------------------------------
)abbrev package LOCPARM LocalParam
LocalParam: Exports == Implementation where
INT ==> Integer
POSINT ==> PositiveInteger
NNI ==> NonNegativeInteger
UTS ==> UnivariateTaylorSeries
ULS ==> UnivariateLaurentSeries
SUP ==> SparseUnivariatePolynomial
ANY1 ==> AnyFunctions1
Exports ==> with
localParam: (POSINT, NNI) -> Any
Implementation ==> add
localParam(p, n) ==
K: CommutativeRing := Fraction Polynomial(PrimeField p)
zero := 0::K
var := new()$Symbol
LS := UnivariateLaurentSeries(K, var, zero)
x := monomial(1, -1)$LS
for i in 1..n repeat
a := new()$Symbol
b := new()$Symbol
rhs := a::K*x + b::K*x**3
f := coefficients taylorRep rhs
d := degree rhs
-- Reduce the pole to minimal possible order.
while negative? d and zero? (d rem p) repeat
eq := monomial(1,p)$SUP(K) - monomial(first f, 0)$SUP(K)
L: CommutativeRing := SimpleAlgebraicExtension(K, SUP K, eq)
f1 := map(#1::L, f)$StreamFunctions2(K,L)
-- subtract w^p-w from f1
f1.1 := 0
j := 1 + (d quo p) - d
f1.j := f1.j + (basis()$L).p
while (negative? d and zero? first f1) repeat
f1 := rest f1
d := d+1
f: Stream L := f1
K := L
return coerce(d)$ANY1(Integer)
--------------------------------------------------------------------
This gives the following compiler warning:
---------------------------------------------
Warnings:
[1] localParam: domain valued variable K has been reassigned
within its scope
---------------------------------------------
Despite the warning, the code does run when called as localParam(2,1),
but I cannot make it return something more useful, such as the series
(or stream) f. All my attemps just lead to more compiler warnings and
"system errors" when I run the code.
So my question is, is the code even legal in Axiom? Can I disregard the
compiler warning?
Marcus
[Axiom-math] Re: [Axiom-mail] Dynamically constructed return types, Marcus Better, 2005/01/10
- Message not available
- Message not available