Douglas Blumeyer's RTT How-To: Difference between revisions
Cmloegcmluin (talk | contribs) →vectors and covectors: go straight into Wolfram Language; forget about Alpha |
Cmloegcmluin (talk | contribs) →null-space: Wolfram Cloud, no Alpha |
||
Line 628: | Line 628: | ||
So why the anti-transpose sandwich? What we (and everyone) want in a canonical mapping is to have a triangle of zeros in the bottom left corner. What we want in a comma basis is also to have a triangle of zeros in the bottom left corner. But the comma basis is on the other side of duality from the mapping, so it must be transposed before we can apply our nullSpaceBasis[] function to it, because that function is designed for mappings. But when we transpose the comma basis we end up with the triangle of zeros in the top right. If we take the null-space of that and then transpose it back again, we don't get our canonical form of the mapping, we get a mapping with a triangle of zeros in the top right. The way to fix this is to anti-transpose instead of transpose, before and after taking the null-space. Because when you anti-transpose the comma basis, you still turn columns into rows, but this time the triangle of zeros stays on the bottom left. | So why the anti-transpose sandwich? What we (and everyone) want in a canonical mapping is to have a triangle of zeros in the bottom left corner. What we want in a comma basis is also to have a triangle of zeros in the bottom left corner. But the comma basis is on the other side of duality from the mapping, so it must be transposed before we can apply our nullSpaceBasis[] function to it, because that function is designed for mappings. But when we transpose the comma basis we end up with the triangle of zeros in the top right. If we take the null-space of that and then transpose it back again, we don't get our canonical form of the mapping, we get a mapping with a triangle of zeros in the top right. The way to fix this is to anti-transpose instead of transpose, before and after taking the null-space. Because when you anti-transpose the comma basis, you still turn columns into rows, but this time the triangle of zeros stays on the bottom left. | ||
Here's the Wolfram Language implementation: | |||
{| class="wikitable" | {| class="wikitable" | ||
!input | !input | ||
!output | !output | ||
Line 657: | Line 645: | ||
|} | |} | ||
Notice how when writing our comma basis in Wolfram Language, we have to write it differently than we probably would otherwise. Wolfram doesn't understand RTT's angle bracket syntax for indicating how a matrix is sliced and diced; it supports only one way of writing matrices: as lists within lists, where the outermost list is always assumed to be vertical. So if we have a comma basis with two commas, we can't just write one comma and then the other; we have to do one element from each comma in a group at a time. It's not a big deal, but again, may take a little getting used to. | |||
Now the null-space function, to take you from {{vector|{{map|19 30 44}}}} back to the matrix, is pretty much the same thing, but simpler! No need to anti-transpose. Just start at the augmentation step: | Now the null-space function, to take you from {{vector|{{map|19 30 44}}}} back to the matrix, is pretty much the same thing, but simpler! No need to anti-transpose. Just start at the augmentation step: | ||
Line 725: | Line 715: | ||
{| class="wikitable" | {| class="wikitable" | ||
!input | !input | ||
!output | !output | ||
|- | |- | ||
|<code> | |<code>nullSpaceBasis[<nowiki>{{19,30,44}}</nowiki>]</code> | ||
|{{-44,0,19},{-30,19,0}} | |{{-44,0,19},{-30,19,0}} | ||
|} | |} | ||
It's great to have Wolfram and other such tools to compute these things for us, once we understand them. But I think it’s a very good idea to work through these operations by hand at least a couple times, to demystify them and give you a feel for them. | |||
=== the other side of duality === | === the other side of duality === |