Add `tocoo` to `Current` and `Source` operators
Initially I was against adding this for the following reason.
If one constructs a simple current: kwant.operator.Current(syst)
then tocoo
would simply return a zero matrix, as the currents all cancel: J_ij + J_ji = 0
.
However I now realize that I am inconsistent in my outrage, as in this case act
also maps any input to the zero vector, which is equally as "unexpected" as
the hypothetical behaviour of tocoo
.
In addition, @pablopiskunow points out a case he came accross when tocoo
would not return a zero matrix: when constructing a velocity operator as kwant.operator.Current(syst, lambda site: site.pos[0])
. Given that such cases exist, we should implement tocoo
to be consistent.