Skip to content

Commit

Permalink
Added test case for empty subset
Browse files Browse the repository at this point in the history
  • Loading branch information
25shriya committed Sep 13, 2024
1 parent 9e11b41 commit ec079dc
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions src/sage/matroids/chow_ring_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,25 +255,34 @@ def groebner_basis(self):
term *= flats_gen[x]
gb.append(term)

elif sorted_list != []:
for j in range(len(subset)):
for k in range(j+1, len(subset)):
if (sorted_list[j] != sorted_list[k]) & (sorted_list[j].issubset(sorted_list[k])):
flag = False
break

if flag is True:
else:
if subset == []:
for F in flats:
if F > reduce(lambda a, b: a.union(b), sorted_list):
term = R.one()
for x in subset:
term *= flats_gen[x]
term1 = R.zero()
for G in flats:
if G >= F:
term1 += flats_gen[G]
if term1 != R.zero():
gb.append(term*(term1**(ranks[F] - ranks[sorted_list[len(subset) - 1]])))
term = R.zero()
for G in flats:
if G >= F:
term += flats_gen[G]
gb.append((term)**(ranks[F]))

else:
for j in range(len(subset)):
for k in range(j+1, len(subset)):
if (sorted_list[j] != sorted_list[k]) & (sorted_list[j].issubset(sorted_list[k])):
flag = False
break

if flag is True:
for F in flats:
if F > reduce(lambda a, b: a.union(b), sorted_list):
term = R.one()
for x in subset:
term *= flats_gen[x]
term1 = R.zero()
for G in flats:
if G >= F:
term1 += flats_gen[G]
if term1 != R.zero():
gb.append(term*(term1**(ranks[F] - ranks[sorted_list[len(subset) - 1]])))

g_basis = PolynomialSequence(R, [gb])
return g_basis
Expand Down

0 comments on commit ec079dc

Please sign in to comment.