Library for Smith normal form calculation