Fix saving lists of arrays with recent versions of numpy
[qpms.git] / oldtests / cytmatrices_consistence.py
blob4d0a689705f9fbd5e50a3a8164a0b9f6c4434bbf
1 from qpms import *
2 import numpy as np
3 R = 40e-9
4 lMax = 2
5 ω = 1.5*eV/
7 spec = BaseSpec(lMax = lMax)
9 inside = EpsMuGenerator(lorentz_drude['Au'])
10 outside = EpsMuGenerator(EpsMu(2.3104,1))
12 gensphere_arc = TMatrixGenerator.sphere_asarc(outside=outside, inside=inside, r=R, lMax_extend=lMax)
14 np.set_printoptions(precision=3, suppress=True,linewidth=1000)
16 QT = gensphere_arc.Q_transposed(ω, spec.norm)
17 RT = gensphere_arc.R_transposed(ω, spec.norm)
18 T = gensphere_arc(spec,ω)
21 QT_corrected = np.array(QT)
22 RT_corrected = np.array(RT)
23 QT_corrected[8:,:8] = 0
24 QT_corrected[:8,8:] = 0
25 RT_corrected[8:,:8] = 0
26 RT_corrected[:8,8:] = 0
27 T_corrected = np.dot(np.linalg.inv(QT_corrected), RT_corrected)
29 print("QT:")
30 print(QT)
32 print("RT:")
33 print(RT)
35 print("T:")
36 print(T[:])
38 print("T_corrected:")
39 print(T_corrected)