Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert chain complexes from Macaulay2 to Sage #28591

Closed
mwageringel opened this issue Oct 11, 2019 · 31 comments
Closed

convert chain complexes from Macaulay2 to Sage #28591

mwageringel opened this issue Oct 11, 2019 · 31 comments

Comments

@mwageringel
Copy link

This ticket implements conversion of chain complexes from Macaulay2 to Sage, for example:

            sage: R = ZZ['a,b,c']
            sage: C = macaulay2(ideal(R.gens())).resolution()
            sage: unicode_art(C.sage())
                                   ⎛-b  0 -c⎞     ⎛ c⎞
                                   ⎜ a -c  0⎟     ⎜ a⎟
                       (a b c)     ⎝ 0  b  a⎠     ⎝-b⎠
             0 ⟵── C_0 ⟵────── C_1 ⟵───────── C_2 ⟵─── C_3 ⟵── 0

This ticket also fixes an issue where matrices of size 0×n failed to convert correctly.

Depends on #28566

CC: @saliola @dimpase @antonleykin

Component: interfaces: optional

Keywords: macaulay2, IMA Coding Sprint

Author: Markus Wageringel

Branch/Commit: adb0a1a

Reviewer: Frédéric Chapoton, Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/28591

@mwageringel mwageringel added this to the sage-9.0 milestone Oct 11, 2019
@mwageringel
Copy link
Author

Dependencies: #28566

@mwageringel
Copy link
Author

comment:1

With this, we could add a method resolution(algorithm=macaulay2) to ideals.


New commits:

03d146028566: implement _matrix_() in Macaulay2 interface
5308c9028566: implement conversion of vectors in Macaulay2 interface
602f6eb28566: preserve variable name in Macaulay2 Galois fields
ce24186simplify some doctests
21025bd28566: use ring-preserving constructor for Macaulay2 matrix/vector
0d702f628591: conversion of chain complexes from Macaulay2 to Sage

@mwageringel
Copy link
Author

Commit: 0d702f6

@mwageringel
Copy link
Author

Author: Markus Wageringel

@mwageringel
Copy link
Author

Branch: u/gh-mwageringel/28591

@fchapoton
Copy link
Contributor

comment:2

you need to add the standard utf8 encoding line at the top of

src/sage/interfaces/macaulay2.py

namely

# -*- coding: utf-8 -*-

@fchapoton
Copy link
Contributor

comment:3

and an optional tag is missing here:

src/sage/interfaces/macaulay2.py", line 1554

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 15, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a4c6c0d28591: conversion of chain complexes from Macaulay2 to Sage

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 15, 2019

Changed commit from 0d702f6 to a4c6c0d

@mwageringel
Copy link
Author

comment:5

Thank you for catching that. It should be fixed now.

@fchapoton
Copy link
Contributor

comment:6

ok, let it be

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@vbraun
Copy link
Member

vbraun commented Oct 15, 2019

comment:7

Merge conflict

@dimpase
Copy link
Member

dimpase commented Oct 15, 2019

comment:8

I guess this got to wait till next beta.

@dimpase
Copy link
Member

dimpase commented Oct 22, 2019

comment:9

rebased - it was conflicting with M2 Graphs interface


New commits:

d58f0b328591: conversion of chain complexes from Macaulay2 to Sage

@dimpase
Copy link
Member

dimpase commented Oct 22, 2019

Changed branch from u/gh-mwageringel/28591 to public/interfaces/28591

@dimpase
Copy link
Member

dimpase commented Oct 22, 2019

Changed commit from a4c6c0d to d58f0b3

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 22, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

e40eb60make tests more foolproof.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 22, 2019

Changed commit from d58f0b3 to e40eb60

@dimpase
Copy link
Member

dimpase commented Oct 22, 2019

Changed reviewer from Frédéric Chapoton to Frédéric Chapoton, Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Oct 22, 2019

comment:11

back to the bots

@vbraun
Copy link
Member

vbraun commented Oct 26, 2019

comment:12

The pdf docs don't build

[docpdf] ! Package inputenc Error: Unicode character ⟵ (U+27F5)
[docpdf] (inputenc)                not set up for use with LaTeX.
[docpdf] 
[docpdf] See the inputenc package documentation for explanation.
[docpdf] Type  H <return>  for immediate help.
[docpdf]  ...                                              
[docpdf]                                                   
[docpdf] l.8925 ...}2 ⟵─── C\PYGZus{}3 ⟵── 0}
[docpdf]                                                   
[docpdf] ? 
[docpdf] ! Emergency stop.

@fchapoton
Copy link
Contributor

comment:13

maybe use ascii_art instead for the moment ?

@dimpase
Copy link
Member

dimpase commented Oct 27, 2019

comment:14

this looks like wrong _ symbol...

@dimpase
Copy link
Member

dimpase commented Oct 27, 2019

comment:15

no, sorry, that's fine. Why not just add convesrion of U+27F5 the way it's done for several other UTF characters? (There is a place where these translations are set, but I can't recall where...)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

adb0a1a28591: replace unicode by ascii art in chain complex tests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Changed commit from e40eb60 to adb0a1a

@mwageringel
Copy link
Author

comment:17

The correct place for that seems to be src/sage/docs/conf.py, but I am not sure what the correct latex code would be to make the arrows line up correctly. I switched to using ascii_art instead, as the use of unicode is not essential here. Now, both the pdf and html docs build, on my end.

@dimpase
Copy link
Member

dimpase commented Oct 27, 2019

comment:19

OK, this works (in pdf docs too).

@mwageringel
Copy link
Author

comment:20

Thank you.

@vbraun
Copy link
Member

vbraun commented Oct 28, 2019

Changed branch from public/interfaces/28591 to adb0a1a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants