Giter VIP home page Giter VIP logo

mueller.jl's Introduction

Mueller.jl

Build Status PkgEval Coverage License

Stable Dev

Mueller matrices for common optical components such as polarizers, phase retarders, and attenuating filters. The matrices are built using StaticArrays.jl for speed and can be arbitrarily rotated.

Installation

julia>] add Mueller

Usage

Import the library like any other Julia package

julia> using Mueller

Mueller.jl provides building blocks for common components. Here I generate the Mueller matrix for an optical system comprising three linear polarizers, each rotated 45 degrees from the one prior. Notice the matrix multiplication is inverse the order of the optical components.

julia> M = linear_polarizer/2) * linear_polarizer/4) * linear_polarizer(0)
4×4 StaticArrays.SMatrix{4, 4, Float64, 16} with indices SOneTo(4)×SOneTo(4):
  0.125         0.125        0.0  0.0
 -0.125        -0.125        0.0  0.0
 -1.53081e-17  -1.53081e-17  0.0  0.0
  0.0           0.0          0.0  0.0

you'll notice some roundoff due to the finite precision of π/4, you can avoid this by using Unitful.jl

julia> using Unitful: °

julia> M = linear_polarizer(90°) * linear_polarizer(45°) * linear_polarizer(0°)
4×4 StaticArrays.SMatrix{4, 4, Float64, 16} with indices SOneTo(4)×SOneTo(4):
  0.125   0.125  0.0  0.0
 -0.125  -0.125  0.0  0.0
  0.0     0.0    0.0  0.0
  0.0     0.0    0.0  0.0

let's see what happens when completely unpolarized light passes through these filters. We can represent light using the Stokes vector

julia> S = [1, 0, 0, 0] # I, Q, U, V
4-element Vector{Int64}:
 1
 0
 0
 0

julia> Sp = M * S
4-element StaticArrays.SVector{4, Float64} with indices SOneTo(4):
  0.125
 -0.125
  0.0
  0.0

the output vector has 1/8 the total intensity of the original light, and it is 1/8 polarized in the -Q direction (vertical). This demonstrates the somewhat paradoxical quantum behavior of light (Bell's Theroem, inspired by this video): even though the light passes through two orthogonal linear polarizers (the 0° and 90° ones) because the wave equation operates probabilistically, 50% passes through the first polarizer, 50% of that light passes through the 45° polarizer, and then 50% of the remaining light passes through the final polarizer, combining to 1/8 of the original light.

Contributing and Support

If you would like to contribute, feel free to open a pull request. If you want to discuss something before contributing, head over to discussions and join or open a new topic. If you're having problems with something, please open an issue.

mueller.jl's People

Contributors

mileslucas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jashcraf

mueller.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.