Ask Your Question
1

Elimination didn't find the correct ideal

asked 2024-10-30 14:21:48 +0100

cgr71 gravatar image

Hi! I'm trying to compute the polynomial relations among matrix entries:

Here is the setup:

# the following codes are from python with sagemath

a, b, c, d, e, f, g = var('a b c d e f g')
N = Matrix(SR,
   [[a, e, f, g],
    [e, b, 0, 0],
    [f, 0, c, 0],
    [g, 0, 0, d]]
)
M = N.inverse()

For the symmetric matrix N with the above zero patterns, we notice that the following relations should hold in its inverse, and indeed we verified them:

# below all passed

assert M[0, 0] * M[1, 2] * M[1, 3] - M[0, 1] ** 2 * M[2, 3] == 0
assert M[0, 1] * M[0, 2] - M[0, 0] * M[1, 2] == 0
assert M[0, 1] * M[0, 3] - M[0, 0] * M[1, 3] == 0
assert M[0, 2] * M[0, 3] - M[0, 0] * M[2, 3] == 0
assert M[0, 3] * M[1, 2] - M[0, 1] * M[2, 3] == 0
assert M[0, 2] * M[1, 3] - M[0, 1] * M[2, 3] == 0

Then, I tried to see if these relations can be found automatically by elimination:

tag_variable_names = [f'M_{i}_{j}' for i in range(4) for j in range(i, 4)]
R = PolynomialRing(QQ, tag_variable_names + ['a', 'b', 'c', 'd', 'e', 'f', 'g'])
R_gens = R.gens_dict()
param_symbolic_to_ring = {v: R_gens[str(v)] for v in [a, b, c, d, e, f, g]}

equations = []
for i in range(4):
    for j in range(i, 4):
        true_expr = M[i, j].subs(param_symbolic_to_ring)
        # this true expression is fraction of polynomials w.r.t. parameters a, b, c, ..., and can be very complicated
        # we clear the denominator as follows:
        numerator, denominator = true_expr.numerator(), true_expr.denominator()
        equations.append(R_gens[f'M_{i}_{j}'] * denominator - R(numerator))

I = R.ideal(equations)
# to get the relations among tag variables (entries of M), we eliminate the parameters
J = I.elimination_ideal(list(param_symbolic_to_ring.values()))
Ideal_M = J.change_ring(PolynomialRing(QQ, tag_variable_names))

I expect that the elimination ideal should contain the above relations. However, nothing was found:

> Ideal_M.gens()
[0]

Why does this happen? Could it be related to handling fractions during the elimination? Any insights would be appreciated!

edit retag flag offensive close merge delete

Comments

2

Btw, you don't need param_symbolic_to_ring, since instead of M[i, j].subs(param_symbolic_to_ring) you can simply use R.fraction_field()(M[i, j]). Also, true_expr (as you define it) is still a symbolic expression, as .subs() does not perform conversion to another ring.

Max Alekseyev gravatar imageMax Alekseyev ( 2024-10-30 16:03:56 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2024-10-30 15:49:07 +0100

rburing gravatar image

updated 2024-10-31 08:52:17 +0100

Here's a way to do the elimination properly:

R = PolynomialRing(QQ, names=['a','b','c','d','e','f','g'] + [f'm_{i}{j}' for i in range(4) for j in range(4)])
a,b,c,d,e,f,g = R.gens()[:7]
N = matrix(R,
   [[a, e, f, g],
    [e, b, 0, 0],
    [f, 0, c, 0],
    [g, 0, 0, d]]
)
M = matrix(R, 4, 4, R.gens()[7:])
I = R.ideal((M*N - identity_matrix(R,4,4)).list())
J = I.elimination_ideal([a,b,c,d,e,f,g])
J.gens()

Output:

[m_23 - m_32, m_13 - m_31, m_12 - m_21, m_03 - m_30, m_02 - m_20, m_01 - m_10, m_20*m_31 - m_10*m_32, m_21*m_30 - m_10*m_32, m_20*m_30 - m_00*m_32, m_10*m_30 - m_00*m_31, m_10*m_20 - m_00*m_21, m_00*m_21*m_31 - m_10^2*m_32]

And here's the way to fix your attempt, making the determinant invertible:

R = PolynomialRing(QQ, names=['a','b','c','d','e','f','g'] + [f'm_{i}{j}' for i in range(4) for j in range(4)] + ['det_N_inv'])
a,b,c,d,e,f,g = R.gens()[:7]
N = matrix(R,
   [[a, e, f, g],
    [e, b, 0, 0],
    [f, 0, c, 0],
    [g, 0, 0, d]]
)
det_N_inv = R.gens()[-1]
M = matrix(R, 4, 4, R.gens()[7:-1])
I = R.ideal((M - N.inverse()).apply_map(numerator).list() + [N.det()*det_N_inv - 1])
J = I.elimination_ideal([a,b,c,d,e,f,g,det_N_inv])
J.gens()

Output:

[m_23 - m_32, m_13 - m_31, m_12 - m_21, m_03 - m_30, m_02 - m_20, m_01 - m_10, m_20*m_31 - m_10*m_32, m_21*m_30 - m_10*m_32, m_20*m_30 - m_00*m_32, m_10*m_30 - m_00*m_31, m_10*m_20 - m_00*m_21, m_00*m_21*m_31 - m_10^2*m_32]
edit flag offensive delete link more

Comments

2

In your set up, OP's ideal is defined as

I = R.ideal((M - N.inverse()).apply_map(numerator).list())

It still leads to the zero elimination ideal, like in OP's question. I think the reason is that elimination in that case needs to know that N has nonzero determinant (to be able to cancel it as a factor), but I did not look closely.

Max Alekseyev gravatar imageMax Alekseyev ( 2024-10-31 00:47:51 +0100 )edit
2

Thanks @Max Alekseyev, I updated the answer making use of your hint.

rburing gravatar imagerburing ( 2024-10-31 08:50:36 +0100 )edit
1

Thank you @rburing and @Max Alekseyev Both solutions work!

cgr71 gravatar imagecgr71 ( 2024-11-01 06:38:47 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-10-30 14:21:48 +0100

Seen: 139 times

Last updated: Oct 31