I'd like to form some tensor products of sparse matrices, but this does not seem to work:
Traceback (most recent call last):
File "/Users/ddahl/anaconda3/envs/qiskit/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-9-88417d1a4157>", line 1, in <module>
tp = TensorProduct(spm,spm)
File "/Users/ddahl/anaconda3/envs/qiskit/lib/python3.8/site-packages/sympy/physics/quantum/tensorproduct.py", line 123, in __new__
c_part, new_args = cls.flatten(sympify(args))
File "/Users/ddahl/anaconda3/envs/qiskit/lib/python3.8/site-packages/sympy/physics/quantum/tensorproduct.py", line 139, in flatten
File "/Users/ddahl/anaconda3/envs/qiskit/lib/python3.8/site-packages/sympy/matrices/matrices.py", line 2339, in __getattr__
AttributeError: ImmutableSparseMatrix has no attribute args_cnc.
When I look in sympy/physics/quantum/tensorproduct.py it looks to me like there is an attempted test to determine
whether the first argument to the TensorProduct(...) function is a sparse SciPy matrix:
Looks to me like that sparse matrix should be of type scipy_sparse_matrix.
My environment is a freshly built Anaconda from two weeks ago and I'm running on macOS.