-
Notifications
You must be signed in to change notification settings - Fork 19
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 extension: svd
, inv
, *
, /
, \
for QuantityArray
#75
Conversation
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
Nice work!! I added some initial comments. |
F.S requires a Vector (QuantityArray not ok like in Julia 1.9)
Failed Julia 1.6 runtest required some additional code for |
Edit: I guess we might need to add a special method for |
This is the same issue that led me to writing |
I guess some of these issues could also be fixed if we could figure out a way to implement #76, right? Trading type instability with compatibility (though people could get type stability if they simply used |
Getting closer and hope to not have missed anything. Certainly ok if you edit this PR. I tried to test on Julia 1.6 locally but Pkg complained about Compat... package not being in registry so I quit. |
Compatibility/composability with other packages is a big reason why I'm interested in this package. Unitful doesn't work with Turing, for example. It seems like there are issues with SciML and Unitful as well. Making some design choices in this package so that it is more usable in combination with other packages would be a good idea in my opinion. |
413400b
to
3873acc
Compare
8ebbdb6
to
c6f5ce5
Compare
svd
, inv
, eigen
, (\)
for QuantityArray
svd
, inv
, *
, /
, \
for QuantityArray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. I took out the eigen
stuff as it needs more tests but that could be added later.
There are a couple of branches that aren't tested but they are disambiguities, so I am okay with 99% coverage for the moment. We should get back to 100% later though.
Thanks for the cool and promising package!
On Julia Discourse there seemed to be some interest in extending this package for "multidimensional analysis" (following George W. Hart) which I mostly interpret to be linear algebra utilities for the
QuantityArray
type. I don't know whether this fits with the vision of this package or whether it is best completed in a separate package. Any comments/advice on this PR are appreciated.Here I make a start using the existing
DynamicQuantitiesLinearAlgebraExt
to add functionality for:inv
,(\)
,svd
,SVD
,Diagonal
,eigen
, anddet
forQuantityArray
s.All functions here use the "algebraic" interpretation of dimensional analysis.
Because
QuantityArray
s represent a dimensionally uniform matrix, the number of applicable linear algebra methods is fairly restricted. In the parlance of Multidimensional Analysis, an array would be any combination of values and dimensions/units in a tabular form. A matrix or multipliable matrix would be a restricted dimensional structure such that multiplication and other linear algebra functions are possible. In this light, theQuantityArray
name for uniform matrices is somewhat confusing.I think that other multipliable matrices (i.e., non-uniform) would best be represented by a different
struct
with the dimensional range and domain as two of the fields. This goes beyond an extension to this package and I plan to experiment on this idea in a separate package.