Exemplo n.º 1
0
def is_minimal(G, u, O, K):
    """
    Checks if G is a minimal Groebner basis.
    """
    G.sort(key=lambda g: O(sdp_LM(g, u)))
    for i, g in enumerate(G):
        if sdp_LC(g, K) != K.one:
            return False

        for h in G[:i] + G[i + 1 :]:
            if monomial_divides(sdp_LM(g, u), sdp_LM(h, u)):
                return False

    return True
Exemplo n.º 2
0
def is_minimal(G, u, O, K):
    """
    Checks if G is a minimal Groebner basis.
    """
    G.sort(key=lambda g: O(sdp_LM(g, u)))
    for i, g in enumerate(G):
        if sdp_LC(g, K) != K.one:
            return False

        for h in G[:i] + G[i + 1:]:
            if monomial_divides(sdp_LM(g, u), sdp_LM(h, u)):
                return False

    return True
Exemplo n.º 3
0
def test_sdp_LC():
    assert sdp_LC([], QQ) == QQ(0)
    assert sdp_LC([((1, 0), QQ(1, 2))], QQ) == QQ(1, 2)
    assert sdp_LC([((1, 1), QQ(1, 4)), ((1, 0), QQ(1, 2))], QQ) == QQ(1, 4)