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:
- 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.
gradk = gradient(u_nk(n, ki), k(ki));
integral = calculateIntegral(u_nk(n, ki));
Omega(n, ki) = cross(gradk, integral);
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);
integrand = u_nk(x(i), y(j)) * gradient(u_nk(x(i), y(j)), x(i), y(j));
integral = integral + trapz(y, integrand);
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