JuliaPhysics / JuliaPhysics/Mueller.jl
Adding depolarizing decomposition
- Dominant language
- Julia
- Stars
- 11
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
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
```julia
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
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue provides a Julia decompose_diattenuator function but names no repository file or test. Start by locating the package's Mueller-matrix types and related operations, then define and implement the full depolarizing decomposition; done means the Depolarizer, Retarder, and Diattenuator can be recovered from one Mueller matrix and are covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100