-
Notifications
You must be signed in to change notification settings - Fork 56
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
[unitaryhack] Improve the calculation of multidimensional hermite polynomials #214
Comments
A second improvement would be to find a way to parallelize the loop in line
This might require a nontrivial amount of algorithmic thinking since this loop implements a recursion relation. |
Finally, it would also be interesting to think about porting this part of the code to |
Hi @nquesada, I didn't get the second improvement you proposed. Can you elaborate on it? Thanks! |
I just meant, to write an implementation of Hermite multidimensional in numba. |
I was referring to this comment, can you elaborate on it? Thanks! |
Hi @TripleR47, the idea here is to use |
To add to @co9olguy : the challenge is that the |
Would love to take a stab at this. Okay if I work on this? |
Hi @e-eight, yes this issue is still open. Feel free to tackle it if interested :) |
Alright. Will give it a shot. |
This issue has been tagged for a bounty during unitaryHACK
Currently all calculations of multidimensional hermite polynomials are carried in
double
precision even though the C++ functions to do these calculations are templated to allow for any datatype.A useful addition to The Walrus would be to allow the Python modules to have the C++ functions do calculations in
long double
precision. Note that even if the input and output of the C++ functions is ultimately casted todouble
it is still useful to internally do the calculations inlong double
given that numerical errors can accumulate very fast. Similar issues for the calculations of hafnians have been solved by doing its internal calculation inlong double
.Two alternatives come to mind to achieve this:
Make a wrapper function that takes as input the matrix
R
and vectory
asdouble
precision arrays and then converts them tolong double
and pass them to the templated version ofhermite_multidimensional_cpp
. An array inlong double
would be returned and then the wrapper function would cast this array intodouble
precision and return it to Python using theArrayWrapper
for double datatypes in libwalrus.pyx.A second option that would avoid any type conversion is to write new array wrappers that allow to pass transparently
long double
arrays into numpynp.longdouble
.An important caveat for testing is that in MS Visual C++
long double
is an alias for double so no gain in precision can be obtained by using this compiler.The text was updated successfully, but these errors were encountered: