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

Fix issue with tf slicing #345

Merged
merged 4 commits into from
Mar 7, 2021
Merged

Fix issue with tf slicing #345

merged 4 commits into from
Mar 7, 2021

Conversation

stavros11
Copy link
Member

Fixes #342. In principle this is a tf issue as the existing code in master still works with numpy, I just changed the slicing to K.gather so that it works with Tensorflow too.

I think the problem of #342 should now be fixed but I would like to do a few more tests with more qubits because based on some other similar tf issues we fixed recently I suspect the tf einsum may fail in some cases. I am not 100% certain though.

@stavros11 stavros11 requested a review from scarrazza March 7, 2021 10:52
@codecov
Copy link

codecov bot commented Mar 7, 2021

Codecov Report

Merging #345 (2fa721d) into master (ec268f6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #345   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           76        76           
  Lines        12375     12387   +12     
=========================================
+ Hits         12375     12387   +12     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/qibo/tests_new/test_backends_agreement.py 100.00% <ø> (ø)
src/qibo/backends/abstract.py 100.00% <100.00%> (ø)
src/qibo/backends/numpy.py 100.00% <100.00%> (ø)
src/qibo/core/gates.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec268f6...2fa721d. Read the comment docs.

@stavros11
Copy link
Member Author

I did a few tests with various controlled by configurations for up to 14 qubits and I did not observe any crashes after this fix, so I believe the einsum issue does not appear here. If you agree we can probably merge this and release, as there aren't any other bug related issues for now.

Copy link
Member

@scarrazza scarrazza left a comment

Choose a reason for hiding this comment

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

@stavros11, thanks for this fix and checks, looks good.

@scarrazza scarrazza merged commit 7cdb5cc into master Mar 7, 2021
@delete-merged-branch delete-merged-branch bot deleted the tfdmfix branch March 7, 2021 15:11
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.

Controlled by gates with density matrices
2 participants