Closed mzaffalon closed 1 year ago
I just checked and this appears to be inherited from how base Julia handles this product.
Thank you. B
should be a matrix for it to work as I expect (and for consistency). The following works:
using SymPy
julia> @syms p₁ p₂; B = [1; 0;;]; P = [p₁ 0; 0 p₂]; transpose(B)*P*B
1×1 Matrix{Sym}:
p₁
julia> B'*P*B
1×1 Matrix{Sym}:
p₁
Ref: https://discourse.julialang.org/t/1x1-matrix-automatically-converted-to-number/101106
In both examples below, I expect the matrix
[p₁]
:with SymPy v1.1.9 and Julia v1.9.1.