|
254 | 254 | Given an ideal `I` with a finite solution set over the complex numbers, return |
255 | 255 | the rational roots of the ideal. |
256 | 256 |
|
| 257 | +# Arguments |
| 258 | +- `I::Ideal{T} where T <: MPolyElem`: input generators. |
| 259 | +- `initial_hts::Int=17`: initial hash table size `log_2`. |
| 260 | +- `nr_thrds::Int=1`: number of threads for parallel linear algebra. |
| 261 | +- `max_nr_pairs::Int=0`: maximal number of pairs per matrix, only bounded by minimal degree if `0`. |
| 262 | +- `la_option::Int=2`: linear algebra option: exact sparse-dense (`1`), exact sparse (`2`, default), probabilistic sparse-dense (`42`), probabilistic sparse(`44`). |
| 263 | +- `info_level::Int=0`: info level printout: off (`0`, default), summary (`1`), detailed (`2`). |
| 264 | +- `precision::Int=32`: bit precision for the computed solutions. |
| 265 | +
|
| 266 | +# Examples |
| 267 | +```jldoctest |
| 268 | +julia> using AlgebraicSolving |
| 269 | +
|
| 270 | +julia> R,(x1,x2,x3) = PolynomialRing(QQ, ["x1","x2","x3"]) |
| 271 | +(Multivariate Polynomial Ring in x1, x2, x3 over Rational Field, Nemo.fmpq_mpoly[x1, x2, x3]) |
| 272 | +
|
| 273 | +julia> I = Ideal([x1+2*x2+2*x3-1, x1^2+2*x2^2+2*x3^2-x1, 2*x1*x2+2*x2*x3-x2]) |
| 274 | +Nemo.fmpq_mpoly[x1 + 2*x2 + 2*x3 - 1, x1^2 - x1 + 2*x2^2 + 2*x3^2, 2*x1*x2 + 2*x2*x3 - x2] |
| 275 | +
|
| 276 | +julia> rat_sols = rational_solutions(I) |
| 277 | +2-element Vector{Vector{fmpq}}: |
| 278 | + [1, 0, 0] |
| 279 | + [1//3, 0, 1//3] |
| 280 | +
|
| 281 | +julia> map(r->map(p->evaluate(p, r), I.gens), rat_sols) |
| 282 | +4-element Vector{Vector{fmpq}}: |
| 283 | + [0, 0, 0] |
| 284 | + [0, 0, 0] |
| 285 | +
|
257 | 286 | """ |
258 | 287 | function rational_solutions( |
259 | 288 | I::Ideal{T} where T <: MPolyElem; # input generators |
|
0 commit comments