Skip to content

Instantly share code, notes, and snippets.

@awreece
Last active December 15, 2015 20:19
Show Gist options
  • Save awreece/5317456 to your computer and use it in GitHub Desktop.
Save awreece/5317456 to your computer and use it in GitHub Desktop.
def try_shit(flist1, flist2):
ideal1 = flist1*R
ideal2 = flist2*R
expected = ideal1.intersection(ideal2).groebner_basis()
actual_ideal = [f.lcm(g) for f in flist1 for g in flist2]*R
actual = actual_ideal.groebner_basis()
return (expected == actual, expected, actual, flist1, flist2)
for powx1 in xrange(3):
for powx2 in xrange(3):
for powy1 in xrange(3):
for powy2 in xrange(3):
for powx3 in xrange(3):
for powx4 in xrange(3):
for powy3 in xrange(3):
for powy4 in xrange(3):
res, a, b, c, d = try_shit([x^powx1 * y^powy1 + x^powx2 * y^powy2],
[x^powx3 * y^powy3 + x^powx4 * y^powy4])
if not res:
print c, d
res, a, b, c, d = try_shit([x^powx1 * y^powy1, x^powx2 * y^powy2],
[x^powx3 * y^powy3, x^powx4 * y^powy4])
if not res:
print c, d
res, a, b, c, d = try_shit([x^powx1 * y^powy1, x^powx2 * y^powy2],
[x^powx3 * y^powy3 + x^powx4 * y^powy4])
if not res:
print c, d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment