Opened 10 years ago

Closed 10 years ago

#10454 closed enhancement (fixed)

Add .is_singular method to matrices

Reported by: rbeezer Owned by: jason, was
Priority: minor Milestone: sage-4.6.2
Component: linear algebra Keywords:
Cc: Merged in: sage-4.6.2.alpha3
Authors: Rob Beezer Reviewers: Robert Bradshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jason)

Some approaches to teaching linear algebra define nonsingular matrices before broaching matrix invertibility. This will just add is_singular, with some changes to the associated documentation. thus making it a bit easier for Sage usage to follow one possible development of the topic.

Attachments (1)

trac_10454-matrix-is-singular.patch (2.8 KB) - added by rbeezer 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 follow-up: Changed 10 years ago by jason

Do you think it might be better to add the positive phrasing, m.is_singular(), rather than the negative nonsingular version?

comment:2 in reply to: ↑ 1 Changed 10 years ago by rbeezer

Replying to jason:

Do you think it might be better to add the positive phrasing, m.is_singular(), rather than the negative nonsingular version?

I had that thought. It would then no longer be an alias, which means (a) the documentation could be separate from invertibility, and (b) it would only need to be done once (is_invertible is defined twice). Does it work for users/students? I like to define nonsingular, but there is no real good reason for that, I guess. What's your preference?

comment:3 follow-up: Changed 10 years ago by jason

My advisor (who was a very good writer) taught me that when you are talking about matrices with determinant zero, and that is the focus, you should use "singular", and when you are talking about matrices with nonzero determinant, and that is the focus, you should use "invertible". This was to avoid confusing the reader with too many negatives. So I think having m.is_singular() and m.is_invertible() is a nice combination. It's easy to say "to check if a matrix is nonsingular, see if m.is_singular() is false".

Personally, I use "invertible" when talking about invertible matrices, so I guess it isn't that huge of a deal. I just thought things could be clearer by not putting a negatively-phrased is_* method in there.

comment:4 in reply to: ↑ 3 Changed 10 years ago by rbeezer

Replying to jason:

Sounds very good to me. I'll likely take this approach.

comment:5 Changed 10 years ago by jason

I guess the other philosophy at play here is that typically, is_* functions determine what an object *is*, not what it is not. There probably are exceptions, though...

Changed 10 years ago by rbeezer

comment:6 Changed 10 years ago by rbeezer

  • Status changed from new to needs_review

It is never what it seems. Over a commutative ring, the right thing to do is to define is_singular() to be the condition that the matrix has a zero determinant.

So this needs to be a new method, it is better stated as the positive version, and it is more than just a convenience.

comment:7 Changed 10 years ago by jason

  • Authors set to Rob Beezer
  • Description modified (diff)
  • Summary changed from Add to matrices .is_nonsingular() as an alias for .is_invertible() to Add .is_singular method to matrices

comment:8 Changed 10 years ago by robertwb

  • Status changed from needs_review to positive_review

Looks good to me.

comment:9 Changed 10 years ago by rbeezer

  • Reviewers set to Robert Bradshaw

comment:10 Changed 10 years ago by jdemeyer

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