shgpy.formgen module¶
Module for (non-Fourier) formula derivation
This module provides a number of routines for calculating the SHG
response of a given material (encoded by its susceptbility tensor,
see tensor_definitions
). These routines are much
more straightforward than those found in fformgen
,
but are only suited for the most simple problems because the
conversion from formulas to Fourier formulas (which is all but
necessary for efficient fitting functionality) is typically quite
slow.
-
shgpy.formgen.
formgen_dipole_quadrupole
(t1, t2, theta)¶ Generate formula assuming dipole+quadrupole SHG.
- Parameters
- t1ndarray of sympy.Expr
SHG dipole susceptibility tensor; see
tensor_definitions
.- t2ndarray of sympy.Expr
SHG quadrupole susceptibility tensor; see
tensor_definitions
.- thetafloat or sympy.Symbol
Angle of incidence
- Returns
- fformFormContainer
Instance of
FormContainer
.
-
shgpy.formgen.
formgen_dipole_quadrupole_complex
(*args, **kwargs)¶
-
shgpy.formgen.
formgen_dipole_quadrupole_real
(*args, **kwargs)¶
-
shgpy.formgen.
formgen_just_dipole
(t1, theta)¶ Generate formula assuming dipole SHG.
- Parameters
- t1ndarray of sympy.Expr
SHG susceptibility tensor; see
tensor_definitions
.- thetafloat or sympy.Symbol
Angle of incidence
- Returns
- fformFormContainer
Instance of
FormContainer
.
Notes
This routine differs from
formgen_just_dipole_real()
only in the sense that the computed intensity function is computed by computing the modulus-squared (rather than**2
) of the polarization. For this reason, it is usually suggested to explicitly substitutex -> real_x+1j*imag_x
for each x in t1. Seemake_tensor_complex()
and the tutorial.
-
shgpy.formgen.
formgen_just_dipole_complex
(*args, **kwargs)¶
-
shgpy.formgen.
formgen_just_dipole_real
(*args, **kwargs)¶
-
shgpy.formgen.
gen_P_dipole_quadrupole
(t1, t2, theta)¶ Generate P formula assuming dipole+quadrupole SHG.
- Parameters
- t1ndarray of sympy.Expr
SHG dipole susceptibility tensor; see
tensor_definitions
.- t2ndarray of sympy.Expr
SHG quadrupole susceptibility tensor; see
tensor_definitions
.- thetafloat or sympy.Symbol
Angle of incidence
- Returns
- Pp_effarray_like of sympy.Expr
The 2omega effective polarization assuming P-polarized input
- Ps_effarray_like of sympy.Expr
The 2omega effective polarization assuming S-polarized input
-
shgpy.formgen.
gen_P_dipole_quadrupole_complex
(*args, **kwargs)¶
-
shgpy.formgen.
gen_P_dipole_quadrupole_real
(*args, **kwargs)¶
-
shgpy.formgen.
gen_P_just_dipole
(t1, theta)¶ Generate P formula assuming dipole SHG.
- Parameters
- t1ndarray of sympy.Expr
SHG susceptibility tensor; see
tensor_definitions
.- thetafloat or sympy.Symbol
Angle of incidence
- Returns
- Pparray_like of sympy.Expr
The 2omega polarization assuming P-polarized input
- Psarray_like of sympy.Expr
The 2omega polarization assuming S-polarized input
-
shgpy.formgen.
gen_P_just_dipole_complex
(*args, **kwargs)¶
-
shgpy.formgen.
gen_P_just_dipole_real
(*args, **kwargs)¶
-
shgpy.formgen.
make_form_from_P_and_Q
(Pp, Ps, Qp, Qs)¶ Given a dipole and quadrupole moment, return the SHG signal.
- Parameters
- Ppsympy.Expr
2omega dipole component if the input is P polarized
- Pssympy.Expr
2omega dipole component if the input is S polarized
- Qpsympy.Expr
2omega quadrupole component if the input is P polarized
- Qssympy.Expr
2omega quadrupole component if the input is S polarized
- Returns
- formFormContainer