2022-10-31 13:37:14 +0200 | received badge | ● Popular Question (source) |
2020-01-16 17:11:29 +0200 | received badge | ● Popular Question (source) |
2017-03-15 15:17:06 +0200 | asked a question | Multivariate polynomial coefficients including zeros Dears, I would like to get the coefficients of a multivariate polynomial including the zero coefficients (in their correct positions). I have found a similar answer as regards a polynomial f of two variables x,y Then using the following code: The result is as expected: [3, ,0 , 0, 1, 0, 0, 0, 0, 3] Now, I would like to extend this solution for a multivariate polynomial of n variables [xo,x1,...xn-1] The polynomial is defined with the following code: (Note: q=next_prime(10000)) How can I do that? Any help will be much appreciated. Regards, Natassa |
2016-12-11 09:26:07 +0200 | received badge | ● Nice Question (source) |
2016-12-11 09:25:39 +0200 | received badge | ● Teacher (source) |
2016-12-11 09:25:39 +0200 | received badge | ● Self-Learner (source) |
2016-12-08 11:40:08 +0200 | commented answer | Problem with the minus sign in symbolic expression Indeed, now I see what the problem was. Thank you! |
2016-12-08 11:18:28 +0200 | received badge | ● Editor (source) |
2016-12-08 10:15:46 +0200 | asked a question | Problem with the minus sign in symbolic expression Hi all! My sage version is: 'SageMath Version 6.9, Release Date: 2015-10-10' In my code, I have a multivariate polynomial with a sign symbol which doesn't return the correct result. I.e. The code snippet is as follows: a1 and b1 are returned from another function. Could this be a problem? a1 is a vector with values (76, 83), b1 is scalar with value 62, x is a vector with values (x1,x2). Thus, f1 should return 62-76 * x1-83 * x2; however it returns 25x1 + 18x2 + 62 which is not correct. Please note that if I use addition in f1 as follows: The result is correct,i.e. 76x1 + 83x2 + 62 type(f1) is sage.symbolic.expression.Expression What could the problem be? I tried to convert the symbolic expression to multivariate polynomial, but this didn't work either? I also though there might be a problem with the minus symbol in my PC but couldn't solve it this way either. Thank you for your responses! Regards, Natassa |
2016-12-03 12:24:19 +0200 | received badge | ● Scholar (source) |
2016-12-03 12:23:41 +0200 | answered a question | Reduce multivariate polynomial coefficients to 1 Thank you all, Indeed, considering sum of all monomials does the trick! As a reference, a slightly tweaked solution below that worked for me: |
2016-12-02 16:42:00 +0200 | received badge | ● Student (source) |
2016-12-02 14:57:35 +0200 | asked a question | Reduce multivariate polynomial coefficients to 1 Hi all, I'm new to Python and SAGE and would like to ask a question: I have a multivariate polynomial, of a degree 3, i.e: g.<x1,x2,x3>=x1^2 + 2x1x2 + x2^2 + 2x1x3 + 2x2x3 + x3^2 + 2x1 + 2x2 + 2*x3 + 1 Its type is <type 'sage.rings.polynomial.multi_polynomial_libsingular.mpolynomial_libsingu\="" lar'=""> The question is how can I reduce all its leading coefficients to 1, i.e. transform ig to: g.<x1,x2,x3>=x1^2 + x1x2 + x2^2 + x1x3 + x2x3 + x3^2 + *x1 + *x2 + *x3 + 1 I tried to get the coefficients of the polynomial (which is a list), iterate through its items, and set the values of the items to 1, i.e. for s in g.coefficients(): if s==2: s=1 I think that the problem is that list items can't be cast to integer (TypeError). How could I solve this? Is there a more efficient way to do this? Thank you for your responses! Regards, Natassa |