trac #16881: fix factorization
added method clique_polynomial to graph
changed code to use IndependentSets instead of clique_complex()
corrected documentation and other minor changes to code
Added author
trac #16881: fix documentation issue
Trac #16681: Random doctest failures in sage/rings/algebraic_closure_finite_field.py

This is caused by #15390
{{{
sage -t --long src/sage/rings/algebraic_closure_finite_field.py
**********************************************************************
File "src/sage/rings/algebraic_closure_finite_field.py", line 940, in sa
ge.rings.algebraic_closure_finite_field.AlgebraicClosureFiniteField_gene
ric._factor_univariate_polynomial
Failed example:
    for d in xrange(10):
        p = R.random_element(degree=randint(2,8))
        assert p.factor().prod() == p
Exception raised:
    Traceback (most recent call last):
      File "/Users/buildslave-
sage/slave/sage_git/build/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 480, in _run
        self.execute(example, compiled, test.globs)
      File "/Users/buildslave-
sage/slave/sage_git/build/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 839, in execute
        exec compiled in globs
      File "<doctest sage.rings.algebraic_closure_finite_field.Algebraic
ClosureFiniteField_generic._factor_univariate_polynomial[4]>", line 3,
in <module>
        assert p.factor().prod() == p
    AssertionError
**********************************************************************
1 item had failures:
   1 of   6 in sage.rings.algebraic_closure_finite_field.AlgebraicClosur
eFiniteField_generic._factor_univariate_polynomial
}}}

First of all, you should use a form of assert that gives some minimal
information when it can fail, e.g. in the form below. The following
fails occasionally and makes it easy enough to reproduce:
{{{
sage: K = GF(3).algebraic_closure()
sage: R = PolynomialRing(K, 'T')
sage: T = R.gen()
sage: for d in xrange(1000):
....:         p = R.random_element(degree=8)
....:         assert p.factor().prod() == p, p.factor()
....:
------------------------------------------------------------------------
---
AssertionError                            Traceback (most recent call
last)
<ipython-input-22-f31a401fb53b> in <module>()
      1 for d in xrange(Integer(1000)):
      2         p = R.random_element(degree=Integer(8))
----> 3         assert p.factor().prod() == p, p.factor()
      4

AssertionError: T * (T + 1) * (T + z5 + 1) * (T + z5^3 + 1) * (T +
2*z5^4 + z5) * (T + 2*z5^4 + 2*z5^2) * (T + 2*z5^4 + 2*z5^3 + z5^2 + z5)
}}}

On a related note, a random element can be zero:
{{{
sage: K = GF(3).algebraic_closure()
sage: R = PolynomialRing(K, 'T')
sage: T = R.gen()
sage: for d in xrange(1000):
....:         p = R.random_element(degree=randint(2,8))
....:         assert p.factor().prod() == p, p
....:
------------------------------------------------------------------------
---
ValueError                                Traceback (most recent call
last)
<ipython-input-15-db4aacba08d5> in <module>()
      1 for d in xrange(Integer(1000)):
      2         p =
R.random_element(degree=randint(Integer(2),Integer(8)))
----> 3         assert p.factor().prod() == p, p
      4

/home/release/Sage/local/lib/python2.7/site-
packages/sage/rings/polynomial/polynomial_element.so in
sage.rings.polynomial.polynomial_element.Polynomial.factor
(build/cythonized/sage/rings/polynomial/polynomial_element.c:23530)()

ValueError: factorization of 0 not defined
}}}

URL: http://trac.sagemath.org/16681
Reported by: vbraun
Ticket author(s): Vincent Delecroix
Reviewer(s): Volker Braun
Trac #16799: clique polynomial of a graph

Add a method for computing the
[http://mathworld.wolfram.com/CliquePolynomial.html clique polynomial]
of a graph.

URL: http://trac.sagemath.org/16799
Reported by: amri
Ticket author(s): Amritanshu Prasad
Reviewer(s): Nathann Cohen