Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update exact eigenspace routines #11595

Closed
rbeezer mannequin opened this issue Jul 14, 2011 · 20 comments
Closed

Update exact eigenspace routines #11595

rbeezer mannequin opened this issue Jul 14, 2011 · 20 comments

Comments

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Jul 14, 2011

This patch overhauls the generic code for eigenspaces of exact matrices.

  1. Removed plain eigenspaces(), which was deprecated 3 years ago. This required three replacements by eigenspaces_left() in code outside the sage/matrix directory.

  2. Right eigenspaces were not being cached. This is fixed by explicity performning the caching in the method before working on the transpose.

  3. Warning about inexact rings have been removed and replaced by exceptions. These exceptions, and the documentation, suggest the eigenmatrix routines for RDF/CDF matrices where accuracy and speed should be much better (or code for symbolic matrices).

  4. Documentation has been improved.

  5. Only about 4 very minor changes were required outside of the matrix code to make doctests pass.

  6. If basis matrices of eigenspaces over QQbar are hanging, then Viewing matrices of algebraic numbers can take a long time #11544 might need to be a dependency. Strictly speaking it is not required to build, but could be needed to pass doctests.

  7. One change in behavior - the new format command, and its default value of "all". This will cause eigenspaces of matrices over the rationals formed with algebraic numbers from QQbar. This is consistent with how the eigenvalues() method behaves for rational matrices. When it is not possible to compute eigenvalues this way, the failure is graceful and suggests the format='galois' option. This required just one change outside of the eigen-stuff code (eigenspaces of graphs). See discussion at:
    http://groups.google.com/group/sage-devel/browse_thread/thread/c67266a5581abff9/

Apply:

  1. attachment: trac_11595-exact-eigenspaces.patch
  2. attachment: trac_11595-exact-eigenspaces-format-v1.patch
  3. attachment: trac_11595-fix_noisy_zero_doctest_errors.reviewer.patch

Component: linear algebra

Author: Rob Beezer

Reviewer: Martin Raum, Leif Leonhardy

Merged: sage-4.7.2.alpha3

Issue created by migration from https://trac.sagemath.org/ticket/11595

@rbeezer rbeezer mannequin added this to the sage-4.7.2 milestone Jul 14, 2011
@rbeezer rbeezer mannequin assigned jasongrout and williamstein Jul 14, 2011
@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Jul 25, 2011

Attachment: trac_11595-exact-eigenspaces.patch.gz

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Jul 25, 2011

Author: Rob Beezer

@rbeezer

This comment has been minimized.

@rbeezer

This comment has been minimized.

@rbeezer rbeezer mannequin added the s: needs review label Aug 11, 2011
@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Aug 19, 2011

comment:4

Hi Robert,
I finally started looking at this patch, which clearly is the most controversial. I read the discussion on sage-devel and I am not sure at all whether there is a real consensus. I know consistency is a strong argument, but I just feel bad with having a standard argument that fails for all but one ring. That won't be beneficial to neither students nor "us", the researchers.
What about a standard format = None, that if the base ring is QQ leads to 'all' and, otherwise, to 'galois'. If, in the documentation, you put a warning that for rings different from QQ this might change in the future (in favour of 'all') than any programmer is informed.

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Aug 19, 2011

comment:5

Replying to @sagetrac-mraum:

Hi Robert,
I read the discussion on sage-devel

Thanks - that is a lot of work all by itself. ;-) I just re-read it myself. You are right that it is the most controversial. Interestingly, consistency was in some measure my goal.

What about a standard format = None, that if the base ring is QQ leads to 'all' and, otherwise, to 'galois'. If, in the documentation, you put a warning that for rings different from QQ this might change in the future (in favour of 'all') than any programmer is informed.

That sounds fine to me. I'll see how it goes coding it up (should be easy) and post once completed.

Rob

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Aug 20, 2011

Apply on top of main patch (this is a draft)

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Aug 20, 2011

comment:6

Attachment: trac_11595-exact-eigenspaces-format-draft.patch.gz

I had to straighten out the format before checking to see if the results are cached. So instead of doing it twice, I moved it to a helper method, and then moved error checking there.

Can you look and see if this is the behavior you are suggesting? If it looks OK, I'll add documentation, etc to get it up to standards. Right now it passses all tests on sage/matrix/matrix2.pyx, except for two obvious changes in the error message for the format keyword.

See sage-devel for a post about another problem with all this...

@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Aug 20, 2011

comment:7

That quiet exactly what I thought of. I still haven't tested this, but will do this tomorrow. I don't expect to find any problems. Please go ahead and doctest/document the additional changes.

@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Aug 21, 2011

comment:8

There is one issue that I found, checking the tests. The lines with

- ``format`` - default: 'all' 
  - 'all' - attempts to create every eigenspace.  This will 

lead to indention errors when building the documentation. Please consider this, when updating the documentation.

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Aug 21, 2011

comment:9

Replying to @sagetrac-mraum:

Please consider this, when updating the documentation.

Yes, certainly. Thanks.

Off to Bug Days 32 in just a bit, and will try to wrap this up soon. I have also looked at the "properties" patch and will try to get to that as well. And there is an RDF/CDF patch I know I need to follow up one (some comments about caching).

Am I missing anything else? I know you touched a lot of tickets while Trac was not sending out email.

Thanks,
Rob

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Aug 22, 2011

comment:10

Attachment: trac_11595-exact-eigenspaces-format-v1.patch.gz

"v1 format" patch is ready to go - documented and tested. Apply on top of the main patch.

@rbeezer

This comment has been minimized.

@rbeezer rbeezer mannequin added s: needs review and removed s: needs info labels Aug 22, 2011
@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Aug 22, 2011

Reviewer: Martin Raum

@sagetrac-mraum
Copy link
Mannequin

sagetrac-mraum mannequin commented Aug 22, 2011

comment:11

Great! Everything works fine.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 17, 2011

Merged: sage-4.7.2.alpha3

@nexttime nexttime mannequin removed the s: positive review label Sep 17, 2011
@nexttime nexttime mannequin closed this as completed Sep 17, 2011
@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 26, 2011

Reviewer patch. Fixes doctest errors due to noisy zeroes in eigenvalues. Apply on top of other patches.

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 26, 2011

comment:13

Attachment: trac_11595-fix_noisy_zero_doctest_errors.reviewer.patch.gz

Reviewer patch is up, fixing two doctest errors in sage/matrix/matrix2.pyx.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Sep 26, 2011

Changed reviewer from Martin Raum to Martin Raum, Leif Leonhardy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants