Add `DiscreteHilbert.states_to_local_indices` as it seems that it's used in multiple places
Created by: PhilipVinc
This function convert every local degree of freedom which might be a whatever number to an integer index from 0 to ... Max.
This function already exists inside nk.models.autoregressive
because it's needed there, and it can easily be extended for fermonic stuff.
Moreover, this function came up as something that would be useful to implement #1209 concisely, so... here is it.