Ask Your Question

OliverP's profile - activity

2023-10-04 13:49:27 +0100 received badge  Notable Question (source)
2022-07-11 19:50:34 +0100 answered a question Color nodes of poset

The solution is to build the poset with an explicit "facade = True", even though this should have been the default. I st

2022-07-11 19:38:25 +0100 commented question Color nodes of poset

possibly related: although "alpha[4] in Q" is True, "alpha[4] in list(Q)" is apparently False. I think this must be a bu

2022-07-11 19:35:26 +0100 asked a question Color nodes of poset

Color nodes of poset I have a poset Q and an element alpha[4] of Q. If I type "alpha[4] in Q", Sage correctly responds "

2021-01-15 18:18:45 +0100 received badge  Popular Question (source)
2020-01-23 11:47:57 +0100 received badge  Popular Question (source)
2017-04-05 01:37:03 +0100 received badge  Taxonomist
2013-06-13 17:16:51 +0100 marked best answer referencing polynomial variables

Note that it is also possible to do this in a genuine Polynomial Ring, instead of the (sometimes weird) Symbolic Ring:

sage: mylist = [1,4,2,3,6,12,21,6,2]
sage: n = len(mylist)
sage: R = PolynomialRing(ZZ, n, 'x'); R
Multivariate Polynomial Ring in x0, x1, x2, x3, x4, x5, x6, x7, x8 over Integer Ring
sage: P = sum(c*R.gen(i) for i, c in enumerate(mylist)); P
x0 + 4*x1 + 2*x2 + 3*x3 + 6*x4 + 12*x5 + 21*x6 + 6*x7 + 2*x8
sage: P(range(n))
285
2013-05-26 19:10:50 +0100 answered a question referencing polynomial variables

The simplest solution is just to use dictionary arguments for subs.

Instead of

for counter in range(1,n):
    f = f.subs(var('x' + str(counter))=counter)

which throws a SyntaxError, you can write

for counter in range(1,n):
    f = f.subs({var('x' + str(counter)):counter})
2013-04-03 19:12:04 +0100 asked a question referencing polynomial variables

Suppose I have a polynomial $f$ in the variables $x_1, \dots, x_5$ defined by something like

f = 0 
for counter in range(1,5): 
    f += mylist[counter] * var('x' + str(counter))

where mylist is some list of integers. Then I can evaluate $f$ by e.g.

f.subs(x1=1,x2=2,x3=3,x4=4,x5=5)

Question: How do I do this evaluation when $f$ is in $n>>0$ variables?

I want to write something like

for counter in range(1,n):
    f = f.subs(var('x' + str(counter))=counter)

but this isn't a valid argument for subs. This must be some way to coerce this to work.

2012-11-15 17:53:12 +0100 answered a question combinat install

The solution was to reinstall sage from source.

2012-11-15 17:52:12 +0100 commented question combinat install

Thank you! I reinstalled from source, and now combinat will work for me.

2012-11-14 15:28:16 +0100 commented question combinat install

oliver@puter:~$ sage -b main ---------------------------------------------------------- sage: Building and installing modified Sage library files. Installing c_lib g++ -o libcsage.so -shared src/convert.os src/interrupt.os src/memory.os src/mpn_pylong.os src/mpz_pylong.os src/mpz_longlong.os src/stdsage.os src/gmp_globals.os src/ZZ_pylong.os src/ntl_wrap.os -L/home/oliver/sage-5.4-linux-32bit-ubuntu_12.04.1_lts-i686-Linux/local/lib -L/home/oliver/sage-5.4-linux-32bit-ubuntu_12.04.1_lts-i686-Linux/local/lib/python2.7/config -lntl -lpari -lgmp -lpython2.7 /usr/bin/ld: cannot find crti.o: No such file or directory collect2: ld returned 1 exit status scons: *** [libcsage.so] Error 1 Error building c_lib.

2012-11-14 12:58:24 +0100 received badge  Editor (source)
2012-11-12 17:09:43 +0100 commented question combinat install

The reinstallation of sage is fine, but I am scared to try combinat again without knowing what went wrong the first time.

2012-11-12 12:29:52 +0100 asked a question combinat install

I was running sage 5.3 on a lubuntu 12.04 machine. Everything was fine.

Then I tried

./sage -combinat install

Now when I try to use sage, it says

<ERROR: name 'sage_prompt' is not defined>

Is this a known issue? I am currently reinstalling sage 5.4 and hoping that it will work this time. Please advise. Thanks!

UPDATE: I tried it again in 5.4 and got the following error:

Creating sage-combinat branch: /home/oliver/sage-5.4-linux-32bit-ubuntu_12.04.1_lts-i686-Linux/sage -b main

---------------------------------------------------------- sage: Building and installing modified Sage library files.

Installing c_lib g++ -o libcsage.so -shared src/convert.os src/interrupt.os src/memory.os src/mpn_pylong.os src/mpz_pylong.os src/mpz_longlong.os src/stdsage.os src/gmp_globals.os src/ZZ_pylong.os src/ntl_wrap.os -L/home/oliver/sage-5.4-linux-32bit-ubuntu_12.04.1_lts-i686-Linux/local/lib -L/home/oliver/sage-5.4-linux-32bit-ubuntu_12.04.1_lts-i686-Linux/local/lib/python2.7/config -lntl -lpari -lgmp -lpython2.7 /usr/bin/ld: cannot find crti.o: No such file or directory collect2: ld returned 1 exit status scons: *** [libcsage.so] Error 1 Error building c_lib. Abort

2012-11-08 12:39:33 +0100 commented answer Skew commuting variables

Thanks! This is exactly what I needed!

2012-11-08 12:39:13 +0100 received badge  Scholar (source)
2012-11-08 12:39:13 +0100 marked best answer Skew commuting variables

You can use our wrapper for Singular's non-commutative component Plural. In particular, you can create a G-algebra for this ring as follows:

sage: A.<x0,x1,x2> = FreeAlgebra(QQ, 3)
sage: A
Free Algebra on 3 generators (x0, x1, x2) over Rational Field
sage: R.<x0,x1,x2> = A.g_algebra({x1*x0: -x0*x1, x2*x0: -x0*x2, x2*x1: -x1*x2})
sage: R
Noncommutative Multivariate Polynomial Ring in x0, x1, x2 over Rational Field, nc-relations: {x2*x1: -x1*x2, x2*x0: -x0*x2, x1*x0: -x0*x1}
sage: x2*x1
-x1*x2
sage: x1*x2
x1*x2
2012-11-08 12:39:11 +0100 received badge  Supporter (source)
2012-11-08 07:01:08 +0100 received badge  Student (source)
2012-11-07 18:22:17 +0100 asked a question Skew commuting variables

I want to work in the ring QQ<x0, x1, x2> / (xi*xj = -xj*xi for i \neq j). (In particular, xi^2 \neq 0; this is not the exterior algebra.)

I seems like FreeAlgebraQuotient is the thing to use, but I am not sure how. In the documentation for FreeAlgebraQuotient, the algebras are 4-dimensional as modules over QQ. However in my application, the algebra is infinite-dimensional as a module, so I can't write down the matrices for the action of the generators.

Is there another way to obtain this ring? Thanks.