Needs Optimization and MC tool
This will require first #12
With some of the more advanced studies of filtercavity performance we need the ability to scan around in parameter space and choose the optimal cavity configuration given nominal installs of the system.
To scan around needs some function interfaces, to MC around requires some configuration parameters such as distributions, and to optimize requires an easily parametrizable optimizer.
Luckily the code is already structured around a hierarchical configuration. I will create a branch with a tool that takes a YAML config that
a) inherits nominal settings (first-try parameters for the optimizer) b) replaces any numbers like for filter cavities
Squeezer:
Inputs:
- type: 'filtercavity'
L_m: 300 # cavity length
Te: 1e-6 # end mirror trasmission
Lrt: 60e-6 # round-trip loss in the cavity
Rot: 0 # phase rotation after cavity
fdetune_Hz: -45.78 # detuning [Hz]
Ti: 1.2e-3 # input mirror trasmission [Power]
mode_matching_loss: .00
mode_matching_phase_deg: .00
#TODO
RMS_length_m: 1e-18 # Length noise RMS << bandwidth (for equiv phase noise)
with an overlay such as
Squeezer:
Inputs:
- type: 'filtercavity'
fdetune_Hz:
parameter: 'optimize'
upperbound: 300
lowerbound: 0
mode_matching_phase_deg:
parameter: 'MC-uniform'
upperbound: 0
lowerbound: 180
and so on for squeezing parameters (like sqz-amplitude and sqz-phase, although those already have a much faster optimizer).
Now the tools will scan for parameters, generate bookkeeping lists, update the ifo struct with MC samples, and run an optimizer by updating other ifo-struct parameters. It will be a very slow way to optimize, but the MC sampler can be multiprocess'ed. The optimizer will probably be a simple one like Nelder-Mead simplex crawl if it can be made to use bounds. The FOM to optimize over should also be configurable, and should be able to take external noise plots such as existing controls noise.
The tool will just be some loops and bookkeeping, shouldn't take long to write and I'm sure others will find it useful.