Second-order NLTMM¶
Main class¶
- class NonlinearTMM.SecondOrderNLTMM(mode)¶
Bases:
objectThis class calculates second-order nonlinear processes (e.g. sum-frequency, difference-frequency generation and SPDC) in layered structures. Relies on the functionality of the
NonlinearTMMclass.- Parameters:
- modestr {‘sfg’, ‘dfg’, ‘spdc’}
- Attributes:
- P1
NonlinearTMM The instance of the first pump wave TMM.
- P2
NonlinearTMM The instance of the second pump wave TMM.
- Gen
NonlinearTMM The instance of the generated wave TMM.
- deltaWlSpdcfloat
The spectral collection window (in nanometers) of the SPDC signal. Only used if
modeis set to"spdc". Default: NaN.- solidAngleSpdcfloat
The collection solid angle (srad) of the detector (given in vacuum). Only used if
modeis set to"spdc". Default: NaN.- deltaThetaSpdcfloat
The horizontal collection window (rad) of the detector (given in vacuum). It is used to calculate the vertical span of the detector. Only used if
modeis set to"spdc". Default: NaN.
- P1
- AddLayer(d, material)¶
Adds layer to SecondOrderNLTMM. Equivalent of adding layer to P1, P2 and Gen.
- Parameters:
- dfloat
layer thickness (m)
- material
Material The class containing the material parameters.
- GetIntensities()¶
Returns the intensities and amplitudes of incident, reflected and transmitted wave for
P1,P2andGen. The structure must be solved first.- Returns:
_SecondOrderNLIntensitiesHelper class to hold intensity data.
- SetParams(**kwargs)¶
Helper method to set the values of all the attributes. See the docstring of
SecondOrderNLTMM.
- Solve()¶
Solves the structure.
- Sweep(paramStr, valuesP1, valuesP2, layerNr=0, layerZ=0.0, outPwr=True, outAbs=False, outEnh=False, outP1=True, outP2=True, outGen=True)¶
Solves the structure for a series of
valuesP1andvaluesP2of paramparamStr. Using this function is more convenient and faster than just changing params and solving the structure (parallelized with OpenMP).- Parameters:
- paramStrstr
- ‘wl’:
Wavelength in meters
- ‘beta’:
normalized tangential wavevector
- ‘I0’:
intensity of the wave
- ‘d_i’:
thickness of layer i (0..N-1)
- valuesP1ndarray of floats
Corresponding values of param
paramStrforP1.- valuesP2ndarray of floats
Corresponding values of param
paramStrforP2.- layerNrint
Specifies layer, where electrical field enhancement is calculated.
- layerZdouble
Specifies z-coordinate of enhancement calculation inside
layerNr.- outPwrbool
Turns calculation of intensities on/off.
- outAbsbool
Turns calculation of absorption in the entire structure on/off.
- outEnhbool
Turns calculation of enhancement in layer
layerNrat distancelayerZon/off.- outP1bool
Turns calculation of
P1on/off.- outP2bool
Turns calculation of
P2on/off.- outGenbool
Turns calculation of
Genon/off.
- Returns:
_SweepResultSecondOrderNLTMMHelper class to store the result.
- UpdateGenParams()¶
Forces the update of the wavelength and beta of the generated beam
Gen.
- WaveGetFields2D(zs, xs, dirStr='total')¶
Calculates 2D electric and magnetic fields of the beam propagating in the structure. Analogous to
GetFields2Dof plane waves. Only for the calculation of the generated beam fields. For pump beams use the same method ofNonlinearTMM.- Parameters:
- zsndarray of floats
Points on z-axis where to calculate the fields. The beginning of the first layer is at z = 0.
- xsndarray of floats
Points on x-axis where to calculate the fields.
- dirStr{‘total’, ‘forward’, ‘backward’}
Specifies the components of the output fields.
- Returns:
_FieldsZXHelper class to store electric and magnetic fields in regular grid.
- WaveGetPowerFlows(layerNr, x0=float('nan'), x1=float('nan'), z=0.0)¶
Analogous to
GetIntensities, but calculates the powers of the beams instead of the intensities of the plane waves. Only for the calculation of the power of the generated beam. For pump beams use the same method ofNonlinearTMM.- Parameters:
- layerNrint
Specifies layer number where to calculate the power of the beam.
- x0float
Specifies the starting point of the integration of the power in the x-direction. By default this parameter is selected by the
_Waveclass.- x1float
Specifies the end point of the integration of the power in the x-direction. By default this parameter is selected by the
_Waveclass.- zfloat
Specifies the z-position of the line through which the integration of the power of the beam is done.
- Returns:
- tuple of floats (PB, PF)
PB is the power propagated into negative infinity and PF denotes the power propagating in the positive direction of z-axis.
- WaveSweep(paramStr, valuesP1, valuesP2, layerNr=0, layerZ=0.0, outPwr=True, outR=False, outT=False, outEnh=False, outP1=True, outP2=True, outGen=True)¶
Solves the structure for waves for a series of
valuesP1andvaluesP2of paramparamStr. Using this function is more convenient and faster than just changing the params and solving the structure. Analogous toSweep.- Parameters:
- paramStrstr
- ‘wl’:
Wavelength in meters
- ‘beta’:
normalized tangential wavevector
- ‘I0’:
intensity of the wave
- ‘d_i’:
thickness of layer i (0..N-1)
- ‘w0’:
waist size of the input beam
- valuesP1ndarray of floats
Corresponding values of param
paramStrforP1.- valuesP2ndarray of floats
Corresponding values of param
paramStrforP2.- layerNrint
Specifies layer, where electrical field enhancement is calculated.
- layerZdouble
Specifies z-coordinate of enhancement calculation inside
layerNr.- outPwrbool
Turns calculation of all powers on/off.
- outRbool
Turns calculation of reflected power on/off.
- outTbool
Turns calculation of transmitted power on/off.
- outEnhbool
Turns calculation of enhancement in layer
layerNrat distancelayerZon/off.- outP1bool
Turns calculation of
P1on/off.- outP2bool
Turns calculation of
P2on/off.- outGenbool
Turns calculation of
Genon/off.
- Returns:
_WaveSweepResultSecondOrderNLTMMHelper class to store the result.
Helper classes¶
- class NonlinearTMM._WaveSweepResultSecondOrderNLTMM¶
Bases:
objectHelper class for SecondOrderNLTMM. Stores the results of WaveSweep method.
- Attributes:
- P1
_WaveSweepResultNonlinearTMM The sweep result of the first input beam.
- P2
_WaveSweepResultNonlinearTMM The sweep result of the second input beam.
- Gen
_WaveSweepResultNonlinearTMM The sweep result of the generated beam.
- wlsGenndarray of floats
Stores the wavelength of the generated wave.
- betasGenndarray of floats
Stores the normalized tangential wave vector of the generated wave.
- P1
- class NonlinearTMM._SweepResultSecondOrderNLTMM¶
Bases:
objectHelper class for SecondOrderNLTMM. Stores the results of Sweep method.
- Attributes:
- P1
_SweepResultNonlinearTMM Sweep results for the first input wave.
- P2
_SweepResultNonlinearTMM Sweep results for the second input wave.
- Gen
_SweepResultNonlinearTMM Sweep results for the generated wave.
- wlsGenndarray of floats
Stores the wavelength of the generated wave.
- betasGenndarray of floats
Stores the normalized tangential wave vector of the generated wave.
- P1
- class NonlinearTMM._SecondOrderNLIntensities¶
Bases:
objectThis is a helper class for SecondOrderNLTMM. It stores the results of GetIntensities.
- Attributes:
- P1
_Intensities Instance of
_Intensitiesclass and holds the intensities of the first input wave.- P2
_Intensities Instance of
_Intensitiesclass and holds the intensities of the second input wave.- Gen
_Intensities Instance of
_Intensitiesclass and holds the intensities of the generated wave.
- P1