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

Graph.{[weighted_]adjacency_matrix,kirchhoff_matrix}: Support constructing End(CombinatorialFreeModule) elements #37955

Merged
merged 11 commits into from
May 12, 2024

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented May 7, 2024

This is a follow-up after

... to cover a few more methods. The methods can now create endomorphisms of free modules whose bases are indexed by the vertices. To help with this, we make the matrix constructor a bit more flexible.

This is also preparation for making the spectral graph theory methods ready for CombinatorialFreeModule:

📝 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

@mkoeppe mkoeppe self-assigned this May 7, 2024
@mkoeppe mkoeppe changed the title Graph.{[weighted_]adjacency_matrix,kirchhoff_matrix}: Support constructing Hom(CombinatorialFreeModule) elements Graph.{[weighted_]adjacency_matrix,kirchhoff_matrix}: Support constructing Hom(CombinatorialFreeModule) elements May 7, 2024
Copy link

github-actions bot commented May 8, 2024

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

@mkoeppe mkoeppe requested review from tscrim and dcoudert May 8, 2024 01:10
@mkoeppe mkoeppe changed the title Graph.{[weighted_]adjacency_matrix,kirchhoff_matrix}: Support constructing Hom(CombinatorialFreeModule) elements Graph.{[weighted_]adjacency_matrix,kirchhoff_matrix}: Support constructing End(CombinatorialFreeModule) elements May 8, 2024
src/sage/graphs/generic_graph.py Show resolved Hide resolved
def _vertex_indices_and_keys(self, vertices=None, *, sort=None):
r"""
Process a ``vertices`` parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

May be you could add that this is a helper function for methods like adjacency_matrix, kirchhoff_matrix, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done in 98323cb

Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

LGTM.

I assume that if needed we can change the name of the new method. I don't have better option in mind.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented May 10, 2024

Thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request May 11, 2024
…x}`: Support constructing `End(CombinatorialFreeModule)` elements

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

This is a follow-up after
- sagemath#37692

... to cover a few more methods. The methods can now create
endomorphisms of free modules whose bases are indexed by the vertices.
To help with this, we make the `matrix` constructor a bit more flexible.

This is also preparation for making the spectral graph theory methods
ready for `CombinatorialFreeModule`:
- sagemath#37943

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] 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

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37955
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request May 12, 2024
…x}`: Support constructing `End(CombinatorialFreeModule)` elements

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

This is a follow-up after
- sagemath#37692

... to cover a few more methods. The methods can now create
endomorphisms of free modules whose bases are indexed by the vertices.
To help with this, we make the `matrix` constructor a bit more flexible.

This is also preparation for making the spectral graph theory methods
ready for `CombinatorialFreeModule`:
- sagemath#37943

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] 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

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37955
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
@vbraun vbraun merged commit feba57a into sagemath:develop May 12, 2024
16 checks passed
@mkoeppe mkoeppe added this to the sage-10.4 milestone May 12, 2024
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