I got an error message that makes me wonder if cocalc is using the polybori package.
# Define the number of variables and the degree of the polynomial
n = 5
d = 4
# Import the BooleanPolynomials class from the sage.crypto.boolean_function module
from sage.crypto.boolean_function import BooleanPolynomials
# Create a random Boolean polynomial in n variables of degree d
p = BooleanPolynomials.random_polynomial(n, d)
# Print the polynomial
print(p)
Response:
ImportError Traceback (most recent call last)
Cell In [18], line 6
3 d = Integer(4)
5 # Import the BooleanPolynomials class from the sage.crypto.boolean_function module
----> 6 from sage.crypto.boolean_function import BooleanPolynomials
8 # Create a random Boolean polynomial in n variables of degree d
9 p = BooleanPolynomials.random_polynomial(n, d)
ImportError: cannot import name 'BooleanPolynomials' from 'sage.crypto.boolean_function' (/ext/sage/9.8/src/sage/crypto/
boolean_function.cpython-311-x86_64-linux-gnu.so)