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

Mobius matrices of posets are integer matrices #10670

Closed
fchapoton opened this issue Jan 21, 2011 · 20 comments
Closed

Mobius matrices of posets are integer matrices #10670

fchapoton opened this issue Jan 21, 2011 · 20 comments

Comments

@fchapoton
Copy link
Contributor

I have noticed the following problem.

P=Posets.PentagonPoset()
P.mobius_function_matrix().parent()
Full MatrixSpace of 5 by 5 sparse matrices over Rational Field

The Mobius function of a poset should really be an integer matrix. This can be achieved by using change_ring :

P.mobius_function_matrix().change_ring(ZZ).parent()
Full MatrixSpace of 5 by 5 sparse matrices over Integer Ring

The patch does this by default. It also adds optional arguments to choose sparse/dense and the base ring. Same thing for lequal_matrix.
It also makes sure those matrices are immutable, and improves a bit the redefinition of .mobius_function when the mobius function has been calculated.

Apply:

Depends on #10998

CC: @fchapoton @sagetrac-sage-combinat

Component: combinatorics

Keywords: poset, matrix, Cernay2012

Author: Frédéric Chapoton, Florent Hivert

Reviewer: Florent Hivert, Nicolas M. Thiéry

Merged: sage-5.0.beta5

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

@fchapoton

This comment has been minimized.

@fchapoton
Copy link
Contributor Author

Author: chapoton

@fchapoton

This comment has been minimized.

@fchapoton

This comment has been minimized.

@hivert
Copy link

hivert commented Jun 2, 2011

comment:6

Hi Frédéric,

Thanks for taking care of this problem.

Here are a few remarks:

  • The field Author below is used to give credits after each release. You
    should put your real name here and not your login.

  • If you think returning a matrix over QQ is a bug, then you should
    make sure by a doctest that the bug is indeed fixed, indicating in comment
    the ticket number for this bug.

  • I can easily imagine use cases where the Moebius function is needed over a
    different ring (eg: Z2 or a polynomial field). What about having an
    optional argument ring with a default value ZZ to avoid
    changing the ring twice ? In this case for consistency,
    .mobius_function_matrix() should also take this optional parameter too.
    What do you think ?

Right now, I'm having lunch, but I'll probably find the time to post a review
patch this evening if you don't beat me. If you start working on it please put
a message here so that we avoid doing it twice. Of course I'll do the same. In
any case one of us will have to do some review and the other to write some
code.

Florent

@hivert
Copy link

hivert commented Jun 2, 2011

Reviewer: Florent Hivert

@hivert
Copy link

hivert commented Jun 2, 2011

Changed author from chapoton to Frédéric Chapoton

@hivert
Copy link

hivert commented Jun 2, 2011

comment:7

Right now, I'm having lunch, but I'll probably find the time to post a review
patch this evening if you don't beat me. If you start working on it please put
a message here so that we avoid doing it twice. Of course I'll do the same. In
any case one of us will have to do some review and the other to write some
code.

I'm on It. Please don't touch anything !

@hivert
Copy link

hivert commented Jun 2, 2011

Dependencies: #10998

@hivert
Copy link

hivert commented Jun 2, 2011

Changed author from Frédéric Chapoton to Frédéric Chapoton, Florent Hivert

@hivert
Copy link

hivert commented Jun 2, 2011

comment:8

I reworked the patch. Unfortunately on the way I got a dependency on #10998

Florent

@hivert

This comment has been minimized.

@fchapoton
Copy link
Contributor Author

comment:9

Trying to help the build bot to do its job

Apply trac_10670_integral_mobius_matrix_for_posets-fh.patch

@hivert hivert self-assigned this Dec 3, 2011
@hivert
Copy link

hivert commented Feb 6, 2012

Changed keywords from poset, matrix to poset, matrix, Cernay2012

@nthiery
Copy link
Contributor

nthiery commented Feb 8, 2012

Changed reviewer from Florent Hivert to Florent Hivert, Nicolas M. Thiéry

@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor

nthiery commented Feb 8, 2012

comment:13

We finalized the patch together with Florent.
Positive review on the version I just uploaded, assuming the test pass (I am running them).

@nthiery
Copy link
Contributor

nthiery commented Feb 9, 2012

comment:14

Except for a timeout in sage/sandpiles/sandpile.py, all tests passed on sage-5.0.beta2 with the following patches applied::

trac_11003-folded.patch
trac_10998-categories-posets-nt.patch
trac_10670_integral_mobius_matrix_for_posets-fh.patch
trac_11382-subposet_to_vertex_speedup-fh.patch
trac_12476-lattice_join_matrix_speedup-fh.patch
trac_11118-finite_enumset_list_cache-fh.patch

Setting a positive review. Thanks Frédéric and Florent!

@nthiery nthiery added this to the sage-5.0 milestone Feb 9, 2012
@jdemeyer
Copy link

comment:15

Attachment: trac_10670_integral_mobius_matrix_for_posets-fh.patch.gz

@jdemeyer
Copy link

Merged: sage-5.0.beta5

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