![]() A strong separation of these concepts means we can afford to make a linear algebra system which is crystal clear and makes sense, have data operations on arrays be crystal clear and make sense, and use AbstractArray to implement both. For instance, this week I found bugs in years-old MATLAB code in production at work because the original programmer was using ' everywhere to reshape arrays of data and it was so unclear it wasn't obvious what was happening. ' (which is Hermitian conjugation) since all of these derive directly from linear algebra concepts. ![]() ' (as opposed to permutedims), conj(::AbstractArray) (as opposed to conj.(::AbstractArray)) and ctranspose/. For instance, IMO Base deals with map, broadcast (and thus dot operators), permutedims, reshape, etc, and LinAlg defines + (as opposed to. To give a bit of context of where I'm coming from, over time, my views have been quite hardline about this kind of thing. IMO, all this follows directly from pre-exisiting Julia choices 1 != (scalars and 1D vector spaces are distinct) and Vector != Matrix (operators and vectors are distinct). That is, we can multiply Mx1 matrices by 1xN matrices - which is fine and already exists, but it doesn't justify the method requested in the OP. And since Julia treats vectors and matrices as distinct, that implies that u must be a matrix. If we replace wáµ with a linear operator from a N-dimensional vector space to a 1-dimensional vector space (remember Julia says a 1D vector space is distinct from a scalar) then that implies u is an operator from 1-dimensional vector space to an M-dimensional vector space. v) and we choose to write this linear map as A = u. Take again the last sentence in my notation description aboveĬomposing scalar-vector multiplication with the inner product means we can define a linear map that takes v and emits u.( wáµ. A." I feel this is associate one-dimensional vector spaces with scalars (in Julia, that is 1 = ). To me, it seems exceeding inelegant to add to the end of this mathematical notation description "Oh, and by the way, in the special case that an operator A is a mapping from a 1-dimensional vector space to a n-dimensional vector space, we also allow you to write v. wáµ." In the universities I've been associated with, a good student at the end of first-year math should be comfortable with this (plus eigenvalues, inverses, etc). Composing scalar-vector multiplication with the inner product means we can define a linear map that takes v and emits u.( wáµ. The inner product induced by the duals (returning a scalar) is written váµ. To disentangle the argument, rather than consider Dirac notation, the corresponding mathematical notation I was aiming for would be this: "Consider vectors v, w, etc and their duals váµ, wáµ, etc, as well as linear operators A, B, etc. MATLAB always just called all of these arrays of numbers I would like to take a more (relatively elementary) abstract linear algebra approach. The point was never Dirac notation (which is definitely a confusing set of brackets for newcomers), but the appreciation of vectors, their duals and linear operators. Haha - that is quite a math lesson to learn from a short string. Since the *(A::AbstractVector, B::AbstractMatrix) method was an error if size(B, 1) was not 1, it is implied that the programmer knows for sure that B is a 1xN-shaped Array, which is guaranteed by B::RowVector. wáµ and O = |psi> H and expect an operator back. You wouldn't impress a math lecturer with writing B = v. Otherwise vector * matrix doesn't make too much sense (outside of MATLAB/Householder notation, where matrices and vectors are of the same kind of object, which is just plain not true in Julia). In fact, this is still a (specialized) method of *(::AbstractVector, ::AbstractMatrix). You can now do vector * rowvector for this. The (only) reason is it was a way of obtaining the outer product of two vectors. ![]() To me, the question is in reverse - why did this method exist in v0.5?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |