-
Notifications
You must be signed in to change notification settings - Fork 64
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
Conversation
Pull Request Test Coverage Report for Build 7670087889
💛 - Coveralls |
There was a problem hiding this 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): |
There was a problem hiding this comment.
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.
#138 (linked above) will fix the copyright issue of other files that this is now failing on. |
Co-authored-by: Steve Wood <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this 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.
Summary
Closes #127
Details and comments
This PR adds an argument
insert_barriers
toTrotterQRTE
. If set toTrue
, barriers are added to the Trotter circuit returned byTrotterQRTE.evolve()
after the initial state and after each Trotter layer.