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 issue #1266: 'convert_observable' function raises an error for QubitOperators containing complex coefficients #1277

Merged
merged 10 commits into from
May 6, 2021

Conversation

agran2018
Copy link
Contributor

Context:
This PR address the issue #1266. Now, an error message is raised if a QubitOperator containing complex coefficients is passed
to the convert_observable function. Currently, the vqe.Hamiltonian class does not support complex coefficients.

Description of the Change:
The convert_observable checks that all coefficients in the QubitOperator are real.

@agran2018 agran2018 added review-ready 👌 PRs which are ready for review by someone from the core team. qchem ⚛️ Related to the QChem package labels May 5, 2021
@agran2018 agran2018 requested review from josh146 and zeyueN May 5, 2021 18:31
@agran2018 agran2018 self-assigned this May 5, 2021
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2021

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #1277 (9ff3575) into master (a8a24da) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1277   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files         147      147           
  Lines       11277    11279    +2     
=======================================
+ Hits        11067    11069    +2     
  Misses        210      210           
Impacted Files Coverage Δ
qchem/pennylane_qchem/qchem/structure.py 97.24% <100.00%> (+0.02%) ⬆️

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 a8a24da...9ff3575. Read the comment docs.

qml.Identity(wires=[0]) @ qml.Identity(wires=[1]),
qml.Identity(wires=[0]) @ qml.PauliZ(wires=[1]),
qml.PauliZ(wires=[0]) @ qml.Identity(wires=[1]),
]

Copy link
Contributor Author

@agran2018 agran2018 May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes from this point on seem to be related to "black"

Copy link
Contributor

@zeyueN zeyueN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Suggested a minor change.

qchem/pennylane_qchem/qchem/structure.py Outdated Show resolved Hide resolved
@mariaschuld
Copy link
Contributor

@agran2018 Thanks so much for fixing this! Would be great if we could merge today!

@agran2018 agran2018 merged commit a839fcf into master May 6, 2021
@agran2018 agran2018 deleted the fix-issue-convert-observable branch May 6, 2021 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qchem ⚛️ Related to the QChem package review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants