예제 #1
0
             **args)
    ax9.set_ylabel('$\\chi_{DC}$ (MHz)')
    ax8.plot(SWP, [r[ID][1, 2] for r in RES],
             label='$\\chi_{BC}$',
             c='r',
             **args)
    ax8.set_ylabel('$\\chi_{BC}$ (MHz)')
    ax9.set_xlabel(swpvar)
    ax7.set_title('cross-Kerr')
    #ax7.axhspan(85,150,  alpha =0.4, color= 'b')
    ax8.axhspan(5.5, 6.5, alpha=0.4, color='b')
    ax9.axhline(0.5, alpha=0.4, color='b')
    fig.tight_layout()
#%%
if 0:
    variation = '0'
    pJ_method = 'J_surf_mag'
    #pJ_mj_series = bbp.calc_Pjs_from_I_for_mode(variation, bbp.U_H,bbp.U_E, bbp.LJs, junc_rects, junc_lens, method = pJ_method) # to be implemented
    res = bbp.calc_avg_current_J_surf_mag(variation, junc_rects[0],
                                          junc_lens[0])

if 0:  # for debug
    variation = '0'
    junc_rect = 'juncV'
    print_color(' Setup: ' + bbp.setup.name)
    lv = bbp.get_lv(variation)
    calc = CalcObject([], bbp.setup)
    calc = calc.getQty("Jsurf").mag().integrate_surf(name=junc_rect)

    #bbp.calc_avg_current_J_surf_mag('0','juncV',1)
예제 #2
0
파일: main.py 프로젝트: zlatkom/pyHFSS
#%%==============================================================================
#     Plot results for sweep
#==============================================================================
if 1:
    swpvar='LJ'    
    use_1st_order = True  # use 1st O PT  to identify correct eigenvectors in ND
    RES = []; SWP = [];
    for key, s in sol.iteritems():     
        print '\r Analyzing ', key,
        try:
            varz  = hfss_variables[key]
            SWP  += [ ureg.Quantity(varz['_'+swpvar]).magnitude ]  
            RES  += [ eBBQ_Pmj_to_H_params(s, meta_datas[key], cos_trunc = cos_trunc, fock_trunc = fock_trunc, use_1st_order = False) ]
        except Exception as e:
            print_color(" !ERROR %s" % e)
    import matplotlib.gridspec as gridspec;
    #%%
    fig = plt.figure(num = 1, figsize=(19,5)) 
    gs1 = gridspec.GridSpec(1, 4, width_ratios=[2,2,2,1]); gs1.update(left=0.05, right=0.98)  # wspace=0.05
    ax1 = plt.subplot(gs1[0]); ax2 = plt.subplot(gs1[1]); ax3 = plt.subplot(gs1[2]); ax3b = plt.subplot(gs1[3])
    
    ax = ax1; ID = 1; 
    args = {'lw':0,'marker':'o','ms':5}
    ax.plot(SWP, [r[ID][0,1]for r in RES], label = '$\\chi_{DB}$', **args)
    ax.plot(SWP, [r[ID][0,2]for r in RES], label = '$\\chi_{DC}$', **args)
    ax.plot(SWP, [r[ID][1,2]for r in RES], label = '$\\chi_{BC}$', **args)
    ax.set_ylim([0.01,10**2]); ax.set_xlabel(swpvar); ax.set_title('cross-Kerr'); ax.set_ylabel('$\\chi$ (MHz)'); ax.legend(loc = 0)
    ax.set_yscale('log');   ax.set_ylim(0.1,100)    
    ax1.axhspan(5.5,6.5, alpha =0.4, color= 'b')
    ax1.axhline(0.5, alpha =0.4, color= 'b')
예제 #3
0
파일: load_data.py 프로젝트: zlatkom/pyHFSS
    hfss_variables = bba.hfss_variables
    sols           = bba.sols
    meta_datas     = bba.meta_data


#%% 
if analyze_BBQ:  
    RES = []; SWP = [];
    for key, s in sols.iteritems():
        print '\r Analyzing ', key,
        try:
            varz  = hfss_variables[key]
            SWP  += [ ureg.Quantity(varz['_'+swp_var]).magnitude ]  
            RES  += [ eBBQ_Pmj_to_H_params(s, meta_datas[key], cos_trunc = cos_trunc, fock_trunc = fock_trunc) ]
        except Exception as e:
            print_color(" !ERROR %s" % e)
#%%==============================================================================
# Plot Chis
#==============================================================================
if plot_Fs:
    #Fs  = bba.get_Fs(swp_var=swp_var)
    Fs = []
    for i in range(len(RES)):
        Fs.append(RES[i][9])
        
    plt.plot(sorted(SWP), np.array(Fs).transpose()[0]*10**-9, label='D mode freq', marker = 'o', lw =1)
    plt.plot(sorted(SWP), np.array(Fs).transpose()[1]*10**-9, label='B mode freq', marker = 'o', lw =1)
    
    plt.title('D and B mode frequencies (nonlinear)');
    plt.xlabel(swp_var);
    plt.ylabel('F (GHz)');
예제 #4
0
파일: main.py 프로젝트: eflurin/pyHFSS
    ax.set_ylabel('Participation'); ax.legend(loc = 0)
    ax = ax5
    ax.plot(SWP, [r[ID][0,1] for r in RES], label = '$P_{DV}$', **args)
    ax.plot(SWP, [r[ID][1,0] for r in RES], label = '$P_{BH}$', **args)
    ax.set_xlabel(swpvar); ax.set_ylabel('Participation'); ax.legend(loc = 0)
    ax = ax6
    ax.plot(SWP, [r[ID][2,0] for r in RES], label = '$P_{CH}$', **args)
    ax.plot(SWP, [r[ID][2,1] for r in RES], label = '$P_{CV}$', **args)
    ax.set_yscale('log'); ax.set_xlabel(swpvar); ax.set_ylabel('Participation'); ax.legend(loc = 0)
  
    ax   = plt.subplot(gs1[1,0]); ID =1;
    chiDC = np.array([r[ID][0,2] for r in RES])
    chiDB = np.array([r[ID][0,1] for r in RES])
    #print_color("chiDB/chiDC ratios:"); print  chiDB/chiDC
    ax.plot(SWP, chiDB/chiDC, **args); ax.locator_params(nbins=4); ax.grid(); ax.set_ylabel('$\\chi_{DB}/\\chi_{DC}$')
    ax.set_xlabel(swpvar);
#%%
if 0: 
    variation = '0';  pJ_method = 'J_surf_mag';
    #pJ_mj_series = bbp.calc_Pjs_from_I_for_mode(variation, bbp.U_H,bbp.U_E, bbp.LJs, junc_rects, junc_lens, method = pJ_method) # to be implemented          
    res = bbp.calc_avg_current_J_surf_mag(variation,junc_rects[0], junc_lens[0])
    
if 0: # for debug 
    variation = '0'; junc_rect = 'juncV';
    print_color(' Setup: ' + bbp.setup.name)
    lv = bbp.get_lv(variation)
    calc = CalcObject([],bbp.setup)
    calc = calc.getQty("Jsurf").mag().integrate_surf(name = junc_rect)
 
    #bbp.calc_avg_current_J_surf_mag('0','juncV',1)
예제 #5
0
if 1:    
    proj_name    = r'mesh_analysis_project' 
    project_path = 'C:\\Users\rslqulab\Desktop\Lysander\\'
    app, desktop, project = load_HFSS_project(proj_name, project_path)
    design       = project.get_design("20pass_7k_seed- 11. SHANTANU FAB SM22 Col 1 Row 9 Measured [May 6 2016]") 
    
    junc_rects    = ['juncV',     'juncH'] 
    junc_lines    = ['juncV_line','juncH_line'] 
    junc_LJ_names = ['LJ1', 'LJ2'];
    junc_lens     = [0.0001]*2                                   
    
    setup_names   = design.get_setup_names()
    setup         = design.get_setup(setup_names[0])
    setup.delta_f = '0.00001'                                       # set max delta f convergence 
    ### Set min # passes = 1 & min conv passes = 1
    # wrap in function  / class eventually 
    #delte all data?
    optimtrc_nms  = design._optimetrics.GetSetupNames()
    optimtrc_nms  = [optimtrc_nms[i] for i in  range(optimtrc_nms.Count)]
    #assert len(optimtrc_nms) == 1, "THis was made for optimetric sweeps which have only 1 optimetric swep "
    optimtrc_name = optimtrc_nms[0]  #'scale_factor_tiny'          # optimetrics sweep  -- doesnt have to be 
    
    for max_passes in range(1, 20, 2):
        print_color("Running optimetric sweep '%s' up to %d passes" % (optimtrc_name, max_passes))
        setup.passes  = max_passes
        design._optimetrics.SolveSetup(optimtrc_name)        # wait for the optimetrics to finish  --> would be nice to add a timer here and call asynch
        
        bbp = bbq.Bbq(project, design, append_analysis=False)
        bbp.do_eBBQ(junc_rect=junc_rects, junc_lines = junc_lines,  junc_len = junc_lens, junc_LJ_var_name = junc_LJ_names, save_mesh_stats=True)
        bba = bbp.bbq_analysis