Skip to content

Allow passing elements to OperationTable not closed under operation#40108

Merged
vbraun merged 11 commits intosagemath:developfrom
venczelzs:operation_table_elems_not_closed
Dec 29, 2025
Merged

Allow passing elements to OperationTable not closed under operation#40108
vbraun merged 11 commits intosagemath:developfrom
venczelzs:operation_table_elems_not_closed

Conversation

@venczelzs
Copy link
Copy Markdown
Contributor

@venczelzs venczelzs commented May 15, 2025

Use the new parameter closed in OperationTable.__init__ to allow generating an operation table if the argument elements is passed and those elements are not necessarily closed under the operation.

A motivating example of usage is to quickly check if the product of two 4-cycles can be a 3-cycle:

sage: S4 = SymmetricGroup(4)
sage: a = S4([(1,2,3,4)])
sage: L = [g for g in a.conjugacy_class()]
sage: from sage.matrix.operation_table import OperationTable
sage: T = OperationTable(S4, operation=operator.mul, elements=L, names='elements', closed=False)
sage: T
         *   (1,2,3,4)  (1,2,4,3)  (1,3,2,4)  (1,3,4,2)  (1,4,2,3)  (1,4,3,2)
          +------------------------------------------------------------------
 (1,2,3,4)| (1,3)(2,4)    (1,4,2)    (1,4,3)    (2,4,3)    (1,3,2)         ()
 (1,2,4,3)|    (1,3,2) (1,4)(2,3)    (1,4,2)         ()    (1,3,4)    (2,3,4)
 (1,3,2,4)|    (1,4,2)    (2,3,4) (1,2)(3,4)    (1,4,3)         ()    (1,2,3)
 (1,3,4,2)|    (1,4,3)         ()    (1,2,3) (1,4)(2,3)    (2,4,3)    (1,2,4)
 (1,4,2,3)|    (2,4,3)    (1,3,2)         ()    (1,2,4) (1,2)(3,4)    (1,3,4)
 (1,4,3,2)|         ()    (1,3,4)    (2,3,4)    (1,2,3)    (1,2,4) (1,3)(2,4)

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

venczelzs added 8 commits May 13, 2025 22:36
Use the new parameter `closed` in OperationTable.__init__ with default
value False to allow generating an operation table if the argument
`elements` is passed and those elements are not necessarily closed
under the operation.
@venczelzs venczelzs changed the title Allow passing elements to OperationTable that are not closed under operation Allow passing elements to OperationTable not closed under operation May 28, 2025
@venczelzs venczelzs marked this pull request as ready for review May 28, 2025 10:25
Comment thread src/sage/matrix/operation_table.py Outdated
Comment thread src/sage/matrix/operation_table.py
Comment thread src/sage/matrix/operation_table.py Outdated
Comment thread src/sage/matrix/operation_table.py
Comment thread src/sage/matrix/operation_table.py
Comment thread src/sage/matrix/operation_table.py
Comment thread src/sage/matrix/operation_table.py Outdated
Comment thread src/sage/matrix/operation_table.py
Comment thread src/sage/matrix/operation_table.py
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 15, 2025

Documentation preview for this PR (built with commit d039d62; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@venczelzs venczelzs requested a review from kwankyu December 20, 2025 21:43
@venczelzs
Copy link
Copy Markdown
Contributor Author

Hi @kwankyu, thank you for your comments! I updated the PR, could you please take a look at it?

Copy link
Copy Markdown
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vbraun vbraun merged commit f0711cc into sagemath:develop Dec 29, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants