taylor_expansions (clifford.taylor_expansions)¶

New in version 1.4.0.

This file implements various Taylor expansions for useful functions of multivectors. For some algebra signatures there may exist closed forms of these functions which would likely be faster and more accurate. Nonetheless, having pre-written taylor expansions for the general case is useful.

Note

Many of these functions are also exposed as MultiVector methods, such as clifford.MultiVector.sin(). This means that mv.sin() or even np.sin(mv) can be used as a convenient interface to functions in this module, without having to import it directly.

For example:

>>> from clifford.g3 import *
>>> import numpy as np
>>> np.sin(np.pi*e12/4)
(0.86867^e12)

Implemented functions¶

clifford.taylor_expansions.exp(x, max_order=15)[source]

This implements the series expansion of $$\exp x$$ where $$x$$ is a multivector The parameter max_order is the maximum order of the taylor series to use

clifford.taylor_expansions.sin(X, max_order=30)[source]

A taylor series expansion for sin The parameter max_order is the maximum order of the taylor series to use

clifford.taylor_expansions.cos(X, max_order=30)[source]

A taylor series expansion for cos The parameter max_order is the maximum order of the taylor series to use

clifford.taylor_expansions.tan(X, max_order=30)[source]

The tan function as the ratio of sin and cos The parameter max_order is the maximum order of the taylor series to use

Note

It would probably be better to implement this as its own taylor series. This function is not JITed as currently we do not overload the truediv operator for multivectors.

clifford.taylor_expansions.sinh(X, max_order=30)[source]

A taylor series expansion for sinh The parameter max_order is the maximum order of the taylor series to use

clifford.taylor_expansions.cosh(X, max_order=30)[source]

A taylor series expansion for cosh The parameter max_order is the maximum order of the taylor series to use

clifford.taylor_expansions.tanh(X, max_order=30)[source]

The tanh function as the ratio of sinh and cosh The parameter max_order is the maximum order of the taylor series to use

Note

It would probably be better to implement this as its own taylor series. This function is not JITed as currently we do not overload the truediv operator for multivectors.