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

44 vues (au cours des 30 derniers jours)
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

Réponse acceptée

SANKALP DEV
SANKALP DEV le 9 Oct 2023
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 commentaire
Dibaskar
Dibaskar le 9 Oct 2023
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

Connectez-vous pour commenter.

Plus de réponses (1)

Guifeng
Guifeng le 13 Fév 2025 à 13:37
Dear Dibaskar,
I am also working on similar problems recently. May I know how do you export un_k data from COMSOL. Moreover, as I understand, the un_k data of any single band at any single k vector should be a matrix for 2D phononic crtsyals, which means the un_k should be a 4 dimension matrix, how do you calculate gradient abour k for such matrix?
Wish to here from you, thank you!
Best,
Guifeng

Catégories

En savoir plus sur Photonics dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by