my_metasurface
- class cemd_metasurf.Metasurface(a=400, b=400, x=0, y=0, z=0, th=1.5707963267948966, eps_b=1, d_layer=0)[source]
Class for defining the metasurface “a” and “b” are the lengths of the lattice vectors (“a” along the x-axis) and “th” is the angle between the lattice vectors. For example the lattice vector “hat(v_1)” and “hat(v_2)” would be: “hat(v_1) = a hat(x)”, “hat(v_2) = b (cos(th)*hat(x) + sin(th)*hat(y))”. Note that “norm(hat(v_1)) = a” and “norm(hat(v_2)) = b”. “x”, “y” and “z” defined the position of the particles in the unit cell. “eps_b” is the backgroud permittivity and the permittivity of the layred substrate (if present). “d_layer” defined the with of the layered substrate (if present).
- Parameters:
a (float) – Length lattice vector along the x-axis
b (float) – Length lattice vector along the other axis (defined by the :param th)
x (float or numpy.ndarray) – Position in the x-axis of the particles that composed the unit cell.
y (float or numpy.ndarray) – Position in the y-axis of the particles that composed the unit cell.
z (float or numpy.ndarray) – Position in the z-axis of the particles that composed the unit cell.
th (float) – Angle between lattice vectors.
eps_b – Permittivity of the media.
d_layer – It will defined the width of the layers of the substrate.
- set_lattice(a, b, th)[source]
Set the properties of the lattice (lattice vectors and the angle between them).
- Parameters:
a (float) – Length lattice vector along the x-axis
b (float) – Length lattice vector along the other axis (defined by the :param th)
th (float) – Angle between lattice vectors.
- get_lattice()[source]
Return lattice parameters.
- Returns:
tuple with the lattice parameters a, b and th.
- set_unit_cell(x, y, z)[source]
Set the position of the particles in the unit cell.
- Parameters:
x (float or numpy.ndarray) – Position in the x-axis of the particles that composed the unit cell.
y (float or numpy.ndarray) – Position in the y-axis of the particles that composed the unit cell.
z (float or numpy.ndarray) – Position in the z-axis of the particles that composed the unit cell.
- get_unit_cell()[source]
Return unit cell configuration.
- Returns:
tuple with the position of the particles in the unit cell (x, y and z)
- set_bloch(my_bloch)[source]
Set the actual Bloch wavevector configuration (it takes the last entry of my_bloch). “k” is the wavevector in the medium where the metasurface is placed (k = 2pi/lambda*sqrt(eps_b[0])) By the moment, “eps_b” is a number, but it will be generized in the future for supporting substrates. “kx” and “ky” are the Bloch wavevector (periodicity along the metasurface plane).
- Parameters:
my_bloch (classes.BlochWavevector) – The object with the information of the wavevectos
- get_bloch()[source]
Return the actual Bloch wave configuration.
- Returns:
tuple with the Bloch wave configuration (k, kx and ky)
- set_particles(my_particle)[source]
Set all particle to have the properties given by “my_particle”.
- Parameters:
my_particle (classes.ParticleMie (or other particle)) – The object with the information of the particle.
- set_particle_i(my_particle, i)[source]
Set the particle “i” to have the properties given by “my_particle”.
- Parameters:
my_particle (classes.ParticleMie (or other particle).) – The object with the information of the particle.
i (Int) – Index of the particle that will be set.
- set_alpha()[source]
Set the polarizability to the one defined in self.particles at the inner wavevector (self.k).
- set_alpha_user_defined(alp)[source]
Set the polarizability to a given specific matrix. At the moment is not really used (“set_alpha” is the one used for setting the polarizability for calculating r and t), but in the future I would like to give more flexibility to the code and, for example, being able of easyly set quirality (modify the off-diagonal matrices of alp).
- Parameters:
alp (numpy.ndarray) – Polarizability of the system.
- class cemd_metasurf.BlochWavevector(k, kx, ky)[source]
Class to handle the Bloch wavevectors “k” is the wavevector (in the medium). “kx” and “ky” are the Bloch wavevector (periodicity along unit cells).
- Parameters:
k (float or numpy.ndarray) – Wavevector in the medium.
kx (float or numpy.ndarray) – Bloch wavevector (Floquet periodicity) along the x-axis.
ky (float or numpy.ndarray) – Bloch wavevector (Floquet periodicity) along the y-axis.
- class cemd_metasurf.ParticleMie(r_p=1, eps=1, wp=0, wr=0, gr=0)[source]
Class to set the properties of the particle to a Mie particle with a permittivity given by a Drude-Lorentz model (at the moment with one single resonance).
- Parameters:
r_p (Float) – Radius of the particles.
ei (Float) – Permittivity at high frecuencies (avobe resonances).
wp (Float (I will generalize it to an array setting several resonances)) – Plasma frequency.
wr (Float (I will generalize it to an array setting several resonances)) – Resonant frequency.
gr (Float (I will generalize it to an array setting several resonances)) – Width of the resonance.