finesse.utilities.maths

Common mathematical routines used by several sub-modules of the Finesse package.

Note

For developers:

The functions in this extension are to be used by the Python sub-modules of Finesse. When writing additional Cython extensions, use the functions found in finesse.cmath instead for the best performance.

This is the principle behind the separation of finesse.utilities.maths and finesse.cmath. The latter only exposes cdef functions and therefore cannot be used from within the pure Python parts of Finesse.

See The Finesse Cython extensions for further details.

Functions

transform_q(Mabcd, q1, nr1, nr2)

Applies the ABCD matrix Mabcd to the beam parameter q1.

zrotate(z, ph)

Rotation of the phase of a complex number by an amount in radians.

complex_equal(z1, z2)

Determines whether the two complex numbers, z1 and z2, are equal.