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
Implement orthogonal complement in vector spaces #7522
Comments
Attachment: 7522-perp.patch.gz |
comment:1
This adds the basic orthogonal complement command. Specifying a larger space can go on another ticket, if someone wants it. |
comment:2
Replying to @jasongrout:
Thanks for doing this - I never got to it, since I haven't used this lately. Agreed on the enhancement. The documentation should make it clear what the ambient space is by default, perhaps by adding an example where things fail? Or at least commenting that the first example just shows itself as the ambient space. What would happen if one took a double subspace - what would it consider to be the ambient subspace? |
apply on top of previous patches |
comment:3
Attachment: 7522-review.patch.gz Replying to @kcrisman:
Review patch attached. Better now? |
comment:4
I got a chance to look at this over the weekend. Unsurprisingly, in general it's great. But... Since this is in the free module module (!), there should be a better error for
I also noticed the following behavior, which is probably desirable, but which should then definitely be explicitly mentioned in the documentation for this function, since it does return a different type of object for the perp object:
|
comment:5
By the way, why didn't
|
Reviewer: Karl-Dieter Crisman |
comment:7
I've uploaded a new version of the patch which moves the |
Changed author from Jason Grout to Jason Grout, Travis Scrimshaw |
comment:8
For patchbot: Apply: trac_7522-perp-ts.patch |
This comment has been minimized.
This comment has been minimized.
comment:9
Apparently |
comment:10
Also, would it be better to do the kernel first and then change the ring? Just wondering if there might be any difference. |
comment:11
I suggest you don't call it orthogonal complement. For instance, on vector spaces over finite fields, it's not (but a basis choice still induces an isomorphism to the dual). |
comment:12
Aargh! You had to go remind us of the whole mathematical correctness thing. You're right, of course. Not every submodule is projective.
Then what do you suggest? Since this is primarily useful for pedagogical purposes, perhaps we can just raise an error outside of QQ, RR, and friends. In particular, I think it's definitely appropriate to not allow this for anything but vector spaces. One interesting thing is that Sage is already doing something analogous to your suggestion about tensoring in getting the "basis matrix", which led to the workaround Travis made. Then again,
shouldn't even be legal to appear in Sage, in some sense... |
comment:13
Replying to @kcrisman:
Even there it's only wrt the standard inner product (i.e., if your basis is orthogonal) that this complement is orthogonal. Wouldn't just And indeed, you should probably only offer this for vector spaces, i.e., when the base ring is a field. |
comment:14
First, if the ring is not a PID, there are many attributes that are not there anymore (ex. As for them being inner product spaces, we have this in sage:
so I think sage always assumes it has an inner product (although not necessarily a nice inner product). For the
that was a doctest error coming from me thinking I know what the output should be >_<. Anyways, new version of the patch with the method now called For patchbot: Apply: trac_7522-perp-ts.patch |
comment:15
Question for Jason and Rob: for teaching linear algebra, would it be useful to have |
comment:16
Rather than testing if the base ring is a field, shouldn't you place the method on |
comment:17
Attachment: trac_7522-perp-ts.patch.gz Here I was looking for something called |
comment:18
I've just discussed this with Rob and Jason at Sage Days 48. The consensus is that the solution here is acceptable. Patchbot, apply: trac_7522-perp-ts.patch |
Changed reviewer from Karl-Dieter Crisman to Karl-Dieter Crisman, Nils Bruin |
Changed keywords from none to sd48 |
comment:19
I'm going to add an example pointing out that over a finite field this gives a complement which intersects the original subspace, which 3 people here say is fine (in the sense that it's not wrong, but we should just point out it's not what one might expect from the "usual" case). Nils, is it okay as long as we don't call it orthogonal? |
This comment has been minimized.
This comment has been minimized.
comment:20
Okay, Travis and/or Nils and/or anyone else, is this okay? The terminology is really the issue here, but hopefully this will satisfy everyone. Patchbot, apply trac_7522-perp-ts.patch and trac_7522-finite.patch |
comment:21
There's a small typo:
once that is fixed, I'm fine with this being set to positive reivew (but I'm probably one of the less opinionated people on this). Feel free to do this on my behalf because I'm going to sleep now to be ready for more Sage Days 49. Hope the 48 is going well. Travis |
comment:22
Attachment: trac_7522-finite.patch.gz Thanks, fixed. Patchbot, apply trac_7522-perp-ts.patch and trac_7522-finite.patch |
Changed reviewer from Karl-Dieter Crisman, Nils Bruin to Karl-Dieter Crisman, Nils Bruin, Jason Grout, Gregory Bard |
This comment has been minimized.
This comment has been minimized.
Merged: sage-5.11.beta3 |
It should be easy to get the orthogonal complement of a subspace W of a vector space V. From Jason Grout:
One would also want to add an option to specify the larger space in which you were dealing, with it defaulting to the ambient vector space. Probably 'perp()' should be an alias.
Apply: attachment: trac_7522-perp-ts.patch and attachment: trac_7522-finite.patch
CC: @jasongrout @rbeezer
Component: linear algebra
Keywords: sd48
Author: Jason Grout, Travis Scrimshaw
Reviewer: Karl-Dieter Crisman, Nils Bruin, Jason Grout, Gregory Bard
Merged: sage-5.11.beta3
Issue created by migration from https://trac.sagemath.org/ticket/7522
The text was updated successfully, but these errors were encountered: