-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hello! I was interested in learning Julia after some persistent persuasion and decided to add a little bit to this package as a first pass because I too exist in Mueller calculus.
Specifically, I’m trying to add the depolarizing decomposition of a Mueller matrix so that you can analytically separate out the Depolarizer, Retarder, and Diattenuator from a single Mueller matrix.
For the time being, here’s the Diattenuator function
using LinearAlgebra
function decompose_diattenuator(M)
T = M[1, 1]
diattenuation_vector = M[1, 2:4] / T
D = sqrt(dot(diattenuation_vector, diattenuation_vector))
mD = sqrt(1 - D^2)
diattenuation_norm = diattenuation_vector # / mD
DD = kron(diattenuation_vector, transpose(diattenuation_vector))
# Create the diattenuator
I = diagm([1., 1., 1.])
inner_diattenuator = (I * mD) + (1 - mD) * DD
# Put it all together
Md = zeros(4, 4)
Md[1, 1] = 1.
Md[1, 2:4] = diattenuation_vector
Md[2:4, 1] = diattenuation_vector
Md[2:4, 2:4] = inner_diattenuator
Md = Md * T
return Md
end
Does this sound like it would be a useful inclusion to Mueller.jl? If so, I can get started on a PR
Metadata
Metadata
Assignees
Labels
No labels