def _eval_expand_tensorproduct(self, **hints):
        args = self.args
        add_args = []
        stop = False
        for i in range(len(args)):
            if isinstance(args[i], Add):
                for aa in args[i].args:
                    tp = TensorProduct(*args[:i] + (aa,) + args[i + 1:])
                    if isinstance(tp, TensorProduct):
                        tp = tp._eval_expand_tensorproduct()
                    add_args.append(tp)
                break

        if add_args:
            return Add(*add_args)
        else:
            return self
Distribute TensorProducts across addition.
dataset/ETHPy150Open sympy/sympy/sympy/physics/quantum/tensorproduct.py/TensorProduct._eval_expand_tensorproduct