-
Notifications
You must be signed in to change notification settings - Fork 16
Matmul overloaded for correlator class. #199
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
Conversation
I know extended the Additionally, I added a |
I now also implemented a |
explicitly specifying the axis. Co-authored-by: Matteo Di Carlo <matteo.dicarlo93@gmail.com>
Another bug in |
pyerrors/correlators.py
Outdated
if self.N == 1: | ||
raise TypeError("Only works for correlator matrices.") |
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.
Strictly speaking, it is not necessary to catch this, since the trace of a 1x1 matrix should be well defined. But of course it does not make much sense.
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.
I just checked and numpy does not like the trace of an array with a single entry:
np.trace(np.array([1.1]))
> ValueError: diag requires an array of at least two dimensions
Hi, I did not (yet?) check the code by running it, but so-far everything looks fine. Thanks for taking care of this. While you are at it: Currently, it is not possible to initialize a li = [pe.cov_Obs(o, 0, '') for o in [1, 2, 3, 4]]
ar = np.array(li)
pe.Corr(li)
pe.Corr(ar)
would you mind looking into this? |
I overloaded the matmul class which should now allow for the multiplication of matrix valued
Corr
objects with matrices. I will write a few tests and look into edge cases but this solution seems to work.