# Change in the permittivity tensor of a material in 3D and 2D simulations

#1

Hello,
I have a permittivity tensor as a material definition, in which z direction is the direction of magnetization and light propagation. E=[e11, -ig, 0; ig, e22, 0; 0, 0, e33]
This means it is suitable for 3D simulations, but for 2D simulations, y direction is the direction of interest. So I wonder how should I change the permittivity matrix to adopt with 2D simulations.

#2

Dear @skharratian15

Can you please elaborate more on why you need to change the matrix permittivity? My understanding is that you need to define your material with permittivity tensor and then use it in 2D or 3D simulations, and I do not think that you will need to modify the permittivity.

The only concern is that since permittivity tensor is anisotropic, you need to diagonalize it first. This is explained in the link below:
https://kb.lumerical.com/en/index.html?materials_anisotropic.html

Thanks

#3

Thank you so much for the reply.
As I have mentioned, the permittivity matrix that I have is compatible with a configuration in which the magnetization and anisotropic direction is in Z direction, which suits with the 3D simulations in Lumerical. But in 2D simulations, the Y direction is the important direction (for my case, direction of magnetization and light propagation); so I think I should change the matrix accordingly before diagonalizing it.

#4

Dear @skharratian15

If I understood your question, you want to rotate your axises along x-axis by 90 degrees. As a result, you need to transform the permittivity tensor into new axes. For a rotation along the x-axis, you will need to unitary rotation matrix in the form of:

ux=(1, 0, 0
0, cos(θ), -sin(θ)
0, sin(θ),  cos(θ)
)

where θ= π/2. Thus you need to calculate:

ϵ_new = ux_dagger * ϵ_old * ux

Doing so, the new permittivity tensor would be:

ϵ_new = (ϵ11, 0, ig
0, ϵ33, 0
-ig, 0,  ϵ22
)

Now you can can diagonalize this matrix using grid attributes and eig command.

Thanks

#5

Dear @bkhanaliloo,
I would like to know the functioning of ϵ_old in the equation ‘ϵ_new = ux_dagger * ϵ_old * ux’.

1. I expect the ϵ_old is isotropic in nature and would like to know the calculation of the permittivity tensor. Is it the correct approach of thinking in the simulation point of view?
2. since the unitary rotation matrix is usually 3by3 matrix whereas the ϵ_old functions with frequency (normally cannot be 3by3 matrix) cannot be multiplied…Can you clarify that the following model (spatial variation of transformation) script can be used to acheive the diagonal elements of permittivity?

# define positions where the object refractive index values and grid attribute will be defined
# a cube where x, y, and z span from 0-1 um
x = linspace(0,2e-6,2);
y = linspace(0,2e-6,2);
z = linspace(0,2e-6,10);

# initialize matrix to hold diagonal refractive index and matrix transform U at each location

eps_diag = matrix(length(x),length(y),length(z),3);# dimensions correspond to [x,y,z,n] where n is a 1x3 vector containing nxx, nyy, nzz

U = matrix(length(x),length(y),length(z),3,3); # dimensions correspond to [x,y,z,U] where U is a 3x3 transform matrix
# loop through each position and calculate diagonalized permittivity and U
for (i=1:length(x)){ # loop through x
for (j=1:length(y)){ # loop through y
for (k=1:length(z)){ # loop through z
A = [ ???? ]; # permittivity at current location
**(in here I am struggling to solve this as I am confused whether my approach is correct or not)**
Evl = eig(A,1); # calculate eigenvalues
DeR = [sqrt(Evl(1));sqrt(Evl(2));sqrt(Evl(3))];# diagonal elements of refractive indexes
n_diag(i,j,k,1:3) = DeR;
Evc = eig(A,2); # calculate eigenvalues
U(i,j,k,1:3,1:3) = ctranspose(Evc);
} # end loop through z
} # end loop through y
} # end loop through z

#6

Hi @surabhi

In the original post, we wanted to find the new permittivity tensor when they were moved to new coordinates. However, your question is about spatially varying anisotropy:

https://kb.lumerical.com/en/index.html?ref_sim_obj_importing_spatial_nk.html

1. I am not quite sure if I understood your inquiry. $\epsilon_{old}$ is not isotropic. However, it is spatially uniform.

2. If permittivity changes with frequency, you can use sampled 3D data and set the anisotropy to diagonal. Please note that permittivity has to be diagonal at every frequency. Looking at your code, however, it looks like in your case permittivity varies as a function of position. Your approach looks correct to me, i.e. diagonalizing your tensor at each position. Please note that the matrix transform grid attribute should be also a tensor as a function of position. Please visit the link below for more details ( Spatially-varying Transform and matrix_transform_spatially_varying.lsf):

https://kb.lumerical.com/en/index.html?materials_anisotropic_matrix_transformation_grid_attribute.html

#7

Dear @bkhanaliloo
Thanks for your points of directions. Let us focus on the discussion as follows

1. In my case, Permittivity functions with frequency but not position. But, I cannot simply utilize the sampled 3D data and set the anisotropy to diagonal as it enables the duplication of the permittivity data in xx, yy, zz directions (under materials tab) whose values are all same for a particular frequency. This is why I named it as “isotropic”.
2. To overcome this problem, we should diagonalize the permittivity at every frequency as you mentioned.
3. To diagonalize it, we have to use the relation ϵ_new = ux_dagger * ϵ_old * ux.
4. In this, the unitary transformation matrix U is I have as
U = [ sqrt(2), 0, 0;
0, 1, 1i;
0, 1, -1i] / sqrt(2);
so that I can also calculate its complex conjugate. Please remember that these two are 3*3 matrices. I have inserted the ‘U’ through the matrix transformation grid attribute within the simulation area/volume by defining its position coordinates. This step confirms your statement that when the entire process is successfully executed, it becomes tensor and functions along with the diagonalized permittivity as a function of frequency by connecting it with the material object through establishing it as sample 3D data in the material list. This is the case of general anisotropic materials explained in https://kb.lumerical.com/en/index.html?materials_anisotropic.html.
5. As you can see my results and set up in the attached files, the matrix multiplication of point-3 is little weird and getting hard.
6. Once the point-3 is successfully achieved, the permittivity tensor (can be dispersive) need to be calculated by the “eig” command (https://kb.lumerical.com/en/index.html?ref_scripts_eig.html) from the resulted “ϵ_new” (this is epsilon diagonal matrix) matrix.
7. Calculating the eig values of the “ϵ_new” allows us to get the permittivity tensor……? (of what size?). In here, the tensor matrix is also dispersive which means at every frequency value, there will be a tensor matrix…!?

Hope, I explained well about my situations and struggling points along with the necessary files. Kindly, check and follow up my condition.

Thank you.

#8

Hi @surabhi

1. Regarding your comments, you should be able to add dispersive anisotropic material. After you select diagonal anisotropy for the sampled 3D data, you can assign different values to the effective index as is shown below:

You can also import data that has different values for the index.

We do not support non-diagonal dispersive material:
Calculation of magneto optical Faraday rotation for a range of wavelength

One workaround would be to run multiple simulations and sweep over wavelength. You will need to update material properties and grid attribute for every wavelength and use the approach as the linked page to diagonalize permittivity at each wavelengths.