ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 16 Jun 2021 20:04:10 +0200Obtaining the Solomon-Orlik algebra in QPA with the help of Sagehttps://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/The Solomon-Orlik algebra (see [Sage documentation: Orlik-Solomon algebra](https://doc.sagemath.org/html/en/reference/algebras/sage/algebras/orlik_solomon.html)) associates to a finite matroid a finite dimensional algebra.
It is implemented in Sage to obtain generators and relations of those algebras but there seems to be no easy way to translate them into the GAP-package QPA where many more functions are available to study those algebras.
Let M be a finite matroid which we can assume for simplicity given as a finite set X of vectors with set of circuits C, which are simply the minimal linearly dependent subsets of X.
Recall that the exterior algebra on a ground set of variables x1,...,xn (assume them to be ordered x1 < ... < xn) is given as the quotient of the free algebra on x1,...,xn modulo the relations xi^2 and xi xj +xj xi for i < j.
In QPA the exterior algebra for n=4 is for example obtained as follows:
Q := Quiver(1,[[1,1,"x1"],[1,1,"x2"],[1,1,"x3"],[1,1,"x4"]]);
KQ := PathAlgebra(Rationals,Q);
AssignGeneratorVariables(KQ);
rel := [x1^2,x2^2,x3^2,x4^2,x1*x2+x2*x1,x1*x3+x3*x1,x1*x4+x4*x1,x2*x3+x3*x2,x2*x4+x4*x2,x3*x4+x4*x3];
A := KQ/rel;
Now the Solomon-Orlik algebra (see [Sage documentation: Orlik-Solomon algebra](https://doc.sagemath.org/html/en/reference/algebras/sage/algebras/orlik_solomon.html)) of a matroid M is given by adding the relations
$$\\sum_{r=1}^{t}{(-1)^{r-1}{x_{j_1} ... \\hat{x_{j_r}} .... x_{j_t}}$$
for every element (x1< ... < xt) in the circuits C.
For example when M is the matroid given by the vectors
x1=t=(1,-1,0), x2=u=(0,1,-1), x3=v=(-1,0,1), x4=w=(1,1,1).
then we have one circut given by x1 x2 x3 and thus one additional relation
given by x2 x3 - x1 x3 +x1x2 and the algebra in QPA can be obtained as follows:
Q := Quiver(1,[[1,1,"x1"],[1,1,"x2"],[1,1,"x3"],[1,1,"x4"]]);
KQ := PathAlgebra(Rationals,Q);
AssignGeneratorVariables(KQ);
rel := [x1^2,x2^2,x3^2,x4^2,x1*x2+x2*x1,x1*x3+x3*x1,x1*x4+x4*x1,x2*x3+x3*x2,x2*x4+x4*x2,x3*x4+x4*x3,x2*x3-x1*x3+x1*x2];
A := KQ/rel;
Question: Is there a direct way to directly obtain the quiver and relations for QPA in the format as in the examples using Sage for a given matroid?Mon, 07 Jun 2021 18:35:55 +0200https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/Answer by tkarn for <p>The Solomon-Orlik algebra (see <a href="https://doc.sagemath.org/html/en/reference/algebras/sage/algebras/orlik_solomon.html">Sage documentation: Orlik-Solomon algebra</a>) associates to a finite matroid a finite dimensional algebra.
It is implemented in Sage to obtain generators and relations of those algebras but there seems to be no easy way to translate them into the GAP-package QPA where many more functions are available to study those algebras.</p>
<p>Let M be a finite matroid which we can assume for simplicity given as a finite set X of vectors with set of circuits C, which are simply the minimal linearly dependent subsets of X.</p>
<p>Recall that the exterior algebra on a ground set of variables x1,...,xn (assume them to be ordered x1 < ... < xn) is given as the quotient of the free algebra on x1,...,xn modulo the relations xi^2 and xi xj +xj xi for i < j.</p>
<p>In QPA the exterior algebra for n=4 is for example obtained as follows:</p>
<pre><code>Q := Quiver(1,[[1,1,"x1"],[1,1,"x2"],[1,1,"x3"],[1,1,"x4"]]);
KQ := PathAlgebra(Rationals,Q);
AssignGeneratorVariables(KQ);
rel := [x1^2,x2^2,x3^2,x4^2,x1*x2+x2*x1,x1*x3+x3*x1,x1*x4+x4*x1,x2*x3+x3*x2,x2*x4+x4*x2,x3*x4+x4*x3];
A := KQ/rel;
</code></pre>
<p>Now the Solomon-Orlik algebra (see <a href="https://doc.sagemath.org/html/en/reference/algebras/sage/algebras/orlik_solomon.html">Sage documentation: Orlik-Solomon algebra</a>) of a matroid M is given by adding the relations
$$\sum_{r=1}^{t}{(-1)^{r-1}{x_{j_1} ... \hat{x_{j_r}} .... x_{j_t}}$$
for every element (x1< ... < xt) in the circuits C.</p>
<p>For example when M is the matroid given by the vectors
x1=t=(1,-1,0), x2=u=(0,1,-1), x3=v=(-1,0,1), x4=w=(1,1,1).
then we have one circut given by x1 x2 x3 and thus one additional relation
given by x2 x3 - x1 x3 +x1x2 and the algebra in QPA can be obtained as follows:</p>
<pre><code>Q := Quiver(1,[[1,1,"x1"],[1,1,"x2"],[1,1,"x3"],[1,1,"x4"]]);
KQ := PathAlgebra(Rationals,Q);
AssignGeneratorVariables(KQ);
rel := [x1^2,x2^2,x3^2,x4^2,x1*x2+x2*x1,x1*x3+x3*x1,x1*x4+x4*x1,x2*x3+x3*x2,x2*x4+x4*x2,x3*x4+x4*x3,x2*x3-x1*x3+x1*x2];
A := KQ/rel;
</code></pre>
<p>Question: Is there a direct way to directly obtain the quiver and relations for QPA in the format as in the examples using Sage for a given matroid?</p>
https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?answer=57524#post-id-57524Here is one way to get the generators of the Orlik-Solomon ideal:
sage: M = matroids.CompleteGraphic(3)
sage: OS = M.orlik_solomon_algebra(QQ)
sage: E.<x,y,z> = algebras.Exterior(QQ)
sage: d = [[((-1)^i,tuple(list(c)[:i]+list(c)[i+1:])) for i in range(len(c))] for c in M.circuits()]
sage: rels = [E.sum([sgn*E.basis()[idx] for sgn,idx in c]) for c in d]; rels
[x*y - x*z + y*z]Thu, 10 Jun 2021 06:16:50 +0200https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?answer=57524#post-id-57524Comment by tkarn for <p>Here is one way to get the generators of the Orlik-Solomon ideal:</p>
<pre><code>sage: M = matroids.CompleteGraphic(3)
sage: OS = M.orlik_solomon_algebra(QQ)
sage: E.<x,y,z> = algebras.Exterior(QQ)
sage: d = [[((-1)^i,tuple(list(c)[:i]+list(c)[i+1:])) for i in range(len(c))] for c in M.circuits()]
sage: rels = [E.sum([sgn*E.basis()[idx] for sgn,idx in c]) for c in d]; rels
[x*y - x*z + y*z]
</code></pre>
https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57587#post-id-57587A better way to do it might be: `E = algebras.Exterior(QQ, 'x', len(G))`. Sorry for the clunky previous answer.Wed, 16 Jun 2021 20:04:10 +0200https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57587#post-id-57587Comment by klaaa for <p>Here is one way to get the generators of the Orlik-Solomon ideal:</p>
<pre><code>sage: M = matroids.CompleteGraphic(3)
sage: OS = M.orlik_solomon_algebra(QQ)
sage: E.<x,y,z> = algebras.Exterior(QQ)
sage: d = [[((-1)^i,tuple(list(c)[:i]+list(c)[i+1:])) for i in range(len(c))] for c in M.circuits()]
sage: rels = [E.sum([sgn*E.basis()[idx] for sgn,idx in c]) for c in d]; rels
[x*y - x*z + y*z]
</code></pre>
https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57546#post-id-57546Thanks again!Fri, 11 Jun 2021 16:51:49 +0200https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57546#post-id-57546Comment by tkarn for <p>Here is one way to get the generators of the Orlik-Solomon ideal:</p>
<pre><code>sage: M = matroids.CompleteGraphic(3)
sage: OS = M.orlik_solomon_algebra(QQ)
sage: E.<x,y,z> = algebras.Exterior(QQ)
sage: d = [[((-1)^i,tuple(list(c)[:i]+list(c)[i+1:])) for i in range(len(c))] for c in M.circuits()]
sage: rels = [E.sum([sgn*E.basis()[idx] for sgn,idx in c]) for c in d]; rels
[x*y - x*z + y*z]
</code></pre>
https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57544#post-id-57544One way to do it is `algebras.Exterior(QQ,[f'x{i}' for i in range(1, len(G)+1)])`Fri, 11 Jun 2021 15:57:07 +0200https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57544#post-id-57544Comment by klaaa for <p>Here is one way to get the generators of the Orlik-Solomon ideal:</p>
<pre><code>sage: M = matroids.CompleteGraphic(3)
sage: OS = M.orlik_solomon_algebra(QQ)
sage: E.<x,y,z> = algebras.Exterior(QQ)
sage: d = [[((-1)^i,tuple(list(c)[:i]+list(c)[i+1:])) for i in range(len(c))] for c in M.circuits()]
sage: rels = [E.sum([sgn*E.basis()[idx] for sgn,idx in c]) for c in d]; rels
[x*y - x*z + y*z]
</code></pre>
https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57539#post-id-57539Thank you very much! This works. I am not so experienced in Sage: Is there a quick way to make Sage automatically write "E.<x1,x2,...,xn> = algebras.Exterior(QQ)" (so that the variables names are xi for i=1,...,n where n is len(G) with G = OS.algebra_generators()))Fri, 11 Jun 2021 09:18:30 +0200https://ask.sagemath.org/question/57466/obtaining-the-solomon-orlik-algebra-in-qpa-with-the-help-of-sage/?comment=57539#post-id-57539