Skip to content

Fix #1003: sinm and cosm can accept list as arguments, similar to expm and other functions#1006

Merged
skirpichev merged 5 commits into
mpmath:masterfrom
baranwalayush:fix/list_as_argument
Oct 8, 2025
Merged

Fix #1003: sinm and cosm can accept list as arguments, similar to expm and other functions#1006
skirpichev merged 5 commits into
mpmath:masterfrom
baranwalayush:fix/list_as_argument

Conversation

@baranwalayush

Copy link
Copy Markdown
Contributor
  • fix sinm() and cosm() don't accept list or int arguments. #1003
  • While solving this issue, I came across a very subtle problem, that when the input matrix to expm(), cosm() and sinm() is a non-square matrix, the error is thrown from the expm() when it calls the __pow__() inside it, which is not very readable and also exposes the inner working of expm(). I have fixed this too, by having a separate check for non-square matrix.
  • Add test case for the same

@skirpichev skirpichev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I came across a very subtle problem, that when the input matrix to expm(), cosm() and sinm() is a non-square matrix, the error is thrown from the expm()

I think that is fine.

That part was reverted and tests slightly simplified. LGTM.

@skirpichev skirpichev merged commit 0d8b0e0 into mpmath:master Oct 8, 2025
15 checks passed
@skirpichev skirpichev added this to the 1.4 milestone Oct 12, 2025
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.

sinm() and cosm() don't accept list or int arguments.

2 participants