Skip to content

Commit

Permalink
new: graph_curve_with_vertex_and_edge_ideals (not exported)
Browse files Browse the repository at this point in the history
  • Loading branch information
YueRen committed Nov 21, 2024
1 parent be63f5c commit 2a594fa
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/AlgebraicGeometry/Curves/ProjectiveCurve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ defined by ideal with 5 generators
```
"""
function graph_curve(G::Graph; check::Bool=true)
C,_ = graph_curve_with_vertex_ideals(G; check=check)
return C
end

function graph_curve_with_vertex_ideals(G::Graph; check::Bool=true)
if check
@req all(isequal(3),degree(G)) "G is not trivalent"
end
Expand All @@ -130,13 +135,20 @@ function graph_curve(G::Graph; check::Bool=true)

edgesG = collect(edges(G)) # indexes all edges of G

lineIdeals = MPolyIdeal[]
vertexIdeals = MPolyIdeal[]
for v in vertices(G)
edgesContainingV = findall(edge->(v in edge),edgesG)
cycleMatrix_v = cycleMatrix[edgesContainingV,:]
push!(lineIdeals,ideal(minors(vcat(cycleMatrix_v,rowOfVariables),3)))
push!(vertexIdeals,ideal(minors(vcat(cycleMatrix_v,rowOfVariables),3)))
end
graphCurveIdeal = reduce(intersect,lineIdeals)
graphCurveIdeal = reduce(intersect,vertexIdeals)
graphCurve = projective_curve(graphCurveIdeal)

return graphCurve, vertexIdeals
end

return projective_curve(graphCurveIdeal)
function graph_curve_with_vertex_and_edge_ideals(G::Graph)
C, vertexIdeals = graph_curve_with_vertex_ideals(G)
edgeIdeals = [ vertexIdeals[src(e)] + vertexIdeals[dst(e)] for e in edges(G)]
return C, vertexIdeals, radical.(edgeIdeals) # is radical really necessary?

Check warning on line 153 in src/AlgebraicGeometry/Curves/ProjectiveCurve.jl

View check run for this annotation

Codecov / codecov/patch

src/AlgebraicGeometry/Curves/ProjectiveCurve.jl#L150-L153

Added lines #L150 - L153 were not covered by tests
end

0 comments on commit 2a594fa

Please sign in to comment.