Skip to content

Add tropical linear spaces from graphs #4445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions docs/src/TropicalGeometry/linear_space.md
Copy link
Member

@micjoswig micjoswig Feb 26, 2025

Choose a reason for hiding this comment

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

The docs on tropical linear spaces (and the rest of tropical geometry) need to state explicitly where the various objects (tropical varieties, tropical linear spaces etc) actually live. Candidates include R^n or the tropical projective torus R^n/R1 (in the homogeneous setting). Either there are choices for the user to make, or there are fixed global decisions.

Specifically, tropical linear spaces may also be viewed as tropical polytopes. And then there are more choices, for they can be considered in a tropical projective torus or in a tropical projective space. I guess, none of this is currently supported in OSCAR.

The role of Bergman fans and constant vs non-constant coefficients must be explained.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good points, I will adjust the documentation accordingly.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ In addition to converting from `TropicalVariety`, objects of type `TropicalLinea
4. matrices over a field and a tropical semiring map.
- if matrix over `QQ` and tropical semiring map is trivial, uses an implementation of Rincon's algorithm [Rin13](@cite) in `polymake`
- for general input, computes minors and uses constructor (2.)
5. graphs
```@docs
tropical_linear_space
```
Expand Down
24 changes: 24 additions & 0 deletions src/TropicalGeometry/linear_space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,30 @@ function tropical_linear_space(I::MPolyIdeal, nu::Union{Nothing,TropicalSemiring
end


@doc raw"""
tropical_linear_space(G::Graph, nu::TropicalSemiringMap; weighted_polyhedral_complex_only::Bool=false)

Return the Bergman fan of the graphic matroid of `G` as a tropical linear space, the tropical semiring map `nu` is used to fix the convention. If `weighted_polyhedral_complex==true`, will not cache any extra information.

# Examples
```jldoctest
julia> G = complete_graph(4)
Undirected graph with 4 nodes and the following edges:
(2, 1)(3, 1)(3, 2)(4, 1)(4, 2)(4, 3)

julia> tropical_linear_space(G)
Min tropical linear space

```
"""
function tropical_linear_space(G::Graph, nu::Union{Nothing,TropicalSemiringMap}=nothing; weighted_polyhedral_complex_only::Bool=false)
M = matrix(QQ,signed_incidence_matrix(G))
TropG = tropical_linear_space(M,nu;weighted_polyhedral_complex_only=weighted_polyhedral_complex_only)
if !weighted_polyhedral_complex_only
set_attribute!(TropG,:graph,G)
end
return TropG
end

###############################################################################
#
Expand Down
6 changes: 6 additions & 0 deletions test/TropicalGeometry/linear_space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,10 @@
@test issetequal(plueckerVector,tropical_pluecker_vector(TropL))
end

@testset "tropical linear space from graphs" begin
G = complete_graph(3)
TropG = tropical_linear_space(G)
@test f_vector(TropG) == [0,1,3]
end

end
Loading