Re: [sage-support] Tasks and xrefs

2021-01-11 Thread Tom Judson
Whoops!  Wrong group.  Sorry about that.

On Monday, January 11, 2021 at 2:01:56 AM UTC-6 dim...@gmail.com wrote:

> I am not sure whether this is the place you wanted to post this - the 
> context is missing (versions of what exactly are you talking about?).
>
>
> On Sun, Jan 10, 2021 at 11:19 PM Thomas Judson  wrote:
>
>> The following code is okay in the HTML version, but there is an error in 
>> the LaTeX version.
>>
>> 
>> 
>> Show that
>> \frac{dI}{dS} = -1 + \frac{1}{R_0S}.
>> Two features of this new equation are particularly worth noting.
>> 
>> The only parameter that appears is R_0, the reproduction 
>> number.
>>
>> The equation is independent of time. That is, what we learn about 
>> the relationship between S and I must be true for the entire 
>> duration of the pandemic.
>>
>> 
>> Compute d^2I/dS^2. Determine when the number of infected will 
>> begin to decrease. Compare this to your result from > ref="systems05-task-I-increasing" />.
>> 
>> 
>> Use the chain rule.
>> 
>> 
>>
>>
>>
>> I’m not sure what’s going on.
>>
>> Tom
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-support...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/892012E3-9EF3-427A-9C02-8D84080D0751%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/sage-support/892012E3-9EF3-427A-9C02-8D84080D0751%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/99b33de3-871b-4e2e-937f-4f22e40a9727n%40googlegroups.com.


Re: [sage-support] Apple M1 Chip

2020-12-17 Thread Tom Judson
Homebrew is a quick and easy install under Rosetta (the Intel emulator). 
 Python 3.8 is there, and I finally got Jupyter Notebook installed. 
 However, when JN opens I have a problem.  I gave up last night but may try 
to work on it later today. - Tom

On Wednesday, December 16, 2020 at 12:34:10 PM UTC-7 kcrisman wrote:

> On Wednesday, December 16, 2020 at 10:46:47 AM UTC-5 dim...@gmail.com 
> wrote:
>
>> On Wed, Dec 16, 2020 at 3:19 PM Thomas Judson  wrote: 
>> > 
>> > I have a new MacBook Air with an Apple M1 chip. Does the Intel version 
>> of Sage 9.2 work on this machine? 
>>
>> 9.2 is not known to work on macOS 11 (the one you have on M1), as far as 
>> I know. 
>> You might try building the latest beta in Homebrew installed into the 
>> Intel emulator. 
>> We are very curious to know how far one can go this way. 
>>
>>
> Tom, anything you can do along these lines will be fantastic - I am slated 
> to get one of those soon too, and we'll need lots of guinea pigs to help. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/569acf3a-746a-48be-8b60-e8635f03274bn%40googlegroups.com.


[sage-support] Offline help with Sage 9.0 from jupyter notebook did not work

2020-01-04 Thread Tom Flyer
 

First thank you for these outstanding software. I just install download 
*sage-9.0-Ubuntu_18.04-x86_64.tar.bz2 
<http://mirrors.mit.edu/sage/linux/64bit/sage-9.0-Ubuntu_18.04-x86_64.tar.bz2> 
from sagemath.org. *

*The **fresh **installation run without any problem on my Notebook **running 
*
*with Ubuntu 18.04.3 LTS. *


*But w**hen I try to open Help - > Sage Documentation from jupyter notebook 
I get an „404 Not **F**ound**(You are requesting a page that does not 
exist!)“** error.*

*T**he application try to open 
http://localhost:/kernelspecs/sagemath/doc/index.html?v=20200104184217 
<http://localhost:/kernelspecs/sagemath/doc/index.html?v=20200104184217>. 
*
*Same problem with „Sage Tutorial“ and *


*„Thematic Tutorials“. *



*The help pages are shown when I use the command manual() or tutorial() 
from command line or in an jupyter notebook. *



*I appreciate any help, thanks.*



*Tom* 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/98b3d6d6-94b9-4534-9b8b-3ef2d3d3497a%40googlegroups.com.


[sage-support] Re: Deprecation warning for a Sage interact

2019-12-22 Thread Tom Judson
Thanks.  You saved me a lot of time.

On Saturday, December 21, 2019 at 11:57:49 AM UTC-7, Nils Bruin wrote:
>
> The problem is fairly subtle, but it boils down to the fact that input_box 
> wants a *string* as default value , because a string is also what it gets 
> from the user. Note that your names x and y are bound to x(t) and y(t) 
> respectively. Input box turns its default parameter to a string, so the 
> expression 3*x-2*y turns into the string "3*x(t)-2*y(t)".
>
> Later when this is evaluated, it is evaluated in the context of the global 
> bindings that are currently in force in your sage session, so with x,y 
> being bound to x(t) and y(t) this turns into evaluating
>
> 3*x(t)(t)-2*y(t)(t)
>
> for which the deprecation warning is entirely correct.
>
> The solution is to quote your arguments to input_box as strings, i.e.,
>
> ... input_box(default = "3*x - 2*y") ...
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/7950a51e-9b11-4605-8267-940639a10937%40googlegroups.com.


[sage-support] Sage starts slowly

2019-12-09 Thread Tom
 I’ve installed SageMath-8.9.app.dmg on my MAC (OS X 10.14.6).  There was 
no link installed on the desktop. I tried to start Sage by double clicking 
on “SageMath-8.9” in the Applications folder.   After about 3 hours this "
file:///Applications/SageMath-8.9.app/Contents/Resources/loading-page.html” 
turned up in Safari. After about a half-hour more, this "
http://localhost:/tree” opened up in a new Safari window, from which I 
appear to be able to open notebooks. 

  1.  How do I set it up so I can start Sage from the desktop (or 
applications folder or dock), more quickly?
  2.  How do I run sage from a command line window?

Thanks,

         Tom

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/1c28c5b7-5cf2-48f8-93cb-20c4b2990c72%40googlegroups.com.


[sage-support] Re: Ubuntu 18.04 binaries for Sage 8.9?

2019-10-21 Thread Tom Flyer
Thanks a lot to the team.

Best wishes

Tom

Am Donnerstag, 17. Oktober 2019 18:27:40 UTC+2 schrieb Tom Flyer:
>
> I can't find any Ubuntu 18.04 binary for Sage 8.9 on the mirrors listed at 
> http://www.sagemath.org/download-linux.html.
> Are there any issues in creating these binary?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/932849f3-f78b-4f38-a2e3-45f735819acf%40googlegroups.com.


[sage-support] Re: Ubuntu 18.04 binaries for Sage 8.9?

2019-10-17 Thread Tom Flyer
Thanks for the info, so I will wait a litle bit before I try to build it 
from source. Because the build process will need some time it's an old core 
duo with 8GB.

Am Donnerstag, 17. Oktober 2019 18:27:40 UTC+2 schrieb Tom Flyer:
>
> I can't find any Ubuntu 18.04 binary for Sage 8.9 on the mirrors listed at 
> http://www.sagemath.org/download-linux.html.
> Are there any issues in creating these binary?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/c9b43ba4-fb58-4167-8fb8-460b3acea83a%40googlegroups.com.


[sage-support] Re: Ubuntu 18.04 binaries for Sage 8.9?

2019-10-17 Thread Tom Flyer
Hi Dima,

I will try to build it from source.

Regards

Tom

Am Donnerstag, 17. Oktober 2019 18:27:40 UTC+2 schrieb Tom Flyer:
>
> I can't find any Ubuntu 18.04 binary for Sage 8.9 on the mirrors listed at 
> http://www.sagemath.org/download-linux.html.
> Are there any issues in creating these binary?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/226596c5-7f9a-48eb-983a-ab690a83c55a%40googlegroups.com.


[sage-support] Ubuntu 18.04 binaries for Sage 8.9?

2019-10-17 Thread Tom Flyer
I can't find any Ubuntu 18.04 binary for Sage 8.9 on the mirrors listed at 
http://www.sagemath.org/download-linux.html.
Are there any issues in creating these binary?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/14914c8f-d8e2-4b52-97bb-87ebd0d03350%40googlegroups.com.


Re: [sage-support] SageMath installation in macOS Catalina

2019-10-09 Thread Tom Judson
I had Sage 8.8 (the app) installed under Mojave.  I upgraded to Catalina, 
and everything seems to work fine.

Tom

On Wednesday, October 9, 2019 at 6:51:48 AM UTC-5, David Joyner wrote:
>
>
>
> On Wed, Oct 9, 2019 at 7:42 AM Dima Pasechnik  > wrote:
>
>>
>>
>> On Wed, Oct 9, 2019 at 6:34 AM David Joyner > > wrote:
>>
>>>
>>>
>>> On Wed, Oct 9, 2019 at 7:14 AM Dima Pasechnik >> > wrote:
>>>
>>>> Hi,
>>>>
>>>> On Wed, Oct 9, 2019 at 6:03 AM George > 
>>>> wrote:
>>>>
>>>>> Hi David,
>>>>>
>>>>> Thanks for the update and information.
>>>>>
>>>>> building from source should still work.
>>>> Did you try this ?
>>>>
>>>
>>> I did. It chokes on the gfortran build:
>>>
>>> ...
>>>
>>> [gfortran-7.4.0] make[7]: *** [gets-chk.lo] Error 1
>>>
>>> [gfortran-7.4.0] make[6]: *** [all] Error 2
>>>
>>> [gfortran-7.4.0] make[5]: *** [all-target-libssp] Error 2
>>>
>>> [gfortran-7.4.0] make[4]: *** [all] Error 2
>>>
>>> [gfortran-7.4.0] 
>>> 
>>>
>>> [gfortran-7.4.0] Error building gfortran-7.4.0
>>>
>>> [gfortran-7.4.0] 
>>> 
>>>
>>>
>>>  
>>>
>> is there Homebrew for  Catalina?
>> Then one can use its gfortran.
>>
>>
> I googled around. Apparently the answer is no
> (or not as of a few days ago anyway).
>  
>
>>
>>
>>>> Dima
>>>>
>>>>> G
>>>>>
>>>>> On Wednesday, October 9, 2019 at 1:00:37 PM UTC+2, David Joyner wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Oct 9, 2019 at 6:45 AM George  wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I upgraded to the new macOS Catalina and SageMath won't install. I 
>>>>>>> get errors like "python2.7 cannot be opened because the developer 
>>>>>>> cannot be 
>>>>>>> verified" and for numerous other components as well. 
>>>>>>>
>>>>>>> Is anyone having the same problem? Any tips, advice or ideas on what 
>>>>>>> is going on and how to fix this?
>>>>>>>
>>>>>>>
>>>>>> I can confirm this issue. The problem is also discussed in the thread
>>>>>>
>>>>>> https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/sage-support/4dUg8mbiDYw/u5o-U9QBCAAJ
>>>>>> That's all I know.
>>>>>>  
>>>>>>
>>>>>>> Thanks a lot,
>>>>>>> G
>>>>>>>
>>>>>>> -- 
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "sage-support" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>>> send an email to sage-s...@googlegroups.com.
>>>>>>> To view this discussion on the web visit 
>>>>>>> https://groups.google.com/d/msgid/sage-support/e69a4235-ec1b-465e-98da-635ed8be1b23%40googlegroups.com
>>>>>>>  
>>>>>>> <https://groups.google.com/d/msgid/sage-support/e69a4235-ec1b-465e-98da-635ed8be1b23%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "sage-support" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to sage-s...@googlegroups.com .
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/sage-support/1cd586e5-35af-4e39-9322-8e055c144601%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/sage-support/1cd586e5-35af-4e39-9322-8e055c144601%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>>> Y

[sage-support] Re: arrows in 3d field plots

2019-01-27 Thread Tom Judson
You can adjust the arrowheads.  Look 
at http://faculty.sfasu.edu/judsontw/ode/html-20190111/firstlook03.html for 
some examples.

On Sunday, January 27, 2019 at 10:11:47 AM UTC-6, Tevian Dray wrote:
>
> Can the formatting of arrows in 3d field plots be adjusted? 
>
> I'm trying to make rotatable, 3d versions of 2d field plots. 
> I can get most of what I want with, say: 
> 
> xy=plot_vector_field3d((x,y,0),(x,-1,1),(y,-1,1),(z,-1,1),colors='black') 
> show(xy,orientation=(0,0,0,0)) 
> but I'd really like the output to look more like: 
> plot_vector_field((x,y),(x,-1,1),(y,-1,1)) 
> In other words, more obvious arrowheads.  A bigger plot would also help, 
> to allow setting plot_points to 20 -- the default for 2d. 
>
> Are the arrows and/or size (easily) configurable? 
>
> Thanks, 
> Tevian 
>
>

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


[sage-support] Re: Abstract Algebra tutorial ?

2018-07-11 Thread Tom Judson
Rob Beezer wrote some nice Sage sections for my abstract algebra textbook. 
 You ca find them at the end of each chapter.

http://abstract.ups.edu/aata/

Tom Judson

On Tuesday, July 10, 2018 at 10:18:47 PM UTC-5, Pat Browne wrote:
>
> Hi folks,
>
> Can anyone recommend a good tutorial for using sage Permutations and 
> groups? I am a complete newbie and haven't been able to figure out how to 
> do things with symmetry or permutation multiplications. I'm pretty sure 
> that sage would be a great help in understanding these things.
>
> thanks in advance
> Pat Browne
>

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


[sage-support] Re: Linking Sage cells in a wiki

2017-07-19 Thread Tom Judson
Actually, the problem is not this specific computation but being able to 
link Sage cells in a wiki in general.  However, the following works.


[[html]]
https://sagecell.sagemath.org/static/embedded_sagecell.js"</a>;>
sagecell.makeSagecell({"inputLocation": ".sage", linked: 
true});


Z8 = Integers(8)
Z8


this is some text



Z8.list()




a = Z8.an_element(); a




a.parent()


[[/html]]

On Monday, July 17, 2017 at 2:04:38 PM UTC+2, Tom Judson wrote:
>
> I am trying to link two Sage cells in a wikidot webpage.  The following 
> code successfully executes
>
> [[html]]
> https://sagecell.sagemath.org/static/embedded_sagecell.js</a>
> ">
> sagecell.makeSagecell({"inputLocation": ".sage"});
> 
>   
> a = 10
> Z8 = Integers(8)
> Z8
> 
> [[/html]]
>
> I would like to add a second linked cell that executes the command
>
> Z8.list()
>
> If possible, I would like to include text between the cells.
>
> So far I haven’t had any luck.  Any ideas would be appreciated.
>
> Tom Judson
>
> =
> Thomas W. Judson, Associate Professor
> Department of Mathematics and Statistics
> Stephen F. Austin State University
> P.O. Box 13040-3040 SFA Station
> Nacogdoches, TX  75962
>
> OFFICE: 316 Math
> TEL: (936) 468-1704
> EMAIL: judso...@sfasu.edu
>
>
>
>
>

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


[sage-support] Plotting Cube Root

2017-01-17 Thread Tom Clark
My students had trouble with plotting cos(x^(1/3)) as a homework problem. 
 What's happening is that x^(1/3) generates a primitive complex root so I 
explained that to them, then I found this work around:

def oddroot(x,n):
  sgn(x)*(abs(x))^(1/n)

This is work for any odd number n and will plot nicely over all of R.  I 
see others have had this question on the forum so I thought I'd share.

I don't know if the devs want to implement something like this into SAGE 
more generally, probably not, but at least this is a work around for simple 
graphing etc.

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


[sage-support] Re: R and Sage Cells

2016-06-08 Thread Tom Judson
If I go to https://sagecell.sagemath.org and use the pull down menu on the 
right to set the language to R, everything works.  If I try %r, then I 
don't get the desired output.

On Tuesday, June 7, 2016 at 3:36:22 PM UTC-5, Tom Judson wrote:
>
> Does anyone have any experience using R in a Sage cell?  The following 
> code works fine on SMC but not on the Sage cell server. 
>
> %r 
> age <- c(25, 30, 56) 
> gender <- c("male", "female", "male") 
> weight <- c(160, 110, 220) 
> mydata <- data.frame(age,gender,weight) 
> summary(mydata) 
> cor(mydata$age,mydata$weight) 
> mean(mydata$age) 
> sd(mydata$age) 
> plot(mydata$age,mydata$weight)]]> 
>
> Tom Judson

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


Re: [sage-support] Sage on Mac OS X 10.11

2015-10-06 Thread Tom Judson
Yes, I caught that one and fixed it, but it didn't help with Sage directly.

On Tuesday, October 6, 2015 at 10:58:01 AM UTC-5, projetmbc wrote:
>
> Hello.
>
> The developers of MacTeX hasard indiçâtes in the last days that the folder 
> usr is not longer usable by applications.
>
> Maybe this can help in fixing problems. 
> Le 6 oct. 2015 17:33, "Thomas Judson" > a 
> écrit :
>
>> Has anyone been able to get Sage running on El Capitan?  The app for Sage 
>> 6.8 doesn’t work.  I downloaded sage-6.9.rc2 and tried to build everything 
>> from the source code.  After installing the latest version of Xcode and 
>> MacPorts, I was able to get the build underway.  However, everything 
>> crashed when I tried to run Sage.  I tried to start over, but I get the 
>> same error as if I had never installed the new version of MacPorts.
>>
>> Tom Judson
>>
>>
>> =
>> Thomas W. Judson, Associate Professor
>> Department of Mathematics and Statistics
>> Stephen F. Austin State University
>> P.O. Box 13040-3040 SFA Station
>> Nacogdoches, TX  75962
>>
>> OFFICE: 316 Math
>> TEL: (936) 468-1704
>> EMAIL: juds...@sfasu.edu 
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-support...@googlegroups.com .
>> To post to this group, send email to sage-s...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


[sage-support] Cayley graph of finitely presented groups

2015-05-22 Thread Tom
Hi,

I have noticed a strange behaviour of Cayley graph of finitely presented
groups in Sage 6.7. For example, one gets

sage: groups.presentation.KleinFour().cayley_graph()
Digraph on 14 vertices

One would expect a graph with 4 vertices only. In Sage 6.6 this works
correctly.

I have already created a ticket for this:
http://trac.sagemath.org/ticket/18462

Tomáš

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


Re: [sage-support] Re: Write Sage in Pycharm

2015-02-28 Thread Tom Boothby
Perhaps Pegah wants syntax highlighting specific for sage?

On Sat, Feb 28, 2015 at 9:36 AM, Ralf Stephan  wrote:
>  What exactly is the problem? Are you on OSX? Do you want to use Sage
> as interpreter in PyCharm?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [sage-support] Re: Only dash some edges in a graph?

2014-06-01 Thread Tom Boothby
g = Graph([(i,(i+1)%6,i%2) for i in range(6)])
h = Graph([(i,(i+2)%6,i%2) for i in range(6)])
k = Graph([(i,(i+3)%6,i%2) for i in range(6) if i<3])
pos = graphs.CycleGraph(6).get_pos()
g.set_pos(pos)
h.set_pos(pos)
k.set_pos(pos)
p = g.plot(color_by_label={0:'blue', 1:'red'}, edge_style='dashed',
vertex_labels=False,vertex_size=0)
p+= h.plot(color_by_label={0:'blue', 1:'green'},
vertex_labels=False,vertex_size=0)
p+= k.plot(color_by_label={0:'brown', 1:'black'}, edge_style='dotted')
p.show(axes=False)

On Sun, Jun 1, 2014 at 1:36 PM, Tom Boothby  wrote:
> If you partition the edges into several graphs, you can sum their
> plots.  Just remember axes=false when you show().
>
> On Sat, May 31, 2014 at 8:07 AM, Ursula Whitcher  wrote:
>> On 5/30/2014 11:47 PM, P Purkayastha wrote:
>>>
>>> Perhaps you can try using different colors instead of different line
>>> styles.  There is an option called 'color_by_label', where you can set a
>>> label for some edges and color them accordingly.
>>
>>
>> I am aware of this option, but I want to be able to color AND dash lines.
>>
>> --Ursula.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.

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


Re: [sage-support] Re: Only dash some edges in a graph?

2014-06-01 Thread Tom Boothby
If you partition the edges into several graphs, you can sum their
plots.  Just remember axes=false when you show().

On Sat, May 31, 2014 at 8:07 AM, Ursula Whitcher  wrote:
> On 5/30/2014 11:47 PM, P Purkayastha wrote:
>>
>> Perhaps you can try using different colors instead of different line
>> styles.  There is an option called 'color_by_label', where you can set a
>> label for some edges and color them accordingly.
>
>
> I am aware of this option, but I want to be able to color AND dash lines.
>
> --Ursula.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

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


[sage-support] Symmetric polynomials over a ring of polynomials

2014-05-24 Thread Tom Harris
Hi all,

I am new to sage, so please forgive me if this is a trivial question.

I am trying to express certain polynomials, which are symmetric in a subset 
of the variables, in terms of elementary symmetric polynomials on the 
symmetric subset (with coefficients that are polynomials in the other 
variables.

Here is my setup:
_

R. = PolynomialRing(ZZ,3)
C. = PolynomialRing(R,2)

Sym = SymmetricFunctions(R)
e = Sym.elementary()

def ElemSym(p):
# checks whether a polynomial is symmetric (coefficients in ZZ[l1,l2,l3])
f = Sym.from_polynomial(p)
return e(f)
_

If one enters some polynomials of the desired form by hand, e.g., 

g = (x1^2 - 2*x2^2)*c1 +c1*c2 + (x1^2 -2*x2^2)*c2

and calls ElemSym(g)

then sage returns

(x1^2-2*x2^2)*e[1] + e[2]

as expected.

Now I have some code to generate the polynomial which I am interested in, I 
store it as p:

p = (output of some functions)

( p is ((x1^3 - 2*x1*x2 + x3)*c1^2 - (x1*x2 - x3)*c1 + x3)*c2^2 + x1^3 + 
c1^2*x3 - (x1*x2 - x3)*c1 - ((x1*x2 - x3)*c1^2 - (x1^3 - x1*x2 + x3)*c1 + 
x1*x2 - x3)*c2 - 2*x1*x2 + x3) 

Now the curious thing: p is (naively at least) symmetric in c1 and c2, but 
calling ElemSym(p) returns an error:

ValueError: x0 + 2*x1 + x2 is not a symmetric polynomial

but if I copy the polynomial itself and call

ElemSym(((x1^3 - 2*x1*x2 + x3)*c1^2 - (x1*x2 - x3)*c1 + x3)*c2^2 + x1^3 + 
c1^2*x3 - (x1*x2 - x3)*c1 - ((x1*x2 - x3)*c1^2 - (x1^3 - x1*x2 + x3)*c1 + 
x1*x2 - x3)*c2 - 2*x1*x2 + x3)),

then it works and I get

(x1^3-2*x1*x2+x3)*e[] + (-x1*x2+x3)*e[1] + x3*e[1, 1] + 
(x1^3-x1*x2-x3)*e[2] + (-x1*x2+x3)*e[2, 1] + (x1^3-2*x1*x2+x3)*e[2, 2] + 
(3*x1*x2-3*x3)*e[3] + (-2*x1^3+4*x1*x2-2*x3)*e[3, 1] + 
(2*x1^3-4*x1*x2+2*x3)*e[4]

as expected.

Can somebody help me understand what is going on here?

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


Re: [sage-support] Re: graph.trace_faces() gives me inconsistent results

2014-03-28 Thread Tom Boothby
Christa,

The problem is not with the code, but your expectations of it (which
may be valid, but that would be a feature request and not a bug).  You
expect the code to look at your planar position dictionary, and gin up
an embedding from that.  That is not a bad idea, and possibly a good
feature to request.

What is actually happening is that you are asking the code to make a
new embedding, and compute the faces from that embedding.  It is not
the same embedding as the one you want.  If you gave it a 3-connected
planar graph, of course, the embedding (hence faces) would be unique
(up to orientation)... but your graph is not 3-connected.

To see the embedding those faces correspond to, try

S.is_planar(set_embedding = True, set_pos=True)
S.show()


Regards,
   Tom

On Fri, Mar 28, 2014 at 9:24 AM, Christa Brelsford
 wrote:
> Nathann,
>
> Thanks for your help!  I'm fairly new to both Sage and graph theory, but I
> understand the difference you point out, and it looks like the trace faces
> function is giving me accurate faces for some valid planar embedding- just
> not the one I thought it was working on.  I spoke with a colleague
> yesterday, and he helped come up with a solution.  He tried to post his
> results on this board, but I'm not seeing it, so I'm copy/pasting his
> solution here.   This is not the most efficient solution, but I've tested in
> on a variety of real planar graphs, and it does work.
>
> Ethans answer:
> the problem is not their algorithm for finding faces, but the embedding.
> The embedding should be a clockwise ordering of nodes, but if you look, node
> 3's neighbors list in the embedding (s_emb[3]) is not clockwise.  If you
> reorder the nodes, it seems to work.  See below.
>
>
> import numpy
>
> def reorder_embedding(emb, locs):
> new_emb = {}
> for i,neighbors in emb.iteritems():
> def angle(b):
> dx = locs[b][0] - locs[i][0]
> dy = locs[b][1] - locs[i][1]
> return numpy.arctan2(dx,dy)
>
> reorder_neighbors = sorted(neighbors, key=angle)
> new_emb[i] = reorder_neighbors
> return new_emb
>
>
> S = Graph(lat)
> S.show(vertex_size = 600, pos = nodes_dict)
> S.is_planar(set_embedding = True)
> s_emb = S.get_embedding()
> s_emb_r = reorder_embedding(s_emb, nodes_dict)
>
> print "SAGE embedding:", s_emb
> print "Reordered:", s_emb_r
>
> faces = S.trace_faces(s_emb)
> print "SAGE faces:", faces
>
> faces_r = S.trace_faces(s_emb_r)
> print "Reordered:", faces_r
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [sage-support] Re: sage->nauty->directed graphs isomorphism vs. magma -- smth is very wrong

2014-03-05 Thread Tom Boothby
Yes automorphisms that pop up along the way are used to prune the
search tree.  That's a key feature of McKay's algorithm.  Also, you
are correct, checking for isomorphism of two graphs is faster than
computing the canonical forms of each (this is what happens when you
call G.is_isomorphic(H)), but my advice to Aleksandr is that in the
case where you want to make a database, the fastest way to check if
something's new is to use a hash -- and a canonical label is the first
step towards getting an isomorph-invariant hash.

On Wed, Mar 5, 2014 at 2:53 AM, Dima Pasechnik  wrote:
> On 2014-03-04, Tom Boothby  wrote:
>> They do implement the same basic algorithm.  However, Robert worked
>> from McKay's paper describing the algorithm, which was approximately
>> state-of-the-art when he wrote the paper (but of course, the community
>> tends to eschew optimizations as superfluous to the math, so...).
>> Also, nauty has some pretty serious optimizations that Robert hasn't
>> even attempted: graphs with <=32 vertices are implemented with bit
>> hacks, for example... and there's the matter of the partition stack
>> invariant - Robert and I came up with the best thing we could, but
>> suspect that McKay's is better (but we didn't peek into his
>> implementation to avoid license issues).
> Do you keep track of graph automorphisms that pop up along the way?
> This is potentially a huge improvement in the situation graphs do
> have nontrivial automorphisms.
>
> Do you attempt to construct isomorphisms directly, or you rather
> compute canonical forms? The latter is known to be less efficient in
> practice in many cases.
>
> Dima
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] Re: sage->nauty->directed graphs isomorphism vs. magma -- smth is very wrong

2014-03-04 Thread Tom Boothby
They do implement the same basic algorithm.  However, Robert worked
from McKay's paper describing the algorithm, which was approximately
state-of-the-art when he wrote the paper (but of course, the community
tends to eschew optimizations as superfluous to the math, so...).
Also, nauty has some pretty serious optimizations that Robert hasn't
even attempted: graphs with <=32 vertices are implemented with bit
hacks, for example... and there's the matter of the partition stack
invariant - Robert and I came up with the best thing we could, but
suspect that McKay's is better (but we didn't peek into his
implementation to avoid license issues).

On Mon, Mar 3, 2014 at 12:41 PM, Volker Braun  wrote:
> AFAIK both implement the same basic algorithm. My guess is that nauty
> quickly realizes that it has a huge problem and starts constructing graph
> invariants in an attempt to answer it to the negative. If you were to
> compare two graphs that are actually isomorphic I'm pretty sure that you
> wouldn't find such a big difference. For practical applications it is of
> course important to have this trick using easily-accessible graph
> invariants, but its probably not that hard to implement..
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] Re: sage->nauty->directed graphs isomorphism vs. magma -- smth is very wrong

2014-03-03 Thread Tom Boothby
Once the graph is constructed, is_isomorphic throws away the vertex
labels and just works with pointers to ints.  Constructing the graph
itself happens in a blink.  Sadly, the bulk of the time is spent in
is_isomorphic.

The answer to Aleksandr's question is: Yes, this is a known issue --
nauty has been mercilessly optimized over decades, while nice
(Robert's implementation) is still in its infancy.  Optimizing it to
be competitive will take years of dedicated effort, and a huge amount
of knowledge in computational group theory (there may be savings to
had with strong integration with libgap).   Robert is on hiatus (or
retired altogether) from academia, and hasn't spent much time on nice
in the last few years.  So, unfortunately, Sage has no current viable
plan to improve isomorphism checking.



On Mon, Mar 3, 2014 at 9:53 AM, Chris Godsil  wrote:
> I would not be surprised it it was the finite field arithmetic that is
> causing the difference.
>
>
> On Friday, February 28, 2014 4:18:44 PM UTC-5, Aleksandr Kodess wrote:
>>
>> As far as I know both sage and magma utilize Brendan McKay's program nauty
>> in order to check whether two given graphs (directed or undirected) are
>> isomorphic. As is demonstrated by the following example, sage and magma
>> greatly differ in the efficiency in which this program is utilized.
>>
>> # sage code
>> q = 19
>> n1 = 7
>> n2 = 13
>> F = FiniteField(q, 'xi')
>> V = [(x,y) for x in F for y in F]
>> G1 = DiGraph([V, lambda x,y: x[1] + y[1] == x[0]*(y[0]**n1)])
>> G2 = DiGraph([V, lambda x,y: x[1] + y[1] == x[0]*(y[0]**n2)])
>> G1.is_isomorphic(G2)
>>
>> // magma code for the same operation
>> q := 19;
>> n1 := 7;
>> n2 := 13;
>> F := FiniteField(q);
>> V := {[x,y] : x,y in F};
>> G1 := Digraph< V|{ [x,y] : x,y in V | x[2] + y[2] eq
>> ((x[1])^1)*((y[1])^n1)}>;
>> G2 := Digraph< V|{ [x,y] : x,y in V | x[2] + y[2] eq
>> ((x[1])^1)*((y[1])^n2)}>;
>> IsIsomorphic(G1,G2);
>>
>>
>> It takes sage forever to test whether these two directed graphs of order
>> 19^2 are isomorphic (they are in fact not), while it takes magma only a
>> second. The same problem occurs for other values of q, n1 and n2. The
>> version of sage I'm running is 5.12, and the version of magma I'm running is
>> 2.19.10.
>>
>> Is this a known issue? Is this going to be fixed any time soon?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] Re: checking if two matrices are permutation similar

2014-02-27 Thread Tom Boothby
Keivan,

I'm not sure if this is the best way to do this (e.g. if there's a
naive approach we teach in undergrad linear algebra, it escapes me at
the moment), but I'm a graph theorist so it's the approach that
readily comes to mind, and easy to implement.  Treat your graphs as
incidence matrices of bipartite graphs.  We could check if two
matrices were isomorphic in this way, but the better approach for "do
I have a new object" is generally to compute canonical labels.

The following computes the number of inequivalent matrices.

for n in range(1,6):
uniquematrices = {}
for M in MatrixSpace(GF(2),n,n):
a,b = M.dimensions()
G = Graph([(i+1,-j-1) for i in range(a) for j in range(b) if M[i,j]])
L = G.canonical_label(partition = [[v for v in G if v>0],[v
for v in G if v<0]])
key = L.graph6_string()
uniquematrices[key] = M
print len(uniquematrices)

It's dog slow, but the first 3 numbers come up pretty quick: 2,7,37.
That's enough to find it in Sloane's:
http://oeis.org/search?q=2%2C7%2C36 and the first hit has a huge
number of terms of the sequence.  That sequence has a couple of
references that might help, if this is too slow.

On Thu, Feb 27, 2014 at 12:05 PM, Keivan Monfared  wrote:
> Yes, Here is an example:
>
> I have A= [[0,1,1],[1,1,1],[1,0,1]], B=[[1,1,1],[1,0,1],[0,1,1]] and
> C=[[1,1,1],[1,1,0],[1,0,1]] in my list, but I only need to keep one of them,
> since B is obtained from 1 by permuting the rows with (2,1,3). Also, C is
> obtained from A by permuting the rows by (1,2) and permuting columns by
> (3,1).
>
>
> On Thursday, February 27, 2014 12:43:07 PM UTC-7, projetmbc wrote:
>>
>> Hello.
>>
>> Can you give a small example of your matrices ?
>>
>> Christophe.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] sum? inconsistent to sum??

2013-10-24 Thread Tom Boothby
EM,

Would you post some offending code?  My guess would be that you may
have used a variable named 'sum', and clobbered the built-in function
out of the namespace... but it's strange that you're getting different
results for ? and ??.

On Thu, Oct 24, 2013 at 1:25 PM, eggartmumie  wrote:
> Hi,
>
> I am irritated because I wanted to apply sum to a vector
> which did not work as expected,
> therefore I asked for help by sum? and got something about Integer
> which is not related to the code as exhibited by sum??
>
> Any explanation wellcome, best EM
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] single cell vs multi cell option in notebook?

2013-10-02 Thread Tom Boothby
In multicell mode, when you evaluate a cell, it jumps to the next.
That can be quite annoying if you've got large cells or large output
(I typically have many of both).  Also, see the arrows & progress bar
at the top?  You can use the notebook to give a talk, and it's like a
slideshow rather than scrolling down a single page.

On Wed, Oct 2, 2013 at 6:33 AM, jorges  wrote:
> I couldn't find anything, either here or the docs. What's the use of
> single/multi cell mode?
>
> Regards,
>
> Jorge
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] Latex in interact?

2013-09-12 Thread Tom Boothby
You can't just put that second argument into html -- the following works for me:

var('x')
f(x)=x^4-2*x^2
@interact
def  _(f=input_box(x^4-2*x^2, width=15,
label="$f(x)=$"),a=input_box(-2, width=5, label="$a=$"),b=input_box(2,
width=5, label="$b=$")):
Cf=plot(f,x,-2,2,color='blue', thickness=3)
k(x)=abs(diff(f,x,2))/(1+(diff(f,x,1))^2)^(3/2)
Ck=plot(k,x,-2,2,color='red', thickness=3)
show(Cf+Ck,figsize=6)
html('La fonction de courbure est')
show(k)

On Thu, Sep 12, 2013 at 7:14 AM, Jotace  wrote:
> Hi all,
>
> I'm trying to do an interact to illustrate the curvature of a curve given by
> y=f(x).
> Here is the code, but at the end I cannot properly show the function k(x).
> What's wrong? What should I do?
>
>
> var('x')
> f(x)=x^4-2*x^2
> @interact
> def  _(f=input_box(x^4-2*x^2, width=15, label="$f(x)=$"),a=input_box(-2,
> width=5, label="$a=$"),b=input_box(2, width=5, label="$b=$")):
> Cf=plot(f,x,-2,2,color='blue', thickness=3)
> k(x)=abs(diff(f,x,2))/(1+(diff(f,x,1))^2)^(3/2)
> Ck=plot(k,x,-2,2,color='red', thickness=3)
> show(Cf+Ck,figsize=6)
> html('La fonction de courbure est', latex(k))
>
>
> Thanks!
>
> JC
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] Re: Notebook running out of memory

2013-08-27 Thread Tom Boothby
Oops, too late, it ate too much and died.  Is this a bug?  Looks like
a malicious (or perhaps incompetent, in my case) user can kill the
server.  I think this is the result of a process dumping huge amounts
of output (I had such a process running that I assume to be the
culprit).

On Tue, Aug 27, 2013 at 1:49 PM, Tom Boothby  wrote:
> There's 10G resident, 13G virtual
>
> On Tue, Aug 27, 2013 at 1:46 PM, Volker Braun  wrote:
>> So you actually have 20GB RSS memory usage? Non-virtual?
>>
>>
>> On Tuesday, August 27, 2013 9:35:49 PM UTC+1, Tom Boothby wrote:
>>>
>>> This is a weird one.  I'm running a notebook, the notebook process
>>> itself is taking ~20 gigabytes of memory, and the worker processes are
>>> only using small amounts of memory.
>>>
>>> My assumption is that some worker process is just dumping crazy
>>> amounts of output... I occasionally am guilty of that myself, so I
>>> looked into my personal worksheets on the server -- nothing over a few
>>> megs. (du -h reports that my user directory takes 411M)
>>>
>>> Some of my processes have been running for quite a while and I
>>> hesitate to restart the server.  Does anybody know if there's
>>> something I can do to mitigate this on a running server?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/groups/opt_out.

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


Re: [sage-support] Re: Notebook running out of memory

2013-08-27 Thread Tom Boothby
There's 10G resident, 13G virtual

On Tue, Aug 27, 2013 at 1:46 PM, Volker Braun  wrote:
> So you actually have 20GB RSS memory usage? Non-virtual?
>
>
> On Tuesday, August 27, 2013 9:35:49 PM UTC+1, Tom Boothby wrote:
>>
>> This is a weird one.  I'm running a notebook, the notebook process
>> itself is taking ~20 gigabytes of memory, and the worker processes are
>> only using small amounts of memory.
>>
>> My assumption is that some worker process is just dumping crazy
>> amounts of output... I occasionally am guilty of that myself, so I
>> looked into my personal worksheets on the server -- nothing over a few
>> megs. (du -h reports that my user directory takes 411M)
>>
>> Some of my processes have been running for quite a while and I
>> hesitate to restart the server.  Does anybody know if there's
>> something I can do to mitigate this on a running server?
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.

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


[sage-support] Notebook running out of memory

2013-08-27 Thread Tom Boothby
This is a weird one.  I'm running a notebook, the notebook process
itself is taking ~20 gigabytes of memory, and the worker processes are
only using small amounts of memory.

My assumption is that some worker process is just dumping crazy
amounts of output... I occasionally am guilty of that myself, so I
looked into my personal worksheets on the server -- nothing over a few
megs. (du -h reports that my user directory takes 411M)

Some of my processes have been running for quite a while and I
hesitate to restart the server.  Does anybody know if there's
something I can do to mitigate this on a running server?

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


Re: [sage-support] c++'s "map" equivalent in sage/python

2013-07-03 Thread Tom Boothby
Ugh.  My mistake.  That only supports int keys.

On Wed, Jul 3, 2013 at 5:48 PM, Tom Boothby  wrote:
> I wrote a binary tree implementation a few million years ago, that
> does the job, but doesn't support nice syntax.
>
> http://www.sagenb.org/src/misc/binary_tree.pyx
>
> B = BinaryTree()
> D = {1.1:1,1.5:2,0.9:3}
> for k,v in D.items():
> B.insert(k,v)
> B.get_min()
>
> returns 3.
>
> Looking back at the source, this class kinda sucks.  For example,
> multiple inserts to the same key are ignored (the first value is kept
> for whatever reason).  And it doesn't use a high-tech balancing data
> structure like red/black or AVL; it's just the simplest binary tree
> data implementation you can imagine.  But hey, it works.
>
>
>
>
> On Wed, Jul 3, 2013 at 4:58 PM, Sam Math  wrote:
>> I'm looking for an equivalent to the 'map' function in C++,
>> http://www.cplusplus.com/reference/map/map/.
>>
>> Essentially, I want an associative array. Specifically, I want the array to
>> be indexed by floats.
>>
>> I'm aware of dictionaries in Python, but my program seems to take a lot of
>> time because the dictionary is not sorted by its key value... it's
>> unordered. I need to find the "first" (smallest key) element. Currently, I
>> do this using myDictionary[min(myDictionary.keys())].
>>
>> For example,
>>
>> myDictionary={1.1:1, 1.5:2, 0.9:3}
>> myDictionary[min(myDictionary.keys())]
>>
>> will print out 3.
>>
>> But calling the "min" function takes time for large arrays, and I figured if
>> the array was constructed in an ordered manner, it would be more efficient
>> (even though insert elements would take more time as well), which is why I'm
>> looking for the equivalent to the map command in C++.
>>
>> Thanks
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>

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




Re: [sage-support] c++'s "map" equivalent in sage/python

2013-07-03 Thread Tom Boothby
I wrote a binary tree implementation a few million years ago, that
does the job, but doesn't support nice syntax.

http://www.sagenb.org/src/misc/binary_tree.pyx

B = BinaryTree()
D = {1.1:1,1.5:2,0.9:3}
for k,v in D.items():
B.insert(k,v)
B.get_min()

returns 3.

Looking back at the source, this class kinda sucks.  For example,
multiple inserts to the same key are ignored (the first value is kept
for whatever reason).  And it doesn't use a high-tech balancing data
structure like red/black or AVL; it's just the simplest binary tree
data implementation you can imagine.  But hey, it works.




On Wed, Jul 3, 2013 at 4:58 PM, Sam Math  wrote:
> I'm looking for an equivalent to the 'map' function in C++,
> http://www.cplusplus.com/reference/map/map/.
>
> Essentially, I want an associative array. Specifically, I want the array to
> be indexed by floats.
>
> I'm aware of dictionaries in Python, but my program seems to take a lot of
> time because the dictionary is not sorted by its key value... it's
> unordered. I need to find the "first" (smallest key) element. Currently, I
> do this using myDictionary[min(myDictionary.keys())].
>
> For example,
>
> myDictionary={1.1:1, 1.5:2, 0.9:3}
> myDictionary[min(myDictionary.keys())]
>
> will print out 3.
>
> But calling the "min" function takes time for large arrays, and I figured if
> the array was constructed in an ordered manner, it would be more efficient
> (even though insert elements would take more time as well), which is why I'm
> looking for the equivalent to the map command in C++.
>
> Thanks
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: [sage-support] Fwd: Memory

2013-04-22 Thread Tom Boothby
To work around this, I tried storing only sparse6_strings.  The
original code failed (just appending the same graph 100k times), and
the following worked on my machine.  If more list functionality is
necessary, I'd be happy to provide.

There will be some slowdown in creating the graphs extra times, but
depending on what you're doing with them, that might not be a big
concern. (slower working code > fast broken code, IMO)

class glist:
def __init__(self):
self._l = []
def append(self,g):
self._l.append(g.sparse6_string())
def __getitem__(i):
return Graph(self._l[i])

gs = glist()
for i in range(10):

gs.append(Graph([(0,1,0),(0,1,1),(0,1,2),(0,1,3),(2,3,4),(2,3,5),(2,3,6),(4,5,7),(4,5,8),(4,5,9),(0,1,10),(0,1,11),(0,1,12),(0,1,13),(0,1,14)]))



On Mon, Apr 22, 2013 at 7:27 AM, Stefan van Zwam
 wrote:
> Dear all,
>
> Gordon Royle has the following issue. Any ideas?
>
> --Stefan van Zwam.
>
> Begin forwarded message:
>
> Subject: [sage-matroid] Memory
> Date: April 22, 2013 2:24:05 AM EDT
> To: sage-matr...@googlegroups.com
> Reply-To: sage-matr...@googlegroups.com
>
> I'm trying to work with some collections of graphs and matroids, but I can't
> seem to keep the memory usage under control...
>
> For example, I have a test file containing 10 multigraphs that I want to
> import into sage and then process.
>
> gs = []
> gs.append(Graph([(0,1,0),(0,1,1),(0,1,2),(0,1,3),(2,3,4),(2,3,5),(2,3,6),(4,5,7),(4,5,8),(4,5,9),(0,1,10),(0,1,11),(0,1,12),(0,1,13),(0,1,14)]))
> gs.append(Graph([(0,1,0),(0,1,1),(0,1,2),(0,1,3),(2,3,4),(2,3,5),(2,3,6),(4,5,7),(4,5,8),(4,5,9),(0,1,10),(0,1,11),(0,1,12),(0,1,13),(0,2,14)]))
>
> and another 8 lines of the same length.
>
>
> The entire file occupies 14Mb of disk space.
>
> When I run it through sage, the memory usage of the python2.7 process
> fluctuates dramatically from the 140Mb of the just started sage, up to over
> 4Gb before finally settling at 950Mb when the file is fully imported.
>
>
> So somehow, my 14Mb file has blown out to over 800Mb when imported into
> Sage
>
> Given that this file is just a sample for my REAL file which has 4.2 million
> graphs, I just can't see how to proceed.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "sage-matroid" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-matroid+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: [sage-support] Re: Graphs from binary incidence matrices

2013-04-22 Thread Tom Boothby
That might not have been terribly clear -- the point is, "incidence"
of edges and vertices is a binary relation.  One needs to make a
choice to orient the matrix to make the linear algebra coincidence
work out.

On Mon, Apr 22, 2013 at 8:51 AM, Tom Boothby  wrote:
>> Yes it does, in a way. If you want to construct the Laplacian matrix L of the
>> graph from the incidence matrix E just by using matrix multiplication,
>> you need to pick up an orientation for each edge, i.e. assigning +1 to
>> one end, and -1 to the other. Then, bingo, you have L=E.T*E
>
> I've always seen that described as: "take a random orientation of an
> incidence matrix and multiply it by its transpose to get the
> Laplacian".

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




Re: [sage-support] Re: Graphs from binary incidence matrices

2013-04-22 Thread Tom Boothby
> Yes it does, in a way. If you want to construct the Laplacian matrix L of the
> graph from the incidence matrix E just by using matrix multiplication,
> you need to pick up an orientation for each edge, i.e. assigning +1 to
> one end, and -1 to the other. Then, bingo, you have L=E.T*E

I've always seen that described as: "take a random orientation of an
incidence matrix and multiply it by its transpose to get the
Laplacian".

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




Re: [sage-support] Re: Graphs from binary incidence matrices

2013-04-17 Thread Tom Boothby
Dima,

Rows correspond to vertices and columns correspond to edges.  This
matrix represents an undirected triangle with a double edge.  I don't
understand why the graph __init__ requires a +1 and a -1 in each
column -- that describes a directed incidence matrix, and has no place
in undirected graphs.

On Wed, Apr 17, 2013 at 4:46 AM, Dima Pasechnik  wrote:
> On 2013-04-17, Michael Welsh  wrote:
>> I have some GF(2) matrices that are incidence matrices of undirected graphs. 
>> When I try to construct the graphs in sage, this happens:
>>
>> sage: Graph(matrix(GF(2), [[1,0,1,1],[1,1,0,1],[0,1,1,0]]))
>
> it's not even clear what two parallel edges should lead to. Should they
> "cancel" each other?
>
>> ---
>> ValueErrorTraceback (most recent call last)
>> in ()
>> > 1 Graph(matrix(GF(Integer(2)), 
>> [[Integer(1),Integer(0),Integer(1),Integer(1)],[Integer(1),Integer(1),Integer(0),Integer(1)],[Integer(0),Integer(1),Integer(1),Integer(0)]]))
>>
>> /Applications/sage/local/lib/python2.7/site-packages/sage/graphs/graph.pyc 
>> in __init__(self, data, pos, loops, format, boundary, weighted, 
>> implementation, sparse, vertex_labels, name, multiedges, 
>> convert_empty_dict_labels_to_None)
>>1288 multiedges = (  len(uniq(positions)) < total  )
>>1289 except AssertionError:
>> -> 1290 raise ValueError(msg)
>>1291 num_verts = data.nrows()
>>1292 elif format == 'Graph':
>>
>> ValueError: Non-symmetric or non-square matrix assumed to be an incidence 
>> matrix: Each column represents an edge: -1 goes to 1.
>> sage:
>>
>> Is there a way around this, apart from manually changing each column so that 
>> it has a -1 in it?
>>
>> Michael
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: [sage-support] Re: Generating variables using indexing

2013-03-29 Thread Tom Boothby
oops, didn't read carefully enough... that third line just doesn't
make much sense.

On Fri, Mar 29, 2013 at 4:49 PM, Tom Boothby  wrote:
> Gary,
>
> The third line
>
> for a[ii] in range(0,d):
>
> should read
>
> for ii in range(0,d):
>
> On Fri, Mar 29, 2013 at 4:38 PM, GaryMak  wrote:
>> Hi guys
>>
>> apologies as usual for how dumb this question's going to sound ... but how
>> do I actually use the variables a[1] etc? What I was hoping to do was to use
>> them in the following way (once I had already apparently successfully
>> invoked Jason's routine), where d is a variable I would like to be able to
>> change:
>>
>> d = 5;
>> for ii in range(0,d):
>> for a[ii] in range(0,d):
>> print a[ii]^2 + ii;
>>
>> but I get "TypeError: 'VariableGenerator' object does not support item
>> assignment" seemingly no matter what variant I try.
>>
>> Thanks for any pointers!
>> kind regards
>> Gary
>>
>>
>> On Tuesday, July 5, 2011 1:05:32 AM UTC+1, Jason Grout wrote:
>>>
>>> This question has come up often enough that I thought posting a short
>>> snippet here might be useful.  The question is: how do I automatically
>>> generate variables based on indices (e.g., a[0], a[1], etc. being
>>> variables).  Here is one way:
>>>
>>> class VariableGenerator(object):
>>>  def __init__(self, prefix):
>>>  self.__prefix = prefix
>>>
>>>  @cached_method
>>>  def __getitem__(self, key):
>>>  return SR.var("%s%s"%(self.__prefix,key))
>>>
>>> Now just specify a prefix, and then you can index to your heart's
>>> content to generate variables.
>>>
>>> a=VariableGenerator('a') # some people may like 'a_' as the prefix
>>> a[0], a[1], a[2] # all variables
>>>
>>> Of course, this can easily be extended to using function call syntax:
>>> a(0), or to using multiple indices: a[1,3].  Indeed, you can let your
>>> imagination run wild and even do things like return full symbolic
>>> matrices or vectors with slices: a[0:5, 0:5].
>>>
>>> Perhaps this is useful enough to be in Sage instead of just a snippet
>>> here too...
>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> --
>>> Jason Grout
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>

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




Re: [sage-support] Re: Generating variables using indexing

2013-03-29 Thread Tom Boothby
Gary,

The third line

for a[ii] in range(0,d):

should read

for ii in range(0,d):

On Fri, Mar 29, 2013 at 4:38 PM, GaryMak  wrote:
> Hi guys
>
> apologies as usual for how dumb this question's going to sound ... but how
> do I actually use the variables a[1] etc? What I was hoping to do was to use
> them in the following way (once I had already apparently successfully
> invoked Jason's routine), where d is a variable I would like to be able to
> change:
>
> d = 5;
> for ii in range(0,d):
> for a[ii] in range(0,d):
> print a[ii]^2 + ii;
>
> but I get "TypeError: 'VariableGenerator' object does not support item
> assignment" seemingly no matter what variant I try.
>
> Thanks for any pointers!
> kind regards
> Gary
>
>
> On Tuesday, July 5, 2011 1:05:32 AM UTC+1, Jason Grout wrote:
>>
>> This question has come up often enough that I thought posting a short
>> snippet here might be useful.  The question is: how do I automatically
>> generate variables based on indices (e.g., a[0], a[1], etc. being
>> variables).  Here is one way:
>>
>> class VariableGenerator(object):
>>  def __init__(self, prefix):
>>  self.__prefix = prefix
>>
>>  @cached_method
>>  def __getitem__(self, key):
>>  return SR.var("%s%s"%(self.__prefix,key))
>>
>> Now just specify a prefix, and then you can index to your heart's
>> content to generate variables.
>>
>> a=VariableGenerator('a') # some people may like 'a_' as the prefix
>> a[0], a[1], a[2] # all variables
>>
>> Of course, this can easily be extended to using function call syntax:
>> a(0), or to using multiple indices: a[1,3].  Indeed, you can let your
>> imagination run wild and even do things like return full symbolic
>> matrices or vectors with slices: a[0:5, 0:5].
>>
>> Perhaps this is useful enough to be in Sage instead of just a snippet
>> here too...
>>
>> Thanks,
>>
>> Jason
>>
>> --
>> Jason Grout
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: [sage-support] matchings bipartite graphs

2013-03-20 Thread Tom Boothby
Note that that code only works for graphs whose vertices are labeled [0...n].

On Wed, Mar 20, 2013 at 1:03 PM, Tom Boothby  wrote:
> I use the following to iterate over all matchings and perfect matchings.
>
> def matchings(G):
> edges = G.edges(labels = False)
> verts = [[v] for v in G]
> m = len(edges)
> for match in DLXCPP(edges+verts):
> yield [edges[t] for t in match if t < m]
>
> def perfect_matchings(G):
> edges = G.edges(labels = False)
> for match in DLXCPP(edges):
> yield [edges[t] for t in match]

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




Re: [sage-support] matchings bipartite graphs

2013-03-20 Thread Tom Boothby
I use the following to iterate over all matchings and perfect matchings.

def matchings(G):
edges = G.edges(labels = False)
verts = [[v] for v in G]
m = len(edges)
for match in DLXCPP(edges+verts):
yield [edges[t] for t in match if t < m]

def perfect_matchings(G):
edges = G.edges(labels = False)
for match in DLXCPP(edges):
yield [edges[t] for t in match]

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




Re: [sage-support] Short cut

2013-02-07 Thread Tom Boothby
Marco, my point was that there's another keyboard shortcut you aren't
using -- ctrl> and ctrl<

On Thu, Feb 7, 2013 at 2:06 AM, Marco Boretto  wrote:
> Ok! how i can find his contanct? Where i have to search? Sorry but i'm new!
>
>
> On 6 February 2013 19:04, Tom Boothby  wrote:
>>
>> IIRC, some emacs user (William?) complained until they got ctrl> and ctrl<
>> in.
>>
>> On Mon, Feb 4, 2013 at 2:02 AM, Marco Boretto 
>> wrote:
>> > Hello,
>> > i try to comment uncomment block of code on the sage notebook, but the
>> > schortcut are similar to some shortcut of firefox.
>> > for example:
>> > clrt-: doesn't work and firefox zoom out the page
>> > clrt 3 and 4 : work but firefox change the page to the tab 3 or 4
>> >
>> > why don't change it like:
>> > ctrl shift somethinelse?
>> >
>> > Thank you!
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "sage-support" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to sage-support+unsubscr...@googlegroups.com.
>> > To post to this group, send email to sage-support@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/sage-support?hl=en.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: [sage-support] Short cut

2013-02-06 Thread Tom Boothby
IIRC, some emacs user (William?) complained until they got ctrl> and ctrl< in.

On Mon, Feb 4, 2013 at 2:02 AM, Marco Boretto  wrote:
> Hello,
> i try to comment uncomment block of code on the sage notebook, but the 
> schortcut are similar to some shortcut of firefox.
> for example:
> clrt-: doesn't work and firefox zoom out the page
> clrt 3 and 4 : work but firefox change the page to the tab 3 or 4
>
> why don't change it like:
> ctrl shift somethinelse?
>
> Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: [sage-support] GPL and code generation using sage

2012-09-27 Thread Tom Boothby
On Thu, Sep 27, 2012 at 11:58 AM, Geoffrey Irving  wrote:
> On Thu, Sep 27, 2012 at 11:50 AM, Johannes  wrote:
>> Hi,
>> as far as I understand the GPL, I would say you can release the output
>> of your script under every license you want to, as long as Sage is not
>> necessary to _compile_ or _run_ the the c++ code.
>
> Since my script copies bits of itself into the output, those bits
> carry the GPL along unless you add a special exception to the LICENSE,
> similar to the exceptions added for bison, flex, etc.

This is quite the grey area.  If your script copies small bits of
itself, then that likely constitutes fair use... which is notoriously
fuzzy.

The thing to do, I believe, is to put different licenses on different
files.  Put the quoted bits under CC0 or MIT, and collect them to a
single file.  Put the rest under GPL in other files.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] GPL and code generation using sage

2012-09-27 Thread Tom Boothby
On Thu, Sep 27, 2012 at 12:55 AM, Robert Bradshaw
 wrote:

> I would be extremely
> surprised if any Sage developer morally objects to you licensing this
> output as you wish (though opinions may vary widely as to its
> legality).

Then let me surprise you.  We must have no say over what a user can do
with the output of a Sage script (unless, of course, it's just dumping
Sage source wholesale).  To insist otherwise is a grave violation of
the user's freedom to use the software.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] sagetex question

2012-03-30 Thread Tom Judson
I have a question about sagetex.  Is it possible to run sagetex if you are 
using a remote server as opposed to a local copy of sage.  I run sagetex 
locally on my Mac, but I have a graduate student who would like to use 
sagetex on a PC.  She is currently doing all of her Sage computations on a 
server.  Does anyone have experience with this?

Tom Judson

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: funny Cayley graph

2012-03-13 Thread Tom Boothby
The spring layout is "accidentally" finding the normal subgroup
{+/-1}.  If we look at a smaller subgraph, the problem should be
apparent.

G= SL(2, ZZ)
S, T= G.gens(); ST= S*T
L= [S^i*ST^j for i in range(4) for j in range(3)]
els= Set([ a*b for a in L for b in L])
gr= G.cayley_graph(generators = [S, ST], elements= els)
gr.plot(color_by_label= True, iterations= 500, vertex_labels=False,
vertex_size= 1, scale=10 ) #for example



On Tue, Mar 13, 2012 at 1:27 PM, Pierre  wrote:
> Dear Tom,
>
> Thanks for your answer! I get the empty set, too. I really wonder what
> is going on with the picture though... if one cannot "rely on the
> picture", then it pretty much defeats the purpose when it comes to
> Cayley graphs, doesn't it?
>
> and i mean, there *is* a double arrow on some edges.
>
> thanks again,
> pierre
>
> On 13 mar, 13:50, Tom Boothby  wrote:
>> Pierre,
>>
>> Don't rely on the picture!
>>
>> sage: U = set(gr.edges())
>> sage: V = set(gr.reverse().edges())
>> sage: U.intersection(V) #for me, this is the empty set
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Mar 13, 2012 at 3:26 AM, Pierre  wrote:
>> > Hi,
>>
>> > I've been playing with Cayley graphs in Sage (thanks to whoever
>> > implemented this!) I got funny results on one example, and I'd like to
>> > understand.
>>
>> > I've tried SL(2, ZZ):
>>
>> > sage: G= SL(2, ZZ)
>> > sage: S, T= G.gens(); ST= S*T
>> > sage: L= [S^i*ST^j for i in range(4) for j in range(3)] #S has order
>> > 4, ST has order 3
>> > sage: els= Set([ a*b*c*d for a in L for b in L for c in L for d in L])
>> > sage: gr= G.cayley_graph(generators = [S, ST], elements= els)
>> > sage: gr.show(color_by_label= True, iterations= 500, vertex_labels=
>> > False, vertex_size= 1,  dpi= 800)) #for example
>>
>> > I don't know how to attach a picture to this message, so I'll have to
>> > describe the result as very close to the Cayley graph of PSL(2, ZZ)
>> > rather than SL(2, ZZ)!! it looks as if one of my generators has order
>> > 2!!
>>
>> > does anyone know what is going on?
>>
>> > thanks!
>> > Pierre
>>
>> > --
>> > To post to this group, send email to sage-support@googlegroups.com
>> > To unsubscribe from this group, send email to 
>> > sage-support+unsubscr...@googlegroups.com
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/sage-support
>> > URL:http://www.sagemath.org
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] funny Cayley graph

2012-03-13 Thread Tom Boothby
Pierre,

Don't rely on the picture!

sage: U = set(gr.edges())
sage: V = set(gr.reverse().edges())
sage: U.intersection(V) #for me, this is the empty set


On Tue, Mar 13, 2012 at 3:26 AM, Pierre  wrote:
> Hi,
>
> I've been playing with Cayley graphs in Sage (thanks to whoever
> implemented this!) I got funny results on one example, and I'd like to
> understand.
>
> I've tried SL(2, ZZ):
>
> sage: G= SL(2, ZZ)
> sage: S, T= G.gens(); ST= S*T
> sage: L= [S^i*ST^j for i in range(4) for j in range(3)] #S has order
> 4, ST has order 3
> sage: els= Set([ a*b*c*d for a in L for b in L for c in L for d in L])
> sage: gr= G.cayley_graph(generators = [S, ST], elements= els)
> sage: gr.show(color_by_label= True, iterations= 500, vertex_labels=
> False, vertex_size= 1,  dpi= 800)) #for example
>
> I don't know how to attach a picture to this message, so I'll have to
> describe the result as very close to the Cayley graph of PSL(2, ZZ)
> rather than SL(2, ZZ)!! it looks as if one of my generators has order
> 2!!
>
> does anyone know what is going on?
>
> thanks!
> Pierre
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Unexplained doctest error

2012-01-31 Thread Tom Boothby
This may be a problem with your install.  It works fine on uw.sagenb.org:

http://uw.sagenb.org/home/pub/102

On Tue, Jan 31, 2012 at 6:03 PM, Starx  wrote:
> Oops, well for those who don't want to download the attachment here's
> the pastebin link: http://pastebin.com/z1x00AEa
>
> -Jim
>
> On Tue, Jan 31, 2012 at 5:26 PM, William Stein  wrote:
>> On Tue, Jan 31, 2012 at 5:18 PM, Starx  wrote:
Please make your code available. [...] It depends on the code...
>>>
>>> I hesitated to do this at first because it's a rather large amount of
>>> code, but as you requested I've attached the file.  It goes in the
>>> sage/modules folder.
>>
>> Oh, regarding "large code", the typical thing people do is post it to
>> a site like http://pastebin.com/ then post a *link* in the email.
>>
>>>
 Do you mean that there were errors when you ran manually but not when you
 did "sage -t ..."?  That's strange.
>>>
>>> Yep, in fact the example code at line 929:
>>>
>>> sage: h = P.get_space(1).hom(0, P.get_space(2))
>>>
>>> produces an error because I guess the hom function was changed in 4.8
>>> and will no longer accept the integer 0 as input for creating a zero
>>> map.  Easy to fix, but the doctest doesn't catch it.
>>>
 Try running 'sage -t --verbose ' to see exactly where the error arises.
 That might help.
>>>
>>> This does help narrow it down.  The following code will crash sage:
>>>
>>> sage: from sage.modules.quiver_module import Quiver
>>> sage: Q = Quiver({1:{2:['a']}})
>>> sage: P = Q.P(GF(3), 1)
>>> sage: R = P.radical()
>>> sage: P.quotient(R)
>>>
>>> The quotient function basically takes a bun of vector space quotients
>>> and passes some homomorphisms to those quotients.  I couldn't come up
>>> with a smaller example that makes it crash though, if I play around
>>> with vector spaces and their quotients everything in sage seems fine.
>>>
>>> -Jim
>>>
>>> On Tue, Jan 31, 2012 at 4:17 PM, John H Palmieri  
>>> wrote:


 On Tuesday, January 31, 2012 3:17:51 PM UTC-8, JStarx wrote:
>
> Hi, I am running OS X 10.6.8 and I just upgraded to 4.8 from 4.7.2.
> Some code I've been working on all of a sudden started failing it's
> doctests.  Most of the failures have been easy to track down and fix,
> I only have one left to go but it's stumped me:
>
> d-69-91-134-166:sage-main Starx$ sage -t sage/modules/quiver_module.py
> sage -t  "devel/sage-main/sage/modules/quiver_module.py"
> lda must be >= MAX(N,1): lda=0 N=0Parameter 7 to routine cblas_sgemv
> was incorrect
> Mac OS BLAS parameter error in cblas_sgemv, parameter #0, (unavailable),
> is 0
>
>  [2.7 s]
>
> --
> The following tests failed:
>
>
> sage -t  "devel/sage-main/sage/modules/quiver_module.py"

 Try running 'sage -t --verbose ' to see exactly where the error arises.
 That might help.



> I tried going into sage and running some of the code from my doctests
> manually and even though the above is the only error from the doctest
> some of the doctest code still produces errors, so does that mean this
> is an error with the doctester itself?

 Do you mean that there were errors when you ran manually but not when you
 did "sage -t ..."?  That's strange.  Do you have it on a laptop?  Come by 
 my
 office some time and show me what's going on.

 --
 John

 --
 To post to this group, send email to sage-support@googlegroups.com
 To unsubscribe from this group, send email to
 sage-support+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/sage-support
 URL: http://www.sagemath.org
>>>
>>>
>>>
>>> --
>>> Die Dunkelheit... leitet die Musik.
>>> Die Musik... leitet die Seele.
>>>
>>> --
>>> To post to this group, send email to sage-support@googlegroups.com
>>> To unsubscribe from this group, send email to 
>>> sage-support+unsubscr...@googlegroups.com
>>> For more options, visit this group at 
>>> http://groups.google.com/group/sage-support
>>> URL: http://www.sagemath.org
>>
>>
>>
>> --
>> William Stein
>> Professor of Mathematics
>> University of Washington
>> http://wstein.org
>>
>> --
>> To post to this group, send email to sage-support@googlegroups.com
>> To unsubscribe from this group, send email to 
>> sage-support+unsubscr...@googlegroups.com
>> For more options, visit this group at 
>> http://groups.google.com/group/sage-support
>> URL: http://www.sagemath.org
>
>
>
> --
> Die Dunkelheit... leitet die Musik.
> Die Musik... leitet die Seele.
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagem

[sage-support] Graphical Tools for Ordinary Differential Equations.

2012-01-12 Thread Tom Judson
Has anyone written any graphical tools such as ODE Toolkit, dfield, or
pplane (http://www.codee.org/software) for analyzing solutions to
differential equations?

Tom Judson

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Simplifying log expressions

2012-01-12 Thread Tom Judson
I would like to simplify the difference of two log expressions to show
that I get a constant, but

simplify((1/2)*log(2*t) - (1/2)*log(t))

just returns the expression.  Does anyone know of an easy fix for
this?  Preferably, I would like something that Calculus II students
could easily use.

Tom Judson

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Saving position dictionary of a graph plot

2011-12-16 Thread Tom Boothby
Execute the following until you're happy with the result:

G.set_pos(None)
G.plot(save_pos=True).show()

On Fri, Dec 16, 2011 at 3:13 PM, akm  wrote:
> Is there a way to determine the position dictionary of a plotted graph
> that Sage laid out itself?  I'm making animations of activity in a
> graph format and would like to use the same positioning for all frames
> of the animation.
>
> I like the way the spring algorithm tends to plot graphs better than a
> random set of coordinates in a position dictionary looks, so I'd like
> to grab the positioning created by the first plot and re-use it for
> subsequent plots.
>
> Any ideas?
>
> Thanks,
> Andrew
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Creating a callable matrix with functions.

2011-11-23 Thread Tom Boothby
This is a little on the terse side, but it works quite generally.

def MatrixCallable(M):
N = Matrix(SR,M)
def m(*a,**k):
return Matrix([[e(*a,**k) for e in row] for row in N])
return m

sage: x = var('x')
sage: M = [[sin(x),cos(x),0],[cos(x),sin(x),x^3]]
sage: N = MatrixCallable(M)
sage: N(x=pi/4)
[1/2*sqrt(3) 1/2   0]
[1/2 1/2*sqrt(3)   1/27*pi^3]


On Wed, Nov 23, 2011 at 12:20 AM, achrzesz  wrote:
> Maybe:
>
> sage:def R_theta(theta):
>   return matrix(SR,[[cos(theta),sin(theta),0],[-sin(theta),cos(theta),
> 0],[0,0,1]])
> sage: R_theta(x)
> [ cos(x)  sin(x)       0]
> [-sin(x)  cos(x)       0]
> [      0       0       1]
> sage: R_theta(1)
> [ cos(1)  sin(1)       0]
> [-sin(1)  cos(1)       0]
> [      0       0       1]
> sage: R_theta
> 
>
> Andrzej Chrzeszczyk
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] integrating indicator functions

2011-10-27 Thread Tom Boothby
I'd like to integrate a symbolically defined indicator function:

W(x,y) = t < abs(x-y) < 1-t

though it seems our symbolic objects don't work with chained
inequalities, so I'd be happy with

W(x,y) = (t < abs(x-y)) * (abs(x-y) < 1-t)

Even the following doesn't work:

sage: x,y,t = var('x,y,t')
sage: V(x,y) =  abs(x-y) > t
sage: integrate(V,x,0,1)

And yes, I know that it's easy to compute the this integral with a
little bit of geometry, but that's hardly the point, since I want to
compute homomorphism densities of a graph into the graphon W.  If G is
a graph on n vertices, and X is a list of n symbolic variables, one
for each vertex in the graph,

F = prod(W(X[i],X[j]) for i,j in G.edges(labels=False))

I want to integrate F over an n-dimensional unit cube.

Does anybody know any tricks for this?

Thanks,
   Tom

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] fill between

2011-10-10 Thread Tom Boothby
Add a plot of one filled curve to another, whose color is set to white.

On Mon, Oct 10, 2011 at 4:32 PM, Dan Aldrich  wrote:
> Been trying to set up my graphs so I can select fill areas of a distribution
> curve. So far all I've been able to do is fill the entire curve.  Any
> suggestions?
>
> Thanks,
> -d
>
> # distribution function
> f(x) = 1/sqrt(2*pi)*e^(.5*(-x^2))
> # plus/minus 1 sigma
> s = 1
> p = plot(f,(-pi,pi),ymax = .4, ticks=[1,[]], fill = 'axis')
> ps = line([(s,0),(s,f(s))],linestyle = 'dashed')
> ns = line([(-s,0),(-s,f(-s))],linestyle = 'dashed')
> p += text("$\\mu$ = 0",(0.4,0.05))
> show (p+ps+ns)
>
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Position of vertices in tree graph

2011-10-08 Thread Tom Boothby
This is a bug.  Thank you for reporting it.

On Sat, Oct 8, 2011 at 11:19 AM, Zheng  wrote:
> Hi,
> I created a simple graph by commanding:
>
> a=Graph({0:[1,2],2:[3,4],1:[5,6]})
>
> and plot it in tree layout:
>
> a.plot(layout='tree',tree_root=0,tree_orientation='down')
>
> However, the tree ploted will arrange the vertices unexpectedly
> because the edges for instance (1,5) and (2,4) are intersected. It
> seems sage will position the vertices of the same level according to
> their labels. Is there anyway to override it and keeps the edge from
> crossing another one? Thx.
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: Downtime for *.sagenb.org

2011-09-19 Thread Tom Boothby
same with flask.sagenb.org

On Sun, Sep 18, 2011 at 7:18 PM, MichTex  wrote:
> William--
>
> There is still some sort of problem. Off and on all day long I have
> gotten the message:
>
>   Internal Server Error
>   An error occurred rendering the requested page. More information is
> available in the server log.
>
> It happens sometimes when I try logging in to http://www.sagenb.org/.
> Other times I am able to log in, but then within a short time after
> having successfully logged in, I get the message again while trying to
> bring up a worksheet, or do something on the worksheet. For a while I
> thought it had to do with my browser (normally I use Chrome), but then
> it happened when I logged in with Firefox, too.
>
> Here's hoping that that the problem isn't something too hard to fix. I
> sympathize with you about the disk space issue. It is a chronic
> problem on another service that I am responsible for.
>
> --Bill Cavnar
>
>
> On Sep 18, 10:17 am, William Stein  wrote:
>> Hi,
>>
>> I appear to have successfully migrated all the *.sagenb.org servers to
>> run on a different computer (mod.math.washington.edu).   If you're a
>> user, this should "just work" and you should notice no changes at all.
>>   Please let me know if I've introduced any new problems as a result
>> of the move.
>>
>> If you help me maintain *.sagenb.org (i.e., Mike, Jason and Rado), use
>> the sagenb account on mod.math.washington.edu now.
>>
>>  -- William
>>
>> On Sun, Sep 18, 2011 at 6:12 AM, William Stein  wrote:
>> > Hi,
>>
>> > It's Sunday morning and we have a critical disk space shortage for 
>> > *.sagenb.org.
>> > They will thus be down for a few hours right now, while I migrate them
>> > to a different
>> > machine.
>>
>> > I apologize for any inconvenience.  But doing this now is much better
>> > than them being down because of running out of disk space, say.
>>
>> > William
>>
>> --
>> William Stein
>> Professor of Mathematics
>> University of Washingtonhttp://wstein.org
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Binary array to integer

2011-08-23 Thread Tom Boothby
Martin Albrecht points out that my stringification is a waste:

ZZ(A,2)

works fine.

On Tue, Aug 23, 2011 at 12:29 PM, Tom Boothby  wrote:
> Treat it as a binary number:
>
> s = ''.join(str(i) for i in A)
> ZZ(s, base=2)
>
> On Tue, Aug 23, 2011 at 12:08 PM, Santanu Sarkar
>  wrote:
>> Let A=(1,1,0,0,0,1) be an binary array. How efficiently can we calculate the
>> corresponding integer?
>>
>> --
>> To post to this group, send email to sage-support@googlegroups.com
>> To unsubscribe from this group, send email to
>> sage-support+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/sage-support
>> URL: http://www.sagemath.org
>>
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Binary array to integer

2011-08-23 Thread Tom Boothby
Treat it as a binary number:

s = ''.join(str(i) for i in A)
ZZ(s, base=2)

On Tue, Aug 23, 2011 at 12:08 PM, Santanu Sarkar
 wrote:
> Let A=(1,1,0,0,0,1) be an binary array. How efficiently can we calculate the
> corresponding integer?
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Howto split text cell

2011-08-03 Thread Tom Boothby
Right, and it doesn't really make sense to "split" a text cell,
normally, since a text cell is "whatever comes between cells".  I
think it makes sense, though, to "split" it by inserting a code cell.

I haven't tried to add key commands to the html editor -- does anybody
know if it would be easy to bind ctrl-enter?

On Wed, Aug 3, 2011 at 10:26 AM, William Stein  wrote:
> On Wed, Aug 3, 2011 at 9:35 AM, Marcin Kostur  wrote:
>> Hi,
>>
>> I have encountered problem with splitting a text cell. Shortcuts which
>> work with compute cell do not work. Is there any way to do that?
>
> Unfortunately, this is not implemented in the graphical interface.  I
> think splitting code cells was implemented long ago (by Tom Boothby)
> before text cells were editable.
>
> You can click on "Edit" in the notebook, then paste
> {{{
> }}}
>
> in the spots where you want to split a text cell.
>
>> The workflow which led me to this problem was following: I got a
>> latex file which i tex2sws-ed to worksheet, and in the next step I
>> wanted  to add some sage code to it.
>>
>> the best
>>
>> Marcin
>>
>> --
>> To post to this group, send email to sage-support@googlegroups.com
>> To unsubscribe from this group, send email to 
>> sage-support+unsubscr...@googlegroups.com
>> For more options, visit this group at 
>> http://groups.google.com/group/sage-support
>> URL: http://www.sagemath.org
>>
>
>
>
> --
> William Stein
> Professor of Mathematics
> University of Washington
> http://wstein.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Graphics() objects and a histogram

2011-07-13 Thread Tom Boothby
Sorry, I didn't read carefully; you do seem to know about the
timeseries code.  I'm assuming that the xmax is the midpoint of the
rightmost bin + half the bin width; are you doing something else?
It's hard to guess at what's going wrong if you don't post code.

FWIW, I'd prefer that "plot_histogram" were a global, along the lines of

def plot_histogram(x, *args, **kwargs):
return TimeSeries(x).plot_histogram(*args,**kwargs)

so I'm happy to see somebody working on this.

On Wed, Jul 13, 2011 at 3:29 PM, David Monarres  wrote:
> Hello all,
> Today I was working on a top-level histogram plotting function by exposing
> matplotlib's hist as a Graphics object and I ran into something that has
> stumped me. This is not surprising since I know very little about matplotlib
> and am not all that experienced with programming in general. I mainly wanted
> a nice simple histogram function that worked a lot like the current plot and
> plot3D. I got a working prototype done in a couple of hours but the code I
> had to resort to a bit of a kludge to get a piece to work the way that I
> wanted. I basically am mirroring how the scatter_plot.py works.
>
> My problem is how to establish the axis information  (in
> self.get_minmax_data()) before I have computed the histogram. The 'xmin' and
> 'xmax' are functions of the data but the frequencies are a function of the
> bins computed by hist.  I have solved this for now by running the histogram
> code twice, once when initializing the class and once when creating the
> matplotlib subplot. This seems like a waste.  Does anybody have an idea of
> how to work around this or another part of Sage where this problem has been
> solved.
>
> I have also tried to use matplotlib 'patches' which outputted by the hist
> function and add them one by one to the the subplot in _render_on_subplot(),
> but the result was shifted in a funny way and I was worried that I may be
> losing some of the generality provided by using the subplot's hist method
> for the graphics generation.
> I will post the patches to Sage if anybody is interested in their inclusion.
> Though I think that most people are happy working directly with matplotlib
> or finance.timeseries to really be interested.
> Thank you for your help.
> David Monarres
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Graphics() objects and a histogram

2011-07-13 Thread Tom Boothby
Try the following:

TimeSeries(s).plot_histogram()



On Wed, Jul 13, 2011 at 3:29 PM, David Monarres  wrote:
> Hello all,
> Today I was working on a top-level histogram plotting function by exposing
> matplotlib's hist as a Graphics object and I ran into something that has
> stumped me. This is not surprising since I know very little about matplotlib
> and am not all that experienced with programming in general. I mainly wanted
> a nice simple histogram function that worked a lot like the current plot and
> plot3D. I got a working prototype done in a couple of hours but the code I
> had to resort to a bit of a kludge to get a piece to work the way that I
> wanted. I basically am mirroring how the scatter_plot.py works.
>
> My problem is how to establish the axis information  (in
> self.get_minmax_data()) before I have computed the histogram. The 'xmin' and
> 'xmax' are functions of the data but the frequencies are a function of the
> bins computed by hist.  I have solved this for now by running the histogram
> code twice, once when initializing the class and once when creating the
> matplotlib subplot. This seems like a waste.  Does anybody have an idea of
> how to work around this or another part of Sage where this problem has been
> solved.
>
> I have also tried to use matplotlib 'patches' which outputted by the hist
> function and add them one by one to the the subplot in _render_on_subplot(),
> but the result was shifted in a funny way and I was worried that I may be
> losing some of the generality provided by using the subplot's hist method
> for the graphics generation.
> I will post the patches to Sage if anybody is interested in their inclusion.
> Though I think that most people are happy working directly with matplotlib
> or finance.timeseries to really be interested.
> Thank you for your help.
> David Monarres
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Element in Finite Field

2011-06-18 Thread Tom Boothby
Yaser, which version of Sage are you using?  I'm using 4.6, and I
don't see the behavior you're reporting.

   -- Tom

On Sat, Jun 18, 2011 at 9:08 AM, Yaser Abbasi  wrote:
> Please see this Function :
> def D_f_a(f,G):
>     ABX_Array = []
>     for c in G:
>         for x in G:
>             b = f(x+c)-f(x)
>             print("b : ",b)
>             ABX_Array.append((c,b,x))
>     return ABX_Array
> #///
> If calling that with f(x) = x**3 and G = GF(4,'a')  ,
> You will see b = -1  for any x,c
> and this b is not in G.list() !
> How can get b in G.list? Is there any function for example
> "G.iner(f(x+c)-f(x))" that doing that mind ?
>
> Thx,
>
>
> On Sat, Jun 18, 2011 at 8:36 AM, Tom Boothby 
> wrote:
>>
>> Looks to me like you haven't explicitly defined a, so it's implicitly
>> defined as in var('a').  Instead,
>>
>> sage: f(x) = x
>> sage: G = GF(4,'a')
>> sage: a = G.gen()
>> sage: f(a) - f(a+1)
>> 1
>>
>> On Sat, Jun 18, 2011 at 8:07 AM, Yaser Abbasi 
>> wrote:
>> > Hi,
>> >
>> > According to this function, Is there any function in sage that
>> > element b {"b =  f(x+a) - f(x)} on GF(p^n) (p is prime) must be into
>> > G,
>> > For example :
>> >
>> > f(x) = x
>> > G = GF(2^2,'a')
>> > G.list() = {0,1,a,a+1}
>> > then f(a) - f(a+1) = -1  must be one of {0,1,a,a+1}
>> >
>> >
>> >
>> >
>> > Thx,
>> >
>> > --
>> > To post to this group, send email to sage-support@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > sage-support+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> > http://groups.google.com/group/sage-support
>> > URL: http://www.sagemath.org
>> >
>>
>> --
>> To post to this group, send email to sage-support@googlegroups.com
>> To unsubscribe from this group, send email to
>> sage-support+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/sage-support
>> URL: http://www.sagemath.org
>
>
>
> --
>
>
>
>
>
> 
>                    Yaser Abbasi
>                   AUT  university
> 
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Element in Finite Field

2011-06-18 Thread Tom Boothby
Looks to me like you haven't explicitly defined a, so it's implicitly
defined as in var('a').  Instead,

sage: f(x) = x
sage: G = GF(4,'a')
sage: a = G.gen()
sage: f(a) - f(a+1)
1

On Sat, Jun 18, 2011 at 8:07 AM, Yaser Abbasi  wrote:
> Hi,
>
> According to this function, Is there any function in sage that
> element b {"b =  f(x+a) - f(x)} on GF(p^n) (p is prime) must be into
> G,
> For example :
>
> f(x) = x
> G = GF(2^2,'a')
> G.list() = {0,1,a,a+1}
> then f(a) - f(a+1) = -1  must be one of {0,1,a,a+1}
>
>
>
>
> Thx,
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] serious usability problem with unsaved notebooks

2011-05-14 Thread Tom
I keep getting notebooks that are messed up: text and formulas have been 
randomly moved around and some are missing.  I think this happens when 
closing the Sage notebook without either saving or discarding the changes. 
 I haven't changed any of the default settings.  Unfortunately, quitting out 
of Sage without properly saving happens fairly frequently, and it is 
extremely annoying to lose not just the unsaved changes, but to end up with 
a completely messed up notebook that may take as long to put in order again 
as it took to write originally.

Is there any way I can avoid these problems?  Is there any solution on the 
horizon?  The current situation really makes Sage feel very flaky and 
unreliable, and it makes me reluctant to rely on it or the integrity of 
results that come out of it, since I can never tell whether a notebook 
really is up to date and correct.

At the very least, there should be a warning when users try to close a page 
containing an unsaved notebook, and there should be another warning if a 
notebook that wasn't properly closed is opened again.

Tom

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Sage Notebook Problems

2011-04-20 Thread Tom Judson
I am getting the following error when I try to load the notebook.  It
just happened out of nowhere.  I reinstalled Sage (different
versions) with no luck.  This only happens on my iMac.  Sage runs fine
on my MacBook.  Can I just delete the notebook and start over?  If so,
how do I do that?

Tom

 Sage Version 4.6.2, Release Date: 2011-02-25   |
| Type notebook() for the GUI, and license() for information.|
--
sage: notebook()
---
EOFError  Traceback (most recent call
last)

/Users/twjudson/.sage/ in ()

/Applications/Sage-4.6.2-OSX-32bit-10.5.app/Contents/Resources/sage/
devel/sagenb/sagenb/notebook/notebook_object.pyc in __call__(self,
*args, **kwds)
215 """
216 def __call__(self, *args, **kwds):
--> 217 return self.notebook(*args, **kwds)
218
219 notebook = run_notebook.notebook_twisted

/Applications/Sage-4.6.2-OSX-32bit-10.5.app/Contents/Resources/sage/
devel/sagenb/sagenb/notebook/run_notebook.pyc in
notebook_twisted(self, directory, port, interface, address,
port_tries, secure, reset, accounts, require_login, server_pool,
ulimit, timeout, open_viewer, sagetex_path, start_path, fork, quiet,
subnets)
172 print '*'*70
173
--> 174 nb = notebook.load_notebook(directory)
175
176 directory = nb._dir

/Applications/Sage-4.6.2-OSX-32bit-10.5.app/Contents/Resources/sage/
devel/sagenb/sagenb/notebook/notebook.pyc in load_notebook(dir,
interface, port, secure)
   1704
   1705 dir = make_path_relative(dir)
-> 1706 nb = Notebook(dir)
   1707 nb.interface = interface
   1708 nb.port = port

/Applications/Sage-4.6.2-OSX-32bit-10.5.app/Contents/Resources/sage/
devel/sagenb/sagenb/notebook/notebook.pyc in __init__(self, dir)
 93 # Set the list of users
 94 try:
---> 95 self.__users = S.load_users()
 96 except IOError:
 97 self.__users = {}

/Applications/Sage-4.6.2-OSX-32bit-10.5.app/Contents/Resources/sage/
devel/sagenb/sagenb/storage/filesystem_storage.pyc in load_users(self)
211 {'admin': admin, 'wstein': wstein}
212 """
--> 213 return
self._basic_to_users(self._load('users.pickle'))
214
215 def save_users(self, users):

/Applications/Sage-4.6.2-OSX-32bit-10.5.app/Contents/Resources/sage/
devel/sagenb/sagenb/storage/filesystem_storage.pyc in _load(self,
filename)
132
#
133 def _load(self, filename):
--> 134 return cPickle.load(open(self._abspath(filename)))
135
136 def _save(self, obj, filename, ):

EOFError:

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] sage server

2011-03-18 Thread Tom Bensky
Dear sage community---

I want to set up a local sage server for my freshman physics students
to use.  I am using Ubuntu 10.10 and followed the directions at the
SageServer wiki and it worked just fine. Assuming my server is at
http://server.whatever, going to this URL would fire up sage just
fine, with apache proxies rerouting / to localhost:8000.

This installation, however, assumes that the document root of the web
server is where the installation should occur. The associated proxy
redirects essentially take over the whole web server--that is,
accessing other web services, like a wiki or some other php codes
becomes impossible.  I tried changing the proxies to reference
something like http://server.whatever/sage (that is, proxy redirect
/sage/ requests to localhost:8000). This works initially, but the css,
etc. was all missing. I fixed this with URL rewrites in
/sage/.htaccess, which edits the absolute references in the sage html
files. Things looked perfect now at http://server.whatever/sage, and
my other web services were available too.

The problem now is that all sage worksheets contain a red "Searching
for sage server..." and the worksheets become useless (i.e.
disconnected from the sage server). Likewise the javascript action of
deleting, etc. a worksheet are broken.  I am stuck here and cannot
find a solution to this problem.  Has anyone tried installing a sage
server into any web directory other that the root one?

Thanks for any help.
Tom B.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Request for Comments (graph genus)

2010-04-29 Thread Tom Boothby
I've been working on a new implementation of an algorithm to compute
the genus of graphs.  Throughout the process, I've been bound by the
chains of backwards compatibility.  As I've attempted to finish off
the patch, I've found some deeply unsettling details in the current
implementation.  I'd like to hear from somebody (anybody) who computes
the genus of graphs with Sage, or cares about this sort of thing in
general.

Currently, the following features exist within Sage:

  * computing the minimal/maximal genus for connected graphs
  * computing the minimal/maximal genus for connected graphs
respecting a boundary (ordered or unordered)
  * computing the genus of graph with a combinatorial embedding
supplied by the user

where we define the maximal genus as the maximum obtained by a
combinatorial embedding.

The following are completely broken, or **built on hypotheses that are
almost certainly false**:

  * computing anything about combinatorial embeddings of graphs with
more than one parallel edge or loop (we can accept up to 1 extra edge
due to a rounding error)
  * computing the maximal genus for graphs respecting a boundary (this
includes a conspicuously incorrect doctest)
  * computing anything about combinatorial embeddings of directed graphs
  * computing the genus of an empty graph (har har)

Also, what does work (simple connected graphs) is so slow, it makes my
eyes bleed.

I'd like to remove anything referring to the "maximal" genus of a
graph.  It seems to have been implemented purely because it was easy
to do so.  I could also be convinced that we should keep this feature,
and raise a NotImplementedError where the implementation is senseless.

Also, I might like to make it possible to compute the genus of
multigraphs and looped graphs.  Part of the difficulty in this is that
embeddings are represented with the assumption that graphs are simple,
so this would result in a change that appears backwards incompatible
-- however, I believe that the only thing lost would be non-simple
graphs, where an incorrect answer was given anyway.  Alternately, I'd
be happy to never compute anything about these graphs -- the only
reason *not* to think about embeddings of simple graphs is that the
max genus goes up with extra parallel edges.  More reason not to
support the max genus.

Issues to vote on:

1) Max Genus:
a [ ] Remove every reference to maximal genus
b [ ] Raise NotImplementedError for max genus computations that are
not supported
c [ ] Delay everything indefinitely until somebody cares enough to
make max genus work while respecting embeddings (I probably won't do
this)

2) Looped Multigraphs:
a [ ] Break backwards compatibility in some cases
b [ ] Raise NotImplementedError on anything involving embeddings of
multigraphs (note, we could still compute the minimal genus with this
option)

For your consideration, my currently-existing code is about ten
thousand times faster for simple graphs, and is working very well.  My
votes are:

1) a
2) b

Thanks,
   --tom

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] export notebooks/worksheets to LaTeX?

2010-04-18 Thread Tom
I would like to use parts of my Sage notebooks for lecture notes.

Is there a script or some other convenient way of exporting Sage
notebooks to LaTeX?

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] script to publish worksheets ... not working

2010-04-18 Thread Tom
I'd like to use a script to publish all the worksheets in a notebook.
I tried the script below but it's not working: the resulting
worksheets contain no title and no text.  Does anybody have any idea
what's wrong?  Are there scripts for bulk publishing worksheets
(ideally, I should be able to select worksheets in the list and then
select "publish" from the drop-down menu, but I'd like to get this
kind of script working for other reasons too).

# -*- Python -*-

import sys,re,os
from sagenb.storage import FilesystemDatastore
from sagenb.notebook.notebook import Notebook

nb = "sage-improc/sage_notebook.sagenb"

ds = FilesystemDatastore(nb)
for worksheet in ds.worksheets("pub"):
pass

notebook = Notebook(nb)
for worksheet in notebook.get_all_worksheets():
name = worksheet.name()
user = worksheet.owner()
print user,name
if worksheet.has_published_version():
print "unpublishing",user,name
published = worksheet.get_published_version()
published.move_to_trash(user)
try:
print "publishing",user,name
published = notebook.publish_worksheet(worksheet,'admin')
print "OK"
except:
print "OOPS"

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] sagemath installs on ubuntu karmic, but abends on simple problem

2010-02-13 Thread Tom Roche
summary: I installed ubuntu package=sagemath (and dependencies) using
aptitude on 2 previously-sage-clean ubuntu karmic boxes. Sage appeared
to install cleanly on both boxes, but a simple problem (that works on
sagenb.org) causes sage to abend similarly on both boxes. How to fix
the current installs, or reinstall more appropriately?

details:

I'm trying to show my girlfriend's daughter how to do some simple math
on her computer. She has UNR 9.10 on i386, I have straight ubuntu 9.10
on amd64. Both are GNOME-based and have default python=2.6. I have
previously installed and used scipy/numpy on my box without problems;
her box is enthought-clean. Both of us are new to sage (I have used
Mathematica some, but only on windows) and both our boxes were
previously sage-clean.

I did one of her homework problems on the web:

http://www.sagenb.org/home/tlroche/0/
> x, y = var('x y')
> e1 = y == 2*x - 2
> e2 = y == x + 2
> solve([e1, e2], x, y)
and got as expected
> [[x == 4, y == 6]]

so I decided to install package=sagemath on her netbook, with

$ sudo aptitude install sagemath

using current default ubuntu repositories. This installed without
error. Since it was such a huge install (postfix?) I restarted
afterward. I then attempted to run the above example from the
commandline and failed miserably. Thinking it might be a box- or
architecture-specific problem, I then installed the same way on
my box and got a very similar error trace, which follows in its
entirety following my .sig.

I'm wondering, is there an easy way to fix these installs?
Alternatively, is there a better way to install sage on ubuntu?
Apologies if this is a FAQ: I saw a buncha posts about ubuntu install
problems, but nothing quite this uncomplicated (i.e. a straight/fresh
install of the sage packages).

Feel free to reply directly to me as well as to the group, and TIA,
Tom Roche -trace follows to end of post--

tlro...@tlrpanp5:~$ sage
--
| SAGE Version 3.0.5, Release Date: 2008-07-11   |
| Type notebook() for the GUI, and license() for information.|
--

sage: x,y=var('x y')
sage: e1=y==2*x-2
Exception pexpect.EOF: EOF() in
'sage.structure.parent._unregister_pair' ignored
Maxima crashed -- automatically restarting.
Exception pexpect.EOF: EOF() in
'sage.structure.parent._unregister_pair' ignored
sage: e2=y==x+2
sage: solve([e1,e2],x,y)
Maxima crashed -- automatically restarting.
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (865, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (865, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (575, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (356, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (865, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (387, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (805, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (785, 0))

---
EOF   Traceback (most recent call
last)

/home/tlroche/ in ()

/usr/lib/python2.5/site-packages/sage/calculus/equations.pyc in
solve(f, *args, **kwds)
   1378 return []
   1379
-> 1380 m = maxima(list(f))
   1381
   1382 try:

/usr/lib/python2.5/site-packages/sage/interfaces/maxima.pyc in
__call__(self, x)
375 def __call__(self, x):
376 import sage.rings.all
--> 377 return Expect.__call__(self, x)
378
379 def __init__(self, script_subdirectory=None, logfile=None,
server=None,

/usr/lib/python2.5/site-packages/sage/interfaces/expect.pyc in
__call__(self, x)
954 pass
955 try:
--> 956 return self._coerce_impl(x, use_special=False)
957

[sage-support] Re: For Sage server maintainers

2010-01-12 Thread tom
Hi Kwankyu,

Do you or anyone know of a recipe to configure a linux apache
httpd.conf file so that sage will run as a web server for the public?
We are looking to make something like the www.sagenb.org except for
our local group.

Thanks for your time,
Tom

On Jan 10, 9:24 pm, Kwankyu  wrote:
> Hi,
>
> This is an advertisement of a simple script starting and stopping a
> Sage server on unix/linux platform, living at
>
> http://trac.sagemath.org/sage_trac/ticket/7893
>
> Kwankyu Lee
-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: illegal instruction with sage-sse2-3.4.2 virtual machine

2009-06-03 Thread tom d

I'm having the same issue with the Debian binary for sage 4.0 on my
eeepc.

/mnt/usb1/sage4> ./sage
--
| Sage Version 4.0, Release Date: 2009-05-29 |
| Type notebook() for the GUI, and license() for information.|
--
The SAGE install tree may have moved.
Regenerating Python.pyo and .pyc files that hardcode the install PATH
(please wait at
most a few minutes)...
Do not interrupt this.
/mnt/usb1/sage4/local/bin/sage-sage: line 198: 31050 Illegal
instruction sage-ipython "$@" -i


On May 17, 12:17 am, paul  wrote:
> Just downloaded the lastest sage for windows virtual machine as well
> as the latest vmware to run it. Wow, 700Mbytes and yet no clear
> instructions on how to run it!
>
> I tried double clicking on sage_vmx.vmx, then at the sage login prompt
> I typed "login" and then "sage" for the password, and then "sage"
> again at the "lo...@sage:~s" prompt. I don't know if that is the
> proper way to proceed, but anyway after that I see:
>
> Sage Version 3.4.2, Release Date: 2009-05-05
> Type notebook() for the GUI, and license() for information.
> //usr/local/sage/local/bin/sage-sage:
> line 198: 3556 illegal instruction   sage-ipython "s@" -i
>
> Does this illegal instruction indicate that it won't run on my
> computer,
> or have I done something wrong?
>
> Since this version seems to suggest that the SSE2 instruction set is
> required I checked my cpu with CHKCPU32.exe which indeed reports that
> my cpu does support SSE2 (although not SSE3).
>
> BTW, my very first attempt was just to type "notebook" at the first
> prompt which was what the readme seemed to suggest. Although no
> warnings were given it seems unlikely that any virtual machine was
> actually started. At least firefox did not think so as it didn't
> respond to the IP address that briefly flashed by the vmware window.
>
> Can someone guess what I might be doing wrong? Also are there any
> clear instructions on how to start this mess. (And why would someone
> upload 700Mbytes of stuff without installation instructions?)
>
> Thanks for any help you can provide.
> ~Paul

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Cython and Matrices over Finite Fields

2009-04-02 Thread Tom H.


Dear Jason and Robert,

Thank you.  Your suggestions solved the above problem, but now I have
an even easier array problem in Cython that I just posted in a new
thread.

-Tom


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Integer Array definition in Cython (Elementary Question)

2009-04-02 Thread Tom H.

I can't use simple integer arrays in Cython.   The following simple
program:

%cython
# --- vectormultiply.pyx ---

def vectormultiply(int a):
  cdef int b[1]
  b[0] = a
  return b

gives the following sage compiling error.   I've tried following some
online examples but can't get this program to compile without errors.
Any suggestions?

Thanks,
Tom

Here's the error
_
Traceback (most recent call last):def vectormultiply(int a):
  File "/Applications/sage/local/lib/python2.5/site-packages/sage/
server/support.py", line 408, in cython_import_all
create_local_c_file=create_local_c_file)
  File "/Applications/sage/local/lib/python2.5/site-packages/sage/
server/support.py", line 385, in cython_import
create_local_c_file=create_local_c_file)
  File "/Applications/sage/local/lib/python2.5/site-packages/sage/misc/
cython.py", line 366, in cython
raise RuntimeError, "Error converting %s to C:\n%s\n%s"%(filename,
log, err)
RuntimeError: Error converting /Users/.../.sage/sage_notebook/
worksheets/admin/22/code/sage328.spyx to C:


Error converting Pyrex file to C:

...
# --- vectormultiply.pyx ---

def vectormultiply(int a):
  cdef int b[1]
  b[0] = a
  return b ^



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Cython and Matrices over Finite Fields

2009-04-01 Thread Tom


I want to write a Cython version of a Python function f(m) where the
input is a sage matrix of the form

m= matrix(GF(p), n, k)

How can I pass m to the .spyx function?  I couldn't find any examples
online.

My only idea is to convert m to a matrix over Z, and then to a list,
but I'm assuming there must be a better way.

-Tom



--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Problem Running with nohup on OSX.5

2009-01-09 Thread Tom

import sys
sys.stdout.flush()

was the solution!

Thanks William!

-Tom
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Problem Running with nohup on OSX.5

2009-01-09 Thread Tom


I think I may have found the source of the error, but not a
solution.   Does Sage (or Python or unix) only save the output to disk
in chunks of 32Kb?  By putting some simple print statements in my
program, I do see the output being recorded in the file.   I find that
the size of the results file gets incremented by approximately 32Kb
each time.   In the original program, there was not much output so one
would have to wait a long time before one would have 32Kb of output
(unless the program ends).

Carl, I also tried your solution  "nohup ./sage mytest.sage < /dev/
null > results.txt &"  and it appears to have the same property.  No
output for the original file, but output in 32Kb chunks with the new
print statements inserted.  Also, the use of the name "commands.sage"
was unfortunate.  I just chose that as it seemed like a generic name.
My original program has a different name that wouldn't be a Sage
command.

If my guess above is correct, is there anyway to force Sage to save
the output to the file more often (i.e. in smaller chunks)?

Thanks in advance,
Tom


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Problem Running with nohup on OSX.5

2009-01-09 Thread Tom


I'm having difficulty running Sage in the background on a Mac with OSX.
5 and getting the output saved in a file.  I tried a few permutations
with different results so I expect I'm making a silly error.   Here's
what I've seen.
Since the program runs fine in some of the scenarios, I don't think
the program (which I call "commands.sage") is the problem (I've made
it simpler and simpler without any change in the results).  Any help
would be appreciated.

Thanks,
Tom

0.  If I run Sage (from the command line) and type

load "commands.sage"

then the program runs fine.


1.  If I run

nohup ./sage < commands.sage > results.txt &

the file results.txt will just contain the initial startup messages
from Sage, but nothing more.


2.  If I run
./sage < commands.sage > results.txt

all the output is correctly written to results.txt.   The only problem
is that I can't close the terminal session and let Sage run in the
background.


3. If I run

./sage < commands.sage

I get the initial startup message, but nothing else written to screen
or any file.


4.  If I create a file "intro.sage" with the one line

load "commands.sage"

and then run

./sage < intro.sage

then the program runs and the output is sent to the screen.


5.  If I run

nohup ./sage < intro.sage > results.txt &

the file results.txt will just contain the initial startup messages
from Sage, but nothing more.


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---