Implement plotting current density
Current State of Affairs
Currently it is possible to use kwant.plotter.map
to make colorplots of scalar quantities
defined on sites in a kwant system. This is routinely used to plot charge density, for example. What is missing is a way to plot quantities such as current densities which are defined on the system's hoppings.
Proposed Solution
Add a new function to plotter, map_current
(name to discuss), that will take a quantity defined over all hoppings in the system and will create a nice visualisation.
We will probably use Matplotlib's streamplot for this. Essentially the problem boils down to creating a reasonable-looking continuous vector field defined everywhere in space from the values of the "currents" which are only defined on individual hoppings.
Action Steps
A solution to this problem was proposed by a Masters student in Grenoble (Adrien Sorgniard), however the code is not in a merge-worthy state. The person looking to address this issue will need to take the code that he has written, understand it, and modify it so that it is of merge-able quality. This will involve:
-
getting Adrien's code from his Kwant fork (ask @jbweston or @cwg) - understanding the algorithms used (ask @cwg)
- understanding Adrien's implementation
-
adding comments / refactoring the code where necessary to make it readable -
adding tests, especially for edge cases -
radding an example in the documentation