Functions operating on complex numbers of type double complex.

This module provides complex number functions as well as the fundamental complex data type to be used by developers.


For any developer writing a Cython extension which involves complex mathematics, you should cimport the complex data type, which is used consistently across the code-base, via:

from finesse.cymath cimport complex_t


from finesse.cymath.complex cimport complex_t

Both statements are equivalent. This complex_t typedef corresponds exactly to NumPy’s np.complex128_t — i.e. double complex.

Most of the standard functions of the C "complex.h" header are exposed at a C level via this module. Refer to the Complex Number Arithmetic C reference for the names, arguments and further details on these functions. One can cimport such functions in the same way as cimporting any other C exposed Cython function. For example:

from finesse.cymath.complex cimport cexp

will cimport the cexp function for use on complex_t data types in another Cython extension.


ceq(double complex z1, double complex z2)

cpow_re(double complex z, double n)