At present, the syntax of Singular allows only to define algebraic extensions of numbers as Q, and Z_p.

If you want to work over the field

Q(a,b) with say

a:=sqrt{2} and

b:=sqrt{3} then you have to calculate first

a primitive element

c(this exists in characteristic 0), such that

Q(c) = Q(a,b) and express

a and

b by

c.

In practice a generic lineare combination of the algebraic elements

a and

b is primitive

element

c. The library

primitive.lib http://www.singular.uni-kl.de/Manual/latest/sing_1320.htm#SEC1396 does this task.

(But there are two drawbacks: 1. IMO, the docmention is difficult to understand

2. the (random) delivered minimal polynomials have in general large coefficients which slows down a computation.

The returned minimal polynomial should be further simplified e.g. by using a the LLL-algorithm.)

To your example: The minimal polynomial for a+b is c4-10c2+1=0.

You will find it by squaring a+b, using a2=2, b2=3, and squaring c2-5=2ab again.

With Singular it can be done quickly as follows:

**Code:**

// find a primitive element

> ring rabc = 0,(a,b,c),dp;

> ideal I = a2-2,b2-3,c-a-b;

> eliminate (I,ab);

_[1]=c4-10c2+1

Check that this polynomial is irreducible over the rationals:

**Code:**

> ring rc =0,c,dp;

> factorize(c4-10c2+1);

[1]:

_[1]=1

_[2]=c4-10c2+1

[2]:

1,1

Now find how to express a and b by c (it also shows what -a and -b is; you only need one of them):

**Code:**

> ring rcab = (0,c),(a,b),dp; minpoly = c4-10c2+1;

> factorize (a2-2);

[1]:

_[1]=1

_[2]=a+(-1/2c3+9/2c)

_[3]=a+(1/2c3-9/2c)

[2]:

1,1,1

> factorize (b2-3);

[1]:

_[1]=1

_[2]=b+(1/2c3-11/2c)

_[3]=b+(-1/2c3+11/2c)

[2]:

1,1,1

Remark: The programm

pari/gp https://pari.math.u-bordeaux.fr/ tells us that also c^4 - 4*c^2 + 1 =0 defines the same number field.

As an alternative approach,

which also addresses to your second question for rings with parameters and algebraic extensions simultaneously,

you can mimic the (double) algebraic extension as follows.

Instead of the parameter

a and

minpoly = ... define the variables

a,b and take

the defining relations

a2-2,b2-3 into your ideal. Then compute a (reduced) Groebner basis.

In this way you can also use additional parameters in the coefficent field:

**Code:**

> ring rt = (0,t),(x,y,a,b),dp;

> // option(redSB);

> ideal I = ....;

> I = I,a2-2,b2-3;

> ideal I = std(I);

To

display the result with

a and

b as parameters switch to another ring:

**Code:**

> ring rtab = (0,a,b,t),(x,y),dp;

> ideal Istd = imap(rt,Istd);

> Istd;