Skip to content
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

GraphicalModels: multiple uses of gaussianRing #3553

Open
taboege opened this issue Oct 29, 2024 · 5 comments
Open

GraphicalModels: multiple uses of gaussianRing #3553

taboege opened this issue Oct 29, 2024 · 5 comments
Assignees

Comments

@taboege
Copy link
Contributor

taboege commented Oct 29, 2024

Multiple uses of gaussianRing Graph from the GraphicalModels package do not work as expected. The code below constructs rings for two different DAGs, but they turn out to be the same (they should already differ in their generators). It looks like the .graph field in both rings is equal to the first DAG.

This impairs all downstream functionality that requires a gaussianRing constructed from a specific graph, like gaussianVanishingIdeal. Multiple people I talked to, including @bkholler, have noticed this and don't know any workaround.

needsPackage "GraphicalModels";
DAGs = {
  digraph({1,2,3},{{1,2}}),
  digraph({1,2,3},{{1,2},{2,3}})
};
L = DAGs / gaussianRing;
print (L#0).graph;
print (L#1).graph;

It seems that gaussianRing maintains a cache of rings it has constructed before. Perhaps the indexing of that cache does not work as intended?

@d-torrance
Copy link
Member

It looks like the rings are cached in a hash table. There's a comment in the code:

--(kk,s,k,l,p,vv) uniquely identifies gaussianRing in case of MixedGraph input.

Is this correct? kk is the coefficient ring, s, l, p, and k are variable names, and vv is a sorted list of vertices. But shouldn't we also keep track of the directed edges to determine the subscripts of the variables in the ring?

Cc: @lukeamendola, @luisgarciapuente, @roserhp, @olgakuznetsova, @harshitmotwani2015, @sonjapetrovic, @mikestillman

@luisgarciapuente
Copy link
Contributor

luisgarciapuente commented Oct 29, 2024 via email

@sonjapetrovic
Copy link

sonjapetrovic commented Oct 29, 2024 via email

@bkholler
Copy link
Contributor

@lukeamendola and I will be leading a group on graphical models at the upcoming M2 conference in Leipzig. We can make the change Luis suggests or some other fix then.

@lukeamendola
Copy link

Good catch! Yes, we will fix it in two weeks during the M2 Workshop in Leipzig!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants