Opened 11 years ago

Closed 11 years ago

# Fractional ideals intersection gives wrong answers in some cases.

Reported by: Owned by: mderickx was major sage-4.8 number theory PARI jdemeyer, leif, cremona sage-4.8.alpha1 Jeroen Demeyer John Cremona Fixed upstream, in a later stable release. #11130

Here is an explicit example:

```sage: var('x')
sage: K=QQ.extension(x,'x')
sage: (K*(1/4)).intersection(K*(1/4))
Fractional ideal (1/16)
```

Apply 10767_doctest.patch to the Sage library.

(The issue is fixed by #11130, upgrading PARI, but the patch adds a corresponding doctest, so this ticket is not a duplicate.)

### comment:1 Changed 11 years ago by johanbosman

This seems to be a bug in Pari:

```           GP/PARI CALCULATOR Version 2.4.3 (development svn-12623)
i386 running darwin (x86-64/GMP-4.2.1 kernel) 64-bit version
compiled: Mar  4 2011, gcc-4.2.1 (Apple Inc. build 5664)
(readline v6.1 enabled, extended help enabled)

Copyright (C) 2000-2008 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes
WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

parisize = 8000000, primelimit = 500509
? K = nfinit(x^2-2)
%1 = [x^2 - 2, [2, 0], 8, 1, [[1, -1.4142135623730950488016887242096980786; 1, 1.4142135623730950488016887242096980786], [1, -1.4142135623730950488016887242096980786; 1, 1.4142135623730950488016887242096980786], [1, -1; 1, 1], [2, 0; 0, 4], [4, 0; 0, 2], [2, 0; 0, 1], [2, [0, 2; 1, 0]]], [-1.4142135623730950488016887242096980786, 1.4142135623730950488016887242096980786], [1, x], [1, 0; 0, 1], [1, 0, 0, 2; 0, 1, 1, 0]]
? a = idealhnf(K, 1/2)
%2 =
[1/2 0]

[0 1/2]

? idealintersect(K, a, a)
%3 =
[1/4 0]

[0 1/4]
```

### comment:2 Changed 11 years ago by johanbosman

I've reported it to Pari.

### comment:3 Changed 11 years ago by mderickx

• Report Upstream changed from N/A to Reported upstream. Developers acknowledge bug.

### comment:4 Changed 11 years ago by johanbosman

• Report Upstream changed from Reported upstream. Developers acknowledge bug. to Fixed upstream, but not in a stable release.

It's been fixed in Pari, so updating Pari would most likely fix this bug.

### comment:5 Changed 11 years ago by jdemeyer

The new PARI spkg at #11130 should fix this.

### comment:6 Changed 11 years ago by jdemeyer

• Authors set to Jeroen Demeyer
• Dependencies set to #11230, #11234, #11130
• Status changed from new to needs_review

### comment:7 follow-up: ↓ 8 Changed 11 years ago by jdemeyer

• Dependencies changed from #11230, #11234, #11130 to #11130
• Report Upstream changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.

Could anybody please review the fact that #11130 fixes this problem and that the doctest is good?

### comment:8 in reply to: ↑ 7 Changed 11 years ago by cremona

Could anybody please review the fact that #11130 fixes this problem and that the doctest is good?

I will, since I have a working build of 4.7.2.alpha2 + #11130 to hand.

### comment:9 Changed 11 years ago by cremona

• Status changed from needs_review to positive_review

Patch applies fine to 4.7.2.alpha2 + patches from #11130, and successfully demonstrates that the bug no longer exists.

### comment:10 Changed 11 years ago by leif

• Description modified (diff)
• Reviewers set to John Cremona
• Summary changed from Fractional ideals intersection gives wrong awnsers in some cases. to Fractional ideals intersection gives wrong answers in some cases.

### comment:11 Changed 11 years ago by jdemeyer

• Milestone changed from sage-4.7.2 to sage-4.7.3

### comment:12 Changed 11 years ago by jdemeyer

• Milestone changed from sage-4.7.3 to sage-pending

### comment:13 Changed 11 years ago by jdemeyer

• Milestone changed from sage-pending to sage-4.7.3

### comment:14 Changed 11 years ago by jdemeyer

• Milestone sage-4.7.3 deleted

Milestone sage-4.7.3 deleted

### comment:15 Changed 11 years ago by jdemeyer

• Merged in set to sage-4.8.alpha1
• Milestone set to sage-4.8
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.