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

Give PauliEvolutionGates the same name-attribute for all instances #7638

Merged
merged 5 commits into from
Mar 19, 2022

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Feb 9, 2022

Summary

Update the PauliEvolutionGate such that the name attribute is always "PauliEvolution". The information on how the gate should be drawn is moved to label (unless the user overrides the label).

Details and comments

This allows unrolling a circuit to PauliEvolutionGates as

unrolled = Unroller(["PauliEvolution", "u", "cx"])(circuit)

Also, this PR includes a small update to how Pauli evolutions are drawn by adding brackets around sum of operators. For example, before the evolution of ZZ + IX was drawn as

             ┌───────────────────────┐
        q_0: ┤0                      ├
             │  exp(-i ZZ + XI)(0.2) │
        q_1: ┤1                      ├
             └───────────────────────┘

and now contains brackets (and -i is changed to -it to indicate a time parameter)

             ┌──────────────────────────┐
        q_0: ┤0                         ├
             │  exp(-it (ZZ + XI))(0.2) │
        q_1: ┤1                         ├
             └──────────────────────────┘

@Cryoris Cryoris requested a review from a team as a code owner February 9, 2022 10:17
@coveralls
Copy link

coveralls commented Feb 9, 2022

Pull Request Test Coverage Report for Build 2007465703

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 83.506%

Totals Coverage Status
Change from base Build 2007464696: 0%
Covered Lines: 52472
Relevant Lines: 62836

💛 - Coveralls

@kdk kdk added Changelog: API Change Include in the "Changed" section of the changelog automerge labels Mar 18, 2022
@kdk kdk added this to the 0.20 milestone Mar 18, 2022
@mergify mergify bot merged commit 36b0e2c into Qiskit:main Mar 19, 2022
@Cryoris Cryoris deleted the paulievo-classname branch March 21, 2022 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: API Change Include in the "Changed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants