2024-02-23 16:02:48 +0100 edited answer How to substitute the product of two variables in polynom? In symbolic ring, you can perform such substitution by explicitly going over the coefficients of powers of x and y: sum 2024-02-23 15:40:37 +0100 commented question Possible bug with product of matrices over GF with modulus I'm not sure if that's relevant, but CoCalc runs venv-python3.11.1/bin/sage, while SageCell runs venv-python3.10/bin/sag 2024-02-23 15:29:55 +0100 received badge ● Notable Question (source) 2024-02-23 15:29:55 +0100 received badge ● Popular Question (source) 2024-02-23 15:29:17 +0100 received badge ● Popular Question (source) 2024-02-23 15:22:36 +0100 edited answer How to substitute the product of two variables in polynom? You can perform such substitution by explicitly going over the coefficients of powers of x and y: sum( cy*x^(dx-min(dx, 2024-02-23 15:22:01 +0100 answered a question How to substitute the product of two variables in polynom? You can perform such substitution by explicitly going over the coefficients of x and y: sum( cy*x^(dx-min(dx,dy))*y^(dy 2024-02-23 14:45:38 +0100 commented answer Efficient reduction to elementary symmetric polynomials Ok, I see. There was an error in to_old function, here is a corrected version: https://sagecell.sagemath.org/?q=eoayyx 2024-02-23 14:44:29 +0100 commented answer Efficient reduction to elementary symmetric polynomials Ok, I see. There was an error in to_old function, here is a corrected version: https://sagecell.sagemath.org/?q=eoayyx B 2024-02-22 22:42:05 +0100 commented answer Efficient reduction to elementary symmetric polynomials Can you provide a complete example? Also, it should be e.from_polynomial( f.reduce([a+b+c]).specialization({a:0}) ), not 2024-02-22 22:39:17 +0100 commented answer Efficient reduction to elementary symmetric polynomials My point is that you can perform computations with symmetric ("primed") functions of one fewer variables, which will tak 2024-02-22 22:37:02 +0100 commented answer Efficient reduction to elementary symmetric polynomials My point is that you can perform computations with symmetric ("primed") functions of one fewer variables, which will tak 2024-02-22 18:29:31 +0100 edited answer Pythagorean triple count There is a known formula for the number of representations as the sum of two squares - see Wikipedia. Employing it, you 2024-02-22 17:32:18 +0100 commented question Bug: RSK Kills Kernel Bugs should be reported at https://github.com/sagemath/sage/issues 2024-02-22 17:30:38 +0100 edited answer Pythagorean triple count There is a known formula for the number of representations as the sum of two squares - see Wikipedia. Employing it, you 2024-02-22 17:30:07 +0100 answered a question Pythagorean triple count There is a known formula for number of representations as the sum of two squares - see Wikipedia. Employing it you can h 2024-02-22 16:30:16 +0100 commented question Pythagorean triple count len([...]) is a waste of memory since it creates a huge list just to compute its length. Use sum(1 for a in ...) instead 2024-02-22 00:16:42 +0100 commented answer Efficient reduction to elementary symmetric polynomials No. Here are a bit ugly but working (back and force) conversion functions: https://sagecell.sagemath.org/?q=khljrd 2024-02-22 00:16:06 +0100 commented answer Efficient reduction to elementary symmetric polynomials No. Here are a bit ugly but working (back and force) conversion functions: https://sagecell.sagemath.org/?q=vehulj 2024-02-22 00:14:23 +0100 commented answer Efficient reduction to elementary symmetric polynomials No. Here are a bit ugly but working (back and force) conversion functions: https://sagecell.sagemath.org/?q=bxjnzg 2024-02-21 21:47:27 +0100 commented answer How to determine if two colorings of a graph are the same? I've already provided code for computing unique_colorings - just check len(unique_colorings) == 1 to make sure that ther 2024-02-21 16:49:18 +0100 commented answer How to determine if two colorings of a graph are the same? Hashable sets are provided by Python's frozenset or by Sage's Set types. Alternatively, you can create set partitions fr 2024-02-21 16:47:53 +0100 commented answer How to determine if two colorings of a graph are the same? Hashable sets are provided by Python's frozenset or by Sage's Set types. 2024-02-20 21:59:40 +0100 commented answer Efficient reduction to elementary symmetric polynomials If $e_i, e'_i$ are "old" and "new" polynomials, respectively, then $e_i = e'_i - e'_1e'_{i-1}$. So, you can work with ne 2024-02-20 21:59:24 +0100 commented answer Efficient reduction to elementary symmetric polynomials If $e_i, e'_i$ are "old" and "new" polynomials, respectively, and $a$ is the eliminated variable, then $e_i = e'_i - e'_ 2024-02-20 20:20:45 +0100 commented question Ideals of$\mathbb Z[x]$The corresponding issue is at https://github.com/sagemath/sage/issues/37409 2024-02-20 20:19:02 +0100 commented question qepcad fails to find an existing solution Just for the record: https://github.com/sagemath/sage/issues/37365 2024-02-20 19:19:25 +0100 edited answer rational canonical form Like this: sage: K = PolynomialRing(QQ,2,'x').fraction_field() sage: x = K.gens() sage: A = Matrix([[x[0]*x[1]+1,x[1]], 2024-02-20 19:08:20 +0100 answered a question rational canonical form Like this: sage: F = PolynomialRing(QQ,2,'x') sage: K = F.fraction_field() sage: x = K.gens() sage: A = Matrix([[x[0]*x 2024-02-20 18:57:20 +0100 marked best answer Implementation of BEST theorem BEST theorem provides a polynomial-time algorithm for enumeration of Eulerian circuits in a given directed graph. Is there is a readily available implementation of it in Sage? 2024-02-20 18:47:59 +0100 edited answer Finding all integer solutions of binary quadratic form You can call pari.qfbsolve directly with flag set to 1 or 3. Rephrasing examples from the PARI/GP manual: sage: pari.qf 2024-02-20 18:37:32 +0100 edited answer How to determine if two colorings of a graph are the same? You can represent colorings as (unordered) set partitions of vertices: from sage.graphs.graph_coloring import all_graph 2024-02-20 18:34:21 +0100 answered a question How to determine if two colorings of a graph are the same? You can represent colorings as (unordered) set partitions of vertices: from sage.graphs.graph_coloring import all_graph 2024-02-20 18:24:28 +0100 answered a question Finding all integer solutions of binary quadratic form You can call pari.qfbsolve directly with flag set to 1 or 3. Rephrasing examples from the PARI/GP manual: sage: pari.qf 2024-02-20 02:36:44 +0100 commented answer Efficient reduction to elementary symmetric polynomials I do not follow. (a^2 + b^2 + c^2 + d^2).reduce([a+b+c+d]) is symmetric in the remaining three variables. E.g. see https 2024-02-19 20:46:37 +0100 commented answer Efficient reduction to elementary symmetric polynomials It's unclear what is your set up. If you work with symmetric expressions of 5 roots only, how do you get$e_i$with$i&g 2024-02-19 18:47:44 +0100 marked best answer symmetric functions with restricted number of variables I'd like to restrict computations with symmetric functions to just a given number of variables. For example, m = SymmetricFunctions(QQ).m() (1 + m[1])^5  produces m[] + 5*m[1] + 20*m[1, 1] + 60*m[1, 1, 1] + 120*m[1, 1, 1, 1] + 120*m[1, 1, 1, 1, 1] + 10*m[2] + 30*m[2, 1] + 60*m[2, 1, 1] + 60*m[2, 1, 1, 1] + 30*m[2, 2] + 30*m[2, 2, 1] + 10*m[3] + 20*m[3, 1] + 20*m[3, 1, 1] + 10*m[3, 2] + 5*m[4] + 5*m[4, 1] + m[5]  However, if it's known that there are just 3 variables, the above result should be truncated to: m[] + 5*m[1] + 20*m[1, 1] + 60*m[1, 1, 1] + 10*m[2] + 30*m[2, 1] + 60*m[2, 1, 1] + 30*m[2, 2] + 30*m[2, 2, 1] + 10*m[3] + 20*m[3, 1] + 20*m[3, 1, 1] + 10*m[3, 2] + 5*m[4] + 5*m[4, 1] + m[5]  I can surely truncate a particular expression myself, but I need an automated way to do so for all intermediate results in lengthy computation. I guess I need somehow to define a custom ring of symmetric functions, where result of multiplication is truncated to a given (fixed) number of variables. 2024-02-19 18:42:00 +0100 edited answer Efficient reduction to elementary symmetric polynomials You can use the function like def myreduce(f): return f.parent()._from_dict( {d:c for d,c in f if d[0]<=5 and d[ 2024-02-19 17:33:53 +0100 edited answer Efficient reduction to elementary symmetric polynomials You can use the function like def myreduce(f): return f.parent()._from_dict( {d:c for d,c in f if d[0]<=5 and d[ 2024-02-19 17:31:34 +0100 answered a question Efficient reduction to elementary symmetric polynomials You can use the function like def myreduce(f): return f.parent()._from_dict( {d:c for d,c in f if max(d,default=0)& 2024-02-19 17:24:59 +0100 commented question Cyclotomic fields - displaying powers of zeta Then work modulo zeta^3 - 1 while you don't do factoring; and when you do, embed the argument into the cyclotomic field 2024-02-19 12:14:14 +0100 commented question Cyclotomic fields - displaying powers of zeta Then work modulo zeta^3 - 1 while you don't factoring; and when you do, embed the argument into the cyclotomic field fir 2024-02-19 08:50:25 +0100 received badge ● Nice Answer (source) 2024-02-19 02:59:34 +0100 edited question Is there a command or a way in SageMath to collect more than one common variable in an equation? without specifying those common variable or write them manually Is there a command or a way in SageMath to collect more than one common variable in an equation? without specifying thos 2024-02-18 23:08:48 +0100 commented answer Ghost numbers when using ARB This is not an answer. 2024-02-18 23:06:54 +0100 answered a question Ghost numbers when using ARB Note that number 3.1 has precision of 53 bits as an element of RDF and this precision is inherited by RDD object. Try th 2024-02-18 22:56:57 +0100 commented question Cyclotomic fields - displaying powers of zeta zeta^5 % (zeta^3 - 1) is not the same as computing zeta^5 in CyclotomicField(3) as the latter is done modulo cyclotomic 2024-02-18 22:55:12 +0100 commented question Cyclotomic fields - displaying powers of zeta zeta^5 % (zeta^3 - 1) is not the same as computing zeta^5 in CyclotomicField(3) as the latter is done modulo cyclotomic 2024-02-18 17:28:25 +0100 commented question How to find all elements of a ring up to a certain value All powers of $(-1+\sqrt5)/2$ have norm $1$, and there are infinitely many such powers. So, your example is invalid. 2024-02-18 17:28:10 +0100 commented question How to find all elements of a ring up to a certain value All powers of $(-1+\sqrt5)/2$ have norm $1$, and there infinitely many such powers. So, your example is invalid.