Photonics

Photonics

Multiple inputs inverse design

    • Ahmed.Bayoumi
      Subscriber

      Hi,

      I would like to ask if it's possible to use inverse design with devices with multiple input arms (i.e. directional coupler). I would like to have two basis files (a basis file where the source is inputted at each arm) being optimized simultaneously, in order to ensure identical response whether the source is at the top or bottom arm, but this results in some errors.


      Another way I thought about it is to enforce topology optimization to search through the symmetric design space only, but I am not sure how I can adjust the code to do so, any suggestions would be appreciated.


      Thanks,


      Ahmed

    • Kyle
      Ansys Employee

      I haven't tried using multiple sources myself, but I believe this should be possible using super-optimization. You will need to define two different lumopt Optimization objects with different base simulation files, one for each source. Then you can combine them together into one optimization (see the Superoptimization section of this page). Is this what you're trying? What kind of errors are you seeing?
    • Ahmed.Bayoumi
      Subscriber


      When I use SuperOptimization to optimize for two monitors (through and cross ports), and use the "+" operator to add two base files (one where the source is in the upper arm, and one where the source is in the lower arm), I get this error:
      Initializing super optimization
      Checking for one forward simulation : One forward simulation is in progress
      Traceback (most recent call last):
      File "/../TopOpt_2D_2FOM.py", line 102, in
      runSim(initial_cond, eps_min, eps_max, x_pos, y_pos, filter_R*1e-9)
      File "/../TopOpt_2D_2FOM.py", line 74, in runSim
      opt_total.run(working_dir = cur_path)
      File "/../../lumericl/releases/R2021_1.4/api/python/lumopt/optimization.py", line 460, in run
      self.initialize(working_dir=working_dir)
      File "/../../lumericl/releases/R2021_1.4/api/python/lumopt/optimization.py", line 119, in initialize
      self.one_forward = check_one_forward_sim(self.optimizations[0])
      File "/../../lumericl/releases/R2021_1.4/api/python/lumopt/optimization.py", line 99, in check_one_forward_sim
      if np.any(self.optimizations[k].wavelengths.asarray() != wavelengths_ref.asarray()):
      AttributeError: 'SuperOptimization' object has no attribute 'wavelengths'

      This is how I did it:

      opt_up_1 = Optimization(base_script=base_script_top , wavelengths = wavelengths, fom=fom1 geometry=geometry, optimizer=optimizer, use_deps=False, hide_fdtd_cad=True plot_history=False, store_all_simulations=False)

      opt_up_2 = Optimization(base_script=base_script_top , wavelengths = wavelengths, fom=fom2 geometry=geometry, optimizer=optimizer, use_deps=False, hide_fdtd_cad=True plot_history=False, store_all_simulations=False)

      opt_bot_1 = Optimization(base_script=base_script_bot ,wavelengths = wavelengths, fom=fom1 geometry=geometry, optimizer=optimizer, use_deps=False, hide_fdtd_cad=True plot_history=False, store_all_simulations=False)

      opt_bot_2 = Optimization(base_script=base_script_bot , wavelengths = wavelengths, fom=fom2 geometry=geometry, optimizer=optimizer, use_deps=False, hide_fdtd_cad=True plot_history=False, store_all_simulations=False)


      opt_up_T=[opt_up_1,opt_up_2]
      opt_bot_T = [opt_bot_1, opt_bot_2]
      weights=[1,1]
      super_opt_up = SuperOptimization(optimizations = opt_up_T, weights = weights)
      super_opt_bot = SuperOptimization(optimizations = opt_bot_T, weights = weights)
      opt_total = super_opt_up + super_opt_bot
      ######## RUN THE OPTIMIZER ########

      opt_total.run
      Thanks
      Ahmed

    • Kyle
      Ansys Employee

      I'm not sure if you can add SuperOptimizations like this. I would try adding the optimizations together all at once without the weights:
      opt_total = opt_up_1 + opt_up_2 + opt_bot_1 + opt_bot_2
      If that works, then you can try adding the weights like this:
      opt=[opt_up_1,opt_up_2, opt_bot_1, opt_bot_2]
      weights=[1,1,1,1]
      super_opt = SuperOptimization(optimizations = opt, weights = weights)

Viewing 3 reply threads
  • You must be logged in to reply to this topic.