Functions operating on complex numbers of type
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.
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
cimport the cexp
function for use on
complex_t data types in another Cython extension.