Closed SimonMel closed 3 years ago
I found my mistake. However, it remains unclear how you use the griddata function. How can you construct a 2D berry curvature map with this function? You first construct a grid for kx and ky values (column 1 and 2 resp), and than use griddata where your z-value is the berry curvature? But z is only a 1D vector?
Can you elaborate on your code? Thank you.
If you look at the line where the griddata function is used in the contour.py script, you can find that x and y points are grouped and its corresponding z value is matched directly. So, (x,y) -> z , then they are 1D variable. Although the data type is 1D like, interpolation is performed over the fine grid, since the target grid is also being 1D by (xi, yi) grouping.
First of all, thank you for the user-friendly code to calculate the Berry curvature and Chern number.
Sorry for my ignorance but I had some problems with the contour.py file. First, I had to include a line for importing 'griddata' from 'scipy.interpolate' which was giving an error for me. However, I still have an error related to griddata, which I was not able to resolve:
File "/Users/simon/opt/anaconda3/envs/Boltzmann/lib/python3.8/site-packages/scipy/interpolate/ndgriddata.py", line 226, in griddata raise ValueError("Unknown interpolation method %r for " ValueError: Unknown interpolation method array([....]) for 1 dimensional data
I think it is problem with the form of the array in BERRYCURV.dat but I was not able to resolve this issue? I would appreciate any help.
Kind regards, Simon