필터 지우기
필터 지우기

I am trying to calculate the Berry curvature of a topological photonic crystal and to solve this I need to write the formula of Berry curvature in MATLAB

조회 수: 38 (최근 30일)
Hello,
i am trying to get the plot of Berry Curvature for topological photonic crystal where the formula given below needs to be implemented in MATLAB.
u_nk data have been extracted from COMSOL, k varies from 0 to 3.
I am finding it difficult to implement this formula.
Any help would be appreciated.
Thanks

채택된 답변

SANKALP DEV
SANKALP DEV 2023년 10월 9일
Hi Dibaskar,
I understand that you want assistance in implementing the equation,’ Ωn(k) = k x unitcelld2runk*(r) runk(r)’, which represents the Berry curvature for a topological photonic crystal.
Kindly refer to the following steps to implement the equation:
  1. Define the necessary variables:
  • k (wavevector): Create an array of values from 0 to 3, depending on the desired range.
  • u_nk (eigenstate data): Import or generate the eigenstate data from COMSOL. This should be a matrix with dimensions n x k, where n is the number of eigenstates and k is the number of wavevectors.
2.Initialize the Berry curvature array:
  • Create an empty matrix ‘omega’ with dimensions ‘n x k.
3.Perform the calculations:
  • Loop through each wavevector ‘k’ and eigen state ‘n’.
  • For each combination of ‘k’ and ‘n’ calculate the berry curvature as shown in following code snippet.
for n = 1:size(u_nk, 1)
for ki = 1:length(k)
% Calculate the gradient of eigenstate with respect to k
gradk = gradient(u_nk(n, ki), k(ki));
% Calculate the integral over the unit cell
integral = calculateIntegral(u_nk(n, ki)); % Implement this function
% Calculate the Berry curvature
Omega(n, ki) = cross(gradk, integral);
end
end
Note that the function, ‘calculateIntegral’, mentioned here is a user defined function which can be implemented by the following code.
function integral = calculateIntegral(u_nk)
x = linspace(x_min, x_max, num_points);
y = linspace(y_min, y_max, num_points);
% Initialize the integral
integral = 0;
% Perform the integration using the trapezoidal rule
for i = 1:length(x)-1
for j = 1:length(y)-1
% Evaluate the integrand at each point
integrand = u_nk(x(i), y(j)) * gradient(u_nk(x(i), y(j)), x(i), y(j));
% Accumulate the results using the trapezoidal rule
integral = integral + trapz(y, integrand);
end
end
end
Replace x_min, x_max, y_min, y_max, and num_points with the appropriate values specific to your problem.
To know more about MATLAB functions used in above code, refer to following documentations.
Regards,
Sankalp
  댓글 수: 1
Dibaskar
Dibaskar 2023년 10월 9일
Thank you so much for such a detailed answer to my query.
I am indeed grateful to your reply.
I am trying to implement that code.
Also one last thing, can you tell me after calculating the berry curvature matrix, how to get the intensity plot?
The plot is between kx and ky vectors.
I am attaching a picture of the plot(taken from a literature) below.
Regards,
Dibaskar

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by