Adding Hong et al. calculations for Coating Brownian Noise
Modified getCoatBrownian() to accept different Bulk and Shear Loss Angles and calculate brownian noise using Hong et a. PRD 87, 082001 (2013).
Function Description:
This function calculates Coating ThermoOptic noise using Hong et al . PRD 87, 082001 (2013). All references to 'the paper', 'Eq' adn 'Sec' are to this paper.
Important Note
Inside this function phi is used for denoting the phase shift suffered by light in one way propagation through a layer. This is in conflict with present nomenclature everywhere else where it is used as loss angle.
The layers are assumed to be alernating low-n high-n layers, with low-n first. Inputs:
f = frequency vector in Hz ifo = parameter struct from IFOmodel.m wBeam = beam radius (at 1 / e^2 power) dOpt = the optical thickness, normalized by lambda, of each coating layer.
New required arguments:
mTi = Mirror Transmittance Ic = Circulating Laser Power falling on the Mirror (W)
The following new arguments should be made available in the Materials object and lines 112-114 and 120-122 should be uncommented:
lossBlown = Coating Bulk Loss Angle of Low Refractive Index layer lossSlown = Coating Shear Loss Angle of Low Refractive Index layer lossBhighn = Coating Bulk Loss Angle of High Refractive Index layer lossShighn = Coating Shear Loss Angle of High Refractive Index layer PETlown = Relevant component of Photoelastic Tensor of High n layer* PEThighn = Relevant component of Photoelastic Tensor of Low n layer*
Returns:
SbrZ = Brownian noise spectra for one mirror in m^2 / Hz
*Default values of PETlown and PEThighn are chosen from sec. A.1. to get the longitudnal coefficent of photoelasticity as -0.5 as been asserted by the paper there for Tantala and -0.27 for Silica. These values also need to be added in Materials object.
The test job failed at a later stage of uploading artifacts and the part of calculation of noise ran without any errors or warnings.
Merge request reports
Activity
added 26 commits
-
fd235ed4...a837d54d - 25 commits from branch
gwinc:master
- 00e5d3db - Merge branch 'master' of https://git.ligo.org/gwinc/pygwinc
-
fd235ed4...a837d54d - 25 commits from branch
added 1 commit
- e879b168 - Corrected calculation of derivatives of complex reflectivity
I updated my fork with the present pygwinc master and made some changes to the code. I found that I was unable to reproduce fig 5 from Hong et al. paper. I found a slightly more computationally brute force but the correct way of writing the code for calculating derivatives of the total complex reflectivity of the coating with respect of phase shift due to each layer and reflectivities of each interface. These corrections have been added and the fig 5 of the paper can be reproduced now. This doesn't change the final result though and hence this error was hard to detect. But now, I am almost certain that this code correctly implements the paper's calculation for calculating coating brownian noise with different shear and bulk loss angles.
CoatingBrownianNoiseComparisonWithOld.pdf I'm attaching a comparison plot here. Note, here the bulk and shear values were still kept the same in the Hong et al. calculations and in the gwinc calculations, I have kept the Phihighn_slope and Philown_slope zero. Otherwise, it would be comparing apples and oranges. Now, I do see a difference in overall level of noise but dependence on f is the same. The minute difference could be coming in through photoelastic effect considerations or due to differences in transfer functions of bulk and shear noise fields to phase noise of layer thickness and surface height fluctuations (Table I in Hong et al.). But honestly, as the paper is very convoluted, it is hard to figure out 'rolling back which thing in the calculation will make it the same as yours'.
If we would like to add the ability to provide frequency-dependent loss angles, I do have a code for that. This code, however, takes the loss angles as python function definitions instead of a float number and that would be hard to feed in through the yaml files that is being done right now. Another way could be to have a fixed model of dependence (polynomial or exponential) and provide coefficients for that. I think that's what is being done right now but just from staring at the code, I couldn't figure out what the Phihighn_slope and Philown_slope refer to actually. But I thought we are not so sure yet of the model of frequency dependence of these loss angles.
mentioned in issue #38 (closed)
I made a comment in #38 (closed) about some of these issues. The upshot is that I think your new code should go into a separate function, so that the aLIGO calculation still uses the existing
getCoatBrownian
function, while at the same time anyone who wants to can use the new Hong calculation. The fact that the Hong calculation gives a different answer than the existing calculation is what is breaking the build right now (it fails on the comparison between the pygwinc and matgwinc aLIGO curves).Edited by Evan Halladded 9 commits
-
357622d5...f22551c6 - 7 commits from branch
gwinc:master
- 0d9c348c - Merge branch 'master' of https://git.ligo.org/gwinc/pygwinc
- 02ddbc9c - Added new requested modifications.
-
357622d5...f22551c6 - 7 commits from branch
I updated my fork with the present pygwinc master and made the requested changes to the code. For using Hong et al. calculations, one would need to use coatbrownianhong instead of coatbrownian. But additional requirements on the Materials object for calculations are mandatory now. The following new arguments should be made available in the Materials object without which this function can not be used:
lossBlown = Coating Bulk Loss Angle of Low Refractive Index layer lossSlown = Coating Shear Loss Angle of Low Refractive Index layer lossBhighn = Coating Bulk Loss Angle of High Refractive Index layer lossShighn = Coating Shear Loss Angle of High Refractive Index layer PETlown = Relevant component of Photoelastic Tensor of High n layer* PEThighn = Relevant component of Photoelastic Tensor of Low n layer* ^ lossBlown, lossSlown, lossBhighn and lossShighn can be string containing python expression to provide dependence on frequency. The expression should be a valid python expression and must have a single variable 'f' for frequency. Ex: '(0.22)*1e-3 + (f - 1000)/1000 * (0.13) * 1e-3' * Choice of PETlown and PEThighn can be inspired from sec. A.1. of the paper. There, values are chosen to get the longitudinal coefficient of photoelasticity as -0.5 for Tantala and -0.27 for Silica. These values also need to be added in Materials object.
The pipeline passes now of course as it is built for the old code which is intact. All changes in this merge request are now strictly additions (no amendments).
assigned to @jameson.rollins
added 61 commits
-
02ddbc9c...078396f1 - 60 commits from branch
gwinc:master
- 7e0b5b1b - Merged all other commits from https://git.ligo.org/gwinc/pygwinc
-
02ddbc9c...078396f1 - 60 commits from branch
added 1 commit
- 5f664c28 - Renamed function and variables to match new coding style of rest of the code
added 1 commit
- e882cb53 - Made use of eval more secure with whitelists and blacklists
added 1 commit
- c2c86c63 - Added extra required fields for coating_brownian_hong
added 4 commits
-
c2c86c63...1de6518b - 3 commits from branch
gwinc:master
- f802952e - Merge branch 'master' of https://git.ligo.org/gwinc/pygwinc
-
c2c86c63...1de6518b - 3 commits from branch
added 1 commit
- eeb0603d - Using coating_brownian_hong only when all parameters are available
added 1 commit
- 66bbb898 - Made mirror transmittance an optional argument
added 1 commit
- 7f87f3b7 - Added testing opiton in coating_brownian_hong()
added 1 commit
- 5d202deb - Parameters for Hong et al calc are marked optional now.
This is ready to merge now. New stuff: There is a test function for this particular calculation and has been added to the test/main.py file as test2() function. This requires some parameter files and cache files which are added in the test/cache directory. Reorganization of this code and/or cache directory can be done very easily after the merge. class CoatingBrownian(nb.Noise) in ifo/noises.py has been modified so that if required parameters for coating_brownian_hong function are present in the ifo.yaml, then Hong et al calculation will be used. Example use of these parameters have been added to aLIGO yaml file and are commented right now. After the merge, these can be uncommented and a new cache can be generated using this function. Currently, the noise estimate with Hong et al. calculation is slightly lower than the previous calculation. Note that frequency-dependent loss angle intake has been implemented now. One can give a mathematical expression in the form of a string with 'f' as the only variable which would denote frequency. I'm using eval but I have made the function use specific white and blacklists to ensure this is safe use.
added 1 commit
- 7c7ca0a2 - Revert "Added Test2 for testing Coating Brownian Code (Hong et al)"
I have cleaned up this merge request now. The other changes regarding .gitignore and testing features have been removed from this branch and will come as separate merge requests. Now this merge request just feature a new function coating_brownian_hong in noise/coatingthermal.py and a modified definition of class CoatingBrownian in ifo/noises.py so that coating_brownian_hong() is used is ifo.yal has all required parameters. These required parameters have been added to ifo/aLIGO/ifo.yaml as comments for providing an example. If this new calculation method is accepted as the new default in future, the cache for tests would need to be generated again. The Hong et al. calculation is estimating slightly lower noise than the existing code as shown in the comparison plot attached. Please ignore the difference in Newtonian noise there (it is some round off error which is not coming up in git CI run of the same test but is coming in my local test). Here head(orange) refers to calculation done using Hong et al code and cache(blue) refers to calculation done by existing code. The commented example inifo/aLIGO/ifo.yaml is used to generate this report. Exactly same loss angle with frequency dependence is used as Bulk loss angle and shear loss angle is made zero. ComparisonExistingCodevsHongCode.pdf
added 3 commits
-
6f708e09...d886c07f - 2 commits from branch
gwinc:master
- 2443a086 - Merge branch 'master' of git.ligo.org:gwinc/pygwinc
-
6f708e09...d886c07f - 2 commits from branch
- Resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
- Resolved by Anchal Gupta
- Resolved by Anchal Gupta
added 1 commit
- 4105bae6 - Using simple power law freq dependence of loss angles
- Automatically resolved by Anchal Gupta
- Resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
added 2 commits
added 1 commit
- 6aa5b486 - Changed some comments. Fixed a typo in example params
Latest comparison plot after the suggested changes. HongCodeVSExistingCache.pdf Please ignore the difference in Newtonian noise there (it is some round off error which is not coming up in git CI run of the same test but is coming in my local test). Here head(orange) refers to calculation done using Hong et al code and cache(blue) refers to calculation done by existing code. The commented example inifo/aLIGO/ifo.yaml is used to generate this report. Exactly same loss angle with frequency dependence is used as Bulk loss angle and shear loss angle is made zero.
added 3 commits
-
6aa5b486...94de6c42 - 2 commits from branch
gwinc:master
- c4a99667 - Merge branch 'master' of git.ligo.org:gwinc/pygwinc
-
6aa5b486...94de6c42 - 2 commits from branch
I don't have original data with which Hong et al. plotted the figures in their paper but with visual inspection atleast (shapes and absolute values), I believe these are same as the figures 5 and 7 in the paper Hong et a. PRD 87, 082001 (2013). aLIGOHongCalcPaperFigures.pdf These plots were generated from this code. coating_brownian_hong_test.zip These quantities are readily available in the code so I plotted them first. If someone wants any particular figure to be reproduces, I can work on that as well. Let me know.
Edited by Anchal GuptaDoes @rana-adhikari or @yanbei.chen know if the code that was originally used to make the plots in the Hong et al coating noise paper is still around for comparison purposes?
we don't have it, but you could ask @huan.yang. He did most of the detailed calculations I believe.
Has anyone profiled this code yet? I see there are a lot of numerical integrals being done over trig functions in ϵ(z); would it help to evaluate those analytically?
Gabriele found a discrepancy between this code and the others when considering coatings with a small number of layers. Has that been understood?
Also, I think this MR highlights the need to come up with a better scheme for organizing the material properties in gwinc. The mishmash of Phi/loss/B/S/highn/lown parameters used by the various CTN codes is likely to lead to some confusion. And it won't scale well to coatings with more than 2 materials, which we may need to add support for in the future.
- Resolved by Anchal Gupta
Nope, the code has not been profiled by a third person yet. The integration over trig functions in ε(z) is how it was described in the Hong et al. paper itself, so I never tried solving it. But I think one can deduce a layer thickness-dependent analytical solution of q^B_k, q^S_k, p^B_k and p^S_k.
Regarding the discrepancy that Gabriele found for 1 and 2 doublets, I investigated it sometime back and the analysis is in this zip file HongAnalysis.zip. On that time, our conclusion was that the weird behavior for low number of doublets is an emergent phenomenon of the model due to the very low reflectivity of the overall coating. The low total reflectivity puts the burden of most of the reflectivity on the top layers increasing their contribution to the Brownian noise. While this effect is seen in the present gwinc code as well from the second layer onwards, somehow the first layers contribution remains constant for the gwinc code and hence the discrepancy.
I agree about the comment about the material properties structure in gwinc. In Caltech CTN lab's noise budget code which is also an object-oriented program, I store the coating structure as a 'stack' object which can be arbitrarily created using 'material' objects. This 'stack' object also holds all properties of the stack like reflectivities, phase shifts, derivatives, effective coefficients, etc. The 'noiseBudget' used this stack object than to calculate coating noise terms. This code can be found at https://git.ligo.org/cit-ctnlab/ctn_noisebudget/-/tree/master/noisebudget . It supports all kinds of coating structure and multiple material stack objects can be created on the fly by using material objects which can be initialized by their own parameter yaml files.
Edited by Anchal Gupta
added 42 commits
-
c4a99667...131d6887 - 41 commits from branch
gwinc:master
- caf69272 - Merged changes in Loss Angle value and slope
-
c4a99667...131d6887 - 41 commits from branch
added 9 commits
-
caf69272...d5bc7891 - 8 commits from branch
gwinc:master
- a95d472b - Merge branch 'master' of git.ligo.org:gwinc/pygwinc
-
caf69272...d5bc7891 - 8 commits from branch
added 30 commits
-
a95d472b...c51f8f48 - 29 commits from branch
gwinc:master
- 38b541c5 - Merge branch 'master' of git.ligo.org:gwinc/pygwinc
-
a95d472b...c51f8f48 - 29 commits from branch
added 22 commits
-
38b541c5...803ede96 - 21 commits from branch
gwinc:master
- b6ddd53a - Merge branch 'master' of git.ligo.org:gwinc/pygwinc
-
38b541c5...803ede96 - 21 commits from branch
added 1 commit
- 05c15313 - Made 1.5x faster. Derivatives calculation made 10x faster.
added 1 commit
- eed64da7 - Made 1.5x Faster. Amplitude noise pathway made optional.
added 1 commit
- 63f2db10 - Replaced existing coating_brownian code with hong code
- Resolved by Anchal Gupta
I've made requested changes to speed up the code. It currently takes about 14.5 ms to run the coating_brownian_hong function while the coating_brownian function takes 0.5 ms on my laptop. This is the lineprofiler stats for the code: speedTestStats8.txt
But I do not think this code can be made significantly faster from this point. Minor improvements can be done but that will come at the cost of code readability. I propose that this is ready for merge after a code review.
- Automatically resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
296 296 w0, wBeam_ITM, wBeam_ETM = arm_cavity(self.ifo) 297 297 dOpt_ITM = coating_thickness(self.ifo, 'ITM') 298 298 dOpt_ETM = coating_thickness(self.ifo, 'ETM') 299 # Optional parameters for including contribution from 300 # amplitude noise due to coating bownian noise. 301 # mTi_ITM = self.ifo.Optics.ITM.Transmittance 302 # mTi_ETM = self.ifo.Optics.ETM.Transmittance 303 # Ic = self.ifo.Laser.Power * self.ifo.gwinc.finesse / pi changed this line in version 44 of the diff
No new parameters in this MR, please. In fact, I prefer we remove the ones that were previously added (
lossB...
/lossN...
/PET...
/etc).There's going to be another MR shortly to add multi-material support. I think the
ifo.yaml
interface for taking advantage of new features in this code should be defined at that time. While for this MR, we just focus on getting the new code to replace the existing functionality.If we add these things piecemeal, I think we'll end up with a morass of oddball legacy parameters that have to be supported (or deprecated) in the future.
All new parameters are optional. The code will still run if they are not provided. This is to ensure backward compatibility. I've only added new parameters as comments for folks who are restructuring ifo.yaml or changing the way layers would be read like the multi-material support MR. So in the present form, I do not think the comments hurt. If I do not keep them, it would be harder to get the new features of this code added into future upgrades of the ifo.yaml interface.
- Automatically resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
added 1 commit
- 66694566 - Inclusion of CaotBr Amplitude Noise controlled from ifo.yaml
added 1 commit
- 4741c385 - 1.7x faster for PTE=0 and No Amp Calculation
added 1 commit
- 5efeed5c - 3.2x faster. Restricted to nL-nH-nL.. structure
added 1 commit
- 7b6ed3ed - Found recursion relation. Back to getCoatReflAndDer with no additional penalty
Mathematica notebook for derivation of the formulas used: getCoatReflAndDer.nb
Speed test results: speedTestStats12.txt
203 203 Indexhighn: 2.09 # 2020 LMA 204 204 Phihighn: 3.89e-4 # loss angle at 100Hz (Gras 2020) 205 205 Phihighn_slope: 0.1 206 # Following are optional parameters to for providing separate Bulk and 207 # Shear loss angles and to include photoelastic effect in Coatings 208 # Brownian noise calculation. 209 # lossBhighn: 3.89e-4 # Bulk loss angle at 100 Hz 210 # lossBhighn_slope: 0.1 # Bulk loss angle slope 211 # lossShighn: 3.89e-4 # Shear loss angle at 100 Hz 212 # lossShighn_slope: 0.1 # Shear loss angle slope 213 # PEThighn: 0.1095 # Hong et al . PRD 87, 082001 (2013) A.1 I agree with @christopher.wipf that we should just leave this stuff out for now.
217 225 # slopes between 0 and 0.3, depending on 218 226 # deposition method. Slawek's analysis in 219 227 # 10.1103/PhysRevD.98.122001 assumes zero slope. 228 # Following are optional parameters to for providing separate Bulk and 229 # Shear loss angles and to include photoelastic effect in Coatings 230 # Brownian noise calculation. 231 # lossBlown: 2.3e-5 # Bulk loss angle at 100 Hz 232 # lossBlown_slope: 0 # Bulk loss angle slope 233 # lossSlown: 2.3e-5 # Shear loss angle at 100 Hz 234 # lossSlown_slope: 0 # Shear loss angle slope 235 # PETlown: 0.269 # Hong et al . PRD 87, 082001 (2013) A.1 236 237 # Indicator for including effect of amplitude noise due to coatings 238 # brownian noise. Set to 'yes' for including. Otherwise would be ignored. 239 # IncCoatBrAmpNoise: 'yes' # Hong et al . PRD 87, 082001 (2013) II.E agree with @christopher.wipf that we should just leave this stuff out for now. We can therefore drop all changes to any ifo.yaml.
- Automatically resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
- Automatically resolved by Anchal Gupta
- Resolved by Christopher Wipf