Skip to main content

Symbolic engine for the Stokes-Mueller algebra of polarization optics: Mueller-matrix decomposition, certified identity discovery (equality saturation + exact symbolic proof), coupled-dipole modelling, and evidence-labelled LaTeX reporting.

Project description

organon-mueller

PyPI Python CI License: MIT

A symbolic engine for the Stokes–Mueller algebra of polarization optics: it decomposes depolarizing Mueller matrices into nondepolarizing components, discovers and certifies algebraic identities of the underlying state algebra, models coupled oriented dipoles, and reports every result as evidence-labelled LaTeX — with each mathematical statement gated by a written verification contract.

Status: experimental research software. Results are labelled by evidence class — verified (machine-checked against published equations/tables: symbolic-exact or seeded-numeric) or candidate (beyond the published results; no novelty or physics claim — that judgement is left to human experts, per docs/novelty-protocol.md).

Released under the MIT License.

What it does

  • Represents a pure polarization state in six isomorphic ways — Jones matrix J, Mueller matrix M = ZZ*, covariance matrix H, covariance vector |h⟩ = (τ, α, β, γ), Z-matrix, and biquaternion — with exact, symbolically proven conversions between all of them [1, 2, 3].
  • Decomposes depolarizing Mueller matrices into symmetry-conditioned nondepolarizing components: the six fundamental variants and three composite types of the symmetry-conditioned decomposition [4], derived from rank-1 minor conditions (not transcribed from the published tables), plus a rank-3 three-term zone that goes beyond the published cases.
  • Discovers algebraic identities by equality saturation over a covariance-vector term language (egglog), with every candidate certified by engine-independent symbolic proof; guarded atoms open a Horn-conditional channel (P(x) → t₁ = t₂).
  • Models coupled oriented dipoles [5, 6, 7]: the three-term scattering decomposition as a theorem, mode hybridization, optical activity, Perrin reciprocity, and ensemble statistics — bridged back to the decomposition layer through the covariance representation.
  • Reports any of the above as deterministic, evidence-labelled LaTeX.

Installation

Requires Python ≥ 3.10 (the discovery engine needs ≥ 3.11).

From PyPI:

pip install organon-mueller                # base
pip install "organon-mueller[ui]"          # + local web interface
pip install "organon-mueller[discovery]"   # + discovery engine (egglog)
pip install "organon-mueller[mcp]"         # + MCP server surface

For development, from a clone:

pip install -e ".[test,discovery,mcp,ui]"
python -m pytest -q                     # full suite: 342 tests collected (discovery self-skips on py3.10)

Quickstart

Interactive (no code) — the local web interface:

organon-ui       # opens http://127.0.0.1:7860 (needs the ui extra)

As a library:

from organon_mueller import HVector

h = HVector.generic("a")   # generic complex (tau, alpha, beta, gamma)
M = h.to_mueller()         # M = Z Z*
Z = h.to_z()
q = h.to_quaternion()      # tau*1 + i*alpha*i + i*beta*j + i*gamma*k
import numpy as np
from organon_mueller.decomposition import decompose

# a depolarizing Mueller matrix -> a symmetric + a generic pure component
result = decompose(mueller=my_4x4_matrix, symmetry="type1")
print(result.alpha1, result.m1, result.m2)

Full demonstration (decomposition against a published worked example, rank-3 recovery, the hypothesis bridge, the dipole engine):

python examples/demo.py

Usage surfaces

Surface For Entry
Python package scripting / integration import organon_mueller
Local web UI interactive use, no code (localhost only) docs/README-ui.md
MCP server tool use from an assistant docs/README-mcp.md
Static web viewer reading results in a browser (no terminal) web/index.html

Nothing is hosted or exposed by the project. The local web UI binds to 127.0.0.1 only (no tunnel, no public link); the MCP server and static viewer are code + tests only — running them is your decision.

Verification contract (the trust anchor)

No mathematical statement reaches main without passing the layers in docs/VERIFICATION.md: exact symbolic proof · seeded numeric checks · regression against the 21 identities of the known-identity library (each tied to a published equation) · engine-independent certification of every discovery candidate · an independent adversarial review of every change set (each reviewer re-derives the mathematics from scratch) · a 3-version CI matrix. Numeric confidence is never a substitute for a passing test.

Architecture

Layered, with one-way dependencies: algebra → identities/conditions → discovery / decomposition / dipoles → reporting → mcp_server → web / ui, plus a safe_parse security layer guarding deserialization. See docs/architecture.md for the layer map and the index of design decisions, and docs/user-guide.md for a task-oriented walkthrough.

Every change lands with a written spec (specs/) and a closing report (reports/); nothing untested reaches main.

References

The algorithms implement, verify against, and extend results from:

  1. E. Kuntman, M. A. Kuntman, O. Arteaga, Vector and matrix states for Mueller matrices of nondepolarizing optical media, J. Opt. Soc. Am. A 34, 80 (2017).
  2. E. Kuntman, M. A. Kuntman, O. Arteaga, Quaternion algebra for Stokes–Mueller formalism, arXiv:1705.07147 (2017).
  3. E. Kuntman, M. A. Kuntman, J. Sancho-Parramon, O. Arteaga, Formalism of optical coherence and polarization based on material media states, Phys. Rev. A 95, 063819 (2017).
  4. E. Kuntman, O. Arteaga, Decomposition of a depolarizing Mueller matrix into its nondepolarizing components by using symmetry conditions, Appl. Opt. 55, 2543 (2016).
  5. M. A. Kuntman, E. Kuntman, J. Sancho-Parramon, O. Arteaga, Light scattering by coupled oriented dipoles: decomposition of the scattering matrix, Phys. Rev. B 98, 045410 (2018).
  6. M. A. Kuntman, E. Kuntman, O. Arteaga, Asymmetric scattering and reciprocity in a plasmonic dimer, Symmetry 12, 1790 (2020).
  7. M. A. Kuntman, E. Kuntman, Plasmonic dimers in a solution: a theoretical approach to the optical activity in an ensemble of randomly oriented chiral and achiral plasmonic dimers, preprint.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

organon_mueller-1.1.0.tar.gz (131.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

organon_mueller-1.1.0-py3-none-any.whl (101.7 kB view details)

Uploaded Python 3

File details

Details for the file organon_mueller-1.1.0.tar.gz.

File metadata

  • Download URL: organon_mueller-1.1.0.tar.gz
  • Upload date:
  • Size: 131.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for organon_mueller-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6da38d4b524230fa5deab4e564c3ea8f59e4a4692611a8d2e004ab51572f850f
MD5 fbdf0b2501955793cf0fb86fee2f2842
BLAKE2b-256 e1df39ea499c733baab8992db52df8aeda9d84d3b5a2555ea8219f127d463d64

See more details on using hashes here.

Provenance

The following attestation bundles were made for organon_mueller-1.1.0.tar.gz:

Publisher: publish.yml on tanzercakir-commits/organon-mueller

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file organon_mueller-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: organon_mueller-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 101.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for organon_mueller-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cacd2bac9d161ea3897766acca6b836e170fb7c6911e7aa64acb29849dac937e
MD5 6b2279689d7530aa467bf0ee5c2743bd
BLAKE2b-256 e1c1657cb67fba11e7176e329393e4191baa76d02c252879eb84144cf8a58271

See more details on using hashes here.

Provenance

The following attestation bundles were made for organon_mueller-1.1.0-py3-none-any.whl:

Publisher: publish.yml on tanzercakir-commits/organon-mueller

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page