5 ms·
I've never really understood the point of Einstein notation, as a piece of mathematical notation. Is writing something like A[i, j] * B[j, k] really that much f
by joppy 8y ago
I've never really understood the point of Einstein notation, as a piece of mathematical notation. Is writing something like A[i, j] * B[j, k] really that much faster than writing something like Sum[j](A[i, j] * B[j, k])? Especially when you have to check the left hand side of the equality sign just to know which indices to sum over, it seems like making things less clear for a minuscule saving on ink.
- ajkjk 8y agoYes, it's incredibly faster. You do a lot of tensor algebra in a relativity class.
- joppy 8y agoTo the point where writing one large sigma and listing indices under it at the start of each line would significantly slow you down? I found I had to do this mentally during my own relativity class, just to figure out what each expression meant.
- frutiger 8y ago> To the point where writing one large sigma and listing indices under it at the start of each line would significantly slow you down? Yes (in my relativity & QFT classes). But the timesaving aspect was not that important for me. The notation enabled the intuition of “zipping” together these somewhat unwieldy mathematical objects, and that was the clincher.
- pishpash 8y agoThen you're doing it wrong. The point of notation (or learning any new language) is to operate in that language, not to translate back and forth.
- joppy 8y agoIt's not actually a new notation though, it's literally just deleting a part of the old notation and then getting the reader to fill that part back in. While this is fine for calculations, I would rather that when equations are actually presented, that one extra piece of information is explicitly given. I guess a similar thing that happens on the programming language side would be leaving out types when the compiler can infer them. This is great, and can make code more concise, but when reading an API I would really like the types written down explicitly, rather than having the play the part of the compiler.
- ajkjk 8y agoIf types are omitted then there's actual missing information from the equation. If summations are omitted, there... isn't. They add nothing (at least in relativity where every sum is over the same 4 values). Anyway, index notation is more of a shorthand for symbolic tensor algebra computations than actual sums. The problem is that when dealing with 2, 3, and 4 index tensors, with co- and contra-variant indexes, it's quite cumbersome to notate which component of a tensor contracts with which component of another tensor, and anything you could come up with would end up looking like index notation. Rarely do you actually mean to sum anything.
- joppy 8y agoI don't have a problem with using indices for anything, they are fine. Distinguishing upper and lower indices is even better. The exact complaint I have is the implicit sums. For example, a matrix A would be written with one upper and one lower index, which I'll just write as A[i, j]. In einstein (implicit sum) notation, the trace of the matrix is written Tr A = A[i, i]. Is this really better than saying Tr A = Sum[i] A[i, i]?
- lenticular 8y agoIt's more succinct, and the thing is that in most physics, repeated indices really almost always are sums. When you're doing fluid mechanics or anything like that, it's tensors all the time. The terseness is nice once you get used to it.
- mhh__ 8y agoAbsolutely yes. Doing tensor magic without einstein notation will make you shoot yourself, and even you don't someone else will if publish it. The only real problem I have with it personally is the abstraction of upper and lower indices, which I constantly forget the conventions as to which is which.
- krastanov 8y agoThis is interesting... I love the notation, but mainly because how upper and lower indices make it easy to distinguish vectors and forms (not that it matters in ML where everything is "euclidean").
- joppy 8y agoUpper and lower indices are great, but are still unrelated to the convention of dropping the big sigma at the front.
- antidesitter 8y ago> not that it matters in ML where everything is "euclidean" Non-euclidean spaces are actually quite common in ML, but many people don’t realize the spaces they’re working in are non-euclidean!
- improbable22 8y agoWould be curious to hear what you have in mind here -- could you expand?
- g82918 8y agoCo -> low, primes below.
- ssivark 8y agoIt's not just about the sum. The upper and lower indices are semantically crucial. Eg: vectors have upper indices and gradients have lower indices. It's nonsensical to add the two, so the core step in gradient descent doesn't make sense. To add the two, you need the metric (Hessian) to raise the index of the gradient. And just like that, voila, you've discovered natural gradients!
- mmmmpancakes 8y agoGradients are vectors. You can certainly add them to other vectors. I think what you mean to say is that you can not add vectors and covectors. The differential of a function is a 1-form. Pointwise, it is a covector. This data is the natural starting point from which to compute gradients. Metrics can be used to convert covectors into vectors and forms into vector fields. The result is the thing you call the natural gradient. If you do this with the standard metric on R^n, then you get the vector field which you call the gradient.
- mcabbott 8y agoIf you have just one term, then leaving out the summation sign saves little. But in larger expressions, the rule applies sums per term, and then the savings in clutter can be quite large. For example, here v_i is not summed, and the term with z_b has two sums: A_ia x_a + v_i + x_a y_a ( w_i + B_ib z_b ) You should not need to check the LHS, x_a y_a should always mean the dot product of these two. At least this is the convention among the heavy addicts; among lighter users you will sometimes find other setups.
- joppy 8y agoI still feel that the whole expression could be clarified quite easily be writing a \Sum_{a, b} at the front?
- mcabbott 8y agoBut that would sum everything, not just the parts which need it. You'd actually have to write this: \sum_a(A_ia x_a) + v_i + \sum_a(x_a y_a) ( w_i + \sum_b(B_ib z_b) ) My example is actually still easier without indices. (Although you lose some information, like the fact that x & y are vectors in the indexed by a,b.) Here it's clear that Ax and x⋅y each involve a sum, which never includes v: Ax + v + (x⋅y)(w + Bz)
- feanaro 8y agoAs an analogy, why do you write A⋅B instead of Sum[i](A[i] * B[i])?
- joppy 8y agoThis is a bit of a red herring - why would people using Einstein notation write A[i] B[i] instead of writing A⋅B?
- feanaro 8y agoThey wouldn't. My point was that A⋅B is also hiding a sum across all indices, just like Einstein notation. The sum never changes and is therefore visual/cognitive noise, once you've understood it the first time. The dot product is an abstraction that hides it and makes it implied.