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

added insert_barrier to TrotterQRTE #128

Merged
merged 15 commits into from
Jan 26, 2024

Conversation

Durd3nT
Copy link
Contributor

@Durd3nT Durd3nT commented Jan 18, 2024

Summary

Closes #127

Details and comments

This PR adds an argument insert_barriers to TrotterQRTE. If set to True, barriers are added to the Trotter circuit returned by TrotterQRTE.evolve() after the initial state and after each Trotter layer.

@CLAassistant
Copy link

CLAassistant commented Jan 18, 2024

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Jan 18, 2024

Pull Request Test Coverage Report for Build 7670087889

  • 0 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 90.666%

Totals Coverage Status
Change from base Build 7667982387: 0.006%
Covered Lines: 6489
Relevant Lines: 7157

💛 - Coveralls

Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, I think the change looks good, all we need now is a unit test and a release note that explains the new feature.

For the unit test, I would add a super simple example (1q, for example) where you build manually the expected circuit and you compare it with the output of the TrotterQRTE class. For the release note, you can run reno new name-of-the-reno to create a file and then check for examples in the releasenotes folder to write the content.

@@ -211,6 +211,30 @@ def test_trotter_qrte_trotter_hamiltonian_errors(self, operator, initial_state):
"""Test TrotterQRTE with raising errors for evolution problem content."""
self._run_error_test(initial_state, operator, None, None, None, None)

def test_barriers(self):
Copy link
Member

@woodsp-ibm woodsp-ibm Jan 19, 2024

Choose a reason for hiding this comment

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

Could you parameterize this test using @ddt - you can see other tests here as examples if needed - so that passing in False and True as data values it can test both aspects so we can make sure when no barriers are asked for that indeed does happen too.

@woodsp-ibm
Copy link
Member

#138 (linked above) will fix the copyright issue of other files that this is now failing on.

Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@woodsp-ibm woodsp-ibm left a comment

Choose a reason for hiding this comment

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

@Durd3nT Thanks for the contribution and making the suggested changes.

@mergify mergify bot merged commit eb8f8fc into qiskit-community:main Jan 26, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TrotterQRTE should have an argument insert_barriers
5 participants