pystencils.sympyextensions.math.get_symmetric_part

pystencils.sympyextensions.math.get_symmetric_part#

pystencils.sympyextensions.math.get_symmetric_part(expr, symbols)#

Returns the symmetric part of a sympy expressions.

This function returns the symmetric part of the given expression w.r.t. the given degrees of freedom, computed as \(\frac{1}{2} [ f(x_0, x_1, ..) + f(-x_0, -x_1) ]\).

Parameters:
  • expr (Expr) – sympy expression, labeled here as \(f\)

  • symbols (Iterable[Symbol]) – sequence of symbols which are considered as degrees of freedom, labeled here as \(x_0, x_1,...\)

Return type:

Expr