Ask Your Question

Revision history [back]

The cause of the error message is that your function reg is returning all zero values for the first matrix H. Somewhere down the line Sage tries to take an inverse of zero and that returns an error. I've created a ticket to report this problem.

One workaround for you is to have your function return a small nonzero value rather than exactly zero to avoid the error. Here's a live example.