sympy/sympy — pull request #7309 by jackolantern (2014-03-20 00:58:39+00:00)
Title: quantum.TensorProduct now suports sympy.Identity

`quantum.TensorProduct` used to throw exceptions when used with `sympy.Identity`.
The exceptions were different depending on whether or not the identity was the first element of the product or not. This fix allows `sympy.Identity` to be used in any position of the product.

This syntax can now be used:

```python
TensorProduct(Identity(2), Matrix([[1, 1], [1, -1]]))
```

Instead of:

```python
TensorProduct(Matrix(Identity(2)), Matrix([[1, 1], [1, -1]]))
```