# Polynomial : From AbstractAlgebra to MultivariatePolynomials

**URL:** <https://discourse.julialang.org/t/polynomial-from-abstractalgebra-to-multivariatepolynomials/88844>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 17, 2022, 11:09am UTC](https://discourse.julialang.org/t/polynomial-from-abstractalgebra-to-multivariatepolynomials/88844 "2022-10-17T11:09:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luca](https://avatars.discourse-cdn.com/v4/letter/l/51bf81/32.png) [@Luca](https://discourse.julialang.org/u/Luca)\
**Post date:** [October 17, 2022, 11:09am UTC](https://discourse.julialang.org/t/polynomial-from-abstractalgebra-to-multivariatepolynomials/88844/1 "2022-10-17T11:09:09Z")

</div>

Dear all,

I am using AbstractAlgebra.jl to create polynomials in a Julia code. I would like to use HomotopyContinuation.jl package and I should pass to this package polynomial created bt MultivariatePolynomial.jl. I am wondering if there exists an easy way to convert polynomial created by AbstractAlgebra.jl to MutivariatePolynomial.jl.

Thanks very much for all your help.

---

<div class="post-metadata">

**Author:** ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)\
**Post date:** [October 19, 2022, 7:42am UTC](https://discourse.julialang.org/t/polynomial-from-abstractalgebra-to-multivariatepolynomials/88844/2 "2022-10-19T07:42:38Z")

</div>

Here is an example using the example from the README:

```julia
julia> using AbstractAlgebra, HomotopyContinuation;

julia> QQxy, (x, y) = PolynomialRing(QQ, [:x, :y]);

julia> f = x^2 + 2*y; g = y^2 - 2;

julia> @var _x _y;

julia> vars_ht = [_x, _y];

julia> f_ht = sum(c * prod(vars_ht[i]^e[i] for i in 1:2) for (c, e) in zip(AbstractAlgebra.coefficients(f), exponent_vectors(f)));

julia> f_ht
2*_y + _x^2

julia> g_ht = sum(c * prod(vars_ht[i]^e[i] for i in 1:2) for (c, e) in zip(AbstractAlgebra.coefficients(g), exponent_vectors(g)));

julia> F = System([f_ht, g_ht])
System of length 2
 2 variables: _x, _y

 2*_y + _x^2
 -2 + _y^2

```
