Skip to content

PR: Implement support for *Transfer Matrix Method* (TMM).#1366

Merged
KelSolaar merged 2 commits intodevelopfrom
feature/thin_film
Oct 18, 2025
Merged

PR: Implement support for *Transfer Matrix Method* (TMM).#1366
KelSolaar merged 2 commits intodevelopfrom
feature/thin_film

Conversation

@KelSolaar
Copy link
Copy Markdown
Member

Summary

This PR relates to #525 and implements the full Transfer Matrix Method (TMM), I started the work 6 years ago and finally managed to finish, thanks Claude!

Computations

The main function is colour.phenomena.matrix_transfer_tmm that computes transfer matrices for multilayer thin film structures with full vectorisation across wavelength, angle and thickness.

Then the two colour.phenomena.thin_film_tmm and colour.phenomena.multilayer_tmm functions compute thin film and multilayer reflectance / transmittance respectively.

  • colour.phenomena.snell_law
  • colour.phenomena.polarised_light_magnitude_elements
  • colour.phenomena.polarised_light_reflection_amplitude
  • colour.phenomena.polarised_light_reflection_coefficient
  • colour.phenomena.polarised_light_transmission_amplitude
  • colour.phenomena.polarised_light_transmission_coefficient
  • colour.phenomena.TransferMatrixResult
  • colour.phenomena.matrix_transfer_tmm
  • colour.phenomena.light_water_molar_refraction_Schiebener1990
  • colour.phenomena.light_water_refractive_index_Schiebener1990
  • colour.phenomena.thin_film_tmm
  • colour.phenomena.multilayer_tmm

Plotting

I also added a bunch of new plotting definitions, most notable ones being colour.plotting.plot_thin_film_iridescence, colour.plotting.plot_thin_film_reflectance_map and colour.plotting.plot_multi_layer_stack.

  • colour.plotting.plot_single_layer_thin_film
  • colour.plotting.plot_multi_layer_thin_film
  • colour.plotting.plot_thin_film_comparison
  • colour.plotting.plot_thin_film_spectrum
  • colour.plotting.plot_thin_film_iridescence
  • colour.plotting.plot_thin_film_reflectance_map
  • colour.plotting.plot_multi_layer_stack
image image

Preflight

Code Style and Quality

  • Unit tests have been implemented and passed.
  • Pyright static checking has been run and passed.
  • Pre-commit hooks have been run and passed.
  • [N/A] New transformations have been added to the Automatic Colour Conversion Graph.
  • New transformations have been exported to the relevant namespaces, e.g. colour, colour.models.

Documentation

  • New features are documented along with examples if relevant.
  • The documentation is Sphinx and numpydoc compliant.

@KelSolaar KelSolaar added this to the v0.4.7 milestone Oct 14, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 14, 2025

Coverage Status

coverage: 99.25% (-0.1%) from 99.354%
when pulling 3254159 on feature/thin_film
into 6f5a8ae on develop.

@KelSolaar KelSolaar force-pushed the feature/thin_film branch 3 times, most recently from c5f20da to 10966f4 Compare October 17, 2025 20:34
@KelSolaar KelSolaar merged commit 0135c3a into develop Oct 18, 2025
29 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants