Skip to content

Fix bug in HNF for non-commutative rings - #488

Merged
perlinm merged 1 commit into
mainfrom
howell
May 16, 2026
Merged

Fix bug in HNF for non-commutative rings#488
perlinm merged 1 commit into
mainfrom
howell

Conversation

@perlinm

@perlinm perlinm commented May 16, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Comment on lines +1827 to +1830
# pad with zero rows on the bottom to ensure that all blocks have the correct size
if tail := matrix.shape[0] % size:
zero_rows = np.zeros((size - tail, num_cols), dtype=int)
matrix = np.vstack([matrix, zero_rows]).view(field)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the critical step that was missing before, causing the last row to sometimes be removed.

@perlinm
perlinm merged commit b61d800 into main May 16, 2026
3 checks passed
@perlinm
perlinm deleted the howell branch May 16, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant