Reflectance at constant angle of incidence

Example for calculating the reflectance at a constant angle of incidence for the metasurface used in [D.R. Abujetas, et. al., PRB, 102, 125411 (2020)]

# Import libraries
import cemd_metasurf as cemd
import numpy as np
import matplotlib.pyplot as plt

# Set a square metasurface of lattice constant a.
a = 400
my_metasurface = cemd.Metasurface(a,a)

# Set the wavevector at which the reflectance (R) is calculated
# theta is the angle of incidence
nk = 1001
theta = 10*np.pi/180
k = np.linspace(0.45,0.85,nk)*2*np.pi/a
ky = np.zeros_like(k)
kx = k*np.sin(theta) 
my_bloch = cemd.BlochWavevector(k,kx,ky)

# Calculation of the depolarization Green function and R
my_metasurface.calc_gb_kxky(my_bloch)
my_metasurface.calc_rt_kxky()
r_tm, r_te, t_tm, t_te = my_metasurface.get_rt()

# Ploting R
plt.plot(k*a/2/np.pi,r_te, label='TE')
plt.plot(k*a/2/np.pi,r_tm, label='TM')
plt.title('Reflectance at $theta$ = ' + str(theta*180/np.pi))
plt.xlabel('ka/2pi')
plt.ylabel('R')
plt.legend()
plt.show()

2D reflectance map for TE wave

2D map of the reflectance for TE polarization as a function of the frequency and the angle of incidence

# Import libraries
import cemd_metasurf as cemd
import numpy as np
import matplotlib.pyplot as plt

# Set a square metasurface of lattice constant a
a = 400
my_metasurface = cemd.Metasurface(a,a)

# Set the wavevector at which the reflectance (R) is calculated
nk = 101
ang1 = np.linspace(0,89,nk)*np.pi/180
k = np.linspace(0.3,0.9,nk)*2*np.pi/a
ky = np.zeros_like(k)

# Calculation of the depolarization Green function and R
for ang in ang1:
    kx = k*np.sin(ang) 
    my_bloch = cemd.BlochWavevector(k,kx,ky)
    my_metasurface.calc_gb_kxky(my_bloch)
my_metasurface.calc_rt_kxky()
r_tm, r_te, t_tm, t_te = my_metasurface.get_rt()
r_te = r_te.reshape(nk,nk)

# Ploting R
fig, ax = plt.subplots()
CS = ax.contourf(k*a/2/np.pi,ang1*180/np.pi,r_te,100)
fig.suptitle('2D map of the reflectance for TE waves')
ax.set_xlabel('ka/2pi')
ax.set_ylabel('$theta$ (deg)')
cbar = fig.colorbar(CS)
cbar.ax.set_ylabel("R")
plt.show()

Change particle properties

Reflectance at a constant angle of incidence for a different particle

# Import libraries
import cemd_metasurf as cemd
import numpy as np
import matplotlib.pyplot as plt

# Set a rectangular metasurface of lattice constant a and b.
a = 400
b = 300
my_metasurface = cemd.Metasurface(a,b)

# Change the property of the particle that defined the unit cell
my_particle = cemd.ParticleMie(r_p = 80, eps = 9, wp=0, wr=0, gr=0)
my_metasurface.set_particles(my_particle)

# Calculation of R and T for a given incidence
nk = 1001
theta = 10*np.pi/180
k = np.linspace(0.45,0.85,nk)*2*np.pi/a
ky = np.zeros_like(k)
kx = k*np.sin(theta) 
my_bloch = cemd.BlochWavevector(k,kx,ky)

my_metasurface.calc_gb_kxky(my_bloch)
my_metasurface.calc_rt_kxky()
r_tm, r_te, t_tm, t_te = my_metasurface.get_rt()

plt.plot(k*a/2/np.pi,r_te, label='TE')
plt.plot(k*a/2/np.pi,r_tm, label='TM')
plt.title('Reflectance at $theta$ = ' + str(theta*180/np.pi))
plt.xlabel('ka/2pi')
plt.ylabel('R')
plt.legend()
plt.show()