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, 15 Nov 2017 09:35:46 +0100Exterior algebra errorhttps://ask.sagemath.org/question/39523/exterior-algebra-error/Hi,
I'm new to Sage, and I've been having a lot of trouble constructing a particular algebra. I want to construct the exterior algebra (over $\mathbb{Q}$) on generators $w_{i,j} = w_{j,i}$ where $1 \le i < j \le n$ for some $n$ (for concreteness, say $n = 6$). I want this particular generating set so that I can define an $S_n$ action, but that's the next challenge. I've been attempting the following rough outline:
1. Construct a vector space $V \cong \mathbb{Q}^n$, with basis $\{v_i\}$.
2. Take a tensor product $V \otimes V$, with basis $w_{i,j} = v_i \otimes v_j$.
3. Take a quotient to impose relations $w_{i,i} = 0$ and $w_{i,j} = w_{j,i}$.
4. Take the exterior algebra on the quotient.
Several possible data structures for $V$ (FiniteRankFreeModule, VectorSpace, FreeModule) seem to fail at step 2. Are tensor products implemented for these? The most promising structure, CombinatorialFreeModule, fails at step 4 for an unknown reason. I get an error "base must be a ring or a subcategory of Rings()", even though the base is $\mathbb{Q}$.
Here's the specific code I've tried.
indices = range(1,7)
V = CombinatorialFreeModule(QQ, indices)
V2 = tensor((V,V))
w = V2.basis()
relations = []
for i in indices:
relations.append(w[i,i])
for j in range(i+1,7)
relations.append(w[i,j] - w[j,i])
R = V2.submodule(relations)
V3 = V2.quotient_module(R)
A = ExteriorAlgebra(V3)
The last line gives an error, "base must be a ring or a subcategory of Rings()". The command `V2.base() in Rings()` returns true, but I can't get around the error.
Any help would be appreciated, either in fixing this error or approaching the construction in a different way.Tue, 14 Nov 2017 04:57:15 +0100https://ask.sagemath.org/question/39523/exterior-algebra-error/Comment by FrédéricC for <p>Hi,</p>
<p>I'm new to Sage, and I've been having a lot of trouble constructing a particular algebra. I want to construct the exterior algebra (over $\mathbb{Q}$) on generators $w_{i,j} = w_{j,i}$ where $1 \le i < j \le n$ for some $n$ (for concreteness, say $n = 6$). I want this particular generating set so that I can define an $S_n$ action, but that's the next challenge. I've been attempting the following rough outline:</p>
<ol>
<li>Construct a vector space $V \cong \mathbb{Q}^n$, with basis ${v_i}$.</li>
<li>Take a tensor product $V \otimes V$, with basis $w_{i,j} = v_i \otimes v_j$.</li>
<li>Take a quotient to impose relations $w_{i,i} = 0$ and $w_{i,j} = w_{j,i}$.</li>
<li>Take the exterior algebra on the quotient.</li>
</ol>
<p>Several possible data structures for $V$ (FiniteRankFreeModule, VectorSpace, FreeModule) seem to fail at step 2. Are tensor products implemented for these? The most promising structure, CombinatorialFreeModule, fails at step 4 for an unknown reason. I get an error "base must be a ring or a subcategory of Rings()", even though the base is $\mathbb{Q}$.</p>
<p>Here's the specific code I've tried.</p>
<pre><code>indices = range(1,7)
V = CombinatorialFreeModule(QQ, indices)
V2 = tensor((V,V))
w = V2.basis()
relations = []
for i in indices:
relations.append(w[i,i])
for j in range(i+1,7)
relations.append(w[i,j] - w[j,i])
R = V2.submodule(relations)
V3 = V2.quotient_module(R)
A = ExteriorAlgebra(V3)
</code></pre>
<p>The last line gives an error, "base must be a ring or a subcategory of Rings()". The command <code>V2.base() in Rings()</code> returns true, but I can't get around the error. </p>
<p>Any help would be appreciated, either in fixing this error or approaching the construction in a different way.</p>
https://ask.sagemath.org/question/39523/exterior-algebra-error/?comment=39536#post-id-39536Look at the doc and code of exterior algebra
sage: V3 in Rings()
False
sage: ExteriorAlgebra??Tue, 14 Nov 2017 13:25:06 +0100https://ask.sagemath.org/question/39523/exterior-algebra-error/?comment=39536#post-id-39536Comment by Nat Mayer for <p>Hi,</p>
<p>I'm new to Sage, and I've been having a lot of trouble constructing a particular algebra. I want to construct the exterior algebra (over $\mathbb{Q}$) on generators $w_{i,j} = w_{j,i}$ where $1 \le i < j \le n$ for some $n$ (for concreteness, say $n = 6$). I want this particular generating set so that I can define an $S_n$ action, but that's the next challenge. I've been attempting the following rough outline:</p>
<ol>
<li>Construct a vector space $V \cong \mathbb{Q}^n$, with basis ${v_i}$.</li>
<li>Take a tensor product $V \otimes V$, with basis $w_{i,j} = v_i \otimes v_j$.</li>
<li>Take a quotient to impose relations $w_{i,i} = 0$ and $w_{i,j} = w_{j,i}$.</li>
<li>Take the exterior algebra on the quotient.</li>
</ol>
<p>Several possible data structures for $V$ (FiniteRankFreeModule, VectorSpace, FreeModule) seem to fail at step 2. Are tensor products implemented for these? The most promising structure, CombinatorialFreeModule, fails at step 4 for an unknown reason. I get an error "base must be a ring or a subcategory of Rings()", even though the base is $\mathbb{Q}$.</p>
<p>Here's the specific code I've tried.</p>
<pre><code>indices = range(1,7)
V = CombinatorialFreeModule(QQ, indices)
V2 = tensor((V,V))
w = V2.basis()
relations = []
for i in indices:
relations.append(w[i,i])
for j in range(i+1,7)
relations.append(w[i,j] - w[j,i])
R = V2.submodule(relations)
V3 = V2.quotient_module(R)
A = ExteriorAlgebra(V3)
</code></pre>
<p>The last line gives an error, "base must be a ring or a subcategory of Rings()". The command <code>V2.base() in Rings()</code> returns true, but I can't get around the error. </p>
<p>Any help would be appreciated, either in fixing this error or approaching the construction in a different way.</p>
https://ask.sagemath.org/question/39523/exterior-algebra-error/?comment=39549#post-id-39549Thanks for the response FredericC. The documentation says that ExteriorAlgebra can take as input R a free module over a base ring. Can I get sage to treat $V3$ as a free module (vector space)? It knows that $V3$ lies in the category of vector spaces with basis over $\mathbb{Q}$.
If not, can you think of any other way to create an exterior algebra with bi-indexed basis, such that $w_{i,j} = w_{j,i}$?Tue, 14 Nov 2017 19:50:18 +0100https://ask.sagemath.org/question/39523/exterior-algebra-error/?comment=39549#post-id-39549Comment by FrédéricC for <p>Hi,</p>
<p>I'm new to Sage, and I've been having a lot of trouble constructing a particular algebra. I want to construct the exterior algebra (over $\mathbb{Q}$) on generators $w_{i,j} = w_{j,i}$ where $1 \le i < j \le n$ for some $n$ (for concreteness, say $n = 6$). I want this particular generating set so that I can define an $S_n$ action, but that's the next challenge. I've been attempting the following rough outline:</p>
<ol>
<li>Construct a vector space $V \cong \mathbb{Q}^n$, with basis ${v_i}$.</li>
<li>Take a tensor product $V \otimes V$, with basis $w_{i,j} = v_i \otimes v_j$.</li>
<li>Take a quotient to impose relations $w_{i,i} = 0$ and $w_{i,j} = w_{j,i}$.</li>
<li>Take the exterior algebra on the quotient.</li>
</ol>
<p>Several possible data structures for $V$ (FiniteRankFreeModule, VectorSpace, FreeModule) seem to fail at step 2. Are tensor products implemented for these? The most promising structure, CombinatorialFreeModule, fails at step 4 for an unknown reason. I get an error "base must be a ring or a subcategory of Rings()", even though the base is $\mathbb{Q}$.</p>
<p>Here's the specific code I've tried.</p>
<pre><code>indices = range(1,7)
V = CombinatorialFreeModule(QQ, indices)
V2 = tensor((V,V))
w = V2.basis()
relations = []
for i in indices:
relations.append(w[i,i])
for j in range(i+1,7)
relations.append(w[i,j] - w[j,i])
R = V2.submodule(relations)
V3 = V2.quotient_module(R)
A = ExteriorAlgebra(V3)
</code></pre>
<p>The last line gives an error, "base must be a ring or a subcategory of Rings()". The command <code>V2.base() in Rings()</code> returns true, but I can't get around the error. </p>
<p>Any help would be appreciated, either in fixing this error or approaching the construction in a different way.</p>
https://ask.sagemath.org/question/39523/exterior-algebra-error/?comment=39558#post-id-39558Indeed, I was wrong. Try this maybe:
sage: n = 4
sage: E=ExteriorAlgebra(QQ,['w{}{}'.format(i,j) for j in range(n) for i in range(j)])
sage: E.gens()
(w01, w02, w12, w03, w13, w23)Wed, 15 Nov 2017 09:35:46 +0100https://ask.sagemath.org/question/39523/exterior-algebra-error/?comment=39558#post-id-39558