fullseye

mueller_apply — OPTICS polarization op

使い方

Push a Stokes vector through a Mueller matrix: S' = M @ S.

mueller is a (4, 4) real matrix (build one with :func:mueller_element, or multiply several together) and stokes a 4-component Stokes vector [S0, S1, S2, S3].

The input is checked for physical realisability: S0 >= 0 and sqrt(S1^2+S2^2+S3^2) <= S0 (degree of polarisation at most 1). Handing an impossible state to a Mueller matrix returns a plausible-looking result that means nothing, so it is refused instead. The output is not re-checked, deliberately: an unphysical output is real evidence that mueller is not a physical Mueller matrix, and swallowing it would hide the bug — inspect it with :func:stokes_analyze, which will say so.

Returns a (4,) float64 Stokes vector.

画像として通す(2026-09-06 追加)

mueller(..., 4, 4)stokes(..., 4) にすると 画素ごとに違う行列を通せる。両者は numpy の規則で broadcast するので、 (H, W, 4, 4)(4,) の組(素子だけが場所で変わる)や、 (4, 4)(H, W, 4) の組(光だけが場所で変わる)も書ける。

足した理由は実測。examples/poc_photoelasticity.py は画素ごとに 位相差の変わる位相子を通す必要があり、この口が無いために (H,W,4,4) を 自分で組む羽目になっていた。行列そのものは正しい(暗視野円偏光系を 組んで教科書の I = sin²(δ/2) と 125 通りで最大差 2.2e-16)ので、 足りなかったのは形だけだった。

実現可能性の検査は画素ごとに行い、破っている画素があれば その数と最悪値を挙げて拒否する(1 点でも通さない = fail-closed)。

Ground truth it reproduces exactly: unpolarised [1,0,0,0] through an ideal polariser gives S0 = 0.5 with degree of polarisation 1; through two polarisers at relative angle theta, 0.5*cos^2(theta) (Malus, to 1e-16 over a full sweep); the identity matrix returns the input unchanged.

Raises ValueError: mueller is not (4, 4), stokes is not a 1-D 4-vector, either is complex / masked / non-finite, the input Stokes vector is unphysical, or the product overflows float64.

ファミリ共通の入力契約(fail-closed)

optics の全 op は入力を検証してから計算する(黙って通さない):

詳しい使い方ガイド

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(stokes を入力に取れる)

stokes_analyze

同カテゴリ(polarization)

jones_element · jones_apply · stokes_from_jones · mueller_element · stokes_analyze


Provenance: optics.py — OPTICS operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

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