Document not found! Please try again

Computing Radical Expressions for Roots of Unity - Computer ...

1 downloads 0 Views 821KB Size Report
Andreas Weber*. Department of .... computing radical expressions for the periods (f, gO), (f, gl),. (f, g2), ..., (f, ge~) if ..... I. Georg Olms Verlag,. Hildesheim, New ...
Computing Radical Expressions for Roots of Unity Andreas Weber* Department of Computer Science Cornell University Ithaca, NY 14853, U. S. A. E-mail: aweber~cs, c o r n e l l , edu

Abstract We present an improvement of an algorithm given by GAUSS to compute a radical expression for a p-th root of unity. The time complexity of the algorithm is O(p3m ~ logp), where m is the largest prime factor of p - 1. On current workstations the given implementation of the algorithm can be used to obtain radical expressions for p-th roots of unity for p up to about 100 in the general case and for p up to about 250 if p - 1 has only small prime factors. Moreover, the algorithm allows the use of coarse grained parallel computation in various ways that would allow one to compute bigger examples on a network of workstations.

1

Introduction

Two hundred years ago, on March 30, 1796, the 19 year old GAUSS reported into his mathematical diary [9] that he had succeeded in showing that the regular 17-gon can be constructed by ruler and compass. In the following year he generalized the methods leading to this result and could show that for every prime number p the p-th roots of unity can be expressed by radical expressions. 1 In his masterwork Disquisitiones Arithmeticae [8] GAUSS exposes his method to obtain radical expressions for roots of unity. Below we will describe an algorithm which is based on a modification of the method of GAUSS yielding a considerable speed-up of the computations. The time complexity of our improved algorithm to compute a radical expression for the p-th root of unity - - where p is a prime number - - is O(p 3 m 6 logp), where m is the largest prime factor of p - 1. 2 On current workstations the given implementation can be used to obtain radical expressions for p-th roots of unity for p up to about 100 in the general case and for p up to about 250 if p - 1 has only small prime factors. Moreover, the algorithm allows the use of coarse grained parallel computation in various ways that would allow one *Supported by the Deutsche Forschungsgemeinschaft. 1The entries of July 17, 1797 refer to this generalization. 2The time complexity of the algorithm of Gaufl is O((p 5 + p3m6) log p).

to compute bigger examples on a network of workstations. The outline of the paper is as follows. In Section 2 and 3 we will introduce the notation and the mathematical results which show the correctness of the algorithm. We will describe the algorithm in Section 4 and will analyze its computational complexity in Section 5. In Section 6 we will give some results we have obtained with an implementation of the algorithm in MAPLE [2]. In the concluding Section 7 we will give a comparison to related work. In an appendix we will provide details of the implementation of the algorithm in MAPLE.

2

With ~p we will denote a primitive p-th root of unity. Having a fixed p-th root of unity ¢ and some primitive root rood p--which will be denoted by g--GAUSS forms certain sums of powers of this root which he called periods of the root. We will use the notation of GAUSS for periods, cf. [8, § 343]. For two integers f and k such that f I P - 1 and k ¢ 0 the period (f, k) is defined by //-1

is, k) = m~0

where e = ( p - 1)/f. Sometimes we will call f the length of the period (f, k). Notice that a period (1, k) of length 1 is just the root of unity Ck.

Remark. In [17] and [5] the periods are denoted by yk leaving another parameter unspecified in the notation. Since the algorithm described below will work by recursion on ff we prefer the notation of GAuss. Since ¢ and g are fixed during the part of the algorithm which involves periods it does not hurt that these parameters are not made visible in the notation. Before we will give a description of the algorithm of GAUSS we will summarize some propositions which make the algorithm of GAUSS and our modification of it work.

3 SIGSAM BULLETIN volume 30, number 117, Sept. 1996. This article has passed the review process described in "Formally Review of Articles in the BULLETIN", SIGSAMBULLETINvolume 30, number 117, Sept. 1996, pp. 2-3.

Notation

Some Mathematics of the Algorithm

The following sketch of the algorithm gives the idea how GAUSS used periods to compute a radical expression for a root of unity. Our modification of the algorithm of GAUSS does not change this general outline but improves the "recursion step".

Andreas Weber

12

• A radical expression for the period (p - 1, 1) is known (it is in fact just the integer - 1 ) . If ( p - 1) = e f c then the main task (the "recursion step") of the algorithm of GAuss is to compute radical expressions for the periods (f, gO), (f, gl), (f, g2), . . . , (f,g~C) once radical expressions for the periods (fc, gO), (fc, gl), (f, g2), . . . , (fc, g~) are known. By recursively applying the step above to smaller divisors of p - 1, a radical expression for the period (1, gO) is computed. Since (1, gO) := ~p the algorithm has also computed a radical expression for this root of unity. All of the lemmas and theorems which are necessary for the correctness proof of the original method of GAUSS are given in [8, §§ 335-365]. The proofs given in [8] still fulfill modern requirements, so we do not think that it is necessary to refer to more modern sources. Only the proof of one proposition is omitted explicitly by GAUSS in [8]: it is the proposition t h a t the value of the resolvent built in [8, § 360] cannot be 0. A proof of this fact can be found e.g. in [6].

3.1

The Foundation of the Recursion

unity it is possible to express the period (f, gq) as a radical expression in these resolvents, c.f. [8, § 360]. In order to have a foundation for the next step of the recursion it does not suffice to compute a radical expression for just one period, but it is necessary to know expressions for all of them. GAUSS suggests in [8, § 360] to use the method of [8, § 346] to calculate all periods after one period has been found. However, the method described in [8, § 346] consists of solving a system of linear equations of size O(p) over the field of rational numbers and thus has a time complexity of O(pS). Thus this relatively harmless looking part in the description of his algorithm contributes to the major part of the computational complexity of the original algorithm of GAUSS! 3

3.3

The Basis of the Improved Algorithm

Our improvement of the algorithm of GAUSS is based on the observation that it is possible to obtain expressions for all periods once the computation for one has been performed. It is only necessary to store intermediate results and to "rearrange" them in the right way! The following proposition shows that this is possible.

The following lemma gives the foundation for the recursion.

Proposition 3. Let cef = p - l , let/3 be a c-th root of unity,

L e m m a 1. For all prime numbers p > 2 the period ( p - l , 1)

let g be a primitive root rood p, and let

is equal to - 1 .

t =

This lemma just states the fact that the sum over all p-th roots of unity (including 1) is equal to 0. One of the easy proofs of this lemma can be found in many textbooks on algebra and number theory, see e.g. [13, p. 71].

3.2

(f, gq) +f~(f,g~+q)-4-~2(f,g 2e÷q) + . . . + # c - l ( f , gq+(~(c-1))) .

Moreover, let _-- (f, gq+l) +13(f, ge+q+l)_.Ff~2(f, g2~+q+l) - 4 - ' "

+#~-i (f, 9q+1+(~(c-t)))

The "Recursion Step"

The following theorem is the cornerstone in the process of computing radical expressions for the periods (f, gO), (f, gl), (f, g2), . . . , (f, ge~) if radical expressions for the periods (fc, g°), (fc, gl), (fc, g2), . . . , (fc, g ~) are known.

.

If t ~ evaluates to ec--1

v[ee] + Z (v[k]. (f, k=0

T h e o r e m 2. Let eel = p - l , let/3 be a c-th root of unity, let

g be a primitive root modp, and let tq

=

f ~ 2 ( f , g 2 e ÷ q ) _{_ . . . + ~ c - - 1 ( f , g q W ( e ( c - 1 ) ) )

(f, gq)T~(f, ge+q)+ . If t~ evaluates to

ec--i

[ee] + Z (w[k].

ec--1

v[ee] +

and ~c evaluates to

(v[k]then v[ec]= w[ec] and

k=0

then

Vi, j E { 0 , . . . , e c - 1 } :

Vi, j e ( O , . . . , e c - 1 } : v [ i ] = v [ j ]

,

k=0

ifi~_j

(model.

Proof. See [8, § 360].

[]

v[i]----w[j]

i f i + l=--j

(mode) .

Proof. Let cr be the automorphism of OC3, ~) that leaves Q(~) fixed and t h a t is generated by the mapping C~¢ g

Remark. The expressions tq in theorem 2 are LAGRANGE resolvents. However, GAUSS does not use this name, although the work of LAGRANGE was earlier than the work of GAUSS.

Thus a((f, gq)) = (f, gq+l) and t = or(t). Now we have ec--I

By theorem 2 we have

w[ee] +

=

(v[kl. (f,g k 1) c--i v[ee] + Z :0 ( v [ . ]

=

v[ee] -4- ~,~=0(v[n]" (cf, g ))

t; = v[ee] +

k=0

ec--1 e--i

e--i

n

n÷em

)))

(1)

Thus the resolvent t~ can be expressed by known quantities. Building the resolvents for all the different c-th roots of

3 S i n c e t h e m a i n o b j e c t i v e of G a u f l in t h i s p a r t of his w o r k w a s to s h o w t h a t a n y c y c l o t o m i c e q u a t i o n c a n b e solved b y r a d i c a l s in p r i n c i p l e , it is r e m a r k a b l e e n o u g h t h a t his p r o o f of t h i s t h e o r e m is n o t o n l y c o n s t r u c t i v e in all p a r t s b u t also e x h i b i t s a q u i t e g o o d a l g o r i t h m !

Andreas Weber

= =

13

4

~(t) ~ ~ ( t ~)

In Fig. 1 an algorithm is given to compute GAussian periods for prime numbers p. This algorithm is the cornerstone to compute a radical expression for a p-th root of unity. It can be called with a prime number p as an argument, some arbitrary primitive root mod p, and the initial arguments 1 and the largest prime factor of p - 1. Then that algorithm returns expressions for the periods of the form (1, k), i.e. the p-th roots of unity. We just have to pick one element of the returned vector of periods. This element will be an expression that consists of rational operations, taking radicals, and symbols for the q-th roots of unity where q is a prime divisor of p - 1. Thus we can use recursion--we know that the 2.nd root of unity is - 1 - - t o find radical expressions for these q-th root of unity and then substitute these for the symbols, which finishes the task to obtain a radical expression for a p-th root of unity.

eC--1 =

(v[eel +

(vEkl k=0 ec-1

k=0 ec--i

:

(vleel)+ k=O ec--i

k=0

the last identity holding because v[i] • 4 ( # ) Thus v[ec] =

Vi, j •

(0 < i < ee) .

w[ec] and

{0,...,ec-1}:v[i]=w[j]

ifi+l~j

(modec) .

However, by theorem 2 we know that Vm, n •

{0,...,ec-1}:v[i]=w[j]

(mode) ,

We have implemented the algorithm in MAPLE. In Table 1 the running times of this implementation on a SUN SPARC 10 for several values of p is given.

ifi+l=-j

(mode) .

5

[] This proposition gives an easy way to calculate periods once the calculation for one period has been performed. Using this proposition our improvement of the algorithm of GAUSS can compute radical expressions for all periods in essentially the same computation time as it needed for the computation of one! 4 The periods that have to be computed consist of the c-th root of sums of the expressions that are built from ec--i

v[ec] +

Remark. Having an algorithm that computes radical expressions for p-th roots of unity for prime numbers p, it is easily possible to obtain an algorithm that computes a radical expression for a n-th root of unity for an arbitrary positive integer n. See e. g. [7, p. 144] for formulas that can be used for such an algorithm.

ifn~m

{0,...,ec-1}:v[n]=v[m]

which gives the desired result

Vi, j E

The Algorithm

(v[k] (S, k=0

In the algorithm of GAUSS it did not matter which particular root was chosen for the period by which the other periods were calculated, c. f. [8, § 360.II]. Since in our improved algorithm all of the periods are computed "equally" without one being marked as an "initial one", we have to take care that the proper roots are chosen. We will accomplish this task by a numeric computation of sufficient numeric significance. This computation does not affect the asymptotic time complexity of our algorithm, as will be shown in Section 5. 4As is d i s c u s s e d below we do n o t k n o w t h e p r o p e r o r d e r of t h e p e r i o d s if we c o m p u t e all of t h e m in t h i s f a s t way. U n f o r t u n a t e l y , we c a n n o t use a n a r b i t r a r y o r d e r of p e r i o d s as t h e basis for t h e n e x t s t e p of a r e c u r s i o n . At t h e m o m e n t we use a n u m e r i c c o m p u t a t i o n to a r r a n g e a p r o p e r o r d e r for s u b s e q u e n t s t e p s . As is s h o w n below t h e t i m e c o m p l e x i t y of t h i s n u m e r i c c o m p u t a t i o n c a n be n e g l e c t e d a s y m p t o t i c a l l y . Also for t h e e x a m p l e s we h a v e a c t u a l l y c o m p u t e d t h e t i m e s p e n t in t h e s e n u m e r i c c o m p u t a t i o n s w a s only s o m e p e r c e n t of t h e t o t a l c o m p u t a t i o n t i m e . N e v e r t h e l e s s , it s e e m s to be possible t h a t t h i s n u m e r i c c o m p u t a t i o n c a n be fully a v o i d e d by s o m e a d d i t i o n a l a n a l y s i s of t h e w a y t h e p e r i o d s a r e o b t a i n e d .

Computational Complexity

In the following estimates we will denote the largest prime factor of p - 1 by m.

5.1

Size of Resulting Terms

We will give a rough estimate of the size of the computed terms which we will need in our analysis of the time complexity below. In the algorithm EXPRESSIONS_FOR_PERIODS each component vi[k] will contain an expression of the form " a symbol /3c-1 Ac-1 + f~c-1A cl + ' " + / 3 A 1 + Ao, where fl m for a c-th root of unity and A t - l , . . . ,Ao are integers, c.f. [8, § 360.I]. However, only at most c + 1 of these expressions are not equal to zero, a number that we can estimate by O(m). The resolvents built in step (4) consist of a sum of a product of e of these with previously computed periods. Notice that the number of recursions of this function is O(logp). Building expressions for periods requires O(c) rational or radical operations on built expressions. Thus the size of a dag representation of an expression that is built by this function can be estimated by O((m3) l°gp) ----O(pm3).

5.2

Time Complexity

The algorithm to compute a radical expression for a p-th root of unity has to be called recursivety for any prime factor of p - 1, thus O(logp) times. Since substituting these radical expressions for the symbols for roots of unity in the result is O(s), where s is the size of the returned term from EXPRESSIONS_FOR_PERIODS--which was shown aboveto be O(pm3)--the asymptotic time complexity of the entire algorithm is not affected by it, because the complexity of the function computing expressions for periods is higher, as will be shown below.

Andreas Weber

14

.~ ~- EXPRESSIONS_FOR_PERIODS(p, g, .f, c). [Returns a vector with indices ranging from 0 to ( p - 1 ) / ( f c ) , whose components contain expressions for the periods (f, g0), . - . , ( f , g ( ( p - x ) / ( f c ) ) - l ) . The expressions contain a symbol for ¢c. p is prime, g is a primitive root m o d p and ff and c are divisors of p - 1 where c = 1 or c is a prime factor of p -- 1. ] (1) [Base of recursion.] if f c =: p - 1 t h e n r e t u r n [-1]. (2) [Recurse.] Let ( p - 1)/(ffc) = p l p 2 " " p ~ . Prime factors are ordered by size, multiplicities counted as separate prime factors. ..~ ~ EXPRESSIONS_FOR_PERIODS(p, g, fe, pl); (3) [Compute resolvents.] for i = 1 , . . . , c d o { set ti = (f, gO) + j3~(f, ge) + ~321(f, g2~) + . . . + j3i(¢-1)(f, g(e(e-1))) , where i.c--i--l¢.~/. e = (p - 1 ) / ( e / ) . Compute T1 = t~ and T / = ~1 Use a symbol for the c-th root of unity fl in the computations. Use the formula of GAUSSfor the product of periods and use a vector vl with indices ranging from 0 to ec to store the result, where viler] stores the "rational part" and vi[k] stores the part belonging to (f, gk). }.

(4) [Compute expression from known quantities.] ~ ~- F[0]. vii0] + F I l l - vile] + . . . +/~[e - 1]. vi[c(e - 1)]. Theorem ~ gives the justification for this setting.

(5) [Compute expressions for periods.] a[0] ~- ~

+ ~/~¢/~e-i

+... + ~.

This is one of periods we want to compute. Up to this point the algorithm is just the method described by GAUSS. In the following steps we use a faster method than the one suggested by GAuss to compute the remaining periods once one period has been computed. Compute a[1], a[2],.., a[ec - 1], similarly from the vectors vi using cyclic shifts on the indices. The precise calculation of these cyclic shifts follows from proposition 3.

(6) [Sort the expressions.] Compute values of the periods numerically up to a precision t h a t is necessary to distinguish two of t h e m and use the numeric results to sort a[0], a [ 1 ] , . . . , a[ec - 1] accordingly. r e t u r n the resorted sequence a[0], a [ 1 ] , . . . , a[ec - 1]. Figure 1: Algorithm computing expressions for GAussian periods

5.2.1

Complexity of the Main Sub-Algorithm

The asymptotic complexity of the algorithm given in Fig. 1 will coincide with the asymptotic complexity of the computation of the resolvents--step (3) of this algorithm. In the following estimate of the complexity of step (3) we will use the names of the parameters from the algorithm in Fig. 1. • There have to be 2c multiplications of expressions of the form ec--1

v[ec] + Z (,[k] • (S, k=0

with another one of a similar form, where each component v~[k] will contain an expression of the form described above. Moreover, at most m of the entries in v[k],k = 1 , . . . , e c - 1 are nonzero. • Using the formula of GAUSS to compute the product of two periods--see [8, § 345] or e.g. [17, § 54]5--such a multiplication requires O(e a) tests for zero End O ( m 3) additions and multiplications in the domain of the elements of v; this domain is Z[fl] in our case. 6 Considering operations on bits and the potential growth of the coefficients, the time complexity of such a multiplication is O(e3mS). Since e can be up to ( p - 1)/2, we will estimate the time complexity of all of these multiplications by 2 m O ( p 3 m 5) = O(p3m6). 5Notice that this formula of GauB is missing in the newer editions o~ [17]. 6 T h e a r i t h m e t i c in t h i s d o m a i n is t h e one of u n i v a r i a t e p o l y n o m i a l s over 2~ o b e y i n g t h e a d d i t i o n a l r e w r i t e rule ~c ~ 1.

The complexity of step (5) is O(p), because in this step only precomputed terms are composed into other ones. The goal of the numeric computation in step (6) is just to correlate the computed radical expressions to the appropriate periods. Thus the necessary final precision in the numerical computations is O(logp). Since the rounding error for rational operations and taking radicals is growing as a polynomial of the number of operations and these numbers of operations are bounded by a polynomial in p - - t h e size of the term when represented as a dag is growing p o l y n o m i a l l y - the necessary precision for the numeric computations is also bounded by a polynomial in log p. Since the time complexity of the arithmetic operations for numeric computations are polynomial in the used precision, the time complexity of one arithmetic operation is still a polynomial in log p. Because a polynomial in log p is growing sublinearly, we can estimate it by O(p). If s is the maximum size of the occurring terms, then the time complexity for evaluating one term is O(sp), i. e. O ( p 2 m 3) using the result from above. Since at most p terms have to be evaluated during one call to EXPRESSIONS_FOR_PERIODS the time complexity for the numeric calculations for one call of EXPRESSIONS_FOR_PERIODS is O(p2s) = O(p3m3). Since this is less than the complexity of the other steps in EXPRESSIONS_FOR_PERIODS t h a t precede the numeric calculations, i.e. step (6) in EXPRESSIONS_FOR_PERIODS, the asymptotic time complexity is not affected by this step. Remark. Instead of estimating the necessary precision for the numeric computation in order to achieve a certain final precision, it might be convenient to use range arithmetic

Andreas Weber

15

instead of floating-point arithmetic. 7 Although the asymptotic complexity does not change, the actual computation time might be affected greatly, because there is no need for worst case a priori estimates of the necessary internal precision if such a system is used.

The time complexity of one call to the algorithm without the recursion is thus O(p3m6). Since the number of recursive calls of this algorithm is O(logp), the complexity of the algorithm is O(p3m 6 logp). 6

Results

In Table 1 we have summarized some of the computations we have performed with our MAPLE implementation of the algorithm on a SUN SPARC 10 workstation. As had to be expected from the method of computation, the dag representations of the resulting terms are much smaller than their tree representations. Because of these differences of size we have chosen to use a dag like form, which uses auxiliary variables, to print a radical expression for a 29-th root of unity in Fig. 2. The real part of the radical expression for a 17-th root of unity we have obtained by our algorithm is

¼~17/4-~17/2+l/2../Y~+3/4.~/Y~-l/2.~lT/2-112.~/T7 -t1 ~41~/~-1/~,/~v+ ~ 18 , which coincides with the expression that GAUSS gives for it in [8, § 365], except that in the expression of GAUSS the operands of the radicals are made denominator free. The running times given in Table 1 suggest that the asymptotic time complexity we have given can be used to estimate the running time for further examples that are computationally feasible. Thus on current workstations it is possible to compute radical expressions for p up to about 100 in the general case and for p up to about 250 if p - 1 contains only small prime factors with the used implementation of the algorithm. 7

Conclusion and Comparison to Related Work

Our modification of the algorithm of GAUSS has improved its asymptotic complexity from

O((p 5 + p3m6) logp) to

O(p3 m 6 logp) , where m is the largest prime factor of p - 1, i. e. if p - 1 is msmooth, s Our implementation of the algorithm in MAPLE can handle cases ofp up to about 100 in the general case and up to about 250 if p - 1 contains only small prime factors. We do not know of an implementation of another algorithm for this task that is able to compute many of the examples we have given. The major part of the computation time in our algorithm is used for the computation of the resolvents. These can be computed independently ,for all factors in the factor chain of 7See e . g . [1] for t h e d e s c r i p t i o n of a r a n g e a r i t h m e t i c s y s t e m . 8 T h e n o t i o n of s m o o t h n e s s plays an i m p o r t a n t role in m a n y n u m b e r t h e o r e t i c a l g o r i t h m s . A s u m m a r y of t h e o r e m s r e l a t e d to t h e dist r i b u t i o n of s m o o t h n u m b e r s can be f o u n d e . g . in [4, 15], which also c o n t a i n f u r t h e r references.

p - 1. Also within the computation for each resolvent there are possibilities to compute many tasks in parallel. For instance in the multiplications of sums of periods it is possible to use parallel computations that are quite coarse grained. So this algorithm is suited for coarse grained parallel computations, which would allow to compute larger examples on a network of workstations. For the cases in which p - 1 has only 2 and 3 as prime factors there are more special and more efficient algorithms which also go back to [8]. An exposition of these methods can also be found e.g. in [5, 17]. However, these methods cannot be generalized to cases in which p - 1 contains other small prime factors like 5 or 7 in contrast to the algorithm of this paper, which works quite well for these cases, too. Generally speaking relatively little work seems to have been done to give algorithms to solve roots of unity by radical expressions. In [6] a special algorithm to obtain radical expressions for roots of unity is given. This algorithm is also based on ideas of GAUSS, and is similar in some aspects to the one we have described in this paper. The main difference is that it does not use a chain of factors of p - 1 but works in one single step on p - 1, which allows certain simplifications. Its time complexity is O(p 6) which makes is asymptotically worse for the class of primes p with the property that the prime factors of p - 1 can be bound by a function that is sublinear. We have also implemented this algorithm in MAPLE. We found that for the examples we could compute it was much slower than the algorithm of this paper and gave much larger radical expressions for the roots of unity, even in the cases of prime numbers p with the property that (p - 1)/2 is prime. We know of an algorithm developed by B. TRAGER, which also computes radical expressions for a p-th root of unity [18]. This algorithm is entirely different from the one of GAUSS. The major computational task of this algorithm consists of inverting a matrix of size O(p) over Q(¢q), where q is a divisor of p - 1 . Thus if p - 1 is smooth, the asymptotic complexity of the algorithm presented in this paper is much better. But in special cases such as the one that ( p - 1)/2 is prime the algorithm of TaAGER might be an interesting alternative. 9 Several methods treat the more general case of giving radical expressions for general polynomials with a solvable GALOIS group--or a cyclic GALOIS g r o u p - - a n d leave the case of roots of unity as a special one. In [7] a method to solve cyclic equations which is based on the method of LAGRANGE is described. However, the described method uses an auxiliary expression which is obtained by applying the full group of permutations S,~ to the set of roots r l , . • •, rn. Thus this method would give an algorithm with exponential complexity. LANDAU and MILLER [14] have shown that the general problem to solve solvable polynomial equations by radicals can be solved in polynomial time. The general algorithm described in [14] can be applied to this more specific problem. However, this algorithm has a time complexity of more than O(p12). An interesting algorithm--which is based on invariant theory--to obtain radical expressions for the roots of a solvable polynomial is sketchedin [16, Section 2.7]. However, we do not know of an implementation of this algorithm nor of a discussion of its computational complexity: For the general 9We do not know of an a c t u a l i m p l e m e n t a t i o n of this a l g o r i t h m a n d so we could not c o m p a r e its a c t u a l b e h a v i o r on s m a l l i n s t a n c e s of t h e " h a r d Cases" such as p ---- 11,23, 47, 59, 8 3 , . . .

Andreas Weber

16

We will use a s s i g n m e n t s to i n t e r m e d i a t e expressions to p r i n t t h e d a g r e p r e s e n t a t i o n of t h e radical e x p r e s s i o n for t h e 2 9 - t h r o o t of unity. T h e r o o t of t h e dag will b e t h e last auxiliary variable t h a t is p r i n t e d , i.e. t 8 2 ; t h i s f o r m a t c o r r e s p o n d s t o t h e o u t p u t of t h e o p t i m i z e c o m m a n d of MAPLE [3]. ~--3

tl = tll

,t2 :

~

-- 1 / 2 , t3 = t 2 2 , t 5

= tSt3, t12 = t8t2,

t14 ~ t132,t15 t20 =

= t142,t16

V--18529

t21 = t 1 5 2 , t 2 2

t20

(48

t13 =

~2

=

t3 +8

+ ~-~ + ~

= t14t13,t17

t l O -- 185293 t l l _

-- 6 t l , t 8

+ 3185.8

=

6--2t3--tl t5

,tl0

~ !

=

/3 + ~

+ ~,

-- 1 / 5 ,

=: t 1 5 t 1 4 , t 1 8 = t 1 5 t 1 3 ,

185239~..I.~. -- I I ~ 7 0 1

= t21 t l S , t25 = t 2 0 2 , t 2 6

10 _ 1 5 7 0 . 4

V9

+ 3 3 3 8 3 t 1 5 + 6 3 2 2 4 t 1 6 -~c 5 8 3 5 2 t 1 7 -- 2 6 0 9 6 t 1 8 -- 4 6 3 9 5 t 1 4 ,

=: t 2 5 2 ,

+ 052

_ 1454

10 _ 7832

1

_

_ 7.2.

3

- 4044 t

5)

20-1

20-1

t30 = t21 t14, t34 =

( - - 2 5 9 t l O -- 2 5 9 3 t l l

=

_ 178

t43 = 2 tlo+ ~

-- 2593t12

14 + 207t

_ .Z.~'~.3 -- 982 t 1 5 --{- 1628 t 1 6 -- 257 t 1 7 + 2 6 7 2 t 1 8 + ,t t 1 4 ) t 2 6 - 1 ,

8_ 2 8 5 . 7

178

15 + 2 5 9 , 1 0

+ 25v1

+ 25v12

_ 352

15),25-1

20-1,

+ 2 t12 +10/3+52 t15+4 t15+52 t17-25 tls-112 t L4 t25

t47 :

(~

-- 2 t l O - -

~-~U~. -- 2 t312 -- 4 t 1 5 -- 4 t 1 8 -- 4 t 1 7 -- 4 t 1 4 -- 4 t 1 6 )

~_~...j_ ~.~..~._~.~..j._ ~..~.~_.~.~_~A. ~ - ~ . J , . t63 =

_

"

7

"

J- ~-~.~.JL~.~-I- ~-~..~-~.]-~..L ~.~-~..~J,-~ "

~

"

7

-- ~

t20-1,

~

t65 t~O t l T , t ~ 5 = t 2 9 t 1 8 , t 6 7 = t ~ 4 t 1 5 , t 6 8 = t 3 9 t 1 6 , t 6 9 = t 4 3 t ] 4 , 70 = tS0 ~ ~ ..I. ~ .~. t ~ ..1- ~ .L t ~ ~ ~ j_ t ~ -- 2 t 2 O t S O t 2 1 -- 2 t 2 9 t 5 6 7

"

7

--

t82= x/-h~ + ~

7

--

7

"

7

-

-

7

~

7

7

t5O ~ t 2 1 2 , t 5 6 :

2t2Ot5Ot21t17

_

t477t13

t13

7

-- 2 t 3 4 t 5 0

7

tSO t 1 5 ,

2t29t50t21

__ 2 t 3 9 t 2 2

7

_

2t43t21

7

+ ~ + ~ + ~ + ~ + ~+~1/2+ ~ + ~ + ~ + ~

2 t34 t56 --

7

_

2t39t21 --

t15t15 7

2 t 4 ~ ~30 --

2t477t18 --

2t47t15

7

7

+ ~ + ~ + ~-1/28

F i g u r e 2: R a d i c a l expression for ~29

T a b l e 1: S u m m a r y of C o m p u t a t i o n s T h e following c o m p u t a t i o n s t i m e s refer to our MAPLE i m p l e m e n t a t i o n of t h e a l g o r i t h m o n a SUN SPARC 10 w o r k s t a t i o n . p

3 5 7 11 13 17 19 23 29 31 37 41 43 53 61 67 71 73 79 89 97 101 109 113 127 151 163 181

p - 1

2 22 2.3 2.5 22 • 3 24 2 • 32 2.11 22 • 7 2 - 3.5 22 - 32 23 • 5 2 •3 •7 2 ~ - 13 2~ • 3 • 5 2.3.11 2.5.7 23. 32 2.3.13 2.3.11 2~.3 22.52 22.3 ~ 24.7 2.32.7 2.3.5 z 2.34 2~.32.5

comp. time (in sec.) l then

ipfe:=ifactors(e) [2] [1] [i] ; ep:=iquo(e,

ipfe);

We assume that i/actors returns the list of prime factors and exponents sorted by the size of the prime factors. This assumption seems to hold in the current implementation. Unfortunately, I did not find it in the documentation, so hopefully this property of i/actors will not change in future releases.

Andreas Weber

18

We also store the result in powers_of_t_array.

known_periods := expressions_for_periods (p.g. ep. ipfe) ; else known_periods [0] :=-i ; fi;

f o r j l from 0 t o e*c do powers_of_t_array[jl, aux_vec [j 13

known_periods is an array with indices ranging from 0 to lpfe. Notice t h a t we have ensured t h a t c < Ipfe.

od; od;

An expression for t = ~1 carl be now o b t a i n e d in the following way. For i ~ j ( m o d e) the values of aux_vec[i] and aux_vec[j] are equal, cf. [8, § 360.I]. T h u s we have

if c> 2 then beta :=Root Of (Z'c- 1=0. Z) ; else

beta:=-l; fi; tvec:=array(O., e,c); aux_vec : = a r r a y ( O . . e , c ) ;

e--1

= o x_ ee[e, c] +

(cy, gk)) k=O

T h e b a s e s t o t h e s e v e c t o r s will b e t h e p e r i o d s ( f , gO), ( f , g l ) , • . . , ( f , g e C - 1 ) , a n d 1.

Since we know expressions for (ef, g k) for k = 0 , . . . , e by recursion we have an expression for t which is j u s t

t _ a u x _ n u m : = a r r a y ( 1 . , c, 0 . . e - l ) ; p o w e r s _ o f _ t _ a r r a y : = a r r a y ( 0 . . e . c , 1 . . c) ;

I

t=

for il from 0 to e*c do for jl from i to c-1 do powers_of_t_array[il, jl] :=0; od od;

= (f, go.~+~) + ( / , g l . ~ + q ) ~ + . . . + (/,g~(o-~)+~)~(~-~)~

e--1

a

_ ee[e el +

(cf,

Here we also have to found t h e recursion and distinguish between the cases e > 1 and e ---- 1. In the last step we only need one period and not all of them. So we can considerably speed up t h e program.

,

where q = second_index. We only need to perform most of the c o m p u t a t i o n s for q = 0 and can derive expressions for other periods quite easily from these ones, as will be shown below. Note t h a t we use different symbols t h a n GAUSS in [8, § 360]: we have e, c, f instead of a~ j3, 7 and 13 instead of R to denote a c-th root of unity. Moreover we will c o m p u t e all these expressions directly; in [8, § 360] GAUSS proposes to c o m p u t e only the one for q = 0 and to c o m p u t e all the other ec - 1 periods from this one by t h e m e t h o d described in [8, § 346]. However, this m e t h o d would require to solve a linear system of equations of size p over the rationals, which would require O(p 5) steps. T h u s this m e t h o d would lead to a higher c o m p u t a tional c o m p l e x i t y of t h e entire algorithm. This is our imp r o v e m e n t of t h e m e t h o d suggested by GAUSS.

if

e*c = p-1 t h e n second_index_bound

second_index_bound := e-I fi; for second_index from 0 to second_index_hound do t_aux_num[1, second_index] :=aux_vec [e,c] ; if e=l then t_aux_num[1, second_index] := eval (t_aux_num[1, second_index] -aux_vec [0] ) ; else

for i from 0 to e-I do t_aux_num[1, second_index] := eval(t_aux_num[l, second_index] + (aux_vec[modp(i - second_index, e)] * known_periods [i] )) ; od; fi;

Notice t h a t all of these expressions evaluate to a real n u m b e r except in the case t h a t ec = p - 1, cf. [8, § 360.IV]. T h e value of the resolvent is j u s t a c-th root.

e)) ;

t v e c [k] :=0;

:= O;

else

t_aux_num[l, second_index] :=eval(( t_aux_num[l, second_index] )" (i / c)) ;

else

od;

fi; aux_vec [k] : = t v e c [k] ; powers_of_t_array [k. 1] : =tvec [k] ; od;

Now we form

ti =

(f, gO.~÷q) ÷ (f, gl.e÷q)f~i.l÷q + . . . -'b(f, g(e(c-1))÷q)f~i.e-(c-1)

T h e rational parts are 0, i. e. the c o m p o n e n t s stored in colu m n ee t v e c [ e , c ] :=0; aux_vec [e*c] : =0 ; p o w e r s _ o f _ t _ a r r a y [e*c,

1] : =0 ;

First we have to c o m p u t e all powers t, t2, . . . , tc We will store the result vectors as row vectors in t h e array

powers_of _t_array. for i from 2 to c do aux_ve c := period_vector_mult (tvec. aux_vec, p. g. e*c. f) ;

1

k=0

We form the expression

for k from 0 to (e*c)-I do if irem(k, e) = 0 then tvec[k] :=(beta)'(iquo(k,

i] :=

,

where q : second_index. for iii from 2 to c-i do for k from 0 to (eat)-1 do if irem(k, e)=O then tvec[k]:=eval((beta)'(iii*iquo(k,

e)));

else

tvec [k] :=0; fi; aux_vec [k] :=powers_of_t_array [k. c-iii] ; od; aux_vec [e*c] :=powers_of_t_array [e,c. c - i i i ]

;

19

Andreas Weber

The rational parts are 0, i.e. the components stored in column ec tvec [ e , c ] :=0;

In order to compute t~ we use the fact that ti .t~- i can be

expressed in terms of known periods. We compute ti . t c-~ by multiplying tvec and aux_vec. aux_vec :=period_vector_mult ( tvec, aux_vec ,p,g, e,c, f) ;

Now we can obtain an expression also for this resolvent. As in the case for t c we can obtain an expression for t~ •tl; then an expression for tt is immediate. Here come our improvement to the algorithm of GAUSS. GAUSS suggests in [8, § 360] to use the method described in [8, § 346] to obtain expressions for all periods once an expression for one is obtained. However, in proposition 3 we have shown that by a cyclic permutation of previously computed values we can obtain expression for all periods much more simply.

nfpr := 4 + round(evalf(l.l*log(eval(p)))); necessary_final_precision := eval(nfpr);

The following precision is an estimate which precision is necessary in order to obtain results within that are accurate up to the desired final precisionl nprc := 3*nfpr'2; Digits:=nprc; for second_index from 0 to second_index_bound do for k from 0 to c-i do ri := modp(k*e + second_index, e.c); rpe := O; for il from I to c do rpe := eval(rpe + ( t_aux_num[il, second_index] * beta " (k * (c-il))) ) ; od; rpe := eval(rpe / c ) ;

N o w we check numericaJly which period we have obtained. aux :=eval (subs ( RootOf (Z'c-l=O, Z) = evalf(exp(2*Pi*I/(c))), rpe));

for second_index

from 0 to second_index_bound do t_aux num[iii, second_index]~=aux_vec [e*c] ; for i from 0 to e-I do t_aux_num[iii,second_index] :=eval ( t_aux_num[iii, second_index] + (aux_vec[modp(i- second_index, e)] * known_periods [i]) ) ; od; t_aux_num[iii,second_index] := eval ( (t aux_num[iii, second_index]) / (t_aux_num[l, second_index]'(c - iii)) ) ;

auxpr:='optimize/makeproc'( map(evalf,[optimize(aux)])); auxf := auxpr(); sinew:=second_index; per_found:=false; for kk from 0 to c-i while per_found=false do rin := modp(kk*e + sinew, e,c); if abs(period_num_value (p,g,f,g'rin,nprc)-auxf) < (10"(-nfpr)) then per_found := true;

od;

Here the iii loop ends. od;

We know that t _ a u x _ n u m [ c , q] = ( c f f , go+q). We are setting its value accordingly. for second_index

from 0 to second_index_bound

if e>l then t_aux_num [c, second index] :=eval ( known_periods [modp(0+second_index,

We also substitute the radical expression for ~, which can be obtained recursively, into the result. beta_radical := radical_prime_primroot(c, 'canonical'); rpe := eval( subs( Root0f(Z'c-l=0,Z)=beta_radical, rpe ) ) ; resulting_periods[rin] := eval(rpe); fi;

do

e )]) ;

else

t_aux_num[c, second_index] := eval (known_periods [0] ) ;

od;

In this case the value of known_periods [0] is just -I.

The case that n o m a t c h i n g period is f o u n d m u s t not happen. if per_found = false then ERROR('No matching period found numerically'); fi;

fi; od; It is easy to obtain values for the periods as soon as values for the resolvents are known. W e just have (f,

g~) =

I

(t~,(°_l> + t~(k,(~_,) + . . . + to~,(o-o>) ,

where0

Suggest Documents