complex now optional, for better performance
renamed n2pi to n2ls for n to linear system