Update quantum code from matgwinc, and vectorize
Before this change and !31 (merged):
%timeit gwinc.gwinc(freq, ifo)
519 ms ± 15.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
After both:
%timeit gwinc.gwinc(freq, ifo)
50.4 ms ± 1.97 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
%prun gwinc.gwinc(freq, ifo)
5304 function calls (4870 primitive calls) in 0.102 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
74 0.033 0.000 0.034 0.000 coatingthermal.py:743(getCoatRefl)
1 0.014 0.014 0.016 0.016 quantum.py:257(shotradSignalRecycled)
10 0.008 0.001 0.008 0.001 suspension.py:30(tst_force_to_tst_displ)
2 0.007 0.004 0.007 0.004 coatingthermal.py:446(getCoatTOPhase)
1 0.006 0.006 0.016 0.016 suspension.py:51(suspQuad)
7 0.006 0.001 0.006 0.001 {built-in method numpy.core.multiarray.matmul}
I think the biggest remaining chunk of run time goes to the coating design step in precompIFO
(which can be skipped by setting CoatLayerOpticalThickness
in the ifo struct).
Merge request reports
Activity
added 1 commit
- 0f25554e - More quantum optimization (precomputed trig functions)
I'm going to mark this as work-in-progress. I think I got a little carried away here, and we should probably not merge this yet. The first step should have been to understand the ~5% discrepancy with matgwinc's quantum curve -- which I now see is produced by code that's very different from what's in pygwinc now. If we end up adopting matgwinc's implementation, most of this branch will have to be thrown away.
added 6 commits
-
3c94c320...ea42d0c6 - 2 commits from branch
master
- 354f5576 - Speed up quad sus tf calculation 10x, by pre-solving the system symbolically
- c92a94a6 - Speed up quantum calculation with monolithic matrix multiply
- df905a0f - More quantum optimization (precomputed trig functions)
- 2749df6d - quantum.py functions updated from matgwinc
Toggle commit list-
3c94c320...ea42d0c6 - 2 commits from branch
added noise label
added 6 commits
-
7534900a...e9aabda9 - 3 commits from branch
master
- be4a88c5 - Speed up quantum calculation with monolithic matrix multiply
- be7ec75d - More quantum optimization (precomputed trig functions)
- 95b010d4 - quantum.py functions updated from matgwinc
Toggle commit list-
7534900a...e9aabda9 - 3 commits from branch
mentioned in commit 49fc9560