Waveguide module

With this module you can easily describe waveguide profiles to be fed in the pynumpm.phasematching module.

Two classes are available:

Waveguide

class pynumpm.waveguide.Waveguide(length: float, poling_period: float = inf)[source]

Base class for the description of a waveguide object. Initialize the object providing its length (in meter) and, if necessary, its poling period.

Parameters:
  • length (float) – Length of the waveguide [meter].
  • poling_period (float) – Poling period of the structure, [meter]. Default: +numpy.infty

The following block of code initialises a 10mm-long waveguide with a poling period of 16 \(\mu\mathrm{m}\):

thiswaveguide = waveguide.Waveguide(length = 10e-3,
                                    poling_period = 16e-6)
poling_period

The poling period of the structure, in m.

poling_period_um

The poling period of the structure, in \(\mu\mathrm{m}\).

length

The length of the structure, in m.

RealisticWaveguide

class pynumpm.waveguide.RealisticWaveguide(z: numpy.ndarray, poling_period: float = inf, nominal_parameter: float = 1.0, nominal_parameter_name: str = '')[source]

Class for the description of waveguides with variable profiles. It can generate noisy profiles (via the functions in the pynumpm.noise module) and it can load user-defined profiles and/or poling structures (they must be consistent with the user specified mesh).

Initialize the waveguide by providing a z-mesh,a poling and the nominal parameter of the profile. This will automatically generate a uniform profile with the specified nominal parameter.

Parameters:
  • z (numpy.ndarray) – linearly spaced space mesh [meter].
  • poling_period (float) – poling period of the structure [meter].
  • nominal_parameter (float) – nominal parameter of the structure [variable units depending on the Sellmeier used].
  • nominal_parameter_name (string) – (optional) name of the nominal parameter (used for the axes). LaTeX syntax is allowed.

The following block of code initialises and plots the profile of a 15mm-long, 7 \(\mu\mathrm{m}\)-wide waveguide with a poling period of 9 \(\mu\mathrm{m}\). The waveguide is discretized over a z-mesh with steps of 10 \(\mu\mathrm{m}\). The waveguide width is characeterised by a noise with a 1/f spectrum with amplitude 0.2 \(\mu\mathrm{m}\).

z = np.arange(0, 15e-3, 10e-6)
thiswaveguide = waveguide.RealisticWaveguide(z = z,
                                             poling_period = 9e-6,
                                             nominal_parameter = 7e-6,
                                             nominal_parameter_name = "Width")
thiswaveguide.create_noisy_waveguide(noise_profile = "1/f",
                                     noise_amplitude = 0.2)
thiswaveguide.plot_waveguide_properties()
z

Array containing the z-mesh of the structure.

dz

Resolution of the z-mesh.

profile

Waveguide profile (array). Array containing the values of the waveguide profile to be simulated (e.g., the waveguide width or temperature profile).

nominal_parameter_name

Name of the nominal fabrication parameter.

poling_structure_set

Boolean to describe if the poling structure is set.

poling_structure

Array containing the poling structure.

nominal_parameter

Nominal fabrication parameter of the waveguide.

load_waveguide_profile(waveguide_profile: numpy.ndarray = None)[source]

Function to load a user-defined waveguide profile.

Parameters:waveguide_profile (numpy.ndarray) – Array with the waveguide profile, with respect to the parameter under investigation, or None. If None, it will create a uniform waveguide with the a constant waveguide.nominal_parameter. If an array, it must have the same shape as the z-mesh. Default: None
Returns:The numpy.ndarray containing the waveguide profile.
create_noisy_waveguide(noise_profile: str = '1/f', noise_amplitude: float = 0.2)[source]

Function to create a noisy waveguide with a predefined noise spectrum.

Parameters:
  • noise_profile (str) – String identifying the noise profile. Options are AWGN | 1/f | 1/f2. Default: 1/f.
  • noise_amplitude (float) – Range of the noise (in the same units as nominal_parameter()). Default: 0.2
Returns:

A ndarray containing the generated profile of the waveguide.

load_poling_structure(poling_structure)[source]

Function to load the poling structure of the waveguide. This function can be used to create custom poling structures, such as apodized poling, e.g. [1] and [2]. If the poling structure is set via this function, the poling period of the waveguide is automatically set to +`numpy.infty`.

Warning

The correct behaviour of this function is untested.

Parameters:poling_structure (numpy.ndarray) – Array containing the orientation of the poling. It must have the same dimensions of the z-mesh.
Returns:The poling structure
plot(ax: matplotlib.axes._axes.Axes = None)[source]

Function to plot the waveguide profile. If an axis handle is passed, it will plot in those axes.

Parameters:ax (matplotlib.axes.Axes) – handle to axis, if you want to plot in specific axes.
Returns:ax: handle to the axis object
plot_waveguide_properties(fig=None, **plotkwargs)[source]

Function to plot the waveguide properties in a figure. This function plots the waveguide profile, the power spectrum, autocorrelation and histogram distribution of the noise. If a Figure handle is passed, it plots in said Figure.

Parameters:
  • fig (matplotlib.figure.Figure) – Handle of the figure where the plots should be displayed. If None, then opens a new figure. Default is None.
  • plotkwargs (dict) – dictionary to be passed to matplotlib.pyplot.plot()