Skip to content
Snippets Groups Projects

Adding Hong et al. calculations for Coating Brownian Noise

Merged Anchal Gupta requested to merge anchal.gupta/pygwinc:master into master

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.

Edited by Anchal Gupta

Merge request reports

Merge request pipeline #154276 passed

Merge request pipeline passed for 67b5f1f5

Approved by

Merged by Jameson RollinsJameson Rollins 4 years ago (Oct 6, 2020 1:17pm UTC)

Merge details

  • Changes merged into master with 8d4dbe85 (commits were squashed).
  • Did not delete the source branch.

Pipeline #160160 passed

Pipeline passed for 8d4dbe85 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Anchal Gupta changed the description

    changed the description

  • Anchal Gupta added 26 commits

    added 26 commits

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • e879b168 - Corrected calculation of derivatives of complex reflectivity

    Compare with previous version

  • Author Contributor

    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.

  • Anchal Gupta added 1 commit

    added 1 commit

    Compare with previous version

  • It's been a while since I read the Hong paper. Why does this calculation result in a different slope for the aLIGO coating Brownian noise estimate?

  • Author Contributor

    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'.

  • Author Contributor

    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.

  • Evan Hall mentioned in issue #38 (closed)

    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 Hall
  • Anchal Gupta added 9 commits

    added 9 commits

    Compare with previous version

  • Author Contributor

    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).

  • Anchal Gupta added 61 commits

    added 61 commits

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 5f664c28 - Renamed function and variables to match new coding style of rest of the code

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 2041c387 - Pep8 conformed in my part of code

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • e882cb53 - Made use of eval more secure with whitelists and blacklists

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • c2c86c63 - Added extra required fields for coating_brownian_hong

    Compare with previous version

  • Anchal Gupta added 4 commits

    added 4 commits

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 15c5a4ba - Testing coating_brownian_hong function

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • eeb0603d - Using coating_brownian_hong only when all parameters are available

    Compare with previous version

  • Anchal Gupta added 2 commits

    added 2 commits

    • 2c864274 - String expressions made clear with use of quotes
    • b9434c3b - Using numbers instead of float for loss angle identification

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 66bbb898 - Made mirror transmittance an optional argument

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 7f87f3b7 - Added testing opiton in coating_brownian_hong()

    Compare with previous version

  • Anchal Gupta added 3 commits

    added 3 commits

    • 23ee59da - Removed useless comment
    • 3e836713 - Added Test2 for testing Coating Brownian Code (Hong et al)
    • 438c8645 - Adding cache data for test2

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 5d202deb - Parameters for Hong et al calc are marked optional now.

    Compare with previous version

  • Author Contributor

    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.

  • Anchal Gupta added 1 commit

    added 1 commit

    • 3dfd8d8d - Revert "Added Mac file .DS_Store"

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 7c7ca0a2 - Revert "Added Test2 for testing Coating Brownian Code (Hong et al)"

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 6f708e09 - Revert "Adding cache data for test2"

    Compare with previous version

  • Author Contributor

    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

  • Anchal Gupta added 3 commits

    added 3 commits

    Compare with previous version

  • Evan Hall
  • Evan Hall
  • Evan Hall
  • Evan Hall
  • Anchal Gupta added 1 commit

    added 1 commit

    • 4105bae6 - Using simple power law freq dependence of loss angles

    Compare with previous version

  • Jameson Rollins
  • Jameson Rollins
  • Jameson Rollins
  • Anchal Gupta added 4 commits

    added 4 commits

    • cf54046b - Corrected a typo
    • 7352a7f5 - Added example parameters for Hong et al calculation
    • 23423013 - Created new class CoatingBrownianHong
    • 9ea6b542 - Made loss slope optional parameter like the usual function

    Compare with previous version

  • Anchal Gupta added 2 commits

    added 2 commits

    • 81d40bbb - Corrected CPE initialization typo
    • ffe1e4da - Using nol instead of len(dOpt)

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 6aa5b486 - Changed some comments. Fixed a typo in example params

    Compare with previous version

  • Author Contributor

    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.

  • Anchal Gupta resolved all threads

    resolved all threads

  • Anchal Gupta resolved all threads

    resolved all threads

  • Anchal Gupta added 3 commits

    added 3 commits

    Compare with previous version

  • Author Contributor

    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 Gupta
  • Does @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.

  • Jameson Rollins resolved all threads

    resolved all threads

  • 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.

    • Author Contributor
      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
  • Anchal Gupta resolved all threads

    resolved all threads

  • Anchal Gupta added 42 commits

    added 42 commits

    Compare with previous version

  • Anchal Gupta resolved all threads

    resolved all threads

  • Anchal Gupta added 9 commits

    added 9 commits

    Compare with previous version

  • Anchal Gupta added 30 commits

    added 30 commits

    Compare with previous version

  • Anchal Gupta added 22 commits

    added 22 commits

    Compare with previous version

  • Anchal Gupta added 2 commits

    added 2 commits

    • c0bc5de7 - Made backward compatible with existing IFO paramaters
    • e306330a - Update comments about optional parameters

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 268967b5 - Fixed a small inconsequential typo

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 05c15313 - Made 1.5x faster. Derivatives calculation made 10x faster.

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 5a379d20 - Made 7.8x faster. Removed integration step.

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • eed64da7 - Made 1.5x Faster. Amplitude noise pathway made optional.

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 3348590b - Made S_Bk, S_Sk arrays instead of function.

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 63f2db10 - Replaced existing coating_brownian code with hong code

    Compare with previous version

    • Author Contributor
      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.

  • Anchal Gupta resolved all threads

    resolved all threads

  • Jameson Rollins
  • Jameson Rollins
  • 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
    • Maybe this should be controlled by parameters in the ifo.

    • changed this line in version 44 of the diff

    • Author Contributor

      Transferred the control to ifo.yaml file through a new optional parameter ifo.Materials.Coating.IncCoatBtAmpNoise

    • 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.

    • Author Contributor

      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.

    • Please register or sign in to reply
  • Jameson Rollins
  • Jameson Rollins
  • Anchal Gupta added 1 commit

    added 1 commit

    • 921a78b9 - Corrected references to old names.

    Compare with previous version

  • Anchal Gupta resolved all threads

    resolved all threads

  • Anchal Gupta added 1 commit

    added 1 commit

    • 66694566 - Inclusion of CaotBr Amplitude Noise controlled from ifo.yaml

    Compare with previous version

  • Anchal Gupta resolved all threads

    resolved all threads

  • Anchal Gupta added 1 commit

    added 1 commit

    • 2a0dc62a - Removed old remanant of epsilon funciton.

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 4741c385 - 1.7x faster for PTE=0 and No Amp Calculation

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 5efeed5c - 3.2x faster. Restricted to nL-nH-nL.. structure

    Compare with previous version

  • Anchal Gupta added 1 commit

    added 1 commit

    • 7b6ed3ed - Found recursion relation. Back to getCoatReflAndDer with no additional penalty

    Compare with previous version

  • 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
  • 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
  • Christopher Wipf
  • Christopher Wipf
  • Christopher Wipf
  • Christopher Wipf
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading