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

Make kraus_to_choi faster by using numpy #2283

Merged
merged 6 commits into from Jan 11, 2024

Conversation

theodotk
Copy link
Contributor

@theodotk theodotk commented Jan 5, 2024

np.tensordot is faster than a triple loop. On my applications the function became up to 100 times faster.

Also, the way to handle dims of the Choi matrix was incorrect (or I misunderstood something). It is explained in the comments.

This was coded in collab with Rafael Haenel.

Also, please, could you make a release of the qutip 4 with all the new changes after this PR passes?

Copy link
Member

@Ericgig Ericgig left a comment

Choose a reason for hiding this comment

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

Thank for for the optimization.

The test failure for 3.6 is due to np.asarray(Qobj) failing with old version of numpy.
We don't want to remove support for older version of python and numpy for v4.
Could you fix it by using Qobj.full as you did in the v5 version.

Other than that, it's looking good.

Other tests failure are not related to your changes.

@Ericgig Ericgig merged commit 7a883d3 into qutip:qutip-4.7.X Jan 11, 2024
10 of 12 checks passed
@theodotk
Copy link
Contributor Author

Thanks for merging!
Is it possible to make a release of qutip 4? Or, if you have a set release calendar, when to expect it?

@Ericgig
Copy link
Member

Ericgig commented Jan 18, 2024

Hi @theodotk, the 4.7.4 release is in progress.

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

2 participants