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

add hermitian_decomposition method #39200

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

jacksonwalters
Copy link
Contributor

@jacksonwalters jacksonwalters commented Dec 24, 2024

Given a Hermitian matrix $U$ over $GF(q^2)$, returns a matrix $A$ such that $U = AA^\ast$, where $^\ast$ denotes conjugate-transpose.

Note that the Cholesky decomposition is meant for characteristic zero, and also only returns a lower/upper triangular matrix.

📝 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

Copy link

github-actions bot commented Dec 26, 2024

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

@jacksonwalters jacksonwalters closed this by deleting the head repository Dec 26, 2024
@jacksonwalters jacksonwalters force-pushed the hermitian_decomposition branch from caed579 to f2f35b7 Compare December 27, 2024 14:38
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
src/sage/matrix/matrix2.pyx Outdated Show resolved Hide resolved
@tscrim
Copy link
Collaborator

tscrim commented Dec 30, 2024

I really dislike these apply-suggestion-commits with a completely useless commit message. Could you please squash and rebase? It makes it easier to see which changes have been done and looking through the logs much later.

add hermitian_decomposition method

given a Hermitian matrix U, returns a matrix A such that U = AA*

use translated GAP source code for BaseChangeCanonical

Co-Authored-By: Travis Scrimshaw <[email protected]>
@jacksonwalters jacksonwalters force-pushed the hermitian_decomposition branch from 6300bae to a8cd89e Compare December 30, 2024 00:54
@jacksonwalters
Copy link
Contributor Author

Sure. I agree, the commit messages are pretty useless. I've squashed the commits here. Which branch should I rebase on? I rebased PR#38455 on this one (PR#39200) already.

@tscrim
Copy link
Collaborator

tscrim commented Dec 30, 2024

Thanks. Sorry, I misspoke slightly, I meant force-push.You will need to rebase #38455 again though…

@jacksonwalters
Copy link
Contributor Author

@tscrim Okay, I have rebased #38455 on this again and attempted to resolve merge conflicts.

@jacksonwalters
Copy link
Contributor Author

I don't think this handles the 1x1 case, so I'll add a fix.

@jacksonwalters
Copy link
Contributor Author

@tscrim How do I squash these commits given there's a merge commit? We may've done this before, but I don't see how.

@tscrim
Copy link
Collaborator

tscrim commented Jan 4, 2025

I would just rebase the entire branch over the latest develop branch and squash commits as reasonable.

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

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

Just a few more details, modulo making row 0-based.


A = B^* B,

where `B^\ast` is the conjugate-transpose.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
where `B^\ast` is the conjugate-transpose.
where `B^*` is the conjugate-transpose.

Let's be consistent. ;)


A conjugate-symmetric version of Gaussian elimination.
This is a translation of ``BaseChangeToCanonical`` from
the GAP ``forms`` for a Hermitian form.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
the GAP ``forms`` for a Hermitian form.
the GAP ``forms`` package for a Hermitian form.

row += 1

# Look for a non-zero element on the main diagonal, starting from `row`
i = row - 1 # Adjust for zero-based indexing in Sage
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is possible as we mutate i compared to row.

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.

2 participants