Commit 58a40d63 authored by Lucas Laplanche's avatar Lucas Laplanche
Browse files

data

parent e52aaf78
......@@ -141,19 +141,19 @@ def scattering_matrix_global():
def scattering_matrix_layer(vi, vg, xi):
a = np.identity(2) + np.matmul(np.linalg.inv(vi), vg)
b = np.identity(2) - np.matmul(np.linalg.inv(vi), vg)
a = np.identity(2) +np.linalg.inv(vi) @ vg
b = np.identity(2) -np.linalg.inv(vi) @ vg
xb = np.matmul(xi, b)
bab = np.matmul(np.matmul(b, np.linalg.inv(a)), b)
xbax = np.matmul(np.matmul(xb, np.linalg.inv(a)), xi)
xb = xi @ b
bab = b @ np.linalg.inv(a) @ b
xbax = xb @ np.linalg.inv(a) @ xi
d = a - np.matmul(xbax, b)
e = np.matmul(xbax, a) - b
f = np.matmul(xi, a - bab)
d = a -xbax @ b
e = xbax @ a - b
f = xi @ (a - bab)
s_11_22 = np.matmul(np.linalg.inv(d), e)
s_12_21 = np.matmul(np.linalg.inv(d), f)
s_11_22 = np.linalg.inv(d) @ e
s_12_21 = np.linalg.inv(d) @ f
s = np.array([[s_11_22, s_12_21],
[s_12_21, s_11_22]])
......@@ -162,19 +162,19 @@ def scattering_matrix_layer(vi, vg, xi):
return s
def redheffer_star_product(sg, si):
ig = np.matmul(si[0, 0], sg[1, 1])
gi = np.matmul(sg[1, 1], si[0, 0])
def redheffer_star_product(sa, sb):
ba = sb[0, 0] @ sa[1, 1]
ab = sa[1, 1] @ sb[0, 0]
d = np.matmul(sg[0, 1], np.linalg.inv(np.identity(2) -ig))
f = np.matmul(si[1, 0], np.linalg.inv(np.identity(2) -gi))
d = sa[0, 1] @ np.linalg.inv(np.identity(2) -ba)
f = sb[1, 0] @ np.linalg.inv(np.identity(2) -ab)
s = np.array([[
sg[0, 0] +np.matmul(np.matmul(d, si[0, 0]), sg[1, 0]),
np.matmul(d, si[0, 1])
sa[0, 0] +d @ sb[0, 0] @ sa[1, 0],
d @ sb[0, 1]
], [
np.matmul(f, sg[1, 0]),
si[1, 1] +np.matmul(np.matmul(f, sg[1, 1]), si[0, 1])
f @ sa[1, 0],
sb[1, 1] +f @ sa[1, 1] @ sb[0, 1]
]])
......@@ -199,7 +199,7 @@ def em_amplitude_scattering_matrix(super_lattice, wavelength, normalize=True):
q_global = np.array([[0., 1.],
[-1., 0.]])
eigen_g = 1j * np.identity(2)
v_global = np.matmul(q_global, np.linalg.inv(eigen_g))
v_global = eigen_g @ q_global
# initialize global scattering matrix
s_global_ini = scattering_matrix_global()
......@@ -222,8 +222,8 @@ def em_amplitude_scattering_matrix(super_lattice, wavelength, normalize=True):
k_z_i = k_0 * k_zt_i
eigen_i[i] = 1j * k_zt_i * np.identity(2)
q_i = np.array([[0., k_zt_i**2],
[-k_zt_i**2, 0.]])
q_i = np.array([[0., k_zt_i**2],
[-k_zt_i**2, 0.]])
v_i[i] = np.matmul(q_i, np.linalg.inv(eigen_i[i]))
x_i = expm(1j * k_z_i * l * np.identity(2))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment