Thank you !
For the bug, I describe what I use, what works and what does not.
using DynamicPolynomials
@polyvar eta_var
eta = (BigInt(0)//1 + (1//1 + 1im*0//1) *eta_var) / (BigInt(1)//1 +(0//1+0//1 * 1im) *eta_var)
the goal of using eta is to have a type of a rational{Polynomial{Rational{Complex}}
the type of eta is :
RationalPoly{Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Complex{Rational{BigInt}}}, Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Complex{Rational{BigInt}}}}
A = [ eta 2*eta ; 0 eta * eta]
YA = [(1+0 * eta) (1+0 * eta)] '
A \ YA works
B # Is a matrix
21×10 Matrix{RationalPoly{Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Complex{Rational{BigInt}}}, Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Complex{Rational{BigInt}}}}}:
YB # Is a vector
21-element Vector{RationalPoly{Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Complex{Rational{BigInt}}}, Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Complex{Rational{BigInt}}}}}:
B[1,2] = ((-1//8 + 0//1*im) eta_var^2) / ((1//1 + 0//1*im))
B[3,2] = ((0//1 + 1//4*im)*eta_var) / ((1//1 + 0//1*im))
B[4,3] = ((-1//4 + 0//1*im)*eta_var^2) / ((1//1 + 0//1*im))
B[5,3] = ((0//1 - 1//4*im)*eta_var) / ((1//1 + 0//1*im))
B[6,3] = ((0//1 + 1//4*im)*eta_var) / ((1//1 + 0//1*im))
B[7,4] = ((-1//8 + 0//1*im)*eta_var^2) / ((1//1 + 0//1*im))
B[8,4] = ((0//1 + 1//4*im)*eta_var) / ((1//1 + 0//1*im))
B[10,1] = ((1//1 + 0//1*im)) / ((1//1 + 0//1*im))
B[11,6] = ((-1//4 + 0//1*im)) / ((1//1 + 0//1*im))
B[12,7] = ((-1//4 + 0//1*im)) / ((1//1 + 0//1*im))
B[13,8] = ((-1//8 + 0//1*im)*eta_var^2) / ((1//1 + 0//1*im))
B[14,8] = ((0//1 - 1//4*im)*eta_var) / ((1//1 + 0//1*im))
B[16,9] = ((-1//4 + 0//1*im)*eta_var^2) / ((1//1 + 0//1*im))
B[17,9] = ((0//1 + 1//4*im)*eta_var) / ((1//1 + 0//1*im))
B[18,9] = ((0//1 - 1//4*im)*eta_var) / ((1//1 + 0//1*im))
B[19,10] = ((-1//8 + 0//1*im)*eta_var^2) / ((1//1 + 0//1*im))
B[21,10] = ((0//1 - 1//4*im)*eta_var) / ((1//1 + 0//1*im))
YB[12] = ((1//1 + 0//1*im)) / ((1//1 + 0//1*im))
(mind to use eta and not eta_var, while recopying, if you do. And add the * )
B \ YB gives a bug :
ERROR: MethodError: no method matching abs2(::RationalPoly{Polynomial{…}, Polynomial{…}})
The function `abs2` exists, but no method is defined for this combination of argument types.
Stacktrace:
[1] _qreltype(::Type{RationalPoly{Polynomial{DynamicPolynomials.Commutative{…}, Graded{…}, Complex{…}}, Polynomial{DynamicPolynomials.Commutative{…}, Graded{…}, Complex{…}}}})
@ LinearAlgebra ~/.julia/juliaup/julia-1.11.2/share/julia/stdlib/v1.11/LinearAlgebra/src/qr.jl:341
[2] qr(A::Matrix{RationalPoly{Polynomial{…}, Polynomial{…}}}, arg::ColumnNorm; kwargs::@Kwargs{})
@ LinearAlgebra ~/.julia/juliaup/julia-1.11.2/share/julia/stdlib/v1.11/LinearAlgebra/src/qr.jl:424
[3] qr(A::Matrix{RationalPoly{Polynomial{…}, Polynomial{…}}}, arg::ColumnNorm)
@ LinearAlgebra ~/.julia/juliaup/julia-1.11.2/share/julia/stdlib/v1.11/LinearAlgebra/src/qr.jl:422
[4] \(A::Matrix{RationalPoly{Polynomial{…}, Polynomial{…}}}, B::Vector{RationalPoly{Polynomial{…}, Polynomial{…}}})
@ LinearAlgebra ~/.julia/juliaup/julia-1.11.2/share/julia/stdlib/v1.11/LinearAlgebra/src/generic.jl:1134
for the 0 elments, you should use :
0 + 0*eta
I hope it’s okay for you