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

Make .coxeter_matrix() return a CoxeterMatrix for coxeter3-implemented groups #30237

Closed
cemulate opened this issue Jul 28, 2020 · 28 comments
Closed

Comments

@cemulate
Copy link

This patch fixes all of the following, which currently throw errors:

W = CoxeterGroup(['B', 3], implementation='coxeter3')
W.coxeter_type()
# AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_dense' object has no attribute 'coxeter_type'
W([1,2,1]).reduced_words()
# IndexError: matrix index out of range
R.<v> = LaurentPolynomialRing(ZZ)
IwahoriHeckeAlgebra(W, v, -1/v)
# AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_dense' object has no attribute 'coxeter_type'

The underlying problem in all cases is that W.coxeter_matrix() does not return a CoxeterMatrix; I've altered this to return the (correctly indexed) coxeter matrix and added a test.

This also removes a completely unused function CoxeterGroup.m(i, j) which seemingly existed only to workaround the fact that .coxeter_matrix() was incorrectly indexed (and in fact is ill-founded, it would cause an error on a group with affine Cartan type). This removal breaks no tests in libs/coxeter3.

Component: combinatorics

Keywords: CoxeterGroup, CoxeterMatrix, coxeter, coxeter3

Author: Chase Meadors

Branch/Commit: bd9b5c6

Reviewer: Travis Scrimshaw

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

@cemulate cemulate added this to the sage-9.2 milestone Jul 28, 2020
@cemulate
Copy link
Author

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 28, 2020

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

c1b4446Add test

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 28, 2020

Commit: c1b4446

@cemulate

This comment has been minimized.

@cemulate
Copy link
Author

New commits:

c1b4446Add test

@cemulate
Copy link
Author

Changed keywords from none to CoxeterGroup, CoxeterMatrix, coxeter, coxeter3

@cemulate
Copy link
Author

Author: Chase Meadors

@cemulate cemulate changed the title coxeter3-matrix-cleanup Make .coxeter_matrix() return a CoxeterMatrix for coxeter3-implemented groups Jul 28, 2020
@tscrim
Copy link
Collaborator

tscrim commented Jul 30, 2020

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Jul 30, 2020

comment:4

The m() method might not be used in the code, but some user might be using it in their personal code. You should issue a deprecation instead with the appropriate redirect:

from sage.misc.superseded import deprecation
deprecation(30237, "the .m(i, j) method has been deprecated; instead use .coxeter_matrix()[i,j]")

or whatever message is appropriate.

Other than that, LGTM.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

Changed commit from c1b4446 to d5a7473

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

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

d5a7473Add deprecation for removed method.

@cemulate
Copy link
Author

comment:6

Done.

@tscrim
Copy link
Collaborator

tscrim commented Jul 30, 2020

comment:7

It needs to be doctested with a docstring as well.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

Changed commit from d5a7473 to bc2e1d1

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

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

bc2e1d1Add doctests for deprecated method.

@cemulate
Copy link
Author

comment:9

Ah, sorry, wasn't sure if that needed to be done in this case. It's there now.

@tscrim
Copy link
Collaborator

tscrim commented Jul 30, 2020

comment:10

Can you quickly add a docstring just saying This is deprecated, use ``self.coxeter_matrix()[i,j]`` instead.?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

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

86fd6ecAdd docstring for deprecated method.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

Changed commit from bc2e1d1 to 86fd6ec

@cemulate
Copy link
Author

comment:12

Done.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

Changed commit from 86fd6ec to c55ec05

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 30, 2020

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

c55ec05Mark other doctest line optional.

@tscrim
Copy link
Collaborator

tscrim commented Jul 30, 2020

comment:14

Sorry, one last thing. It needs to actually have the same result/behavior as before.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 31, 2020

Changed commit from c55ec05 to bd9b5c6

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 31, 2020

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

bd9b5c6Make deprecated method have same behavior.

@cemulate
Copy link
Author

comment:16

I hope I understood correctly; I made it have the same behavior as before by "fixing" it; should it instead have the same implementation as before (which would cause the old doctests to throw errors)? Thanks for guiding me through the protocol here, by the way.

@tscrim
Copy link
Collaborator

tscrim commented Jul 31, 2020

comment:17

Perfect, thank you.

@vbraun
Copy link
Member

vbraun commented Aug 10, 2020

Changed branch from u/gh-cemulate/coxeter3_matrix_cleanup to bd9b5c6

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

3 participants