Opened 13 years ago

Closed 13 years ago

#4068 closed enhancement (fixed)

[with patch, positive review] determinants for matrices over multivariate polynomial rings slow

Reported by: malb Owned by: malb
Priority: major Milestone: sage-3.1.2
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

phil <fongpwfATgmail.com> wrote on [sage-devel]

I have a matrix that is composed of multivariant polynomial entries. I want to compute its determinant. The problem is that it is very slow or runs out of memory. For example, R.<x,y> = QQ[] C = random_matrix(R,10,10) Cdet = C.determinant() # this line takes a long time

If you have more variables, it will run out of memory instead (on a 32 bit installation).

Attachments (1)

matrix_mpoly_det.patch (14.2 KB) - added by malb 13 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 13 years ago by malb

Here's a workaround:

sage: R.<x,y> = QQ[]
sage: C = random_matrix(R,8,8)
sage: %time d = C.determinant()
CPU times: user 2.64 s, sys: 0.00 s, total: 2.65 s
Wall time: 2.67 s
sage: %time d2 = R(C._singular_().det())
CPU times: user 0.04 s, sys: 0.01 s, total: 0.05 s
Wall time: 0.15 s
sage: d2 == d
True

So we need to call Singular instead of using the native code.

Changed 13 years ago by malb

comment:2 Changed 13 years ago by malb

  • Summary changed from determinants for matrices over multivariate polynomial rings slow to [with patch, needs review] determinants for matrices over multivariate polynomial rings slow

comment:3 Changed 13 years ago by mhansen

  • Summary changed from [with patch, needs review] determinants for matrices over multivariate polynomial rings slow to [with patch, positive review] determinants for matrices over multivariate polynomial rings slow

Looks good to me.

comment:4 Changed 13 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed

Merged in Sage 3.1.2.rc0

Note: See TracTickets for help on using tickets.