-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Symbol ⊗ [Unicode 'CIRCLED TIMES' (U+2297)], typed \otimes in Julia, as the default shortcut for the kron operation #1181
Comments
(Note that you should use I guess the concern is that this symbol is used for other things in math too. But in the context of LinearAlgebra I agree that it might be reasonable. |
For example Many of these would then need to decide if they want to shadow the new LinearAlgebra definition (the default) or import/extend it. And there might be side effects we aren't considering, if they use |
It could be confusing if someone needs to use both the LinearAlgebra.jl and a package where ⊗ is defined with some other meaning, but I don't think it could break anything. I can't imagine what kind of side affects could appear. Yes, I define ⊗ with the const (learned that the hard way). |
Xref JuliaLang/julia#35150, which defined this symbol for That's a more standard definition for this symbol than |
Well I'm glad that PR got reverted, I think making Which is double frustrating, because I'd love to have it in |
On matrices, But I agree that it is unfortunate that the matrix version swaps the ordering compared to the multilinear-algebra "tensor product" version. |
This issue is akin to the big-endian vs little-endian convention (BTW, I've tried to make parallels between this and tensor products in this short doc about conventions in math). I find little-endian convention to be more natural, but big-endian is simply much more common and older convention. Same with the Kronecker product, it's older and used more widely. |
I think what is swapping the order is the col-major orientation. If we define a row-based vectorization |
Apart from the row- vs column-based vectorization, there are other ways to get a swapped kron: redefine the matrix product to be Anyway, the issue of what is better, |
@araujoms, note that I agree that it would be nicer (in hindsight) the other way around, but you cannot argue that it is nonstandard, or that it is an idiosyncratic choice specific to Julia. |
Python's I much prefer the identity |
Like them or not, they are not merely "Julia's" choices … they are both the standard meanings of these terms in linear algebra. The source notes that some authors historically used a row-major Personally, I would also have preferred row-major storage, but anyway … water under the bridge at this point. |
Hello!
I think that the symbol ⊗ is quite a common notation for denoting tensor products and the Kronecker product of matrices in linear algebra. I always use
⊗ = kron
in my code and it works without any problems (in its infix form A⊗B). Are there any reasons why this could not be included by default in the LinearAlgebra.jl?The text was updated successfully, but these errors were encountered: