Hi Sergey,

The error you got is `ValueError: Cannot increase the number of moments if 
'accumulate_vectors' is 'False'.`.
This error is solved by passing `accumulate_vectors=True` to 
`kwant.kpm.conductivity()` as 

```
cond = 
kwant.kpm.conductivity(sys,alpha=component1,beta=component2,params=params, 
accumulate_vectors=True)
cond.add_moments(100)
```

Beware that the implementation here is the quickest version in terms of 
computation time, but is the most expensive in terms of RAM.

Both of them scale as `N*M^2`, where N is the Hamiltonian size (total number of 
orbitals in the system), times the number of moments squared.

If before you could do an LDoS with `10^4` moments, the conductivity will use 
`10^4` times the RAM and computation time, which is a lot for medium to large 
system sizes, and likely undoable in a laptop, you would need a node in a 
cluster with dozens or hundreds of GBs of RAM.

There are other implementations that discard vectors, and recompute them 
on-the-fly, this approach takes much less memory and much more computation 
time, and it is *not* implemented in Kwant.

I hope the information helps, best regards,
Pablo

Reply via email to