Anton Akhmerov wrote:
On Fri, Mar 23, 2018 at 5:22 PM,
wrote: Is there currently way to visualize the current through a 2D cut for a 3D system that does not involve messing with the kwant code?
* After computing the current across those hoppings, you would need to call kwant.plotter.interpolate_current. This function only does the interpolation, but no plotting. Having that interpolation in 3D you need to slice it and probably take a projection onto 2D plane.
This gives me the following idea: Currently, interpolate_current interpolates the current in a n-dimensional Kwant system onto a n-dimensional grid. But as we can from Eleni's request it can be useful to generalize this. Without complicating the interface for simple use cases we could do the following: we separate the interpolation algorithm from interpolate_current. I.e. there would be a function (e.g. interpolate_vector_field) that takes a n-dimensional current field (i.e. a sequence of pairs of points together with the current strengths) and interpolates this onto a given m-dimensional grid, with m <= n. Without loss of generality, the grid can be oriented along the first m axes since an arbitrary transformation may be applied to the hoppings before interpolate_vector_field is called. This would allow Eleni to plot currents across any plane. Incidentally, the function interpolate_vector_field matches quite exactly the part of interpolate_current that should be implemented in C to speed it up.