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

Use comma when printing the wires of qml.Hermitian in qml.Hamiltonian #1465

Merged
merged 4 commits into from
Jul 22, 2021

Conversation

antalszava
Copy link
Contributor

@antalszava antalszava commented Jul 21, 2021

Context

When printing the observables building up qml.Hamiltonian, coefficients and terms are printed following the OpenFermion convention. OpenFermion doesn't represent aribtrary Hermitian observables, therefore we're using a custom notation for qml.Hermitian (#987):

  (0.8) [Z0]
+ (0.8) [Z0 Hermitian1'3 Z2]

Changes
Changes the separator between the wires of qml.Hermitian to be a comma:

  (0.8) [Z0]
+ (0.8) [Z0 Hermitian1,3 Z2]

Related issues
Closes #1068

@github-actions
Copy link
Contributor

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.

@antalszava antalszava marked this pull request as ready for review July 21, 2021 09:15
@codecov
Copy link

codecov bot commented Jul 21, 2021

Codecov Report

Merging #1465 (f6f96d0) into master (148d9cc) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1465   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         169      169           
  Lines       12360    12360           
=======================================
  Hits        12149    12149           
  Misses        211      211           
Impacted Files Coverage Δ
pennylane/vqe/vqe.py 92.19% <0.00%> (ø)

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 148d9cc...f6f96d0. Read the comment docs.

@antalszava antalszava requested a review from albi3ro July 21, 2021 09:17
Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

Seem like more people want the commas. Thanks for fixing this up.

@antalszava antalszava merged commit c9b78a5 into master Jul 22, 2021
@antalszava antalszava deleted the hermitian_comma_separator branch July 22, 2021 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyError when printing Hamiltonian with a Hermitian term
2 participants