Working over extensions of polynomial rings

72 views
Skip to first unread message

Andrew

unread,
Oct 9, 2014, 4:31:21 AM10/9/14
to sage-s...@googlegroups.com
Hello,

I want to do some calculations over an extension of the polynomial ring Z[q] which many quantum integers have square roots.

Initially I thought that I was going to be easy and that I could do the following:

sage: R.<q>=PolynomialRing(QQ)
sage
: s3=(1+q+q^2).sqrt(name='s3')
sage
: s4=(1+q+q^2+q^3).sqrt(name='s4')
sage
: s3*s4    # this blows up:(

Unfortunately, the last line blows up as s3 and s4 do not belong to a common ring as far as sage is concerned, which is fair enough.

So then I tried:

sage: R=PolynomialRing(ZZ,'q')
sage
: R2.<s2>=R.extension(x^2-1-q,'s2')
sage
: R3.<s3>=R2.extension(x^2-1-q-q^2,'s3')
sage
: R4.<s4>=R3.extension(x^2-1-q-q^2-q^3,'s4')
sage
: (s2*s3)^2
(q + 1)*s2 + q^2 + 3*q + 2

This seems to work but it is quite cumbersome especially as I want to be able to adjoin the square roots s2, s3, ..., s<n> for an integer n.

Two questions:
  1. Is there a better way to do this? Ultimately I want to work with modules defined over this (awful) ring. So, by "better" I do not necessarily mean less cumbersome: I need arithmetic to be efficient.
  2. Second, I really need to work of the fraction of this ring -- or rather, I need s2, s3, ... to be invertible. Unfortunately,
    sage: FractionField(R4)

    returns a not implemented error.I can probably get around this by adjoining inverses, but I am hoping that there is a better to do this. Any suggestions?

Cheers,

Andrew


Jeroen Demeyer

unread,
Oct 9, 2014, 5:33:20 AM10/9/14
to sage-s...@googlegroups.com
On 2014-10-09 10:31, Andrew wrote:
> sage:R.<q>=PolynomialRing(QQ)
> sage:s3=(1+q+q^2).sqrt(name='s3')
> sage:s4=(1+q+q^2+q^3).sqrt(name='s4')
> sage:s3*s4 # this blows up:(

If you don't mind approximations, you could consider using
PowerSeriesRing(QQ) instead. There, every polynomial with constant
coefficient 1 has a square root.

Andrew

unread,
Oct 10, 2014, 11:35:01 PM10/10/14
to sage-s...@googlegroups.com
Thanks for the suggestion Jeroen. I tried this but I also need the indeterminate q to be invertible. I have ended up using he following:

 
     R=LaurentPolynomialRing(IntegerRing(),'q')
     q
=R.gen()
     
self._quantum_integer={0:0, 1:1}      # dictionary of positive quantum integers
     
self._quantum_integer_root={0:0, 1:1} # dictionary of square roots of positive quantum integers
     qint
=1
     x
=polygen(R)
     
for k in range(1,shape.size()):
         qint
+=q**(2*k)                      # now equal to 1+q^2+...+q^2k = [k+1]_{q^2}
         R
=R.extension(x**2-qint,'r%d'%(k+1))
         
self._quantum_integer[k+1]=qint     # we remember these because we nee them later
         
self._quantum_integer_root[k+1]=R.gen()
     R
=R.extension(x**2+1,'I')
     I
=R.gen();
     F
=FractionField_generic(R) # the FractionField is not implemented so we hack
     R
.__fraction_field=F

which seems to work and not be too slow. The hack at the bottom to create the field of fractions is necessary because extensions don't know that they are PIDs (of course, they aren't always, although they are in this case).

Andrew
Reply all
Reply to author
Forward
0 new messages