Example #1
0
def mcgehee():
    st = TransferMatrix()
    st.add_layer(0, 1.4504)
    st.add_layer(110, 1.7704 + 0.01161j)
    st.add_layer(35, 1.4621 + 0.04426j)
    st.add_layer(220, 2.12 + 0.3166016j)
    st.add_layer(7, 2.095 + 2.3357j)
    st.add_layer(200, 1.20252 + 7.25439j)
    st.add_layer(0, 1.20252 + 7.25439j)

    st.set_vacuum_wavelength(600)
    st.set_polarization('s')
    st.set_field('E')
    st.set_incident_angle(0, units='degrees')
    st.info()

    # Do calculations
    result = st.calc_field_structure()
    z = result['z']
    y = result['field_squared']

    # Plot results
    plt.figure()
    plt.plot(z, y)
    for z in st.get_layer_boundaries()[:-1]:
        plt.axvline(x=z, color='k', lw=2)
    plt.xlabel('Position in Device (nm)')
    plt.ylabel('Normalized |E|$^2$ Intensity ($|E(z)/E_0(0)|^2$)')
    if SAVE:
        plt.savefig('../Images/McGehee structure.png', dpi=300)
    plt.show()
Example #2
0
def guiding_electric_field():
    # Create structure
    st = TransferMatrix()
    st.set_vacuum_wavelength(lam0)
    st.add_layer(1.5 * lam0, air)
    st.add_layer(lam0, si)
    st.add_layer(1.5 * lam0, air)
    st.info()

    st.set_polarization('TM')
    st.set_field('H')
    st.set_leaky_or_guiding('guiding')
    alpha = st.calc_guided_modes(normalised=True)
    plt.figure()
    for i, a in enumerate(alpha):
        st.set_guided_mode(a)
        result = st.calc_field_structure()
        z = result['z']
        # z = st.calc_z_to_lambda(z)
        E = result['field']
        # Normalise fields
        # E /= max(E)
        plt.plot(z, abs(E) ** 2, label=i)

    for z in st.get_layer_boundaries()[:-1]:
        # z = st.calc_z_to_lambda(z)
        plt.axvline(x=z, color='k', lw=1, ls='--')
    plt.legend(title='Mode index')
    if SAVE:
        plt.savefig('../Images/guided fields.png', dpi=300)
    plt.show()