Python linear algebra routines