[sage-devel] Re: Updating Sage documentation presentation

2019-06-20 Thread saad khalid
Thanks for posting it here! Just to include the few posts that were on the 
sage-support thread:

On Thursday, June 20, 2019 at 10:29:06 PM UTC-4, saad khalid wrote:
>
> I definitely see your point, it doesn't look fancy to me. But, I would 
> argue that Mathematica *does* have very "fancy" and accessible looking 
> documentation, and I think accessibility and polish are what new users may 
> base their choice on when deciding which CAS to use. 
>
> On Thursday, June 20, 2019 at 9:23:32 AM UTC-4, Kwankyu wrote:
>>
>>
>>
>> On Wednesday, June 19, 2019 at 9:31:05 PM UTC+9, saad khalid wrote:
>>>
>>> Hi all:
>>>
>>> The sage documentation hosted online (eg. 
>>> http://doc.sagemath.org/html/en/reference/index.html ) looks very old. 
>>> To me at least, it makes the software seem ancient, and I believe it puts 
>>> off younger new users. The Cocalc interface for Sage maintains a modern 
>>> looking aesthetic which makes it easy to show my peers (because it doesn't 
>>> look that intimidating). I wish the documentation was the same way. Has 
>>> there been any thought towards updating the look of the documentation? For 
>>> example, we could use readthedocs (I believe this is the simplest option). 
>>> Alternatively, we could use something like slate (
>>> https://github.com/lord/slate) or a variety of other options. My 
>>> question is, has this been considered and is there any obvious reasons to 
>>> *not 
>>> *do this? 
>>>
>>
>> I am curious if the Python documentation looks fancy to you?
>>
>> https://docs.python.org/3.6/ 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/ae0f57bb-ad89-4017-aabf-b5de08838a9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: talk

2018-09-04 Thread saad khalid
Hello:

The link seems to be broken, I was hoping to take a second look at some of 
the items on the wishlist. is there any way you could repost it? Thank you.

-Saad

On Tuesday, July 24, 2018 at 3:18:32 PM UTC-4, William wrote:
>
> Hi, 
>
> I just wrote a short talk that I'm about to give at ICMS 2018 about a 
> sort of Sage status report and wishlist: 
>
> https://goo.gl/qNycb3 
>
> -- 
> William (http://wstein.org) 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: talk

2018-07-29 Thread saad khalid
On the topic of error messages, I would like to add that this issue has 
almost singlehandedly prevented any of my mathematics and physics 
professors from using Sage or Cocalc in a classroom setting. This of course 
doesn't say anything about whether they would consider using it for their 
own research, and a few of them have certainly considered it and one 
actualy did use it fairly extensively. However, if we do value students 
using Sage, I think it would go a long way towards making it "classroom 
ready" if the error messages were at all sensible from a user perspective. 

On Tuesday, July 24, 2018 at 2:18:32 PM UTC-5, William wrote:
>
> Hi, 
>
> I just wrote a short talk that I'm about to give at ICMS 2018 about a 
> sort of Sage status report and wishlist: 
>
> https://goo.gl/qNycb3 
>
> -- 
> William (http://wstein.org) 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: How much do we support the casual user

2018-04-09 Thread saad khalid
Have we come to any conclusions on what steps should be taken after this 
topic? What seems to be the concensus? Or, at the very least, could someone 
give a listing of the options we have so that we can give it a poll or 
something similar?

On Monday, April 2, 2018 at 2:58:36 AM UTC-5, Sebastian Oehms wrote:
>
> Hello,
>
> This topic is a good example, that wrong names can be worse than wrong 
> code.
>
> Only the user knows what he has in mind using the adjective "prime":
>
> 1) prime in a "narrower sense": being a prime number
> 2) prime in a "broader sense":  being a prime element of a unital 
> commutative ring 
>
> Therefore, the user must have the possibility to solve this ambiguity.
>
> If we will do that by an optional argument (as suggested by Erik Bray), 
> then we have to fix a default! Taking the default to be 1) would prefer the 
> casual user and keep track with popular CAS. 
>
> WolframAlpha answers the question "is 3/1 prime?" in the sense of 1) with 
> "true". If you have 2) in mind this seems to be a bug. But to be fair: The 
> result "true" matches the explanation WolframAlpha gives for the adjective 
> "prime" (namely according to 1)). If you ask "is 3/1 a prime element?" then 
> it shows you the definition of "prime element" but does not calculate any 
> thing.
>
> Now, Sage can calculate this, and accordingly gives the answer in the 
> sense of 2) like mathematicians would expect. Does it so, always?
>
> sage: is_prime(I)
> ---
> TypeError Traceback (most recent call last
> )
> 
> TypeError: Unable to coerce I to an integer
>
>
> This looks as if even Sage is trying to give the answer according to 1), 
> as well!
>
> Nevertheless, taking 2) as default would raise less compatibility problems 
> (and seems to be the favorite in most of the contributions of this thread).
>
> But anyway, IMHO the best thing would be to follow the suggestion of Eric 
> Gourgoulhon, solving the ambiguity by separated function names. But if the 
> name "is_prime" should survive, you will have to make a "default"-decision, 
> as well.
>
>
> As a newcomer to sage-devel I cannot really say, how painful the most 
> transparent solution would be, but I think it should be taken into account, 
> too:
>
> Deprecation of "is_prime" as function (not as method!!! since there is no 
> ambiguity here) and replace it by two new functions "is_prime_number" and 
> "is_prime_element" (according to the corresponding Wikipedia articles). The 
> first function should try to coerce the input into ZZ and raise an error if 
> this it not possible or not positive. The second one should raise an error 
> if the input is not an element of a unital commutative ring and a warning 
> in the case the ring is a field (according to 
> https://trac.sagemath.org/ticket/25046). In cases as for the SymbolicRing 
> above a NotImplementedError should be raised.
>
> If you think deprecation of "is_prime()" would be to painful, then which 
> of both ("is_prime_number" or "is_prime_element") should keep the name 
> "is_prime"? I found contributions for both possibilities!
>
> Best,
> Sebastian
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: How much do we support the casual user

2018-03-29 Thread saad khalid
I'm not entirely sure how to implement this though, if we don't want it to 
be the global behavior. I was considering just implementing it for the 
rank() function, but I'm assuming it processes the input into the function 
before it starts running the actual function, right? So it isn't just 
behavior I could set within the rank function. Would it be possible or 
desirable to make it so that matrix by scalar multiplication converts the 
scalar to an element of QQ? Or perhaps rank treats the entries of the 
matrix as members of QQ? The latter sounds best to me.

Also, with regard to is_prime, would it be possible/easy change the default 
behavior of is_prime to try to convert the input to an integer if it is a 
member of QQ and raising an error if it is unable to convert the input to 
an integer, and give an option/keyword to not do this conversion? Perhaps 
if the conversion is succesful, a warning could be raised that the 
conversion was made, in case the user actually did want to check for 
primality over QQ. Though, Volker Braun's suggestion also sounds good, but 
I'm not sure how helpful it would be to a beginner if they don't know what 
a field is. I might suggest a warning which comes up if the user enters an 
element of QQ that is equivalent to an integer that tells them  to run 
ZZ(x).is_prime() instead of (x).is_prime, if they to check primality over 
the integers. However, I'm not sure how elegant this solution is. 

On Tuesday, March 27, 2018 at 2:07:41 AM UTC-5, Ralf Stephan wrote:
>
> Hello,
> I thought I'd try Sage for a casual computation. I was interested in which 
> numbers of the form (2^n - (-1)^n)/3 are prime. I first tried out n=23:
>
> sage: (2^23+1)/3
> 2796203
> sage: _.is_prime()
> False
> sage: factor(2796203)
> 2796203
>
> It turns out that Rational.is_prime does not exist and the fallback gives 
> false answers.
>
> Then, I tried to print a list of primes of the above form, using the 
> global is_prime:
>
> sage: for n in range(1,100):
> : if is_prime((2^n - (-1)^n)/3):
> : print((2^n - (-1)^n)/3)
> : 
> sage:
>
> No output. Turns out `is_prime(ZZ((2^n - (-1)^n)/3))` works. Really? How 
> long does Sage exist without a fix to that? This goes beyond "serious lack 
> of reviewers" and "dev shortage".
>
> There was always the notion that you shouldn't "team up" for ticket 
> review. I'm now breaking it. If YOU are interested in fixing the above or 
> similar problems please mail me. There are also about 25 calculus tickets 
> from me waiting for review. But probably noone is really interested in that 
> either. The algebraists can have their Sage back. Good job.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: How much do we support the casual user

2018-03-29 Thread saad khalid
On Wednesday, March 28, 2018 at 1:52:17 AM UTC-5, Simon King wrote:
>
> Hi Andrey and Saad, 
>
> On 2018-03-28, Andrey Novoseltsev <novo...@gmail.com > 
> wrote: 
> > On Tuesday, 27 March 2018 18:03:48 UTC-6, saad khalid wrote: 
> >> 
> >> Why not assume by default that when someone enters a floating point 
> >> number, they intend it as a member of QQ, at least in this case. 
> >> 
> > 
> > It may be an interesting option to have similar to "automatic_names". 
>
> +1 
>
> I certainly oppose for it being the default, as when I type in a float 
> I *want* a float (actually an element of RR). 
>
> Cheers, 
> Simon 
>
>
Yes, I definitely agree with that. Do others also feel this would be 
apropriate? How could we go about implementing this? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] How much do we support the casual user

2018-03-27 Thread saad khalid
On Tuesday, March 27, 2018 at 2:57:12 PM UTC-5, Michael Orlitzky wrote:The 
thread was about casual users, who shouldn't have to care about the 
implementation details behind what "0.5" means. To a casual user, 0.5 is 
one-half. I didn't bring this up to fight about by pet bug again, but 
because of the similarity between this and the fact that 12/4 is not 
three. Casual users don't want to hear about the coercion framework, 
categories, maps and what-not -- they just want to be able to put in 
trivial homework problems and get out the right answers. 

I definitely agree with Michael, and would go further and say that this 
doesn't just affect students who want to solve their homework problems, but 
also people who teach physics and even likely many people with an extensive 
knowledge of mathematics. I have used Mathematica Far more in my physics 
classes than I have in my mathematics classes, and my physics professors 
would definitely expect the rank of these two matrices to be the same, if 
they are indeed equivalent. Actually, so would all of my mathematics 
professors, I am fairly sure. In my opinion, the purpose of an ideal CAS is 
to do mathematics/computation, not get bogged down with the technical 
details. So even if, by the nature of floating point numbers, the ranks 
should be different, that is absolutely useless to most people. Most people 
are not interested in the intricacies of floating point numbers, the CAS 
should understand the users likely intention and leave these special case 
usages (such as having floating point numbers work non-associatively) as 
options (not the default). Why not assume by default that when someone 
enters a floating point number, they intend it as a member of QQ, at least 
in this case. 


Why not introducing a different function, is_prime_integer() say, keeping 
> is_prime() as it is now?
> Of course, x.is_prime_integer(), or is_prime_integer(x), would return 
> ZZ(x).is_prime().
> Then, for the casual user, we should advertise (in examples, tutorials, 
> etc.) the use of is_prime_integer() over is_prime().
> Note that the casual user may discover is_prime_integer() by the standard 
> TAB mechanism, since its name starts by "is_prime". Facing the choice 
> between the two functions, he would probably (hopefully?)  opt for 
> is_prime_integer(), which is self-explanatory.


I am actually not a fan of this solution, though I definitely appreciate 
the intention. For me, the goal should be that the easiest to use 
function(in the sense that it is the one the casual user will likely type) 
is the one that behaves like the average user would want. So, in this case, 
it Should assume that 3/1 is referring to the integer 3, use is_prime on 
the integer, and then also give a warning stating that 3/1 was interpreted 
as the integer 3. Then, we should have a function like is_prime_in_ring, 
which functions the way is_prime functions right now, ie it takes into 
account what the parent was instead of making the common simplification. 
The warning I mentioned earlier could even tell the use that if they want a 
ring dependent result, then they should use is_prime_in_ring. Again, the 
vast majority of users are assuming 3/1 = 3, and paying attention to the 
parent is a case of special usage. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: polymake interface merged in 8.0.beta1; needs users, developers for integrating polymake features

2017-04-09 Thread saad khalid
Hello! Thank you for your post! I was just a bit confused, in what ways can 
people help? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: integration algorithms

2017-03-19 Thread saad khalid
I think it's not a relevant question to ask "when we'd want student to pull 
out their smartphone to do integrals." The fact is that students already 
Can do this, whether or not this should be integrated into the curriculum 
has nothing to do with what functionality Sage offers. Also, I'm more 
concerned with desktop/laptop use. Both Sage and Mathematica/WolframAlpha 
currently give access to integration. WolframAlpha is easier to access by a 
bit, simply because of the search bar functionality. However, it is often 
useful to see the steps involved in solving an integral. Currently, Sage 
can't do this. WolframAlpha can, but you have to pay a fee to see it. For 
this reason, I think it would be useful for Sage to have this function. 
Many students can't afford to pay money, but I think it's a useful 
educational tool to be able to see how to solve integrals instead of simply 
being given the solution. Also, Sage often gives solutions that are not as 
simple as possible, in the sense that they look ugly often. I think this 
would help with that. If the main concern is that students don't need 
integration algorithms so advanced, well, I'm certain there are researchers 
that do. Clearly Mathematica thinks there are researches that need these 
algorithms, as they support much more integration than Sage does, which is 
good enough reason for me to support this for Sage. I don't understand why 
we would want to be mediocre, it makes sense to be cutting edge. And, as I 
said at the beginning of this message, there is ample reason for this 
integration method to be useful for students too, as it shows the steps to 
the solution (which is excellent for studying). 

It also seems that my statement about making money was misunderstood. I'm 
not saying that Sage should have capitalizing off its users as a priority. 
Obviously the motive for Sage is not profit. However, considering there are 
costs to upkeeping Sage and its servers, I think money is an important 
thing to keep in mind. In line with that thought, I think that being able 
to advertise that Sage can perform integration better than Mathematica, and 
that it is more helpful for students in calculus class since it shows the 
steps involved, is an excellent thing to be able to advertise. In general, 
it is important for Sage to be as widely used as possible, and I think the 
biggest place we could reach out to is the classroom. Isn't this the main 
issue Sage faces? It must deal with both the desire to stay up to date, 
usable, relavent for mathematicians, but it must also have enough paying 
users to making sustaining it possible. Clearly, not all the time and 
effort can be put in to the former, effort must be put in functionality and 
usability for students. Personally, I think the biggest thing to be done in 
this direction is to update the documentation. Maybe I'll try working on 
that a little this summer. However, I think that this integration method is 
good as it provides cleaner output and it gives steps to the solution and 
it is easy to advertise. The fact that it also performs far more integrals 
than we currently can is also a great bonus. 

As far as I can tell, real progress in converting Rubi to python will be 
possible once it is converted to using binary search instead of pattern 
matching, right? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: integration algorithms

2017-03-01 Thread saad khalid
I think Sage's integration can't compare to Mathematica's. The output is 
not as clean and it doesn't solve as many integrals and it is not as fast. 
Sage is used by many students, and in my opinion, its profitability and 
sustainability in the future depends on classroom use, to a large extent. 
For that reason alone, I think it is worthwhile to make integration cleaner 
and better, as that is what the majority of students do. I'm not sure what 
the  qualm against adding thousands of rules is. If it's more efficient and 
effective, why does it matter if its similar to a student who simply 
"memorizes the formulas." Also, saying that we can integrate better than 
mathematica is definitely a solid advertising point. 

My main question is why this is so difficult to implement. Is the 
difficulty in implementing the "if-then-else"/binary-search-tree method? Or 
is it with converting the mathematica code to python? I have a hard time 
believing it's the latter. It's just that several people have said now that 
implementing Rubi is unfeasible, and I don't totally understand why. Could 
someone clarify this for me?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Implementation of Gamma in Sage

2016-12-24 Thread saad khalid
You're certainly right. It was faster than mathematica implementation of 
q-digamma, so I assumed that it would be faster than any implementation 
that is open source. I will do some definitive testing of that soon. I 
would like to add a basic implementation of these functions first at least. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Implementation of Gamma in Sage

2016-12-24 Thread saad khalid
A few issues I am running into at the moment. 


First, most of the functions in the other.py and special.py folder include 
code for their derivatives. However, I honestly have no idea about the 
derivative of the qgamma function, and I could not find any literature 
about it. Is it possible to have the function without defining its 
derivative? 

Also, what exactly is the difference between eval and evalf? Is eval for 
symbolic computation while evalf is for numeric or something? Or is eval 
simply tried before evalf is? 


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Implementation of Gamma in Sage

2016-12-19 Thread saad khalid
Hello everyone!

I'm interested in contributing/working on Sage a bit. Specifically, one of 
my Professor's came up with a faster way to compute q-digamma, at least in 
some cases. I would like to code it up and add it to Sage. A few things are 
in my way at the moment, that I wanted to ask about:

1. It appears we don't have a native q-gamma or q-digamma function. We do 
have access to q-gamma from mpmath. However, a wrapper function in Sage 
hasn't been added yet:
https://trac.sagemath.org/ticket/19032

Would adding this be a simple as importing qgamma from mpmath? My worry in 
implementing it that way is about efficiency. If a user uses calls qgamma 
many times, then it would be doing "from mpmath import qgamma" many times, 
which seems pretty inefficient. Is there a more efficient way of doing 
this? So that it wouldn't keep importing it over and over, or maybe some 
way I could make it so that I don't have to important anything at all. I 
only ask if the latter is possible because when I was looking at the source 
code for the gamma function in sage (I believe it uses GiNaC?), I don't see 
it say "import gamma" anywhere. Does it not have to do that because GiNaC 
isn't in python? Also, is there a reason we don't use mpmath for the gamma 
function? 


2. Going off of what I was talking about in question 1, how can I see the 
implementation of the gamma function? I'm looking at the source in 
sage/functions/other.py:
https://github.com/sagemath/sage/blob/master/src/sage/functions/other.py

but I can't see the code for the actual function. I just see that it calls 
something called gamma1, apparently. What is gamma1 here and where can I 
see the code for the actual function? It mentions that Gamma uses various 
libraries in sage, but it looks like it just uses gamma1(from ginac?) and 
gamma_inc. Is this correct?


3. The formula for q-digamma is for q = 1. Since we don't have an 
implementation of q-digamma as far as i can tell, I was thinking I would 
try to find a library with an implementation of it, import that, and then 
add the q = 1 case implementation as an if statement? And if I can't find a 
library with it, would it work okay to simply write the formula for it 
directly there? Or would that be slow because it's in python? I was 
thinking that since the code gets cythonized, the fact that I'd be writing 
it in python wouldn't be cause it to be slow. 


Sorry, these questions are fairly vague, and I'm not entirely sure whether 
this belonged in devel or support. However, I'd appreciate any advice/info 
you have! 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: VotePlugin for trac?

2016-07-06 Thread saad khalid
I've always wondered why we didn't use GH. 

Also, I would definitely support some sort of voting on feature/improvement 
option. I'm not sure if trac is the best place to put it, but I think one 
of the best things we can do is make it easy for people to report and vote 
on what features Sage and SMC needs. I often hear the excuse from my 
professors that Sage is "not as good" as mathematica, though they are 
rarely able to give specifics. I don't want them to have that cop out 
anymore; if there's something lacking form Sage, I think it should be very 
easy to know about it. If often wish there were a list of features that 
people wanted that we don't have, just so I could look at it and see if 
there's anything I could contribute to. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-04 Thread saad khalid
Sorry about that, I thought sage-devel was for talking/asking questions 
related to doing development on Sage. Since I was editting the source, I 
assumed it would be okay to post it here, but if it's not, I'll definitely 
remember that in the future. 
I created a trac for review:
https://trac.sagemath.org/ticket/20936#comment:1

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-04 Thread saad khalid
Thanks! That makes much more sense and seems simpler, I'm glad I know that 
now!

Side note:  Never use += on a string in a loop.  Here it's even worse, 
> since you are concatenating strings on the right hand side as well. 
>
>
Is it because it's slow? 

Also, do you think I should have the to_sage function automatically convert 
it to a symbolic function or fracfield, or should I just leave it as 
outputting the string version? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
So, after fixing a small typo, here is the output from an example:

sage: macaulay2.eval("""
: K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
: A=matrix{{zet^1,0},{0,zet^14}}
: needsPackage "InvariantRing"
: G=generateGroup({A},K)
: P = molienSeries G
:  """)

sage: macaulay2('P').to_sage()


'(1-T+T**2-T**3+T**4-T**5+T**6-T**7+T**8-T**9+T**10-T**11+T**12-T**13+T**14)/((1-T)^2*(1-T+T^3-T^4+T^5-T^7+T^8)^1*(1+T+T^2)^1*(1+T+T^2+T^3+T^4)^1)'


That's the output from the last command, anyways. Now, what I don't 
understand is how to make it into like... a function, or a Sage object or 
something like that. Like, I'd want to be able to compute its Taylor series 
just by doing something like "macaulay2('P').to_sage().taylor()" or 
something, but I'm not sure how to convert the string. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
So, after fixing a small typo, here is the output from an example:

sage: macaulay2.eval("""
: K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
: A=matrix{{zet^1,0},{0,zet^14}}
: needsPackage "InvariantRing"
: G=generateGroup({A},K)
: P = molienSeries G
:  """)
sage: macaulay2('P').to_sage()


'(1-T+T**2-T**3+T**4-T**5+T**6-T**7+T**8-T**9+T**10-T**11+T**12-T**13+T**14)/((1-T)^2*(1-T+T^3-T^4+T^5-T^7+T^8)^1*(1+T+T^2)^1*(1+T+T^2+T^3+T^4)^1)'


That's the output from the last command, anyways. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
Sorry! I hadn't seen that, that's great, thank you! The denominator is 
proving to be a bit tricky to deal with, mostly because I can't decide what 
I want to do with it. I did it though, but I'm not happy with it. I'm also 
an amatuer at regex(this is the first time I've used it, I figured it was 
about time I started learning now). But, I Think it should work? So, I made 
another method named sage_prodstring that does a similar job to 
sage_polystring. Here is the code for it:

def sage_prodstring(self):
"""
If this Macaulay2 element is a Product, return a string
representation of this Product that is suitable for
evaluation in Python. Needed internally for using to_sage on 
objects of class Divide. 

EXAMPLES::


"""
external_string = self.external_String()
prod_String = re.findall("new Power from \{(.+?),(.+?)\}", 
external_string)
final_Prod = ""
for i in range(0, len(prod_String)):
final_Prod += "(" + prod_String[i][0] + ")" + '^' + prod_String[i][1
] + "*"
final_Prod = final_Prod[:-1]
return final_Prod

I don't really know what to put in the Examples part. If you have any 
recommendations, I'd love to know. Also, I feel like this implementation is 
inneficient, since it first runs external_string, which is a Sage method 
that parses Macaulay's ascii art into a str, and then my method parses that 
str into something that you could actually use as python code. I feel like, 
ideally, I wouldn't need to run external_string, and could directly convert 
the ascii output from macaulay directly into the python code output I 
wanted, but i couldn't figure out exactly how to do that... I hope this is 
okay. I don't think i can test it yet until I fill in the spot for the 
Example though. 

I then used this method in the to_sage() function for the denominator, as 
seen here:

elif cls_str == "Divide":
div_Numerator = self.numerator()
div_Denominator = self.denominator()
div_Numerator = div_Numerator.sage_polystring()
div_Denominator = div_Denominator.sage_prodstring()
sage_Div = "(" +  div_Numerator ")" + "/" + "(" + 
div_Denominator + ")"
return sage_Div

How does it look? Thanks for all the help thus far.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-03 Thread saad khalid
Hmm, so I tried this instead but it also didn't work and gave a similar 
error:

elif cls_str == "Divide":
div_Str = repr_str
div_Numerator = macaulay2('numerator div_Str')
div_Denominator = macaulay2('denominator div_Str')
div_Numerator = div_Numerator.sage_polystring()
div_Denominator = div_Denominator.sage_polystring()
sage_Div = div_Numerator/div_Denominator
return sage_Div


I guess I don't understand what each of those variables contains... What is 
self in this situation? I thought that self would be the Divide object, 
since that is what's being passed to the to_sage function. But when that 
didn't work, i assumed that repr_str would contain the string of the Divide 
object, but that's also not working.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-02 Thread saad khalid
Well, here's what i tried and it doesn't seem to work after I build sage 
again. I added this code to the to_sage() function, 
elif cls_str == "Divide":
self_Div = self
div_Numerator = macaulay2('numerator self_Div')
div_Denominator = macaulay2('denominator self_Div')
div_Numerator = div_Numerator.sage_polystring()
div_Denominator = div_Denominator.sage_polystring()
sage_Div = div_Numerator/div_Denominator
return sage_Div

 
I added this after the main else statement. The code looks like rubbish to 
me but I didn't know what else to do, so i thought I'd show something and 
ask for improvements, if that's okay... When running the following code now 
in Sage, here is my error message:

sage: macaulay2.eval("""
: K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
: A=matrix{{zet^1,0},{0,zet^14}}
: needsPackage "InvariantRing"
: G=generateGroup({A},K)
: P = molienSeries G
:  """)
K

PolynomialRing

| zet 0|
| 0   -zet^7+zet^6-zet^4+zet^3-zet^2+1 |

2   2
Matrix K  <--- K

InvariantRing

Package

{| 1 0 |, | -zet^7-zet^2 0 |, | zet^7 0 |, | 
zet^7-zet^6-zet^3+zet^2-1 0 |, | -zet^7+zet^6-zet^4+zet^3-zet^2+1 0   |, 
| zet 0|, | -zet^6-zet 0 |, | zet^5 0   
 |, | zet^2 0|, | zet^6 0   
  |, | zet^7-zet^5+zet^4-zet^3+zet-1 0 |, | zet^4 0  |, | -zet^7
+zet^5-zet^4-zet+1 0 |, | zet^3 0|, | -zet^5-1 0 |}
 | 0 1 |  | 0zet^3 |  | 0 zet^7-zet^5+zet^4-zet^3+zet-1 |  | 
0 zet^6 |  | 0zet | 
 | 0   -zet^7+zet^6-zet^4+zet^3-zet^2+1 |  | 0  zet^4 |  | 0 -
zet^5-1 |  | 0 -zet^7+zet^5-zet^4-zet+1 |  | 0 zet^7-zet^6-zet^3+zet
^2-1 |  | 0 zet^7 |  | 0 -zet^6-zet |  | 0 
   zet^2 |  | 0 -zet^7-zet^2 |  | 0zet^5 |

List

 234567891011121314
1 - T + T  - T  + T  - T  + T  - T  + T  - T  + T   - T   + T   - T   + T
---
2  34578   2   234
 (1 - T) (1 - T + T  - T  + T  - T  + T )(1 + T + T )(1 + T + T  + T  + T )

Expression of class Divide

sage: G = macaulay2('P').to_sage()
---
TypeError Traceback (most recent call last)
/home/saad/sage/local/lib/python2.7/site-packages/sage/all_cmdline.pyc in 
()
> 1 G = macaulay2('P').to_sage()

/home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/macaulay2.pyc 
in to_sage(self)
   1151 elif cls_str == "Divide":
   1152 self_Div = self
-> 1153 div_Numerator = macaulay2('numerator self_Div')
   1154 div_Denominator = macaulay2('denominator self_Div')
   1155 div_Numerator = div_Numerator.sage_polystring()

/home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc 
in __call__(self, x, name)
241 
242 if isinstance(x, six.string_types):
--> 243 return cls(self, x, name=name)
244 try:
245 return self._coerce_from_special_method(x)

/home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in __init__(self, parent, value, is_name, name)
   1379 except (RuntimeError, ValueError) as x:
   1380 self._session_number = -1
-> 1381 raise_(TypeError, x, sys.exc_info()[2])
   1382 except BaseException:
   1383 self._session_number = -1

/home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc 
in __init__(self, parent, value, is_name, name)
   1374 else:
   1375 try:
-> 1376 self._name = parent._create(value, name=name)
   1377 # Convert ValueError and RuntimeError to TypeError for
   1378 # coercion to work properly.

/home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc 
in _create(self, value, name)
431 def _create(self, value, name=None):
432 name = self._next_var_name() if name is None else name
--> 433 self.set(name, value)
434 return name
435 

/home/saad/sage/local/lib/python2.7/site-packages/sage/interfaces/macaulay2.pyc 
in set(self, var, value)
318 ans = Expect.eval(self, cmd)
319 if ans.find("stdio:") != -1:
--> 320 raise RuntimeError("Error evaluating Macaulay2 
code.\nIN:%s\nOUT:%s"%(cmd, ans))
321 
322 def _object_class(self):

TypeError: Error 

[sage-devel] Can't figure out how polynomial conversion works in the M2/Sage interface

2016-07-02 Thread saad khalid
Hey everyone:

I was hoping some of you could provide some insight where my knowledge is 
lacking. I'm trying to add to the M2/Sage interface by adding a conversion 
for the M2 Divide class. Sage can already convert polynomials, so my hope 
was to just have it treat the Divide class as two polynomials, one in the 
numerator and the other in the denominator. Here is an example of an object 
in the divide class:
macaulay2.eval("""
K = toField(QQ[zet]/(zet^8 - zet^7 +zet^5 - zet^4 +zet^3 -zet + 1))
A=matrix{{zet^1,0},{0,zet^13}}
needsPackage "InvariantRing"
G=generateGroup({A},K)
P = molienSeries G
 """)

P is a "Divide" object. Here is an example of Sage converting a polynomial 
from M2 to Sage:
macaulay2.eval(""" 
needsPackage "Points"; 
M = matrix{{1,2,3},{4,5,6}}
R = QQ[x,y,MonomialOrder=>Lex]; 
(Q,inG,G) = points(M,R) 
G#0
ring G#0
""") 
G0 = macaulay2('G#0').to_sage(); G0

G in M2 is a list of polynomials, and G#0 is the first one. Here's what it 
looks like:

 3  2
y  - 15y  + 74y - 120

I convert this to a sage object, G0, and it appears as:

y^3 - 15*y^2 + 74*y - 120

The part that I really need is where Sage changes M2's two-line display for 
exponents on variables to just the standard Sage notation. I'm looking at the 
to_sage()
method in the source code but I can't seem to figure out how it's doing it. Am 
I missing something obvious? G#0 is a polynomial ring I believe, and here 
is the code in the to_sage function for PolynomialRings:
elif cls_str == "PolynomialRing":
from sage.rings.all import PolynomialRing
from sage.rings.polynomial.term_order import 
inv_macaulay2_name_mapping

#Get the base ring
base_ring = self.coefficientRing().to_sage()

#Get a string list of generators
gens = str(self.gens())[1:-1]

# Check that we are dealing with default degrees, i.e. 1's.
if self.degrees().any("x -> x != {1}").to_sage():
raise ValueError("cannot convert Macaulay2 polynomial ring 
with non-default degrees to Sage")
#Handle the term order
external_string = self.external_string()
order = None
if "MonomialOrder" not in external_string:
order = "degrevlex"
else:
for order_name in inv_macaulay2_name_mapping:
if order_name in external_string:
order = inv_macaulay2_name_mapping[order_name]
if len(gens) > 1 and order is None:
raise ValueError("cannot convert Macaulay2's term order to 
a Sage term order")

return PolynomialRing(base_ring, order=order, names=gens)


Where in this code does that conversion happen? It's like parsing ascii 
art...

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: wiki.sagemath.org

2016-06-26 Thread saad khalid
At the top of the page it says 
"*No jsMath TeX fonts found* -- using image fonts instead.
These may be slow and might not print well.
Use the jsMath control panel to get additional information."

I wasn't sure if this was just my browser(I'm running firefox) or if it was 
supposed to be like that right now. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: [gdr-im] Announcing Sollya 5.0

2016-06-16 Thread saad khalid
I don't know much about this so I thought I would just ask, how would using 
this benefit Sage? Is it comparable to mpmath and MPFR? If so, how does it 
compare? Sorry for my ignorance. Also, what is the target? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: limit bug that I'm really sure used to work correctly

2016-06-10 Thread saad khalid
On page 3 at the top, is that a typo with how (9)(1/2) is formatted? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: limit bug that I'm really sure used to work correctly

2016-06-10 Thread saad khalid
Will there be a trac made about this? 

On Tuesday, June 7, 2016 at 3:36:50 PM UTC-5, john_perry_usm wrote:
>
> This surprised me today:
>
> > limit(1/x, x=0)
> Infinity
>
> I was expecting something more like this:
>
> > limit(x/abs(x), x=0)
> und
>
> The help on Infinity wasn't illuminating:
>
> > Infinity?
> Type:  PlusInfinity
> String form:   +Infinity
>
> ...and so forth. This implies to me that Infinity and +Infinity are the 
> same, but Sage seems to give a different result for the one-sided limit:
>
> > limit(1/x, x=0, dir='right')
> +Infinity
>
> Why am I getting a different answer this time? I'll grant that Sage 
> eventually simplifies them to the same:
>
> > (limit(1/x, x=0, dir='right') == limit(1/x, x=0)).full_simplify()
> 1
> > (limit(1/x, x=0, dir='left') == limit(1/x, x=0)).full_simplify()
> 0
>
> ...but they print differently for some reason, and in any case I don't see 
> why Sage would report a limit when the two one-sided limits disagree. The 
> documentation on limit didn't help, either.
>
> Is this a bug, or do I misunderstand something?
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Python3

2016-05-21 Thread saad khalid
What exactly are the benefits of using Python3? I thought that it tended to 
be a bit slower for computation, since it uses infinite precision numbers 
instead of ints. Not that I'm against it, I just didn't know the 
motivation. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Bugs silently producing wrong answers

2016-05-20 Thread saad khalid
I was on trac, looking at the tickets under "Bugs silently producing wrong 
answers". All of them seemed quite old, for the most part, and none of 
them(that I could find) had anything under Branch. Does this mean that they 
have been dealt with? What exactly is the situation with all of those 
tickets? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Error Building Sage

2016-05-17 Thread saad khalid
So, I ran 'make distclean', and then I made sure that my develop branch was 
up to date, and then I did make build and it ran properly and I was able to 
do the doctest I had been trying to do before! Should I still run 'make'? 
I'm kind of afraid that it will mess up again, it takes like 8-12 hours 
total to run 'make distclean' and 'make build' if it messes up again... 
However, I do want to know why it wasn't working. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Error Building Sage

2016-05-15 Thread saad khalid
Hey everyone:

So, here's the issue. I was facing this same issue before, so I decided to 
delete my git folder in home and then install it again. So, I ran 

git clone git://github.com/sagemath/sage.git

and it remade the sage directory. Then, I did "cd sage", and ran "git checkout 
develop". After this, I checked and I was on the develop branch. This should 
have been a fresh copy, straight from 
the Sage mirror. 
However, when I ran make, I got the following error: 
Error building the documentation.
Traceback (most recent call last):
  File "/home/saad/sage/local/lib/python/runpy.py", line 162, in 
_run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/home/saad/sage/local/lib/python/runpy.py", line 72, in _run_code
exec code in run_globals
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__main__.py",
 line 2, in 
main()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__init__.py",
 line 1629, in main
builder()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__init__.py",
 line 284, in _wrapper
getattr(get_builder(document), 'inventory')(*args, **kwds)
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage_setup/docbuild/__init__.py",
 line 495, in _wrapper
x.get(9)
  File "/home/saad/sage/local/lib/python/multiprocessing/pool.py", line 567, in 
get
raise self._value
OSError: [plot3d   ] 
/home/saad/sage/local/lib/python2.7/site-packages/sage/plot/plot3d/platonic.py:docstring
 of sage.plot.plot3d.platonic:10: WARNING: Exception occurred in plotting 
platonic-1

make[2]: *** [doc-html] Error 1
make[2]: Leaving directory `/home/saad/sage/build/make'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/saad/sage/build/make'

real193m34.862s
user182m33.248s
sys 4m55.540s
***
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all'):

* documentation: dochtml
  log file: /home/saad/sage/logs/pkgs/../dochtml.log

The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.

make: *** [all] Error 1


I'm not exactly sure what to do here. Now, when I try running a doctest like 
the following:
./sage -t /src/sage/interface/maxima_lib.py

I get the following error:
no stored timings available
Running doctests with ID 2016-05-15-10-38-26-bc8799da.
Git branch: develop
Using --optional=mpir,python2,sage
Doctesting 1 file.
Traceback (most recent call last):
  File "/home/saad/sage/src/bin/sage-runtests", line 89, in 
err = DC.run()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/control.py", 
line 1044, in run
self.run_doctests()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/control.py", 
line 761, in run_doctests
self.dispatcher = DocTestDispatcher(self)
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", 
line 1376, in __init__
init_sage()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", 
line 125, in init_sage
from sympy.printing.pretty.stringpict import stringPict
ImportError: No module named sympy.printing.pretty.stringpict


Now, I got this error in the last thread as well(see here 
https://groups.google.com/forum/#!topic/sage-devel/ayb4qJ6_sM4 ) and when I 
tried the suggestion of reinstalling sympy within the
 sage directory, it gave me  errors with mpmath, the same ones that are in 
these tickets(and were obviously fixed a while ago)

http://trac.sagemath.org/ticket/16624
https://github.com/sympy/sympy/issues/8022

I'm certain I'm running the most recent version of Sage. When I run it, it says 
that I'm running 7.2.rc2. Obviously, something is happening incorrectly with my 
install of sympy(it's not automatically
 installed in my sage directory, and simply installing the .7.6.1 copy from 
sympy just gives me the mpmath based errors). What exactly is 
happening? 
To do a full reinstall from scratch, do I need to do more than delete the sage 
directory? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-15 Thread saad khalid
Thanks for all the help so far guys. This issue is persisting, so I think 
I'm going to make a separate topic about this(it doesn't seem to have 
anything to do with the OP). Thank you!


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-14 Thread saad khalid
Thanks guys! Another issue has popped up since I installed sympy, it is 
exactly what is described in these two posts:

http://trac.sagemath.org/ticket/16624
https://github.com/sympy/sympy/issues/8022

I think the issue is that the version of sympy I've installed is using 
mpmath code in a way that isn't fully compatible with sage. Note, I 
installed Sympy 0.7.6.1. I'm not entirely sure why my install of Sage 
didn't come with sympy to begin with. The trac link says that it is fixed, 
however I'm not sure what exactly they did to fix it that I could 
reproduce. Should I delete my current sage directory and reinstall it from 
source? Or would that not do anything? Sorry for the hassle..

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-13 Thread saad khalid
Another note, this is happening on my master branch as well, which is just 
an uneditted version of sage 7.1. I try running the command:
./sage-t src/sage/interfaces/maxima_lib.py

and it tells me this:


saad@saad-ThinkPad-X201:~/sage$ ./sage -t src/sage/interfaces/maxima_lib.py
no stored timings available
Running doctests with ID 2016-05-13-18-07-30-d52339e0.
Git branch: master
Using --optional=mpir,python2,sage
Doctesting 1 file.
Traceback (most recent call last):
  File "/home/saad/sage/src/bin/sage-runtests", line 88, in 
err = DC.run()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/control.py", 
line 1044, in run
self.run_doctests()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/control.py", 
line 761, in run_doctests
self.dispatcher = DocTestDispatcher(self)
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", 
line 1376, in __init__
init_sage()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", 
line 125, in init_sage
from sympy.printing.pretty.stringpict import stringPict
ImportError: No module named sympy.printing.pretty.stringpict



-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-13 Thread saad khalid
I believe that I pushed my branch to the trac server on here?
http://trac.sagemath.org/ticket/20595#comment:3

Or is that not the same as pushing my branch? Regardless, I've also put it 
here under the develop branch(which I believe is the same as the branch 
trac made for the ticket):
https://github.com/Babyll/sage/tree/develop
Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-13 Thread saad khalid
I believe that I pushed my branch to the trac server on here?
http://trac.sagemath.org/ticket/20595#comment:3

Or is that not the same as pushing my branch? Regardless, I've also put it 
here under the develop branch:
https://github.com/Babyll/sage/tree/develop
Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-13 Thread saad khalid
Ohhh, I see. Thanks! Unfortunately, I'm still unable to run the doctests on 
the file. I'm getting the same error as I mentioned above, and the error 
doesn't seem to have anything to do with the file itself. Am I inputting 
the command incorrectly? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-13 Thread saad khalid
When I try running the doctest, here is the error I am getting:

saad@saad-ThinkPad-X201:~/sage$ ./sage -t src/sage/interfaces/maxima_lib.py
no stored timings available
Running doctests with ID 2016-05-13-11-54-59-7d842524.
Git branch: t/20595/setting_besselexpand_to_true_globally
Using --optional=mpir,python2,sage
Doctesting 1 file.
Traceback (most recent call last):
  File "/home/saad/sage/src/bin/sage-runtests", line 89, in 
err = DC.run()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/control.py", 
line 1044, in run
self.run_doctests()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/control.py", 
line 761, in run_doctests
self.dispatcher = DocTestDispatcher(self)
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", 
line 1376, in __init__
init_sage()
  File 
"/home/saad/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", 
line 125, in init_sage
from sympy.printing.pretty.stringpict import stringPict
ImportError: No module named sympy.printing.pretty.stringpict


What exactly is the issue here? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-13 Thread saad khalid
Thanks for the help everyone. I've got it submitted here, hopefully I 
followed the procedure properly

http://trac.sagemath.org/ticket/20595#comment:3

Also, sorry for this basic question but, when documenting a function, what 
is the purpose of starting it with r""" ? Is this some python convention 
I'm unaware of? What does it signify exactly? 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-13 Thread saad khalid
Thanks for the help everyone. I've got it submitted here, hopefully I 
followed the procedure properly

http://trac.sagemath.org/ticket/20595#comment:3

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Some quick git tips

2016-05-11 Thread saad khalid
Hey guys:

I was wondering... So, I have my local install of Sage 7.1 from source. I 
didn't get the source using git, I downloaded it from the website. I've 
made a local repository for Sage on my computer, and also made a remote 
repository for it on my github. However, I don't think it is connected 
through git to the original sage repository on github. Do I need to connect 
it somehow to the git repository for Sage? Also, what do I do when release 
7.2 comes out? Do I just cd to my current local sage repository, and the 
pull from the original sage repository? What would happen to the changes 
I've made on mine that are not(yet?) in main Sage source code online? Sorry 
for the confusion, i'm a bit new to git. Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-09 Thread saad khalid
So, I've set the besselexpand option to true in the init_code of 
maxima_lib. I was thinking, however, that it would be a good idea to have 
an easy way to turn besselexpand off, so that those who Want the bessel 
version of the output can easily get it. This is where I'm running into 
some issues, I'm not really sure what the best course of action would be. 
First, I was thinking that I could try to edit the code for sum in 
calculus.py and maxima_lib.py. I was thinking that, if I added another 
input variable to symbolic_sum in calculus.py, something like 
besselexpand='true'. So, the function would look like 
symbolic_sum(expression, v, a, b, algorithm='maxima',besselexpand='true')

Then, the value for besselexpand could be fed into the call to 
maxima.sr_sum, and the code could be edited there to let it change the 
init.code to set besselexpand to false. Ideally, I could add code to 
symbolic_sum in calculus.py that lets me change the init.code from there, 
but I don't think that's possible(or rather, I don't know of how to do 
that). Even with this, however, I can't figure out how to let the function 
sr_sum change the init.code to set besselexpand to false from within the 
function. 

Another issue is whether this would even be useful at all, to add this 
option within sum. I'm assuming there are other situations in which the 
bessel function appears as output apart from just the sum function? If 
that's the case, then what I really need is a easy global way to change the 
setting on besselexpand, and then a good place to document it. I'm new to 
this, so I would really appreciate everyones thoughts. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Finding the right place to edit code

2016-05-09 Thread saad khalid
Thank you for your response! Sorry for replying so late, but I was 
wondering, what benefit would there be in leaving the bessel function in 
that form rather than simplifying it? Assuming that setting besselexpand to 
true(thus simplifying it when it can from bessel to trig functions) doesn't 
cause any errors, what reason would there be in leaving it in bessel form 
by default rather than simplifying it by default? 

On Saturday, April 30, 2016 at 3:55:10 PM UTC-5, Nils Bruin wrote:
>
> On Saturday, April 30, 2016 at 11:16:21 AM UTC-7, saad khalid wrote:
>>
>>
>> Specifically, I wanted to try and find where the besselexpand option was 
>> in the source code, so that I could make it default to true globally, 
>> instead of false. However, I have no idea where to look to find where this 
>> option is defined in the source files. If I want to find an option that's 
>> built into sage, it's very easy to type "the_command"?? and have it give me 
>> the source code. However, I haven't had similar luck when trying to edit 
>> global variables or things that are imported from Sympy or Maxima. Is there 
>> an easy way to edit code from them as well? And, my main issue, that file 
>> should I be looking at in order to change the besselexpand option? Thanks 
>> for your patience
>>
>> It can sometimes be a little bit of a goose chase to find which code 
> actually gets executed. In this case, you can trace that "sum" would call 
> the "sum" method on a symbolic expression, and looking at the SR('x').sum 
> implementation you can see that sage.calculus.calculus.symbolic_sum gets 
> called, which leads to sage.interfaces.maxima_lib.
>
> The right place to set the besselexpand option would be in the `init_code` 
> variable there.
>
> I don't know a better way to find these things other than to read code. 
> Note that we're not setting the besselexpand option at all at the moment; 
> we're just going with the default. So searching for it in the source 
> doesn't get you anywhere. (you'd get hits in the maxima source of course, 
> but that's not where you want to change anything for this)
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] FGb - Gröbner basis computation code

2016-05-03 Thread saad khalid
I was actually thinking about trying to do this(to include it in Sage such that 
you could choose between the normal algorhythm and using Fougeres). However, i 
was having trouble even getting the C interface to worl on my computer on its 
own. Hopefully thats something i can look at next week. However, if anyone else 
has had some succeas with the C interface, id love to know how! I kept getting 
an Illegal Instruction error when i tried running the compiled code, and i 
hadnt had a chance to debug. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Finding the right place to edit code

2016-04-30 Thread saad khalid
Hey everyone:

I'm new to developing(I've been programming for a while, but never on an 
open source project). 

I remembered this thread from a while ago:
https://groups.google.com/forum/#!topic/sage-support/PPsHBx6Z6Fc

And I wanted to try and make some of the edits proposed in there on my copy 
of sage. Specifically, I wanted to try and find where the besselexpand 
option was in the source code, so that I could make it default to true 
globally, instead of false. However, I have no idea where to look to find 
where this option is defined in the source files. If I want to find an 
option that's built into sage, it's very easy to type "the_command"?? and 
have it give me the source code. However, I haven't had similar luck when 
trying to edit global variables or things that are imported from Sympy or 
Maxima. Is there an easy way to edit code from them as well? And, my main 
issue, that file should I be looking at in order to change the besselexpand 
option? Thanks for your patience


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.