Ejemplo n.º 1
0
def supplementary_material1():
    """ SE rate for Silicon to air semi-infinite half spaces."""
    # """Plot leaky and guided SE rates and then sum for randomly orientated dipole."""

    # WIDTH = 412.56  # the number (in pt) latex spits out when typing: \the\linewidth (paper 246, thesis 412.56)
    # FACTOR = 0.8  # the fraction of the width you'd like the figure to occupy

    lam0 = 1540

    # Create structure
    st = SPE()
    st.add_layer(0.05 * lam0, 3.48)
    st.add_layer(50, 2)
    st.add_layer(0.05 * lam0, 1)
    st.set_vacuum_wavelength(lam0)
    st.info()

    # Calculate
    res = st.calc_spe_structure(th_pow=11)
    z = res['z']

    # Convert z into z/lam0 and center
    z = st.calc_z_to_lambda(z)

    # ------- Plots -------
    # Plot data
    fig, ax1 = plt.subplots()
    ax1.plot(z, res['leaky']['avg'], label='Avg')
    ax1.plot(z, res['leaky']['parallel'], '--', label=r'$\parallel$')
    ax1.plot(z, res['leaky']['perpendicular'], '-.', label=r'$\bot$')
    ax1.set_ylabel('$\Gamma / \Gamma_0$')
    ax1.set_xlabel('Position z [$\lambda$]')
    ax1.legend(fontsize='small')
    ax1.set_ylim(0, ax1.get_ylim()[1])
    bounds = ax1.get_ylim()

    # Draw rectangles for the refractive index
    ax2 = ax1.twinx()
    for z0, dz, n in zip(st.d_cumulative, st.d_list, st.n_list):
        z0 = st.calc_z_to_lambda(z0)
        dz = st.calc_z_to_lambda(dz, center=False)
        rect = Rectangle((z0 - dz, 0), dz, n.real, facecolor='c', alpha=0.15)
        ax2.add_patch(rect)  # Note: add to ax1 so that zorder has effect
    ax2.set_ylabel('n')
    ax2.set_ylim(bounds)

    ax1.set_zorder(ax2.get_zorder() + 1)  # put ax1 in front of ax2
    ax1.patch.set_visible(False)  # hide ax1'canvas'

    for zb in st.get_layer_boundaries()[:-1]:
        zb = st.calc_z_to_lambda(zb)
        ax1.axvline(x=zb, color='k', lw=2)

    ax1.set_xlim([min(z), max(z)])

    if SAVE:
        plt.savefig('../Images/SupplementaryMaterial1')
    plt.show()
Ejemplo n.º 2
0
def fig4():
    """ n=3 or n=1 (air) to n=1.5 (Erbium deposition) semi-infinite half spaces.
    Plot the average total spontaneous emission rate of dipoles as a function of
    distance from the interface.
    """
    # Vacuum wavelength
    lam0 = 1550
    # Plotting units
    units = lam0 / (2 * pi)

    # Create plot
    f, ax = plt.subplots()

    for n in [1, 2]:
        print('Evaluating n={:g}'.format(n))
        # Create structure
        st = SPE()
        st.add_layer(4 * units, n)
        st.add_layer(4 * units, 1.5)
        st.set_vacuum_wavelength(lam0)
        st.info()
        # Calculate spontaneous emission over whole structure
        result = st.calc_spe_structure()
        z = result['z']
        # Shift so centre of structure at z=0
        z -= st.get_structure_thickness() / 2
        spe = result['leaky']['avg']
        # Plot spontaneous emission rates
        ax.plot(z / units, spe, label=('n=' + str(n)), lw=2)
        ax.axhline(y=n, xmin=0, xmax=0.4, ls='dotted', color='k', lw=2)

        # Plot internal layer boundaries
        for z in st.get_layer_boundaries()[:-1]:
            # Shift so centre of structure at z=0
            z -= st.get_structure_thickness() / 2
            ax.axvline(z / units, color='k', lw=2)

    ax.axhline(1.5, ls='--', color='k', lw=2)
    ax.set_title(
        'Spontaneous emission rate at boundary for semi-infinite media. RHS n=1.5.'
    )
    ax.set_ylabel('$\Gamma / \Gamma_0$')
    ax.set_xlabel('Position z ($\lambda$/2$\pi$)')
    plt.legend(title='LHS n')
    plt.tight_layout()
    if SAVE:
        plt.savefig('../Images/spe_vs_n.png', dpi=300)
    plt.show()
Ejemplo n.º 3
0
def example3():
    """ SE rate for Silicon to air semi-infinite half spaces."""
    # """Plot leaky and guided SE rates and then sum for randomly orientated dipole."""
    lam0 = 1540

    # Create structure
    st = SPE()
    st.add_layer(0.5 * lam0, 1.45)
    st.add_layer(100, 1.65)
    st.add_layer(500, 1.45)
    st.add_layer(0.5 * lam0, 1)
    st.set_vacuum_wavelength(lam0)
    st.info()

    # Calculate
    res = st.calc_spe_structure(th_pow=11)
    z = res['z']

    # Convert z into z/lam0 and center
    z = st.calc_z_to_lambda(z)

    # ------- Plots -------
    # Plot data
    fig, ax1 = plt.subplots()
    if st.supports_guiding():
        ax1.plot(z, res['leaky']['avg'] + res['guided']['avg'], label='Avg')
        ax1.plot(z,
                 res['leaky']['parallel'] + res['guided']['parallel'],
                 '--',
                 label=r'$\parallel$')
        ax1.plot(z,
                 res['leaky']['perpendicular'] +
                 res['guided']['perpendicular'],
                 '-.',
                 label=r'$\bot$')
    else:
        ax1.plot(z, res['leaky']['avg'], label='Avg')
        ax1.plot(z, res['leaky']['parallel'], '--', label=r'$\parallel$')
        ax1.plot(z, res['leaky']['perpendicular'], '-.', label=r'$\bot$')
    ax1.set_ylabel('$\Gamma / \Gamma_0$')
    ax1.set_xlabel('Position z [$\lambda$]')
    ax1.legend(fontsize='small')
    ax1.set_ylim(0, ax1.get_ylim()[1])
    bounds = ax1.get_ylim()

    # Draw rectangles for the refractive index
    ax2 = ax1.twinx()
    for z0, dz, n in zip(st.d_cumulative, st.d_list, st.n_list):
        z0 = st.calc_z_to_lambda(z0)
        dz = st.calc_z_to_lambda(dz, center=False)
        rect = Rectangle((z0 - dz, 0), dz, n.real, facecolor='c', alpha=0.15)
        ax2.add_patch(rect)  # Note: add to ax1 so that zorder has effect
    ax2.set_ylabel('n')
    ax2.set_ylim(bounds)

    ax1.set_zorder(ax2.get_zorder() + 1)  # put ax1 in front of ax2
    ax1.patch.set_visible(False)  # hide ax1'canvas'

    for zb in st.get_layer_boundaries()[:-1]:
        zb = st.calc_z_to_lambda(zb)
        ax1.axvline(x=zb, color='k', lw=2)

    ax1.set_xlim([min(z), max(z)])

    if SAVE:
        plt.savefig('../Images/Air')
    plt.show()
Ejemplo n.º 4
0
def example1():
    """ SE rate for Silicon to air semi-infinite half spaces."""
    from lifetmm.SPE import SPE
    import pandas as pd
    from lifetmm.Materials import n_1540nm as sample
    """Plot leaky and guided SE rates and then sum for randomly orientated dipole."""
    # Load Sample Data
    df = pd.read_csv('../Data/Screening.csv', index_col='Sample ID')
    n = df.loc[sample]['n']
    d = df.loc[sample]['d'] * 1e3  # in nm not um
    chip = {'Sample ID': sample, 'n': n, 'd': d}

    # Create Structure
    st = SPE()
    st.set_vacuum_wavelength(lam0)
    st.add_layer(d_clad * lam0, n_dict['SiO2'])
    st.add_layer(chip['d'], chip['n'])
    st.add_layer(d_clad * lam0, n_dict['Air'])
    st.info()

    # Calculate
    res = st.calc_spe_structure(th_pow=11)
    z = res['z']
    z = st.calc_z_to_lambda(z)

    # ------- Plots -------
    fig, (ax1, ax2) = plt.subplots(2, 1, sharex='col', sharey='none')
    ax1.plot(z, res['leaky']['avg'])
    if st.supports_guiding():
        ax2.plot(z, res['guided']['avg'])

    ax1.set_ylabel('$\Gamma / \Gamma_0$')
    ax2.set_ylabel('$\Gamma / \Gamma_0$')
    ax2.set_xlabel('Position z ($\lambda$)')
    ax1.set_title('Leaky')
    ax2.set_title('Guided')

    for zb in st.get_layer_boundaries()[:-1]:
        zb = st.calc_z_to_lambda(zb)
        ax1.axvline(x=zb, color='k', lw=2)
        ax2.axvline(x=zb, color='k', lw=2)

    # Draw rectangles for the refractive index
    ax1b = ax1.twinx()
    ax2b = ax2.twinx()
    for z0, dz, n in zip(st.d_cumulative, st.d_list, st.n_list):
        z0 = st.calc_z_to_lambda(z0)
        dz = st.calc_z_to_lambda(dz, center=False)
        rect = Rectangle((z0 - dz, 0), dz, n.real, facecolor='c', alpha=0.2)
        ax1b.add_patch(rect)
        ax1b.set_ylabel('n')
        ax1b.set_ylim(0, 1.5 * max(st.n_list.real))
        rect = Rectangle((z0 - dz, 0), dz, n.real, facecolor='c', alpha=0.2)
        ax2b.add_patch(rect)
        ax2b.set_ylabel('n')
        ax2b.set_ylim(0, 1.5 * max(st.n_list.real))
    ax1.set_zorder(ax1b.get_zorder() + 1)  # put ax1 in front of ax2
    ax1.patch.set_visible(False)  # hide ax1'canvas'
    ax2.set_zorder(ax2b.get_zorder() + 1)  # put ax1 in front of ax2
    ax2.patch.set_visible(False)  # hide ax1'canvas'

    if SAVE:
        plt.savefig('../Images/{}_individual'.format(chip['Sample ID']))

    fig, ax1 = plt.subplots()
    if st.supports_guiding():
        ax1.plot(z, res['leaky']['avg'] + res['guided']['avg'], label='Avg')
    else:
        ax1.plot(z, res['leaky']['avg'], label='Avg')
    ax1.set_ylabel('$\Gamma / \Gamma_0$')
    ax1.set_xlabel('Position z ($\lambda$)')
    ax1.legend()

    # Draw rectangles for the refractive index
    ax2 = ax1.twinx()
    for z0, dz, n in zip(st.d_cumulative, st.d_list, st.n_list):
        z0 = st.calc_z_to_lambda(z0)
        dz = st.calc_z_to_lambda(dz, center=False)
        rect = Rectangle((z0 - dz, 0), dz, n.real, facecolor='c', alpha=0.15)
        ax2.add_patch(rect)  # Note: add to ax1 so that zorder has effect
    ax2.set_ylabel('n')
    ax2.set_ylim(0, 1.5 * max(st.n_list.real))
    ax1.set_zorder(ax2.get_zorder() + 1)  # put ax1 in front of ax2
    ax1.patch.set_visible(False)  # hide ax1'canvas'

    for zb in st.get_layer_boundaries()[:-1]:
        zb = st.calc_z_to_lambda(zb)
        ax1.axvline(x=zb, color='k', lw=2)

    if SAVE:
        plt.savefig('../Images/{}_total'.format(chip['Sample ID']))
    plt.show()
Ejemplo n.º 5
0
def fig7():
    """
    Silicon layer bounded by two semi infinite air claddings.
    """
    d_list = np.arange(start=11, stop=2511, step=5)
    te_guided = []
    tm_guided_p = []
    te_leaky = []
    tm_leaky_p = []
    tm_guided_s = []
    tm_leaky_s = []

    k0 = 2 * np.pi / lam0
    for d in d_list:
        # Create structure
        st = SPE()
        st.add_layer(0, air)
        st.add_layer(d, si)
        st.add_layer(0, air)
        st.set_vacuum_wavelength(lam0)
        st.info()

        # Calculate spontaneous emission of layer
        result = st.calc_spe_structure(th_pow=9)
        z = result['z']
        iloc = int((len(z) - 1) / 2)
        leaky = result['leaky']
        try:
            guided = result['guided']
            te_guided.append(guided['TE'][iloc])
            tm_guided_p.append(guided['TM_p'][iloc])
            tm_guided_s.append(guided['TM_s'][iloc])
        except KeyError:
            te_guided.append(0)
            tm_guided_p.append(0)
            tm_guided_s.append(0)

        te_leaky.append(leaky['TE'][iloc])
        tm_leaky_p.append(leaky['TM_p'][iloc])
        tm_leaky_s.append(leaky['TM_s'][iloc])

    # Convert lists to arrays
    d_list = np.array(d_list)
    te_guided = np.array(te_guided)
    tm_guided_p = np.array(tm_guided_p)
    tm_guided_s = np.array(tm_guided_s)
    te_leaky = np.array(te_leaky)
    tm_leaky_p = np.array(tm_leaky_p)
    tm_leaky_s = np.array(tm_leaky_s)

    # Plot spontaneous emission rates
    fig = plt.figure()
    ax1 = fig.add_subplot(211)
    ax1.plot(d_list * k0, te_guided, label='TE guided')
    ax1.plot(d_list * k0, tm_guided_p, label='TM guided')
    ax1.plot(d_list * k0, te_leaky, 'k', label='TE leaky')
    ax1.plot(d_list * k0, tm_leaky_p, 'k', label='TM leaky')
    total = tm_leaky_p + te_leaky + tm_guided_p + te_guided
    ax1.plot(d_list * k0, total, 'k', label='total')

    ax2 = fig.add_subplot(212)
    ax2.plot(d_list * k0, tm_guided_s, 'k', label='TM guided')
    ax2.plot(d_list * k0, tm_leaky_s * 20, 'k', label='TM leaky')

    # ax1.set_ylim(0, 1.4)
    # ax2.set_ylim(0, 1.4)
    # ax1.set_title('Spontaneous Emission Rate. Silicon (n=3.48) with air cladding (n=1.)')
    ax1.set_ylabel('$\Gamma / \Gamma_0$')
    ax2.set_ylabel('$\Gamma /\Gamma_0$')
    # ax2.set_xlabel('z/$\lambda$')
    ax1.legend(title='Horizontal Dipoles',
               loc='lower right',
               fontsize='medium')
    ax2.legend(title='Vertical Dipoles', loc='lower right', fontsize='medium')
    if SAVE:
        plt.savefig('../Images/creatore_fig6')
    plt.show()