ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 22 Oct 2020 04:11:30 +0200Is there any difference between the two different ways of declaring variables?https://ask.sagemath.org/question/54003/is-there-any-difference-between-the-two-different-ways-of-declaring-variables/ I sometimes see variables declared as `y,z,t = var("y z t")` and others simply as `var("y z t")`
Both seem to work. Is there any actual difference between them?cybervigilanteThu, 22 Oct 2020 04:11:30 +0200https://ask.sagemath.org/question/54003/Declaring variable to be in a particular field/ring/grouphttps://ask.sagemath.org/question/25037/declaring-variable-to-be-in-a-particular-fieldringgroup/Is it possible to have Sage symbolically simplify expressions involving variables subject to the assumption that the variables take values in a defined domain (field/ring/group/etc)?
The closest I've gotten is to declare a dummy polynomial ring over my domain of interest so that its variable has some notion of the domain, e.g.:
<pre>Z3=Integers(3)
Dummy.<x> = PolynomialRing(Z3)
3*x</pre>
evaluates to "0" as I'd expect, but sage fails to simplify "x^3" to "x", which ISTM should be doable if it really understood that x is a variable in Z/3Z.
Related things I've found in my searches that haven't panned out:<br/>
1. var('x', domain=*foo*) -- apparently *foo* can only be one of real/complex/positive (where I'd like to be able to say 'Z3' in the example above)<br/>
2. assume('x is Z3') - doesn't seem to have any effect.a1846583Fri, 28 Nov 2014 17:44:44 +0100https://ask.sagemath.org/question/25037/What are all the types we can declare in Cython?https://ask.sagemath.org/question/10304/what-are-all-the-types-we-can-declare-in-cython/Let me be more precise: I know we can declare "int", "list", "float", "double", but what else ?
Is it possible to declare a matrix ?
Is it possible to declare combined types, as list of list of integers...?
My goal is that the program doesn't lose time to find, for example, in which type are the elements of a list...
If it's to long to describe all such available types here, maybe you can indicate to me where I can find this information.Sébastien PalcouxTue, 02 Jul 2013 11:43:20 +0200https://ask.sagemath.org/question/10304/Symbolic variable declarationhttps://ask.sagemath.org/question/8251/symbolic-variable-declaration/what is the difference, when I declare variable like this
a, b, c = var('a, b, c')
or just like this
var('a, b, c')
?OndraSun, 31 Jul 2011 13:57:48 +0200https://ask.sagemath.org/question/8251/