Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9080b1b
started on first hc conversion function but there are compatibility i…
antonydellavecchia Feb 5, 2026
3c68a5e
attempting top create ext
antonydellavecchia Feb 5, 2026
446babf
rename fuinctions
antonydellavecchia Feb 5, 2026
87ee070
things are starting to work
antonydellavecchia Feb 5, 2026
f8e7c26
adds remaining functions
antonydellavecchia Feb 6, 2026
f6808b0
homotopycontinuation 2.15
antonydellavecchia Feb 10, 2026
58ea098
adds workflow and extension tests file
antonydellavecchia Feb 10, 2026
d73d186
adds tests
antonydellavecchia Feb 10, 2026
5d8acf3
remove white line
antonydellavecchia Feb 10, 2026
e7dacae
Apply suggestions from code review
benlorenz Feb 17, 2026
45e5b2f
some changes to function names
antonydellavecchia Feb 20, 2026
e92a698
remove pkg server line
antonydellavecchia Feb 20, 2026
5c8476f
Merge remote-tracking branch 'origin/adv/add-hc-ext' into adv/add-hc-ext
antonydellavecchia Feb 20, 2026
4da3ff3
Apply suggestions from code review
antonydellavecchia Feb 20, 2026
3a8e38c
change signatures and names
antonydellavecchia Feb 20, 2026
f0f6253
Merge remote-tracking branch 'origin/adv/add-hc-ext' into adv/add-hc-ext
antonydellavecchia Feb 20, 2026
123f89c
Apply suggestions from code review
lgoettgens Feb 20, 2026
0765bf2
imports, signatures and export
antonydellavecchia Feb 20, 2026
7e58c76
Merge remote-tracking branch 'origin/adv/add-hc-ext' into adv/add-hc-ext
antonydellavecchia Feb 20, 2026
5c3fbde
System fix
antonydellavecchia Feb 20, 2026
0f9e7f9
fix export + typo
antonydellavecchia Feb 20, 2026
9891b41
docs + experimental
antonydellavecchia Feb 20, 2026
c1e2cc9
makes docs available + adds error checks
antonydellavecchia Feb 23, 2026
9507e9b
Apply suggestion from @antonydellavecchia
antonydellavecchia Feb 23, 2026
c3b5fc7
forgot the test
antonydellavecchia Feb 23, 2026
0894cc9
Merge remote-tracking branch 'origin/adv/add-hc-ext' into adv/add-hc-ext
antonydellavecchia Feb 23, 2026
742b0ab
fix tests for extensions
antonydellavecchia Feb 27, 2026
716c2ee
proper fix for picking up extensions test
antonydellavecchia Feb 27, 2026
d61ab7f
threading
antonydellavecchia May 7, 2026
818beac
bump homotopy continuation
antonydellavecchia Jun 3, 2026
ed5158c
Merge remote-tracking branch 'origin/master' into adv/add-hc-ext
antonydellavecchia Jun 3, 2026
1403729
Merge remote-tracking branch 'origin/master' into adv/add-hc-ext
antonydellavecchia Jul 6, 2026
4eaa37d
new test example
antonydellavecchia Jul 6, 2026
323a1e1
comment out incorrect code
antonydellavecchia Jul 6, 2026
d7fc8d4
comment out dim test for now
antonydellavecchia Jul 6, 2026
1bd6c71
move HomotopyContinuation in Project.toml
antonydellavecchia Jul 9, 2026
232b556
small tweak; don't export
thofma Jul 9, 2026
40d4c33
adjust ci
thofma Jul 9, 2026
2510158
fix test
thofma Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,51 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

exts:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ contains(matrix.julia-version, 'nightly') }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
julia-version:
- '1.10'
- '1.12'
- '1.13-nightly'
- 'nightly'
os: ['ubuntu-latest']
env:
OSCAR_TEST_SUBSET: "exts"
steps:
- uses: actions/checkout@v6
Comment thread
thofma marked this conversation as resolved.
Outdated
- name: "Set up Julia"
uses: julia-actions/setup-julia@v2
Comment thread
thofma marked this conversation as resolved.
Outdated
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v2
Comment thread
thofma marked this conversation as resolved.
Outdated
with:
cache-name: julia-cache;workflow=${{ github.workflow }};julia=${{ matrix.julia-version }};arch=${{ runner.arch }}
include-matrix: false
cache-scratchspaces: false
- name: "Inject HomotopyContinuation as test dependencies"
continue-on-error: true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
continue-on-error: true

I don't see how a sed command could fail

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied the work flow for the dependency injections for Hecke.jl

@benlorenz any opinions here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be removed but it doesn't hurt either.
It was probably a leftover of a previous version where these extra dependencies were installed in a different way.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let's keep it

run: |
sed -i -e "s/\[deps\]/[deps]\nHomotopyContinuation = \"f213a82b-91d6-5c5d-acf7-10f1c761b327\"/" test/Project.toml
- uses: julia-actions/julia-runtest@v1
with:
annotate: ${{ matrix.julia-version == '1.10' }}
coverage: ${{ matrix.julia-version == '1.10' }}
- name: "Process code coverage"
if: matrix.julia-version == '1.10'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.10'
continue-on-error: true
uses: codecov/codecov-action@v5
Comment thread
thofma marked this conversation as resolved.
Outdated
with:
token: ${{ secrets.CODECOV_TOKEN }}
Comment thread
thofma marked this conversation as resolved.

# adapted from gap-system/gap
slack-notification:
Expand Down
7 changes: 7 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade"
f4ncgb_jll = "160f184c-7e1a-5d95-af1f-70d62a450302"
lib4ti2_jll = "1493ae25-0f90-5c0e-a06c-8c5077d6d66f"

[weakdeps]
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"

[extensions]
HomotopyContinuationExt = "HomotopyContinuation"

[compat]
AbstractAlgebra = "0.48.0"
AlgebraicSolving = "0.10.4"
Expand Down Expand Up @@ -61,3 +67,4 @@ cohomCalg_jll = "0.32.0"
f4ncgb_jll = "0.300.300"
julia = "1.10"
lib4ti2_jll = "1.6.10"
HomotopyContinuation = "2.15"
53 changes: 53 additions & 0 deletions ext/HomotopyContinuationExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module HomotopyContinuationExt

using Oscar, HomotopyContinuation

import HomotopyContinuation: HomotopyContinuation, Variable

"""
Expression(f::MPolyRingElem)

Takes a polynomial `f` an `MPolyRingElem` and converts it into a
`HomotopyContinuation.Expression`. The `HomotopyContinuation.Variable`
objects used in the expression have the same names as the generators
in the `parent(f)` (including brackets as in `x[1]`).
"""
function HomotopyContinuation.Expression(f::MPolyRingElem)
# Get a list of HomotopyContinuation variables whose names are the
# same as the ones in the Oscar polynomial f.
v = Variable.(symbols(parent(f)))
# Make the HomotopyContinuation expression
sum(Float64(c) * prod(v[i]^e for (i,e) in enumerate(a)) for (c,a) in coefficients_and_exponents(f))
end

"""
System(I::MPolyIdeal; args...)

Takes an `MPolyIdeal` and turns it into a `HomotopyContinuation.System`
containing the ideal generators. It forwards all `args` to `HomotopyContinuation.System`.
"""
HomotopyContinuation.System(I::MPolyIdeal; args...) = HomotopyContinuation.System(Expression.(gens(I)); args...)

"""
solve(I::MPolyIdeal; args...)

Call `HomotopyContinuation.solve` on the `HomotopyContinuation.System` derived
from `I` forwarding all `args`.
"""
HomotopyContinuation.solve(I::MPolyIdeal; show_progress=false, args...) = HomotopyContinuation.solve(HomotopyContinuation.System(I); show_progress, args...)

HomotopyContinuation.witness_set(I::MPolyIdeal; show_progress=false, args...) = HomotopyContinuation.witness_set(HomotopyContinuation.System(I); show_progress, args...)

"""
dim(I::MPolyIdeal)

Compute the dimension of `I` numerically.
"""
function HomotopyContinuation.dim(I::MPolyIdeal)
# This is provided by HomotopyContinuation.jl and computes the
# dimension based on the Jacobian rank at a random point.
F = HomotopyContinuation.System(I)
return HomotopyContinuation.nvariables(F) - rank(HomotopyContinuation.fixed(F))
end

end
15 changes: 15 additions & 0 deletions test/exts.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using HomotopyContinuation
Comment thread
antonydellavecchia marked this conversation as resolved.
Outdated

@testset "Extensions" begin
Comment thread
antonydellavecchia marked this conversation as resolved.
@testset "HomotopyContinuation" begin
Qxy, (x, y) = QQ[:x, :y]
I = ideal([x^2 - x * y + y^3, y^2 - x - 4//5])
@test iszero(HomotopyContinuation.dim(I))
result = Oscar.nsolve(I)
Comment thread
lgoettgens marked this conversation as resolved.
Outdated
@test [r.multiplicity for r in result.path_results] == [1, 1, 1, 1]

J = ideal([x^2 - x * y + y^3])
ws = Oscar.witness_set(J)
Comment thread
lgoettgens marked this conversation as resolved.
Outdated
@test length(ws.R) == 3
end
end
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ test_subsets = Dict(
:book => [
"test/book/test.jl",
],
:oscar_db => ["experimental/OscarDB/test/runtests.jl"]
:oscar_db => ["experimental/OscarDB/test/runtests.jl"],
:exts => ["test/exts.jl"]
)

tests_on_main = Dict(
Expand Down
Loading