Reports until 19:41, Tuesday 23 January 2024
testbedAI General
nikhil - posted 19:41, Tuesday 23 January 2024 (11482)
Speeding up Finesse3 simulator with lots of higher order modes

To simulate a grossly misaligned interferometer configuration accurately using Finesse3, where misalignments are of the order of a few hundred micro-radians, we need to include a lot of higher-order modes (max_tem=20-40). The scaling between the degree of misalignment and the number of HOMs is quadratic and thus slows down the simulator tremendously. For the testbedAI case, as part of the RL model-based training, we must continuously monitor and update mirror alignments a few thousand times to learn the optimal controller. 


We have two different ways to reduce the simulation time.
(1) Adaptively refine the number of higher-order modes based on the power recovered on the final photodiode. We start with max_tem=15 and update it in units of 5 till we see less than 10% improvement in the recovered power. Note for max_tem ==N, the number of higher order modes = 0.5*(N+1)*(N+2). 


(2) Based on discussions with Kevin and Dan Brown (Adelaide), we figured out that Finesse3 spends a lot of time building and deleting the model per simulation call. So we can sort of hack into Finesse3 and use some undocumented low-level functions to make the simulation object persist between the calls, modify the parameter, and get the results. This trick works if we initially fix the max_tem parameter to a higher number (30 - 40) and then dynamically update the parametes. Max_tem cannot be tuned on the fly within a persisting model.

Another way would be to run many Monte Carlo simulations once, then build a reduced order model (state space) and use that within the RL environment. I will first check the results with (1) and (2).

Time comparison/scaling plot attached. 

Images attached to this report