Skip to content

Commit 0723edd

Browse files
fix for parametrization when root distribution is not QQFieldElem
1 parent a5117d3 commit 0723edd

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

experimental/AlgebraicStatistics/src/PhylogeneticModels.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -916,9 +916,8 @@ end
916916
sorted_edges::Union{Vector{Edge}, Nothing} = nothing)
917917
vars = unique(transition_matrix(PM))
918918
edge_gens = [x => 1:n_edges(graph(PM)) for x in vars]
919-
R, r, x... = polynomial_ring(base_field(PM),
920-
root_distribution(PM),
921-
edge_gens...; cached=cached)
919+
CR, r = polynomial_ring(base_field(PM), root_distribution(PM); cached=false)
920+
R, x... = polynomial_ring(CR, edge_gens...; cached=cached)
922921

923922
R, Dict{Tuple{VarName, Edge}, MPolyRingElem}(
924923
(vars[i], e) => x[i][j] for i in 1:length(vars),
@@ -958,9 +957,10 @@ end
958957
root_vars = gens(coefficient_ring(trans_ring))
959958

960959
edge_gens = [x => 1:n_edges(graph(PM)) for x in Symbol.(transition_vars)]
961-
R, rv, x... = polynomial_ring(base_field(PM), Symbol.(root_vars), edge_gens..., ; cached=cached)
960+
CR, rv = polynomial_ring(base_field(PM), Symbol.(root_vars); cached=cached)
961+
R, x... = polynomial_ring(CR, edge_gens..., ; cached=cached)
962962

963-
coef_map = hom(coefficient_ring(trans_ring), R, rv)
963+
coef_map = hom(coefficient_ring(trans_ring), CR, rv)
964964

965965
# the union here is used to ensure it's a GraphDict
966966
dict_maps = Dict{Union{Edge, Int}, Oscar.MPolyAnyMap}()
@@ -1030,9 +1030,9 @@ end
10301030
edge_gens = [x => 1:n_edges(N) for x in vars]
10311031
h_nodes = hybrid_vertices(N)
10321032
R, r, l, x... = polynomial_ring(base_field(PM),
1033-
root_distribution(PM),
1034-
:l => (1:length(h_nodes), 1:2),
1035-
edge_gens...; cached=cached)
1033+
root_distribution(PM),
1034+
:l => (1:length(h_nodes), 1:2),
1035+
edge_gens...; cached=cached)
10361036

10371037
hyb = hybrids(N)
10381038
R, Dict{Tuple{VarName, Edge}, MPolyRingElem}(

experimental/AlgebraicStatistics/test/PhylogeneticModels.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@
161161

162162
@test length(f.img_gens) == n_states(model)^n_leaves(tree)
163163

164-
165164
# Test some entries of the joint distribution vector
166165
a = gens(parameter_ring(pm)[1])[1:3]
167166
b = gens(parameter_ring(pm)[1])[4:6]

0 commit comments

Comments
 (0)