polarization op• Data kinds: none → matrix (an op determined by its arguments alone — it takes no image or data input)
• Call: import fullseye as fs; fs.ledger.mueller_partial_polarizer(angle_deg=0.0, extinction_ratio=1000.0, transmission=1.0) (to call the implementation directly, import optics; optics.mueller_partial_polarizer(angle_deg=0.0, extinction_ratio=1000.0, transmission=1.0); from the registry, opsoptics.get("mueller_partial_polarizer"))
• GPU: none (CPU reference implementation only)
Mueller matrix of a linear polariser with a finite extinction ratio (a linear diattenuator). → (4, 4), or (*shape, 4, 4) for an angle field.
A real polariser passes intensity transmittance T1 = transmission for light polarised along its axis and T2 = T1 / extinction_ratio for light across it. Writing P = T1 + T2, D = T1 - T2, Q = 2 sqrt(T1 T2) and c = cos 2a, s = sin 2a (the axis at *angle_deg*), the matrix is
0.5 * [[P, D c, D s, 0],
[D c, P c^2 + Q s^2, (P - Q) c s, 0],
[D s, (P - Q) c s, P s^2 + Q c^2, 0],
[0, 0, 0, Q]]
— the textbook diattenuator diag-block form rotated to *angle_deg*. It is also exactly the Mueller matrix of the Jones matrix R(a) diag(sqrt T1, sqrt T2) R(-a) (a pure diattenuator has no retardance and no depolarisation), and the tests check that equality through the generic Jones → Mueller conversion, a separate code path.
Ground truth (closed form, checked in the tests): unpolarised light comes out with intensity (T1 + T2)/2 and degree of polarisation (ER - 1)/(ER + 1); the intensity transmitted through two such polarisers, parallel vs crossed, is (T1^2 + T2^2)/2 vs T1 T2 — the measured extinction ratio of the pair is (ER^2 + 1)/(2 ER), not ER; Malus's law becomes T2 + (T1 - T2) cos^2(theta) for fully polarised input at angle theta to the axis; ER -> infinity tends to T1 * mueller_element ("polarizer"); ER = 1 is a neutral-density filter T1 * I.
*angle_deg* may be an array (one matrix per entry, as mueller_element); *extinction_ratio* and *transmission* are scalars. Angles follow the module convention (from +x toward +y = down the rows, clockwise on a displayed image).
Raises ValueError: non-finite / non-real / bool / string arguments; *extinction_ratio* < 1 (an "extinction ratio" below 1 means the axis is the other one — rotate by 90 degrees instead of passing the reciprocal) or infinite (use mueller_element for the ideal polariser); *transmission* outside (0, 1] (a passive element cannot amplify, and a zero-transmission element has no axis); an angle field over MAX_FIELD_ELEMENTS / 16 entries.
Every optics op validates its input before computing (nothing slips through silently):
• Units are baked into the argument name — _mm / _um / _deg / _mrad. Confusing mm with µm does not crash; it yields a plausible-looking wrong answer, so the name prevents it. Nothing here guesses the unit from the magnitude.
• Strings raise ValueError — float('50') succeeds, so an unparsed configuration value would slip through as a length (measured: thin_lens('50', '200') returned a plausible 66.667 mm). bool is refused too, as the implicit promotion True == 1.
• complex / masked arrays raise ValueError (real-valued slots only; silently dropping the imaginary part or peeling off the mask is refused). NaN/Inf raises ValueError on every input. Exception, declared: the u_map of bottle_fit_from_pattern takes pixels that could not be measured as NaN (infinity is still refused).
• Division by zero and its relatives are refused by name: focal length 0, radius of curvature 0, refractive index <= 0, a fully opaque aperture (all zeros, so the normalisation is 0/0), a PSF whose sum is <= 0, a Stokes vector with S0 = 0, and an object sitting at the front focal point (the image is at infinity).
• Only two ops return a non-finite value, and both state it as a contract: depth_of_field returns far_mm = inf beyond the hyperfocal distance (that is what the hyperfocal distance means), and gaussian_beam returns wavefront_radius_mm = inf at the waist (the radius of curvature of a plane wavefront). Both also return a finite companion (far_is_infinite / curvature_per_mm). Any other silent NaN/Inf is detected internally and raises ValueError — "float64 overflowed" and "the answer is infinite" are different claims, so the first is never returned wearing the face of the second. Exception, declared: bottle_background_map returns NaN in u_mm for pixels whose ray is unusable (total internal reflection and the like), together with a valid mask and the counts.
• Size caps: generated grids are capped by optics.MAX_GRID (4096); supplied fields/PSFs/apertures by optics.MAX_FIELD_ELEMENTS (2^24); ABCD element chains by optics.MAX_SYSTEM_ELEMENTS (1024); Zernike by MAX_ZERNIKE_TERMS (512) / MAX_ZERNIKE_ORDER (40) / MAX_ZERNIKE_BASIS (2^25). This closes, fail-closed, the paths where a small argument triggers a huge internal allocation (measured: n_max=40 × 4096² needs 108 GB).
• Physically impossible states are refused too: a Stokes vector with degree of polarisation > 1, negative transmittance, negative intensity, and invalid Zernike indices such as n-|m| odd.
• 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.
• polarization_camera_pipeline — py -3.11 examples/polarization_camera_pipeline.py
matrix as input)abcd_trace · emva_filter_distortion · mueller_apply · mueller_checks · equirect_rotate · pixel_shift_capture · pixel_shift_merge · pixel_shift_motion_mask
polarization)jones_element · jones_apply · stokes_from_jones · mueller_element · mueller_apply · stokes_analyze · polarization_demosaic · polarization_demosaic_color
*Provenance: optics.py — OPTICS 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.