optimize 'to_unit_cell'
The current implementation is not optimized at all, making finding the FD quite slow. Could be improved by combining it with the old method: Pull back to the parallelepipedal UC (which is quite cheap) and only then apply the cvp
method, caching previous values (the firs step is needed, because to_unit_cell
is called many times for sites translated far away from the origin in fundamental_hoppings
). Some things inside cvp
only depend on basis
and not vec
, these could be cached, also the already calculated points should be reused when increasing l
.