cplx_rational_field — MATH complex op

• Data kinds: roots × roots → cimage

• Call: import fullseye as fs; fs.ledger.cplx_rational_field(zeros, poles, gain=1.0, centre=0j, half_width=2.0, shape=(256, 256)) (to call the implementation directly, import mathops; mathops.cplx_rational_field(zeros, poles, gain=1.0, centre=0j, half_width=2.0, shape=(256, 256)); from the registry, opsmath.get("cplx_rational_field"))

Usage

Sample a rational function `R(z) = gain * prod(z - zeros) / prod(z - poles)`.

Returns the complex image `R(z)` over a rectangular window of the plane —

the *area* counterpart of this family's contour operators. The product is

formed in log space (`exp(sum(log(z - zk)) - sum(log(z - pm)))`) so a

degree-30 numerator does not overflow before the denominator can divide it

back down; the branch cuts of the individual logarithms cancel in the

exponential, so the result is the ordinary principal value of the quotient,

not a branch of it.

★Why this earns its place: the field is not decoration. The argument

principle says that the winding number of `R` along a closed contour

equals *(zeros inside) - (poles inside)*, counted with multiplicity — so

this family's own `cplx_argument_principle / cplx_winding_number`

are an independent oracle for every field this operator produces, and

:func:cplx_domain_colour makes that integer visible as the number of

times the hue cycles.

Parameters

----------

zeros, poles : complex array-like

Roots of the numerator and denominator, repeated for multiplicity.

Either may be empty (a polynomial, or `1/q). poly_roots` produces

exactly this `roots` vocabulary.

gain : complex

Leading coefficient.

centre, half_width, shape :

The window, as in :func:cplx_plane_grid.

Raises `ValueError`: a pole (or zero) lands *exactly* on a sample, so

the value there is not a number — nudge `centre` by half a pixel or take

an odd `shape` (the message says which pole and where); non-finite input;

the window is degenerate; the result overflows to infinity anyway (the gain

and the window disagree by more than float64 can hold).

HALCON: no operator (HALCON has no complex-plane family).

Family-wide input contract (fail-closed)

Every mathops op validates its input before computing (nothing slips through silently):

• **complex input raises ValueError** — coercing to float64 silently discards the imaginary part (numpy only emits a ComplexWarning and returns a plausible-looking wrong real number). State .real/.imag/abs() explicitly, or use complexops, which handles complex data.

• **masked arrays with masked elements raise ValueError** — the implicit conversion that peels off the mask and uses the raw values underneath is refused. Say explicitly whether to fill or to drop.

• **NaN/Inf raises ValueError on every input** (refused with the count stated — it propagates through the whole result).

• Shapes are strict: 1-D and 2-D are never implicitly promoted or broadcast (a matrix in a vector slot, or a vector in a matrix slot, raises ValueError; reshape explicitly).

• Size cap: ops that take a matrix, and the stat_histogram bins, raise ValueError beyond mathops.MAX_ELEMENTS (2^26 ≈ 67 million elements).

Detailed usage guide

• math_metrology family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• poc_complex_plane_fields — py -3.11 examples/poc_complex_plane_fields.py

Ops the type connects to (they accept cimage as input)

cplx_cr_residual · cplx_domain_colour · mandelbrot_interior

Same category (complex)

cplx_contour_circle · cplx_poly_eval · cplx_contour_integral · cplx_winding_number · cplx_cauchy_value · cplx_argument_principle · cplx_laurent_coeffs · cplx_joukowski


*Provenance: mathops.py — MATH operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.