a simple side-effect free linear algebgra in python