# Ticket #3329(closed defect: fixed)

Opened 5 years ago

## attempting to convert relative number field elements to Singular should fail quickly

Reported by: Owned by: cwitty malb major sage-4.3.1 interfaces N/A

### Description

Consider this example:

```  R.<a,b> = NumberField(x^2-3,'g').extension(x^2-7,'h')[]
h = R.base_ring().gen()
S.<y> = R.fraction_field()[]
xgcd(y^2, a*h*y+b)
```

This fails because it tries to use Singular to take the gcd of multivariate polynomials over a relative number field, and Singular does not support relative number fields. However, the error message is quite poor; it would be better if it failed with a better error message.

## Change History

### comment:1 Changed 5 years ago by cwitty

See also #3330, which is about the exact same test case, but requests a working implementation of GCD (rather than just a better error message).

### comment:2 Changed 5 years ago by malb

This fails before Singular:

```TypeError: unsupported operand parent(s) for '+': 'Univariate Polynomial Ring in y over Fraction Field of Multivariate Polynomial Ring in a, b over Number Field in h with defining polynomial x^2 - 7 over its base field' and 'Multivariate Polynomial Ring in a, b over Number Field in h with defining polynomial x^2 - 7 over its base field'
```

### comment:3 Changed 4 years ago by malb

This seems to work now because we avoid Singular

```sage: R.<a,b> = NumberField(x^2-3,'g').extension(x^2-7,'h')[]
sage: h = R.base_ring().gen()
sage: S.<y> = R.fraction_field()[]
sage: xgcd(y^2, a*h*y+b)
(49*a^4*b^2/(343*a^6), 1, ((-1)/(h*a))*y + 49*a^4*b/(343*a^6))
```

Carl, any thoughts on this?

### comment:4 Changed 4 years ago by malb

• Owner changed from was to malb
• Status changed from new to assigned

### comment:5 Changed 3 years ago by was

• Status changed from new to closed
• Resolution set to fixed
• Report Upstream set to N/A

Since Carl's not involved any more, and this now works fine (in sage-4.3.1.rc0 too), I'm closing this as fixed:

```bash\$ sage
----------------------------------------------------------------------
| Sage Version 4.3.1.rc0, Release Date: 2010-01-15                   |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
sage:   R.<a,b> = NumberField(x^2-3,'g').extension(x^2-7,'h')[]
sage:   h = R.base_ring().gen()
sage:   S.<y> = R.fraction_field()[]
sage:   xgcd(y^2, a*h*y+b)
(7*a^2*b^2/(7*a^2*b^2), 7*a^2/b^2, (((-7)*a^2)/(h*a*b^2))*y + 7*a^2*b/(7*a^2*b^2))
```
Note: See TracTickets for help on using tickets.