from sympy import Symbol, Matrix from sympy.interactive import printing printing.init_printing() dt = Symbol('\Delta t') Q = Matrix([[.5*dt**2], [.5*dt**2], [dt], [dt]]) Q*Q.T Q = Matrix([[.5*dt**2], [dt]]) Q*Q.T