Fix saving lists of arrays with recent versions of numpy
[qpms.git] / oldtests / c_Mie_tmatrices.py
blob2a0389be048bd29df42b1b1ab26a8fccd46975cc
1 #!/usr/bin/env python
2 # coding: utf-8
4 # In[1]:
7 from qpms import *
10 # In[6]:
13 R = 40e-9
14 ω_p = 9*eV/#9*eV/ℏ
15 ε_inf = 4.6
16 γ_p = 0.1*eV/
17 ε_b = 2.13
18 lMax = 3
20 ω = 1.5*eV/
23 # In[7]:
26 ε_m = ε_drude(ε_inf, ω_p, γ_p, ω)
29 # In[9]:
32 k_i = cmath.sqrt(ε_m)*ω/c
33 k_e = cmath.sqrt(ε_b)*ω/c
34 RH, RV, TH, TV = mie_coefficients(a=R, nmax=lMax, k_i=k_i, k_e=k_e, J_ext=1, J_scat=3)
37 # In[11]:
40 spec = BaseSpec(lMax=lMax)
41 cT = CTMatrix.spherical(spec, R, k_i, k_e, 1, 1)
44 # In[16]:
47 print(np.diag(cT[...]))
50 # In[18]:
53 print(RV)
54 print(RH)
57 # In[ ]: