pychi package — pychi 0.0.1 documentation

# pychi package

## Submodules

## pychi.light module

Created on Fri Aug 13 12:01:48 2021

@author: Thibault

This module contains the classes used to instantiate light. Different standard pulse shapes are built-in, and a class is dedicated to accomodating user-provided light with arbitrary spectral shape. Note that the electric field is stored as an analytical envelope, thus is a complex quantity.

class `pychi.light.` `Arbitrary`(waveguide, pulse_frequency_axis, pulse_electric_field, pulse_energy)

  Bases: `pychi.light.Light`

  Class for arbitrary light waveform, specified in frequency domain.

class `pychi.light.` `Cw`(waveguide, average_power, wavelength)

  Bases: `pychi.light.Light`

  Class for CW light.

class `pychi.light.` `Gaussian`(waveguide, pulse_duration, pulse_energy, pulse_wavelength, delay=0)

  Bases: `pychi.light.Light`

  Class for a Gaussian pulse.

class `pychi.light.` `Light`(waveguide, field_t_in)

  Bases: `object`

  Parent light class. Implement support for adding pulses, saving the results of a propagation and plotting these results. Not suitable for light instantiation.

  `add_shot_noise`(seed=None)

    Add shot noise to the pulse, useful for coherence study.

    Parameters

      seed (int) – Seed for the random number generator for reproducibility.

  `plot_propagation`(savename=None)

    Plot propagation results.

  `set_result_as_start`()

    Set output field from propagation as initial field for a new propagation.

    Returns

      New Light object with final propagation result as input field.

    Return type

      Light

class `pychi.light.` `Sech`(waveguide, pulse_duration, pulse_energy, pulse_wavelength, delay=0)

  Bases: `pychi.light.Light`

  Class for a sech pulse.

## pychi.materials module

Created on Fri Aug 13 12:07:43 2021

@author: Thibault

class `pychi.materials.` `Waveguide`(frequency, n_eff, chi_2, chi_3, effective_area, length, raman_fraction=0.18, raman_tau_1=1.22e-14, raman_tau_2=3.2e-14, t_pts=16384)

  Bases: `object`

  Waveguide class. Contains all material related information, i.e. the refractive index curve versus frequency, the Raman parameters, the nonlinear coefficients, the effective area and length. This object should be the first object instantiated, as the time/frequency axes of the simulation are derived here from the available refractive index data.

  property `chi_2`
  property `chi_3`
  `compute_betas`(wavelength=None, order=6)

    Compute beta coefficients at a given wavelength and order.

    Parameters

      - wavelength (float, optional) – Wavelength at which the beta coefficients are computed. The default is the center of the simulation axis.

      - order (int, optional) – Highest order of the beta coefficients to be computed. The default is 6.

    Returns

      beta – Beta coefficients of the material at the given wavelength.

    Return type

      array

  property `k`
  property `n_eff`
  `plot_refractive_index`(savename=None)

    Plot refractive index

  property `rhs_prefactor`
  `set_betas`(betas, wavelength)

    Convenience only. Allow the use to provide the beta coefficients instead of n_eff. Should be avoided.

  `set_gamma`(gamma, wavelength=None)

    Convenience only. Allow the user to give the nonlinear coefficient instead of chi3. Overwrite the initialized chi3 value accordingly.

    Parameters

      gamma (float) – Nonlinear coefficient.

  `set_n2`(n2, wavelength=None)

    Convenience only. Allow the user to give the nonlinear index instead of chi3. Overwrite the initialized chi3 value accordingly.

    Parameters

      n2 (float) – Nonlinear index.

## pychi.models module

Created on Fri Feb 18 17:24:21 2022

@author: voumardt

class `pychi.models.` `Chi2`(waveguide, light)

  Bases: `pychi.models.Model`

  Sum frequency generation and difference frequency generation only physical model.

  `nonlinear_term`(field_f)

    Nonlinear function with chi 2

    Parameters

      field_f (array) – Analytical envelope of the electric field in frequency domain.

    Returns

      Nonlinear evolution term.

    Return type

      array

class `pychi.models.` `Chi2Chi3`(waveguide, light)

  Bases: `pychi.models.Model`

  Triple-sum, sum and difference frequency generation physical model.

  `nonlinear_term`(field_f)

    Nonlinear function with chi 2 and chi 3

    Parameters

      field_f (array) – Analytical envelope of the electric field in frequency domain.

    Returns

      Nonlinear evolution term.

    Return type

      array

class `pychi.models.` `Chi3`(waveguide, light)

  Bases: `pychi.models.Model`

  Triple sum-frequency physical model.

  `nonlinear_term`(field_f)

    Nonlinear function with spm and chi 3

    Parameters

      field_f (array) – Analytical envelope of the electric field in frequency domain.

    Returns

      Nonlinear evolution term.

    Return type

      array

class `pychi.models.` `Model`(waveguide, light)

  Bases: `object`

  Parent class for the different nonlinear Schrödinger equations. Provide general utility, optimization and setup functions for the physics happening in the child classes.

  `dispersion_step`(field, dz)

    Compute dispersion step with field in frequency domain.

    Parameters

      - field (array) – Field in frequency domain.

      - dz (float) – Step size.

    Returns

      Dispersion affected field in frequency domain.

    Return type

      array

  `nonlinear_term`(field)

    Nonlinear term, implemented in child classes for different interaction types.

class `pychi.models.` `Spm`(waveguide, light)

  Bases: `pychi.models.Model`

  Self phase modulation only physical model.

  `nonlinear_term`(field_f)

    Nonlinear function with spm

    Parameters

      field_f (array) – Analytical envelope of the electric field in frequency domain.

    Returns

      Nonlinear evolution term.

    Return type

      array

class `pychi.models.` `SpmChi2`(waveguide, light)

  Bases: `pychi.models.Model`

  Self phase modulation, sum and difference frequency generation physical model.

  `nonlinear_term`(field_f)

    Nonlinear function with spm and chi 2

    Parameters

      field_f (array) – Analytical envelope of the electric field in frequency domain.

    Returns

      Nonlinear evolution term.

    Return type

      array

class `pychi.models.` `SpmChi2Chi3`(waveguide, light)

  Bases: `pychi.models.Model`

  Self phase modulation, triple harmonic, sum and difference frequency generation physical model.

  `nonlinear_term`(field_f)

    Nonlinear function with spm, chi 2 and chi 3

    Parameters

      field_f (array) – Analytical envelope of the electric field in frequency domain.

    Returns

      Nonlinear evolution term.

    Return type

      array

class `pychi.models.` `SpmChi3`(waveguide, light)

  Bases: `pychi.models.Model`

  Self phase modulation and triple harmonic physical model.

  `nonlinear_term`(field_f)

    Nonlinear function with spm and chi 3

    Parameters

      field_f (array) – Analytical envelope of the electric field in frequency domain.

    Returns

      Nonlinear evolution term.

    Return type

      array

`pychi.models.` `numbaconj`

  Compute numba optimized complex conjugate of a vector.

`pychi.models.` `numbacopy`

  Create a numba optimized copy of a vector.

`pychi.models.` `numbaexp`

  Compute numba optimized exponential of input vector.

## pychi.solvers module

Created on Fri Feb 18 17:54:20 2022

@author: voumardt

class `pychi.solvers.` `Solver`(model, z_pts=500, local_error=1e-05, adaptive_factor=1.1, max_dz=None, method=None)

  Bases: `object`

  `solve`()

    Integrate over waveguide length with adaptive step size

`pychi.solvers.` `numbaexp`

`pychi.solvers.` `numbanorm`

## Module contents

Created on Thu Feb 17 12:32:49 2022

@author: voumardt