Opened 13 years ago

Closed 13 years ago

#1706 closed defect (fixed)

[with patch attached to #2050, postive review] Eigenspaces bug?

Reported by: rlm Owned by: was
Priority: major Milestone: sage-2.10.3
Component: linear algebra Keywords:
Cc: ncalexander@… Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Shouldn't the sum of the dimensions be 2?

sage: M = Matrix(CC, [[1,0],[0,1]])
sage: M

[1.00000000000000                0]
[               0 1.00000000000000]
sage: M.eigenspaces()

[
(1.00000000000000, [
(1.00000000000000, 0),
(0, 1.00000000000000)
]),
(1.00000000000000, [
(1.00000000000000, 0),
(0, 1.00000000000000)
])
]

Change History (8)

comment:1 Changed 13 years ago by craigcitro

The problem is that fcp (factored char poly) returns (x-1)*(x-1), as opposed to (x-1)2. (That is, it says that there are two distinct factors, each of which happens to be the same.) However, the eigenspaces algorithm implicitly assumes that the terms in self.fcp() are distinct.

comment:2 Changed 13 years ago by malb

  • Milestone set to sage-2.10.1

comment:3 Changed 13 years ago by jason

More data from Sage 2.9.3 which might shed some light on the problem:

sage: M=Matrix(ZZ,[[1,0],[0,1]])
sage: M.fcp()
(x - 1)^2
sage: M=Matrix(QQ,[[1,0],[0,1]])
sage: M.fcp()
(x - 1)^2
sage: M=Matrix(RR,[[1,0],[0,1]])
sage: M.fcp()
(1.00000000000000*x - 1.00000000000000) * (1.00000000000000*x - 1.00000000000000)
sage: M=Matrix(CC,[[1,0],[0,1]])
sage: M.fcp()
(1.00000000000000*x - 1.00000000000000) * (1.00000000000000*x - 1.00000000000000)

and

sage: R.<x>=RR[x]
sage: ((x-1)^2).factor()
(1.00000000000000*x - 1.00000000000000) * (1.00000000000000*x - 1.00000000000000)
sage: a=((x-1)^2).factor()
sage: a
(1.00000000000000*x - 1.00000000000000) * (1.00000000000000*x - 1.00000000000000)
sage: a[0]
(1.00000000000000*x - 1.00000000000000, 1)
sage: a[0]==a[1]
True
sage: var('x')
x
sage: Q.<x>=QQ[x]
sage: ((x-1)^2).factor()
(x - 1)^2

comment:4 Changed 13 years ago by was

See #2050 for a related ticket, which would likely remove the functionality that is broken above.

comment:5 Changed 13 years ago by ncalexan

  • Summary changed from Eigenspaces bug? to [with patch attached to #2050, needs review] Eigenspaces bug?

If #2050 is applied, this will be fixed (the functionality will by default raise NotImplemented?). Patch is attached to #2050.

comment:6 Changed 13 years ago by ncalexan

  • Cc ncalexander@… added

comment:7 Changed 13 years ago by mhansen

  • Summary changed from [with patch attached to #2050, needs review] Eigenspaces bug? to [with patch attached to #2050, postive review] Eigenspaces bug?

I can confirm that this is taken care of after #2050 is applied.

comment:8 Changed 13 years ago by mhansen

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

The patch for #2050 was merged in 2.10.3.rc0 .

Note: See TracTickets for help on using tickets.