-
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
Add general Heisenberg
Hamiltonian and XXX
model
#1538
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1538 +/- ##
=======================================
Coverage 99.68% 99.68%
=======================================
Files 80 80
Lines 11586 11606 +20
=======================================
+ Hits 11550 11570 +20
Misses 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Heisenberg
Hamiltonian and XXX
model
for more information, see https://pre-commit.ci
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, I've just a small suggestion.
if not isinstance(coupling_constant, (float, int)): | ||
raise_error( | ||
TypeError, | ||
"`coupling_constant` must be type float or int, " | ||
+ f"but it is type {type(coupling_constant)}.", | ||
) |
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.
Perhaps we could drop this given that a similar check is performed in the Heiseinberg
function.
qibo/src/qibo/hamiltonians/models.py
Lines 183 to 187 in 707a106
if isinstance(coupling_constants, (list, tuple)) and len(coupling_constants) != 3: | |
raise_error( | |
ValueError, | |
f"When `coupling_constants` is type `int` or `list`, it must have length == 3.", | |
) |
Checklist: