1 | initial version |
Hint: start with the boolean polynomial ring generators.
sage: B = BooleanPolynomialRing(9, 'x', order = 'lex')
sage: print(B.gens())
(x0, x1, x2, x3, x4, x5, x6, x7, x8)
2 | No.2 Revision |
Hint: start with the boolean polynomial ring generators.
sage: B = BooleanPolynomialRing(9, 'x', order = 'lex')
sage: print(B.gens())
(x0, x1, x2, x3, x4, x5, x6, x7, x8)
Detailed answer: use powerset
to build on the hint.
sage: B = BooleanPolynomialRing(3, 'x', order='lex')
sage: B
Boolean PolynomialRing in x0, x1, x2
sage: G = B.gens()
sage: len(G)
3
sage: G
(x0, x1, x2)
sage: M = list(prod(x, B.one()) for x in powerset(G))
sage: len(M)
8
sage: M
[1, x0, x1, x0*x1, x2, x0*x2, x1*x2, x0*x1*x2]