a matrix of type 4×3 Matrix{QQFieldElem}:
and Q=[2 ,-3 , 1, 1] of type 4-element Vector{QQFieldElem}:
My goal is to compute A \setminus Q but I got error
MethodError: no method matching abs2(::QQFieldElem)
I try to convert 4×3 Matrix{QQFieldElem}: into 4×3 Matrix{Int64}: so I can use LinearAlgebra package but no success.
Any ideal how to compute this.
You’re trying to find a length-3 vector X such that A * X == Q. In this case, you can check by hand that no solution exists, because the system is over-determined. If you were doing this over floating-point numbers, it makes sense to talk about a “closest” solution, but this is not a natural thing for rational numbers or integers. If you really need to do this, convert the matrix and vector to Float64.
The functions for solving or checking solvability are can_solve and can_solve_with_solution. Only works with matrices though, so your example would look like: