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

Improve separate_circuit docstring #267

Merged
merged 4 commits into from
Jun 20, 2023
Merged

Conversation

garrison
Copy link
Member

I've also added circuit_knitting/ to the paths passed to pytest, as this is required for doctests to be discovered.

I've also added `circuit_knitting/` to the paths passed to pytest,
as this is required for doctests to be discovered.
@garrison garrison added documentation Improvements or additions to documentation cutting QPD-based circuit cutting code labels Jun 17, 2023
@garrison garrison requested a review from caleb-johnson June 17, 2023 02:20
Comment on lines +73 to +75
>>> _ = qc.x(0)
>>> _ = qc.cx(1, 2)
>>> _ = qc.h(3)
Copy link
Member Author

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.

@github-actions
Copy link

Pull Request Test Coverage Report for Build 5295854068

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

Totals Coverage Status
Change from base Build 5295429418: 0.0%
Covered Lines: 2327
Relevant Lines: 2596

💛 - Coveralls

Copy link
Member Author

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).

caleb-johnson
caleb-johnson previously approved these changes Jun 18, 2023
Copy link
Collaborator

@caleb-johnson caleb-johnson left a 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

circuit_knitting/utils/transforms.py Outdated Show resolved Hide resolved
@garrison garrison merged commit effbd38 into main Jun 20, 2023
@garrison garrison deleted the improve-separate_circuit-docstring branch June 20, 2023 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cutting QPD-based circuit cutting code documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants