Generalize physics.quantum.OuterProduct so that it can handle scale kets/bras and sums of kets and bras
Unit tests for updated OuterProduct in the physics.quantum module
Assumptions: is_zero: add XFAIL test for issue #7993
Don't fail on gcd([f]) where f.expand() == 0 (fixes #8384)

In [1]: f = x * (y + 42) - x * y - x * 42

In [2]: gcd([f])
Out[2]: 0

In [3]: f.expand()
Out[3]: 0

Previously failed with ComputationFailed(...).
8247: use minpoly in Expr._eval_is_zero

Only attempt this test if self is algebraic
with hopes that the test will then be successful and fast. There
are cases where something passed the is_algebraic test but still
raised the NotAlgebraic error in minpoly:

sympy/integrals/transforms.py", line 1818, in
sympy.integrals.transforms.inverse_hankel_transform
Failed example:
    inverse_hankel_transform(ht, k, r, 0)
    Exception raised:
        Traceback (most recent call last):
        ...
    NotAlgebraic: exp_polar(0) doesn't seem to be an algebraic element
Correct docstring of Pow for 0**negative; few formatting fixes
Add Pow._eval_is_zero() helper

fixes #7965
Fix Pow._eval_is_negative (if base>=0) and tests:

1) if k>=0 - for k**-2 we can't say anything
   definite (i.e. it's positive), because 0**-2 is zoo.

2) Evaluate Abs(1/Abs(x)) as 1/Abs(x)

3) workaround powsimp(e, combine='base'):
   (x/y)**(-n) -> (y/x)**n for nonnegative x, y
move minpoly handling to is_negative and is_positive

Failures when trying to make this go in the is_zero routine were
catastrophic and random:

https://travis-ci.org/smichr/sympy/builds/39894250
fix Mul._eval_is_rational
Add _eval_simplify helper for AlgebraicNumber

fixes #4401
Merge pull request #1 from smichr/rat

fix Mul._eval_is_rational
Assumptions: 7993 test use is not "=="
roots: Factor expression before using roots_quadratic()

Example:

In [1]: var('a')
Out[1]: a

In [2]: M = Matrix([[a, 0], [0, 1]])

In [3]: M.eigenvals()
Out[3]: {1: 1, a: 1}

Before it gave {a/2 + sqrt((a - 1)**2)/2 + 1/2: 1,
                a/2 - sqrt((a - 1)**2)/2 + 1/2: 1}
watch out for algebraics with functions (they can be slow)

Should this be a criteria in equals to keep minpoly from running
if the number has functions in it?
Infinity/NegativeInfinity: simplify relational code

If we call `Expr.__lt__` then we do not need as much error checking
here.  In particular, can drop the "compare to nonreal" error.
keep quadratic processing if there is only one factor
Merge pull request #8223 from skirpichev/algsimp

Add _eval_simplify helper for AlgebraicNumber
move _mexpand to function; give recursive option

The expressions from test_roots_slow in test_polyroots were
moved to test_arit where their ability to simplify to zero
is tested and used to demonstrate the need for a recursive
flag on _mexpand.
Merge pull request #8355 from smichr/8247

8247: use minpoly in Expr._eval_is_zero