I’m using Julia v.1.6.2 and the package Symbolic v.3.3. I have a simple script to compute that Jacobian that gives an error:
typeusing Symbolics
using LinearAlgebra
renormI(x) = x ./ x[[end],:]
homogenize(x) = [x; ones(1,size(x,2))]
cross_product_matrix(v) = [0 -v[3] v[2]; v[3] 0 -v[1]; -v[2] v[1] 0]
@variables H[1:3,1:3]
@variables x[1:3]
xp = H*x
J = Symbolics.jacobian(xp,x)
which gives the error
MethodError: no method matching similar(::Type{Matrix{Num}}, ::Tuple{UnitRange{Int64}, UnitRange{Int64}})
Closest candidates are:
similar(!Matched::AbstractArray{T, N} where N, ::Tuple) where T at abstractarray.jl:740
similar(::Type{A}, !Matched::Type{T}, !Matched::StaticArrays.Size{S}) where {A<:Array, T, S} at /home/jbpritts/.julia/packages/StaticArrays/vxjOO/src/abstractarray.jl:163
similar(::Type{T}, !Matched::Union{Integer, AbstractUnitRange}...) where T<:AbstractArray at abstractarray.jl:783
...
_array_for(#unused#::Type{Num}, itr::Base.Iterators.ProductIterator{Tuple{Symbolics.Arr{Num, 1}, Symbolics.Arr{Num, 1}}}, #unused#::Base.HasShape{2}) at array.jl:670
jacobian(ops::Symbolics.Arr{Num, 1}, vars::Symbolics.Arr{Num, 1}; simplify::Bool) at diff.jl:356
jacobian(ops::Symbolics.Arr{Num, 1}, vars::Symbolics.Arr{Num, 1}) at diff.jl:356
top-level scope at make_cov_expressions.jl:12
eval at boot.jl:360 [inlined]
eval_in_module(fully_qualified_module_name::Vector{Symbol}, expr::Expr) at JuliaSnail.jl:160
eval_tmpfile(tmpfile::String, modpath::Vector{Symbol}, realfile::String, linenum::Int64) at JuliaSnail.jl:190
top-level scope at none:1
eval at boot.jl:360 [inlined]
eval_in_module(fully_qualified_module_name::Vector{Symbol}, expr::Expr) at JuliaSnail.jl:160
macro expansion at JuliaSnail.jl:698 [inlined]
(::Main.JuliaSnail.var"#28#32"{Sockets.TCPSocket})() at task.jl:411e