Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-05-08 Thread John Cremona
On 8 May 2014 08:18, Nils Bruin wrote: > On Wednesday, April 30, 2014 1:07:55 AM UTC-7, John Cremona wrote: > >> NO! If f1 and f2 define the same extension field then will >> not be prime, e.g. f1=x^2-2 and f2=x^2-8 over QQ. >> > > you probably mean f1=x^2-2 and f2=y^2-8 in QQ[x,y] . =<1> is >

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-05-08 Thread Nils Bruin
On Wednesday, April 30, 2014 1:07:55 AM UTC-7, John Cremona wrote: > NO! If f1 and f2 define the same extension field then will > not be prime, e.g. f1=x^2-2 and f2=x^2-8 over QQ. > you probably mean f1=x^2-2 and f2=y^2-8 in QQ[x,y] . =<1> is also not prime but that doesn't have much to do

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-30 Thread John Cremona
On 30 April 2014 10:09, François Colas wrote: > What I am trying to do is to use the prime factorisation of m to compute in > another field than Q(zeta_m) (i.e. Q(zeta_m1, zeta_m2, ..., zeta_ml)) or > Q[x]/ (i.e. Q[x1, ..., xl] / ) because I need m > between 1000 and 1 and actually sage is not

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-30 Thread François Colas
What I am trying to do is to use the prime factorisation of m to compute in another field than Q(zeta_m) (i.e. Q(zeta_m1, zeta_m2, ..., zeta_ml)) or Q[x]/ (i.e. Q[x1, ..., xl] / ) because I need m between 1000 and 1 and actually sage is not able to do this. The idea is to have a faster arit

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-30 Thread John Cremona
On 29 April 2014 19:23, Martin Albrecht wrote: > On Monday 28 Apr 2014 14:57:59 François Colas wrote: >> Hi Martin, >> >> Here is two examples using multivariate quotients and extension fields >> which should be faster than computing CyclotomicField(m) or >> NumberField(cyclotomic(m), 'r') : >> >>

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-29 Thread Martin Albrecht
On Monday 28 Apr 2014 14:57:59 François Colas wrote: > Hi Martin, > > Here is two examples using multivariate quotients and extension fields > which should be faster than computing CyclotomicField(m) or > NumberField(cyclotomic(m), 'r') : > > m = 3*5*7 > pi = prime_factors(m) > Qi = PolynomialRin

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-28 Thread François Colas
Hi Martin, Here is two examples using multivariate quotients and extension fields which should be faster than computing CyclotomicField(m) or NumberField(cyclotomic(m), 'r') : m = 3*5*7 pi = prime_factors(m) Qi = PolynomialRing(QQ, len(pi), 'q') Idl = [cyclotomic_polynomial(p, 'q'+str(i)) for (

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-28 Thread Martin Albrecht
I just tried to run: sage: m = random_prime(10^5) sage: K. = CyclotomicField(m) and I ran out of RAM! Doing a smaller example: sage: m = random_prime(10^4) sage: %prun K. = CyclotomicField(m) puts sage.rings.number_field.number_field_morphisms.create_embedding_from_approx as the most expensi

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-15 Thread François Colas
Hi Vincent, In fact that's exactly what I want to do! But I am using morphisms: m = ZZ(int(random()*10^5+1)) R. = NumberField(cyclotomic_polynomial(m)) Idl = [] for (p, e) in factor(m): Idl.append(cyclotomic_polynomial(p)) K = NumberField(Idl, 'k') F = Hom(R, K) f = F([...]) Unfortuna

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-15 Thread John Cremona
I wa going to write: "Is there any reason not to do sage: m=random_prime(10^5) sage: K. = CyclotomicField(m) sage: R = K.ring_of_integers() " but I tried it and the last line is (much too) slow, which probably means that a generic algorithm is being used even though one knows that R = Z[r]. John

Re: [sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-15 Thread Vincent Delecroix
Hi François, Might be related to the ticket #16116 on trac (http://trac.sagemath.org/ticket/16116). Note that for performance, it is possible to use multivariate polynomials as described in the ticket. Best Vincent 2014-04-15 18:30 UTC+02:00, François Colas : > Hello group, > > I am playing with

[sage-devel] Quotient ring over cyclotomic polynomial very slow

2014-04-15 Thread François Colas
Hello group, I am playing with quotient ring of Z over cyclotomic polynomial but it is strangely slow: sage: m = random_prime(10^4); m 2437 sage: %time R. = ZZ['z'].quotient(cyclotomic_polynomial(m)) CPU times: user 2.50 s, sys: 0.00 s, total: 2.50 s Wall time: 2.50 s cyclotomic_polynomial(m) i