-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ie #57
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #57 +/- ##
===========================================
- Coverage 46.09% 24.39% -21.71%
===========================================
Files 7 8 +1
Lines 692 1279 +587
===========================================
- Hits 319 312 -7
- Misses 373 967 +594
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
what I have so far for IE solver
The code I pushed has the file I described above, which uses the equations here (but in conformal newton gauge as I wrote out in the notes). I also turned the RSA off in ie.jl (which is a file that only evolves the low-order moments of the photons and uses the splines for quadrupoles). Some notes about this last point: RSA serves two purposes:
The latter is entirely a numerical artefact of the hierarchy - with the ie solution we can properly resolve photon oscillations without the boundary issue. While aesthetically pleasing to say we don't need to make the RSA assumption (for a finite number of multipoles), it is probably desirable from a computational standpoint to continue using RSA. But we no longer absolutely have to to get a correct answer (and I wonder if there are any science cases for late-time radiation-like perturbations...). |
This PR is at a very exciting step! I'm finding your code to be very clear, especially for a first draft. For my own understanding, I still need to do a bit of derivation to go from the hierarchy to the IE, as you've done in your notes! |
Going to start posting some numerical experiment results (plots/timings/norms) here for the massless neutrino FFT dependence on numerical parameters. (Everything here is in conformal time integration, though I don't find much of a difference between stepping in Varying:
Also will look at truncating the number of multipoles in the initial solve and using a better initial ansatz, as by default here I will use Timings should be taken with a grain of salt because the FFT code is 1. Unoptimized and 2. Still carrying the weight of the full hierarchy for the photons and massive neutrinos, but I think are still useful for a rough indication at least in the tradeoff of |
Fiducial values of the main parameters (fixed to this unless otherwise stated): Vary
|
Here is the same test at higher 14.687309 seconds (3.66 M allocations: 420.126 MiB, 0.61% gc time, 14.60% compilation time) 12.744275 seconds (1.48 M allocations: 456.152 MiB, 0.79% gc time) 12.747244 seconds (2.20 M allocations: 799.949 MiB, 1.47% gc time) Obviously this takes much longer (but we might explore relaxing the tolerance?). Either way convergence results are qualitatively similar (error is actually lower than for lower k). Again most of the time is probably spent in the truncated ODE solve, and I would imagine dropping the photon and massive neutrino hierarchies will help down the line. To follow up on this, the time for the solutions of the "late" full hierarchy is Each truncated solve costs around 2.4 seconds
So we are saving only around 30% of the runtime by truncating the neutrinos. Will revisit these timings again later, but this helps (at least me) get oriented. |
Hmm I may need to fix that first plot for |
These last few commits remove the monopole and quadrupole entirely from the neutrino solution in the truncated hierarchies (per @marius311's correction of my oversight there). |
Now (finally) moving on to photon iterative unification.... |
With these changes, unification is complete! But there are some residual numerical issues with the k=1.0 h/Mpc mode I am looking at before moving on to performance (the sanity check passes for the other two modes we have been looking at k=0.03 and 0.3) |
The issue I mentioned with high-k mode probably needs to be investigated more, but there is nothing wrong with the iteration procedure - after sufficiently many iterations the result still converges. Here also is a somewhat clean "experiment" file for the combined iteration where I started to look at performance. |
Added a first look at comparing solvers and the full vs truncated hierarchy times in in the "/scripts/combined_experiment_iter.jl" file Getting an AD error for Rodas5P on the truncated hierarchy solve though, so will need to check that out.... Also AD fails due to the conformal time interpolator in the conformal solver |
Toward a hierarchy-less version - eventually want to compare speed against hierarchy.