Hi Nick,

On Fri, Jan 15, 2010 at 3:14 PM, Nick Alexander <ncalexan...@gmail.com> wrote:

<SNIP>

> To me, these look like the same expressions, just one has variables sorted
> differently (h < e?) and different term orders.  What is the issue?

Something like the following is OK:

[mv...@mod sage-4.3.1.alpha2-sage.math.washington.edu-x86_64-Linux]$ ./sage
----------------------------------------------------------------------
| Sage Version 4.3.1.alpha2, Release Date: 2010-01-13                |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
sage: var("a, b, c, d, e, f, g, h");
sage: S = matrix([[a,b], [c,d]])
sage: D = matrix([[e,f], [g,h]])
sage: K = S*D
sage: y = expand(K.det()); y
a*d*e*h - a*d*f*g - b*c*e*h + b*c*f*g
sage: simplify(y)
-a*d*f*g + a*d*h*e + b*c*f*g - b*c*h*e


What got me, and the original querent, confused is the following simplification:

sage: reset()
sage: var("a1, b1, c1, d1, a2, b2, c2, d2");
sage: A = matrix([[a1,b1], [c1,d1]])
sage: B = matrix([[a2,b2], [c2,d2]])
sage: M = A*B
sage: y = expand(M.det()); y
a1*a2*d1*d2 - a1*b2*c2*d1 - a2*b1*c1*d2 + b1*b2*c1*c2
sage: simplify(y)
b1*b2*c1*c2 - a1*b2*c2*factorial(k + 2*n - 1)/factorial(2*k + 4*n) -
a2*b1*c1*factorial(k + 3*n - 1)/factorial(2*k + 6*n) +
a1*a2*factorial(k + 2*n - 1)*factorial(k + 3*n - 1)/(factorial(2*k +
4*n)*factorial(2*k + 6*n))
sage: bool(simplify(y) == y)
True

But if I now use underscores, the command simplify() works as I expect:

sage: reset()
sage: var("a_1, b_1, c_1, d_1, a_2, b_2, c_2, d_2");
sage: A = matrix([[a_1, b_1], [c_1, d_1]])
sage: B = matrix([[a_2, b_2], [c_2, d_2]])
sage: M = A*B
sage: y = expand(M.det()); y
a_1*a_2*d_1*d_2 - a_1*b_2*c_2*d_1 - a_2*b_1*c_1*d_2 + b_1*b_2*c_1*c_2
sage: simplify(y)
a_1*a_2*d_1*d_2 - a_1*b_2*c_2*d_1 - a_2*b_1*c_1*d_2 + b_1*b_2*c_1*c_2
sage: bool(simplify(y) == y)
True

-- 
Regards
Minh Van Nguyen
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to