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

Add general Heisenberg Hamiltonian and XXX model #1538

Merged
merged 16 commits into from
Dec 10, 2024
Merged

Conversation

renatomello
Copy link
Contributor

@renatomello renatomello commented Dec 7, 2024

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

@renatomello renatomello added this to the Qibo 0.2.15 milestone Dec 7, 2024
@renatomello renatomello added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 7, 2024
@renatomello renatomello self-assigned this Dec 7, 2024
Copy link

codecov bot commented Dec 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.68%. Comparing base (9e00ebd) to head (707a106).
Report is 17 commits behind head on master.

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           
Flag Coverage Δ
unittests 99.68% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renatomello renatomello changed the title Add general Heisenberg Hamiltonian Add general Heisenberg Hamiltonian and XXX model Dec 8, 2024
Copy link
Contributor

@andrea-pasquale andrea-pasquale left a 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.

Comment on lines +294 to +299
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)}.",
)
Copy link
Contributor

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.

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.",
)

@renatomello renatomello added this pull request to the merge queue Dec 10, 2024
Merged via the queue into master with commit 1afd96d Dec 10, 2024
27 checks passed
@renatomello renatomello deleted the Heisenberg branch December 10, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants