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 dtype of CZ matrix #503

Merged
merged 3 commits into from
Nov 7, 2021
Merged

Fix dtype of CZ matrix #503

merged 3 commits into from
Nov 7, 2021

Conversation

mlazzarin
Copy link
Contributor

I may have found an unwanted behavior. The dtype of CZ matrix in src/qibo/backends/matrices.py is int64 but I think it should be equal to the dtype property of qibo.backends.matrices.Matrices class.

@mlazzarin mlazzarin added the bug Something isn't working label Nov 6, 2021
Copy link
Member

@stavros11 stavros11 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 finding this. Looking at the implementation of self.backend.cast for the numpy and other backends, I believe that the final array, here self._CZ will have the backend complex type regardless of the type of the original array m, right? If this is true the self.dtype used in all matrix definitions here is essentially useless.

I am not sure why the macos tests fail though.

@mlazzarin mlazzarin changed the base branch from master to rmbackends November 7, 2021 09:33
@codecov
Copy link

codecov bot commented Nov 7, 2021

Codecov Report

Merging #503 (0e062f0) into rmbackends (f5f0e9f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           rmbackends     #503   +/-   ##
===========================================
  Coverage       99.99%   99.99%           
===========================================
  Files              84       84           
  Lines           11853    11854    +1     
===========================================
+ Hits            11852    11853    +1     
  Misses              1        1           
Flag Coverage Δ
unittests 99.99% <100.00%> (ø)

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

Impacted Files Coverage Δ
src/qibo/backends/matrices.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 f5f0e9f...0e062f0. Read the comment docs.

@mlazzarin mlazzarin changed the base branch from rmbackends to multiqubit November 7, 2021 18:46
@mlazzarin
Copy link
Contributor Author

Given that we merged #500, I changed the base branch to multiqubit. Shall we merge this?

@scarrazza
Copy link
Member

@mlazzarin, yes, sure. I was planning to merge directly to master, but we can instead merge this in multiqubit.

@scarrazza scarrazza merged commit d9cf4d2 into multiqubit Nov 7, 2021
@scarrazza scarrazza deleted the fixcz branch November 7, 2021 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants