Generalize samplers to arbitrary function of machine
Created by: gcarleo
This PR allows to sample from other functions of the machine. In general it is now possible to sample from F(machine(x)), for arbitrary real-valued F. By default, F(X)=|X|^2. e.g. Sampling from |machine(x)| is useful when dealing with density matrices for example.