-
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
SymbolicHamiltonian
refactor
#1548
base: master
Are you sure you want to change the base?
Conversation
SymbolicHamiltonian
terms
and dense
settersSymbolicHamiltonian
refactor
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1548 +/- ##
==========================================
- Coverage 99.67% 99.31% -0.37%
==========================================
Files 76 76
Lines 11234 11168 -66
==========================================
- Hits 11198 11092 -106
- Misses 36 76 +40
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I am still unsure whether it is worth keeping the two different ways for computing the dense form of the {
"2q": 36,
"3q": 81,
"4q": 144,
"5q": 225,
"6q": 324,
"7q": 441,
"8q": 576,
"9q": 729,
"10q": 900,
"11q": 1089
} the average runtimes across 10 runs are as follows: time vs nqubits time vs nterms the Long story short, if I had to pick only one of the two I'd probably lean towards the |
This should address #1494
EDIT: this turned out to be more in general a refactor of
SymbolicHamiltonian
and partly ofhamiltonian/models.py
. Namely,SymbolicHamiltonian
now only has aform
attribute,dense
andterms
are cached properties computed starting fromform
and, thus, they can no longer be manually setted. Concerninghamiltonian/models.py
, now the models are built starting from theform
and not theterms
as it was before. I also made the dense representation of the models more backend aware, replacing thenumpy
operations with the backend ones.Note: tests on
cupy
are still failing due to this qiboteam/qibojit#196 .Checklist: