Update quantum code from matgwinc, and vectorize
Compare changes
- Christopher Wipf authored
+ 28
− 21
@@ -322,34 +322,41 @@ def shotradSignalRecycled(f, ifo):
@@ -360,22 +367,22 @@ def shotradSignalRecycled(f, ifo):
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).