-
Notifications
You must be signed in to change notification settings - Fork 2
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
Linear Algebra pedagogy #2
Comments
Hi @goretkin 👋 Just seeing this now. I saw your other issue JuliaLang/julia#1 and apologized there, but I'll apologize here too since I feel bad. The package was broken when you tried it. I have some decent tests, but was in a rush after the last round of changes and foolishly announced the package after some last-minute changes, but didn't run the tests. You are absolutely right to expect https://github.com/EricForgy/TensorAlgebra.jl/blob/master/test/runtests.jl AND... thank you for your feedback. I'll think about how to relate this to more familiar linear algebra. Until then, here are a few things to take note of... A matrix A vector A covector You can think of vectors as "column matrices" and you can think of covectors as "row matrices". Note, a row matrix can be defined as a row matrix and does not need to be the transpose of some column matrix. This is important. If we want to represent a vector If we want to represent a covector Similarly, if we want to represent With that in mind, it might help to write
and
I'm not super happy to write that down because the analogies only go so far, but maybe it helps. For instance
obviously, but in the docs, I mention that we identify the "double dual" of a vector with itself because we can define
and that constitutes a natural transformation. I hope this helps and sorry again the package was broken when you tried it. Thank you for submitting the issues to bring it to my attention 🙏😊 |
Hi @EricForgy , thanks for the reply! And thank you for this package!! I think it's great that the package has tests already. I hope it helps to say that there's no need to apologize! |
It's fair if your answer is [a more polite version of] "go read a book", but I wanted to write down some questions.
is this some statement about the absence of a structure that is present in linear algebra, in which every row matrix can be seen as the transpose of some column matrix (right?)?
I'm wondering if this concept could be somehow reified with an actual operation. Probably not https://en.wikipedia.org/wiki/Complex_number#Matrix_representation_of_complex_numbers possibly totally outside the scope of this package to define those methods, but what I dream of is that they could all be written as methods of some generic function. Perhaps what tensor algebra writes as
To check, it's obviously the case because the right-hand side is an "outer product" and evaluates to a matrix / something with tensor-rank 2, whereas the left-hand side corresponds to an inner product and evaluates to a scalar / something with tensor-rank 0. Can the blank in
Is it a vector that has a dual, or is it a vector space, or is it both?
And is it instructive or beneficial to not identify the double dual of a vector space with the vector space itself? I guess this might be hard to answer in the same way that it can be valid to see the integers as a subset of the rational numbers, but also valid to say that the element type of those sets are different, so it is either 1. a type error to even ask the question, 2. the answer is no. In Julia terms, it's a question of
perhaps a better question is, is there any benefit to making I recognize these are basic questions ("go read a book"), for which I'm sorry. I guess at least the issue title is honest about the agenda to leverage someone's (uh, me) linear algebra knowledge (including knowledge that is perhaps kind of sloppy because it equivocates things that should be seen as distinct) so that they can use this package to actually write clearer code. |
Hah! I wouldn't do that 😊 I'm happy to answer questions if I can.
Yes. In the standard library,
However, not all covectors arise from the transpose / adjoint of a vector. I discussed this a bit in the issue One important example that comes to mind is the differential
with
a row vector.
This is a great question and not really out of scope 😊 The first two examples, complex numbers and dual numbers, are fields and this package should be able to handle them directly and a matrix representation should not be required. Quarternions form a ring, so that gets a little out of scope for tensor algebra. A tensor with values in a ring is a "module". It could be nice to add modules / matrix-valued tensors to this package. We'll see 😊
Not off the rails 😊 The method I use for this is [v] = collect(v)
This hurts my eyes a little bit 😅 This is kind of what I was talking about above.
This is pretty unfortunate in my opinion.
Great question 😊 A vector space
Another great question. If you keep digging, you find that asking if two things are the "same" is kind of tricky. Is "same" the "same" as "equivalent" (down the rabbit hole we go!). Have a look here and the surrounding material for some fun reading 😊 https://en.wikipedia.org/wiki/Natural_transformation#Double_dual_of_a_vector_space Since I hope this helps 😊 |
It might be outside the scope of this package, but if there were examples explained in terms of more familiar linear algebra, that would be so, so lovely.
I tried to give examples of what I think are analogies to linear algebra in the
@show _ == _
statements below.And then the manual could even show where the analogy cannot go any further, since there are only two "sides" you can multiply a "2D matrix" by.
The text was updated successfully, but these errors were encountered: