-
Notifications
You must be signed in to change notification settings - Fork 61
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
Allowing circuit execution using float32
and float64
dtypes
#1625
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1625 +/- ##
=======================================
Coverage 99.11% 99.11%
=======================================
Files 77 77
Lines 11475 11486 +11
=======================================
+ Hits 11373 11384 +11
Misses 102 102
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@scarrazza do we have any intention of supporting data types like |
I would say not, but did you try somenof those with the code in this PR? |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Run on QPU
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @renatomello. This looks good to me and it's great to be able to simulate circuits using real dtypes whenever this is possible.
I just noticed the following issue: the following
import qibo
from qibo import Circuit, gates, matrices
c = Circuit(1)
c.add(gates.X(0))
qibo.set_backend("numpy")
qibo.set_dtype("float32")
state = c().state()
print(state.dtype)
gives float32
as expected, however if I switch the setting of backend and precision to
qibo.set_dtype("float32")
qibo.set_backend("numpy")
it goes back to the default complex128
. Is this the behavior we want?
I would say so, yes. |
Closes #1515 and #1626 . This has implications for
qiboml
andqibochem
since it allows memory reduction for circuits that only contain gates with real-valued matrix representations.Also fixes some tests on GPU.
Needs qiboteam/qibojit#219
Checklist: