[sage-support] Re: Is there a way to use Sage's Jupyter outside the sage shell ?
On Monday, April 8, 2024 at 5:21:57 PM UTC-5 Nils Bruin wrote: If you run `jupyter --paths` and `sage -sh <<<"jupyter --paths"` you see the difference in paths. The relevant ones for you are probably the sage-specific ones $SAGE-LOCAL/var/lib/sage/venv-python3.10/share/jupyter Whatever is there will get picked up by sage's jupyter but, naturally, not by your standard jupyter. So the kernels that live there could be copied to a location that is accessed by your system jupyter: $HOME/.local/share/jupyter or something like that. Note that the files there might need some surgery, because starting those kernels probably needs to happen through sage's python (or at least its venv); similar to how to get the sage kernel working in a system jupyter. The Sage binary installer for macOS optionally installs the Sage Jupyter kernels in a location that an arbitrary Jupyter will search by default, and in that case the JSON kernel file just looks like: {"argv": ["/var/tmp/sage-10.3-current/venv/bin/sage", "--python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"], "display_name": "SageMath 10.3", "language": "sage"} I think it will work as long as your have the full path to Sage in the venv as part of argv. Best, Nathan -- 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/5954ddb3-092c-4c69-af61-b00956eff28cn%40googlegroups.com.
[sage-support] Re: HPC Multi Node/Cluster Install Question
I have used Sage extensively on a couple HPC clusters. While I used to build it from source, I use conda/mamba to install Sage: https://doc.sagemath.org/html/en/installation/conda.html and strongly recommend this approach today. As for a local or shared install, Sage opens a staggeringly large number of files on startup. On a shared file system, this can result in very slow startup times (30 seconds or even more) even though starting Sage takes just a few seconds on one's laptop. Best, Nathan -- 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/98631d72-1a63-40d7-8ffe-116d917a8b28n%40googlegroups.com.
Re: [sage-support] Sage Crash Report
On Monday, January 17, 2022, Dima wrote: > This is an M1 machine, right? I don't think we already support these. > The recommended binaries for macOS, namely https://github.com/3-manifolds/Sage_macOS/releases are known to work fine on M1, though using Rosetta emulation for Sage 9.4. An M1-native version should be available for the upcoming SageMath 9.5, and a prerelease version has been posted at the above, though it has some known issues. Best, Nathan -- 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/682dfacf-5d62-4095-ab4f-edabd2a6e3ebn%40googlegroups.com.
[sage-support] Re: sage 9.4 installation problem on ubuntu 20.04
> > I have installed sage 9.2 on ubuntu 20.04 fron binaries and it works fine. > I tried to install sage 9.4 with the same method but it doesn't work. > You will find an example in attached file with its log file. > Unfortunately, the current 9.4 binaries don't work on some older hardware because of how OpenBLAS was compiled. This will be fixed in 9.5, until then you could either go back to 9.2 (I think 9.3 is also problematic, someone else might be able to clarify), or install via different method, such as: https://doc.sagemath.org/html/en/installation/conda.html A version of SageMath is also available as a Debian/Ubuntu package, not sure what version. Best, Nathan -- 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/36a853d6-63e7-49e4-b4fd-eaef992a127bn%40googlegroups.com.
Re: [sage-support] Re: after upgrade to 9.3, SignalError: Illegal instruction
I suspect the cause is OpenBLAS. While this library is built with DYNAMIC_ARCH=1, there is still the non-performance critical code which will use whatever instructions are available on the machine at compile time unless you also set TARGET. See https://github.com/xianyi/OpenBLAS/issues/3056 For the macOS app, Marc Culler had to set TARGET=CORE2 so that it would run on a 2013 cylindrical Mac Pro (this version is not yet posted). Best, Nathan On Wednesday, August 25, 2021 at 10:15:02 PM William Stein wrote: > Hi, > > I release cocalc-docker ([1], [2]) a few days ago with sage-9.4, and had > people reporting back "illegal instruction" issues. Sage is built there > with SAGE_FAT_BINARY="yes", using this script [3]. One person who reported > a problem had a "Dell PowerEdge R710." and I built on an intel Dell > PowerEdge R630, for what it is worth. They got the error "An illegal > instructor occurred" when computing "5+2" in Sage. > > My solution for now is to keep cocalc-docker at sage-9.3 for the time > being, and suggest that people build sage from source on their own machine > if necessary. I'll let you know if I have any further information, but I > just wanted to add this data point. > > [1] https://github.com/sagemathinc/cocalc-docker > [2] https://hub.docker.com/r/sagemathinc/cocalc > [3] > https://github.com/sagemathinc/cocalc-docker/blob/master/scripts/install_sage.sh > > On Wednesday, August 25, 2021 at 8:57:44 AM UTC-7 Marco Streng wrote: > >> In the end I build 9.4 from source and that worked perfectly. And it >> turned out that the Ubuntu 18.04 binaries of 9.2 also work on this >> particular machine (though we went for 9.4 in the end). Thanks again for >> the help. >> >> Op dinsdag 24 augustus 2021 om 18:03:01 UTC+2 schreef slelievre: >> >>> 2021-08-24 05:48 UTC, Dima Pasechnik: >>> > >>> > These "illegal instruction" errors are an indication >>> > that the binary was built for a more advanced CPU >>> > than yours - which does not support certain CPU >>> > commands. It's a bug in "fat binary" build process >>> > we see for some time. >>> > >>> > Build Sage yourself, or use Conda. >>> >>> I opened a ticket at binary-pkg for that: >>> https://github.com/sagemath/binary-pkg/issues/31 >>> >> -- 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/62622bd6-6fcd-4b94-8fce-455517ad093an%40googlegroups.com.
Re: [sage-support] Conveniently running and building sage on Win10
> > * running "uname -r" (without options, uname only given back "Linux" which > I don't think is distinguishing information) I get > 4.4.0-19041-Microsoft > > I guess 4<19. On the other hand, 4.4 > 4.19, so I'm not sure what that is > telling me. > Based on this, I think you have WSL1: https://github.com/microsoft/WSL/issues/5428 In any case: do people get "fair" performance under WSL or WSL2? Does > Cygwin give better performance? Is development even possible/convenient > under Cygwin? > No direct experience, other than I have used Docker on a Surface Pro 5 and Docker itself uses WSL(2?) these days. It's been fine, but I didn't do anything like compile all of Sage; as you say, it's passively cooled. -- With WSL2, I think there are two different file systems "Linux side" and "Windows side" and access to the Windows side is super slow by comparison. But I may be misremembering. Best, Nathan > My impression (with both my laptop and the Surface Pro 7 having an intel > core i5) was that I should be getting similar performance. On the other > hand, the Surface doesn't seem to show any fan action at any point whereas > the laptop is quite happy whirring away whenever some load comes its way, > so it could just be that the Surface is passively cooled and therefore > throttled into computational mediocrity (the surface is really just a > tablet to write on and as a tablet OS, win10 seems to be performing just > fine). I think the students who'd be using Win10 for development would have > beefier machines > -- 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/f09e6f53-1ba4-45d6-8a8e-fa2c8fd200a6n%40googlegroups.com.
[sage-support] Re: Conveniently running and building sage on Win10
An option worth considering is Docker. I have had some success with students on Windows or macOS using https://github.com/3-manifolds/sagedocker to develop Sage-dependent code for SnapPy. One advantage of Docker is that you can have everyone working from an initially uniform image, which helps with debugging technical glitches. I've even had students connect via their web browser to a JupyterLab instance on the container, giving them a perfectly serviceable development environment right off the bat. Of course, at that point one could also look into a Cocalc subscription, we've used that for Sage-based classes here. Best, Nathan -- 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/c97796fb-1bfb-46c7-ae1c-22441c043763n%40googlegroups.com.
[sage-support] Re: Cannot install Sage 9.2 on macOS 10.15.7 Catalina
Suggest you try the version in development here: https://github.com/3-manifolds/Sage_macOS/releases/tag/v1.0-beta To be clear, it's the same Sage 9.2 as you are trying to install, the "beta" refers to the packaging method. Nathan On Saturday, March 27, 2021 at 11:58:38 AM UTC-5 Anscari wrote: > I downloaded the binary sage-9.2-OSX_10.15.7_x86_64.app.dmg in order to > install SageMath 9.2 as an app on my MacBook Pro (Intel Core i7, 2015) > running macOS Catalina 10.15.7. I already have SageMath 8.0 as an app, > which I installed with no problem some time ago, but since I don't know of > a better way to upgrade I am just trying to install the SageMath 9.2 app. > > The download works fine and when I open the dmg and drag the app to > 'Applications' the app starts copying just fine, but after a few minutes I > get an error message saying 'The operation can't be completed because you > don't have permission to access "SageMath-9.2".' and the process stops. > > [image: Screenshot 2021-03-26 at 13.18.03.png] > Copying normally ^ > > > [image: Screenshot 2021-03-26 at 13.21.53.png] > > After some minutes this happens ^ > > > Do you have any suggestions as to why this might be happening and how to > solve it? > > Thank you very much! > -- 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/69d66b09-5173-4808-a090-06e0550c2829n%40googlegroups.com.
Re: [sage-support] problems again installing Sage9.1 (and 9.2)
Anita, 1. The version at: https://github.com/3-manifolds/Sage_macOS/releases/tag/v1.0-beta was just updated last night. Now double-clicking the icon should produce a window which offers a choice of terminal or Jupyter. 2. I don't think kbmag comes with Sage, or at least your command failed on three different versions of Sage I tried (one Mac, two Linux). So I assume this is a file in one of your own directories that you are trying to load. If so, probably the file is not in the directory where Sage starts (which is /Users/anita or similar). Best, Nathan On Thursday, March 18, 2021 at 9:45:12 AM UTC-5 roja...@gmail.com wrote: > Dear Samuel, > thank you very much for your help. I installed the version you told me. It > worked in the basics, so thanks! > But I still have some problems. I write them here, hoping you can help me. > Thanks in advance! > 1. I double click on SageMath icon, and it opens in a Terminal. I do not > know how to open it as a Sage notebook in > jupyter. In my macbook I run sage -n jupyter. > 2. I have some routines using the underlying GAP. They do not work here. I > tried (and fail) the following: > sage: libgap.eval('LoadPackage("kbmag")') > > fail > > Thank you very much for all your help and support. > With best regards, > Anita > > > On Thu, Mar 18, 2021 at 8:50 AM Samuel Lelièvre > wrote: > >> ¡Hola Anita! >> >> You could try the new macOS app, currently in beta testing at: >> >> https://github.com/3-manifolds/Sage_macOS/releases/ >> Let us know if it solves your problems. --Samuel >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "sage-support" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/sage-support/NletjrinNhM/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> sage-support...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/sage-support/CAEcArF18DCUC%3DhdL%2Bq%2BXC4nrcV6qhbpPiHD006d4QOxjmpic%3Dg%40mail.gmail.com >> . >> > > > -- > Anita M. Rojas > Departamento de Matemáticas > Facultad de Ciencias > Universidad de Chile > > https://sites.google.com/a/u.uchile.cl/mat-ciencias-prof-anita-rojas/ > -- 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/42cdf878-6cdc-4aaa-a462-2abe3017901bn%40googlegroups.com.
Re: [sage-support] problem compiling sage 9.2 on RHEL 6
Is there some reason you need to build from source? Last fall, I struggled without success to get Sage 9.1 to build on RHEL 6 (technically Scientific Linux 6, which is clone of RHEL), but the conda version worked fine for me on that platform: https://doc.sagemath.org/html/en/installation/conda.html Best, Nathan -- 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/4225e2cf-d872-409d-b25c-4d4b11515e9an%40googlegroups.com.
Re: [sage-support] Re: i'm having trouble installing Jupyter - the log is below. I have open ssl. it it supposed to be installed or just files?
> > *I installed the 9.2 fix. The response to the second line of the script > *I think* is telling me the quarantine attribute is not present:* > > *“No such xattr: com.apple.quarantine”* > Yes, that response is fine. It means you downloaded the file by a method which does not add that attribute. > “irashavel@Iras-MBP Downloads % /Applications/SageMath-9.2/sage -python -m > fix_mac_sage9_2.fix > > zsh: no such file or directory: /Applications/SageMath-9.2/sage > This is saying that the file "/Applications/SageMath-9.2/sage" does not exist. Likely, you want "/Applications/SageMath-9.2.app/sage". Best, Nathan > -- 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/784b1134-000b-430a-b927-f41978898afdn%40googlegroups.com.
[sage-support] Re: The pip ssl mess on Mac OS X: ways forwards
For a quick hack fix, you can use: https://github.com/3-manifolds/fix_mac_sage/ On Sunday, November 22, 2020 at 1:24:45 PM UTC-6 watso...@gmail.com wrote: > > Right now pip doesn't work in the binary distributions due to the absence > of the ssl module. This is apparently due to licensing restrictions, thanks > to the terrible license of OpenSSL. > > My suggestion is that we hack together a build curl+NSS, which is freely > redistributable. Then as part of the post-install fixup the curl grabs > OpenSSL and the ssl python module, and we run a hacky install of the local > copy with pip. Better options highly welcome. > > Sincerely, > Watson Ladd > -- 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/b25a2226-2f07-4221-b208-3c432c8ce423n%40googlegroups.com.
[sage-support] Re: Does SageMath work on Mac OS 10.14.6
On Tuesday, February 25, 2020 at 9:36:55 AM UTC-6, seriously wrote: > > Seriously, has anyone got one of the current releases of Sage to work on > any Mac platform? > > I tried several times, lately with version 8.8 for 10.14.5. I dropped the > binary in Applications. > It can start up then - it opens a browser window which just stalls; it has > a drop-down menu called "Terminal Session", > which doesn't do anything, and if I go directly into the App and execute > ./sage, all kinds of errors appear > (many about permissions) and it crashes. > > Unfortunately I want to run a program built on this platform, and really > need a working version. > Any ideas are much appreciated. > I would try this version: sage-8.9-OSX_10.14.6-x86_64.tar.bz2 (1058.94 MB) as it worked fine for me on macOS 10.14.6 using the following commands in the terminal: cd /Applications mv ~/Downloads/sage-8.9-OSX_10.14.6-x86_64.tar.bz2 . tar xf sage-8.9-OSX_10.14.6-x86_64.tar.bz2 cd SageMath ./sage Best, Nathan -- 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/93a7e77b-83fa-40f3-9687-15bd18c0cf32%40googlegroups.com.
[sage-support] Re: Help/Pointers on using docker with travis-ci
Simon, You can start a container and open a shell on it via: docker run -it image_name /bin/bash The container will keep running until you exit the shell, if not longer. You can open a shell on any running container via docker exec -it container_name /bin/bash Best, Nathan -- 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/fb382921-6576-4789-be16-6012f9dfeea2%40googlegroups.com.
Re: [sage-support] macOS Catalina
Are the SageMath app versions signed with an Apple Developer ID? If not, this strengthening of Gatekeeper may not be an issue for SageMath at all. Currently, there are three categories of Mac apps: 1) Those in the App Store, which must come from a registered Apple Developer and are reviewed by Apple before posting. 2) Those not from the App Store but that are signed by a Apple Dev ID. 3) Everything else. To run anything in this category, the user has to click various things saying it's OK to run "untrusted" code. As I understand the link, Apple is increasing their oversight in category (2): not only must the app be signed but it must be run through some automated Apple website that searches for nefarious code and adds a signed cert confirming that. But that won't change anything about category (3). Best, Nathan -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/555c2275-a37a-48a5-b9e1-1f7310589581%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: How to install Python packages into Sage using pip?
> > Is there a solution? I am using Sage on macOS (app version). > Your problem is that the Sage app distributed for macOS does not have SSL support and so pip cannot securely download the package you requested. For the fix, see here: https://groups.google.com/d/msg/sage-devel/h974Gv6kOtg/Fq49Qo3vBgAJ Best, Nathan -- 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: Sage matplotlib OSX
There are some instructions here for how to build the Tk GUI backend on macOS: https://bitbucket.org/nathan_dunfield/nplot This is distinct from the "native" macOS backend that you're trying to compile, but it works just fine in my experience. Nathan -- 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: Seaborn in sage
On Wednesday, July 27, 2016 at 3:30:47 AM UTC-5, Dima Pasechnik wrote: > > errors like you get: > > > /var/folders/md/71gv03bs6mx4qxg933r_k_x4gn/T//ccSLsnmg.s:984:suffix or > operands invalid for `movq' > > > indicate that your Sage's compiler toolchain is broken in some way, > probably incompatible with your hardware. > A way to fix this would be to build Sage from source. > I believe this issue is likely the same as: https://trac.sagemath.org/ticket/20563 As Dima says, building all of Sage from source will fix this. An quicker solution might be to make sure you installed the version of Sage from http://mirrors.mit.edu/sage/osx/intel/index.html whose label matches your version of OS X. Best, Nathan -- 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: Sage math on CentOS 6
I would like to use Sage on a large computing grid running on CentOS 6. I use Sage on a very similar cluster running another RHEL 6 clone, namely Scientific Linux 6.6. I had no issues building Sage 6.7 from source using gcc 4.6.3. Nathan -- 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] Re: Interface to Mathematica
Unfortunately, this is a known issue http://trac.sagemath.org/ticket/13892 It has to do with a change they made in Mathematica 9. Personally, my work-around is just to use Mathematica 8, though someone has proposed an actual fix that has not yet been incorporated into Sage: http://trac.sagemath.org/ticket/16703 Best, Nathan -- 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] Re: Missing library for plotting with Matplotlib (Sage package) from a Python script
Lou, I wrote some notes on using the TkAgg backend with Sage which you can find here: https://bitbucket.org/nathan_dunfield/nplot There is no need to compile all of Sage from scratch just matplotlib and (sometimes) python itself. Best, Nathan -- 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] Re: Missing library for plotting with Matplotlib (Sage package) from a Python script
We don't include tcl/tk so our binary distribution doesn't include tkinter / tkagg. If you have all build dependencies and compile from source it should work. Volker, Unlike Linux, the binary version of Sage on OS X comes with a working copy of Tkinter, though not Tkagg. I think the reason is just that OS X has always included a working copy of Tk and this is found automatically by the Python build system. Best, Nathan -- 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] Re: Newton Polygons
Are there any Sage functions and/or classes for computing Newton Polygons? Yes there are, here's some quick examples. sage: R.x,y = PolynomialRing(QQ) sage: p = 1 + x + y + x^2*y sage: P = p.newton_polytope() sage: P.vertices() [[2, 1], [1, 0], [0, 1], [0, 0]] sage: P.show() # picture of newton polytope appears in web browser sage: R.u,v,w = PolynomialRing(QQ) sage: p = (1 + u)*(1 + v)*(1 + w) sage: P. Display all 149 possibilities? (y or n) sage: P = p.newton_polytope() sage: P.show() # cube appears in JMol -- 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: noncommutative polynomials and free differential calculus
On Aug 13, 10:39 am, Nicholas Jackson nicholas.jack...@warwick.ac.uk wrote: I'm trying to use SnapPy [1] to calculate Alexander polynomials of knot complements. Nicholas, You can find code I wrote to compute the Alexander polynomial using a mix of Sage and Magma here: http://dunfield.info/fibered-faces/ If you don't have Magma, it shouldn't be too hard to port what's in alexander.magma into Sage, and indeed this would be a worthwhile project. As you can see from the code there, it is possible to avoid actually using noncommutative rings, so there's no need to create them. (Even if you really want to compute twisted Alexander polynomials this can still be avoided.) Just yesterday I wrote Sage code for one thing you'll need --- computing the free abelianization of the fundamental group of the knot complement. It's below. Best, Nathan --- import os, sys, re, string import snappy import sage from sage.all import Integers, vector, matrix # # # Abelianization of the fundamental group # # ZZ = Integers() def abelianize_word(word, gens): return vector(ZZ, [ word.count(g) - word.count(g.swapcase()) for g in gens]) class MapToFreeAbelianization(sage.structure.sage_object.SageObject): def __init__(self, fund_group): self.domain_gens = fund_group.generators() R = matrix(ZZ, [abelianize_word(R, self.domain_gens) for R in fund_group.relators()]).transpose() D, U, V = R.smith_form() self.U = U self.elementry_divisors = [D[i,i] for i in range(D.ncols())] + [0,]*(D.nrows() - D. ncols()) def range(self): return ZZ**self.elementry_divisors.count(0) def __call__(self, word): D = self.elementry_divisors v = self.U*abelianize_word(word, self.domain_gens) return vector(ZZ, [v[i] for i in range(len(D)) if D[i] == 0]) # Sample function using this def homological_longitude(manifold, cusp=0): G = manifold.fundamental_group() f = MapToFreeAbelianization(G) m, l = G.peripheral_curves()[cusp] kernel_basis = matrix(ZZ, [f(m), f(l)]).left_kernel().basis() assert len(kernel_basis) 2 if len(kernel_basis) == 0: return None return kernel_basis[0] --~--~-~--~~~---~--~~ 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: noncommutative polynomials and free differential calculus
On Aug 14, 7:54 am, Nathan Dunfield nat...@dunfield.info wrote: You can find code I wrote to compute the Alexander polynomial using a mix of Sage and Magma here: http://dunfield.info/fibered-faces/ If you don't have Magma, it shouldn't be too hard to port what's in alexander.magma into Sage, and indeed this would be a worthwhile project. I just realized that the code I referred to above used the old Python- SnapPea inverface, not SnapPy. Below is a code snippet for using alexander.magma with Sage and SnapPy. An usage example: sage: attach alexander.py sage: M = snappy.Manifold(8^2_4) sage: alexander_polynomial(M) a^5 + 2*a^4 - 2*a^3*b + a^2*b^2 + a^3 - 2*a^2*b + 2*a*b^2 + b^2 Best, Nathan Contents of alexander.py- import os, sys, re, string, snappy # # # Computing Alexander polynomials via Magma # # magma.load(alexander.magma) magma.eval( DeconstructPolynomial := function(p) return [Exponents(m) : m in Monomials(p)], Coefficients(p); end function; ) def sage_poly_from_magma(poly): exponents, coeffs = poly.DeconstructPolynomial(nvals=2) exponents, coeffs = exponents.sage(), coeffs.sage() n = len(exponents[0]) R = PolynomialRing(Rationals(), list(string.lowercase[:n])) gens = R.gens() def make_term(exp, c): ans = c for i in range(len(exp)): ans = ans * gens[i]**exp[i] return ans return sum( [ make_term(exponents[i], coeffs[i]) for i in range(len (exponents))]) def alexander_polynomial(manifold): G = manifold.fundamental_group() if len(G.generators()) == 1 and len(G.relators()) == 0: return PolynomialRing(ZZ, a)(1) G = magma(manifold.fundamental_group()) return sage_poly_from_magma(G.AlexanderPolynomial()) --~--~-~--~~~---~--~~ 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: noncommutative polynomials and free differential calculus
I went ahead and did a quick port of my Magma code over to Sage --- I'm trying to wean myself of Magma as much as possible. You can find it as the file alexander.py at http://dunfield.info/snappea/ Example usage: sage: import snappy sage: from alexander import alexander_polynomial sage: M = snappy.Manifold('m004') sage: alexander_polynomial(M) -a^2 + 3*a - 1 sage: M = snappy.Manifold('v3551') sage: alexander_polynomial(M) a^4*b^4 + a^4*b^3 + a^3*b^4 + a^4*b^2 + 2*a^3*b^3 + a^2*b^4 + 2*a^3*b^2 + 2*a^2*b^3 + a^3*b + 2*a^2*b^2 + a*b^3 + 2*a^2*b + 2*a*b^2 + a^2 + 2*a*b + b^2 + a + b + 1 Best, Nathan --~--~-~--~~~---~--~~ 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: Installing SnapPy in SAGE
Here's how to install SnapPy on the VMWare version of SAGE; you have to do a little hack to account for the fact that certain header files are missing. wget -nd http://www.math.uic.edu/~t3m/SnapPy/SnapPy.tar.gz tar xfz SnapPy.tar.gz; cd SnapPy sudo sage -python -m easy_install -U cython sudo sage -python -m easy_install -U sphinx # Edit line 207 of setup.py to read: ext_modules = [SnapPyC], sudo sage -python setup.py install sudo sage -python setup.py build_docs install cd ../; sage # test -- | Sage Version 4.0, Release Date: 2009-05-29 | | Type notebook() for the GUI, and license() for information.| -- sage: import snappy sage: M = snappy.Manifold('m004') sage: M.volume() 2.0298832128193069 sage: [C.homology() for C in M.covers(8, method='gap')] [Z/21 + Z/105 + Z, Z/30 + Z, Z/30 + Z, Z/3 + Z/3 + Z + Z, Z/3 + Z + Z, Z/3 + Z/3 + Z + Z, Z/3 + Z + Z, Z/3 + Z/3 + Z + Z, Z/5 + Z + Z, Z + Z] SnapPy does have some Sage specific features as you can see above. I plan on making an spkg for it eventually. Best, Nathan --~--~-~--~~~---~--~~ 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: Picture re: Notebook browser issues in OSX.4
I hope sending this works. Should be a picture of wacky behavior. I don't know whether this is a PowerPC issue or not, but in the past there have been differences, so I wouldn't be surprised. Maybe it is PPC issue --- I can't duplicate this on OSX.4/Intel with Firefox 2.0.0.13 and indeed I can't even get there to be a horizontal scrollbar at the bottom unless I have the window only 100 pixels wide or so. Best, Nathanwww.sage --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Picture re: Notebook browser issues in OSX.4
An easy way to make the scrollbar appear without narrowing the window is to have an error message that you didn't bother to clear. It's true that it could be a PPC issue, but just thought I'd throw it out there. I did download 2.0.0.13, and it stills happens, unfortunately, so it's not necessarily Firefox (though it could be). Ah, ok, now that I can create a horizontal scroll-bar, I can duplicate this problem on OS X.4/Intel with Firefox 2.0.0.13. So it's not a processor issue. Unsurprisingly, Camino 1.5.5 has the same problem. Nathan --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---