ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 24 Apr 2012 03:54:23 -0500how to print the weight multiplicites in a columnhttp://ask.sagemath.org/question/8918/how-to-print-the-weight-multiplicites-in-a-column/I work with
D2=WeylCharacterRing("D2")
and I am interested in
D2(1,0).weight_multiplicities()
{(0, 1): 1, (1, 0): 1, (-1, 0): 1, (0, -1): 1}
I would like to have this result in a column. I tried as follows:
for a in D2(1,0).weight_multiplicities(): print a
(0, 1)
(1, 0)
(-1, 0)
(0, -1)
But now, I didn't have the multiplicities (the number after ":"). I would like to obtain
(0, 1): 1
(1, 0): 1
(-1, 0): 1
(0, -1):1
How can I do? Thanks.-.Tue, 24 Apr 2012 02:06:30 -0500http://ask.sagemath.org/question/8918/how-to-print-the-weight-multiplicites-in-a-column/Answer by achrzesz for <p>I work with </p>
<pre><code>D2=WeylCharacterRing("D2")
</code></pre>
<p>and I am interested in </p>
<pre><code>D2(1,0).weight_multiplicities()
{(0, 1): 1, (1, 0): 1, (-1, 0): 1, (0, -1): 1}
</code></pre>
<p>I would like to have this result in a column. I tried as follows:</p>
<pre><code>for a in D2(1,0).weight_multiplicities(): print a
(0, 1)
(1, 0)
(-1, 0)
(0, -1)
</code></pre>
<p>But now, I didn't have the multiplicities (the number after ":"). I would like to obtain</p>
<pre><code>(0, 1): 1
(1, 0): 1
(-1, 0): 1
(0, -1):1
</code></pre>
<p>How can I do? Thanks.-.</p>
http://ask.sagemath.org/question/8918/how-to-print-the-weight-multiplicites-in-a-column/?answer=13493#post-id-13493
sage: d=D2(1,0).weight_multiplicities()
sage: for k in range(len(d)): print d.keys()[k],":",d.values()[k]
....:
(0, 1) : 1
(1, 0) : 1
(-1, 0): 1
(0, -1): 1
Tue, 24 Apr 2012 03:54:23 -0500http://ask.sagemath.org/question/8918/how-to-print-the-weight-multiplicites-in-a-column/?answer=13493#post-id-13493Answer by achrzesz for <p>I work with </p>
<pre><code>D2=WeylCharacterRing("D2")
</code></pre>
<p>and I am interested in </p>
<pre><code>D2(1,0).weight_multiplicities()
{(0, 1): 1, (1, 0): 1, (-1, 0): 1, (0, -1): 1}
</code></pre>
<p>I would like to have this result in a column. I tried as follows:</p>
<pre><code>for a in D2(1,0).weight_multiplicities(): print a
(0, 1)
(1, 0)
(-1, 0)
(0, -1)
</code></pre>
<p>But now, I didn't have the multiplicities (the number after ":"). I would like to obtain</p>
<pre><code>(0, 1): 1
(1, 0): 1
(-1, 0): 1
(0, -1):1
</code></pre>
<p>How can I do? Thanks.-.</p>
http://ask.sagemath.org/question/8918/how-to-print-the-weight-multiplicites-in-a-column/?answer=13492#post-id-13492 sage: for a in D2(1,0).weight_multiplicities().items(): print a
....:
((0, 1), 1)
((1, 0), 1)
((-1, 0), 1)
((0, -1), 1)
Tue, 24 Apr 2012 03:46:13 -0500http://ask.sagemath.org/question/8918/how-to-print-the-weight-multiplicites-in-a-column/?answer=13492#post-id-13492