| 1 | initial version |
If you define your matrices containing elements of the field $\mathbb Z/p\mathbb Z$, solve_right does what you need.
sage: A = matrix(GF(17), [[6,3], [3,8]])
sage: b = matrix(GF(17), [1, 2]).transpose()
sage: A.solve_right(b)
[14]
[12]
If for some reason you need matrices over (say) $\mathbb Z$ but still need to solve modulo some prime $p$, you can use change_ring.
sage: A = matrix(ZZ, [[1,2], [3,4]])
sage: b = matrix(ZZ, [5, 6]).transpose()
sage: A.change_ring(GF(17)).solve_right(b.change_ring(GF(17)))
[13]
[13]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.