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

Use CSR as default for expand_operator #227

Merged
merged 4 commits into from
Apr 3, 2024

Conversation

BoxiLi
Copy link
Member

@BoxiLi BoxiLi commented Dec 18, 2023

Transform the qobj to CSR only if it is Dense, in case more data types are introduced in the future.

@BoxiLi BoxiLi added this to the qutip-qip-0.3.1 milestone Dec 18, 2023
Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Could we add a small test for this? E.g. check that a Dense operator really is expanded to a CSR? Otherwise looks good.

Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Thanks for adding the test.

Why were the qiskit tests removed?

src/qutip_qip/operations/gates.py Show resolved Hide resolved
@BoxiLi
Copy link
Member Author

BoxiLi commented Feb 12, 2024

Deleting qiskit_test was a mistake

@BoxiLi
Copy link
Member Author

BoxiLi commented Feb 12, 2024

And maybe I should make the same change to the function in qutip-v5 .
https://github.com/qutip/qutip/blob/fcb4117c25e22fe2f553a3bd6d0eda6458f6ff12/qutip/core/tensor.py#L416

@hodgestar
Copy link
Contributor

And maybe I should make the same change to the function in qutip-v5 . https://github.com/qutip/qutip/blob/fcb4117c25e22fe2f553a3bd6d0eda6458f6ff12/qutip/core/tensor.py#L416

I would say yes. Ideally the two functions should remain the same.

@BoxiLi
Copy link
Member Author

BoxiLi commented Apr 2, 2024

@Ericgig Does the change look good to you? I'll make the same PR to the main qutip

@Ericgig
Copy link
Member

Ericgig commented Apr 2, 2024

I am fine with setting csr as the default type to expand_operator.

Transform the qobj to CSR only if it is Dense, incase more data types are introduced in the future.
@BoxiLi BoxiLi merged commit 045eaab into qutip:master Apr 3, 2024
11 of 12 checks passed
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Apr 20, 2024
Use CSR as default for expand_operator
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.

None yet

3 participants