Julia implementation of Mie theory for nanophotonics
Julia implementation of Mie theory for nanophotonics.[1]
Author is checking the validity of the implementation as much as possible, but any warranty is not provided.
This project is under development. Because jlmie is just a transported program from author’s homebuilt package written in different language, its implementation might not be optimized for Julia language…
Use Julia Package Manager (]) and run
(@v1.5) pkg> add https://github.com/Hinamoooon/jlmie.git
jlmie depends on a following package.
SpecialFunctions
for computation of Bessel functionsInstallation of following packages are recommended to visualize calculated results. Example codes in ./example
require prior installation of them.
Plots
for visualizationPyPlot
for visulization of 3D graphsUse Julia Package Manager (]) and run
(@v1.5) pkg> add Plots PyPlot
[To be updated once it is published in the Julia’s public repositry]
Install jlmie following the Installation section.
using jlmie
using Plots
lbd0 = (400:800)1e-9;
lbdp = lbd01e9; # used for plot
3. calculation
m,x = jlmie_mx(nmat,radius,lbd0) # Environment is vacuum (nenv = 1) by default
Qsca = jlmie_Qsca(m,x)
4. plot the calculated spectrum
plot(lbdp,Qsca,
xlabel = “Wavelength (nm)”,
ylabel = “Scattering efficiency”,
legend = false,
)
```
Some example codes are included in ./example
.
ex01_Qsca_n4r100.jl
calculates total scattering efficiency spectrum of a high-refractive-index nanosphere (n = 4) of 100 nm in radius.ex02_QscaMultipoles_n4r100.jl
calculates total scattering efficiency of a sphere with n = 4 and r = 100 nm and each contribution from n-th order electric and magnetic Mie resonance.ex03_ForwardBackward_n4r100.jl
calculates forward (θ = 0°) and backward (θ = 180°) scattering intensities.ex04_2DRadiationPattern_n4r100.jl
calculates far-field radiation patterns at a fixed wavelength.ex05_3DRadiationPattern_n4r100.jl
is a 3D version of ex04 which calculates radiation pattern.Important functions are included in ./src
. If you want to see source codes of any functions, see ./src/jlmie.jl
.
Tatsuki Hinamoto@Kobe University, Japan
jlmie is distributed under MIT license.