-
Notifications
You must be signed in to change notification settings - Fork 32
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
Improve separate_circuit
docstring
#267
Conversation
I've also added `circuit_knitting/` to the paths passed to pytest, as this is required for doctests to be discovered.
>>> _ = qc.x(0) | ||
>>> _ = qc.cx(1, 2) | ||
>>> _ = qc.h(3) |
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.
Without the _ =
, one gets extra output from the non-None
expressions:
>>> from qiskit import QuantumCircuit
>>> qc = QuantumCircuit(4)
>>> qc.x(0)
<qiskit.circuit.instructionset.InstructionSet object at 0x7f710e9921c0>
>>> qc.cx(1, 2)
<qiskit.circuit.instructionset.InstructionSet object at 0x7f70da3873a0>
>>> qc.h(3)
<qiskit.circuit.instructionset.InstructionSet object at 0x7f70da3872b0>
and doctest fails unless these are also added here. Of course, the memory address is not predictable, so there is no way to allow such a thing to be output and still have the tests pass.
Pull Request Test Coverage Report for Build 5295854068
💛 - 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.
This file had to be modified for doctest discovery to work on Python 3.11 (i.e., when DOcplex is not present).
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.
Awesome, much needed, thanks. Thanks for adding it to api docs as well. I approved with one minor language suggestion
Co-authored-by: Caleb Johnson <[email protected]>
I've also added
circuit_knitting/
to the paths passed to pytest, as this is required for doctests to be discovered.