Large expansion of the dfunc_population() docstring.
Fixed some index names.
Fixed a call to the non-existant chi2_element() function (should be to chi2()).
Missing import.
Fixes for the setup of the N-state model optimisation code.
Fixes for the func_population() target function.
Fixed the call to to_tensor().
Fixed the setting up of optimisation of the population N-state model.
Spelling fix for the word 'indices'.
Another spelling fix for 'indices'.