Inner products module
Inner products definition module
Module containing classes to define the inner products used by the model.
Main classes
- class layercake.inner_products.definition.InnerProductDefinition[source]
Bases:
ABCBase class to define the model’s basis inner products.
- class layercake.inner_products.definition.StandardSymbolicInnerProductDefinition(coordinate_system, optimizer=None, complex=False, kwargs=None)[source]
Bases:
InnerProductDefinitionStandard class to define symbolic inner products using Sympy.
- Parameters:
coordinate_system (CoordinateSystem) – Coordinate system on which the basis is defined.
optimizer (None or callable or str, optional) – A function to optimize the computation of the integrals or the integrand. If a string, specifies pre-defined optimizers: * ‘trig’: Optimizer specifically designed for trigonometric functions. If None, does not optimize.
complex (bool, optional) – Whether to compute the inner products with complex conjugate expression for the second term. Default to False, i.e. real inner products.
kwargs (dict) – Specific keywords arguments to pass to the Sympy integrals, see
integrate()andIntegral.
- coordinate_system
Coordinate system on which the basis is defined.
- Type:
- complex
Whether to compute the inner products with complex conjugate expression for the second term.
- Type:
bool, optional
- optimizer
A function to optimize the computation of the integrals or the integrand. If None, does not optimize the computation.
- Type:
None or callable
- inner_product(S, G, symbolic_expr=False, integrand=False)[source]
Function defining the inner product to be computed symbolically: \((S, G) = \left(1 / \mathcal{N}\right) \int_a^b\int_c^d S(x,y)\, G(x,y)\, \mathrm{d} x \, \mathrm{d} y\) where \(\mathcal{N} = (b-a) \, (d-c)\) is the norm of the integrals.
- Parameters:
S (Expr) – Left-hand side function of the product.
G (Expr) – Right-hand side function of the product.
symbolic_expr (bool, optional) – If True, return the integral as a symbolic expression object. Else, return the integral performed symbolically.
integrand (bool, optional) – If True, return the integrand of the integral and its integration limits as a list of symbolic expression object. Else, return the integral performed symbolically.
- Returns:
The result of the symbolic integration
- Return type: