Filter löschen
Filter löschen

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 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

SANKALP DEV
SANKALP DEV am 9 Okt. 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 Kommentar
Dibaskar
Dibaskar am 9 Okt. 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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Particle & Nuclear Physics finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by