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

Changed to MatrixBase from Matrix #14698

Merged
merged 3 commits into from
May 5, 2018

Conversation

kyamaz
Copy link
Contributor

@kyamaz kyamaz commented May 4, 2018

References to other Issues or PRs

fixes #14696

Brief description of what is fixed or changed

Replaced Matrix in physics.quantum.matrixutils by MatrixBase which is a common superclass of all SymPy matrices.

Other comments

Copy link
Member

@sidhantnagpal sidhantnagpal left a comment

Choose a reason for hiding this comment

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

It would be good to include the test mentioned in the referenced issue, and additional tests if required.

@kyamaz
Copy link
Contributor Author

kyamaz commented May 4, 2018

I think I have fixed it and added test.

u1 = X(0) + UGate(0, uMat1)
assert represent(u1, nqubits=2) == cMat1

uMat2 = ImmutableMatrix([[1/sqrt(2),1/sqrt(2)],[I/sqrt(2),-I/sqrt(2)]])
Copy link
Member

Choose a reason for hiding this comment

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

Do add spaces after commas throughout the function, otherwise looks fine.

@jksuom
Copy link
Member

jksuom commented May 5, 2018

Thank you, this looks good.

@jksuom jksuom merged commit 14307a9 into sympy:master May 5, 2018
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.

error in calculating between an UGate operator and well-defined Unitary operators.
4 participants