ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 02 Feb 2016 05:26:18 +0100Can I import M2 matrices into sage?https://ask.sagemath.org/question/32413/can-i-import-m2-matrices-into-sage/I have thousands of matrices I computed in Macaulay2. They are scattered throughout sub-directories of `~/matrices/` one example of one of these matrices is
$ cat ~/matrices/foo/001-matrix
map((ZZ)^9,(ZZ)^7,{{1, 0, -1, 0, 0, 0, 0}, {1, 0, 1, 0, 0, 0, 0}, {1, 0, 0, -1, -1, -1, -1}, {1, 0, 0, 1, 0, 0, 0}, {1, 0, 0, 0, 1, 0, 0}, {0, 1, 0, 0, 0, 1, 0}, {0, 1, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0}})
I would like to write a script to convert each of these matrices into a format that sage can read. It seems like
sage: A = macaulay2(value get "~/matrices/foo/001-matrix")
should work but this returns the error `invalid syntax`. Is it possible to perform my desired conversions?done_with_fishTue, 02 Feb 2016 05:26:18 +0100https://ask.sagemath.org/question/32413/