Skip to content

Integrating_M2_and_Sage

Mahrud Sayrafi edited this page Mar 12, 2021 · 1 revision

title: Integrating M2 and Sage permalink: wiki/Integrating_M2_and_Sage/ layout: wiki

Visit Sage homepage for more information on it. There are links in its top-right corner to public notebook servers allowing you to use Sage without actually installing it.

Initial stage and some noticed bugs.

  1. Macaulay2 via Sage notebook. Noticed problems: "help matrix" seems to break the interaction at the beginning of examples, completion does not include functions from loaded packages.
  2. Macaulay2 via Sage command macaulay2("Macaulay2-code"). Noticed problems: "help matrix" still breaks the interaction.
  3. Specialized commands:
    1. macaulay2.help("matrix") works fine.
    2. S = macaulay2.ring('ZZ/101', '[t_1 .. t_9, u_1 .. u_9]') does not work, error message contains IN:sage0=ZZ/101[symbol t..symbol 9, MonomialSize=>16, MonomialOrder=>Lex];
    3. S = macaulay2("ZZ/101[t_1 .. t_9, u_1 .. u_9]") does work and prints S as a polynomial ring, but view(S) typesets "sage1"
    4. For a matrix m[1,2] does not work.
    5. completion for Macaulay2 objects does not include functions from loaded packages, but does include all the other stuff, including irrelevant.

Goals.

  1. Fix some bugs.
  2. Make smart completion: show only usable methods and show methods from loaded packages. (Cache results between sections if this is taking too long?)
  3. Make a wrapper for NormalToricVariety allowing work without explicit usage of Macaulay2 commands.

Results.

  1. Productive discussions!
  2. Fixed an interface bug with long input. 1
  3. Fixed an interface bug with returns from Macaulay2 help command. 2
  4. Fixed an interface bug related to comment lines. 3
  5. Made the interface more robust. In particular, two bugs above disappear. 4
  6. Dynamic -completion works: new methods become visible and only usable methods are visible for objects. 5

Demo worksheets.

These are the worksheets (sws links) from the last day presentation and their printouts (pdf links), which do not look quite as good as actual worksheets.

  • Using Macaulay2 inside of Sage notebook: sws pdf
  • Using Macaulay2 from Sage code for real interaction: sws pdf
Clone this wiki locally