-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add Vioreanu-Rokhlin quadrature finding #107
Conversation
a86edf2
to
ad3f756
Compare
It made its first nodes: 🎉 cc @alexfikl |
One possible issue right now is the basis orthogonalization. V and R propose an SVD-based procedure that (IIUC?) seems to produce |
Would a pivoted version work better? Although those aren't exactly available easily https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.lapack.dpstrf.html#scipy.linalg.lapack.dpstrf |
TIL that's even a thing! In CS450, I say things like "Cholesky doesn't need pivoting". And it's not just me:
For now, I would bet that perhaps the bigger problem is that the implementation (just the test really) currently tries to go where it needs to by linearly combining monomials. Another indication that it's perhaps not the linear algebra that is to blame here is that, at least by back-of-the-envelope analysis, the main "accuracy loser" in CholeskyQR2 is the formation of Yet another indication is that the coefficients reach a magnitude of about 3000, which might help explain the loss of about three digits. |
This facilitates type checking of some common code.
4e75f88
to
8f286da
Compare
8f286da
to
baf214d
Compare
This is ready for a look. @ShawnL00, while I can't formally request a review from you, I'd like you to review this code as well. One thing that's missing is better support for (inefficiently) computing reference integrals of "obstinate" integrands, probably using adaptive quadrature. Some useful pieces exist for that, but I figured I would still leave it for future work. |
That is cool! will do! |
481b7ee
to
625cf41
Compare
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.
Left a few nitpicks, but it all looks pretty straightforward. Very cool! 🎉
Some additional questions:
- How do the nodes from
guess_nodes_vr
compare to the stored VR nodes? Do they also miss some digits? - Does
orthogonalize_basis
work to iteratively construct a basis too? I recall there was a section in Vioreanu2011 doing something like "start with f_i = 1, multiply it by x, orthogonalize, repeat". - How slow is this to find higher order rules?
Not a meaningful comparison IMO.
TBH, I did not fully understand that bit of the paper. As it stands, it seems that this process would provide functions that are orthogonal in terms of the
The tests run within a few seconds, but they only exercise up to |
611adab
to
4423a5f
Compare
4423a5f
to
96523ae
Compare
Pushed the changes addressing the concerns. |
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.
Left a few nitpicks in the docs to make them sound more sentence-y, but otherwise this looks good to me! ❤️ (As usual, not sure if these follow line lengths and stuff :(
Not a meaningful comparison IMO. guess_nodes_vr gives interpolatory nodes.
Yeah, forgot that does a lot of extra work to get the nodes. Would be cool to be able to reproduce those one day 😁
TBH, I did not fully understand that bit of the paper.
Yeah, it seemed more like they just added it to the paper to fill in the hole "what if you have a domain where you don't know the basis??".
The tests run within a few seconds, but they only exercise up to P 11 on the triangle.
That's not bad already. I assume that we'll precompute and cache the rules to some order (like the current ones).
Co-authored-by: Alex Fikl <[email protected]>
f5c9277
to
5ccf44b
Compare
@alexfikl Thanks for taking a look!
I would be super excited if it were plausible to run rule generation at code startup and stuff the resulting data somewhere in a cache (instead of plastering a bunch of floating point numbers into source code files). This would of course delay cold-cache runs, but on the upside it would make sure to preserve the recipe for making the rule (as opposed to a bunch of opaque data). |
Forgot the most important part: Advertise the existence of this in the README! 😁 3dbe7d3 |
To do:
Improve basis orthogonalization(@inducer thinks this can't be improved while still representing functions as linear combinations of monomials. Using PKDOs on a simplex avoids this. Unverified conjecture: an orthonormal basis on a mismatched domain will still make this better, e.g. tensor product Chebyshev on a simplex.)Closes #106.
cc @ShawnL00 @a-alveyblanc