Ask Your Question

Revision history [back]

As I already said in my comment, there does not seem to be anything in Sage code. Here is a simple function that can be used as a very naive workaround (and that should work for any finite rings as soon as you have access to a list of generators)

def finite_ring_list(R):
    L1 = set(R.gens())
    L1.add(R.one())
    L1.add(R.zero())

    while True:
        L2 = set(a*b + c for a in L1 for b in L1 for c in L1)
        if len(L1) == len(L2):
            return L1
        L1 = L2

On your example I got

sage: finite_ring_list(S)
{0,
 1,
 ybar,
 ybar + 1,
 xbar,
 xbar + 1,
 xbar + ybar,
 xbar + ybar + 1,
 ybar^2,
 ybar^2 + 1,
 ybar^2 + ybar,
 ybar^2 + ybar + 1,
 ybar^2 + xbar,
 ybar^2 + xbar + 1,
 ybar^2 + xbar + ybar,
 ybar^2 + xbar + ybar + 1}

My function is too general to be efficient.

In your situation, you have a vector space and there might be some ways to take advantage of it. In particular, you can manually implement an isomorphism between the vector space GF(2)^4 and your ring and start playing with that.