def ac_mode_freqs(coat_y):
    print('Commencing mode calculation for coat_y = %f'% coat_y)

    wguide = objects.Struct(unitcell_x,inc_a_x,unitcell_y,inc_a_y,inc_shape,
                            slab_a_x=slab_a_x, slab_a_y=slab_a_y, inc_b_x=inc_b_x,
                            coat_y=coat_y,
                            material_bkg=materials.Vacuum,            # background
                            material_a=materials.As2S3_2017_Morrison, # slot
                            material_b=materials.SiO2_2013_Laude,     # slab
                            material_c=materials.Si_2016_Smith,       # walls of slot
                            material_d=materials.SiO2_2013_Laude,     # coating
                            lc_bkg=5, lc2=2000.0, lc3=1000.0)

    # Expected effective index of fundamental guided mode.
    n_eff = wguide.material_a.n-0.1

    # Calculate Electromagnetic modes.
    sim_EM_pump = wguide.calc_EM_modes(num_modes_EM_pump, wl_nm, n_eff=n_eff)
    sim_EM_Stokes = mode_calcs.bkwd_Stokes_modes(sim_EM_pump)

    k_AC = np.real(sim_EM_pump.Eig_values[EM_ival_pump] - sim_EM_Stokes.Eig_values[EM_ival_Stokes])

    shift_Hz = 4e9

    # Calculate Acoustic modes.
    sim_AC = wguide.calc_AC_modes(num_modes_AC, k_AC, EM_sim=sim_EM_pump, shift_Hz=shift_Hz)

    # plotting.plt_mode_fields(sim_AC, xlim_min=0.4, xlim_max=0.4, 
    #                           ylim_min=0.7, ylim_max=0.0, EM_AC='AC', 
    #                           prefix_str=prefix_str, suffix_str='_%i' %int(coat_y))

    set_q_factor = 1000.

    SBS_gain, SBS_gain_PE, SBS_gain_MB, linewidth_Hz, Q_factors, alpha = integration.gain_and_qs(
        sim_EM_pump, sim_EM_Stokes, sim_AC, k_AC,
        EM_ival_pump=EM_ival_pump, EM_ival_Stokes=EM_ival_Stokes, AC_ival=AC_ival, fixed_Q=set_q_factor)

    # Construct the SBS gain spectrum, built from Lorentzian peaks of the individual modes.
    freq_min = 4 # np.real(sim_AC.Eig_values[0])*1e-9 - 2  # GHz
    freq_max = 14 # np.real(sim_AC.Eig_values[-1])*1e-9 + 2  # GHz
    
    plotting.gain_spectra(sim_AC, SBS_gain, SBS_gain_PE, SBS_gain_MB, linewidth_Hz, k_AC,
        EM_ival_pump, EM_ival_Stokes, AC_ival, freq_min=freq_min, freq_max=freq_max, 
        prefix_str=prefix_str, suffix_str='_%i' %int(coat_y))

    # Convert to GHz
    mode_freqs = sim_AC.Eig_values*1.e-9
    # Clear memory
    wguide = sim_EM_pump = sim_EM_Stokes = sim_AC = None
    SBS_gain = SBS_gain_PE = SBS_gain_MB = linewidth_Hz = Q_factors = alpha = None

    print('Completed mode calculation for coating coat_y = %f'% coat_y)

    # Return the frequencies and simulated k_ac value in a list
    return mode_freqs
def modes_n_gain(inc_a_x):
    inc_a_y = inc_a_x
    # Use all specified parameters to create a waveguide object.
    wguide = objects.Struct(unitcell_x,inc_a_x,unitcell_y,inc_a_y,inc_shape,
                            material_bkg=materials.materials_dict["Vacuum"],
                            material_a=materials.materials_dict["SiO2_2016_Smith"],
                            lc_bkg=1, lc_refine_1=400.0, lc_refine_2=50.0)

    sim_EM_pump = wguide.calc_EM_modes(num_modes_EM_pump, wl_nm, n_eff=n_eff)
    sim_EM_Stokes = mode_calcs.bkwd_Stokes_modes(sim_EM_pump)
    k_AC = np.real(sim_EM_pump.Eig_values[EM_ival_pump] - sim_EM_Stokes.Eig_values[EM_ival_Stokes])
    shift_Hz = 4e9
    sim_AC = wguide.calc_AC_modes(num_modes_AC, k_AC, EM_sim=sim_EM_pump, shift_Hz=shift_Hz)

    set_q_factor = 600.
    SBS_gain, SBS_gain_PE, SBS_gain_MB, linewidth_Hz, Q_factors, alpha = integration.gain_and_qs(
        sim_EM_pump, sim_EM_Stokes, sim_AC, k_AC,
        EM_ival_pump=EM_ival_pump, EM_ival_Stokes=EM_ival_Stokes, AC_ival=AC_ival)#, fixed_Q=set_q_factor)

    interp_values = plotting.gain_spectra(sim_AC, SBS_gain, SBS_gain_PE, SBS_gain_MB, linewidth_Hz, k_AC,
        EM_ival_pump, EM_ival_Stokes, AC_ival, freq_min, freq_max, num_interp_pts=num_interp_pts, 
        save_fig=False, suffix_str='%i' %int(inc_a_x))

    # Clear memory
    wguide = sim_EM_pump = sim_EM_Stokes = sim_AC = None
    SBS_gain = SBS_gain_PE = SBS_gain_MB = linewidth_Hz = Q_factors = alpha = None

    return interp_values
Example #3
0
# Calculate the acoustic loss from our fields.
# Calculate interaction integrals and SBS gain for PE and MB effects combined,
# as well as just for PE, and just for MB.
SBS_gain, SBS_gain_PE, SBS_gain_MB, linewidth_Hz, Q_factors, alpha = integration.gain_and_qs(
    sim_EM_pump,
    sim_EM_Stokes,
    sim_AC,
    k_AC,
    EM_ival_pump=EM_ival_pump,
    EM_ival_Stokes=EM_ival_Stokes,
    AC_ival=AC_ival)

# Construct the SBS gain spectrum, built from Lorentzian peaks of the individual modes.
freq_min = np.real(sim_AC.Eig_values[0]) * 1e-9 - 2  # GHz
freq_max = np.real(sim_AC.Eig_values[-1]) * 1e-9 + 2  # GHz
plotting.gain_spectra(sim_AC,
                      SBS_gain,
                      SBS_gain_PE,
                      SBS_gain_MB,
                      linewidth_Hz,
                      k_AC,
                      EM_ival_pump,
                      EM_ival_Stokes,
                      AC_ival,
                      freq_min=freq_min,
                      freq_max=freq_max,
                      prefix_str=prefix_str)

end = time.time()
print("\n Simulation time (sec.)", (end - start))
    sim_AC,
    k_AC,
    EM_ival_pump=EM_ival_pump,
    EM_ival_Stokes=EM_ival_Stokes,
    AC_ival=AC_ival)

# Construct the SBS gain spectrum, built from Lorentzian peaks of the individual modes.
freq_min = 4  # GHz
freq_max = 13  # GHz
plotting.gain_spectra(sim_AC,
                      SBS_gain,
                      SBS_gain_PE,
                      SBS_gain_MB,
                      linewidth_Hz,
                      k_AC,
                      EM_ival_pump,
                      EM_ival_Stokes,
                      AC_ival,
                      freq_min=freq_min,
                      freq_max=freq_max,
                      semilogy=True,
                      prefix_str=prefix_str,
                      pdf_png='png')

# Construct the SBS gain spectrum, built from Lorentzian peaks of the individual modes.
freq_min = 9.5  # GHz
freq_max = 10  # GHz
plotting.gain_spectra(sim_AC,
                      SBS_gain,
                      SBS_gain_PE,
                      SBS_gain_MB,
                      linewidth_Hz,
    k_AC,
    EM_ival_pump=EM_ival_pump,
    EM_ival_Stokes=EM_ival_Stokes,
    AC_ival=AC_ival,
    fixed_Q=set_q_factor)

# Construct the SBS gain spectrum, built from Lorentzian peaks of the individual modes.
freq_min = 5  # GHz
freq_max = 12  # GHz
plotting.gain_spectra(sim_AC,
                      SBS_gain,
                      SBS_gain_PE,
                      SBS_gain_MB,
                      linewidth_Hz,
                      k_AC,
                      EM_ival_pump,
                      EM_ival_Stokes,
                      AC_ival,
                      freq_min=freq_min,
                      freq_max=freq_max,
                      prefix_str=prefix_str,
                      pdf_png='png')

# Construct the SBS gain spectrum, built from Lorentzian peaks of the individual modes.
freq_min = 5.86  # GHz
freq_max = 5.9  # GHz
plotting.gain_spectra(sim_AC,
                      SBS_gain,
                      SBS_gain_PE,
                      SBS_gain_MB,
                      linewidth_Hz,