-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Suppress Opflow deprecation warnings in test_qpy.py #9998
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5152883879
💛 - 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.
These deprecation warnings are fine, though would it be a good idea for us to start including the tests of what will be the new form of the functionality as well? I don't know if we have coverage of that, yet.
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.
Sorry @t-imamichi that you have to clean up again after the opflow deprecation PR. As I explain in the specific comments, I think that we could already get rid of the opflow dependency in this test in particular.
Co-authored-by: Elena Peña Tapia <[email protected]>
Thank you for your suggestions. I applied them. |
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!
test/qpy_compat/test_qpy.py
Outdated
def generate_string_parameters(): | ||
"""Generate a circuit from pauli tensor opflow.""" | ||
op_circuit = (X ^ Y ^ Z).to_circuit_op().to_circuit() | ||
op_circuit.name = "X^Y^Z" | ||
"""Generate a circuit for the XYZ pauli string.""" | ||
op_circuit = QuantumCircuit(3, name="X^Y^Z") | ||
op_circuit.z(0) | ||
op_circuit.y(1) | ||
op_circuit.x(2) | ||
return op_circuit |
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.
I think this change is actually breaking the intended test; in the original, there's a PauliGate
in the circuit, which has a .params
field that contains a string. The new form doesn't have that; it's just got a string in the op_circuit
name, which is the standard.
We could probably hew to the intent of the test with something like
from qiskit.circuit.library import PauliGate
op_circuit = QuantumCircuit(3)
op_circuit.append(PauliGate("XYZ"), op_circuit.qubits, [])
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. I use PauliGate 97f5a84.
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 changes, this should make the tests a little less noisy now.
Summary
Removes opflow in test_qpy.py due to #9176
https://dev.azure.com/qiskit-ci/qiskit-terra/_build/results?buildId=45729&view=logs&j=e4ea27c2-3a16-5b32-7be8-0bf30fe9e828&t=b4382375-beb9-5aee-c896-08d1279c743b
Details and comments