2018-08-13 12:13:01 -0600 | received badge | ● Enlightened (source) |

2018-08-13 12:13:01 -0600 | received badge | ● Good Answer (source) |

2018-08-09 07:08:34 -0600 | received badge | ● Nice Answer (source) |

2018-08-08 12:29:14 -0600 | answered a question | arrange an expression in powers of a variable Alternatively, you can use collect(): To get the coefficient of ep^2 you can do: To get all the coefficients at once: If you define you can access the coefficient of |

2018-02-01 08:58:06 -0600 | received badge | ● Notable Question (source) |

2017-04-05 10:48:36 -0600 | received badge | ● Civic Duty (source) |

2017-04-05 08:57:51 -0600 | commented question | Defining a generic symbolic function with symmetric arguments @mforets: Thank you for pointing that out! Now it works in general, see updated question. I can now also define an |

2017-04-05 05:38:25 -0600 | commented question | Defining a generic symbolic function with symmetric arguments @mforets: Thank you very much for suggesting a general Python audience, I will try that later. Regarding the recursion, you have to know when to stop sorting the arguments. I updated the question with one attempt that is not general wrt the number of arguments just as an idea to try. |

2017-04-03 14:00:56 -0600 | received badge | ● Popular Question (source) |

2017-03-28 17:25:38 -0600 | received badge | ● Commentator |

2017-03-28 17:25:38 -0600 | commented question | use multiple precision by default ? @tmonteil: I believe that he is doing something like QQ = RealField(1000) to have numbers with 1000 bits of precision and he does not want to keep on writing everything inside QQ(). It would be nice to have a 'default' precision command that one sets up in the beginning and forget about it |

2017-03-28 17:21:57 -0600 | commented answer | Arbitrary precision with power function Is there a way to choose a default precision such that one does not need to keep typing RealField(1000)? |

2016-11-04 20:37:05 -0600 | commented question | Speeding up power_mod @Wojowu Despite the different environments, ~45s to ~18s is a huge difference. I tested |

2016-11-04 19:26:29 -0600 | commented question | Speeding up power_mod @Wojowu I'd expect GMP's .powermod to have a similar performance as Julia since Julia uses GMP too. But you cannot really compare the methods unless you compare them running in the |

2016-11-03 15:20:46 -0600 | commented answer | Defining a generic symbolic function with symmetric arguments Right, s(1,1) makes sense but it is zero. So in general one can restrict the labels to be distinct. Furthermore, s(i,j) is commutative. In Mathematica terms I am looking for the equivalent of using something like SetAttributes[s, Orderless] and nothing more. |

2016-11-03 03:42:36 -0600 | received badge | ● Good Question (source) |

2016-11-02 09:38:41 -0600 | received badge | ● Enthusiast |

2016-11-01 13:03:39 -0600 | commented answer | Defining a generic symbolic function with symmetric arguments So ideally one would have the choice of defining a symmetric function via an argument to the |

2016-11-01 13:00:30 -0600 | commented answer | Defining a generic symbolic function with symmetric arguments Thank you for your answer, but this is not really what I am looking for. The name of the function in the input must be the same as the output; ie I want to type |

2016-10-30 08:27:50 -0600 | commented question | Speeding up power_mod |

2016-10-30 07:50:20 -0600 | commented question | Speeding up power_mod Julia uses the gmp library (see line 440 of [https://github.com/JuliaLang/julia/bl...]), whereas Sage uses a hand-made power_mod() function in python (see [https://github.com/sagemath/sage/blob...]). So one way to speed up Sage's power_mod() function is to implement it in pynac. Have you compared to Python's built-in pow(a,b,c) function, where c is the modulus? see here [https://docs.python.org/3/library/fun...] |

2016-10-21 19:44:35 -0600 | answered a question | How to find a polynomial identity to evaluate sum of fifth powers? You can also solve it a bit more directly without explicitly invoking the Groebner basis (this happens under the hood). (I came up with this solution after reading the solution to Exercise 37 from the book "Calcul Mathematique avec Sage", given on page 423) |

2016-10-06 00:04:02 -0600 | received badge | ● Teacher (source) |

2016-10-03 09:17:11 -0600 | answered a question | leading coefficient polynomial For example, you can extract its coefficients as follows: to get So the last sublist contains the answer, in this case 2 is the coefficient of x^4. To extract this automatically you can define a function that takes a polynomial as argument: And use it like this: to get 2 as the answer. Hope this helps you get going! |

2016-09-30 06:17:21 -0600 | commented question | Is there a command like Mathematica's Dynamic[] in Sage? There is a "profiling" section in the tutorial http://doc.sagemath.org/pdf/en/tutori... which could be helpful. |

2016-09-25 12:20:05 -0600 | received badge | ● Scholar (source) |

2016-09-25 09:26:17 -0600 | received badge | ● Nice Question (source) |

2016-09-24 16:55:43 -0600 | asked a question | solve((x^3 - 4*x) > 0,x) does not enforce condition assume(x > 0) I actually have two (related) questions. First question, am I misunderstanding the following code? The solution given by sagemath-7.3 is but I would expect only the solution [x > 2] under the condition x > 0. Is this a bug or am I doing something wrong? Second question. How can I enforce the condition x > 0 myself and "solve" the resulting conditions of: How can I solve this type of question efficiently? I believe that discarding the negative solutions in the above system will imply that 2 < D < 1/9(116 - sqrt(1081)), for example. However, I'd like to do this for many other cases as well. Any help will be appreciated! |

2016-09-22 11:50:48 -0600 | received badge | ● Nice Question (source) |

2016-09-22 11:41:52 -0600 | received badge | ● Editor (source) |

2016-09-19 15:51:05 -0600 | received badge | ● Supporter (source) |

2016-09-19 14:43:23 -0600 | received badge | ● Student (source) |

2016-09-18 16:05:36 -0600 | asked a question | Defining a generic symbolic function with symmetric arguments
I would like to define a generic symbolic function called So if I type s(3,2) the output must be s(2,3), and similarly and in general some arbitrary product Is it possible to have such a definition? It would be nice if there was an argument to the built-in
Upon reading Sage's source code I noticed the 'eval_func' option when defining functions. So if I define (following a suggestion of mforets, thanks!): and define the ( everything works. For example So I consider this question closed! |

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.