def tutorial_example_2Dphasematching():
    from pynumpm import waveguide, utils, phasematching
    import matplotlib.pyplot as plt

    length = 25e-3  # length in m
    dz = 100e-6  # discretization in m

    nte, ntm = custom_sellmeier()
    T0 = 25

    poling_period = utils.calculate_poling_period(1.55e-6, 0, 0.55e-6, nte(T0),
                                                  ntm(T0), nte(T0), 1)
    print("Poling period: ", poling_period)
    z = np.arange(0, length + dz, dz)
    thiswaveguide = waveguide.RealisticWaveguide(
        z=z,
        poling_period=poling_period,
        nominal_parameter=T0,
        nominal_parameter_name=r"WG temperature[$^\circ$C]")
    thiswaveguide.create_noisy_waveguide(noise_profile="1/f",
                                         noise_amplitude=1.0)
    thisprocess = phasematching.Phasematching2D(waveguide=thiswaveguide,
                                                n_red=nte,
                                                n_green=ntm,
                                                n_blue=nte)

    thisprocess.red_wavelength = np.linspace(1.50e-6, 1.6e-6, 100)
    thisprocess.blue_wavelength = np.linspace(0.549e-6, 0.551e-6, 1000)
    thisprocess.calculate_phasematching()
    thisprocess.plot()
    plt.show()
def example_1D_SFG():
    from pynumpm import waveguide, phasematching, utils

    length = 30e-3  # length in m
    dz = 50e-6  # discretization in m
    z = np.arange(0, length + dz, dz)

    nte, ntm = custom_sellmeier()

    poling_period = utils.calculate_poling_period(1.55e-6, 0, 0.55e-6, nte(20),
                                                  ntm(20), nte(20), 1)
    print("Poling period: ", poling_period)

    thiswaveguide = waveguide.RealisticWaveguide(
        z=z,
        poling_period=poling_period,
        nominal_parameter=20,
        nominal_parameter_name=r"Temperature [deg]")
    thiswaveguide.create_noisy_waveguide(noise_profile="1/f",
                                         noise_amplitude=0.1)
    thiswaveguide.plot_waveguide_properties()
    thisprocess = phasematching.Phasematching1D(waveguide=thiswaveguide,
                                                n_red=nte,
                                                n_green=ntm,
                                                n_blue=nte)
    wl_red = np.linspace(1.50, 1.6, 1000) * 1e-6
    thisprocess.red_wavelength = wl_red
    thisprocess.blue_wavelength = 0.55e-6
    thisprocess.set_nonlinearity_profile(profile_type="constant",
                                         first_order_coefficient=False)
    phi = thisprocess.calculate_phasematching()
    thisprocess.plot()
    plt.show()
Beispiel #3
0
def test_simple_phasematching():
    ny, nz = custom_sellmeier()
    thiswaveguide = waveguide.Waveguide(length=25e-3)
    deltabeta = np.linspace(-5000, 5000, 1000)
    thisprocess = phasematching.SimplePhasematchingDeltaBeta(
        waveguide=thiswaveguide)
    thisprocess.deltabeta = deltabeta
    thisprocess.calculate_phasematching(normalized=False)
    print(thisprocess.calculate_integral())
    thisprocess.plot()
    print(utils.bandwidth(thisprocess.deltabeta, abs(thisprocess.phi)**2))

    thisprocess2 = phasematching.SimplePhasematchingDeltaBeta(
        waveguide=thiswaveguide)
    thisprocess2.deltabeta = deltabeta
    thisprocess2.calculate_phasematching()
    print(thisprocess2.calculate_integral())
    thisprocess2.plot()

    poling_period = utils.calculate_poling_period(1550e-9, 0, 532e-9, ny(150),
                                                  nz(150), ny(150))
    thiswaveguide2 = waveguide.Waveguide(length=25e-3,
                                         poling_period=poling_period)
    thisprocess3 = phasematching.SimplePhasematching1D(
        waveguide=thiswaveguide2,
        n_red=ny(150),
        n_green=nz(150),
        n_blue=ny(150))
    thisprocess3.red_wavelength = np.linspace(1530, 1570, 1000) * 1e-9
    thisprocess3.blue_wavelength = 532e-9
    thisprocess3.calculate_phasematching()
    thisprocess3.plot()
    print(
        utils.bandwidth(thisprocess3.red_wavelength,
                        abs(thisprocess3.phi)**2))

    thisprocess4 = phasematching.SimplePhasematching2D(
        waveguide=thiswaveguide2,
        n_red=ny(150),
        n_green=nz(150),
        n_blue=ny(150))
    thisprocess4.red_wavelength = np.linspace(1530, 1570, 1000) * 1e-9
    thisprocess4.blue_wavelength = np.linspace(530, 534, 200) * 1e-9
    thisprocess4.calculate_phasematching()
    thisprocess4.plot()
    thisprocess4.plot_deltabeta_contour()

    plt.show()
Beispiel #4
0
def test_phasematching():
    ny, nz = custom_sellmeier()
    z = np.linspace(0, 25, 1000) * 1e-3

    thiswaveguide = waveguide.RealisticWaveguide(
        z=z, nominal_parameter_name=r"$\Delta\beta$", nominal_parameter=0)
    thiswaveguide.create_noisy_waveguide(noise_profile="1/f",
                                         noise_amplitude=1000)
    thiswaveguide.plot_waveguide_properties()

    thisprocess = phasematching.PhasematchingDeltaBeta(waveguide=thiswaveguide)
    thisprocess.deltabeta = np.linspace(-5000, 5000, 1000)
    thisprocess.calculate_phasematching(normalized=True)
    print(thisprocess.calculate_integral())
    thisprocess.plot()

    poling_period = utils.calculate_poling_period(1550e-9, 0, 532e-9, ny(150),
                                                  nz(150), ny(150))
    thiswaveguide2 = waveguide.RealisticWaveguide(
        z=z,
        poling_period=poling_period,
        nominal_parameter_name=r"$T$",
        nominal_parameter=150)
    thiswaveguide2.create_noisy_waveguide(noise_profile="1/f",
                                          noise_amplitude=5)

    thisprocess2 = phasematching.Phasematching1D(waveguide=thiswaveguide2,
                                                 n_red=ny,
                                                 n_green=nz,
                                                 n_blue=ny)
    thisprocess2.red_wavelength = np.linspace(1530, 1570, 1000) * 1e-9
    thisprocess2.blue_wavelength = 532e-9
    thisprocess2.calculate_phasematching()
    thisprocess2.plot()

    thisprocess3 = phasematching.Phasematching2D(waveguide=thiswaveguide2,
                                                 n_red=ny,
                                                 n_green=nz,
                                                 n_blue=ny)
    thisprocess3.red_wavelength = np.linspace(1530, 1570, 200) * 1e-9
    thisprocess3.blue_wavelength = np.linspace(530, 534, 200) * 1e-9
    thisprocess3.calculate_phasematching()
    thisprocess3.plot()

    plt.show()
def tutorial_example_1Dphasematching():
    from pynumpm import waveguide, phasematching, utils
    import matplotlib.pyplot as plt

    length = 30e-3  # length in m
    dz = 1e-6  # discretization in m
    z = np.arange(0, length + dz, dz)

    # Define the dispersion relations
    # n = n(parameter)(wavelength)
    nte, ntm = custom_sellmeier()

    # Define the process wavelengths
    red_wl0 = 1550e-9
    red_span = 20e-9
    green_wl0 = 890e-9

    # Calculate the poling period
    poling_period = utils.calculate_poling_period(red_wl0, green_wl0, 0,
                                                  nte(40), ntm(40), nte(40), 1)
    print("The poling period is poling period: ", poling_period)

    # Define the waveguide
    thiswaveguide = waveguide.RealisticWaveguide(
        z=z,
        poling_period=poling_period,
        nominal_parameter=40,
        nominal_parameter_name=r"Waveguide temperature [$^\circ$ C]")
    thiswaveguide.create_noisy_waveguide(noise_profile="1/f",
                                         noise_amplitude=3)
    thiswaveguide.plot_waveguide_properties()

    # Calculate the phasematching
    thisprocess = phasematching.Phasematching1D(waveguide=thiswaveguide,
                                                n_red=nte,
                                                n_green=ntm,
                                                n_blue=nte)
    thisprocess.red_wavelength = np.linspace(red_wl0 - red_span / 2,
                                             red_wl0 + red_span / 2, 1000)
    thisprocess.green_wavelength = green_wl0
    phi = thisprocess.calculate_phasematching()
    thisprocess.plot(phase=True)
    plt.show()
def example_jsa1():
    from pynumpm import waveguide, utils, phasematching, jsa

    length = 5e-3  # length in m

    nte, ntm = custom_sellmeier()
    T0 = 25

    poling_period = utils.calculate_poling_period(1.55e-6, 0, 0.55e-6, nte(T0),
                                                  ntm(T0), nte(T0), 1)
    print("Poling period: ", poling_period)
    z = np.array([0, length])
    thiswaveguide = waveguide.Waveguide(length=length,
                                        poling_period=poling_period)
    thisprocess = phasematching.SimplePhasematching2D(waveguide=thiswaveguide,
                                                      n_red=nte(T0),
                                                      n_green=ntm(T0),
                                                      n_blue=nte(T0))

    thisprocess.red_wavelength = np.linspace(1.50e-6, 1.6e-6, 500)
    thisprocess.blue_wavelength = np.linspace(0.549e-6, 0.551e-6, 1000)
    thisprocess.calculate_phasematching()
    thisprocess.plot()

    # the process is an SFG process
    thispump = jsa.Pump(process=jsa.Process.SFG)
    thispump.wavelength1 = thisprocess.wavelength1
    thispump.wavelength2 = thisprocess.wavelength2
    # set the bandwidth to 1nm
    thispump.pump_width = 1e-9
    thispump.plot()

    # load the pump and the phasematching to calculate the JSA
    thisjsa = jsa.JSA(phasematching=thisprocess, pump=thispump)
    thisjsa.calculate_JSA()
    thisjsa.calculate_schmidt_decomposition()
    thisjsa.plot_schmidt_coefficients(ncoeff=20)
    thisjsa.plot(plot_pump=True)
    plt.show()
def tutorial_example_simple2dphasematching():
    NY, NZ = custom_sellmeier()
    nTE = lambda wl: NY(30)(wl)
    nTM = lambda wl: NZ(30)(wl)

    from pynumpm import waveguide, phasematching, utils
    import matplotlib.pyplot as plt

    length = 20e-3
    red_wl0 = 1550e-9
    red_span = 10e-9
    green_wl0 = 1550e-9
    green_span = 10e-9
    # Use the utilities module to calculate the poling period of the process
    poling_period = utils.calculate_poling_period(red_wl0, green_wl0, 0, nTE,
                                                  nTM, nTE)
    print("The correct poling period is {0}".format(poling_period))

    # Define the waveguide
    thiswaveguide = waveguide.Waveguide(length=length,
                                        poling_period=poling_period)

    # Define the phasematching process
    thisprocess = phasematching.SimplePhasematching2D(waveguide=thiswaveguide,
                                                      n_red=nTE,
                                                      n_green=nTM,
                                                      n_blue=nTE,
                                                      order=1)
    # Define the range for the scanning wavelength
    thisprocess.red_wavelength = np.linspace(red_wl0 - red_span / 2,
                                             red_wl0 + red_span / 2, 1000)
    thisprocess.green_wavelength = np.linspace(green_wl0 - green_span / 2,
                                               green_wl0 + green_span / 2,
                                               1000)
    # Calculate the phasematching spectrum
    thisprocess.calculate_phasematching()
    # Plot
    thisprocess.plot()
    plt.show()