Opened 5 years ago

Closed 5 years ago

# degree is very slow on QQbar

Reported by: Owned by: zimmerma major sage-duplicate/invalid/wontfix basic arithmetic thome Jeroen Demeyer N/A

### Description

consider this with Sage 6.10:

```sage: b=(QQ['x'](x^17-x+1)).roots(QQbar)[0][0]
sage: a=(QQ['x'](x^3-x+1)).roots(QQbar)[0][0]
sage: a.degree()
3
sage: b.degree()
17
sage: a
-1.324717957244746?
sage: b
-1.042917732301787?
sage: a+b
-2.367635689546533?
sage: %time (a+b).degree()
CPU times: user 3.65 s, sys: 0 ns, total: 3.65 s
Wall time: 3.64 s
51
```

Why does it takes more than 3 seconds to compute `3*17`?

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

• Milestone changed from sage-7.1 to sage-duplicate/invalid/wontfix
• Reviewers set to Jeroen Demeyer
• Status changed from new to needs_review

Duplicate of #18333.

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

• Status changed from needs_review to positive_review

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

Yep. We should seriously get the resolvant code from #17886, #18356, #18242 into Sage!

### comment:4 Changed 5 years ago by vdelecroix

All right, x1000 improvement with #18356 (needs review)

```sage: b=(QQ['x'](x^17-x+1)).roots(QQbar)[0][0]
sage: pb = b.minpoly()
sage: a=(QQ['x'](x^3-x+1)).roots(QQbar)[0][0]
sage: pa = a.minpoly()
sage: %time p = pa.composed_op(pb, operator.add)
CPU times: user 4 ms, sys: 0 ns, total: 4 ms
Wall time: 3.04 ms
sage: p.degree()
51
```

### comment:5 Changed 5 years ago by zimmerma

All right, x1000 improvement with #18356 (needs review)

excellent! Paul

### comment:6 Changed 5 years ago by vbraun

• Resolution set to duplicate
• Status changed from positive_review to closed

### comment:7 Changed 5 years ago by zimmerma

I'm not sure we should close this ticket before #18356 gets a positive review and is closed too. Indeed, if for some reason #18356 never gets a positive review, this ticket will be lost.

Note: See TracTickets for help on using tickets.